Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OpenSeaPort

Hierarchy

  • OpenSeaPort

Index

Constructors

constructor

Properties

api

gasIncreaseFactor

gasIncreaseFactor: number = DEFAULT_GAS_INCREASE_FACTOR

gasPriceAddition

gasPriceAddition: BigNumber = new BigNumber(3)

logger

logger: function

Type declaration

    • (arg: string): void
    • Parameters

      • arg: string

      Returns void

web3

web3: Web3

web3ReadOnly

web3ReadOnly: Web3

Methods

_approveAll

  • _approveAll(__namedParameters: object): Promise<(null | string)[]>

_approveOrder

_buyOrderValidationAndApprovals

  • _buyOrderValidationAndApprovals(__namedParameters: object): Promise<void>

_computeGasPrice

  • _computeGasPrice(): Promise<BigNumber>

_correctGasAmount

  • _correctGasAmount(estimation: number): number

_createEmailWhitelistEntry

  • _createEmailWhitelistEntry(__namedParameters: object): Promise<void>

_estimateGasForMatch

  • _estimateGasForMatch(__namedParameters: object, retries?: number): Promise<number | undefined>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • buy: Order
      • metadata: string
      • sell: Order
    • Default value retries: number = 1

    Returns Promise<number | undefined>

_estimateGasForTransfer

  • _estimateGasForTransfer(__namedParameters: object): Promise<number>

_getApprovedTokenCount

  • _getApprovedTokenCount(__namedParameters: object): Promise<BigNumber>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • proxyAddress: undefined | string
      • tokenAddress: undefined | string

    Returns Promise<BigNumber>

_getBuyFeeParameters

  • _getBuyFeeParameters(totalBuyerFeeBasisPoints: number, totalSellerFeeBasisPoints: number, sellOrder?: UnhashedOrder): object
  • Parameters

    • totalBuyerFeeBasisPoints: number
    • totalSellerFeeBasisPoints: number
    • Optional sellOrder: UnhashedOrder

    Returns object

    • feeMethod: FeeMethod
    • feeRecipient: string
    • makerProtocolFee: BigNumber
    • makerReferrerFee: BigNumber
    • makerRelayerFee: BigNumber
    • takerProtocolFee: BigNumber
    • takerRelayerFee: BigNumber

_getProxy

  • _getProxy(accountAddress: string, retries?: number): Promise<string | null>
  • Parameters

    • accountAddress: string
    • Default value retries: number = 0

    Returns Promise<string | null>

_getSellFeeParameters

  • _getSellFeeParameters(totalBuyerFeeBasisPoints: number, totalSellerFeeBasisPoints: number, waitForHighestBid: boolean, sellerBountyBasisPoints?: number): object
  • Parameters

    • totalBuyerFeeBasisPoints: number
    • totalSellerFeeBasisPoints: number
    • waitForHighestBid: boolean
    • Default value sellerBountyBasisPoints: number = 0

    Returns object

    • feeMethod: FeeMethod
    • feeRecipient: any
    • makerProtocolFee: BigNumber
    • makerReferrerFee: BigNumber
    • makerRelayerFee: BigNumber
    • takerProtocolFee: BigNumber
    • takerRelayerFee: BigNumber

_getStaticCallTargetAndExtraData

  • _getStaticCallTargetAndExtraData(__namedParameters: object): Promise<object>
  • Parameters

    • __namedParameters: object

    Returns Promise<object>

_initializeProxy

  • _initializeProxy(accountAddress: string): Promise<string>
  • Parameters

    • accountAddress: string

    Returns Promise<string>

_makeBundleBuyOrder

  • _makeBundleBuyOrder(__namedParameters: object): Promise<UnhashedOrder>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • collection: undefined | object
      • expirationTime: number
      • extraBountyBasisPoints: number
      • paymentTokenAddress: string
      • quantities: number[]
      • referrerAddress: undefined | string
      • sellOrder: undefined | UnhashedOrder
      • startAmount: number

    Returns Promise<UnhashedOrder>

_makeBundleSellOrder

  • _makeBundleSellOrder(__namedParameters: object): Promise<UnhashedOrder>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • bundleDescription: undefined | string
      • bundleExternalLink: undefined | string
      • bundleName: string
      • buyerAddress: string
      • collection: undefined | object
      • endAmount: undefined | number
      • expirationTime: number
      • extraBountyBasisPoints: number
      • paymentTokenAddress: string
      • quantities: number[]
      • startAmount: number
      • waitForHighestBid: boolean

    Returns Promise<UnhashedOrder>

_makeBuyOrder

  • _makeBuyOrder(__namedParameters: object): Promise<UnhashedOrder>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • asset: Asset
      • expirationTime: number
      • extraBountyBasisPoints: number
      • paymentTokenAddress: string
      • quantity: number
      • referrerAddress: undefined | string
      • sellOrder: undefined | UnhashedOrder
      • startAmount: number

    Returns Promise<UnhashedOrder>

_makeMatchingOrder

_makeSellOrder

  • _makeSellOrder(__namedParameters: object): Promise<UnhashedOrder>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • asset: Asset
      • buyerAddress: string
      • endAmount: undefined | number
      • expirationTime: number
      • extraBountyBasisPoints: number
      • paymentTokenAddress: string
      • quantity: number
      • startAmount: number
      • waitForHighestBid: boolean

    Returns Promise<UnhashedOrder>

_ownsAssetOnChain

  • _ownsAssetOnChain(__namedParameters: object): Promise<boolean>

_sellOrderValidationAndApprovals

  • _sellOrderValidationAndApprovals(__namedParameters: object): Promise<void>

_validateMatch

  • _validateMatch(__namedParameters: object, retries?: number): Promise<boolean>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • buy: Order
      • sell: Order
      • shouldValidateBuy: boolean
      • shouldValidateSell: boolean
    • Default value retries: number = 1

    Returns Promise<boolean>

_validateOrder

  • _validateOrder(order: Order): Promise<boolean>

addListener

  • addListener(event: EventType, listener: function, once?: boolean): EventSubscription

approveFungibleToken

  • approveFungibleToken(__namedParameters: object): Promise<string | null>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • minimumAmount: any
      • proxyAddress: undefined | string
      • tokenAddress: string

    Returns Promise<string | null>

    Transaction hash if a new transaction occurred, otherwise null

approveSemiOrNonFungibleToken

  • approveSemiOrNonFungibleToken(__namedParameters: object): Promise<string | null>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • proxyAddress: undefined | string
      • schemaName: WyvernSchemaName
      • skipApproveAllIfTokenAddressIn: Set<any>
      • tokenAbi: object[]
      • tokenAddress: string
      • tokenId: string

    Returns Promise<string | null>

    Transaction hash if a new transaction was created, otherwise null

cancelOrder

  • cancelOrder(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • order: Order

    Returns Promise<void>

computeFees

  • computeFees(__namedParameters: object): Promise<ComputedFees>

createBundleBuyOrder

  • createBundleBuyOrder(__namedParameters: object): Promise<Order>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • collection: undefined | object
      • expirationTime: number
      • paymentTokenAddress: undefined | string
      • quantities: undefined | number[]
      • referrerAddress: undefined | string
      • sellOrder: undefined | Order
      • startAmount: number

    Returns Promise<Order>

createBundleSellOrder

  • createBundleSellOrder(__namedParameters: object): Promise<Order>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • bundleDescription: undefined | string
      • bundleExternalLink: undefined | string
      • bundleName: string
      • buyerAddress: undefined | string
      • collection: undefined | object
      • endAmount: undefined | number
      • expirationTime: number
      • extraBountyBasisPoints: number
      • paymentTokenAddress: undefined | string
      • quantities: undefined | number[]
      • startAmount: number
      • waitForHighestBid: boolean

    Returns Promise<Order>

createBuyOrder

  • createBuyOrder(__namedParameters: object): Promise<Order>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • asset: Asset
      • expirationTime: number
      • paymentTokenAddress: undefined | string
      • quantity: number
      • referrerAddress: undefined | string
      • sellOrder: undefined | Order
      • startAmount: number

    Returns Promise<Order>

createFactorySellOrders

  • createFactorySellOrders(__namedParameters: object): Promise<number>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • buyerAddress: undefined | string
      • buyerEmail: undefined | string
      • endAmount: undefined | number
      • expirationTime: number
      • extraBountyBasisPoints: number
      • numberOfOrders: number
      • paymentTokenAddress: undefined | string
      • quantity: number
      • startAmount: number
      • waitForHighestBid: boolean

    Returns Promise<number>

    The number of orders created in total

createSellOrder

  • createSellOrder(__namedParameters: object): Promise<Order>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • asset: Asset
      • buyerAddress: undefined | string
      • buyerEmail: undefined | string
      • endAmount: undefined | number
      • expirationTime: number
      • extraBountyBasisPoints: number
      • paymentTokenAddress: undefined | string
      • quantity: number
      • startAmount: number
      • waitForHighestBid: boolean

    Returns Promise<Order>

fulfillOrder

  • fulfillOrder(__namedParameters: object): Promise<string>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • order: Order
      • recipientAddress: undefined | string
      • referrerAddress: undefined | string

    Returns Promise<string>

    Transaction hash for fulfilling the order

getAssetBalance

  • getAssetBalance(__namedParameters: object, retries?: number): Promise<BigNumber>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • asset: Asset
    • Default value retries: number = 1

    Returns Promise<BigNumber>

getCurrentPrice

  • getCurrentPrice(order: Order): Promise<any>

getFungibleTokens

  • Parameters

    • Default value __namedParameters: object = {}
      • address: undefined | string
      • name: undefined | string
      • symbol: undefined | string

    Returns Promise<OpenSeaFungibleToken[]>

getQuoteFromUniswap

  • getQuoteFromUniswap(__namedParameters: object): Promise<number>
  • Parameters

    • __namedParameters: object
      • contractAddress: string
      • isBuying: boolean
      • numTokens: number

    Returns Promise<number>

getTokenBalance

  • getTokenBalance(__namedParameters: object, retries?: number): Promise<BigNumber>
  • Parameters

    • __namedParameters: object
    • Default value retries: number = 1

    Returns Promise<BigNumber>

isAssetTransferrable

  • isAssetTransferrable(__namedParameters: object, retries?: number): Promise<boolean>
  • Parameters

    • __namedParameters: object
      • asset: Asset
      • fromAddress: string
      • quantity: undefined | number | BigNumber
      • toAddress: string
      • useProxy: boolean
    • Default value retries: number = 1

    Returns Promise<boolean>

isOrderFulfillable

  • isOrderFulfillable(__namedParameters: object): Promise<boolean>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • order: Order
      • recipientAddress: undefined | string
      • referrerAddress: undefined | string

    Returns Promise<boolean>

liquidateAssets

  • liquidateAssets(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • uniswapSlippageAllowedInBasisPoints: number

    Returns Promise<void>

purchaseAssets

  • purchaseAssets(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • amount: BigNumber
      • contractAddress: string
      • numTokensToBuy: number

    Returns Promise<void>

removeAllListeners

  • removeAllListeners(event?: EventType): void

removeListener

  • removeListener(subscription: EventSubscription): void
  • Parameters

    • subscription: EventSubscription

    Returns void

transfer

  • transfer(__namedParameters: object): Promise<string>
  • Parameters

    • __namedParameters: object
      • asset: Asset
      • fromAddress: string
      • quantity: number | BigNumber
      • toAddress: string

    Returns Promise<string>

    Transaction hash

transferAll

  • transferAll(__namedParameters: object): Promise<string>
  • Parameters

    • __namedParameters: object

    Returns Promise<string>

    Transaction hash

unapproveFungibleToken

  • unapproveFungibleToken(__namedParameters: object): Promise<string>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • proxyAddress: undefined | string
      • tokenAddress: string

    Returns Promise<string>

    Transaction hash

unwrapAssets

  • unwrapAssets(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]
      • destinationAddresses: string[]

    Returns Promise<void>

unwrapWeth

  • unwrapWeth(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • amountInEth: number

    Returns Promise<void>

validateAndPostOrder

  • validateAndPostOrder(order: Order): Promise<Order>

wrapAssets

  • wrapAssets(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • assets: Asset[]

    Returns Promise<void>

wrapEth

  • wrapEth(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • accountAddress: string
      • amountInEth: number

    Returns Promise<void>

Generated using TypeDoc