Zebec Network
  • 💰Zebec Network
  • ➡️ZBC to ZBCN Migration Guide
  • 🗞️Zebec Network white Paper
  • 📈ZBCN Tokemonics
  • 🥳Getting Started
    • How to get started?
    • Benefits of Using Zebec Protocol
    • Deposit
    • Start Streaming
    • Withdraw Funds
  • 👾Safe
    • Create Safe
    • Deposit in Safe
    • Sending a Transaction
    • Zapps
    • Signing a Transaction
  • ZEBEC SOLANA
    • 🖥️Zebec Solana Sdk
      • 🖱️Streaming
        • Initialize Zebec Stream
        • Create Fee Vault
        • Update Fee Vault
        • Collect Fees
        • Deposit
        • Withdraw Deposited Token
        • Start Streaming
        • Pause Stream
        • Resume Stream
        • Cancel Stream
        • Withdraw Streamed Token
  • ZEBEC SILVER CARD
    • 💳Silver Card Sdk
      • 🔧Installation
      • 👨‍🚀Quick Start
      • ✉️Fetch Quote
      • ⚖️Configuration Parameters
      • 📦Recipient Fields
      • 🔁Responses
      • 🔢Environment Variables
      • 🌎Supported Countries
  • Zebec Bridge
    • Bridge Sdk
      • Creating clients
      • Initialize Proxy Account
      • Initialize Token Account
      • Deposit
        • Token Transfer
        • Deposit to Zebec
      • Withdraw Deposited
        • Withdraw From Zebec
        • Token Transfer
      • Init Stream
      • Pause/Resume Stream
      • Cancel Stream
      • Update Stream
  • Zebec Near
    • Zebec Near Sdk
      • Normal Stream
        • Initialize Near Stream
        • Initialize Token Stream
        • Pause/Resume Stream
        • Withdraw Stream
        • Update Stream
        • Cancel Stream
        • Claim Stream
        • View methods
      • Multisig Factory
        • Create Multisig Account
      • Multisig Stream
        • Initialize Near Stream
        • Initialize Token Stream
        • Pause/Resume Stream
        • Withdraw Stream
        • Update Stream
        • Cancel Stream
        • Claim Stream
        • View methods
  • ZEBEC EVM
    • Zebec Evm Sdk
      • Zebec Stream Client
        • Creating Clients
        • Whitelisting Tokens
        • Deposit into Zebec Wallet
        • Withdraw from Zebec Wallet
        • Initiating a Stream
        • Pause/Resume/Cancel Stream
        • Updating a Stream
        • Withdraw Streamed Tokens
        • Getting Stream Details
        • Whitelisted Tokens on BSC and Nautilus
      • Zebec Bulk Client
        • Bulk Instant Transfer
      • Zebec Multisig Stream
        • NFT
    • Zapps Compatible
Powered by GitBook
On this page
  1. Zebec Bridge
  2. Bridge Sdk

Creating clients

Currently, there are two clients:

  1. Evm Bridge client

  2. Solana Bridge client

Evm bridge client instances can be created in following way:

const sourceChain = CHAIN_ID_BSC;
const targetChain = CHAIN_ID_SOLANA;

const ethClient = new ZebecEthBridgeClient(
   BSC_ZEBEC_BRIDGE_ADDRESS, 
   signer, 
   sourceChain
);

Solana bridge client instances can be created in following way:

const connection = new Connection(SOLANA_HOST);
const wallet = new anchor.Wallet(keypair);
const achorProvider = new anchor.AnchorProvider(
   connection, 
   wallet, 
   AnchorProvider.defaultOptions()
);
const wormholeConfig = {
   coreBridgeProgram: new PublicKey(SOL_BRIDGE_ADDRESS),
   tokenBridgeProgram: new PublicKey(SOL_TOKEN_BRIDGE_ADDRESS),
};
const FEE_RECEIVER = "<solana pubkey>"
const zebecInstructions = new ZebecInstructions(anchorProvider);
const bridgeProgram = ZebecSolBridge__factory.getProgram(new PublicKey(SOL_ZEBEC_BRIDGE_ADDRESS), anchorProvider);
const bridgeTransactions = new ZebecBridgeTransactions(bridgeProgram);

const solanaClient = new ZebecSolBridgeClient(
   anchorProvider,
   bridgeProgram,
   bridgeTransactions,
   zebecInstructions,
   wormholeConfig,
   FEE_RECEIVER,
);

Here, FEE_RECEIVER is solana pubkey address which receives fee for provider streaming services. If you're using this sdk for providing stream service to other, then you must have initialzed before streaming.

PreviousBridge SdkNextInitialize Proxy Account

Last updated 1 year ago