Retrieve bins
Functioin
async fetchBins({
pair: string
coinTypeA: string
coinTypeB: string
offset: number
limit: number
}: FetchBinsParams): Promise<EventBin[]>
Parameters
pair
: pool object idcoinTypeA
: the coin type address about coinA.coinTypeB
: the coin type address about coinB.offset
: the start index of the returned bins.limit
: the max number of the returned bins.
Please refer to the original function for specific parameter types.
Example
const bins = await magmaSDK.Almm.fetchBins({
pair: "0x540e56df0e57ac0d779a64d1f9f01fe9ac03d4758623105e05b4f9facc5d0f61",
coinTypeA:
"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
coinTypeB:
"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",
offset: 0,
limit: 500,
});
console.log("Bins:", bins);
Last updated