collect Fees
Signature
Params
export interface CollectFeeOptions extends Pick<Pool.MintParams, 'pool' | 'txb' | 'address' | 'deadline'> {
/**
* Position NFT ID
*/
nft: string;
collectAmountA: string | number;
collectAmountB: string | number;
}Examples
const turbosSdk = new TurbosSdk(Network.testnet, {
url: 'https://fullnode.testnet.sui.io',
});
//const signer = turbosSdk.account.getKeypairFromMnemonics("your mnemonic");
const signer = services.turbosBaseService.signer;
const poolId = '0xb32fb8ec0b447a833066496bd7251d3a2ee57a0a97c54bf4cc945a986235582a';
const positionId =
'0xb7efa54832e000dcb8879e586f74cec55623105920c96f5f1ebe78a60f9cbd3b';
const txb = await turbosSdk.pool.collectFee({
pool: poolId,
nft: positionId,
collectAmountA: MAX_UINT_64.toString(),
collectAmountB: MAX_UINT_64.toString(),
address: signer.toSuiAddress(),
});
const result = await turbosSdk.provider.devInspectTransactionBlock({
transactionBlock: txb,
sender: signer.toSuiAddress(),
});
const collectEvent = result.events.filter((event) =>
event.type.endsWith('::pool::CollectEvent'),
);
const amountA = collectEvent[0]!.parsedJson!.amount_a!;
const amountB = collectEvent[0]!.parsedJson!.amount_b!;
console.log(amountA, amountB);Last updated