Delegate transactions
For user controlled wallet, user can delegate developer to send certain transactions on behalf of them for a limited time by creating delegation policy. This is very useful for automation of certain tasks where user don’t want to be involved when the task needs to be performed.
The above example creates a policy that allows developer to initiate USDC transfer that is less than 10 USDC to the specified address without requiring user to be involved.
Delegation policy is a set of rules that define what transactions can be sent on behalf of
the user for a given period. And rules are defined as a list of ArgumentRule
objects.
The argument
field defines which part of the transaction should be checked (e.g. to
, value
).
WalletKit decodes the transaction input data to decodedInput
object, to access the decoded input,
use decodedInput.<field>
(e.g. decodedInput.function
, decodedInput.to
).