Namespace: serumInstructions
Last updated
Last updated
▸ Const
cancelAllOpenOrders(program
, optionMarketKey
, dexProgramId
, serumMarketKey
): Promise
<TransactionInstruction
[]>
Create an array of TransactionInstructions to cancel all of the wallet's orders for a given OptionMarket and SerumMarket.
NOTE: Current implementation does not account for Transaction packet size limitations. It is on the client to slice the instructions to be within the limits.
Parameters
Name | Type | Description |
---|---|---|
Returns
Promise
<TransactionInstruction
[]>
Defined in
serumInstructions/cancelOrder.ts:109
▸ Const
cancelOrderByClientId(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, order
, marketAuthorityBump?
): Promise
<TransactionInstruction
>
Generate a TransactionInstruction
for canceling an open order by the set clientId
Parameters
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/cancelOrder.ts:63
▸ Const
cancelOrderInstructionV2(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, order
, marketAuthorityBump?
): Promise
<TransactionInstruction
>
Create a TransactionInstruction for canceling a specific order
Parameters
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/cancelOrder.ts:22
▸ Const
closeOpenOrdersInstruction(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, openOrdersKey
, marketAuthorityBump
, solWallet?
): Promise
<TransactionInstruction
>
Create instruction to close OpenOrders account.
Parameters
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/closeOpenOrders.ts:19
▸ Const
initOpenOrdersInstruction(program
, owner
, optionMarketKey
, dexProgramId
, serumMarketKey
, marketAuthorityBump?
): Promise
<Object
>
Create a proxied InitOpenOrdersInstruction
Parameters
Returns
Promise
<Object
>
Defined in
serumInstructions/initOpenOrders.ts:18
▸ Const
marketLoader(program
, optionMarketKey
, marketAuthorityBump
, dexProgramId
, marketKey
, opts?
): Promise
<MarketProxy
>
Create a MarketProxy for the Psy American V 1.1 program
Parameters
Returns
Promise
<MarketProxy
>
Defined in
serumInstructions/marketLoader.ts:16
▸ Const
newOrderInstruction(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, orderArguments
, marketAuthorityBump?
): Promise
<Object
>
Create a new order proxied through the Psy American Protocol
Parameters
Returns
Promise
<Object
>
Defined in
serumInstructions/newOrder.ts:22
▸ Const
settleFundsInstruction(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, baseWallet
, quoteWallet
, serumReferralKey
, openOrdersKey
, marketAuthorityBump?
): Promise
<TransactionInstruction
>
Create a TransactionInstruction for the settleFunds instruction
Parameters
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/settleFunds.ts:24
▸ Const
settleMarketFundsInstruction(program
, optionMarketKey
, dexProgramId
, serumMarket
, baseWallet
, quoteWallet
, openOrdersKey
): Promise
<TransactionInstruction
>
Create a TransactionInstruction for the settleFunds instruction
Note: this API abstracts the complexity of the serumReferralKey away.
Parameters
Returns
Promise
<TransactionInstruction
>
Defined in
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
program
Program
<PsyAmerican
>
Anchor Program for Psy American
optionMarketKey
PublicKey
The address of the OptionMarket for the option in the Seurm Market
dexProgramId
PublicKey
The PublicKey of the DEX program
serumMarketKey
PublicKey
The PublicKey of the Serum market
program
Program
<PsyAmerican
>
Anchor Program for Psy American
optionMarketKey
PublicKey
The address of the OptionMarket for the option in the Seurm Market
dexProgramId
PublicKey
The PublicKey of the DEX program
serumMarketKey
PublicKey
The PublicKey of the Serum market
order
Order
The Serum Order to cancel
marketAuthorityBump
number
Optional: bump seed for the Serum market
program
Program
<PsyAmerican
>
Anchor Program for Psy American
optionMarketKey
PublicKey
The address of the OptionMarket for the option in the Seurm Market
dexProgramId
PublicKey
The PublicKey of the DEX program
serumMarketKey
PublicKey
The PublicKey of the Serum market
order
Order
The Serum Order to cancel
marketAuthorityBump
number
Optional: bump seed for the Serum market
program
Program
<PsyAmerican
>
Anchor Psy American Program
optionMarketKey
PublicKey
The OptionMarket address
dexProgramId
PublicKey
The Serum DEX program ID
serumMarketKey
PublicKey
The Serum market address
openOrdersKey
PublicKey
The open orders key for the account we're closing
marketAuthorityBump
number
OPTIONAL: pass in the market authority bump seed
solWallet?
PublicKey
OPTIONAL: pass in a different address to send the unlocked Sol to
program
Program
<PsyAmerican
>
Anchor Psy American program
owner
PublicKey
The user's wallet address
optionMarketKey
PublicKey
The OptionMarket address key
dexProgramId
PublicKey
Serum DEX id
serumMarketKey
PublicKey
The Serum market address
marketAuthorityBump
number
OPTIONAL: pass in the market authority bump seed
program
Program
<PsyAmerican
>
Anchor Psy American program
optionMarketKey
PublicKey
The OptionMarket address
marketAuthorityBump
number
The marketAuthority bump seed
dexProgramId
PublicKey
The Serum DEX program id
marketKey
PublicKey
The Serum market address
opts
Object
-
opts.enableLogger
boolean
-
program