Usage
Last updated
Last updated
For example, to bridge USDC from Base to Scroll
For more details, check the example/bridge_usdc folder.
Map your the chain names from your protocol with Owlto.
For example, if the chain name of Base Mainnet on your protocol is "Base", you can set chainNameMapping["Base"] = "BaseMainnet"
.
Then you can run functions with chain name as "Base" in order to proceed with a bridge.
The txs contains the transactions user should send to from chain
when bridging.
1.Evm
txs.approveBody
The approve transaction, if any, should be sent first.
txs.transferBody
The actual transfer transaction.
2.Starknet
Coming Soon
3.Solana
Coming Soon
bridge.waitReceipt(fromChainHash: string)
bridge.getReceipt(fromChainHash: string)
fromChainHash
is the hash value of the transfer transaction.
waitReceipt
refers to waiting for the bridge process to complete.
If the bridge process is not completed within 1 minute (usually due to not finding the hash value or failure), error message will be displayed.
getReceipt
refers to get the status of a bridge process.
If fromChainHash
is not found, bridge is in progress or failed, error message will be displayed.
bridge.getPairInfo(tokenName: string, fromChainName: string, toChainName: string)
bridge.getAllPairInfos()
A pair consists of three components: token name
, from chain name
, to chain name
.
You can only bridge supported pairs
Please visit: https://owlto.finance/bridge_api/v1/swagger/index.html .