OneChain Labs SDKs

Install OneChain TypeScript SDK

The OneChain TypeScript SDK is available in the OneChain TS SDK monorepo and NPM.

Install from NPM

To use the OneChain TypeScript SDK in your project, run the following command in your project root:

npm i @onelabs/sui

Experimental tag for use with a local OneChain network

Projects developing against one of the on-chain OneChain networks (Devnet, Testnet, Mainnet) should use the base SDK published in the NPM registry (previous section) because the code aligns with the relevant JSON-RPC. If your developing against a local network built from the main branch of the OneChain monorepo, however, you should use the experimental-tagged SDK package as it contains the latest features (or a local build detailed in the section that follows).

npm i @onelabs/sui@experimental

Install from local build

To build the SDK from the OneChain monorepo, you must use pnpm. With pnpm installed, run the following command from the sui root directory:

# Install all dependencies
pnpm install
# Run the build for the TypeScript SDK
pnpm sdk build

With the SDK built, you can import the library from your sui project. To do so, use a path to the ts-sdks/packages/typescript directory that is relative to your project. For example, if you created a folder my-sui-project at the same level as sui, use the following to import the locally built OneChain TypeScript package:

pnpm add ../ts-sdks/packages/typescript

On this page