Options
All
  • Public
  • Public/Protected
  • All
Menu

@solventprotocol/strikr-core

Index

Functions

  • closeOptionState(provider: AnchorProvider, assetNftMint: PublicKey): Promise<string>
  • Close the OptionState account and release lamports

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    Returns Promise<string>

    Promise resolving to the transaction signature

  • closePutOptionBuyer(provider: AnchorProvider, assetNftMint: PublicKey, buyerPositionNftMint: PublicKey, assetNftTokenAccount?: PublicKey): Promise<string>
  • Close the put option buyer position.

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    • buyerPositionNftMint: PublicKey

      Position NFT representing option buyer position

    • Optional assetNftTokenAccount: PublicKey

      Token account containing the asset NFT

    Returns Promise<string>

    Promise resolving to the transaction signature

  • closePutOptionSeller(provider: AnchorProvider, assetNftMint: PublicKey, sellerPositionNftMint: PublicKey, assetNftTokenAccount?: PublicKey): Promise<string>
  • Close the put option seller position.

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    • sellerPositionNftMint: PublicKey

      Position NFT representing option seller position

    • Optional assetNftTokenAccount: PublicKey

      Token account containing the asset NFT

    Returns Promise<string>

    Promise resolving to the transaction signature

  • createPutOption(provider: AnchorProvider, assetNftMint: PublicKey, strikePrice: BN, duration: BN, premium: BN, isGraceIncluded?: boolean, assetNftTokenAccount?: PublicKey): Promise<string>
  • Create a put option request as an option buyer

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    • strikePrice: BN
    • duration: BN
    • premium: BN
    • isGraceIncluded: boolean = false
    • Optional assetNftTokenAccount: PublicKey

      Token account containing the asset NFT

    Returns Promise<string>

    Promise resolving to the transaction signature

  • exercisePutOption(provider: AnchorProvider, assetNftMint: PublicKey, buyerPositionNftMint: PublicKey): Promise<string>
  • Exercise the put option

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    • buyerPositionNftMint: PublicKey

      Position NFT representing option buyer position

    Returns Promise<string>

    Promise resolving to the transaction signature

  • fillPutOption(provider: AnchorProvider, assetNftMint: PublicKey): Promise<string>
  • Fill the put option request as a seller.

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    Returns Promise<string>

    Promise resolving to the transaction signature

  • floorClosePutOptionBuyer(provider: AnchorProvider, optionKey: PublicKey): Promise<Response>
  • Close the put option buyer position.

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • optionKey: PublicKey

      Option key representing a unique option

    Returns Promise<Response>

    Promise resolving to the transaction signature

  • floorClosePutOptionSeller(provider: AnchorProvider, optionKey: PublicKey, assetNftMint?: PublicKey, assetNftTokenAccount?: PublicKey): Promise<Response>
  • Close the put option seller position.

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • optionKey: PublicKey

      Option key representing a unique option

    • Optional assetNftMint: PublicKey

      Asset NFT which underlies the option

    • Optional assetNftTokenAccount: PublicKey

      Token account containing the asset NFT

    Returns Promise<Response>

    Promise resolving to the transaction signature

  • floorCreatePutOption(provider: AnchorProvider, collectionIdentifierKey: PublicKey, strikePrice: BN, duration: BN, premium: BN): Promise<Response>
  • Create a put option request as an option buyer

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • collectionIdentifierKey: PublicKey

      CollectionIdentifier key of the NFT collection which underlies the option

    • strikePrice: BN
    • duration: BN
    • premium: BN

    Returns Promise<Response>

    Promise resolving to the transaction signature

  • floorExercisePutOption(provider: AnchorProvider, optionKey: PublicKey, assetNftMint: PublicKey, whitelistProof: number[][], assetNftTokenAccount?: PublicKey): Promise<Response>
  • Exercise the put option

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • optionKey: PublicKey

      Option key representing a unique option

    • assetNftMint: PublicKey

      Asset NFT which underlies the option

    • whitelistProof: number[][]

      The Merkle proof of the NFT wrt the mint list tree

    • Optional assetNftTokenAccount: PublicKey

      Optional: The token account of the user wrt the NFT

    Returns Promise<Response>

    Promise resolving to the transaction signature

  • floorFillPutOption(provider: AnchorProvider, optionKey: PublicKey): Promise<Response>
  • Fill the put option request as a seller.

    Parameters

    • provider: AnchorProvider

      Anchor provider

    • optionKey: PublicKey

      Option key representing the option to be filled

    Returns Promise<Response>

    Promise resolving to the transaction signature

  • getAllFloorOptions(connection: Connection): Promise<ProgramAccount<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>[]>
  • Fetch all OptionState accounts

    Parameters

    • connection: Connection

      Solana Web3 connection object

    Returns Promise<ProgramAccount<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>[]>

    Promise resolving to the OptionState account contents

  • getAllOptions(connection: Connection): Promise<ProgramAccount<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>[]>
  • Fetch all OptionState accounts

    Parameters

    • connection: Connection

      Solana Web3 connection object

    Returns Promise<ProgramAccount<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>[]>

    Promise resolving to the OptionState account contents

  • getCollectionIdentifier(collectionIdentifierKey: PublicKey): Promise<PublicKey>
  • Parameters

    • collectionIdentifierKey: PublicKey

    Returns Promise<PublicKey>

  • getFloorOption(connection: Connection, optionKey: PublicKey): Promise<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>
  • Fetch OptionState account

    Parameters

    • connection: Connection

      Solana Web3 connection object

    • optionKey: PublicKey

      OptionKey representing an option uniquely

    Returns Promise<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>

    Promise resolving to the OptionState account contents

  • getFloorOptionState(optionKey: PublicKey): Promise<PublicKey>
  • Parameters

    • optionKey: PublicKey

    Returns Promise<PublicKey>

  • getMerkleProof(mints: PublicKey[], mint: PublicKey): number[][]
  • getMerkleTree(mints: PublicKey[]): { root: number[]; tree: MerkleTree }
  • Parameters

    • mints: PublicKey[]

    Returns { root: number[]; tree: MerkleTree }

    • root: number[]
    • tree: MerkleTree
  • getOption(connection: Connection, assetNftMint: PublicKey): Promise<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>
  • Fetch OptionState account

    Parameters

    • connection: Connection

      Solana Web3 connection object

    • assetNftMint: PublicKey

    Returns Promise<TypeDef<{ name: "collectionIdentifier"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "collectionIdentifierKey"; type: "publicKey" }, { name: "collectionMetadata"; type: { defined: "CollectionMetadata" } }, { name: "isEnabled"; type: "bool" }]; kind: "struct" } } | { name: "floorOptionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isCollateralDeposited"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "optionKey"; type: "publicKey" }]; kind: "struct" } } | { name: "optionState"; type: { fields: [{ name: "bump"; type: "u8" }, { name: "isExercised"; type: "bool" }, { name: "isExpired"; type: "bool" }, { name: "isBuyerClosed"; type: "bool" }, { name: "isSellerClosed"; type: "bool" }, { name: "assetNftMint"; type: "publicKey" }, { name: "buyerPositionNftMint"; type: "publicKey" }, { name: "sellerPositionNftMint"; type: { option: "publicKey" } }]; kind: "struct" } }, IdlTypes<Strikr>>>

    Promise resolving to the OptionState account contents

  • getOptionState(assetNftMint: PublicKey): Promise<PublicKey>
  • Parameters

    • assetNftMint: PublicKey

    Returns Promise<PublicKey>

  • getShellProvider(connection: Connection): AnchorProvider
  • getStrikr(provider: AnchorProvider): Program<Strikr>
  • getStrikrAuthority(): Promise<PublicKey>

Generated using TypeDoc