裸裸 (乐乐)golang开发, [Jan 9, 2024 at 18:39:16]:
hello sir. I use the
https://testnet.tonviewer.com/transaction/77fb3cc4ad47a5d9dcd178f91d5454eee42e14c267056375975f227e6df78d92
or the
https://testnet.tonviewer.com/transaction/4c53b8e11851672876e354f537d4ae9d16cf3f9e9f7c3bd47ca2b1fbc8fba0db
can get almost same result.

what is the logic of this page?

if I only have 77fb3cc4ad47a5d9dcd178f91d5454eee42e14c267056375975f227e6df78d92 how can I get the 4c53b8e11851672876e354f537d4ae9d16cf3f9e9f7c3bd47ca2b1fbc8fba0db

or If I only have 4c53b8e11851672876e354f537d4ae9d16cf3f9e9f7c3bd47ca2b1fbc8fba0db how can I get 77fb3cc4ad47a5d9dcd178f91d5454eee42e14c267056375975f227e6df78d92

the tonviewer is the tonviewer.

but I want to use the api to get the result. not see by eyes.

which api can I use?

this api is not ok:
https://testnet.toncenter.com/api/v2/getBlockTransactions?workchain=0&shard=8000000000000000&seqno=17229018&root_hash=77fb3cc4ad47a5d9dcd178f91d5454eee42e14c267056375975f227e6df78d92&count=40
because it give me 4 results. while I need is 2.
so please help me.

Jan 10, 2024, 2:23 AM
the api link is for getBlockTransactions, so you get all tx in this block
Jan 10, 2024, 2:35 AM
so is there anther api can help me?
Jan 10, 2024, 2:36 AM
maybe, but idk, I just saw the api link, and the result seems to be right
Jan 10, 2024, 2:37 AM
Jan 10, 2024, 2:43 AM
which site is this?
Jan 10, 2024, 2:44 AM
I passed the root_hash parameter, but the result is the same as not passing it. Even if I change it to an incorrect hash, I can still retrieve all the transactions.
https://testnet.toncenter.com/api/v2/#
https://toncenter.com/api/v2/#bin
so how to get the relative tx by use api?
the page is very good.
but my program is not good.
I am testiing the transfer between the wallet.
first. I get the balance of the two wallet.
then I get the relative tx to calculate the balance.
then I compare the result with the getBalance from the web.
the main point is how to get the next transaction and the next transaction when send a transfer tx.
how to avoid this?
Suppose I have opened a store where I sell goods and accept "ton" as the currency. A person made a payment to me and provided the tx hash 89f6f64f58c973b0c7ec33fbe0b72b4d885ac271d67c0c3a5afe7f40aacdb624. After verifying this tx hash, which indeed corresponds to a transaction, I proceeded to give them the goods, considering the transaction complete. However, upon opening my wallet, I discovered that the money did not get credited, but instead, it bounced. At this point, I incurred a loss of both the money and the goods.
Therefore, when the other party made a transfer to me and informed me that their hash was "89f6f64f58c973b0c7ec33fbe0b72b4d885ac271d67c0c3a5afe7f40aacdb624," I should immediately recognize that this transaction has gone through the hashes "ee0286602552164251406cbc590a26f63e817f083c142ad9b2ae0541a171cf64" and "641e2a362ac1a4d17b56dafab03f97efe494d31844c8a09d13cf80daf81c9c92" and ultimately bounced back. At this point, I should not have given the goods to the other party.
However, now, how can I accomplish these tasks? When the other party sends a transaction, they will have a hash, but I need to understand the complete process behind that hash. I know that through a web browser, it's evident that I can see the results. However, if I want to turn this into an automated process, where a program can recognize this situation, how can I go about identifying it?
Suppose I am a shop owner selling goods. When I receive a transfer, I know that the hash for this transfer is 334e166cb9e825d296f52ed020276a11d6b19b70302f94a1a410adb82f870670. I also know that this transaction is from a specific customer. However, which transaction does it correspond to for the customer? If the customer made two purchases but I only received payment for one, how can I determine which one was successful and which one failed? Furthermore, how can I identify which item to send to the customer?
Jan 10, 2024, 3:36 AM
If your wallet is initialized, money doesn't bounce.
Normally, you include a comment with UID of purchase generated by your service.
Second option. TON Connect provides you with external message which you can match with item. You can track whether the transactions caused by it succeeded.
Jan 10, 2024, 3:42 AM
Well, you're absolutely right. I can use "comment=UID" to pass messages.
However, I do feel that you need to add an API interface that allows users to retrieve all the hashes associated with a complete transaction using a single hash. Otherwise, your logic cannot be fully closed, and that is also a problem.
Jan 10, 2024, 3:47 AM
https://toncenter.com/api/v3/#/default/get_transaction_trace_api_v3_transactionTrace_get
Jan 10, 2024, 3:52 AM
Wow, this interface seems to be exactly what I was expecting. I'll give it a try first and see if I can get the desired results.
the api you give me can work very good. however, the api is rate limited. even I use the "X-API-Key" it is always 503.
can the https://testnet.toncenter.com/api/v2/# and https://testnet.toncenter.com/api/v3/# use the same api_key in the headers when request?
Jan 10, 2024, 9:27 AM
Yes
Jan 10, 2024, 9:33 AM
thank you.
https://testnet.tonapi.io/v2/blockchain/transactions/dd979231ce0dc18d6fd019daae4d91fce87f05ca06d4e54bcfeb552997b5bf07
why the "block": "(0,c000000000000000,16397394)",
c000000000000000
8000000000000000 I always think the shard is 8000000000000000. but now I get a c000000000000000.
and the go sdk define is type BlockID struct {
Workchain int32
Shard uint64
Seqno uint32
}
Jan 10, 2024, 10:41 AM
that’s the master shard - when there is only one shard. When blockchain splits the master shard is dividing to c000000000000000 and 4000000000000000
Jan 10, 2024, 10:42 AM
OK I will change my code to define it as string type.
Jan 10, 2024, 10:44 AM
no 😥, it's uint64. You just compare Hex
Jan 10, 2024, 10:46 AM
ok the hex value.
Jan 10, 2024, 10:47 AM

© 2024 Draquery.com All rights reserved.