Class CargoPod

Hierarchy

  • CargoPod

Implements

  • Account

Constructors

  • Parameters

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

    Returns CargoPod

Properties

ACCOUNT_NAME: "cargoPod" | "cargoType" | "cargoStatsDefinition" = 'cargoPod'
MIN_DATA_SIZE: number = CARGO_POD_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

  • Add Cargo to Cargo Pod Only the registered cargo pod authority is allowed to do this

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • authority: AsyncSigner<unknown>

      Authority for the cargo pod

    • originTokenAccountAuthority: AsyncSigner<unknown>

      Authority for origin Token Account

    • cargoPod: PublicKey

      Cargo Pod PublicKey

    • cargoType: PublicKey

      Cargo Type PublicKey

    • statsDefinition: PublicKey

      Stats Definition PublicKey

    • originTokenAccount: PublicKey

      Origin Token Account

    • destinationTokenAccount: PublicKey

      Token Account owned by Cargo Pod

    • cargoAmount: BN

      Amount of cargo to be deposited

    Returns InstructionReturn

  • Close Cargo Pod Account

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • authority: AsyncSigner<unknown>

      Authority for Cargo Pod

    • cargoPod: PublicKey

      Cargo Pod Account

    Returns InstructionReturn

  • Close Cargo Pod Token Account

    Returns

    InstructionReturn

    Parameters

    • p: {
          authority: AsyncSigner<unknown>;
          cargoPod: PublicKey;
          cargoType: PublicKey;
          mint: AsyncSigner<unknown>;
          program: CargoIDLProgram;
          tokenAccountToClose: AsyncSigner<unknown>;
      }

      input parameters for this function

      • authority: AsyncSigner<unknown>

        Cargo Pod Authority

      • cargoPod: PublicKey

        Cargo Pod Account

      • cargoType: PublicKey

        Cargo Type Account

      • mint: AsyncSigner<unknown>

        Mint

      • program: CargoIDLProgram

        Cargo IDL program

      • tokenAccountToClose: AsyncSigner<unknown>

        Cargo Pod Token Account

    Returns InstructionReturn

  • Burns Cargo in a Cargo Pod This is permanent and irreversible

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • authority: AsyncSigner<unknown>

      Authority for the Cargo Pod

    • cargoPod: PublicKey

      Cargo Pod Account

    • cargoType: PublicKey

      Cargo Type Account

    • statsDefinition: PublicKey

      Stats Definition Account

    • cargoTokenAccount: PublicKey

      Token Account owned by Cargo Pod

    • tokenMint: PublicKey

      Token Mint key

    • cargoAmount: BN

      Amount of cargo to be burned

    Returns InstructionReturn

  • Finds the Cargo Pod PDA

    Returns

    PDA key & bump

    Parameters

    Returns [PublicKey, number]

  • Initialize new Cargo Pod

    Returns

    IntructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo program

    • authority: AsyncSigner<unknown>

      Authority for new Cargo Pod

    • statsDefinition: PublicKey

      The key for StatsDefinition Account

    • podSeeds: Buffer

      Pod Seeds

    Returns InstructionReturn

  • Legitimize cargo The cargo pod token accounts can receive tokens from anyone. However, only tokens received through the cargo pod program are recognized as valid cargo. This instruction can be used in cases where one wants to "legitimize" such token account balances Only the registered cargo pod authority is allowed to do this

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • authority: AsyncSigner<unknown>

      Cargo Pod Authority

    • cargoPod: PublicKey

      Cargo Pod Account

    • cargoType: PublicKey

      Cargo Type Account

    • statsDefinition: PublicKey

      Stats Definition Account

    • cargoTokenAccount: PublicKey

      Cargo Pod Token Account

    • cargoAmount: BN

      Amount of cargo to be legitimized

    Returns InstructionReturn

  • Mints to a Cargo Pod Token Account

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • mintAmount: BN

      Amount to be minted

    • authority: AsyncSigner<unknown>

      Authority for the Cargo Pod Account

    • mint: AsyncSigner<unknown>

      Mint Key

    • statsDefinition: PublicKey

      Stats Definition Account

    • cargoPod: PublicKey

      Cargo Pod Account

    • cargoType: PublicKey

      Cargo Type Account

    • tokenAccountToMintTo: AsyncSigner<unknown>

      Cargo Pod Token Account

    • tokenProgram: PublicKey

      Token Program

    Returns InstructionReturn

  • Remove Cargo from Cargo Pod Only the registered cargo pod authority is allowed to do this

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • authority: AsyncSigner<unknown>

      Authority for Cargo Pod

    • cargoPod: PublicKey

      Cargo Pod Account

    • cargoType: PublicKey

      Cargo Type Account

    • statsDefinition: PublicKey

      Stats Definition Account

    • originTokenAccount: PublicKey

      Token Account owned by Cargo Pod

    • destinationTokenAccount: PublicKey

      Destination Token Account

    • cargoAmount: BN

      Amount of cargo to be transferred

    Returns InstructionReturn

  • Updates Cargo Pod Authority This transfers the ownership of the cargo pod to another person/entity

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • authority: AsyncSigner<unknown>

      Current Authority

    • newAuthority: AsyncSigner<unknown>

      New Authority

    • cargoPod: PublicKey

      Cargo Pod account

    Returns InstructionReturn

  • Transfers Cargo between 2 Cargo Pods

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • originPodAuthority: AsyncSigner<unknown>

      Authority for the origin Cargo Pod

    • destinationPodAuthority: AsyncSigner<unknown>

      Authority for the destination Cargo Pod

    • originCargoPod: PublicKey

      Origin Cargo Pod

    • destinationCargoPod: PublicKey

      Destination Cargo Pod

    • cargoType: PublicKey

      Cargo Type Account

    • statsDefinition: PublicKey

      Stats Definition Account

    • originTokenAccount: PublicKey

      Token Account owned by origin Cargo Pod

    • destinationTokenAccount: PublicKey

      Token Account owned by destination Cargo Pod

    • cargoAmount: BN

      Amount of cargo to be transferred

    Returns InstructionReturn

  • Updates a Cargo Pod seq id to match the Stats Definition, Also freezes the pod until all related token accounts are updated

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • cargoPod: PublicKey

      Cargo Pod Account

    • statsDefinition: PublicKey

      Stats Definition Account

    Returns InstructionReturn

  • Updates Cargo Pod Token Account

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • statsDefinition: PublicKey

      Stats Definition Account

    • cargoPod: PublicKey

      Cargo Pod Account

    • oldCargoType: PublicKey

      Old Cargo Type Account

    • cargoType: PublicKey

      Current Cargo Type Account

    • cargoTokenAccount: PublicKey

      Token Account owned by the Cargo Pod

    Returns InstructionReturn

  • Used in the case a Cargo Type is not valid any more for a new seq_id , also tokens are burned and substracted from pod stats

    Returns

    InstructionReturn

    Parameters

    • program: CargoIDLProgram

      Cargo IDL program

    • statsDefinition: PublicKey

      Stats Definition Account

    • cargoPod: PublicKey

      Cargo Pod Account

    • oldCargoType: PublicKey

      Old Cargo Type Account

    • cargoTokenAccount: PublicKey

      Cargo Pod Token Account

    • tokenMint: PublicKey

      Mint Key

    Returns InstructionReturn

Generated using TypeDoc