PermissionClient
Methods
- setPermission
- createSetPermissionSignature
- setAllPermissions
- setBatchPermissions
- createBatchPermissionSignature
setPermission
Sets the permission for a specific function call. Each policy is represented as a mapping from an IP account address to a signer address to a recipientaddress to a function selector to a permission level. The permission level can be 0 (ABSTAIN), 1 (ALLOW), or
2 (DENY). By default, all policies are set to 0 (ABSTAIN), which means that the permission is not set. The owner of IP Account by default has all permission.
| Method | Type |
|---|---|
setPermission | (request: SetPermissionsRequest) => Promise<SetPermissionsResponse> |
request.ipId: The IP ID that grants the permission forsigner.request.signer: The address that can calltoon behalf of theipAccount.request.to: The address that can be called by thesigner(currently only modules can beto)request.permission: The new permission level.request.func: [Optional] The function selector string oftothat can be called by thesigneron behalf of theipAccount. By default, it allows all functions.
Response Type
createSetPermissionSignature
Specific permission overrides wildcard permission with signature.| Method | Type |
|---|---|
createSetPermissionSignature | (request: CreateSetPermissionSignatureRequest) => Promise<SetPermissionsResponse> |
request.ipId: The IP ID that grants the permission forsigner.request.signer: The address that can calltoon behalf of theipAccount.request.to: The address that can be called by thesigner(currently only modules can beto)request.permission: The new permission level.request.func: [Optional] The function selector string oftothat can be called by thesigneron behalf of theipAccount. By default, it allows all functions.request.deadline: [Optional] The deadline for the signature in milliseconds, default is 1000ms.
Response Type
setAllPermissions
Sets permission to a signer for all functions across all modules.| Method | Type |
|---|---|
setAllPermissions | (request: SetAllPermissionsRequest) => Promise<SetPermissionsResponse> |
request.ipId: The IP ID that grants the permission forsigner.request.signer: The address of the signer receiving the permissions.request.permission: The new permission.
Response Type
setBatchPermissions
Sets a batch of permissions in a single transaction.| Method | Type |
|---|---|
setBatchPermissions | (request: SetBatchPermissionsRequest) => Promise<SetPermissionsResponse> |
request.permissions[]: An array ofPermissionstructure, each representing the permission to be set.request.permissions[].ipId: The IP ID that grants the permission forsigner.request.permissions[].signer: The address that can calltoon behalf of theipAccount.request.permissions[].to: The address that can be called by thesigner(currently only modules can beto)request.permissions[].permission: The new permission level.request.permissions[].func: [Optional] The function selector string oftothat can be called by thesigneron behalf of theipAccount. By default, it allows all functions.
request.deadline: [Optional] The deadline for the signature in milliseconds, default is 1000ms.
Response Type
createBatchPermissionSignature
Sets a batch of permissions in a single transaction with signature.| Method | Type |
|---|---|
createBatchPermissionSignature | (request: CreateBatchPermissionSignatureRequest) => Promise<SetPermissionsResponse> |
request.ipId: The IP ID that grants the permission forsignerrequest.permissions[]- An array ofPermissionstructure, each representing the permission to be set.request.permissions[].ipId: The IP ID that grants the permission forsigner.request.permissions[].signer: The address that can calltoon behalf of theipAccount.request.permissions[].to: The address that can be called by thesigner(currently only modules can beto)request.permissions[].permission: The new permission level.request.permissions[].func: [Optional] The function selector string oftothat can be called by thesigneron behalf of theipAccount. By default, it allows all functions.
Response Type

