0.3.0 • Published 11 months ago
@bnb-chain/canonical-bridge-sdk v0.3.0
BNB chain canonical-bridge sdk
This SDK integrates API and methods from multiple cross-chain bridges, such as cBridge(Celer bridge), deBridge and Stargate. Users can easily retrieve protocol fees and transfer tokens through different chains.
Installation
npm install @bnb-chain/canonical-bridge-sdk viem@^2
Creating an Instance
import { CanonicalBridgeSDK } from '@bnb-chain/canonical-bridge-sdk';
/**
* Initialize SDK Instance
* @returns SDK Instance
*/
const bridgeSDK = new CanonicalBridgeSDK({
bridgeConfigs: [
{
bridgeType: 'cBridge',
endpoint: env.CBRIDGE_ENDPOINT,
timeout: 5000,
},
{
bridgeType: 'deBridge',
endpoint: env.DEBRIDGE_ENDPOINT,
statsEndpoint: env.DEBRIDGE_STATS_ENDPOINT,
timeout: 5000,
},
],
});
const order = await bridgeSDK.deBridge.getOrder({
id: '0x4cb96c88916d5f08a979750c54f3001ffb4069762326705d431a83f946b3ba64',
});
Demo
Support Bridge Protocols
If you are interested in protocol of each bridge, please find the links below.
Bridge | Doc Link |
---|---|
Celer cBridge | Link |
deBridge | Link |
Stargate V2 | Link |
License
The contents of this repo are made available under the MIT License.
0.2.0-alpha.2
11 months ago
0.2.0-alpha.1
11 months ago
0.2.0-alpha.4
11 months ago
0.2.0-alpha.3
11 months ago
0.3.0
11 months ago
0.2.0
11 months ago
0.3.1
11 months ago
0.2.0-alpha.0
11 months ago
0.1.2
11 months ago
0.1.1
11 months ago
0.0.16
11 months ago
0.0.17
11 months ago
0.0.18
11 months ago
0.0.15
12 months ago
0.0.14
1 year ago
0.0.13
1 year ago
0.0.12
1 year ago
0.0.10
1 year ago
0.0.9
1 year ago
0.0.8
1 year ago
0.0.7
1 year ago
0.0.6
1 year ago
0.0.5
1 year ago
0.0.4
1 year ago
0.0.3
1 year ago
0.0.0
1 year ago