ton-blockchain / ton

Main TON monorepo
Other
2.95k stars 891 forks source link

Can't receive state for wallet that was created using fift files from tonlib #111

Closed APshenkin closed 4 years ago

APshenkin commented 4 years ago

Here is an example of created wallet 0f-tGs1HBweSDCLnvVSih4J9zf5knXEdxLYkveHwizYkkDBf kf-tGs1HBweSDCLnvVSih4J9zf5knXEdxLYkveHwizYkkG2a

when trying to get wallet state for it tonlib returns

{
    "@type": "error",
    "code": 400,
    "message": "ACCOUNT_TYPE_UNEXPECTED: not a Wallet"
}

Wallet was created using new-wallet.fif file

APshenkin commented 4 years ago

Also what is the difference between testWallet.getAccountState and wallet.getAccountState ?

APshenkin commented 4 years ago

If use new-wallet-v2.fif then it returns state.

Does this mean, that new-wallet.fif is no longer supported and it's recomended to create wallets from new-wallet-v2.fif

In this case, how will the wallet code be updated in the future? If it will change often and tonlib will support only latest version it will be hard to maintain it in services

APshenkin commented 4 years ago

And as I understand difference between new-wallet-v2.fif and new-wallet.fif is that in new-wallet-v2.fif there is expiration time for generated send messages, correct?

ton-blockchain commented 4 years ago

Both accounts should be supported. The first one is testWallet and the second is wallet.

To get an account state it is better to use generic.getAccountState. Otherwise, the type of requested account should match the actual type of account.

APshenkin commented 4 years ago

Thanks for response!