Provides utility methods and transaction builders for interacting with the Galactic Marketplace.

Constructors

Properties

currencyInfo: GmRegisteredCurrency[] = []

Methods

  • Fetches all open orders from the Galactic Marketplace.

    Parameters

    • connection: Connection

      Solana Connection

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order[]>

  • Parameters

    • connection: Connection
    • uiPrice: number
    • quoteCurrency: PublicKey
    • programId: PublicKey

    Returns Promise<BN>

  • Parameters

    • connection: Connection

      Solana Connection

    • orderAccount: PublicKey

      The order account PublicKey (order ID)

    • orderInitializer: PublicKey

      The PublicKey which created the order

    • programId: PublicKey

      Galactic Marketplace program ID

    Returns Promise<{
        signers: Keypair[];
        transaction: Transaction;
    }>

  • Parameters

    • connection: Connection

      Solana Connection

    • order: Order

      The order account PublicKey (order ID)

    • orderTaker: PublicKey

      The PublicKey purchasing the order

    • purchaseQty: number

      Self-explanatory

    • programId: PublicKey

      Galactic Marketplace program ID

    • stakingProgramId: PublicKey = ...

      (optional) Atlas Staking program ID, used to find seller's ATLAS staking account for market fee reductions - defaults to mainnet staking program ID

    • registeredStake: PublicKey = ...

      (optional) A RegisteredStake account, used to validate the seller's ATLAS staking account - defaults to the Atlas locker deployed by Star Atlas on mainnet

    Returns Promise<{
        signers: Keypair[];
        transaction: Transaction;
    }>

  • Get a Transaction to initialize either a buy or sell order

    Parameters

    • connection: Connection

      Solana Connection

    • orderCreator: PublicKey

      Order creator

    • itemMint: PublicKey

      Item mint, e.g. Discovery of Iris

    • quoteMint: PublicKey

      The quote currency, e.g. ATLAS, USDC

    • quantity: number

      Self-explanatory

    • price: BN

      The price of the item

    • programId: PublicKey

      Galactic Marketplace program ID

    • orderSide: OrderSide

      The order side from the perspective of the order creator

    Returns Promise<{
        signers: Keypair[];
        transaction: Transaction;
    }>

  • Fetch a single open order

    Parameters

    • connection: Connection

      Solana Connection

    • orderAccount: PublicKey

      The order.id as PublicKey

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order>

  • Fetches all open orders from the Galactic Marketplace filtered by asset.

    Parameters

    • connection: Connection

      Solana Connection

    • assetMint: PublicKey

      The token PublicKey

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order[]>

  • Fetches all open orders from the Galactic Marketplace filtered by currency.

    Parameters

    • connection: Connection

      Solana Connection

    • currencyMint: PublicKey

      Currency mint - use getAllGmRegisteredCurrencyInfo for a list of valid currencies

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order[]>

  • Fetches all open orders for a player PublicKey.

    Parameters

    • connection: Connection

      Solana Connection

    • playerPublicKey: PublicKey

      User PublicKey

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order[]>

  • Fetches all open orders from the Galactic Marketplace filtered by asset.

    Parameters

    • connection: Connection

      Solana Connection

    • playerPublicKey: PublicKey

      User PublicKey

    • assetMint: PublicKey

      The token PublicKey

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order[]>

  • Fetches all open orders from the Galactic Marketplace filtered by asset.

    Parameters

    • connection: Connection

      Solana Connection

    • playerPublicKey: PublicKey

      User PublicKey

    • currencyMint: PublicKey

      Currency mint - use getAllGmRegisteredCurrencyInfo for a list of valid currencies

    • programId: PublicKey

      Marketplace program PublicKey

    Returns Promise<Order[]>

  • Returns information about all valid quote currencies registered with the Galactic Marketplace

    Parameters

    • connection: Connection

      Solana Connection

    • programId: PublicKey

      Marketplace program PublicKey

    • invalidateCache: boolean = false

      Forces currency cache to be invalidated

    Returns Promise<GmRegisteredCurrency[]>