Options
All
  • Public
  • Public/Protected
  • All
Menu

stellar-option

Index

Type aliases

AssetAmount

AssetAmount: { amount: number; asset: Asset }

Type declaration

  • amount: number
  • asset: Asset

NetworkOptions

NetworkOptions: { baseReserve: number; fee: number; network: string; timeout: number }

Type declaration

  • baseReserve: number
  • fee: number
  • network: string
  • timeout: number

OptionParams

OptionParams: { delay: number; exercise: AssetAmount; expiry: number; premium: AssetAmount; underlying: AssetAmount }

underlying is the asset that the buyer buys a right to buy an amount of.

premium is the price the buyer pays the seller for that right.

exercise is the price the buyer pays if the option is exercised.

expiry is the timestamp at which the option matures and can be exercised.

delay is how long (in seconds) after expiry the seller has to wait in order to reclaim the underlying assets of an option not exercised.

Type declaration

OptionTransactions

OptionTransactions: { exercise: Transaction; refund: Transaction; setup: Transaction }

This is used by createTransactions to return the transactions created

setup contains a transaction that can be used to create an option. It creates the escrow account, puts the underlying assets in escrow, pays the seller the option premium, and locks itself down.

Needs to be signed by both buyer and seller.

exercise contains a transaction that the buyer can use to exercise the options right, by paying the seller the strike price to get the underlying assets out of escrow.

Needs to be signed by the buyer.

refund contains a transaction that the seller can use to reclaim the underlying asset from the escrow account.

No additional signatures needed, can be submitted as-is.

Type declaration

  • exercise: Transaction
  • refund: Transaction
  • setup: Transaction