Skip to main content

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

FieldTypeDescription
idintegerChain identifier
chainstringChain name (e.g., "Ethereum", "BSC")
chainDescstringChain description
enablebooleanWhether the chain is currently enabled
receiptAddressstringHashNut platform receiving address on this chain
txConfirmCountstringRequired confirmation count for transactions
walletConnectEnablebooleanWhether WalletConnect is supported
bridgeServerAddressstringWalletConnect bridge server address
decimalsintegerBase currency decimals (e.g., 18 for ETH)
baseChainSymbolstringBase chain symbol (e.g., "ETH")
envintegerEnvironment (0=Production, 1=Testing, 2=Development)
chainIdstringChain ID (e.g., "1" for Ethereum mainnet)
baseChainCoinstringBase chain coin symbol
eip712ChainIdstringEIP-712 chain ID
eip1559SupportbooleanWhether EIP-1559 is supported

Code Examples

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'})`);
});
}

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

FieldTypeDescription
idintegerCoin identifier
chainstringChain name where the coin is located
chainCodestringChain code (e.g., "erc20", "tron-trc20")
coinCodestringCurrency code (e.g., "usdt", "usdc") - case-sensitive
isTokenbooleanWhether the currency is a token (false for native coins like ETH)
enablebooleanWhether the currency is currently available
contractAddressstringToken contract address (null for native coins)
coinDescstringCurrency description
gateWayEnablebooleanWhether gateway payment is enabled
decimalsstringCurrency decimals (e.g., "6" for USDT, "18" for ETH)
nftmarketstringNFT marketplace (if applicable)

Code Examples

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'}`);
});
}

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

ParameterTypeRequiredDescription
chainCodestring✅ YesChain 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

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(', ')}`);
}

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


Need help? Check out Troubleshooting →