• This function creates an AddRemoveDelegation operation using the specified Honeycomb instance and the provided arguments. The operation is used to add or remove a delegate's authority in a HoneycombProject. If the delegate already has authority, provide the index to remove it.

    The function calculates the delegate authority public key using the project's address, the identity's address, and the delegate's public key.

    Parameters

    Returns Promise<{
        delegateAuthority: web3.PublicKey;
        operation: Operation;
    }>

    An object containing the operation and delegate authority information.

    Example

    const honeycomb = new Honeycomb(connection);
    const project = new HoneycombProject(...); // Create the HoneycombProject instance.

    // Create AddRemoveDelegation operation with specified delegation arguments.
    const operationArgs: CreateAddRemoveDelegationOperationArgs = {
    args: {
    delegation: { __kind: "Master", permission: MasterProgramPermission.ManageServices }, // Or "Read" for read-only authority.
    index: null, // Provided when removing a delegation
    },
    project: project,
    delegate: publicKey1,
    };
    const { operation, delegateAuthority } = await createAddRemoveDelegationOperation(honeycomb, operationArgs);
    operation.send(); // The generated AddRemoveDelegation operation.
    console.log(delegateAuthority); // The delegate authority public key.

Generated using TypeDoc