0.3.0 • Published 9 months ago

@bnb-chain/canonical-bridge-sdk v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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

Demo

Support Bridge Protocols

If you are interested in protocol of each bridge, please find the links below.

BridgeDoc Link
Celer cBridgeLink
deBridgeLink
Stargate V2Link

License

The contents of this repo are made available under the MIT License.

0.2.0-alpha.2

9 months ago

0.2.0-alpha.1

9 months ago

0.2.0-alpha.4

9 months ago

0.2.0-alpha.3

9 months ago

0.3.0

9 months ago

0.2.0

9 months ago

0.3.1

9 months ago

0.2.0-alpha.0

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.0.16

10 months ago

0.0.17

10 months ago

0.0.18

10 months ago

0.0.15

10 months ago

0.0.14

11 months ago

0.0.13

11 months ago

0.0.12

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.0

11 months ago