linkAuth method provides a way for an Antelope account owner to limit an account permission so that it’s only able to execute specific smart contract actions. It returns an Action instance that can be signed and executed on-chain using the
SessionKit Transact method.
linkAuth method is available on any Account instance. Here is an example of how to use it:
const action = testAccount.linkAuth( "eosio.token", "claimrewards", "claim" )
In the example above, an action limiting the custom
claim permission to the
claimrewards action is created. This makes it so the
claim permission can only execute the
claimrewards action on the
eosio smart contract.
contract: The name of the account that the permission should be linked to.
actionName: The name of the action that the permission should be linked to.
permission: The name of the permission that should be linked to the specified action (e.g.