Open karim-en opened 2 days ago
We need to implement essential bridge SDK in Typescript; the library should include basic functions to be able to create and track transfers.
This is just a nominal description of the, it is subject to change during the development if needed.
interface TransferMessage { tokenAddress: OmniAddress, amount: BigNumber, fee: BigNumber, nativeFee: BigNumber, recipient: OmniAddress, message: string | null } interface OmniTransfer { txId: string, nonce: BigNumber, transferMessage: TransferMessage } function omniTransfer( wallet: ethers.Wallet | NearWalletConnection | solWalletAdapter, transferMessage: TransferMessage ): Promise<OmniTransfer>; function findOmniTransfers(sender: OmniAddress): Promise<OmniTransfer[]>; function getFee(sender: OmniAddress, recipient: OmniAddress): Promise<Fee>; function getTransferStatus(originChain: ChainKind, nonce: BigNumber): Promise<Status>; function initDeployToken(tokenAddress: OmniAddress, destinationChain: ChainKind): Promise; function finDeployToken(txId: OmniTranscationId): Promise; function bindToken(txId: OmniTranscationId): Promise;
Notes:
The first user of the API will be the bridge web app https://github.com/aurora-is-near/rainbow-bridge-next/pull/241
There is a Rust SDK that is used by the Omni Relayer https://github.com/Near-One/bridge-sdk-rs
The previous rainbow bridge implementation is here https://github.com/aurora-is-near/rainbow-bridge-client, but we want to deprecate it.
Finalisation of the transfers is out of the scope of this issue.
The findOmniTransfers, getFee, and getStatus are relays on our bridge API provider https://github.com/Near-One/bridge-indexer-rs/tree/master/omni-indexer-endpoint. The endpoint URL for testnet is https://testnet.api.bridge.nearone.org
findOmniTransfers
getFee
getStatus
https://testnet.api.bridge.nearone.org
initDeployToken: Only tokens that have been deployed on Near can be deployed on other chains. And other chain tokens can be deployed on Near. So to be able to deploy Ethereum Erc20 token on Solana, it should be deployed on Near first
initDeployToken
To init the deployment:
To finalize it:
To bind the deployed token on Near:
We need to implement essential bridge SDK in Typescript; the library should include basic functions to be able to create and track transfers.
This is just a nominal description of the, it is subject to change during the development if needed.
Notes:
The first user of the API will be the bridge web app https://github.com/aurora-is-near/rainbow-bridge-next/pull/241
There is a Rust SDK that is used by the Omni Relayer https://github.com/Near-One/bridge-sdk-rs
The previous rainbow bridge implementation is here https://github.com/aurora-is-near/rainbow-bridge-client, but we want to deprecate it.
Finalisation of the transfers is out of the scope of this issue.
The
findOmniTransfers
,getFee
, andgetStatus
are relays on our bridge API provider https://github.com/Near-One/bridge-indexer-rs/tree/master/omni-indexer-endpoint. The endpoint URL for testnet ishttps://testnet.api.bridge.nearone.org
initDeployToken
: Only tokens that have been deployed on Near can be deployed on other chains. And other chain tokens can be deployed on Near. So to be able to deploy Ethereum Erc20 token on Solana, it should be deployed on Near first