Sending Tokens from the Issuer | XRPL Development in JavaScript Level 1
With XRPL, once a trust line is set up between accounts and users, tokens can be transferred instantly.
In the previous chapter, Alice obtained the right to receive about 10,000 DOJ
tokens issued by Charlie. Now, let’s send 1,000 DOJ
from Charlie to Alice.
Prerequisites
This guide proceeds with the following characters:
- Charlie (Token Issuer)
- Alice (Token Recipient)
Create the Script
The following is a script to send tokens from Charlie to Alice.
-
Create a new file named
payment_token.js
in your project directory. -
Paste the following code into
payment_token.js
.- Enter Charlie’s testnet secret key in
charlie_wallet_secret_here
. - Enter Alice’s testnet address in
alice_wallet_address_here
.
- Enter Charlie’s testnet secret key in
Run the Script
-
Run the following command in the command line to execute the script.
-
If successful, the console will display the following.
Now, using Alice’s account address information, check the results in Explorer. If successful, you will see that Alice has received
1,000 DOJ
.In this way, XRPL allows tokens to be issued in a very smart and secure way using the trust line functionality.