How can i send ton in C# wallet to other wallet??
How can i send ton in C# wallet to other wallet??
i test this code but code return this error :
Received error: {"ok":false,"error":"LITE_SERVER_UNKNOWN: cannot apply external message to current state : External message was not accepted\nCannot run message on account: inbound external message rejected by transaction 567F1D4BCB17CE7440806854F3DB31A986229B46C73EFE0835F80B9E4CAC5258:\nexitcode=9, steps=8, gas_used=0\nVM Log (truncated):\n...execute SETCP 0\nexecute DICTPUSHCONST 19 (xC_,1)\nexecute DICTIGETJMPZ\nexecute PUSHPOW2 9\nexecute LDSLICEX\nexecute DUP\nexecute LDU 32\nhandling exception code 9: cell underflow\ndefault exception handler, terminating vm with exit code 9\n","code":500}
i dont know what happend.
________________________
this my code
try
{
TonClient tonclient = new(new TonClientParameters
{
Endpoint = "https://toncenter.com/api/v2/jsonRPC",
ApiKey = "...",
});
var destination = new Address("UQBWfx1LyxfOdECAaFTz2zGphiKbRsc-_gg1-AueTKxSWPZ9");
var mnemonic = new Mnemonic();
WalletV4 walletV4 = new WalletV4(new WalletV4Options() { PublicKey = mnemonic.Keys.PublicKey! });
// Create a transfer message for the wallet
ExternalInMessage message = walletV4.CreateTransferMessage(new[]
{
new WalletTransfer
{
Message = new ExternalInMessage(new()
{
Info = new ExtInMsgInfo(new()
{
Dest = destination,
ImportFee = new Coins("0.013"),
Src = walletV4.Address
}),
Body = new Message(destination, new Coins("0.5")).Payload,
StateInit = new StateInit(new StateInitOptions()),
}),
Mode = 1
}
}, 0).Sign(mnemonic.Keys.PrivateKey, true);
await tonclient.SendBoc(message.Cell!);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
i test this code but code return this error :
Received error: {"ok":false,"error":"LITE_SERVER_UNKNOWN: cannot apply external message to current state : External message was not accepted\nCannot run message on account: inbound external message rejected by transaction 567F1D4BCB17CE7440806854F3DB31A986229B46C73EFE0835F80B9E4CAC5258:\nexitcode=9, steps=8, gas_used=0\nVM Log (truncated):\n...execute SETCP 0\nexecute DICTPUSHCONST 19 (xC_,1)\nexecute DICTIGETJMPZ\nexecute PUSHPOW2 9\nexecute LDSLICEX\nexecute DUP\nexecute LDU 32\nhandling exception code 9: cell underflow\ndefault exception handler, terminating vm with exit code 9\n","code":500}
i dont know what happend.
________________________
this my code
try
{
TonClient tonclient = new(new TonClientParameters
{
Endpoint = "https://toncenter.com/api/v2/jsonRPC",
ApiKey = "...",
});
var destination = new Address("UQBWfx1LyxfOdECAaFTz2zGphiKbRsc-_gg1-AueTKxSWPZ9");
var mnemonic = new Mnemonic();
WalletV4 walletV4 = new WalletV4(new WalletV4Options() { PublicKey = mnemonic.Keys.PublicKey! });
// Create a transfer message for the wallet
ExternalInMessage message = walletV4.CreateTransferMessage(new[]
{
new WalletTransfer
{
Message = new ExternalInMessage(new()
{
Info = new ExtInMsgInfo(new()
{
Dest = destination,
ImportFee = new Coins("0.013"),
Src = walletV4.Address
}),
Body = new Message(destination, new Coins("0.5")).Payload,
StateInit = new StateInit(new StateInitOptions()),
}),
Mode = 1
}
}, 0).Sign(mnemonic.Keys.PrivateKey, true);
await tonclient.SendBoc(message.Cell!);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
How can i send ton in C# wallet to other wallet??
i test this code but code return this error :
Received error: {"ok":false,"error":"LITE_SERVER_UNKNOWN: cannot apply external message to current state : External message was not accepted\nCannot run message on account: inbound external message rejected by transaction 567F1D4BCB17CE7440806854F3DB31A986229B46C73EFE0835F80B9E4CAC5258:\nexitcode=9, steps=8, gas_used=0\nVM Log (truncated):\n...execute SETCP 0\nexecute DICTPUSHCONST 19 (xC_,1)\nexecute DICTIGETJMPZ\nexecute PUSHPOW2 9\nexecute LDSLICEX\nexecute DUP\nexecute LDU 32\nhandling exception code 9: cell underflow\ndefault exception handler, terminating vm with exit code 9\n","code":500}
i dont know what happend.
________________________
this my code
try
{
TonClient tonclient = new(new TonClientParameters
{
Endpoint = "https://toncenter.com/api/v2/jsonRPC",
ApiKey = "...",
});
var destination = new Address("UQBWfx1LyxfOdECAaFTz2zGphiKbRsc-_gg1-AueTKxSWPZ9");
var mnemonic = new Mnemonic();
WalletV4 walletV4 = new WalletV4(new WalletV4Options() { PublicKey = mnemonic.Keys.PublicKey! });
// Create a transfer message for the wallet
ExternalInMessage message = walletV4.CreateTransferMessage(new[]
{
new WalletTransfer
{
Message = new ExternalInMessage(new()
{
Info = new ExtInMsgInfo(new()
{
Dest = destination,
ImportFee = new Coins("0.013"),
Src = walletV4.Address
}),
Body = new Message(destination, new Coins("0.5")).Payload,
StateInit = new StateInit(new StateInitOptions()),
}),
Mode = 1
}
}, 0).Sign(mnemonic.Keys.PrivateKey, true);
await tonclient.SendBoc(message.Cell!);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}