Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Update getNep21Balance with the usage of view method get_bridge_token_account_id of a bridge factory #86

Open
alexauroradev opened this issue Feb 9, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers P2

Comments

@alexauroradev
Copy link

alexauroradev commented Feb 9, 2021

Currently, in getNep21Balance function we use the following code:

const nep21Address =
    transfer.sourceToken.replace('0x', '').toLowerCase() +
    '.' +
    process.env.nearTokenFactoryAccount

Though at the moment this is correct, a connector might change the way how it maps addresses of the tokens on both sides. For the consistency, we should use get_bridge_token_account_id view method of the bridge factory

@alexauroradev alexauroradev added enhancement New feature or request good first issue Good for newcomers P2 labels Feb 9, 2021
@paouvrard
Copy link
Member

The frontend could also use a function that goes the other way: bridged_nep141_address -> original_erc20_address so that users can search for a token with the nep141 address when they are transferring from NEAR.

Are these bridged addresses really expected to change ? Similar to token decimals, I think its also nice to be able to know the information without querying everything on chain.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers P2
Projects
None yet
Development

No branches or pull requests

2 participants