appendRevealOperation static method
Implementation
static Future<List<OperationModel>> appendRevealOperation(
String server,
String? publicKey,
String publicKeyHash,
int accountOperationIndex,
List<OperationModel> operations,
[bool isKeyRevealed = false]) async {
isKeyRevealed = !isKeyRevealed
? await TezosNodeReader.isManagerKeyRevealedForAccount(
server, publicKeyHash)
: isKeyRevealed;
var counter = accountOperationIndex + 1;
for (var i = 0; i < operations.length; i++) {
operations[i].fee = '1500'; // default gas fee
}
if (!isKeyRevealed) {
var revealOp = OperationModel(
counter: counter,
fee: '0', // Reveal Fee will be covered by the appended operation
source: publicKeyHash,
kind: 'reveal',
gasLimit: TezosConstants.DefaultKeyRevealGasLimit,
storageLimit: TezosConstants.DefaultKeyRevealStorageLimit,
publicKey: publicKey,
);
for (var index = 0; index < operations.length; index++) {
var c = accountOperationIndex + 2 + index;
operations[index].counter = c;
}
return prepareOperation(
server, <OperationModel>[revealOp, ...operations]);
}
return prepareOperation(server, operations);
}