Good afternoon. I’m trying to understand the ICRC-2/ICRC-103 standard and I’ve run into some questions.
For all SNS tokens there is an icrc103_get_allowances method, which returns a list of accounts (principal + subaccount), and it is possible to revoke an allowance by passing a zero allowance for a specific account.
However, the ICP ledger does not have such an interface.
If I use get_allowances for ICP, I get a list of addresses (hashes of the principal + subaccount), and with this data I have no way to revoke all allowances for my account — icrc2_allowance still requires an account (principal + subaccount), which of course cannot be derived from a hash.
Is it possible that I’m missing something?
Is there any way to obtain all allowances for my principal and then revoke them on the ICP ledger?
For the ICP ledger it is not possible to obtain the allowances of a principal since the ledgers itself does not keep the information about which account belongs to which principal.
There, you can remove allowances on a per account basis using the remove_allowance method.
Thank you. I’m getting a list of textual identifiers in get_allowances, but to execute remove_approval I need spender : blob.
How can I convert to_spender_id : text into spender : blob?
Is it sufficient to simply use AccountIdentifier.toUint8Array …. blob, or do I need to perform any additional steps to convert the text response into a blob request?
Thank you. I’ve already tested it. It’s sufficient to use AccountIdentifier.fromHex(spenderPrincipalId).toUint8Array(). This is a bit misleading. It’s unclear why this decision was made — to use one type for the response and then convert the same data to another type for the request. But it works, so thanks for that