Software Development Kit (SDK)
In this section, we will provide the required technical details of the Infinity Protocol SDK to promote easy adoption allowing developers effortless interaction and global integration of the Infinity Protocol into applications.
The SDK is designed to run in any environment that can execute JavaScript. The source code is available on the GitHub repository available:
GitHub - InfinityWallet/InfinityProtocol-SDK
GitHub

Dependencies

The SDK declares its dependencies as peer dependencies as described in package.json, this is to prevent the installation of unused dependencies:
InfinityProtocol-SDK/package.json at main · InfinityWallet/InfinityProtocol-SDK
GitHub

Installation

To use the SDK you can install the package in your project by:

Using yarn

1
yarn add @infinityprotocol/sdk
Copied!

Using npm

1
npm install @infinityprotocol/sdk
Copied!

Usage

To run the SDK in any application, you will need to use an import or require statement.

Import

1
import { ChainId } from '@infinityprotocol/sdk'
2
console.log(`The chainId of mainnet is ${ChainId.MAINNET}.`)
Copied!

Require

1
const INFINITYPROTOCOL = require('@infinityprotocol/sdk')
2
console.log(`The chainId of mainnet is ${INFINITYPROTOCOL.ChainId.MAINNET}.`)
Copied!
Last modified 4mo ago