Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Purchasing

Hierarchy

  • Tx
    • Purchasing

Index

Constructors

constructor

  • new Purchasing(purchasingProgramAddress?: string, spltProgramAddress?: string, splataProgramAddress?: string, nodeUrl: string): Purchasing
  • Parameters

    • purchasingProgramAddress: string = ...
    • spltProgramAddress: string = ...
    • splataProgramAddress: string = ...
    • nodeUrl: string

    Returns Purchasing

Properties

connection

connection: Connection

nodeUrl

nodeUrl: string

purchasingProgramId

purchasingProgramId: PublicKey

splataProgramId

splataProgramId: PublicKey

spltProgramId

spltProgramId: PublicKey

Methods

approveOrder

  • approveOrder(orderAddress: string, wallet: WalletInterface): Promise<{ txId: string }>

cancelOrder

  • cancelOrder(orderAddress: string, wallet: WalletInterface): Promise<{ txId: string }>

deriveOrderAddress

  • deriveOrderAddress(index: number, ownerAddress: string, retailerAddress: string): Promise<string>
  • Derive order address

    Parameters

    • index: number

      Account index (MAX: 4294967296)

    • ownerAddress: string
    • retailerAddress: string

      Corresponding retailer address to the order account

    Returns Promise<string>

    Debt account address

freezeRetailer

  • freezeRetailer(retailerAddress: string, wallet: WalletInterface): Promise<{ txId: string }>

getOrderData

  • getOrderData(orderAddress: string): Promise<OrderData>

getRetailerData

  • getRetailerData(retailerAddress: string): Promise<RetailerData>

initializeRetailer

  • initializeRetailer(ownerAddress: string, mintBidAddress: string, mintAskAddress: string, wallet: WalletInterface): Promise<{ retailerAddress: string; txId: string }>
  • Initialize retailer

    Parameters

    • ownerAddress: string
    • mintBidAddress: string
    • mintAskAddress: string
    • wallet: WalletInterface

    Returns Promise<{ retailerAddress: string; txId: string }>

parseOrderData

parseRetailerData

placeOrder

  • placeOrder(index: number, bidAmount: bigint, askAmount: bigint, lockedTime: bigint, retailerAddress: string, wallet: WalletInterface): Promise<{ orderAddress: string; txId: string }>
  • Place an order

    Parameters

    • index: number
    • bidAmount: bigint
    • askAmount: bigint
    • lockedTime: bigint

      (seconds time unit)

    • retailerAddress: string
    • wallet: WalletInterface

    Returns Promise<{ orderAddress: string; txId: string }>

redeemOrder

  • redeemOrder(orderAddress: string, wallet: WalletInterface): Promise<{ txId: string }>

rejectOrder

  • rejectOrder(orderAddress: string, wallet: WalletInterface): Promise<{ txId: string }>

thawRetailer

  • thawRetailer(retailerAddress: string, wallet: WalletInterface): Promise<{ txId: string }>

transferRetailerOwnership

  • transferRetailerOwnership(retailerAddress: string, newOwnerAddress: string, wallet: WalletInterface): Promise<{ txId: string }>
  • Transfer retailer's ownership

    remarks

    Retailer owner only

    Parameters

    Returns Promise<{ txId: string }>

    Transaction hash txId

unwatch

  • unwatch(watchId: number): Promise<void>
  • Unwatch a watcher by watch id

    Parameters

    • watchId: number

      The watchId was returned by watch function.

    Returns Promise<void>

watch

Generated using TypeDoc