This is a collection of node scripts that uses tinyman-js-sdk v2 operations.
operation
folder 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.util
folder includes helper functions or constant variables that are used in the test scriptsindex.ts
includes amain
function 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