Client Integration
Public packages
Javascript instruction bindings can be found under @mithraic-labs/psyoptions
A Rust crate will be supported soon to help with Cross Program Invocations!
Rust
Coming soon.
Javascript
American Style Options
@mithraic-labs/psy-american
Installation
Namespaces
Enumerations
Type aliases
NetworkInfo
Ƭ NetworkInfo: Object
Type declaration
Defined in
OptionMarket
Ƭ OptionMarket: Object
Type declaration
Defined in
OptionMarketWithKey
Ƭ OptionMarketWithKey: OptionMarket
& { key
: PublicKey
}
Defined in
OrderParamsWithFeeRate
Ƭ OrderParamsWithFeeRate<T
>: OrderParams
<T
> & { feeRate?
: number
}
Type parameters
Defined in
PsyAmerican
Ƭ PsyAmerican: Object
Type declaration
Defined in
Variables
FEE_OWNER_KEY
• FEE_OWNER_KEY: PublicKey
The fee owner key for the Psy American program
Defined in
NFT_MINT_LAMPORTS
• NFT_MINT_LAMPORTS: number
The number of lamports the protocol takes as a fee when minting or exercising an option on an asset that cannot take a 5bps fee. E.g a minting a call option on an NFT
Defined in
PSY_AMERICAN_PROGRAM_IDS
• PSY_AMERICAN_PROGRAM_IDS: Object
All prior Psy American programIds for all networks so clients that require backwards compatability can maintain it.
Type declaration
Defined in
PsyAmericanIdl
• PsyAmericanIdl: Idl
The Anchor IDL for the Psy American program. Used when creating an Anchor Program.
Copy
Defined in
Functions
chunkArray
▸ Const
chunkArray(myArray
, chunkSize
): any
[][]
Returns an array with arrays of the given size.
Parameters
Returns
any
[][]
Defined in
deriveOptionKeyFromParams
▸ Const
deriveOptionKeyFromParams(__namedParameters
): Promise
<[PublicKey
, number
]>
Get the deterministic address for an Option based on its properties.
Parameters
Returns
Promise
<[PublicKey
, number
]>
Defined in
utils/deriveOptionKeyFromParams.ts:8
feeAmountPerContract
▸ Const
feeAmountPerContract(assetQuantity
): BN
Get the protocol's fee amount when minting or exercising. When minting this should be the underlingAmountPerContract. When exercising this should be the quoteAmountPerContract.
Parameters
Returns
BN
Defined in
getAllOptionAccounts
▸ Const
getAllOptionAccounts(program
): Promise
<OptionMarketWithKey
[]>
Load all OptionMarkets owned by the given program from the blockchain.
Parameters#
Returns
Promise
<OptionMarketWithKey
[]>
Defined in
getOptionByKey
▸ Const
getOptionByKey(program
, key
): Promise
<OptionMarketWithKey
>
Parameters
Returns
Promise
<OptionMarketWithKey
>
Defined in
getOrAddAssociatedTokenAccountTx
▸ Const
getOrAddAssociatedTokenAccountTx(associatedAddress
, mintKey
, provider
, owner?
): Promise
<TransactionInstruction
>
Returns a TransactionInstruction for creating the associated token account if one deos not exist.
Parameters
Returns
Promise
<TransactionInstruction
>
Defined in
utils/getOrAddAssociatedTokenAccountTx.ts:20
getVaultOwnerAndNonce
▸ Const
getVaultOwnerAndNonce(marketPublicKey
, dexProgramId
): Promise
<[PublicKey
, BN
]>
This is needed for the permissioned serum markets.
TODO can we replace this with PublicKey.findProgramAddress
Parameters
Returns
Promise
<[PublicKey
, BN
]>
Defined in
utils/getVaultOwnerAndNonce.ts:13
parseTransactionError
▸ Const
parseTransactionError(error
): ProgramError
Parameters
Returns
ProgramError
Defined in
Last updated