One of the core features of the Moneypot casino API is that you can transfer currency between holders (users and controllers).
Transfers can move between these states:
COMPLETED
: (Terminal) The transfer is settled and money was moved between two holder accounts.PENDING
: (Initial) The transfer hasn't moved any money yet until the sender calls completeTransfer(id)
.UNCLAIMED
: (Initial) An expirable transfer. Funds have been deducted from the sender, but the sender must call claimTransfer(id)
before expiration or user cancels the transfer.EXPIRED
: (Terminal) An UNCLAIMED
transfer that wasn't claimed in time by receiver. Funds have been returned to sender.CANCELED
: (Terminal) An UNCLAIMED
or PENDING
transfer where the sender called cancelTransfer(id)
.Loading diagram...
When a user wants to play an experience, they use the transferCurrencyToExperience
mutation which starts a transfer to the experience's underlying controller.
Here is the process:
UNCLAIMED
transfer is created with a very short expiration (one minute)Then one of these things can happen:
cancelTransfer(id)
and the transfer state becomes CANCELED
EXPIRED
claimTransfer(id)
, their balance gets credited, and the transfer state becomes COMPLETED
The controller is responsible for polling the Casino API to watch for incoming UNCLAIMED
transfers.