/api/v1/accounts

This endpoint returns the accounts of the access token creator with pagination

The response schema:

interface v1_AccountsResponse extends Base_ApiV1 {
  accounts: Array<Account_ApiV1>;
  pagination: PaginationResponse_ApiV1;
}

You can find the Base_ApiV1 and the PaginationResponse_ApiV1 interface here:

Schema

Accounts Object contains the following parameters:

 {
  id: number;
  created_at: string;
  network: {
     name: string;
     rpc: string;
     chain_id: string;
     currency: string;
     virtual_accounts_contract: string;
     connected_wallets_contract: string;
     available_currencies: Array<{name: string,native: boolean,contract_address: string}>
   }
  commitment: string;
  name: string;
  closed: boolean;
  currency: {name: string,native: boolean,contract_address: string}                           };
  balance: string;
  account_type: "VIRTUALACCOUNT" | "CONNECTEDWALLET"
  creator_address: string;
}
  • id - A unique numeric identifier for the account

  • created_at - Account creation UTC date string

  • network - The details of the network the account is connected to

  • commitment - The unique identifier of the account, useful for querying the blockchain with.

  • name - The name of the account

  • closed - The status of the account, closed accounts are not usable anymore.

  • currency - The currency the account is using

  • balance - The account balance in the currency. Formatted Eth string! To convert to wei you need to parseEther

  • account_type - The account type determines which smart contract the account is using. Spell it using all caps

  • creator_address - The address of the account creator

The accounts can be sorted by using these parameters:

An Example GET request to fetch accounts sorted by network_id

  • current_page - The current page number to fetch. Pages are indexed from 0 and defaults to 0

  • page_size - Override the default page size. It will determine the total pages based on the count of results defaults to 0

  • sort_by - See the Accounts_sortBy enum for the accepted values. Defaults to created_at

  • sort_direction - DESC or ASC . Defaults to DESC

Filtering

You can request to filter the responses using the filter query parameter which must contain a JSON string! See the below pseudo code:

All the parameters of the filter are optional, you should only include the parameters you want to match exactly.

Here is an example GET request URL to fetch all active accounts (closed: false) on network BTT Testnet (network_id: 0x405) created by the access token creator

Last updated