buildSignedTokenTx function
Map<String, Object?>
buildSignedTokenTx({
- String networkId = kNetworkId,
- required int timestamp,
- required Object fee,
- required int nonce,
- required String senderAddress,
- required String publicKey,
- required int op,
- String tokenId = '',
- String symbol = '',
- String name = '',
- int decimals = 0,
- String? cap,
- String? amount,
- String? recipient,
- required String privHex,
Build a fully-signed TokenTx body. cap/amount are integer base-unit strings.
Implementation
Map<String, Object?> buildSignedTokenTx({
String networkId = kNetworkId,
required int timestamp,
required Object fee,
required int nonce,
required String senderAddress,
required String publicKey,
required int op,
String tokenId = '',
String symbol = '',
String name = '',
int decimals = 0,
String? cap,
String? amount,
String? recipient,
required String privHex,
}) {
final s = _sign(
networkId,
timestamp,
fee,
nonce,
senderAddress,
privHex,
p.tokenPayload(
op: op,
tokenId: tokenId,
symbol: symbol,
name: name,
decimals: decimals,
cap: cap,
amount: amount,
recipient: recipient));
return {
'timestamp': timestamp,
'fee': normalizeAmount(fee),
'nonce': nonce,
'senderAddress': senderAddress,
'op': op,
'tokenId': tokenId,
'symbol': symbol,
'name': name,
'decimals': decimals,
'cap': cap,
'amount': amount,
'recipient': recipient,
'hash': s['hash'],
'senderSignature': s['signature'],
'senderPublicKey': publicKey,
};
}