Skip to main content

contracts/handlers/institutional-access-manager-handler

Classes

InstitutionalAccessManagerHandler

Handler for the InstitutionalAccessManager contract exposing methods to interact with the contract.

Constructors

new InstitutionalAccessManagerHandler()

new InstitutionalAccessManagerHandler(chain, walletClient, publicClient): InstitutionalAccessManagerHandler

Create the handler for the Institutional AccessManager contract exposing methods to interact with the contract.

Parameters
ParameterTypeDescription
chainChainChain to use for the client.
walletClientobjectThe wallet client to use for wallet interactions.
publicClientobjectThe public client to use for public interactions.
Returns

InstitutionalAccessManagerHandler

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:54

Properties

PropertyModifierTypeDefault valueDescription
address?private`0x${string}`undefined-
publicClientprivateobjectundefinedThe public client to use for public interactions.
selectorsMapprivateRecord<`0x${string}`, string>...-
viemChainprivateChainundefined-
walletClientprivateobjectundefinedThe wallet client to use for wallet interactions.

Methods

canCall()

canCall(caller, target, selector): Promise<object>

Check if a caller can call a target with a specific selector.

Parameters
ParameterTypeDescription
caller`0x${string}`The caller address.
target`0x${string}`The target contract address.
selector`0x${string}`The function selector.
Returns

Promise<object>

Whether the caller can call the target immediately and the delay.

canCall

canCall: boolean = immediate

canCallDelay

canCallDelay: number = delay

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:135

cancel()

cancel(caller, target, data): Promise<`0x${string}`>

Cancel a scheduled operation.

Parameters
ParameterTypeDescription
caller`0x${string}`The caller address.
target`0x${string}`The target contract address.
data`0x${string}`The operation data.
Returns

Promise<`0x${string}`>

The nonce.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:153

execute()

execute(target, data, value?): Promise<`0x${string}`>

Execute a target with data.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
data`0x${string}`The data to execute.
value?bigintThe value to send.
Returns

Promise<`0x${string}`>

The nonce.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:168

getAccess()

getAccess(roleIdOrLabel, account): Promise<object>

Get access information for a role and account.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
account`0x${string}`The account address.
Returns

Promise<object>

The access information.

currentDelay

currentDelay: number

effect

effect: number

pendingDelay

pendingDelay: number

since

since: number

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:184

getAddress()

getAddress(): undefined | `0x${string}`

Get the address of the contract for this handler.

Returns

undefined | `0x${string}`

The address of the contract.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:79

getAdminRole()

getAdminRole(): Promise<bigint>

Get the admin role.

Returns

Promise<bigint>

The admin role.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:114

getContract()

getContract(): object

Get the contract. This is a method because the typings are complex and lost when trying to make it a member.

Returns

object

The viem contract.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:89

getFunctionNameFromSelector()

getFunctionNameFromSelector(selector): undefined | string

Get the function name for a selector.

Parameters
ParameterTypeDescription
selector`0x${string}`The selector.
Returns

undefined | string

The function name.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:587

getMinSetback()

getMinSetback(): Promise<number>

Get the minimum setback.

Returns

Promise<number>

The minimum setback.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:355

getNonce()

getNonce(id): Promise<number>

Get the nonce for an operation ID.

Parameters
ParameterTypeDescription
id`0x${string}`The operation ID.
Returns

Promise<number>

The nonce.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:198

getPublicRole()

getPublicRole(): Promise<bigint>

Get the public role.

Returns

Promise<bigint>

The public role.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:123

getRoleAdmin()

getRoleAdmin(roleIdOrLabel): Promise<bigint>

Get the admin role for a role ID.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
Returns

Promise<bigint>

The admin role ID.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:209

getRoleGrantDelay()

getRoleGrantDelay(roleIdOrLabel): Promise<number>

Get the grant delay for a role ID.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
Returns

Promise<number>

The grant delay.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:221

getRoleGuardian()

getRoleGuardian(roleIdOrLabel): Promise<bigint>

Get the guardian role for a role ID.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
Returns

Promise<bigint>

The guardian role ID.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:233

getSchedule()

getSchedule(id): Promise<number>

Get the schedule for an operation ID.

Parameters
ParameterTypeDescription
id`0x${string}`The operation ID.
Returns

Promise<number>

The schedule time.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:244

getSelectorFromFunctionName()

getSelectorFromFunctionName(functionName): undefined | string

Get the selector for a function name.

Parameters
ParameterTypeDescription
functionNamestringThe function name.
Returns

undefined | string

The selector.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:575

getTargetAdminDelay()

getTargetAdminDelay(target): Promise<number>

Get the admin delay for a target.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
Returns

Promise<number>

The admin delay.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:254

getTargetFunctionRole()

getTargetFunctionRole(target, selector): Promise<bigint>

Get the function role for a target and selector.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
selector`0x${string}`The function selector.
Returns

