XRP Tokens
Instantiate Cryptum SDK first:
Transfer tokens
Transfer tokens in XRPL blockchain.
sdk.token.transfer(opts)
opts.protocol
(string)(required) - blockchain protocol must beRIPPLE
.opts.wallet
(Wallet)(required) - wallet to sign the transaction with.opts.token
(string)(required) - token symbol to transfer orXRP
if you're transferring the native token.opts.issuer
(string)(optional) - token issuer account. Required only if you're not transferring the native token.opts.amount
(string)(required) - token amount to be transferred.opts.destination
(string)(required) - destination address.opts.memo
(string)(optional) - memo string.
This function returns the transaction hash.
Establish trustline in Ripple
sdk.token.setTrustline(opts)
Create a trustline transaction in XRPL blockchain. It is used to create or delete tokens (trustline).
opts.protocol
(Wallet)(required) - blockchain protocol must beRIPPLE
.opts.wallet
(Wallet)(required) - wallet to sign the transaction with.opts.symbol
(string)(required) - asset to transfer.opts.issuer
(string) - required if you are transferring a custom asset so this is the issuer account, otherwise leave undefined.opts.limit
(string)(required) - limit for the trustline. To create the trustline this limit should be bigger than 0 and to delete the trustline it should be 0.opts.memo
(string)(optional) - message to be attached with this transaction, otherwise leave it undefined.
This function returns the hash of the transaction.
Example:
Last updated