Skip to main content
Install the RWA SDK from npm and set up your project.

Set up TS ENV

1. New Project

2. Install packages

3. Add a TypeScript config

Add the following into the file:

4. Update scripts in package.json.

The src/index.ts is the executable file.

5. Create source file

Set up JS ENV

1. Initialize node env

2. Install packages

3. Create source file

Execute

For both TS/JS environments your next steps are:

Create .env file

The examples read secrets from a .env file. Create it together with a .gitignore so you do not commit keys:
To follow the full walkthrough, define .env as:
HTTPS_BASE_URL is the EVM RPC for the chain you pass as chainId. The examples use agung; for Chain.PEAQ use a peaq mainnet RPC such as https://quicknode1.peaq.xyz. Add to .gitignore:

TS Execution

Copy one of the examples with the proper authority into src/index.ts for execution and run with:

JS Execution

Copy one of the examples with the proper authority into src/index.js for execution and run with:

new RWA(opts)

Initialize the peaq RWA SDK for a specific chain. The instance wires module addresses for that chain and exposes module entry points. A Provider is required at initialization and is used for read operations; write operations require an explicit Signer.

Parameters

Usage

TypeScript

JavaScript (ESM)

JavaScript (CommonJS)

Optional setup to use cjs. Remove "type": "module", from your package.json.