admin管理员组文章数量:1312927
I am having trouble parsing the boc that I get after a sendTransaction is successful. I have tried using the libraries in python as well as js. I reach up to getting some hex codes but I'm unable to figure out how to extract the data from those. I need help in extraction of the information available in the boc like the sender Address, destination address, time, value etc.
Here's the code snippet for reference
let a = new TonWeb.boc.Cell();
a.bits.writeUint(0, 32);
a.bits.writeString("Hello TON!");
let payload = TonWeb.utils.bytesToBase64(await a.toBoc());
// connector is the ton_connect object
console.log(await connector.sendTransaction({
validUntil: Math.floor(new Date() / 1000) + 360,
messages: [
{
address: connector.wallet.account.address,
amount: "200000000",
payload: payload
}
]
}));
This is an example of the object returned from the above code
{
boc: "te6ccgEBBAEAygABRYgBuHbhGI31Hjax4/d/GRQVrG+62pQM57RVamnpUGSjDJIMAQGadNzyPfpUYS4DajxVtls/EkwJxArNT2ljbFh2931gDxg5MA/b9vMuTS0wyQAh0mx//qhvM4L7T+lCfsKs4rusAimpoxdnnNoVAAAAAwMCAWhiAG4duEYjfUeNrHj938ZFBWsb7ralAzntFVqaelQZKMMkoF9eEAAAAAAAAAAAAAAAAAABAwA2AAAAAFRPTiBDb25uZWN0IDIgdHV0b3JpYWwh"
}
I need help in extracting the data from this
I am having trouble parsing the boc that I get after a sendTransaction is successful. I have tried using the libraries in python as well as js. I reach up to getting some hex codes but I'm unable to figure out how to extract the data from those. I need help in extraction of the information available in the boc like the sender Address, destination address, time, value etc.
Here's the code snippet for reference
let a = new TonWeb.boc.Cell();
a.bits.writeUint(0, 32);
a.bits.writeString("Hello TON!");
let payload = TonWeb.utils.bytesToBase64(await a.toBoc());
// connector is the ton_connect object
console.log(await connector.sendTransaction({
validUntil: Math.floor(new Date() / 1000) + 360,
messages: [
{
address: connector.wallet.account.address,
amount: "200000000",
payload: payload
}
]
}));
This is an example of the object returned from the above code
{
boc: "te6ccgEBBAEAygABRYgBuHbhGI31Hjax4/d/GRQVrG+62pQM57RVamnpUGSjDJIMAQGadNzyPfpUYS4DajxVtls/EkwJxArNT2ljbFh2931gDxg5MA/b9vMuTS0wyQAh0mx//qhvM4L7T+lCfsKs4rusAimpoxdnnNoVAAAAAwMCAWhiAG4duEYjfUeNrHj938ZFBWsb7ralAzntFVqaelQZKMMkoF9eEAAAAAAAAAAAAAAAAAABAwA2AAAAAFRPTiBDb25uZWN0IDIgdHV0b3JpYWwh"
}
I need help in extracting the data from this
Share Improve this question edited Feb 1 at 11:56 PatPanda 5,06027 gold badges115 silver badges247 bronze badges asked Feb 1 at 5:07 SamSam 11 bronze badge1 Answer
Reset to default 0After extensive research, I found that it is probably not possible to get the info from the boc.
Instead you can use the boc to find the transaction on the ton network.
More details are found on this website
https://docs.ton./v3/guidelines/dapps/cookbook#how-to-find-transaction-for-a-certain-ton-connect-result
本文标签: blockchainHow to parse the BoC returned from the sendTransaction method in Ton ConnectStack Overflow
版权声明:本文标题:blockchain - How to parse the BoC returned from the sendTransaction method in Ton Connect - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741886519a2403052.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论