Skip to main content

Channel delegates overview

This section covers all APIs related to managing channel delegate including add / remove and get list of all delegates.

What is Channel Delegate

Channel Delegates are additional wallets that the channel creators have authorised to send notifications on the channels behalf on a specific chain. They are extremely useful to expand on sending notification capabilities and helps in ensuring an additional level of security besides enabling multiple wallets to send notifications on your behalf.

Get delegate API

const delegates = await userAlice.channel.delegate.get();

Get delegate parameters

ParamTypeSubtypeDefaultRemarks
optionsobject-Configuration options for retrieving delegator information.
-options.channelstringChannel address in CAIP

Note: Parameters in this style are mandatory.

Expected response
[
'eip155:11155111:0x35B84d6848D16415177c64D64504663b998A6ab4',
'eip155:80001:0xD8634C39BBFd4033c0d3289C4515275102423681',
];

Add delegate API

To add a delegate to a channel, on ethereum or alias chain of the channel.

const addedDelegate = await userAlice.channel.delegate.add(
`eip155:11155111:${walletAddress}`
);

Add delegate parameters

ParamTypeSubtypeDefaultRemarks
delegatestring-delegator address in CAIP

Note: Parameters in this style are mandatory.

Expected response
{
transactionHash: '0xd4a65a474ea7bd12bae887df43ebe8531ab211e498925cfad6599c5758880c33';
}

Remove delegate API

To remove a delegate to a channel, on ethereum or alias chain of the channel.

const removeDelegate = await userAlice.channel.delegate.remove(
`eip155:11155111:${walletAddress}`
);

Remove delegate parameters

ParamTypeSubtypeDefaultRemarks
delegatestring-delegator address in CAIP

Note: Parameters in this style are mandatory.

Expected response
{
transactionHash: '0x85327b3d24772f4b424eb959fe01bf5ca5e6148bfde93cc1fa7cb7f4ebcf7c41';
}