TypeError: Do not know how to serialize a BigInt
from Rahul Dabhi
Hey, i am getting this error while trasnfer NFT. I can't find this error anywhere. i have used as ton metion in their docs. please help me why i am geeting this error and how can i solved this?
USING : React js with typescript template, @ton/ton, @tonconnect/ui-react
ERROR:
TypeError: Do not know how to serialize a BigInt
const body = beginCell()
.storeUint(0x5fcc3d14, 32) // NFT transfer op code 0x5fcc3d14
.storeUint(0, 64) // queryid:uint64
.storeAddress(Address.parse(toAddress)) // newowner:MsgAddress
.storeAddress(Address.parse(fromAddress)) // responsedestination:MsgAddress
.storeUint(0, 1) // custompayload:(Maybe ^Cell)
.storeCoins(toNano('0.000000001')) // forwardamount:(VarUInteger 16)
.storeUint(0,1) // forwardpayload:(Either Cell ^Cell)
.endCell();
const transaction = {
validUntil: Math.floor(Date.now() / 1000) + 360,
messages:
{
address: Address.parse(nft_address), // NFT Item address, which will be transferred
amount: toNano("0.05"), // for commission fees, excess will be returned
payload: body.toBoc().toString("base64") // payload with a NFT transfer body
}
}
const result = await tonConnectUI.sendTransaction(transaction);
š Answer on TON Overflow
Aug 22, 2023, 1:02 PM