I've encountered an issue with the Account class in this package. Specifically, the issue arises in the from_dict static method.
Description:
The method currently tries to retrieve the chain data using ton_addr['network']. However, in the data returned from the frontend, this piece of information is actually provided under the key 'chain', not 'network'.
Affected Code:
def from_dict(ton_addr: dict):
if 'address' not in ton_addr:
raise TonConnectError('address not contains in ton_addr')
account = Account()
account.address = ton_addr['address']
account.chain = ton_addr['network'] # This line needs correction
account.wallet_state_init = ton_addr['walletStateInit']
account.public_key = ton_addr.get('publicKey', None)
return account
Expected Behavior:
The method should correctly map the 'chain' key from the input dictionary to the chain attribute of the Account object.
Proposed Fix:
Update the line where the chain is assigned:
account.chain = ton_addr['chain']
I believe this correction will align the backend handling of the data with the structure provided by the frontend.
Thank you for looking into this matter. Please let me know if I can provide any more details.
Hello,
I've encountered an issue with the
Account
class in this package. Specifically, the issue arises in thefrom_dict
static method.Description: The method currently tries to retrieve the chain data using
ton_addr['network']
. However, in the data returned from the frontend, this piece of information is actually provided under the key'chain'
, not'network'
.Affected Code:
Expected Behavior: The method should correctly map the
'chain'
key from the input dictionary to thechain
attribute of theAccount
object.Proposed Fix: Update the line where the chain is assigned:
I believe this correction will align the backend handling of the data with the structure provided by the frontend.
Thank you for looking into this matter. Please let me know if I can provide any more details.