deleteKey method
Implementation
Future<BlockchainResponse> deleteKey({
required String accountId,
required String deletedPublicKey,
required String privateKey,
required String publicKey,
}) async {
final transactionInfo = await getTransactionInfo(
accountId: accountId,
publicKey: publicKey,
);
final gas = BlockchainGas.gas[BlockChains.near];
if (gas == null) {
throw Exception('Incorrect Blockchain Gas');
}
final List<Map<String, dynamic>> actions = [
{
"type": "deleteKey",
"data": {
"publicKey": deletedPublicKey,
},
},
];
final signedAction = await signNearActions(
fromAddress: accountId,
toAddress: accountId,
transferAmount: "0",
privateKey: privateKey,
gas: gas,
nonce: transactionInfo.nonce,
blockHash: transactionInfo.blockHash,
actions: actions,
);
final res = await nearRpcClient.sendSyncTx([signedAction]);
return res;
}