Overview

TokenFactory is the main SDK class. It wraps the on-chain TokenFactory contract and provides a developer-friendly TypeScript API for deploying all six RWA token templates.

Constructor

Config options:

Deploy Methods

deployFarmland

Deploys a FarmlandToken contract via the factory. Example:

deployCommodity

Deploys a CommodityReceiptToken contract.

deployRealEstate

Deploys a RealEstateToken contract.

deployInvoice

Deploys an InvoiceToken contract.

deployCarbonCredit

Deploys a CarbonCreditToken contract.

deployMiningRights

Deploys a MiningRightsToken contract.

Query Methods

getDeployedTokens

Returns all token addresses deployed by a given wallet (defaults to the connected signer).

totalDeployed

Returns the total number of tokens deployed via this factory contract.

getBalance

Returns the native token balance (MATIC / ETH / BNB etc.) of a wallet, formatted as a human-readable string.

DeployResult

All deploy methods return:

Base Deploy Options

All deploy methods extend BaseDeployOptions:

Low-Level Adapter

For advanced use, the underlying EVMAdapter is exposed: