Clients
Get the client’s details
GET
https://api.portalhq.io/api/v3/clients/me
This endpoint retrieves the details of the current client, including information about associated wallets.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token.
Example Response
Get the client’s assets by chain
GET
https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets
This endpoint retrieves the asset balances (native and token balances) for a specified blockchain. It provides detailed information on the native balance and token balances held by a given address on the specified chain.
Supported Chains
You can use either the full chain identifier or the shortcut for popular chains.- Monad Testnet (
eip155:10143
ormonad-testnet
) - Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
orsolana
) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
orsolana-devnet
) - Bitcoin (
bip122:000000000019d6689c085ae165831e93-p2wpkh
orbitcoin-p2wpkh
orbitcoin-segwit
) - Bitcoin Testnet (
bip122:000000000933ea01ad0ee984209779ba-p2wpkh
orbitcoin-p2wpkh-testnet
orbitcoin-segwit-testnet
) - Celo (
eip155:42220
orcelo
) - Celo Alfajores Testnet (
eip155:44787
orcelo-alfajores
) - Tron (
tron:mainnet
) - Tron Nile (
tron:nile
) - Tron Shasta (
tron:shasta
) - Stellar (
stellar:pubnet
) - Stellar Testnet (
stellar:testnet
) - Ethereum Mainnet (
eip155:1
orethereum
) - Ethereum Sepolia (
eip155:11155111
orsepolia
) - Base Mainnet (
eip155:8453
orbase
) - Base Sepolia (
eip155:84532
orbase-sepolia
) - Polygon Mainnet (
eip155:137
orpolygon
) - Polygon Amoy (
eip155:80002
orpolygon-amoy
) - Optimism Mainnet (
eip155:10
) - Binance Smart Chain (
eip155:56
) - Binance Smart Chain Testnet (
eip155:97
) - Fantom (
eip155:250
) - Moonbeam (
eip155:1284
) - Arbitrum Mainnet (
eip155:42161
) - Arbitrum Sepolia (
eip155:421614
) - Avalanche Mainnet (
eip155:43114
) - Linea Mainnet (
eip155:59144
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format or chain identifier shortcut (e.g. eip155:10143 or monad-testnet ). |
includeNfts | Boolean - Defaults to false | Optionally includes the NFTs of the client on the specified chain. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
Get the client’s assets by chain (NFTs only)
GET
https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/nfts
This endpoint retrieves the NFT assets for a specified blockchain.
Supported Chains
You can use either the full chain identifier or the shortcut for popular chains.- Ethereum Mainnet (
eip155:1
orethereum
) - Ethereum Sepolia (
eip155:11155111
orsepolia
) - Base Mainnet (
eip155:8453
orbase
) - Base Sepolia (
eip155:84532
orbase-sepolia
) - Polygon Mainnet (
eip155:137
orpolygon
) - Polygon Amoy (
eip155:80002
orpolygon-amoy
) - Optimism Mainnet (
eip155:10
) - Binance Smart Chain (
eip155:56
) - Binance Smart Chain Testnet (
eip155:97
) - Fantom (
eip155:250
) - Moonbeam (
eip155:1284
) - Arbitrum Mainnet (
eip155:42161
) - Avalanche Mainnet (
eip155:43114
) - Linea Mainnet (
eip155:59144
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format or chain identifier shortcut (e.g. eip155:10143 or monad-testnet ). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
Get the client’s Solana transaction history
GET
https://api.portalhq.io/api/v3/clients/me/chains/:chain/transactions
Retrieves the client’s transaction history for a specific chain.
Supported Chains
- Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
orsolana
) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
orsolana-devnet
)
You can find the EVM Portal client transaction history endpoint here.
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
chain * | String | Must be in CAIP-2 format or chain identifier shortcut (e.g. eip155:10143 or monad-testnet ). |
Query Parameters
Name | Type | Description |
---|---|---|
limit | Number | The max amount of transactions returned in the request. Defaults to 1000 . |
offset | Number | The number of transactions to skip before returning results. Used for pagination when combined with the limit parameter. Defaults to 0 . |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
Get the client’s EIP-155 transaction history
GET
https://api.portalhq.io/api/v3/clients/me/transactions
Retrieves the client’s transaction history for a specific chain.
Supported Chains
- Monad Testnet (
eip155:10143
) - Ethereum Mainnet (
eip155:1
) - Ethereum Sepolia (
eip155:11155111
) - Base Mainnet (
eip155:8453
) - Base Sepolia (
eip155:84532
) - Polygon Mainnet (
eip155:137
) - Polygon Mumbai (
eip155:80001
) - Polygon Amoy (
eip155:80002
) - Arbitrum (
eip155:42161
) - Arbitrum Sepolia (
eip155:421614
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format (e.g. "eip155:10143" ). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
Fund wallet with testnet tokens
POST
https://api.portalhq.io/api/v3/clients/me/fund
Sends testnet tokens to your Portal client’s wallet.
Supported Chains
- Monad Testnet (
eip155:10143
)- Up to
0.01
MON
per Portal client per 24 hours.
- Up to
- Ethereum Sepolia (
eip155:11155111
)- Up to
0.01
ETH
per Portal client per 24 hours.
- Up to
- Celo Alfajores (
eip155:44787
)- Up to
0.1
CELO
per Portal client per 24 hours.
- Up to
- Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
)- Up to
0.01
SOL
per Portal client per 24 hours.
- Up to
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Body Parameters
Name | Type | Description |
---|---|---|
chainId * | String | The CAIP-2 chainId you want to receive testnet tokens on. |
token * | String | The testnet token you want to receive. |
amount * | String | The amount to transfer (as a string, in the token’s primary denomination). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
Build a transaction
POST
https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/send/build-transaction
Creates an unsigned transaction for transferring assets to another address on a specific chain. You can then use this unsigned transaction to sign and submit the transaction.
Supported Chains
- You can use any of the following friendly chain names for the
chain
path param (or alternatively you can use the CAIP-2chainId
):monad-testnet
(eip155:10143
)ethereum
(eip155:1
)sepolia
(eip155:11155111
)base
(eip155:8453
)base-sepolia
(eip155:84532
)polygon
(eip155:137
)polygon-mumbai
(eip155:80001
)celo
(eip155:42220
)celo-alfajores
(eip155:44787
)solana
(solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
)solana-devnet
(solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
)tron
(tron:mainnet
)tron-nile
(tron:nile
)tron-shasta
(tron:shasta
)stellar
(stellar:pubnet
)stellar-testnet
(stellar:testnet
)bitcoin-segwit
(bip122:000000000019d6689c085ae165831e93-p2wpkh
)bitcoin-segwit-testnet
(bip122:000000000933ea01ad0ee984209779ba-p2wpkh
)bitcoin-p2wpkh
(bip122:000000000019d6689c085ae165831e93-p2wpkh
)bitcoin-p2wpkh-testnet
(bip122:000000000933ea01ad0ee984209779ba-p2wpkh
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
chain * | String | Must be one of the chains in “Supported Chains”. |
Body Parameters
Name | Type | Description |
---|---|---|
to * | String | The recipient’s address. |
token * | String | The token symbol (e.g., “USDC”) or contract address or mint address (for Solana). For native token transfers, use "NATIVE" . |
amount * | String | The amount to transfer (as a string, in the token’s primary denomination). For example, “0.01” is 1 cent of USDC. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
The response includes the unsigned transaction details and metadata. The structure of the response differs depending on whether the chain is Solana or an EIP-155 chain (e.g., Ethereum, Polygon, Base).Notes
- The
token
field can accept either a token symbol (e.g. “USDC” or “USDT”) or a contract address (for EIP-155 tokens) or a mint address (for Solana tokens). - The
amount
should be provided in the token’s primary denomination (e.g. whole USDC, not micro-USDC). - This endpoint creates an unsigned transaction. The client is responsible for signing the transaction before broadcasting it to the network.
- The response structure differs between Solana and EIP-155 chains. Make sure to handle both response types in your implementation.
Simulate + validate a transaction
POST
https://api.portalhq.io/api/v3/clients/me/evaluate-transaction
This endpoint evaluates a transaction by either simulating its execution or validating its authenticity (or both). The evaluation provides detailed insights into the transaction, including potential changes in asset balances, exposures, and a classification of the transaction’s risk.
Supported Chains
- Ethereum Mainnet (
eip155:1
) - Ethereum Sepolia (
eip155:11155111
) - Optimism Mainnet (
eip155:10
) - Binance Smart Chain (
eip155:56
) - Polygon Mainnet (
eip155:137
) - Blast Mainnet (
eip155:238
) - zkSync Mainnet (
eip155:324
) - zkSync Sepolia (
eip155:300
) - Base Mainnet (
eip155:8453
) - Base Sepolia (
eip155:84532
) - Immutable zkEVM (
eip155:13371
) - Arbitrum Mainnet (
eip155:42161
) - Avalanche Fuji (
eip155:43113
) - Avalanche Mainnet (
eip155:43114
) - Linea Mainnet (
eip155:59144
) - Scroll Mainnet (
eip155:534352
) - Zora Mainnet (
eip155:7777777
) - Degen Mainnet (
eip155:666666666
) - Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format (e.g. eip155:11155111 , solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 ). |
Body Parameters
Name | Type | Description |
---|---|---|
to (Required) | String | The recipient’s address. |
gas | String | The gas limit provided for the transaction. |
gasPrice | String | The price per unit of gas the sender is willing to pay. |
maxFeePerGas | String | The maximum total fee per gas unit the sender is willing to pay. |
maxPriorityFeePerGas | String | The maximum priority fee per gas unit the sender is willing to pay. |
value | String | The amount of native token to send with the transaction. |
data | String | The input data to send with the transaction (used for contract calls). |
operationType |
| The operation to perform with the transaction. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the chain
with a valid chain value.
Example Response
Swaps
For all swap endpoints, you will need to provide a 0x API key. You can get one by signing up for a 0x account here.Get available swap sources
POST
https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/swap/sources
This endpoint retrieves the available swap sources for a specific chain.
Supported Chains
- Ethereum (
eip155:1
) - Monad Testnet (
eip155:10143
) - Base (
eip155:8453
) - Arbitrum (
eip155:42161
) - Optimism (
eip155:10
) - Avalanche (
eip155:43114
) - Polygon (
eip155:137
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
chain * | String | Must be one of the chains in “Supported Chains”. |
Body Parameters
Name | Type | Description |
---|---|---|
zeroXApiKey * | String | Your 0x API key for swap functionality. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token, the chain
with a valid chain value, and the zeroXApiKey
with your 0x API key.
Example Response
Get swap quote
POST
https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/swap/quote
This endpoint retrieves a swap quote for trading tokens on a specific chain.
Supported Chains
- Ethereum (
eip155:1
) - Monad Testnet (
eip155:10143
) - Base (
eip155:8453
) - Arbitrum (
eip155:42161
) - Optimism (
eip155:10
) - Avalanche (
eip155:43114
) - Polygon (
eip155:137
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
chain * | String | Must be one of the chains in “Supported Chains”. |
Body Parameters
Name | Type | Description |
---|---|---|
zeroXApiKey * | String | Your 0x API key for swap functionality. |
buyToken * | String | The token symbol you want to buy (e.g., “ETH”, “USDC”, “0x123abc”). |
sellToken * | String | The token symbol you want to sell (e.g., “ETH”, “USDC”, “0x123abc”). |
sellAmount * | String | The amount to sell (in wei for ETH, or smallest unit for tokens). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token, the chain
with a valid chain value, and the zeroXApiKey
with your 0x API key.
Example Response
Get swap price
POST
https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/swap/price
This endpoint retrieves a swap price for trading tokens on a specific chain without building a transaction.
Supported Chains
- Ethereum (
eip155:1
) - Monad Testnet (
eip155:10143
) - Base (
eip155:8453
) - Arbitrum (
eip155:42161
) - Optimism (
eip155:10
) - Avalanche (
eip155:43114
) - Polygon (
eip155:137
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Path Parameters
Name | Type | Description |
---|---|---|
chain * | String | Must be one of the chains in “Supported Chains”. |
Body Parameters
Name | Type | Description |
---|---|---|
zeroXApiKey * | String | Your 0x API key for swap functionality. |
buyToken * | String | The token symbol you want to buy (e.g., “ETH”, “USDC”, “0x123abc”). |
sellToken * | String | The token symbol you want to sell (e.g., “ETH”, “USDC”, “0x123abc”). |
sellAmount * | String | The amount to sell (in wei for ETH, or smallest unit for tokens). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token, the chain
with a valid chain value, and the zeroXApiKey
with your 0x API key.
Example Response
Client Shares
Update the client’s signing share pairs’ statuses
PATCH
https://api.portalhq.io/api/v3/clients/me/signing-share-pairs
Updates a client’s signing share pairs’ statuses. Intended to be used after successfully storing the client signing share on the client’s device.
Do not use this endpoint if you are using the Portal SDKs. The Portal SDKs already use this endpoint internally for your convenience.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Body Parameters
Name | Type | Description |
---|---|---|
signingSharePairIds * | String[] | An array of signing share pair IDs. |
status * | "STORED_CLIENT" | The updated status of the signing share pairs. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token.
Example Response
Update the client’s backup share pairs’ statuses
PATCH
https://api.portalhq.io/api/v3/clients/me/backup-share-pairs
Updates a client’s backup share pairs’ statuses. Intended to be used after successfully storing the encrypted client backup share.
Do not use this endpoint if you are using the Portal SDKs. The Portal SDKs already use this endpoint internally for your convenience.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Body Parameters
Name | Type | Description |
---|---|---|
backupSharePairIds * | String[] | An array of backup share pair IDs. |
status * | "STORED_CLIENT_BACKUP_SHARE_KEY" | "STORED_CLIENT_BACKUP_SHARE" | The updated status of the backup share pairs. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token.
Example Response
Store the client’s encrypted backup share for Portal-Managed Backups
PATCH
https://api.portalhq.io/api/v3/clients/me/backup-share-pairs/:backupSharePairId
Stores a client’s encrypted backup share for Portal-Managed Backups. This endpoint is used when running eject while using the Enclave MPC API with a Portal-Managed Backup configuration. Call this endpoint once for the SECP256K1 share and once for the ED25519 share.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Body Parameters
Name | Type | Description |
---|---|---|
clientCipherText * | String | The ciphertext from encrypting a backup share. |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the backupSharePairId
with the relevant backup share pair ID.
Example Response
Get the encrypted client backup share for Portal-Managed Backups
GET
https://api.portalhq.io/api/v3/clients/me/backup-share-pairs/:backupSharePairId/cipher-text
Your custodian must be using Portal-Managed Backups to use this endpoint. Fetches a client’s encrypted backup share for Portal-Managed Backups. This endpoint is used when running eject while using the Enclave MPC API with a Portal-Managed Backup configuration.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the backupSharePairId
with the relevant backup share pair ID.
Example Response
Get the ejectable backup shares for Portal-Managed Backups
GET
https://api.portalhq.io/api/v3/clients/me/wallets/:walletId/ejectable-backup-shares
You must have made the wallet ejectable before using this endpoint. Your custodian must be using Portal-Managed Backups to use this endpoint. Fetches a client’s encrypted backup share and their custodian backup share. This endpoint is used when running eject while using the Enclave MPC API with a Portal-Managed Backup configuration.
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token and the walletId
with the relevant Portal client wallet ID.
Example Response
Deprecated Endpoints:
Get the client’s NFTs by chain (@deprecated)
GET
https://api.portalhq.io/api/v3/clients/me/nfts
This endpoint retrieves the NFTs for the client for a particular chain.
Supported Chains
- Ethereum Mainnet (
eip155:1
) - Ethereum Goerli (
eip155:5
) // @deprecated - Ethereum Sepolia (
eip155:11155111
) - Base Mainnet (
eip155:8453
) - Base Sepolia (
eip155:84532
) - Polygon Mainnet (
eip155:137
) - Polygon Mumbai (
eip155:80001
) - Polygon Amoy (
eip155:80002
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format (e.g. "eip155:10143" ). |
Example Response
Simulate a transaction (@deprecated)
POST
https://api.portalhq.io/api/v3/clients/me/simulate-transaction
Simulates a transaction for a specific chain.
Supported Chains
- Ethereum Mainnet (
eip155:1
) - Ethereum Goerli (
eip155:5
) // @deprecated - Ethereum Sepolia (
eip155:11155111
) - Base Mainnet (
eip155:8453
) - Base Sepolia (
eip155:84532
) - Polygon Mainnet (
eip155:137
) - Polygon Mumbai (
eip155:80001
) - Polygon Amoy (
eip155:80002
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format (e.g. "eip155:10143" ). |
Body Parameters
Name | Type | Description |
---|---|---|
from * | String | The sender’s address. |
to * | String | The recipient’s address. |
gas | String | The gas limit provided for the transaction. |
gasPrice | String | The price per unit of gas the sender is willing to pay. |
maxFeePerGas | String | The maximum total fee per gas unit the sender is willing to pay. |
maxPriorityFeePerGas | String | The maximum priority fee per gas unit the sender is willing to pay. |
value | String | The amount of native token to send with the transaction. |
data | String | The input data to send with the transaction (used for contract calls). |
nonce | String | The transaction count of the sender’s address, used to ensure uniqueness. |
Example Response
Get the client’s ERC20 assets by chain (@deprecated)
GET
https://api.portalhq.io/api/v3/clients/me/balances
Retrieves the client’s ERC20 balances for a specific chain.
Supported Chains
- Ethereum Mainnet (
eip155:1
) - Ethereum Goerli (
eip155:5
) // @deprecated - Ethereum Sepolia (
eip155:11155111
) - Base Mainnet (
eip155:8453
) - Base Sepolia (
eip155:84532
) - Polygon Mainnet (
eip155:137
) - Polygon Mumbai (
eip155:80001
) - Polygon Amoy (
eip155:80002
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Query Parameters
Name | Type | Description |
---|---|---|
chainId * | String | Must be in CAIP-2 format (e.g. "eip155:10143" ). |
Example Response
Get swap quote (@deprecated)
POST
https://api.portalhq.io/api/v3/swaps/quote
This endpoint retrieves a swap quote for trading tokens on a specific chain.
This endpoint is deprecated. Use the new swap endpoints under the Swaps section instead.
Supported Chains
- Ethereum (
eip155:1
) - Monad Testnet (
eip155:10143
) - Base (
eip155:8453
) - Arbitrum (
eip155:42161
) - Optimism (
eip155:10
) - Avalanche (
eip155:43114
) - Polygon (
eip155:137
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Body Parameters
Name | Type | Description |
---|---|---|
address * | String | The client’s address. |
apiKey * | String | Your 0x API key for swap functionality. |
chainId * | String | Must be in CAIP-2 format (e.g. "eip155:10143" ). |
buyToken * | String | The token symbol you want to buy (e.g., “ETH”, “USDC”, “0x123abc”). |
sellToken * | String | The token symbol you want to sell (e.g., “ETH”, “USDC”, “0x123abc”). |
sellAmount * | String | The amount to sell (in wei for ETH, or smallest unit for tokens). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token, the address
with the client’s address, the apiKey
with your 0x API key, and the chainId
with a valid chain value.
Example Response
Get swap sources (@deprecated)
POST
https://api.portalhq.io/api/v3/swaps/sources
This endpoint retrieves the available swap sources for a specific chain.
This endpoint is deprecated. Use the new swap endpoints under the Swaps section instead.
Supported Chains
- Ethereum (
eip155:1
) - Monad Testnet (
eip155:10143
) - Base (
eip155:8453
) - Arbitrum (
eip155:42161
) - Optimism (
eip155:10
) - Avalanche (
eip155:43114
) - Polygon (
eip155:137
)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143
), ensure the URL is URI encoded to accommodate the ”:” character.Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer <Client API Key> |
Content-Type* | String | application/json |
Body Parameters
Name | Type | Description |
---|---|---|
apiKey * | String | Your 0x API key for swap functionality. |
chainId * | String | Must be in CAIP-2 format (e.g. "eip155:10143" ). |
Example Request
Be sure to replace the[token]
with either a Client API Key or a Client Session Token, the apiKey
with your 0x API key, and the chainId
with a valid chain value.