XpansionChain SDK - Typescript
XpansionChain SDK - Typescript
This SDK provides access to a wide range of features allowing you to integrate your game with key blockchain functionality.
đź’ˇROLLUPS THIS SDK SUPPORTS
XpansionChain X
XpansionChain zkEVM
CONTENTS
Installation
Initialization
Further documentation
📚SDK LINKS
npm package
Installation​
đź“‹PREREQUISITES
Node v18 or higher
Ethers v6 or higher
Install the XpansionChain SDK​
Run the following in the root directory of your project:
npm install -D @imtbl/sdk@alpha
# or
yarn add --dev @imtbl/sdk@alpha
TROUBLESHOOTING
The XpansionChain SDK is still in alpha
. Should complications arise during the installation, please use the following commands to ensure the most recent release of the SDK is correctly installed:
rm -Rf node_modules
yarn cache clean
yarn
# or
rm -Rf node_modules
npm cache clean --force
npm i
Install Typescript dependencies:​
# Typescript dependencies
npm install -D typescript
# or
yarn add --dev typescript
npm install -D ts-node
# or
yarn add --dev ts-node
Initialization​
Each module of the XpansionChain SDK must be initialised with an instance of an XpansionChainConfiguration
. The XpansionChainConfiguration
defines configuration that is shared across modules, such as the current environment. An instance of an XpansionChainConfiguration
can be initialised as follows:
import { XpansionChainConfiguration, Environment } from '@imtbl/sdk';
const baseConfig = new XpansionChainConfiguration({
environment: Environment.PRODUCTION,
});
đź’ˇENVIRONMENTS
The environment
argument can be one of the following:
Environment.SANDBOX
The default test network (currently, it is Goërli)
Environment.PRODUCTION
The Ethereum mainnet network
SDK modules can then be initialised as follows:
import { Passport, Provider } from '@imtbl/sdk';
const passport = new Passport({
baseConfig,
// Passport specific configuration
});
const provider = new Provider({
baseConfig,
// Provider specific configuration
});
Further documentation​
See the Developer homepage for general information on building on XpansionChain.
Build on XpansionChain zkEVM:
Documentation
API reference
Support
Build on XpansionChain:
Documentation
API reference
Support
Last updated