AssetRegistry is the SDK class for reading and writing metadata on an already-deployed Ankara Chain token. Pass it the adapter you used to configure TokenFactory, the token’s contract address, and the asset template string — it then exposes a fully typed method surface for every operation supported by that template.
AssetRegistry wraps an existing token; it does not deploy new ones. Use TokenFactory to deploy first, then construct an AssetRegistry with the returned tokenAddress.Import
Constructor
IAdapter
required
The
EVMAdapter or StellarAdapter instance. Obtain it from tokenFactory.adapter or construct one directly.string
required
The deployed token contract address (EVM hex address or Stellar contract ID).
AssetTemplate | NFTAssetTemplate
required
The asset template the token was deployed with. Must match the on-chain contract — the registry uses this to route calls to the correct ABI methods.Fungible templates:
"farmland" | "commodity" | "real-estate" | "invoice" | "carbon-credit" | "mining-rights"NFT templates: "farmland-nft" | "real-estate-nft" | "mining-rights-nft" | "commodity-vault-nft"Generic Read Methods
These methods work on all fungible templates.getName
getSymbol
getTotalSupply
getBalanceOf
string
required
The wallet or contract address to query.
getStatus
enum
DRAFT (0) · ACTIVE (1) · SUSPENDED (2) · REDEEMED (3) · EXPIRED (4)getCountryCode
getIdentityVerifier
getVersion
getMetadata
getValuationUSD
Generic Write Methods
These methods work on all fungible templates and require the appropriate on-chain role (typicallyDEFAULT_ADMIN_ROLE or MANAGER_ROLE).
setStatus
AssetStatus
required
The target status. Import
AssetStatus from @ankarachain/sdk.setIdentityVerifier
"0x0000000000000000000000000000000000000000") to remove KYC gating.
string
required
Address of the verifier contract, or the zero address to disable verification.
mint
MINTER_ROLE.
string
required
Recipient wallet address.
bigint
required
Amount in wei.
pause
unpause
Farmland & Real Estate Methods
updateValuation
farmland and real-estate templates only.
bigint
required
New valuation in wei (e.g.
150_000n * 10n ** 18n for $150,000).Real Estate Methods
updateOccupancyStatus
real-estate template.
string
required
One of
"Vacant", "Owner-occupied", or "Tenanted".declareRentalDistribution
real-estate template.
bigint
required
Total distribution amount in USD wei.
Commodity Methods
isExpired
true if the commodity’s expiryDate has passed. Only available on the commodity template.
markExpired
commodity template.
Invoice Methods
getInvoiceStatus
invoice template.
enum
PENDING (0) · FUNDED (1) · REPAID (2) · DEFAULTED (3)isOverdue
true if the invoice is past its due date and still in PENDING or FUNDED status.
markFunded
PENDING to FUNDED. Call this once the investor has funded the invoice.
markRepaid
REPAID. Call this once the debtor has settled the invoice.
markDefaulted
DEFAULTED and records a human-readable reason on-chain.
string
required
Free-text reason for default, e.g.
"Debtor insolvent — court reference NG/2024/0042".Carbon Credit Methods
retire
carbon-credit template.
bigint
required
Amount of credits to retire, in wei (1e18 = 1 tCO₂e).
string
required
Entity on whose behalf the offset is being made (can be a name string stored as calldata, or an address).
string
required
Reason or project reference, e.g.
"Flight offset — Abuja–Lagos Q1 2025".getTotalRetired
getTotalRetirements
getRetirement
string
Wallet address that called
retire().bigint
Credits retired in that event, in wei.
bigint
Unix timestamp of the retirement.
string
The beneficiary string passed to
retire().string
The note string passed to
retire().Mining Rights Methods
isLicenseExpired
true if the mining licence has passed its licenseExpiry timestamp.
renewLicense
bigint
required
New Unix timestamp for licence expiry.
markLicenseExpired
declareRoyalty
royaltyRateBps setting.
bigint
required
Total extraction value in USD wei for the period being declared.
NFT Methods
The following methods are only available when theAssetRegistry is constructed with an NFT template ("farmland-nft", "real-estate-nft", "mining-rights-nft", "commodity-vault-nft").
getTokenMetadata
getTokenVersion
ownerOf
linkToERC20
string
required
Address of the ERC-20 token to link.
Properties
Type Reference
Template-specific methods (
updateValuation, retire, etc.) throw a descriptive Error at runtime if called on a registry constructed with a different template. This is a developer-safety guard — the TypeScript types do not currently enforce the constraint at compile time, because the registry uses a single union template type.