xssnick / tonutils-go

TON SDK Library in pure Golang for interacting with The Open Network ecosystem using native protocols, such as ADNL, RLDP and etc.
Apache License 2.0
464 stars 95 forks source link

invalid seed check #184

Closed wgx731 closed 4 months ago

wgx731 commented 4 months ago

Hi @xssnick ,

I am wondering about the following line

what are we checking here?

The official tutorial code just creates the key directly.

Thanks.

xssnick commented 4 months ago

Hi, we are checking seed type, we doing additional hash to detect is seed with password (1) or not (0), this is how it is implemented in official ton node, see https://github.com/ton-blockchain/ton/blob/4cfe1d1a96acf956e28e2bbc696a143489e23631/tonlib/tonlib/keys/Mnemonic.cpp#L77

xssnick commented 4 months ago

Please use wallet.NewSeed() and wallet.FromSeed(), it is simpler and better :)

wgx731 commented 4 months ago

Thanks a lot for the quick answer, a related question about the wallet: README states This library will deploy and initialize wallet contract if it is not initialized yet.

But I am getting SendWaitTransaction err: failed to send message: lite server error, code 0: cannot apply external message to current state : External message was not accepted error, following basic usage example, as the wallet is inactive, any code reference to init the wallet?

Thank you very much.

xssnick commented 4 months ago

Probably this is because balance is 0 or not enough

wgx731 commented 4 months ago

Probably this is because balance is 0 or not enough

The issue is I have sent to the bounceable addresses of the wallet which I want to init previously. Thanks again for the help. Closing the issue now.