βοΈexecuteSwap
Last updated
npm install @nest25/xy-finance-lib
OR
yarn add @nest25/xy-finance-lib// import Nest SDK library
const { xySwap } = require('@nest25/xy-finance-lib');
// create xySwap instance
const swap = new xySwap();
async function main() {
// execute swap
const response = await swap.executeSwap(
'your-private-key',
'klaytn',
'klaytn',
'0xCF87f94fD8F6B6f0b479771F10dF672f99eADa63',
'0x5c74070FDeA071359b86082bd9f9b3dEaafbe32b',
'0.1',
'0x9f658964c3658257545b13483e2c9a59b6faa98a',
1,
);
console.log(`Contract hash is: ${response.hash}`);
}
// run main function
main();
Contract hash is: 0x08a2be0e4c0019c34f9705b07cb4f5991d7c8710964b0baca32fd378281ea1a8