Blockin
  • Blockin Overview
  • How Does It Work?
  • Developer Docs
    • Core Concepts
    • Getting Started
      • 🖊️User Signatures
      • 🖥️Sign In with BitBadges
      • 🆔Verification
      • 📤ChainDrivers
        • Setting Chain Drivers
        • Chain Driver Interface
        • Implementing a New Chain Driver
        • List of Implemented Chain Drivers
          • EthDriver
          • SolDriver
          • CosmosDriver
          • BtcDriver
          • AlgoDriver
    • Library Documentation
Powered by GitBook
On this page
  • Interface Definition
  • Individual Functions
  1. Developer Docs
  2. Getting Started
  3. ChainDrivers

Chain Driver Interface

PreviousSetting Chain DriversNextImplementing a New Chain Driver

Last updated 1 year ago

ChainDrivers are the heart and soul of BitBadges. They handle all chain-specific logic.

Interface Definition

Individual Functions

See for some notes on implementing ChainDriver functions.

Note that verifyAssets typically requires an API key of some sort, depending on how it is implemented. Also, assert your selected ChainDrivers can handle all the asset types and functionality you need for verification.

balancesSnapshot is an optional field to verifyAssets that allows you to pass in a snapshot of balances as opposed to fetching from the blockchain or an API. Make sure this is supported by your ChainDrivers.

For IDs (collections or assets) which are number based (such as BitBadges assets), you can use the UintRange<T> type. Otherwise, specify them as strings.

export interface AssetDetails<T extends NumberType> {
  chain: string,
  collectionId: T | string,
  assetIds: (string | UintRange<T>)[],
  ownershipTimes?: UintRange<T>[],
  mustOwnAmounts: UintRange<T>,
  additionalCriteria?: string,
}
{
  collectionId: "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
  assetIds: ["15"],
  mustOwnAmounts: { start: 0, end: 0 },
  chain: 'Ethereum',
},
{
  collectionId: 1,
  assetIds: [{ start: 1, end: 1 }],
  mustOwnAmounts: { start: 0, end: 0 },
  chain: 'BitBadges',
}

📤
https://blockin-labs.github.io/blockin/docs/interfaces/IChainDriver.html
Adding a New Chain