Promise<bigint>

The role ID.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:265

grantRole()

grantRole(roleIdOrLabel, account, executionDelay): Promise<`0x${string}`>

Grant a role to an account.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
account`0x${string}`The account address.
executionDelaynumberThe execution delay.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:277

hasRole()

hasRole(roleIdOrLabel, account): Promise<object>

Check if an account has a role.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
account`0x${string}`The account address.
Returns

Promise<object>

Whether the account has the role and the execution delay.

executionDelay

executionDelay: number

isMember

isMember: boolean

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:301

hashOperation()

hashOperation(caller, target, data): Promise<`0x${string}`>

Hash an operation.

Parameters
ParameterTypeDescription
caller`0x${string}`The caller address.
target`0x${string}`The target address.
data`0x${string}`The operation data.
Returns

Promise<`0x${string}`>

The operation hash.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:319

isTargetClosed()

isTargetClosed(target): Promise<boolean>

Check if a target is closed.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
Returns

Promise<boolean>

Whether the target is closed.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:329

labelRole()

labelRole(roleIdOrLabel, label): Promise<`0x${string}`>

Label a role.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
labelstringThe label.
Returns

Promise<`0x${string}`>

The transaction hash.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:341

labelToRoleId()

labelToRoleId(label): bigint

Convert a label to a role ID. Useful if you want to create a roleId from a label which can then be used to get the label back using roleIdToLabel.

Parameters
ParameterTypeDescription
labelstringThe label to convert.
Returns

bigint

The role ID.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:545

multicall()

multicall(data): Promise<`0x${string}`>

Execute multiple calls.

Parameters
ParameterTypeDescription
data`0x${string}`[]Array of call data.
Returns

Promise<`0x${string}`>

Array of results.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:365

processRoleIdOrLabel()

private processRoleIdOrLabel(roleIdOrLabel): bigint

Parameters
ParameterType
roleIdOrLabelstring | bigint
Returns

bigint

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:593

renounceRole()

renounceRole(roleIdOrLabel, callerConfirmation): Promise<`0x${string}`>

Renounce a role.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
callerConfirmation`0x${string}`The caller confirmation address.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:379

revokeRole()

revokeRole(roleIdOrLabel, account): Promise<`0x${string}`>

Revoke a role from an account.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
account`0x${string}`The account address.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:398

roleIdToLabel()

roleIdToLabel(roleId): string

Convert a role ID to a label. Only useful if the roleId was created using labelToRoleId.

Parameters
ParameterTypeDescription
roleIdbigintThe role ID to convert.
Returns

string

The label.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:561

schedule()

schedule(target, data, when): Promise<`0x${string}`>

Schedule an operation.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
data`0x${string}`The operation data.
whennumberThe execution time.
Returns

Promise<`0x${string}`>

The operation ID and nonce.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:415

setGrantDelay()

setGrantDelay(roleIdOrLabel, newDelay): Promise<`0x${string}`>

Set the grant delay for a role.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
newDelaynumberThe new delay.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:429

setRoleAdmin()

setRoleAdmin(roleIdOrLabel, admin): Promise<`0x${string}`>

Set the admin role for a role.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
adminbigintThe admin role ID.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:445

setRoleGuardian()

setRoleGuardian(roleIdOrLabel, guardian): Promise<`0x${string}`>

Set the guardian role for a role.

Parameters
ParameterTypeDescription
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
guardianbigintThe guardian role ID.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:461

setTargetAdminDelay()

setTargetAdminDelay(target, newDelay): Promise<`0x${string}`>

Set the admin delay for a target.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
newDelaynumberThe new delay.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:476

setTargetClosed()

setTargetClosed(target, closed): Promise<`0x${string}`>

Set whether a target is closed.

Parameters
ParameterTypeDescription
target`0x${string}`The target contract address.
closedbooleanWhether the target is closed.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:489

setTargetFunctionRole()

setTargetFunctionRole(target, selectors, roleIdOrLabel): Promise<`0x${string}`>

Set the function role for a target.

Parameters
ParameterTypeDescription
target`0x${string}`The target address.
selectors`0x${string}`[]Array of function selectors.
roleIdOrLabelstring | bigintThe role ID or role label generated with labelToRoleId.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:504

updateAuthority()

updateAuthority(target, newAuthority): Promise<`0x${string}`>

Update the authority for a target.

Parameters
ParameterTypeDescription
target`0x${string}`The target address.
newAuthority`0x${string}`The new authority address.
Returns

Promise<`0x${string}`>

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:526

withAddress()

withAddress(address): InstitutionalAccessManagerHandler

Set the address of the contract for this handler.

Parameters
ParameterTypeDescription
address`0x${string}`The address of the contract.
Returns

InstitutionalAccessManagerHandler

The handler.

Source

lib/contracts/handlers/institutional-access-manager-handler.ts:68