Skip to main content

AB Connect

Basic Information

AB is a blockchain network built on a Hybrid Blockchain architecture. With AB Core as the main chain, it connects multiple dedicated sidechains (AB IoT) via AB Connect, which serves as the primary component to enable efficient transfers of AB tokens between AB Core and each dedicated sidechain.

AB Connect, operated in a distributed manner through multiple nodes, establishes a decentralized network architecture to ensure security, reliability, and efficiency.

In simple terms, AB Connect, as the core connector, links AB Core and the dedicated sidechains, enabling efficient and decentralized transfers of AB tokens across the chains.


API

API Service Endpoints:

Struct

Blockchain

namevaluedesc
networkABCore, ABIoT, ABCoreTestnet, ABIoTTestnetblockchain network name of AB network
chain_id1, 1012 or main, testget from rpc, eth_chainId for evm
base_chainEthereum, NewChainBase chain
sluguuid, one of abcore, abiot, abcoretestnet, abiottestnetuid
Example
networkchain_idbase_chainslug
ABIoT1012NewChainabiot
ABCore36888Ethereumabcore
ABIoTTestnet1007NewChainabiottestnet
ABCoreTestnet26888Ethereumabcoretestnet
Asset

namedesc
assetempty for native coin or address for token
namename
symbolsymbol
decimals0-18, for AB is 18
asset_typeCoin, ERC-20, NRC-6, BRC-20
networkBlockchain.network
chain_idBlockchain.chain_id
base_chainBlockchain.base_chain
SlugBlockchain.slug
Example
assetnamesymboldecimalasset_typenetworkchain_idbase_chainslugdesc
ABAB18CoinABIoT1012NewChainabiotAB IoT native asset
ABAB18CoinABCore36888EthereumabcoreAB Core native asset

API

GET /v1/networks (get networks)

Parameters

None

Responses

array of Blockchain

Example cURL

 curl http://localhost:9699/v1/networks
{
"networks": [
{
"network": "ABCore",
"chain_id": "36888",
"base_chain": "Ethereum",
"slug": "abcore"
},
{
"network": "ABIoT",
"chain_id": "1012",
"base_chain": "NewChain",
"slug": "abiot"
}
]
}
GET /v1/connects (get connects)

Parameters

None

Responses

namevaluedesc
bc1Blockchainblockchain a
bc2Blockchainblockchain b

Example cURL

 curl http://localhost:9699/v1/connects
{
"connects": [
{
"bc1": {
"network": "ABCore",
"chain_id": "36888",
"base_chain": "Ethereum",
"slug": "abcore"
},
"bc2": {
"network": "ABIoT",
"chain_id": "1012",
"base_chain": "NewChain",
"slug": "abiot"
}
}
]
}
GET /v1/pairs (get pairs)

Parameters

None

Responses

namevaluedesc
idpair idthe id of pair
asset_a_idasset idthe id of asset A
asset_b_idasset idthe id of asset B
asset_aAssetasset_a
asset_bAssetasset_b
a2b_min_deposit_amountstring, unit is ABmin deposit amount for asset a to b
b2a_min_deposit_amountstring, unit is ABmin deposit amount for asset b to a
a2b_fee_percentfloat, base on 10000fee percent for asset a to b
b2a_fee_percentfloat, base on 10000fee percent for asset b to a
a2b_fee_min_amountstring, unit is ABmin fee for asset a to b
b2a_fee_min_amountstring, unit is ABmin fee for asset b to a
b2a_fee_min_amountstring, unit is ABmin fee for asset b to a
connect_pairstringmerge of blockchain slug for a-b

