Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPositionsByUserAndLbPair throwing TypeError: clockAccInfo.data.readBigInt64LE is not a function #61

Open
Gitmazter opened this issue Apr 27, 2024 · 0 comments

Comments

@Gitmazter
Copy link

Hi, been trying to fetch user positions for a DLMM pool and keep getting the following error:

Uncaught (in promise) TypeError: clockAccInfo.data.readBigInt64LE is not a function at DLMM.getPositionsByUserAndLbPair (@meteora-ag_dlmm.js?v=f8389d80:23004:25) at async getMeteora (getMeteora.ts:15:17) at async loadMarkets (MyFile.tsx:50:25)

Not sure what is causing it, the account data object returned by getMultipleChunkedAccountInfos does NOT have the ".readBigInt64LE " method. The result was the same when I tried to get the Clock data outside of the node module using a standard connection and 3 RPC's from 3 different providers.
My @solana/web3.js version is 1.91.7 have also tried with 1.87.6 and latest @~1.78.3,

Potential solution:
I believe I have managed to get the correct output using .readInt32LE() which is available.
`
const clockinfo = connection.getAccountInfo(SYSVAR_CLOCK_PUBKEY);
const pclockinfo = connection.getParsedAccountInfo(SYSVAR_CLOCK_PUBKEY);

console.log((await clockinfo)?.data.readInt32LE()); //262508127
console.log(await pclockinfo.context.slot); //262508120

`
Difference likely due to latency between calls

Available methods for the returned account data:
ƒ compare(target, start, end, thisStart, thisEnd)
ƒ copy(target, targetStart, start, end)
ƒ equals(b)
ƒ fill(val, start, end, encoding)
ƒ includes(val, byteOffset, encoding)
ƒ indexOf(val, byteOffset, encoding)
ƒ inspect()
ƒ lastIndexOf(val, byteOffset, encoding)
ƒ readDoubleBE(offset, noAssert)
ƒ readDoubleLE(offset, noAssert)
ƒ readFloatBE(offset, noAssert)
ƒ readFloatLE(offset, noAssert)
ƒ readInt8(offset, noAssert)
ƒ readInt16BE(offset, noAssert)
ƒ readInt16LE(offset, noAssert)
ƒ readInt32BE(offset, noAssert)
ƒ readInt32LE(offset, noAssert)
ƒ readIntBE(offset, byteLength2, noAssert)
ƒ readIntLE(offset, byteLength2, noAssert)
ƒ readUInt8(offset, noAssert)
ƒ readUInt16BE(offset, noAssert)
ƒ readUInt16LE(offset, noAssert)
ƒ readUInt32BE(offset, noAssert)
ƒ readUInt32LE(offset, noAssert)
ƒ readUIntBE(offset, byteLength2, noAssert)
ƒ readUIntLE(offset, byteLength2, noAssert)
ƒ readUInt8(offset, noAssert)
ƒ readUInt16BE(offset, noAssert)
ƒ readUInt16LE(offset, noAssert)
ƒ readUInt32BE(offset, noAssert)
ƒ readUInt32LE(offset, noAssert)
ƒ readUIntBE(offset, byteLength2, noAssert)
ƒ readUIntLE(offset, byteLength2, noAssert)
ƒ slice(start, end)
ƒ swap16()
ƒ swap32()
ƒ swap64()
ƒ toJSON()
ƒ toString()
ƒ toString()
ƒ write(string, offset, length, encoding)
ƒ writeDoubleBE(value, offset, noAssert)
ƒ writeDoubleLE(value, offset, noAssert)
ƒ writeFloatBE(value, offset, noAssert)
ƒ writeFloatLE(value, offset, noAssert)
ƒ writeInt8(value, offset, noAssert)
ƒ writeInt16BE(value, offset, noAssert)
ƒ writeInt16LE(value, offset, noAssert)
ƒ writeInt32BE(value, offset, noAssert)
ƒ writeInt32LE(value, offset, noAssert)
ƒ writeIntBE(value, offset, byteLength2, noAssert)
ƒ writeIntLE(value, offset, byteLength2, noAssert)
ƒ writeUInt8(value, offset, noAssert)
ƒ writeUInt16BE(value, offset, noAssert)
ƒ writeUInt16LE(value, offset, noAssert)
ƒ writeUInt32BE(value, offset, noAssert)
ƒ writeUInt32LE(value, offset, noAssert)
ƒ writeUIntBE(value, offset, byteLength2, noAssert)
ƒ writeUIntLE(value, offset, byteLength2, noAssert)
ƒ writeUInt8(value, offset, noAssert)
ƒ writeUInt16BE(value, offset, noAssert)
ƒ writeUInt16LE(value, offset, noAssert)
ƒ writeUInt32BE(value, offset, noAssert)
ƒ writeUInt32LE(value, offset, noAssert)
ƒ writeUIntBE(value, offset, byteLength2, noAssert)
ƒ writeUIntLE(value, offset, byteLength2, noAssert)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant