Retrieve ticks
1. Batch retrieve ticks by pool ID
Method: sdk.Pool.fetchTicks()
Params:
poolID
: The pool object ID.coinTypeA
: Coin A type.coinTypeB
: Coin B type.
Example
async function betchRetrievalTicksByPoolID() {
const tickdatas = await TestnetSDK.Pool.fetchTicks({
pool_id: '0x11f63063e721a99da6b33df2de0749f564c31d709b3c8689cf20dffcb983232f',
coinTypeA: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
coinTypeB: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',
})
console.log('fetchTicks: ', tickdatas)
}
2. Batch retrieve ticks by tickHandle
Method: sdk.Pool.fetchTicksByRpc()
Params:
tickHandle
: The tick handle of pool.
Example
async function betchFetchTicksByRpc() {
const pool = await TestnetSDK.Pool.getPool('0x0128aade80123e3f6c5c0eac1a2dee2512bbdc92c9c1b386b0fd66e6cddfaa72')
const tickdatas = await TestnetSDK.Pool.fetchTicksByRpc(pool.ticks_handle)
console.log('tick data:', tickdatas)
}
Last updated