The chain rail: money that arrives at an address the store watches.
Correlation is by address — charging opens one, the invoice records it, and
settlement is read back from the wallet for that address. A settlement notice
is only ever a prompt to re-read; its body is never evidence. That is what
makes this rail safe over a gateway that signs nothing, and it is why the
profile declares :server-confirmed.
Any IChainWallet drives it: a monero-wallet-rpc the store runs, a MoneroPay
instance watching on its behalf, or the fake. The rail cannot tell, which is
the point.
The chain rail: money that arrives at an address the store watches. Correlation is by address — charging opens one, the invoice records it, and settlement is read back from the wallet for that address. A settlement notice is only ever a prompt to re-read; its body is never evidence. That is what makes this rail safe over a gateway that signs nothing, and it is why the profile declares `:server-confirmed`. Any `IChainWallet` drives it: a monero-wallet-rpc the store runs, a MoneroPay instance watching on its behalf, or the fake. The rail cannot tell, which is the point.
(->rail {:keys [wallet provider-id callback-secret] :or {provider-id :monero}})Build a chain rail over an IChainWallet.
:wallet is the port. :provider-id names this rail in the registry, so a
store can run a self-hosted wallet and a watching gateway side by side.
:callback-secret, when set, is the HMAC key for the token in the callback
URL.
Build a chain rail over an IChainWallet. `:wallet` is the port. `:provider-id` names this rail in the registry, so a store can run a self-hosted wallet and a watching gateway side by side. `:callback-secret`, when set, is the HMAC key for the token in the callback URL.
Ten confirmations, no underpayment tolerated, settlement by polling.
Ten is the depth at which a Monero reorg stops being a practical concern; a deployment that sells something cheap and revocable may lower it, and one that ships a licence key should not.
Ten confirmations, no underpayment tolerated, settlement by polling. Ten is the depth at which a Monero reorg stops being a practical concern; a deployment that sells something cheap and revocable may lower it, and one that ships a licence key should not.
(entry config)A registry entry {:profile :rail} for a chain rail.
config is ->rail's, plus any profile key to override — a deployment that
wants six confirmations passes :provider/min-confirmations 6 and nothing
else changes.
A registry entry {:profile :rail} for a chain rail.
`config` is `->rail`'s, plus any profile key to override — a deployment that
wants six confirmations passes `:provider/min-confirmations 6` and nothing
else changes.(settlement-of provider-id observation expected-amount)Normalize a WalletObservation into a Settlement for provider-id. Pure.
expected-amount is the invoice's authoritative amount in atomic units.
Transfers flagged as double spends contribute neither funds nor
confirmations, and are reported as :settlement/suspect?. The payment is
:settled once every contributing transfer is unlocked.
When the wallet reports its own unlocked total, the smaller of the two wins.
Normalize a WalletObservation into a Settlement for `provider-id`. Pure. `expected-amount` is the invoice's authoritative amount in atomic units. Transfers flagged as double spends contribute neither funds nor confirmations, and are reported as `:settlement/suspect?`. The payment is `:settled` once every contributing transfer is unlocked. When the wallet reports its own unlocked total, the smaller of the two wins.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |