Skip to content

Get all token contracts

Request

Retrieve all token contracts for the project. Only admins can access inactive tokens via ?active=false parameter. Use pagination parameters (page & limit) for optimal performance. Legacy support: returns array without params (deprecated - will be removed in future).

Security
projectKey
Query
activestring

Filter for active tokens only (default: true). Non-admin users always get active tokens only.

tokenTypesstring

Filter by token types (comma-separated: ERC20,ERC721,ERC1155)

contractAddressesstring

Include specific contract addresses (comma-separated). When used with tokenTypes=null, only these addresses are returned.

pagestring

Page number for pagination (1-based)

limitstring

Number of items per page

curl -i -X GET \
  'https://docs.pers.ninja/_mock/swagger/tokens?active=string&tokenTypes=string&contractAddresses=string&page=string&limit=string' \
  -H 'x-project-key: YOUR_API_KEY_HERE'

Responses

Tokens retrieved successfully

Bodyapplication/json
Array [
idstringrequired

Database UUID for this token contract entity

contractAddressstringrequired

Smart contract address deployed on the blockchain

metadataArray of objects(TokenMetadataDTO)

Token metadata templates - blueprints used when minting NFTs. Each template defines properties (name, image, expiry) and has a unique tokenMetadataIncrementalId. Null for ERC20 (Points) tokens.

abiobjectrequired

this is the abi of the contract, this is the interface of the contract to interact with it

chainIdnumberrequired

this is the chain id of the chain where the token is deployed

abiUrlstringrequired

this is the url of the abi of the contract, to be used to fetch the abi of the contract

namestring

this is the name of the token contract

symbolstring

this is the symbol of the token contract, this is optional and can be null

decimalsnumber

this is the decimals of the token. This is optional and only used for ERC20 tokens (Points)

isActivebooleanrequired

This can be used to enable or disable the token

isGallerybooleanrequired

This can be used to enable or disable the token for gallery

typestringrequired

This is the underlying web3 native type of the token contract

Enum:"ERC20""ERC1155""ERC721"
stampTokenbooleanrequired

When true, this ERC1155 contract is used as a shared stamp contract. TokenMetadata entries are auto-provisioned per business and can be referenced in redemption priceTokenUnits with resolveByBusiness=true.

Default:false
]
Response
[ { "id": "string", "contractAddress": "string", "metadata": [], "abi": {}, "chainId": 0, "abiUrl": "string", "name": "string", "symbol": "string", "decimals": 0, "isActive": true, "isGallery": true, "type": "ERC20", "stampToken": false } ]