Skip to content

Bcode SDK

This documentation is done for old BcodeSDK v0.1. We encourage to use the v1 with same functionalities and more.

Initialization

First of all to get access to the service you have to request an api key to our development team. This API Key will allow you to request a JWT token for authentication and enable all the functionalies.

BcodeSDK can be use by creating an instance of it and running init function to exchange the auth data with the API service. Private key field is optional if not specified BcodeSDK will create a random wallet for you, it's always possible to change wallet later.

In config you can specify:

  • env: MUMBAI | POLYGON
  • debugMode: true | false (It enables verbose log)
  • rpcProvider: You can specify custom RPC for the selected network
const { BcodeSDK } = require("@bcode-tech/bcode-sdk");

(async () => {
  const sdk = new BcodeSDK({
    apiKey: "your-api-key",
    privateKey: "your_private_key",
    config: { env: "MUMBAI", debugMode: true },
  });

  await sdk.init();
})();

It's possible to change private key later in the script if you have necessity, by running:

sdk.setPrivateKey("private_key");

That's all you need to initialize BcodeSDK, now you can execute every smart contract function you need.