Home

Calculate Transaction Mass

POST
https://kas.nownodes.io/transactions/mass

Authorizations

ApiKeyAuthApiKeyAuth

api-key string

NOWNodes API key passed in the api-key header.

Changed. The returned mass is the largest of the compute mass, the storage mass (KIP-0009) and the normalized transient mass, for both v0 and v1 transactions; previously the transient mass was not taken into account, so mass could be lower. The request accepts the v1 fields (computeBudget, covenant, gas, payload).

This function calculates and returns the mass of a transaction, which is essential for determining the minimum fee. The returned mass is the largest of the compute mass, the storage mass as defined in KIP-0009 and the normalized transient mass, for both v0 and v1 transactions.

Note: Be aware that if the transaction has a very low output amount or a high number of outputs, the mass can become significantly large.

Body

application/json
versionintegerrequired
inputsArray<SubmitTxInput>required
Show child attributes
previousOutpointSubmitTxOutpointrequired
Show child attributes
transactionIdstringrequired
indexintegerrequired
signatureScriptstringrequired
sequenceintegerrequired
sigOpCountintegerrequired
computeBudgetinteger0

Compute budget of the input (v1 transactions). For v1, sigOpCount must be 0. Ignored for v0.

outputsArray<SubmitTxOutput>required
Show child attributes
amountintegerrequired
scriptPublicKeySubmitTxScriptPublicKeyrequired
Show child attributes
versionintegerrequired
scriptPublicKeystringrequired
covenantSubmitTxCovenantBinding

Covenant binding of an output (v1 transactions).

Show child attributes
authorizingInputintegerrequired
covenantIdstringrequired
lockTimeinteger0
subnetworkIdstring
gasinteger0

Gas (v1 transactions). Forced to 0 for v0.

payloadstring

Hex-encoded transaction payload. Supported for both v0 and v1 transactions.

Response

200OK

Successful Response

422Unprocessable Entity

Validation Error