List all Tokens

You can list all tokens in a project by sending a GET request to the /token endpoint, with the project name in the path.

List all tokens in a project.

GET https://api.playfix.io/token/<project_name>/tokens

Path Parameters

Name
Type
Description

<projeect_name>*

String

The name of the project that contains the token. It begins with "project/" followed by a ULID.

Example: projects/01gfav9m1c4zd6eq154th2pafz

Query Parameters

Name
Type
Description

pageSize

String

Max number of projects to return in a single page. Each response will contain one page. This can be any number from 1 to 100.

pageToken

String

Page token for next page. You can get this value from the nextPageToken field of a previous response.

Headers

Name
Type
Description

Authorization*

String

Bearer <your_access_token>

{
  "projectTokens": [
    {
    "name": "<token_name>",
    "project": "<project_name>",
    "title": "The Block Party Token",
    "config": {
      "name": "Blocked",
      "symbol": "BPT",
      "decimals": "18",
      "initialSupply": "1000",
      "totalSupply": "10000",
      "mintable": true,
      "burnable": true,
      "pausable": true,
      "permit": true,
      "votes": true,
      "flashMinting": true,
      "snapshots": true,
      "ownerAddress": "<your_wallet_address>"
      },
    "network": "NETWORK_POLYGON_MUMBAI",
    "address": "<contract_address>",
    "deployTxHash": ""
    }
  ],
  "nextPageToken": "tokens/01gfrhk235jhqp3rz31f2sjfj0"
}

Example cURL API Call

curl --request GET \
  --url 'https://api.playfix.io/token/<project_name>/tokens' \
  --header 'Authorization: Bearer <your_access_token>'

Example Python API Call

import requests

r = requests.get(
    "https://api.playfix.io/token/<project_name>/tokens",
    headers = {
        "Authorization": "Bearer <your_access_token>"
        }
    )

print(r.text)

Response

{
  "projectTokens": [
    {
    "name": "<token_name>",
    "project": "<project_name>",
    "title": "The Block Party Token",
    "config": {
      "name": "Blocked",
      "symbol": "BPT",
      "decimals": "18",
      "initialSupply": "1000",
      "totalSupply": "10000",
      "mintable": true,
      "burnable": true,
      "pausable": true,
      "permit": true,
      "votes": true,
      "flashMinting": true,
      "snapshots": true,
      "ownerAddress": "<your_wallet_address>"
      },
    "network": "NETWORK_POLYGON_MUMBAI",
    "address": "<contract_address>",
    "deployTxHash": ""
    }
  ],
  "nextPageToken": "tokens/01gfrhk235jhqp3rz31f2sjfj0"
}

Response Fields

  • projectTokens: An array of objects. Each object contains the details of a token.

  • nextPageToken: A string that enable you to query the next page if you have multiple tokens.

Use the nextPageToken as the value of the pageToken query parameter to view the next page of results if you have created more than 10 tokens.

Also, you can set the pageSize parameter to a number between 1 and 100 to increase the default number of tokens returned per page.

Example cURL API Call

curl --request GET \
  --url 'https://api.playfix.io/token/<project_name>/tokens?pageSize=100&pageToken=<your_nextPageToken>' \
  --header 'Authorization: Bearer <your_access_token>'

Example Python Call

import requests

r = requests.get(
    "https://api.playfix.io/token/<project_name>/tokens",
    params = {
        "pageToken": "<your_nextPageToken>".
        "pageSize": "100"
        },
    headers = {
        "Authorization": "Bearer <your_access_token>"
        }
    )

print(r.text)

Last updated