@thebadge/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.2.13 • Public • Published

TheBadge - SDK

Join to Discord contributions welcome Follow us on Twitter MIT licensed Latest release

Develop the sdk

  • Run lint checker:
yarn lint
  • Run tests:
yarn test
  • Build sdk:
yarn build

Setup on your project

  1. Install the sdk:
npm install @thebadge/sdk

or

yarn add @thebadge/sdk
  1. Initialize sdk instance:
const sdkInstance = new TheBadgeSDK(
  // check if your chain id is supported with TheBadgeSDK.isChainSupported(chainId)
  chainId, // chain id numeric value 
    
  // configuration object
  {
    // read only provider
    rpcProviderConfig: {
      // your desired provider: 'infura' or 'alchemy'
      name: 'infura',
    
      // your infura/alchemy apiKey
      apiKey: '00000000000000', 
    }, 
        
    // OPTIONAL: web3Provider instance, needed for write methods e.g. mint badge
    web3Provider,
        
    // OPTIONAL: use dev mode (relevant only on testnets where qa env is default), 
    // default value: false
    devMode: true,  
  }
)

Supported chains

Get the list of supported chain ids:

TheBadgeSDK.getSupportedChainIds()

Check if a chain is supported:

TheBadgeSDK.isChainSupported(chainId)
// chainId is a number, for example: 1, 5, etc

Sources of information

Package Sidebar

Install

npm i @thebadge/sdk

Weekly Downloads

14

Version

0.2.13

License

MIT

Unpacked Size

1.68 MB

Total Files

74

Last publish

Collaborators

  • thebadge