Balance
status: under development
Balance a transaction body of a given transaction, add needed inputs/outputs, so as the transaction can be signed from the wallet.
Path parameters
-
walletId
string(hex) Required Minimum length is
40
, maximum length is40
.
Body
Required
-
transaction
string(base64|base16) Required The CBOR-encoded transaction, represented in either hex or base64 encoding. This always includes the transaction body and the witness set, even if the latter is empty.
-
inputs
array[object] Mapping from inputs (
id
,ix
) in the suppliedtransaction
binary to outputs (amount
,assets
, ...). It is not required to include inputs present in thecardano-node
UTxO, ascardano-wallet
will automatically query for them.In other words, this field can be left empty unless the supplied
transaction
contains inputs referring to pending transactions. -
redeemers
array[object] A list of redeemers data with their purpose. The redeemers in the
transaction
binary will be overwritten by this value. -
encoding
string Encoding of transaction CBOR returned in response (base64 by default).
Values are
base16
orbase64
.
Responses
-
400 application/json
Bad Request
-
403 application/json
Forbidden
One of: already_withdrawingobject node_not_yet_in_recent_eraobject balance_tx_conflicting_networksobject balance_tx_existing_collateralobject balance_tx_existing_key_witnessesobject balance_tx_existing_collateral_return_outputsobject balance_tx_existing_total_collateralobject balance_tx_internal_errorobject cannot_cover_feeobject insufficient_collateralobject invalid_wallet_typeobject no_utxos_availableobject not_enough_moneyobject transaction_already_balancedobject transaction_is_too_bigobject utxo_too_smallobject tx_not_in_node_eraobject balance_tx_inline_plutus_v3_script_not_supported_in_babbageobject translation_byron_tx_out_in_contextobject -
415 application/json
Unsupported Media Type
-
406 application/json
Not Acceptable
-
404 application/json
Not Found
-
202 application/json
Accepted
curl \
--request POST https://localhost:8090/v2/wallets/{walletId}/transactions-balance \
--header "Content-Type: application/json" \
--data '{"transaction":"string","inputs":[{"id":"1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1","index":42,"address":"addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g","amount":{"quantity":42000000,"unit":"lovelace"},"datum":"16f30f4e8d665d53eb4ab6028bd0ac971809d514c92d423856bc91c49e928faf","assets":[{"policy_id":"65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b","asset_name":"string","quantity":42}]}],"redeemers":[{"purpose":"spending","data":"string","input":{"id":"1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1","index":42}}],"encoding":"base16"}'
{
"transaction": "string",
"inputs": [
{
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"index": 42,
"address": "addr1sjck9mdmfyhzvjhydcjllgj9vjvl522w0573ncustrrr2rg7h9azg4cyqd36yyd48t5ut72hgld0fg2xfvz82xgwh7wal6g2xt8n996s3xvu5g",
"amount": {
"quantity": 42000000,
"unit": "lovelace"
},
"datum": "16f30f4e8d665d53eb4ab6028bd0ac971809d514c92d423856bc91c49e928faf",
"assets": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"asset_name": "string",
"quantity": 42
}
]
}
],
"redeemers": [
{
"purpose": "spending",
"data": "string",
"input": {
"id": "1423856bc91c49e928f6f30f4e8d665d53eb4ab6028bd0ac971809d514c92db1",
"index": 42
}
}
],
"encoding": "base16"
}
{
"message": "string",
"code": "bad_request"
}
{
"message": "string",
"code": "redeemer_script_failure"
}
{
"message": "string",
"code": "redeemer_target_not_found"
}
{
"message": "string",
"code": "redeemer_invalid_data"
}
{
"message": "string",
"code": "translation_error"
}
{
"message": "string",
"code": "unknown_inputs"
}
{
"message": "string",
"code": "input_resolution_conflicts"
}
{
"message": "string",
"code": "already_withdrawing"
}
{
"message": "string",
"code": "node_not_yet_in_recent_era",
"info": {
"node_era": "byron",
"recent_eras": [
"byron"
]
}
}
{
"message": "string",
"code": "balance_tx_conflicting_networks"
}
{
"message": "string",
"code": "balance_tx_existing_collateral"
}
{
"message": "string",
"code": "balance_tx_existing_key_witnesses"
}
{
"message": "string",
"code": "balance_tx_existing_collateral_return_outputs"
}
{
"message": "string",
"code": "balance_tx_existing_total_collateral"
}
{
"message": "string",
"code": "balance_tx_internal_error"
}
{
"message": "string",
"code": "cannot_cover_fee"
}
{
"message": "string",
"code": "insufficient_collateral"
}
{
"message": "string",
"code": "invalid_wallet_type"
}
{
"message": "string",
"code": "no_utxos_available"
}
{
"message": "string",
"code": "not_enough_money",
"info": {
"shortfall": {
"ada": {
"quantity": 42000000,
"unit": "lovelace"
},
"assets": [
{
"policy_id": "65ab82542b0ca20391caaf66a4d4d7897d281f9c136cd3513136945b",
"asset_name": "string",
"quantity": 42
}
]
}
}
}
{
"message": "string",
"code": "transaction_already_balanced"
}
{
"message": "string",
"code": "transaction_is_too_big"
}
{
"message": "string",
"code": "utxo_too_small",
"info": {
"tx_output_index": 42,
"tx_output_lovelace_specified": {
"quantity": 42000000,
"unit": "lovelace"
},
"tx_output_lovelace_required_minimum": {
"quantity": 42000000,
"unit": "lovelace"
}
}
}
{
"message": "string",
"code": "tx_not_in_node_era"
}
{
"message": "string",
"code": "balance_tx_inline_plutus_v3_script_not_supported_in_babbage"
}
{
"message": "string",
"code": "translation_byron_tx_out_in_context"
}
{
"message": "string",
"code": "unsupported_media_type"
}
{
"message": "string",
"code": "not_acceptable"
}
{
"message": "string",
"code": "no_such_wallet",
"info": {
"wallet_id": "2512a00e9653fe49a44a5886202e24d77eeb998f"
}
}
{
"transaction": "string"
}