Example cURL

 curl http://localhost:9699/v1/pairs
{
"pairs": [
{
"id": "1",
"asset_a_id": "1",
"asset_b_id": "2",
"asset_a": {
"id": "1",
"asset": "",
"name": "AB",
"symbol": "AB",
"decimals": 18,
"asset_type": "Coin",
"network": "ABCore",
"chain_id": "36888",
"base_chain": "Ethereum",
"slug": "abcore"
},
"asset_b": {
"id": "2",
"asset": "",
"name": "AB",
"symbol": "AB",
"decimals": 18,
"asset_type": "Coin",
"network": "ABIoT",
"chain_id": "1012",
"base_chain": "NewChain",
"slug": "abiot"
},
"a2b_min_deposit_amount": "12",
"b2a_min_deposit_amount": "12",
"a2b_fee_percent": "0.000000",
"b2a_fee_percent": "0.000000",
"a2b_fee_min_amount": "11.55",
"b2a_fee_min_amount": "11.55",
"connect_pair": "abcore-abiot"
}
]
}
GET /v1/account (get account's deposit address)

Parameters

namevaluedesc
recipient_addressaddressrecipient address on recipient blockchain, user's address to receive asset
recipient_blockchainslugslug of recipient blockchain
deposit_blockchainslugslug of deposit blockchain

if recipient blockchain is AB Core network, the address must be in checksum.

Responses

namevaluedesc
recipient_addressaddressrecipient address on recipient blockchain, user's address to receive asset
recipient_blockchainslugslug of recipient blockchain
deposit_blockchainslugslug of deposit blockchain
deposit_addressaddressdeposit address on deposit blockchain, which used for use to send asset to

Example cURL

 curl http://127.0.0.1:9699/v1/account?recipient_address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&recipient_blockchain=abcore&deposit_blockchain=abiot
{
"recipient_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"recipient_blockchain": "abcore",
"deposit_address": "NEW17zWPekqx7GKGQFvzk3wqF4SbYFgv1xoCpMo",
"deposit_blockchain": "abiot"
}
GET /v1/history (get all history or account's history)

Parameters

namevaluedesc
page_iduint64Optional, page id, default 0
page_size50Optional, page size, default 50
source_deposit_addressaddress on source_blockchaindeposit_address get by v1/account
source_senderaddress on source_blockchainthe address who send AB to deposit_address
source_blockchainslug of blockchainslug of blockchain, get by v1/networks
destination_addressaddress on destination_blockchaindeposit_address get by v1/account
destination_blockchainslug of blockchainslug of blockchain

if address and blockchain is empty, return all history

Responses

namevaluedesc
statusDeposit,Pending,Confirmedcurrent status
listHistoryhistory list

the History is as follow:

NameTypeDescription
idintegerUnique ID of the history record
pair_idintegerPair ID related to this transfer
source_slugstringSlug of the source blockchain
source_networkstringSource network name
source_chain_idstringSource blockchain chain ID
source_base_chainstringSource blockchain base chain
destination_slugstringSlug of the destination blockchain
destination_networkstringDestination network name
destination_chain_idstringDestination blockchain chain ID
destination_base_chainstringDestination blockchain base chain
source_deposit_addressstringDeposit address on the source blockchain
source_senderstringSender address on the source blockchain
destination_addressstringDestination address on the destination blockchain
source_block_numberstringBlock number of source blockchain transaction
destination_block_numberstringBlock number of destination blockchain transaction
source_block_timestampstringBlock timestamp of source blockchain transaction
destination_block_timestampstringBlock timestamp of destination blockchain transaction
source_tx_hashstringTransaction hash on the source blockchain
destination_tx_hashstringTransaction hash on the destination blockchain
source_asset_idintegerAsset ID
source_asset_addressstringAsset address on the source blockchain (empty if native)
source_asset_namestringAsset name
source_asset_symbolstringAsset symbol
source_asset_decimalsintegerAsset decimals
source_asset_typestringAsset type (e.g., Coin, ERC20)
destination_asset_idintegerAsset ID
destination_asset_addressstringAsset address on the destination blockchain (empty if native)
destination_asset_namestringAsset name
destination_asset_symbolstringAsset symbol
destination_asset_decimalsintegerAsset decimals
destination_asset_typestringAsset type (e.g., Coin, ERC-20)
source_amountstringAmount sent on the source blockchain
destination_amountstringAmount received on the destination blockchain
feestringFee amount charged during the transfer
statusstringStatus of the transfer (Deposit,Pending,Confirmed,Error)
Example cURL
 curl http://localhost:9699/v1/history
{
"page_id": "1",
"page_size": "1",
"total_page": "4",
"total_history": "3",
"list": [
{
"id": "3",
"pair_id": "1",
"source_slug": "abiot",
"source_network": "ABIoT",
"source_chain_id": "1012",
"source_base_chain": "NewChain",
"destination_slug": "abcore",
"destination_network": "ABCore",
"destination_chain_id": "36888",
"destination_base_chain": "Ethereum",
"source_deposit_address": "NEW17zVctFa42dC1rBNFPf775Bq34yiwWLz4GM1",
"source_sender": "NEW17zS9ZvgGV1EaT8KT2tLjqRvQbcApjFot8xj",
"destination_address": "0x7EdC0CaDD6c20811058D4FB3EDA6F9218cCC7332",
"source_block_number": "15368195",
"destination_block_number": "4579902",
"source_block_timestamp": "1746118154",
"destination_block_timestamp": "1746118194",
"source_tx_hash": "0x7abaedaaed2f2da1ebc9c0622e06a80725149db5adf1df363c92011644de0b0f",
"destination_tx_hash": "0xd4d5cea2d5ae6b89a70257cff068587938c367c6f5729a4929b974060ac3db1b",
"source_asset_id": "2",
"source_asset_address": "",
"source_asset_name": "AB",
"source_asset_symbol": "AB",
"source_asset_decimals": 18,
"source_asset_type": "Coin",
"destination_asset_id": "1",
"destination_asset_address": "",
"destination_asset_name": "AB",
"destination_asset_symbol": "AB",
"destination_asset_decimals": 18,
"destination_asset_type": "Coin",
"source_amount": "100",
"destination_amount": "88.45",
"fee": "11.55",
"status": "Confirmed"
}
],
"source_deposit_address": "",
"source_sender": "",
"source_blockchain": "",
"source_asset_id": "",
"destination_address": "",
"destination_blockchain": "",
"destination_asset_id": "",
"pairId": "",
"status": ""
}
GET /v1/ab (get supply of AB)

Parameters

None

Responses

namevaluedesc
chainsChainchain list

the Chain is as follow:

namevaluedesc
slugabcore,abiotslug of blockchain, get by /v1/networks
networkABCore,ABIoTnetwork of blockchain
chain_idstring, 1, 1012 or main, testget from rpc, eth_chainId
base_chainEthereum, NewChainBase chain
statusOK,STUCK, OFFLINE, SYNCINGstatus of chain
latest_heightnumberlatest block number
nameABthe name of AB in this chain
symbolABthe symbol of AB in this chain
decimals18the decimals of AB in this chain
supplystringthe amount of AB in unit AB

The totalSupply of AB is the sum of the supply from each chain.

Example cURL
 curl http://localhost:9699/v1/ab
{
"chains": [
{
"slug": "abcore",
"network": "ABCore",
"chain_id": "36888",
"base_chain": "Ethereum",
"status": "OK",
"latest_height": "4648796",
"name": "AB",
"symbol": "AB",
"decimals": 18,
"supply": "80.05"
},
{
"slug": "abiot",
"network": "ABIoT",
"chain_id": "1012",
"base_chain": "NewChain",
"status": "OK",
"latest_height": "15391173",
"name": "AB",
"symbol": "AB",
"decimals": 18,
"supply": "99999999919.95"
}
]
}