Now we will create an AMM Pool to provide some liquidity for our new token.
Create an AMM Pool
Now that the receiver has tokens, we can use the receiver's account to create an AMM. Note that this is the usual architecture where the issuer account solely issues the token, and other proprietary accounts hold the token and can create liquidity.
For this example, we will use pools that have XRP as one side.
Putting it all together, the final main function and index.ts should now look like this:
Don't forget to import enableRippling, createToken, createAMM and convertStringToHexPadded if needed.
You can now go to the training website at https://amm.xrpl.at/ and interact with other pools.
You will need to set up Xaman with the receiver account you created above. You can use the family seed import route. If you are new to Xaman don't forget to enable developer mode in the advanced settings and then switch to testnet from the home page of the Xaman app.
Interact with your pool (swap)
Using the training app, connect and add your public address to the list. When you click a user in the list you can see that account's token holdings.
You can create Trustlines for tokens you have not interacted with yet. You can swap XRP for other tokens where you have trustlines using the pool view's swap feature.
You may need to mint more XRP for your receiver account. That's where the print money function might come in handy.