Skip to content

dispatchAddDelegateToChain

dispatchAddDelegateToChain(registryId, delegateAddress, roles, authorAccount): Promise<void>

Dispatches a transaction to add a delegate to a registry with specified permissions.

Parameters

registryId: string

The identifier of the registry (e.g., ‘3xygo…’).

delegateAddress: string

The SS58 address of the delegate.

roles: object | RegistryPermissionVariant

A single RegistryPermissionVariant or array of variants (‘Entry’, ‘Delegate’, ‘Admin’).

authorAccount: CordKeyringPair

The keyring pair of the author.

Returns

Promise<void>

A promise that resolves when the transaction is submitted.

Throws

If the transaction fails.

Example

await dispatchAddDelegateToChain(
'2Lwwd3xygo...',
'5FHne...',
[RegistryPermissionVariant.Entry, RegistryPermissionVariant.Delegate],
alice
);

Source

registry/src/Registry.chain.ts:337