This is a collection of node scripts that uses tinyman-js-sdk v2 operations.
operationfolder includes scripts that perform operations on the pool. If you only want to see a specific operation example, you can check the files in this folder.utilfolder includes helper functions or constant variables that are used in the test scriptsindex.tsincludes amainfunction that runs all of the operations in order;- Create an account and two assets (for testing purposes)
- (Bootstrap) Create the pool with owned assets
- (Add Liquidity) Adds liquidity to the pool
- (Remove Liquidity) Take out some of the owned liquidity from the pool
- (Swap) Swap one of the assets for the other
For easier testing, on the first run, main function creates an account and two assets (for testing purposes). The account will initiator of the operations, and the asset pair will be used for creating the pool.
-
First, install the dependencies
npm install
-
Then run the script:
npm run start