Think in Coin | DEV Docs
  • Develop Documents
  • Networks
    • Fantom Network
      • quick-start
        • Short Guide
      • technology
        • Lachesis aBFT
        • Overview
        • Proof of Stake
        • Transaction Fees
        • FAQ
      • staking
        • Quick start
        • Overview
        • Stake on Fantom
        • Run a Validator Node
        • Run a Read-only node
        • Run a Testnet Validator
        • Troubleshooting
      • api
        • Public API endpoints
        • Getting Started
        • Installation
        • GraphQL Schema Basics
        • Schema Structure
        • Implementation Details and Notes
        • Covalent indexing and querying API
      • tutorials
        • Set up Metamask
        • Set up Metamask (testnet)
        • Deploy a Smart Contract
        • Create a Fixed-cap Asset
    • xDAI Chain
      • Welcome to xDai
      • untitled
        • About xdai
          • Projects & DApps
          • Features
          • Use Cases
          • News & Information
          • Roadmaps
          • FAQs
        • For users
          • xDai Token
          • Getting Started with xDai
          • Bridges
          • Wallets
          • Applications
          • Block Explorers
          • Governance
        • For stakers
          • STAKE Token
          • Staking on xDai
          • EasyStaking on Ethereum
          • POSDAO Staking Roadmap
        • For developers
          • Developer Resources & Tools
          • On-Chain Random Numbers
          • Install xDai Client - Run a Non-Validator Node
          • Stable Chain Network Deployment
          • Grants for building on xDai
          • Immunefi Bug Bounty
        • For validators
    • Polygon Network
      • About - Polygon
      • Technology
    • Huobi HECO Chain
      • Huobi Open Platform
    • Binance Chain
      • Create Address
      • Fees
      • Governance
      • Threshold Signature Scheme
      • Atomic Swap
      • WalletConnect
      • Wallets Support
        • WalletConnect Support
        • Trust Wallet User Guide
        • Ledger Wallet Guide
        • Trezor Wallet Guide
        • How to manage BEP8 token with Web Wallet
      • BEP8 Token Protocol
      • Binance DEX Trading
      • Binance Chain Testnet
      • Exchange Integration
      • List Instructions
    • Binance Smart Chain
      • Concepts
        • Consensus
        • Comparison
        • Genesis File
        • BC > BSC Cross-Chain
          • Mechanism
          • Cross-Chain Transfer
          • BSC Relayer
          • Oracle Module
          • Oracle Relayer
          • Relayer incentives
        • Build-in System Contract
        • Governance
      • Ecosystem
      • Gnosis
      • Binance Bridge
        • Release
        • Roadmap
        • User Guides
        • Developer
          • Widget
          • Swagger API reference
        • Partnership
        • Support
          • Customer Support
        • guides
          • Binance Bridge v2
          • Binance Bridge v1
          • Supported Assets
          • Buy BNB as Gas
    • Ethereum (ERC)
      • Ether - Introduction
        • The Ethereum Foundation
        • Community
        • History of Ethereum
        • The Homestead Release
        • What is Ethereum?
        • A platform for decentralized apps
      • The Ethereum network
        • Connecting to the Network
        • Test Networks
      • Mining
      • Contracts and Transactions
        • Account Types, Gas, and Transactions
        • Contracts
        • Accessing Contracts and Transactions
        • Dapps
        • Mix
          • Project Editor
          • Scenarios Editor
          • State Viewer
          • Transaction Explorer
          • JavaScript console
          • Transaction debugger
          • Dapps deployment
          • Code Editor
        • Ethereum Tests
          • Blockchain Tests
          • State Tests
        • Web3 Base Layer Services
    • Harmony ONE
      • developers
        • Getting Started
        • Network & Faucets
        • Deploying on Harmony
        • SDK
        • API
        • Wallets
        • Tools
        • Showcases
        • Hackathon & Bounties
        • Learn
      • network
        • Governance
        • Holders
        • Validators
        • Delegators
      • general
        • Grants
        • Introduction
          • What is Harmony?‌
          • Roadmap
          • Strategy & Architecture
          • Study Materials
          • FAQ
        • Technology
        • Horizon Bridge
        • DApps
        • Ecosystem
        • Community
    • TRON Network (TRC)
      • Introduction
      • Tron Protocol
        • Account
        • Resource Model
        • Super Representatives
          • Mechanism
          • Step to become a Candidate
          • Committee and Proposal
        • Transaction
        • Multi-Signature
          • Example Process Flow
        • Concensus
        • untitled
          • Build transaction locally
      • TRX AND TRC TOKEN
        • TRX
          • TRX Transfer
          • Query TRX balance
        • TRC-10
          • Issue TRC-10 token
          • Participate TRC-10
          • TRC-10 Transfer
          • Query TRC-10 balance
          • TRC-10 Transfer in Smart Contracts
          • Other TRC-10 Interfaces
        • TRC-20
          • Protocol Interface
          • Issuing TRC-20 tokens tutorial
          • TRC-20 Contract Interaction
        • TRC-721
  • Community
    • Github
    • Telegram DEVs
Powered by GitBook
On this page
  • Public Services
  • REST API
  • Node RPC
  • Running a Full Node
  • Access via Node Command Line Interface (CLI)
  • SDKs
  • Important: Ensuring Transaction Finality
  • The Recommended Way (via WebSocket)
  • The Alternative Way (via RPC Polling)

Was this helpful?

  1. Networks
  2. Binance Chain

Exchange Integration

