/api/v1/accounts
This endpoint returns the accounts of the access token creator with pagination
Last updated
This endpoint returns the accounts of the access token creator with pagination
Last updated
The response schema:
You can find the Base_ApiV1
and the PaginationResponse_ApiV1
interface here:
Accounts Object contains the following parameters:
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
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
Note about filtering currencies: The currencies stored by the back-end are JSON strings with the following interface: { name: string, native: boolean, contractAddress : string
} You must filter for them using a JSON string, else it won't work. Query the /api/v1 endpoint for available currencies per network and JSON.stringify() before you pass it as filter parameter!