TOKEN_PROFILE_REQUIRED.
The module hangs off the client as trusset.tokens. None of its calls sends a transaction. The one signature it can ask for is the controller’s approval of an instrument record, a message signature that costs no gas.
Import a token
Detect first. Detection reads the contract and writes nothing, so a token that can only be refused is caught before the import.erc3643, erc1400, erc7943, erc1404, erc721, erc1155, erc20. A contract that answers none of them is refused with UNSUPPORTED_TOKEN. The import detects the contract again, so the stored framework is the chain’s answer, not anything you send.
assetType is your classification of the asset. It is not read from the chain and not verified. It is one of PUBLIC_EQUITY, PRIVATE_EQUITY, REAL_ESTATE, COMMODITY, ART, WATCH, INFRASTRUCTURE, BOND or CRYPTO_ASSET. An instance holds at most 200 active imports.
A token your instance issued through Trusset already belongs to it, so the import refuses it with TOKEN_IS_OWN. For an ERC-721 or ERC-1155 collection that does not declare its standard through ERC-165, pass assetStandard: 'ERC721' or 'ERC1155' to both calls. A collection that declares the other standard is refused with COLLECTION_STANDARD_MISMATCH.
Check which collateral mode a token supports
list returns every active import, newest first, unpaginated. With withLendingEligibility, each entry says whether a FREEZE or a CUSTODY market can be deployed on the token, with the reason when it cannot. lendingEligibility is null when the token could not be read just now, which is not a verdict. A FREEZE market needs the ERC-3643 agent surface. See Markets for what each mode means.
Publish the overview
The overview is your instance’s description of the asset:description, issuerName, sector, website, ammAddress and reserveURI. Every importer edits its own, whether or not it controls the token on chain.
setProfile replaces the whole overview. A key you leave out is cleared, so read the current overview and send it back with your changes, as above. null clears it. The SDK refuses any other key before sending: identifiers, the jurisdiction and offering documents belong to the instrument record.
Everything in the overview is your assertion. No field is verified against a register, a regulator or the chain, and wherever it surfaces downstream it is labelled ISSUER_ASSERTED.
Add an icon
upload pins a file to IPFS and returns the URI to reference it by. It takes a Blob or the file’s bytes.
purpose: 'image' only the four image types. SVG is refused because it can carry scripts. A document must be 1022 KB or smaller, and images are re-encoded before pinning. setImage(tokenAddress, null) clears the icon.
Publish the instrument record
The instrument record holds the token’s identifiers, legal terms, ranking, term, redemption, register and offering documents. There is one record per token and chain, and it is what a lender of record reads before it takes a market on the token. Everything in the record is an assertion of the instance that publishes it. A standard ISIN or LEI is checked against its check digits and markedARITHMETIC_VALIDATED, and anything else is stored as stated and marked ISSUER_STATED. Nothing is verified against a register or a regulator.
Only the token’s controller publishes the record: its owner(), a T-REX agent, or a holder of DEFAULT_ADMIN_ROLE. The API accepts a save on one of two authorities.
Your instance controls the token
When one of your instance’s verified wallets controls the token, or the token was issued through your instance, send the record alone.missingRequired lists the fields and documents the security class requires that the record still lacks. instrumentSchema() returns every field, its allowed values, and what each class requires.
The controller signs
When your instance does not control the token, the controller approves the record with a signature and your instance carries it. Pass the controller’s wallet as the signer. The controller’s wallet never becomes a wallet of your instance.{ signer } the SDK runs the whole flow. It checks the signer is on the instance’s chain and requests the approval message for exactly this body. The signer signs it with signMessage (EIP-191), and the SDK saves the record with that signature. Nothing is broadcast. At the save, the API reads the signer’s role on chain and refuses a wallet that is not the controller now with ISSUER_NOT_CONTROLLER.
The message binds the token, the chain, your instance, the exact content, the record version and the time. A signature older than ten minutes is refused with ISSUER_APPROVAL_EXPIRED, and one made before the record changed with ISSUER_APPROVAL_STALE. With a signer the SDK requests and saves in one call, so neither normally arises.
When another instance asserts the record, the SDK refuses before asking for a signature unless you send takeOver: true. A controller’s signed save with takeOver: true replaces that record.
Where the controller signs in another system, for example a Safe whose owners approve messages in their own flow, request the message, collect the signature there, and pass it as issuerApproval. Trusset checks a contract wallet’s signature through ERC-1271.
requestApproval runs every check the save runs on that body and writes nothing, so a record that would be refused is refused before anybody signs. Send the same body to both calls.
Release the record
Read a token
get returns the import record. instrument returns the instrument record with each field’s provenance and verification, your instance’s overview, and authority.holds, which says whether your instance can publish the record on its own.
holders() returns holder counts per imported token, keyed by the lowercase token address. Each count carries complete and indexing, because the counts come from an index that fills over time.
Keep the record current
Name, symbol, decimals, supply and metadata are read from the chain at import and then frozen.refresh reads the contract again and stores the new values only when the framework still matches the record. redetect runs detection again and stores its answer even when the framework changed, reporting the previous values. setAssetType changes your classification.
Remove an import
instrumentRecordKept says so. Importing the same address again creates a fresh record.
