Umi — API References - v1.3.0
    Preparing search index...

    Type Alias Program

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

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

    Properties

    getErrorFromCode: (code: number, cause?: Error) => ProgramError | null

    Retrieves a ProgramError from a given error code or null if the error code is not recognized.

    getErrorFromName: (name: string, cause?: Error) => ProgramError | null

    Retrieves a ProgramError from a given error name or null if the error name is not recognized.

    isOnCluster: (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.

    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.