Type alias CandyGuardManifest<Settings, MintSettings, RouteSettings>

CandyGuardManifest<Settings, MintSettings, RouteSettings>: {
    name: string;
    settingsBytes: number;
    settingsSerializer: Serializer<Settings>;
    mintSettingsParser?: ((input: MintSettingsParserInput<Settings, MintSettings>) => {
        arguments: Buffer;
        remainingAccounts: CandyGuardsRemainingAccount[];
    });
    routeSettingsParser?: ((input: RouteSettingsParserInput<Settings, RouteSettings>) => {
        arguments: Buffer;
        remainingAccounts: CandyGuardsRemainingAccount[];
    });
}

When creating your own custom guards, you will need to register them with the JS SDK by creating a CandyGuardManifest which lets the SDK know how to interact with your guard.

Type Parameters

  • Settings extends object

  • MintSettings extends object = {}

  • RouteSettings extends object = {}

Type declaration

  • name: string

    The name of your guard. This should match the name provided in the availableGuards array of your registered CandyGuardProgram.

  • settingsBytes: number

    The total amount of bytes required to serialize your guard's settings. Contratry to the usual Borsh serialization, this size is fixed and should represent the maximum space required for your guard's settings.

  • settingsSerializer: Serializer<Settings>

    The serializer used to serialize and deserialize your guard's settings.

  • Optional mintSettingsParser?: ((input: MintSettingsParserInput<Settings, MintSettings>) => {
        arguments: Buffer;
        remainingAccounts: CandyGuardsRemainingAccount[];
    })
      • (input: MintSettingsParserInput<Settings, MintSettings>): {
            arguments: Buffer;
            remainingAccounts: CandyGuardsRemainingAccount[];
        }
      • If your guard requires additional accounts or arguments to be passed to the mint instruction, this function parses the predefined mintSettings of your guards into the required arguments and remaining accounts.

        Parameters

        Returns {
            arguments: Buffer;
            remainingAccounts: CandyGuardsRemainingAccount[];
        }

        • arguments: Buffer

          The serialized arguments to pass to the mint instruction.

        • remainingAccounts: CandyGuardsRemainingAccount[]

          A remain account to push to the mint or route instruction. When isSigner is true, the address attribute must be Signer and it will be pushed to the signers array of the transaction.

  • Optional routeSettingsParser?: ((input: RouteSettingsParserInput<Settings, RouteSettings>) => {
        arguments: Buffer;
        remainingAccounts: CandyGuardsRemainingAccount[];
    })
      • (input: RouteSettingsParserInput<Settings, RouteSettings>): {
            arguments: Buffer;
            remainingAccounts: CandyGuardsRemainingAccount[];
        }
      • If your guard support the "route" instruction which allows you to execute a custom instruction on the guard, this function parses the predefined routeSettings of your guards into the required arguments and remaining accounts.

        Parameters

        Returns {
            arguments: Buffer;
            remainingAccounts: CandyGuardsRemainingAccount[];
        }

        • arguments: Buffer

          The serialized arguments to pass to the route instruction.

        • remainingAccounts: CandyGuardsRemainingAccount[]

          A remain account to push to the mint or route instruction. When isSigner is true, the address attribute must be Signer and it will be pushed to the signers array of the transaction.

Generated using TypeDoc