When I try to send a transaction though my bot with the npm ton lib, I get this issue. error:
'LITE_SERVER_UNKNOWN: cannot apply external message to current state : Failed to unpack account state'

The parameters seem to be processed correctly unti lthe transfer method is called.

Jan 5, 2023, 9:31 PM
What means Failed to unpack account state?
I've followed this guide here. But can't find any information about this error.

https://blog.ton.org/how-ton-wallets-work-and-how-to-access-them-from-javascript
Jan 5, 2023, 9:32 PM
something is wrong
maybe seqno
Jan 5, 2023, 9:38 PM
seqNo is 0 in my logs
This are my logs.
Could it be something with my account type? I've used the given one which is org.ton.wallets.v4 but I#ve created my wallet though wallet.ton.org, just a couple days ago. So I guess it should be the latest type? Where can I lookup my wallet type?
Jan 5, 2023, 9:45 PM
Make sure to not use this secret key from now on :)
Jan 5, 2023, 9:48 PM
haha yea thought about it but don't worry, the secret has a bunch of other characters left that aren't on the screenshot. :)
That makes no sense to me and honestly I could try the other library, but I think both are working the same way somehow so I will probably end up with the same error. Failed to unpack account state. I will try v3 to see if I get a different error.

The error is coming from the jsonRPC, so not even the library itself has a hint for that error (500).
God. Really. Why does it work with the wallet type org.ton.wallets.v3.r2 🤔
Are the Blockchain Fees % based on the tx value that you send?

I am building a ecommerce shop system with marketing payment feature. Means, User buys, the Bot Wallet gets the money, takes it's commision and sends the rest to the Seller Wallet.

Easy stuff. But I am testing right now with low amount TON (0,009x) and I am ending up in having LESS TON's on the Bot Wallet due the fees.

So is this even relyable?
Here a more specific example in values that I've just tested.

0.009675849 Transaction Value in TON

55% Application Fee ( our comission )
45% gets the shop owner so
0,004354132 gets the shop owner
calc = (0,009675849 / 100 * (100-55))

Wallet Values pre and post tx.
1,991531338 to 1,99022302 on the Bot Wallet
1,01372162 to 1,017975718 on the Seller Wallet

This
means, even we get 100% and split out the rest money for the seller, we
pay more fees and have less money after the split?
Bot Wallet tx list of the example
Okay, another test with higher amount. 8 USD = 3,8792xx TON now.

The fees seems to be at a 1000th decimal place. So no % and this may work then.

Buy Input 3,879xx fee 0,001xx
Split to Seller 1,7456xx fee 0,006xx

So we make like 2,1273 TON win out of this Transaction with 55% fee rate.
Jan 5, 2023, 11:17 PM

© 2024 Draquery.com All rights reserved.