buildTxBody function
Build a Tx body. Clause should confine to "thor_devkit.transaction.CLAUSE" schema. {to, value, data} Tx body shall confine to "thor_devkit.transaction.BODY" schema.
Implementation
Map buildTxBody(List clauses, int chainTag, String blockRef, int nonce,
{int expiration = 32,
int gasPriceCoef = 0,
int gas = 0,
String? dependsOn,
bool feeDelegation = false}) {
var body = {
"chainTag": chainTag,
"blockRef": blockRef,
"expiration": expiration,
"clauses": clauses,
"gasPriceCoef": gasPriceCoef,
"gas": gas,
"dependsOn": dependsOn,
"nonce": nonce,
};
if (feeDelegation) {
body['reserved'] = {'features': 1};
}
return body;
}