Sections
- Clients
- Client Shares
- Swaps
- 0x Integration
- Yield.xyz Integration
- Li.Fi Integration
- Blockaid Integration
- Deprecated Endpoints
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
- 200: OK Success
- 400: Bad Request
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:10143ormonad-testnet) - Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdporsolana) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1orsolana-devnet) - Bitcoin (
bip122:000000000019d6689c085ae165831e93-p2wpkhorbitcoin-p2wpkhorbitcoin-segwit) - Bitcoin Testnet (
bip122:000000000933ea01ad0ee984209779ba-p2wpkhorbitcoin-p2wpkh-testnetorbitcoin-segwit-testnet) - Celo (
eip155:42220orcelo) - Celo Alfajores Testnet (
eip155:44787orcelo-alfajores) - Tron (
tron:mainnet) - Tron Nile (
tron:nile) - Tron Shasta (
tron:shasta) - Stellar (
stellar:pubnet) - Stellar Testnet (
stellar:testnet) - Ethereum Mainnet (
eip155:1orethereum) - Ethereum Sepolia (
eip155:11155111orsepolia) - Base Mainnet (
eip155:8453orbase) - Base Sepolia (
eip155:84532orbase-sepolia) - Polygon Mainnet (
eip155:137orpolygon) - Polygon Amoy (
eip155:80002orpolygon-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
- 200: Success
- 400: Bad Request
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:1orethereum) - Ethereum Sepolia (
eip155:11155111orsepolia) - Base Mainnet (
eip155:8453orbase) - Base Sepolia (
eip155:84532orbase-sepolia) - Polygon Mainnet (
eip155:137orpolygon) - Polygon Amoy (
eip155:80002orpolygon-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
- 200: Success
- 400: Bad Request
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:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdporsolana) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1orsolana-devnet)
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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.01MONper Portal client per 24 hours.
- Up to
- Ethereum Sepolia (
eip155:11155111)- Up to
0.01ETHper Portal client per 24 hours.
- Up to
- Celo Alfajores (
eip155:44787)- Up to
0.1CELOper Portal client per 24 hours.
- Up to
- Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)- Up to
0.01SOLper 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
- 200: EIP-155 Response
- 429: Too Many Requests
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
chainpath 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).- 200: EIP-155 Response
- 200: Solana Response
- 200: Bitcoin Response
- 400: Bad Request
Notes
- The
tokenfield 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
amountshould 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
- EIP-155
- Solana
| 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
- 200: EIP-155 Success
- 200: Solana Success
- 400: Bad Request
Delegations
Approve a delegation
POST https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/:asset/approvals
Creates an approval transaction to delegate spending authority for a specific token to another address. Returns the unsigned transaction(s) ready for signing.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana Mainnet). |
asset* | String | Token identifier specified by token address or symbol (e.g. USDC) to approve for delegation. |
Body Parameters
| Name | Type | Description |
|---|---|---|
delegateAddress* | String | The address that will be granted spending authority. |
amount* | String | The maximum amount the delegate can spend (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 [asset] with the token symbol or address.
Example Response
- 200: Success (EVM)
- 200: Success (Solana)
- 400: Bad Request
Revoke a delegation
POST https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/:asset/revocations
Creates a revocation transaction to remove spending authority for a specific token from a delegated address. Returns the unsigned transaction(s) ready for signing.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana Mainnet). |
asset* | String | Token identifier specified by token address or symbol (e.g. USDC) to revoke delegation for. |
Body Parameters
| Name | Type | Description |
|---|---|---|
delegateAddress* | String | The address whose spending authority will be revoked. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token, and the [asset] with the token symbol or address.
Example Response
- 200: Success (EVM)
- 200: Success (Solana)
- 400: Bad Request
Get delegation status for an address
GET https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/:asset/delegations
Retrieves the current delegation status for a specific token, including the balance and delegation status for the specified delegate address.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana Mainnet). |
asset* | String | Token identifier specified by token address or symbol (e.g. USDC) to check delegation status for. |
Query Parameters
| Name | Type | Description |
|---|---|---|
delegateAddress* | String | The delegate address to check delegation status for. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token, and the [asset] with the token symbol or address.
Example Response
- 200: Success (EVM)
- 200: Success (Solana)
- 400: Bad Request
Transfer as a delegate
POST https://api.portalhq.io/api/v3/clients/me/chains/:chain/assets/:asset/delegations/transfers
Transfers tokens on behalf of another address using delegated spending authority. This allows a delegate to move tokens from the owner’s address to a recipient. Returns the unsigned transaction(s) ready for signing.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana Mainnet). |
asset* | String | Token identifier specified by token address or symbol (e.g. USDC) to transfer. |
Body Parameters
| Name | Type | Description |
|---|---|---|
fromAddress* | String | The address of the token owner whose tokens will be transferred. |
toAddress* | String | The recipient address that will receive the tokens. |
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, the [chain] with a valid CAIP-2 chain ID (URL encoded), and the [asset] with the token symbol or address.
Example Response
- 200: Success (EVM)
- 200: Success (Solana)
- 400: Bad Request
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.
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
- 204: Success, No Content
- 400: Bad Request
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.
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
- 204: Success, No Content
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
0x Integration
For all 0x integration endpoints, the system will attempt to use a Portal-managed 0x API key if available for your environment. You can optionally provide your own 0x API key in the request body using thezeroXApiKey field. You can get a 0x API key by signing up for a 0x account here.
Get available swap sources
POST https://api.portalhq.io/api/v3/clients/me/integrations/0x/swap/sources
This endpoint retrieves the available swap sources (liquidity providers) for a specific chain.
Supported Chains
- Monad Testnet (
eip155:10143) - Ethereum (
eip155:1) - Arbitrum (
eip155:42161) - Avalanche (
eip155:43114) - BSC (
eip155:56) - Base (
eip155:8453) - Berachain (
eip155:80094) - Blast (
eip155:81457) - Ink (
eip155:57073) - Linea (
eip155:59144) - Mantle (
eip155:5000) - Mode (
eip155:34443) - Optimism (
eip155:10) - Polygon (
eip155:137) - Scroll (
eip155:534352) - Unichain (
eip155:130) - Worldchain (
eip155:480)
When using CAIP-2 chain formats (e.g.
eip155:1), ensure the chainId in the request body is properly formatted..Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chainId* | String | Must be in CAIP-2 format (e.g. "eip155:1"). |
zeroXApiKey | String | Optional. Your 0x API key for swap functionality. If not provided, Portal will use a managed key if available. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Get swap quote
POST https://api.portalhq.io/api/v3/clients/me/integrations/0x/swap/quote
This endpoint retrieves a swap quote with full transaction details for trading tokens on a specific chain. Use this endpoint when you’re ready to execute a swap and need the complete transaction to sign and broadcast.
Supported Chains
- Monad Testnet (
eip155:10143) - Ethereum (
eip155:1) - Arbitrum (
eip155:42161) - Avalanche (
eip155:43114) - BSC (
eip155:56) - Base (
eip155:8453) - Berachain (
eip155:80094) - Blast (
eip155:81457) - Ink (
eip155:57073) - Linea (
eip155:59144) - Mantle (
eip155:5000) - Mode (
eip155:34443) - Optimism (
eip155:10) - Polygon (
eip155:137) - Scroll (
eip155:534352) - Unichain (
eip155:130) - Worldchain (
eip155:480)
When using CAIP-2 chain formats (e.g.
eip155:1), ensure the chainId in the request body is properly formatted.Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chainId* | String | Must be in CAIP-2 format (e.g. "eip155:1"). |
buyToken* | String | The token symbol you want to buy (e.g., “ETH”, “USDC”) or token address. |
sellToken* | String | The token symbol you want to sell (e.g., “ETH”, “USDC”) or token address. |
sellAmount* | String | The amount to sell in the smallest unit (e.g., wei for ETH, or smallest unit for tokens). |
zeroXApiKey | String | Optional. Your 0x API key for swap functionality. If not provided, Portal will use a managed key if available. |
slippageBps | Number | Optional. Maximum acceptable slippage in basis points (e.g., 100 = 1%). |
excludedSources | String | Optional. Comma-separated list of liquidity sources to exclude. |
swapFeeRecipient | String | Optional. Address to receive swap fees. |
swapFeeBps | Number | Optional. Swap fee in basis points. |
swapFeeToken | String | Optional. Token to collect fees in. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Get swap price
POST https://api.portalhq.io/api/v3/clients/me/integrations/0x/swap/price
This endpoint retrieves a swap price estimate for trading tokens on a specific chain without building a complete transaction. Use this endpoint for displaying price quotes to users before they commit to a swap.
Supported Chains
- Monad Testnet (
eip155:10143) - Ethereum (
eip155:1) - Arbitrum (
eip155:42161) - Avalanche (
eip155:43114) - BSC (
eip155:56) - Base (
eip155:8453) - Berachain (
eip155:80094) - Blast (
eip155:81457) - Ink (
eip155:57073) - Linea (
eip155:59144) - Mantle (
eip155:5000) - Mode (
eip155:34443) - Optimism (
eip155:10) - Polygon (
eip155:137) - Scroll (
eip155:534352) - Unichain (
eip155:130) - Worldchain (
eip155:480)
When using CAIP-2 chain formats (e.g.
eip155:1), ensure the chainId in the request body is properly formatted..Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chainId* | String | Must be in CAIP-2 format (e.g. "eip155:1"). |
buyToken* | String | The token symbol you want to buy (e.g., “ETH”, “USDC”) or token address. |
sellToken* | String | The token symbol you want to sell (e.g., “ETH”, “USDC”) or token address. |
sellAmount* | String | The amount to sell in the smallest unit (e.g., wei for ETH, or smallest unit for tokens). |
zeroXApiKey | String | Optional. Your 0x API key for swap functionality. If not provided, Portal will use a managed key if available. |
slippageBps | Number | Optional. Maximum acceptable slippage in basis points (e.g., 100 = 1%). |
excludedSources | String | Optional. Comma-separated list of liquidity sources to exclude. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Yield.xyz Integration
Get yield opportunities
GET https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/yields
This proxy endpoint retrieves a paginated list of available yield opportunities across all supported networks and protocols.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Query Parameters
| Name | Type | Description |
|---|---|---|
offset | Number | Number of results to skip (for pagination). Defaults to 0. |
limit | Number | Maximum number of results to return. Defaults to 100. |
network | String | Network identifier in CAIP-2 format (e.g., eip155:1 for Ethereum). |
networks | String[] | Array of network identifiers in CAIP-2 format. |
yieldId | String | Specific yield opportunity ID. |
yieldIds | String[] | Array of specific yield opportunity IDs. |
type | String | Type of yield mechanism (staking, restaking, lending, vault, fixed_yield, real_world_asset). |
types | String[] | Array of yield mechanism types. |
hasCooldownPeriod | Boolean | Filter by cooldown period requirement. |
hasWarmupPeriod | Boolean | Filter by warmup period requirement. |
token | String | Token contract address to filter by. |
inputToken | String | Input token symbol or address. |
inputTokens | String[] | Array of input token symbols or addresses. |
provider | String | Protocol provider (e.g., aave, compound). |
providers | String[] | Array of protocol providers. |
search | String | Search term for yield opportunities. |
sort | String | Sorting criteria (statusEnterAsc, statusEnterDesc, statusExitAsc, statusExitDesc). |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Get yield balances
POST https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/yields/balances
This endpoint retrieves balances for multiple wallet addresses across different networks and yield opportunities.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
queries* | Array | Array of balance query objects. |
queries[].address* | String | Wallet address to query balances for. |
queries[].network* | String | Network identifier in CAIP-2 format (e.g., eip155:1 for Ethereum). |
queries[].yieldId | String | Optional specific yield opportunity ID to query. |
queries[].arguments | Object | Optional arguments for the yield position. (View the original Yield.xyz API endpoint for available arguments here) |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Enter yield position
POST https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/actions/enter
This endpoint creates an action to enter a yield position.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
yieldId* | String | The yield opportunity ID to enter. |
address* | String | The wallet address to use for the yield position. |
arguments | Object | Optional arguments for the yield entry. View the original Yield.xyz API endpoint for available arguments here |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Exit yield position
POST https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/actions/exit
This endpoint creates an action to exit a yield position.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
yieldId* | String | The yield opportunity ID to exit. |
address* | String | The wallet address that holds the yield position. |
arguments | Object | Optional arguments for the yield exit. View the original Yield.xyz API endpoint for available arguments here |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Manage yield position
POST https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/actions/manage
This endpoint creates an action to manage an existing yield position (claim rewards, compound, etc.).
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
yieldId* | String | The yield opportunity ID to manage. |
address* | String | The wallet address that holds the yield position. |
action* | String | The type of management action (STAKE, UNSTAKE, CLAIM_REWARDS, RESTAKE_REWARDS, WITHDRAW, WITHDRAW_ALL, RESTAKE, CLAIM_UNSTAKED, UNLOCK_LOCKED, STAKE_LOCKED, VOTE, REVOKE, VOTE_LOCKED, REVOTE, REBOND, MIGRATE, VERIFY_WITHDRAW_CREDENTIALS, DELEGATE). |
passthrough* | String | Passthrough data from the balance’s pending actions. |
arguments | Object | Optional arguments for the yield management action. View the original Yield.xyz API endpoint for available arguments here |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Submit transaction hash
PUT https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/transactions/:transactionId/submit-hash
This endpoint submits a transaction hash after broadcasting a transaction to the network.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
transactionId* | String | The transaction ID to submit the hash for. |
Body Parameters
| Name | Type | Description |
|---|---|---|
hash* | String | The transaction hash from the broadcasted transaction. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token and the [transactionId] with the actual transaction ID.
Example Response
- 200: Success
- 400: Bad Request
Get transaction details
GET https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/transactions/:transactionId
This endpoint retrieves details for a specific transaction.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
transactionId* | String | The transaction ID to retrieve details for. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token and the [transactionId] with the actual transaction ID.
Example Response
- 200: Success
- 400: Bad Request
Get historical actions
GET https://api.portalhq.io/api/v3/clients/me/integrations/yield-xyz/actions
This endpoint retrieves historical yield actions for a client with optional filtering.
View the original Yield.xyz API endpoint here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Query Parameters
| Name | Type | Description |
|---|---|---|
offset | Number | Number of results to skip (for pagination). Defaults to 0. |
limit | Number | Maximum number of results to return. Defaults to 100. |
address* | String | Filter by wallet address. |
status | String | Filter by action status (pending, completed, failed). |
intent | String | Filter by action intent (enter, manage, exit). |
type | String | Filter by action type (STAKE, UNSTAKE, CLAIM_REWARDS, RESTAKE_REWARDS, WITHDRAW, WITHDRAW_ALL, RESTAKE, CLAIM_UNSTAKED, UNLOCK_LOCKED, STAKE_LOCKED, VOTE, REVOKE, VOTE_LOCKED, REVOTE, REBOND, MIGRATE, VERIFY_WITHDRAW_CREDENTIALS, DELEGATE). |
yieldId | String | Filter by yield opportunity ID. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Li.Fi Integration
Get Li.Fi quote
POST https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote
This proxy endpoint retrieves a quote for bridging or swapping tokens across chains using Li.Fi.
View the original Li.Fi API documentation here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
fromChain* | String | Source chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum). |
fromAmount* | String | Amount to bridge/swap in the smallest unit (e.g., wei for ETH). |
fromToken* | String | Source token symbol (e.g., ETH) or contract address. |
toChain* | String | Destination chain identifier in CAIP-2 format (e.g., eip155:137 for Polygon). |
toToken* | String | Destination token symbol (e.g., USDC) or contract address. |
fromAddress* | String | Wallet address initiating the bridge/swap. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Get Li.Fi routes
POST https://api.portalhq.io/api/v3/clients/me/integrations/lifi/routes
This proxy endpoint retrieves available routes for bridging or swapping tokens across chains using Li.Fi.
View the original Li.Fi API documentation here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
fromChainId* | String | Source chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum). |
fromAmount* | String | Amount to bridge/swap in the smallest unit (e.g., wei for ETH). |
fromTokenAddress* | String | Source token contract address or symbol (e.g., 0x0000000000000000000000000000000000000000 for native ETH or ETH). |
toChainId* | String | Destination chain identifier in CAIP-2 format (e.g., eip155:137 for Polygon). |
toTokenAddress* | String | Destination token contract address or symbol (e.g., USDC). |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Get Li.Fi route step details
POST https://api.portalhq.io/api/v3/clients/me/integrations/lifi/route-step-details
This proxy endpoint retrieves detailed transaction information for a specific route step using Li.Fi.
View the original Li.Fi API documentation here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
id* | String | Source chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum). |
type* | String | Amount to bridge/swap in the smallest unit (e.g., wei for ETH). |
tool* | String | Source token contract address or symbol (e.g., 0x0000000000000000000000000000000000000000 for native ETH or ETH). |
action* | String | Destination chain identifier in CAIP-2 format (e.g., eip155:137 for Polygon). |
action.fromChainId* | String | Destination token contract address or symbol (e.g., USDC). |
id, type, tool, toolDetails, action, estimate, and includedSteps.
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Get Li.Fi transaction status
GET https://api.portalhq.io/api/v3/clients/me/integrations/lifi/status
This proxy endpoint retrieves the status of a cross-chain transaction using Li.Fi.
View the original Li.Fi API documentation here.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Query Parameters
| Name | Type | Description |
|---|---|---|
fromChain* | String | Source chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum). |
txHash* | String | Transaction hash from the source chain. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Blockaid Integration
Portal integrates with Blockaid to provide transaction, address, token, and URL scanning for security threats. These endpoints allow you to scan various blockchain entities for potential risks before interacting with them.To use these endpoints, you must first enable the Blockaid integration in your Portal Dashboard under the Integrations page. See the Blockaid Integration documentation for setup instructions.
Scan EVM Transaction
POST https://api.portalhq.io/api/v3/clients/me/integrations/blockaid/evm/scan
Scans an EVM transaction for potential security risks using Blockaid. Returns validation results and simulation data including asset diffs, gas estimation, and risk classification.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet, eip155:11155111 for Sepolia). |
data* | Object | Transaction data object containing from, to, data, and value fields. |
data.from* | String | The sender’s address. |
data.to | String | The recipient’s address. |
data.data | String | The transaction calldata (hex encoded). |
data.value | String | The value to send (hex encoded wei). |
metadata | Object | Optional metadata about the transaction origin. Can include domain for dApp transactions or non_dapp: true. |
account_address | String | The address to relate the transaction to. Account address determines in which perspective the transaction is simulated and validated |
options | Array | Optional array of scan options: validation, simulation, gas_estimation, events. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Scan Solana Transaction
POST https://api.portalhq.io/api/v3/clients/me/integrations/blockaid/solana/scan
Scans a Solana transaction for potential security risks using Blockaid. Returns validation results and simulation data including asset diffs and risk classification.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Solana chain identifier (e.g., solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for mainnet). |
transactions* | Array | Array of base58 or base64 encoded serialized transactions to scan. |
account_address* | String | The account address that will sign the transaction. |
encoding | String | Transaction encoding format: base58 or base64. Defaults to base58. |
method | String | The Solana method being called (e.g., signAndSendTransaction, signTransaction). |
options | Array | Optional array of scan options: simulation, validation. |
metadata | Object | Optional metadata about the request, can include url for dApp origin. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Scan Address
POST https://api.portalhq.io/api/v3/clients/me/integrations/blockaid/address/scan
Scans a blockchain address for known malicious activity or security risks using Blockaid.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet or solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana Mainnet). |
address* | String | The blockchain address to scan. |
metadata | Object | Optional metadata about the request. Can include domain for dApp context or non_dapp: true. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Scan Tokens
POST https://api.portalhq.io/api/v3/clients/me/integrations/blockaid/tokens/scan
Scans one or more token contract addresses for potential security risks, scam indicators, or malicious behavior using Blockaid.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chain* | String | Chain identifier in CAIP-2 format (e.g., eip155:1 for Ethereum Mainnet). |
tokens* | Array | Array of string token addresses to scan. |
metadata | Object | Optional metadata about the request. Can include domain for dApp context. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success
- 400: Bad Request
Scan URL
POST https://api.portalhq.io/api/v3/clients/me/integrations/blockaid/url/scan
Scans a URL for potential phishing, scam, or malicious Web3 activity using Blockaid.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
url* | String | The URL to scan. |
metadata | Object | Optional metadata about the scan type. Use { "type": "catalog" } for general catalog scans, or { "type": "wallet", "account_address": "0x..." } when scanning in the context of a specific wallet. |
Example Request
Be sure to replace the[token] with either a Client API Key or a Client Session Token.
Example Response
- 200: Success (Hit)
- 200: Success (Miss)
- 400: Bad Request
Deprecated Endpoints:
Swaps (deprecated)
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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
- 200: Success
- 400: Bad Request
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.
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
- 200: Success
- 400: Bad Request
Get swap sources (@deprecated)
POST https://api.portalhq.io/api/v3/swaps/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 |
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.
Example Response
- 200: Success
- 400: Bad Request