Namespace: serumInstructions
Classes
Functions
cancelAllOpenOrders
▸ 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 |
---|---|---|
|
| Anchor Program for Psy American |
|
| The address of the OptionMarket for the option in the Seurm Market |
|
| The PublicKey of the DEX program |
|
| The PublicKey of the Serum market |
Returns
Promise
<TransactionInstruction
[]>
Defined in
serumInstructions/cancelOrder.ts:109
cancelOrderByClientId
▸ Const
cancelOrderByClientId(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, order
, marketAuthorityBump?
): Promise
<TransactionInstruction
>
Generate a TransactionInstruction
for canceling an open order by the set clientId
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The address of the OptionMarket for the option in the Seurm Market |
|
| The PublicKey of the DEX program |
|
| The PublicKey of the Serum market |
|
| The Serum Order to cancel |
|
| Optional: bump seed for the Serum market |
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/cancelOrder.ts:63
cancelOrderInstructionV2
▸ Const
cancelOrderInstructionV2(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, order
, marketAuthorityBump?
): Promise
<TransactionInstruction
>
Create a TransactionInstruction for canceling a specific order
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Program for Psy American |
|
| The address of the OptionMarket for the option in the Seurm Market |
|
| The PublicKey of the DEX program |
|
| The PublicKey of the Serum market |
|
| The Serum Order to cancel |
|
| Optional: bump seed for the Serum market |
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/cancelOrder.ts:22
closeOpenOrdersInstruction
▸ Const
closeOpenOrdersInstruction(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, openOrdersKey
, marketAuthorityBump
, solWallet?
): Promise
<TransactionInstruction
>
Create instruction to close OpenOrders account.
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Psy American Program |
|
| The OptionMarket address |
|
| The Serum DEX program ID |
|
| The Serum market address |
|
| The open orders key for the account we're closing |
|
| OPTIONAL: pass in the market authority bump seed |
|
| OPTIONAL: pass in a different address to send the unlocked Sol to |
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/closeOpenOrders.ts:19
initOpenOrdersInstruction
▸ Const
initOpenOrdersInstruction(program
, owner
, optionMarketKey
, dexProgramId
, serumMarketKey
, marketAuthorityBump?
): Promise
<Object
>
Create a proxied InitOpenOrdersInstruction
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Psy American program |
|
| The user's wallet address |
|
| The OptionMarket address key |
|
| Serum DEX id |
|
| The Serum market address |
|
| OPTIONAL: pass in the market authority bump seed |
Returns
Promise
<Object
>
Defined in
serumInstructions/initOpenOrders.ts:18
marketLoader
▸ Const
marketLoader(program
, optionMarketKey
, marketAuthorityBump
, dexProgramId
, marketKey
, opts?
): Promise
<MarketProxy
>
Create a MarketProxy for the Psy American V 1.1 program
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Psy American program |
|
| The OptionMarket address |
|
| The marketAuthority bump seed |
|
| The Serum DEX program id |
|
| The Serum market address |
|
| - |
|
| - |
Returns
Promise
<MarketProxy
>
Defined in
serumInstructions/marketLoader.ts:16
newOrderInstruction
▸ Const
newOrderInstruction(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, orderArguments
, marketAuthorityBump?
): Promise
<Object
>
Create a new order proxied through the Psy American Protocol
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Psy American program |
|
| The OptionMarket address |
|
| The Serum DEX program ID |
|
| The Serum market address |
|
| The Serum OrderParams |
|
| OPTIONAL: pass in the market authority bump seed |
Returns
Promise
<Object
>
Defined in
serumInstructions/newOrder.ts:22
settleFundsInstruction
▸ Const
settleFundsInstruction(program
, optionMarketKey
, dexProgramId
, serumMarketKey
, baseWallet
, quoteWallet
, serumReferralKey
, openOrdersKey
, marketAuthorityBump?
): Promise
<TransactionInstruction
>
Create a TransactionInstruction for the settleFunds instruction
Parameters
Name | Type | Description |
---|---|---|
|
| Anchor Psy American Program |
|
| The OptionMarket address |
|
| The Serum DEX program ID |
|
| The Serum market address |
|
| The wallet address that contains the user's base asset tokens |
|
| The wallet address that contains the user's quote asset tokens |
|
| The Psy American referral address for the quote asset |
|
| The open orders keys |
|
| OPTIONAL: pass in the market authority bump seed |
Returns
Promise
<TransactionInstruction
>
Defined in
serumInstructions/settleFunds.ts:24
settleMarketFundsInstruction
▸ 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
Name | Type | Description |
---|---|---|
|
| Anchor Psy American Program |
|
| The OptionMarket address |
|
| The Serum DEX program ID |
|
| The Serum market |
|
| The wallet address that contains the user's base asset tokens |
|
| The wallet address that contains the user's quote asset tokens |
|
| The open orders keys |
Returns
Promise
<TransactionInstruction
>
Defined in
Last updated