In TON, each transaction has a million attributes and options for executing various phases, and an attempt to derive from this a single sign of the success of a transaction turns out very poorly. Blockchain is for the smart ones.
In the ethereum a transaction simply has a binary sign of success/unsuccess (well, pending until it is included in the block ).Blockchain for stupids.
And in Bitcoin, all transactions are either successful or not in the blockchain. Blockchain for successful ones.
Nov 14, 2023, 7:45 AM
Sorry for google translate
Wiki: logical time
Nov 14, 2023, 7:50 AM
is logical time unique for all transactions?
Hi, can we decode event log in TON ?
Nov 14, 2023, 8:15 AM
You can try https://tonapi.io/v2/traces/{tx_hash}
I think it's more similar to you requirements
Nov 14, 2023, 8:27 AM
alright, thanks ill look into that
btw what makes a wallet active? i sent in 5 Ton in a newly generated address, its still inactive
Nov 14, 2023, 10:25 AM
you need to make a transaction with it
by sending not receiving
Nov 14, 2023, 10:34 AM
is there a method i can use to find if account is not initiated?
so i can try to initiate it only then
Nov 14, 2023, 10:35 AM
doesn’t it say on tonviewer
active/uninit
Nov 14, 2023, 10:35 AM
what wallet address are you checking?
https://testnet.tonscan.org/address/EQATw7jzaDWNjF9xHDLEMHTTn1ORHLmhuH7LWAGV4nms-4Bk
this is my address
ah u mean there is no " not initiated state " basically i want to know if i have to do the tx from account or not
to make it active, or is it already active
programatically ~
Nov 14, 2023, 10:37 AM
it says status - inactive
because you havent made a tx from that account
if you're asking how to grab that information programatically, not sure
because you havent made a tx from that account
if you're asking how to grab that information programatically, not sure
Nov 14, 2023, 10:38 AM
well when i try to get its balance programtically, it fails
cause: Error: getaddrinfo ENOTFOUND test.toncenter.com at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
errno: -3008, code: 'ENOTFOUND',
syscall: 'getaddrinfo', hostname: 'test.toncenter.com'
}
errno: -3008, code: 'ENOTFOUND',
syscall: 'getaddrinfo', hostname: 'test.toncenter.com'
}
my main issue is not being able to get balance, when i already gave it balance, at this point in my code i dont necessarily need to make a Tx, i just wanna get balance
a little context
i generated the wallet like this
const generateTonWallet = () => {
const KeyPair = TonWeb.utils.nacl.sign.keyPair();
const tonWallet = {
publicKey: TonWeb.utils.bytesToHex(KeyPair.publicKey),
secretKey: TonWeb.utils.bytesToHex(KeyPair.secretKey)
}
return tonWallet
}
and then got the public address to fund like this
const wallet = new walletClass(tonweb.provider, { publicKey: TonWeb.utils.hexToBytes(tonWallet.publicKey) });
await wallet.getAddress()
i generated the wallet like this
const generateTonWallet = () => {
const KeyPair = TonWeb.utils.nacl.sign.keyPair();
const tonWallet = {
publicKey: TonWeb.utils.bytesToHex(KeyPair.publicKey),
secretKey: TonWeb.utils.bytesToHex(KeyPair.secretKey)
}
return tonWallet
}
and then got the public address to fund like this
const wallet = new walletClass(tonweb.provider, { publicKey: TonWeb.utils.hexToBytes(tonWallet.publicKey) });
await wallet.getAddress()
Nov 14, 2023, 10:42 AM
You have to send the code to the contract address to activate it
transaction.code: contract.fromInit(initParams).code
Nov 14, 2023, 11:31 AM
trying to deploy the wallet like this
const walletClass = tonweb.wallet.all['v3R2'];
const wallet = new walletClass(tonweb.provider, { publicKey: TonWeb.utils.hexToBytes(tonWallet.publicKey) });
const deployTx = wallet.deploy(TonWeb.utils.hexToBytes(tonWallet.secretKey))
const deployTxResult = await deployTx.send()
and its giving me this error
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11522:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: Error: getaddrinfo ENOTFOUND test.toncenter.com
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'test.toncenter.com'
}
}
const walletClass = tonweb.wallet.all['v3R2'];
const wallet = new walletClass(tonweb.provider, { publicKey: TonWeb.utils.hexToBytes(tonWallet.publicKey) });
const deployTx = wallet.deploy(TonWeb.utils.hexToBytes(tonWallet.secretKey))
const deployTxResult = await deployTx.send()
and its giving me this error
TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11522:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: Error: getaddrinfo ENOTFOUND test.toncenter.com
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'test.toncenter.com'
}
}
maybe you cant deploy from the same wallet which you want to make active?
is that how it is?
but doesnt ton keeper does the same?
so it should be possible, can anyone please pointout what i am doing wrong here?
Nov 14, 2023, 11:43 AM
import { getHttpEndpoint } from "@orbs-network/ton-access";
import { mnemonicToKeyPair } from "@ton/crypto";
import TonWeb from "tonweb";
async function main() {
const mnemonic = "words ..."; // your 24 secret words
const key = await mnemonicToKeyPair(mnemonic.split(" "));
// initialize ton rpc client on testnet
const endpoint = await getHttpEndpoint({ network: "testnet" });
const tonweb = new TonWeb(new TonWeb.HttpProvider(endpoint));
// open wallet (notice the correct wallet version here)
const WalletClass = tonweb.wallet.all["v3R2"];
const wallet = new WalletClass(tonweb.provider, { publicKey: key.publicKey });
const walletAddress = await wallet.getAddress();
console.log("wallet address: ", walletAddress);
}
import { mnemonicToKeyPair } from "@ton/crypto";
import TonWeb from "tonweb";
async function main() {
const mnemonic = "words ..."; // your 24 secret words
const key = await mnemonicToKeyPair(mnemonic.split(" "));
// initialize ton rpc client on testnet
const endpoint = await getHttpEndpoint({ network: "testnet" });
const tonweb = new TonWeb(new TonWeb.HttpProvider(endpoint));
// open wallet (notice the correct wallet version here)
const WalletClass = tonweb.wallet.all["v3R2"];
const wallet = new WalletClass(tonweb.provider, { publicKey: key.publicKey });
const walletAddress = await wallet.getAddress();
console.log("wallet address: ", walletAddress);
}
Nov 14, 2023, 11:55 AM
the problem is while deploying, i am getting address and everything, i even funded the wallet
thanks <3
Nov 14, 2023, 12:39 PM
How can i convert 24-word mnemonic to receiving address? I am using the console in wallet.ton.org
Nov 14, 2023, 12:39 PM
one more question xD is Logical time of transaction unique for all transactions?
Nov 14, 2023, 12:40 PM
Can get it quickly by just importing it but it would be easier to do it with a command
Nov 14, 2023, 12:40 PM
thats how
@cottonfarm ^
Nov 14, 2023, 12:40 PM
Unique on single account.
Nov 14, 2023, 12:41 PM
So do i just copy paste that code into the console
That looks different
Nov 14, 2023, 12:41 PM
ie if transactions are happening on contract, then all transactions will have unique Logical time of transaction
its a js code
Nov 14, 2023, 12:41 PM
okay ty
Nov 14, 2023, 12:42 PM
by the way is there a example on how to decode the logs that i get from transaction ?
Nov 14, 2023, 12:43 PM
It didn't work for some reason, can you show what I did wrong
(this mnemonic is obviously for a wallet that is not funded, do not worry)
oh wait, does the account need to be initialized for that to work
Nov 14, 2023, 12:47 PM
its a js code that means u need to install those libraries...
Nov 14, 2023, 12:48 PM
I thought wallet.ton.org automatically has that
Nov 14, 2023, 12:49 PM
guys i am trying to get transactions with this api
https://testnet.toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get
this is the contract
https://testnet.tonscan.org/address/EQAgcUB9SbWSn3HEYTpKfg8ZbCwjBBiK-I22IUqBto1zkiXo
i am copying LT from 2nd transaction and giving it as LT param in the api, api is still sending me 3 transactions result back, is it supposed to be like that? from my understanding it should start reading the transactions from LT time i gave it
https://testnet.toncenter.com/api/v2/#/transactions/get_transactions_getTransactions_get
this is the contract
https://testnet.tonscan.org/address/EQAgcUB9SbWSn3HEYTpKfg8ZbCwjBBiK-I22IUqBto1zkiXo
i am copying LT from 2nd transaction and giving it as LT param in the api, api is still sending me 3 transactions result back, is it supposed to be like that? from my understanding it should start reading the transactions from LT time i gave it
hello, toncenter api is giving unexpected results
curl -X 'GET' \
'https://testnet.toncenter.com/api/v2/getTransactions?address=EQAgcUB9SbWSn3HEYTpKfg8ZbCwjBBiK-I22IUqBto1zkiXo&limit=10<=16541429000002&to_lt=16541429000002&archival=false' \
-H 'accept: application/json
i am giving it same LT and TO_LT, and its returning all three transactions of my contract, more over if i only give it LT and no TO_LT, the api still gives all transactions of contract, is this borken?
curl -X 'GET' \
'https://testnet.toncenter.com/api/v2/getTransactions?address=EQAgcUB9SbWSn3HEYTpKfg8ZbCwjBBiK-I22IUqBto1zkiXo&limit=10<=16541429000002&to_lt=16541429000002&archival=false' \
-H 'accept: application/json
i am giving it same LT and TO_LT, and its returning all three transactions of my contract, more over if i only give it LT and no TO_LT, the api still gives all transactions of contract, is this borken?
Nov 14, 2023, 1:37 PM
for all transactions of this particular address only
Nov 14, 2023, 1:50 PM
@just_dmitry can you look at this problem, it seems weird
Nov 14, 2023, 1:51 PM
Nov 14, 2023, 1:53 PM
AH makes sense alright
xD thanks <3
@just_dmitry the event logs will come in "out_msgs": [] ?
Nov 14, 2023, 2:23 PM