Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
TypeError: Do not know how to serialize a BigInt

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)                        // query_id:uint64
				.storeAddress(Address.parse(toAddress))  // new_owner:MsgAddress
				.storeAddress(Address.parse(fromAddress)) // response_destination:MsgAddress
				.storeUint(0, 1)                         // custom_payload:(Maybe ^Cell)
				.storeCoins(toNano('0.000000001'))       // forward_amount:(VarUInteger 16)
				.storeUint(0,1)                          // forward_payload:(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);

  
  
Posted 11 months ago
Edited 11 months ago
  
  

Update the content format

Howard Peng   11 months ago Report
Votes Newest

Answers 2


i already solved this error. the error was in converting TON to nano using this "toNano()" function, this should be work as they mention in docs but it's giving error. so i had to remove that function and set static value.

  
  
Posted 11 months ago

General speaking, from the Error message that for BigInt

You should notice that your line of code is incorrect:
.storeUint(0,1) // forward_payload:(Either Cell ^Cell)

It should be the Cell not using Uint I think.

  
  
Posted 11 months ago
Howard Peng
10 × 1 Administrator
  
  

@<1515658400011128832|Howard Peng> no, the code as it is from docs. i already solved this error. the error in converting TON to nano using this "toNano()" function,this should be work as they mention in docs but it's giving error. so i had to remove that function and set static value.
Thanks for the answer

Rahul Dabhi   11 months ago Report