Payment Functions

How to use Payment model using mitumjs SDK.

(Supported from SDK version 2.1.14 and above)

  1. Create a contract account using contract.createWallet(), then sign and send the operation.

  2. Register a payment model with registerModel(), then sign and send the operation.

  3. Check model registration using getModelInfo().

  4. 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.

  5. Sign and send the deposit operation to Mitum network.

  6. Check the deposited amount and transfer condition through getData().

  7. The deposited currency can be transfered with the transfer operation, which is generated by the transfer() method.

  8. Sign and send the transfer operation to Mitum network. The transfer will be successful only if the previously set conditions are met.

  9. 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