Use send mode 128 (carry all balance) and set message value to zero.
If you wish also to deactivate wallet (saves storage fee, but resets seqno to 0 thus making the wallet subject to replay attacks), use send mode 160 (128 + 32).
https://ton.org/docs/learn/tvm-instructions/instructions#119-outbound-message-and-output-action-primitives
Answered
How to transfer all the balance in the wallet?
https://tonapi.io/transaction/31d2a3344dfaa91e0e89c95417a50a5dd699e89679445c2c5b0568c2fcb6b62a
Here's the one i try to transfer all the balance to myself by using tonweb sdk (https://github.com/toncenter/tonweb), but the transaction broadcast and failed.
I think it is the reason that i did not minus the transaction fee and cause the insufficient balance to finish the transaction . But the estimateFee () return a dynamic value , if i try to minus the fee before i broadcast the transaction , will it causes the few balance left or broadcast fail by lack of tiny transaction fee ?
Tonkeeper do this perfectly and i wonder how they implement this function.
2K Views
1
Answer
one year ago
one year ago
Similar posts