Payment Functions
How to use Payment model using mitumjs SDK.
(Supported from SDK version 2.1.14 and above)
Create a contract account using
contract.createWallet()
, then sign and send the operation.Register a payment model with
registerModel()
, then sign and send the operation.Check model registration using
getModelInfo()
.Any user can deposit currency using the deposit operation, which is generated by the
deposit()
method. When making a deposit, the user also sets the conditions that will apply when a transfer occurs in the future.Sign and send the deposit operation to Mitum network.
Check the deposited amount and transfer condition through
getData()
.The deposited currency can be transfered with the transfer operation, which is generated by the
transfer()
method.Sign and send the transfer operation to Mitum network. The transfer will be successful only if the previously set conditions are met.
Users can withdraw the remaining deposit of certain currency at once and delete registered information through the withdraw operation. Generate the operation with
withdraw()
method, then sign and send to the network.
Last updated