PreviousBinance Chain TestnetNextList Instructions

Last updated 1 year ago

Was this helpful?

Public Services

There are public nodes running by Binance Chain community which will allow you to interact with the blockchain.

REST API

​ provide advanced API services for the public. List of all the Rest API information available on accelerated node can be found: ​

Node RPC

There are multiple data seed node in the network which allow users to perform low-level operations like executing ABCI queries, broadcasting a transaction or viewing network/consensus state. If you run a full node by yourself, you can also use those RPC functions. List of all endpoints Node RPC service provides can be found: ​

Running a Full Node

Running a full node requires considerable computational/bandwidth resources. Please refer to this guide about .

Access via Node Command Line Interface (CLI)

Command Line Interface is currently available for Linux, Mac and Windows. Please refer to the .

SDKs

There are multiple advanced SDK solutions available for Binance chain. Majority of SDKs provide simplified functions to:

  • Create wallets and manage keys

  • Encode/sign transactions and submit to Binance Chain/DEX, including Transfer, New Order, Cancel Order, etc.

  • Communicate with Binance Chain/DEX via Node RPC calls through public node RPC services or your own private full nodes

List of currently available SDKs and their respective documentations:


Important: Ensuring Transaction Finality

If you intend to add "deposit" and "withdrawal" functionalities to your implementation, it is important that you ensure that transactions are final before the backend system credits or deducts funds from a user account.

The status "code" recorded for each of these phases can differ, so be sure to check that it is 0 (meaning success) for each of them. A non-zero "code" indicates that there was a problem with the transaction during processing.

{code: 393621,hash: "F296E84917A92FC4876AFE77DE662CC9417F9D6F2EB8ED1AD723A5433EBB8362",height: "30771453",log: "{"codespace":6,"code":405,"abci_code":393621,"message":"Failed to find order [E0B781A5DA419E0E596D13FE8A06BF5F9CE9C37D-19450]"}",ok: false,tx: {type: "auth/StdTx",value: {data: null,memo: "",msg: [{type: "dex/CancelOrder",value: {refid: "E0B781A5DA419E0E596D13FE8A06BF5F9CE9C37D-19450",sender: "bnb1uzmcrfw6gx0quktdz0lg5p4lt7wwnsmat6ksd6",symbol: "BNB_TUSDB-888"}}],signatures: [{account_number: "153135",pub_key: {type: "tendermint/PubKeySecp256k1",value: "AzWMnQAwvCP9mbpNyaGuOtNVum1ktvlBb+XFy8D50xmh"},sequence: "19452",signature: "y2FTS4rAqWvDmNWLxsOg+8vrz9XZ4gDXs/tGh/psnQwRMQBtw1x1a2TSCgc0G4qbvh0YICe5ZvJFRNvg/zGG7w=="}],source: "889"}}}

The two phases we should be concerned about are CheckTx and DeliverTx.

Instead, there are two ways that you can go about checking the status of your transaction after you have broadcasted it.

If you haven't received anything after a couple of blocks, resend the transaction. If the same happens again, send it to some other node. This is safe to do so long as you are broadcasting the same transaction. Transactions are unique in the blockchain and you cannot spend the coins twice by retrying the send of the same data.

The Recommended Way (via WebSocket)

The Alternative Way (via RPC Polling)

Some of the SDKs do not yet support WebSocket subscriptions for RPC queries, so this may be the preferable option in some use cases.

You can use the Tx RPC method to query for the transaction and get its block height. Here is an example using the JavaScript SDK:

> rpc.tx({  hash: Buffer.from('B2EF71DAEB86385E64F6C0B923636ADE5510B3C34C07D19EE5A114FC9075273D', 'hex'),  prove:false}).then(x => console.log('',x)){  hash: 'B2EF71DAEB86385E64F6C0B923636ADE5510B3C34C07D19EE5A114FC9075273D',  height: '30261607',  index: 0,  tx_result: { log: 'Msg 0: ', tags: [ [Object], [Object], [Object] ] },  tx: '0AHwYl3uCkwqLIf6CiIKFLjeOPB9sCxE5v+lpkRhnPu+K1ahEgoKA0JOQhCMy5ZfEiIKFI6nDX0uqKFLorM9GNXfvW+uCm6oEgoKA0JOQhCMy5ZfEnEKJuta6YchA6Xy63LJBSKNsW1nkGMbPyvWl7VDeD/lVByJrtnB3v1kEkA243QKSCn5GxFSTFbh6EA8ZuqdO+0UTR8+Vq7CDikOzCIpuRo95Ww7zak0qXRmL3/shGkwHcvB4l9ofF61mSQgGKfQCSDDARoJMTAxNzg5MTEz'}

If the Transaction does not yet exist in the blockchain, this attempt will return with an error.

You should check for an absent "code" field in the tx_result: this indicates a code of 0. You could also perform further checks on the log to make sure that it matches the expected value.

In brief, transactions pass through several before they are finalised and included in a block.

For example, was invalid because the order was already canceled. You can query that the code for this transaction is 405.

We recommend that you broadcast your transactions via or, if you wish to run a , via the BroadcastTxSync command.

While there is an RPC command called BroadcastTxCommit which will wait for both CheckTx and DeliverTx and return with codes for both and a block height, it is unfortunately .

If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. See .

Accelerated nodes
here
here
how to run your own node
CLI Reference
phases
this transaction
REST API
Full Node
Node RPC
not recommended for use in production
Subscribing to Events via WebSocket