Class CargoType

Hierarchy

  • CargoType

Implements

  • Account

Constructors

  • Parameters

    • _data: AnchorTypeDef<Object, AnchorDefined<CargoIDL, Record<string, never>>>
    • _key: PublicKey
    • _stats: BN[]

    Returns CargoType

Properties

ACCOUNT_NAME: "cargoPod" | "cargoType" | "cargoStatsDefinition" = 'cargoType'
MIN_DATA_SIZE: number = CARGO_TYPE_OFFSET

Accessors

  • get data(): Readonly<AnchorTypeDef<Object, AnchorDefined<CargoIDL, Record<string, never>>>>
  • Returns Readonly<AnchorTypeDef<Object, AnchorDefined<CargoIDL, Record<string, never>>>>

  • get key(): PublicKey
  • Returns PublicKey

  • get stats(): readonly BN[]
  • Returns readonly BN[]

Methods

  • Finds PDA for Cargo Type Account

    Returns

    PDA key & bump

    Parameters

    • program: CargoIDLProgram

      The Cargo IDL program

    • statsDefinition: PublicKey

      Stats Definition Account key

    • mint: PublicKey

      Mint key

    • seqId: number

      Sequence ID of the Cargo Type Account

    Returns [PublicKey, number]

  • Initialize a new Cargo Type Account

    Returns

    InstructionReturn

    Parameters

    • root0: {
          input: AnchorTypeDef<Object, Record<string, never>>;
          managerKey: AsyncSigner<unknown>;
          mint: PublicKey;
          profile: PublicKey;
          program: CargoIDLProgram;
          statsDefinition: PublicKey;
          statsDefinitionSeqId: number;
      }

      Object for initCargoType instruction

      • input: AnchorTypeDef<Object, Record<string, never>>

        Input struct

      • managerKey: AsyncSigner<unknown>

        Key authorized for this instruction

      • mint: PublicKey

        Mint key

      • profile: PublicKey

        Profile with required Cargo Permissions

      • program: CargoIDLProgram

        Cargo Program

      • statsDefinition: PublicKey

        Stats Definition Account

      • statsDefinitionSeqId: number

        Stats Definition Sequence ID

    Returns InstructionReturn

  • Initialize a new cargo type with seq_id = definition.seq_id + 1

    Returns

    InstructionReturn

    Parameters

    • root0: {
          input: AnchorTypeDef<Object, Record<string, never>>;
          managerKey: AsyncSigner<unknown>;
          profile: PublicKey;
          program: CargoIDLProgram;
          statsDefinition: CargoStatsDefinition;
          typeMint: PublicKey;
      }

      Object containing function parameters

      • input: AnchorTypeDef<Object, Record<string, never>>

        Input struct

      • managerKey: AsyncSigner<unknown>

        Key authorized to use this instruction

      • profile: PublicKey

        Profile with required Cargo Permissions

      • program: CargoIDLProgram

        Cargo Program

      • statsDefinition: CargoStatsDefinition

        Stats Definition Account

      • typeMint: PublicKey

        Cargo Type Mint

    Returns InstructionReturn

  • Initializes a new Cargo Type Account with the same Mint as an old one. Updates stats if new values are provided, otherwise copies from old Cargo Type Account.

    Returns

    InstructionReturn

    Parameters

    • root0: {
          input: AnchorTypeDef<Object, Record<string, never>>;
          managerKey: AsyncSigner<unknown>;
          mint: AsyncSigner<unknown>;
          oldCargoType: CargoType;
          profile: PublicKey;
          program: CargoIDLProgram;
          statsDefinition: PublicKey;
      }

      Object containing parameters

      • input: AnchorTypeDef<Object, Record<string, never>>

        Input struct

      • managerKey: AsyncSigner<unknown>

        Key authorized to use this instruction

      • mint: AsyncSigner<unknown>

        Mint account

      • oldCargoType: CargoType

        Old Cargo Type Account

      • profile: PublicKey

        Profile with required Cargo permissions

      • program: CargoIDLProgram

        Cargo program

      • statsDefinition: PublicKey

        Stats Definition Account

    Returns InstructionReturn

Generated using TypeDoc