Transactions

Endpoints for submitting and simulating blockchain transactions

Broadcast Transaction

post
/broadcast

Broadcasts a transaction to the blockchain. This will broadcast the transaction to the blockchain via the BitBadges blockchain node.

const res = await BitBadgesApi.broadcastTx(...);

Documentation References / Tutorials:

SDK Links:

Authorizations
Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Body
one ofOptional
or
stringOptional
Responses
200

Success response

application/json
post
/broadcast
POST /api/v0/broadcast HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "tx_bytes": null,
  "mode": "text"
}
{
  "tx_response": {
    "code": 1,
    "codespace": "text",
    "data": "text",
    "events": [
      {
        "type": "text",
        "attributes": [
          {
            "key": "text",
            "value": "text",
            "index": true
          }
        ]
      }
    ],
    "gas_wanted": "text",
    "gas_used": "text",
    "height": "text",
    "logs": [
      {
        "events": [
          {
            "type": "text",
            "attributes": [
              {
                "key": "text",
                "value": "text",
                "index": true
              }
            ]
          }
        ]
      }
    ],
    "raw_log": "text",
    "timestamp": "text",
    "tx": {},
    "txhash": "text"
  }
}

Simulate Transaction

post
/simulate

Simulates a transaction on the blockchain. This will simulate the transaction on the blockchain via the BitBadges blockchain node.

const res = await BitBadgesApi.simulateTx(...);

Documentation References / Tutorials:

SDK Links:

Authorizations
Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Body
one ofOptional
or
stringOptional
Responses
200

Success response

application/json
post
/simulate
POST /api/v0/simulate HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "tx_bytes": null,
  "mode": "text"
}
{
  "gas_info": {
    "gas_used": "text",
    "gas_wanted": "text"
  },
  "result": {
    "data": "text",
    "log": "text",
    "events": [
      {
        "type": "text",
        "attributes": [
          {
            "key": "text",
            "value": "text",
            "index": true
          }
        ]
      }
    ]
  }
}

Last updated