Transactions
Endpoints for submitting and simulating blockchain transactions
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:
BitBadges API Key for authentication
Success response
Bad Request - Invalid configuration or request
Unauthorized - Does not meet authentication requirements. This can be due to an invalid API key, CORS origin, or session cookie.
Internal Server Error
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"
}
}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:
BitBadges API Key for authentication
Success response
Bad Request - Invalid configuration or request
Unauthorized - Does not meet authentication requirements. This can be due to an invalid API key, CORS origin, or session cookie.
Internal Server Error
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