Token Transfer Between Users 2 | XRPL Development in JavaScript Level 1
In the previous chapter, we successfully enabled the Rippling feature for Charlie’s account, the issuer of the DOJ
tokens.
In XRPL, transferring tokens between users other than the issuer is usually not permitted, but if the Rippling
feature is enabled in the issuer’s account, users (Alice and Bob) should be able to transfer tokens to each other.
※ It is not that Alice and Bob are directly interacting with each other, but rather adjusting balances through Charlie.
Prerequisites
This guide proceeds with the following characters:
- Charlie (Token Issuer)
- Alice (Token Recipient 1) ※ Currently holds 1000 DOJ
- Bob (Token Recipient 2)
Create the Script
The following is a script to send tokens from Alice to Bob.
-
Reuse the previously created
payment_token_ab.js
file in your project directory. -
Ensure the code is as follows.
- Enter Alice’s testnet secret key in
alice_wallet_secret_here
. - Enter Bob’s testnet address in
bob_wallet_address_here
. - Enter Charlie’s testnet address in
charlie_wallet_address_here
.
- Enter Alice’s testnet secret key in
Run the Script
-
Run the following command in the command line to execute the script.
-
Check result in the console .
Again, the transfer failed. Why?
In such cases, there may be issues with the account settings, so let’s check the status of the trust line using the wallet address of the issuer, Charlie.