🌟Quick Start

This page provides you the basic work flow of using the Trader API.

bloXroute Account - Authorization Header

Before you call the Trader API endpoint, you will need a bloXroute account to access the endpoint. After registering your bloXroute account, you will find your authorization header in your account dashboard. A unique authorization header is needed every time we call our endpoints.

If you have more questions, please refer to the Authorization Headers page for more details.

Add Tip

Adding a tip to each transaction you submit is required to use our service. You can review the Fee Schedule page and ensure you are sending the required minimum tip amount.

We provide the following code example for transferring a tip.

const tipAddress = "UQDaFk07luSapiO40EuBDhffgqPQOfpADU6iidxtEeF3YMVt"

func generateTipTransfer(from *wallet.Wallet, tip int64, comment string) (*wallet.Message, error) {
   tipAmount := tlb.FromNanoTON(big.NewInt(tip))
   bta, err := address.ParseAddr(tipAddress)
   if err != nil {
      return nil, fmt.Errorf("failed to parse tip address: %v", err)
   }

   if comment == "" {
      comment = fmt.Sprintf("tip from %s", from.Address().String())
   }

   tt, err := from.BuildTransfer(bta, tipAmount, true, comment)
   if err != nil {
      return nil, fmt.Errorf("failed to generate tip transfer: %v", err)
   }

   return tt, nil
}

For more comprehensive example you may see: https://pkg.go.dev/github.com/bloXroute-Labs/ton-trader-api-client

Submit to Endpoint

After you constructed your transaction and signed it, you will be able to submit it to the Submit endpoint.

Request example:

curl -X 'POST' \
  'https://ny.ton.dex.blxrbdn.com/api/v2/submit' \
  -header "Authorization: $AUTH_HEADER" \
  -d '{
 "transaction": {"content": "Aj+Br...ABC"}, "wallet":"V5R1Final"
}'

Last updated