Configuration Endpoints
Query supported blockchain networks, tokens, and platform configuration.
Query All Chain Information
Queries all supported blockchain networks and their configurations.
Endpoint: POST /api/v3.0.0/config/queryAllChainInfo
Request
Headers:
Content-Type: application/json
Body: No body required (empty POST request)
Response
Success Response (200 OK):
{
"code": 0,
"msg": "success",
"data": [
{
"id": 1,
"chain": "Ethereum",
"chainDesc": "Ethereum Mainnet",
"enable": true,
"receiptAddress": "0x...",
"txConfirmCount": "12",
"walletConnectEnable": true,
"bridgeServerAddress": "https://bridge.hashnut.io",
"decimals": 18,
"baseChainSymbol": "ETH",
"env": 1,
"chainId": "1",
"baseChainCoin": "ETH",
"eip712ChainId": "1",
"eip1559Support": true
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | integer | Chain identifier |
chain | string | Chain name (e.g., "Ethereum", "BSC") |
chainDesc | string | Chain description |
enable | boolean | Whether the chain is currently enabled |
receiptAddress | string | HashNut platform receiving address on this chain |
txConfirmCount | string | Required confirmation count for transactions |
walletConnectEnable | boolean | Whether WalletConnect is supported |
bridgeServerAddress | string | WalletConnect bridge server address |
decimals | integer | Base currency decimals (e.g., 18 for ETH) |
baseChainSymbol | string | Base chain symbol (e.g., "ETH") |
env | integer | Environment (0=Production, 1=Testing, 2=Development) |
chainId | string | Chain ID (e.g., "1" for Ethereum mainnet) |
baseChainCoin | string | Base chain coin symbol |
eip712ChainId | string | EIP-712 chain ID |
eip1559Support | boolean | Whether EIP-1559 is supported |
Code Examples
- JavaScript
- Python
- cURL
const response = await fetch(
'https://testnet.hashnut.io/api/v3.0.0/config/queryAllChainInfo',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}
);
const result = await response.json();
if (result.code === 0) {
const chains = result.data;
chains.forEach(chain => {
console.log(`${chain.chain}: ${chain.chainId} (${chain.enable ? 'Enabled' : 'Disabled'})`);
});
}
import requests
response = requests.post(
'https://testnet.hashnut.io/api/v3.0.0/config/queryAllChainInfo',
headers={'Content-Type': 'application/json'}
)
result = response.json()
if result['code'] == 0:
for chain in result['data']:
print(f"{chain['chain']}: {chain['chainId']} ({'Enabled' if chain['enable'] else 'Disabled'})")
curl -X POST 'https://testnet.hashnut.io/api/v3.0.0/config/queryAllChainInfo' \
-H 'Content-Type: application/json'
Query All Coin Information
Queries all supported currencies/tokens across all chains.
Endpoint: POST /api/v3.0.0/config/queryAllCoinInfo
Request
Headers:
Content-Type: application/json
Body: No body required (empty POST request)
Response
Success Response (200 OK):
{
"code": 0,
"msg": "success",
"data": [
{
"id": 1,
"chain": "Ethereum",
"chainCode": "erc20",
"coinCode": "usdt",
"isToken": true,
"enable": true,
"contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"coinDesc": "Tether USD",
"gateWayEnable": true,
"decimals": "6",
"nftmarket": null
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | integer | Coin identifier |
chain | string | Chain name where the coin is located |
chainCode | string | Chain code (e.g., "erc20", "tron-trc20") |
coinCode | string | Currency code (e.g., "usdt", "usdc") - case-sensitive |
isToken | boolean | Whether the currency is a token (false for native coins like ETH) |
enable | boolean | Whether the currency is currently available |
contractAddress | string | Token contract address (null for native coins) |
coinDesc | string | Currency description |
gateWayEnable | boolean | Whether gateway payment is enabled |
decimals | string | Currency decimals (e.g., "6" for USDT, "18" for ETH) |
nftmarket | string | NFT marketplace (if applicable) |
Code Examples
- JavaScript
- Python
- cURL
const response = await fetch(
'https://testnet.hashnut.io/api/v3.0.0/config/queryAllCoinInfo',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}
);
const result = await response.json();
if (result.code === 0) {
const coins = result.data;
coins.forEach(coin => {
console.log(`${coin.coinCode} on ${coin.chain}: ${coin.contractAddress || 'Native'}`);
});
}
import requests
response = requests.post(
'https://testnet.hashnut.io/api/v3.0.0/config/queryAllCoinInfo',
headers={'Content-Type': 'application/json'}
)
result = response.json()
if result['code'] == 0:
for coin in result['data']:
address = coin['contractAddress'] or 'Native'
print(f"{coin['coinCode']} on {coin['chain']}: {address}")
curl -X POST 'https://testnet.hashnut.io/api/v3.0.0/config/queryAllCoinInfo' \
-H 'Content-Type: application/json'
Query Supported Coins by Chain Code
Queries all supported currencies/tokens for a specific chain.
Endpoint: POST /api/v3.0.0/config/querySupportCoinsByChainCode
Request
Headers:
Content-Type: application/json
Body:
{
"chainCode": "erc20"
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chainCode | string | ✅ Yes | Chain code (e.g., "erc20", "bsc-erc20", "polygon-erc20", "tron-trc20") |
Response
Success Response (200 OK):
{
"code": 0,
"msg": "success",
"data": [
{
"id": 2,
"chain": "Ethereum",
"chainCode": "erc20",
"coinCode": "usdc",
"isToken": true,
"enable": true,
"contractAddress": "0x4ca772bb3e6326647b8dd02ddbc758773aa7c650",
"coinDesc": "USD Coin",
"gateWayEnable": true,
"decimals": "6",
"nftmarket": "opensea"
}
]
}
Response format is the same as queryAllCoinInfo, but filtered by chainCode.
Code Examples
- JavaScript
- Python
- cURL
const response = await fetch(
'https://testnet.hashnut.io/api/v3.0.0/config/querySupportCoinsByChainCode',
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
chainCode: 'erc20'
})
}
);
const result = await response.json();
if (result.code === 0) {
const coins = result.data;
console.log(`Supported coins on ERC-20: ${coins.map(c => c.coinCode).join(', ')}`);
}
import requests
response = requests.post(
'https://testnet.hashnut.io/api/v3.0.0/config/querySupportCoinsByChainCode',
headers={'Content-Type': 'application/json'},
json={'chainCode': 'erc20'}
)
result = response.json()
if result['code'] == 0:
coins = result['data']
coin_codes = [c['coinCode'] for c in coins]
print(f"Supported coins on ERC-20: {', '.join(coin_codes)}")
curl -X POST 'https://testnet.hashnut.io/api/v3.0.0/config/querySupportCoinsByChainCode' \
-H 'Content-Type: application/json' \
-d '{
"chainCode": "erc20"
}'
Use Cases
Dynamic Chain Selection
Use queryAllChainInfo to:
- Display available chains to users
- Check if a chain is enabled before creating orders
- Get chain-specific configuration (confirmations, chainId, etc.)
Dynamic Token Selection
Use queryAllCoinInfo or querySupportCoinsByChainCode to:
- Display available tokens for a selected chain
- Validate token availability before order creation
- Get token contract addresses for wallet integration
- Check token decimals for amount calculations
Integration Example
// Get available chains
const chainsResponse = await fetch(
'https://testnet.hashnut.io/api/v3.0.0/config/queryAllChainInfo',
{ method: 'POST', headers: { 'Content-Type': 'application/json' } }
);
const chains = (await chainsResponse.json()).data;
// Get tokens for selected chain
const selectedChain = chains.find(c => c.chainCode === 'erc20');
const tokensResponse = await fetch(
'https://testnet.hashnut.io/api/v3.0.0/config/querySupportCoinsByChainCode',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ chainCode: selectedChain.chainCode })
}
);
const tokens = (await tokensResponse.json()).data;
// Now you can create orders with validated chain and token
Next Steps
- Learn about Order Endpoints
- Understand Multi-Chain Support
- Explore API Reference Overview
Need help? Check out Troubleshooting →