We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to understand how to create w script that transfers TON using @ton/ton library, but I am unable to proceed.
Here's the code I am using:
const nacl = require("tweetnacl"); const { TonClient, WalletContractV4, internal } = require("@ton/ton"); const { SendMode } = require("@ton/core"); const client = new TonClient({ endpoint: '', // endpoint }); const senderSecret = ''; // private key in hex format const privBytes = Buffer.from(senderSecret, 'hex'); const privUint8 = Uint8Array.from(privBytes); let keypair = nacl.sign.keyPair.fromSecretKey(privUint8); keypair.publicKey = Buffer.from(keypair.publicKey); keypair.secretKey = Buffer.from(keypair.secretKey); // Create wallet contract let workchain = 0; // Usually you need a workchain 0 let wallet = WalletContractV4.create({ workchain, publicKey: keypair.publicKey }); let contract = client.open(wallet); // Create a transfer let seqno = await contract.getSeqno(); let transfer = await contract.createTransfer({ seqno, messages: [internal({ value: '0.1', to: 'UQDoxj63LWTBmCrVOxh2z_DAl1AxQ33Nbw9CTXWLPZDYIowF', })], secretKey: keypair.secretKey }); let result = await contract.send(transfer);
I would expect this code to succeed, however all I am getting is:
error: 'LITE_SERVER_UNKNOWN: cannot apply external message to current state : External message was not accepted\n' + 'Cannot run message on account: inbound external message rejected by transaction 3C44EF8316576398A14921538312C1A639F5637CAA6774614F7FB664837DB4AF:\n' + 'exitcode=35, steps=31, gas_used=0\n' + 'VM Log (truncated):\n' + '... XCPU s4,s3\n' + 'execute EQUAL\n' + 'execute THROWIFNOT 33\n' + 'execute XCPU s5,s1\n' + 'execute EQUAL\n' + 'execute THROWIFNOT 34\n' + 'execute XCHG s5\n' + 'execute HASHSU\n' + 'execute XC2PU s0,s6,s4\n' + 'execute CHKSIGNU\n' + 'execute THROWIFNOT 35\n' + 'default exception handler, terminating vm with exit code 35\n',
The address from which I am sending this:
contract.send()
What am I missing?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to understand how to create w script that transfers TON using @ton/ton library, but I am unable to proceed.
Here's the code I am using:
I would expect this code to succeed, however all I am getting is:
The address from which I am sending this:
contract.send()
is supposed to attach initcode in that caseWhat am I missing?
The text was updated successfully, but these errors were encountered: