Properties

baseGlobal: null | Global
connection: Connection
isBase22: boolean
isQuote22: boolean
market: Market
quoteGlobal: null | Global
wrapper: null | Wrapper

Methods

  • CancelAll instruction. Cancels all orders on a market

    Returns TransactionInstruction

    TransactionInstruction

  • Deposit instruction

    Parameters

    • payer: PublicKey

      PublicKey of the trader

    • mint: PublicKey

      PublicKey for deposit mint. Must be either the base or quote

    • amountTokens: number

      Number of tokens to deposit.

    Returns TransactionInstruction

    TransactionInstruction

  • killSwitchMarket transactions. Pulls all orders and withdraws all balances from the market in two transactions

    Parameters

    • payerKeypair: Keypair

    Returns Promise<string[]>

    TransactionSignatures[]

  • PlaceOrder instruction

    Parameters

    • params: WrapperPlaceOrderParamsExternal

      PlaceOrderParamsExternal including all the information for placing an order like amount, price, ordertype, ... This is called external because to avoid conflicts with the autogenerated version which has problems with expressing some of the parameters.

    Returns TransactionInstruction

    TransactionInstruction

  • PlaceOrderWithRequiredDeposit instruction. Only deposits the appropriate base or quote tokens if not in the withdrawable balances.

    Parameters

    • payer: PublicKey

      PublicKey of the trader

    • params: WrapperPlaceOrderParamsExternal

      WrapperPlaceOrderParamsExternal including all the information for placing an order like amount, price, ordertype, ... This is called external because to avoid conflicts with the autogenerated version which has problems with expressing some of the parameters.

    Returns Promise<TransactionInstruction[]>

    TransactionInstruction[]

  • Swap instruction

    Optimized swap for routers and arb bots. Normal traders should compose depost/withdraw/placeOrder to get limit orders. Does not go through the wrapper.

    Parameters

    • payer: PublicKey

      PublicKey of the trader

    • params: SwapParams

      SwapParams

    Returns TransactionInstruction

    TransactionInstruction

  • Withdraw All instruction. Withdraws all available base and quote tokens

    Returns TransactionInstruction[]

    TransactionInstruction[]

  • Withdraw instruction

    Parameters

    • payer: PublicKey

      PublicKey of the trader

    • mint: PublicKey

      PublicKey for withdraw mint. Must be either the base or quote

    • amountTokens: number

      Number of tokens to withdraw.

    Returns TransactionInstruction

    TransactionInstruction

  • CreateGlobalAddTrader instruction. Adds a new trader to the global account. Static because it does not require a wrapper.

    Parameters

    • payer: PublicKey

      PublicKey of the trader

    • globalMint: PublicKey

      PublicKey of the globalMint

    Returns TransactionInstruction

    TransactionInstruction

  • Create a new client which creates a wrapper and claims seat if needed.

    Parameters

    • connection: Connection

      Connection

    • marketPk: PublicKey

      PublicKey of the market

    • payerKeypair: Keypair

      Keypair of the trader

    Returns Promise<ManifestClient>

    ManifestClient

  • Create a new client. throws if setup ixs are needed. Call ManifestClient.getSetupIxs to check if ixs are needed. This is the way to create a client without directly passing in Keypair types (for example when building a UI).

    Parameters

    • connection: Connection

      Connection

    • marketPk: PublicKey

      PublicKey of the market

    • trader: PublicKey

      PublicKey of the trader

    Returns Promise<ManifestClient>

    ManifestClient

  • Create a new client that is read only. Cannot send transactions or generate instructions.

    Parameters

    • connection: Connection

      Connection

    • marketPk: PublicKey

      PublicKey of the market

    • Optionaltrader: PublicKey

      PublicKey for trader whose wrapper to fetch

    Returns Promise<ManifestClient>

    ManifestClient

  • Get all market program accounts. This is expensive RPC load..

    Parameters

    • connection: Connection

      Connection

    Returns Promise<GetProgramAccountsResponse>

    GetProgramAccountsResponse

  • generate ixs which need to be executed in order to run a manifest client for a given market. { setupNeeded: false } means all good. this function should be used before getClientForMarketNoPrivateKey for UI cases where Keypairs cannot be directly passed in.

    Parameters

    • connection: Connection

      Connection

    • marketPk: PublicKey

      PublicKey of the market

    • trader: PublicKey

      PublicKey of the trader

    Returns Promise<SetupData>

    Promise

  • Global deposit instruction. Static because it does not require a wrapper.

    Parameters

    • connection: Connection

      Connection to pull mint info

    • payer: PublicKey

      PublicKey of the trader

    • globalMint: PublicKey

      PublicKey for global mint deposit.

    • amountTokens: number

      Number of tokens to deposit.

    Returns Promise<TransactionInstruction>

    Promise

  • Global withdraw instruction. Static because it does not require a wrapper.

    Parameters

    • connection: Connection

      Connection to pull mint info

    • payer: PublicKey

      PublicKey of the trader

    • globalMint: PublicKey

      PublicKey for global mint withdraw.

    • amountTokens: number

      Number of tokens to withdraw.

    Returns Promise<TransactionInstruction>

    Promise

  • list all Manifest markets using getProgramAccounts. caution: this is a heavy call.

    Parameters

    • connection: Connection

      Connection

    Returns Promise<PublicKey[]>

    PublicKey[]