Type alias Program

Program: {
    getErrorFromCode: ((code: number, cause?: Error) => ProgramError | null);
    getErrorFromName: ((name: string, cause?: Error) => ProgramError | null);
    isOnCluster: ((cluster: Cluster) => boolean);
    name: string;
    publicKey: PublicKey;
}

Defines a Solana Program that can be registered in Umi's program repository.

Type declaration

  • getErrorFromCode: ((code: number, cause?: Error) => ProgramError | null)
      • (code: number, cause?: Error): ProgramError | null
      • Retrieves a ProgramError from a given error code or null if the error code is not recognized.

        Parameters

        • code: number
        • Optional cause: Error

        Returns ProgramError | null

  • getErrorFromName: ((name: string, cause?: Error) => ProgramError | null)
      • (name: string, cause?: Error): ProgramError | null
      • Retrieves a ProgramError from a given error name or null if the error name is not recognized.

        Parameters

        • name: string
        • Optional cause: Error

        Returns ProgramError | null

  • isOnCluster: ((cluster: Cluster) => boolean)
      • (cluster: Cluster): boolean
      • A method that returns true if the program is available on the given cluster.

        If the same program is available on multiple clusters but using different public keys, multiple Program instances must be registered such that the isOnCluster method returns true for the appropriate cluster.

        Parameters

        Returns boolean

  • name: string

    A unique name for the Program in camelCase.

    To avoid conflict with other organizations, it is recommended to prefix the program name with a namespace that is unique to your organization. For instance, Metaplex programs are prefixed with mpl like so: mplTokenMetadata or mplCandyMachine.

  • publicKey: PublicKey

    The public key of the program.

Generated using TypeDoc