Skip to main content

CoreSDK

@bosonprotocol/core-sdk / Exports / CoreSDK

Class: CoreSDK

Hierarchy

  • BaseCoreSDK

  • MetadataMixin

  • AccountsMixin

  • OfferMixin

  • FundsMixin

  • ExchangesMixin

  • DisputesMixin

  • MetaTxMixin

  • NativeMetaTxMixin

  • GroupsMixin

  • OrchestrationMixin

  • EventLogsMixin

    CoreSDK

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new CoreSDK(opts)

Creates an instance of BaseCoreSDK

Parameters

NameType
optsObject
opts.chainIdnumber
opts.lensContracts?LensContracts
opts.metaTx?Partial<MetaTxConfig>
opts.metadataStorage?MetadataStorage
opts.protocolDiamondstring
opts.subgraphUrlstring
opts.theGraphStorage?MetadataStorage
opts.web3LibWeb3LibAdapter

Inherited from

BaseCoreSDK.constructor

Defined in

src/mixins/base-core-sdk.ts:26

Properties

_chainId

Protected _chainId: number

Inherited from

BaseCoreSDK._chainId

Defined in

src/mixins/base-core-sdk.ts:16


_lensContracts

Protected Optional _lensContracts: LensContracts

Inherited from

BaseCoreSDK._lensContracts

Defined in

src/mixins/base-core-sdk.ts:20


_metaTxConfig

Protected Optional _metaTxConfig: Partial<MetaTxConfig>

Inherited from

BaseCoreSDK._metaTxConfig

Defined in

src/mixins/base-core-sdk.ts:19


_metadataStorage

Protected Optional _metadataStorage: MetadataStorage

Inherited from

BaseCoreSDK._metadataStorage

Defined in

src/mixins/base-core-sdk.ts:11


_protocolDiamond

Protected _protocolDiamond: string

Inherited from

BaseCoreSDK._protocolDiamond

Defined in

src/mixins/base-core-sdk.ts:15


_subgraphUrl

Protected _subgraphUrl: string

Inherited from

BaseCoreSDK._subgraphUrl

Defined in

src/mixins/base-core-sdk.ts:14


_theGraphStorage

Protected Optional _theGraphStorage: MetadataStorage

Inherited from

BaseCoreSDK._theGraphStorage

Defined in

src/mixins/base-core-sdk.ts:12


_tokenInfoManager

Protected _tokenInfoManager: TokenInfoManager

Inherited from

BaseCoreSDK._tokenInfoManager

Defined in

src/mixins/base-core-sdk.ts:17


_web3Lib

Protected _web3Lib: Web3LibAdapter

Inherited from

BaseCoreSDK._web3Lib

Defined in

src/mixins/base-core-sdk.ts:10

Accessors

isMetaTxConfigSet

get isMetaTxConfigSet(): boolean

Returns

boolean

Defined in

src/core-sdk.ts:67


metaTxConfig

get metaTxConfig(): Partial<MetaTxConfig>

Returns

Partial<MetaTxConfig>

Defined in

src/core-sdk.ts:63

Methods

activateDisputeResolver

activateDisputeResolver(disputeResolverId): Promise<TransactionResponse>

Activates a dispute resolver account by calling the AccountHandlerFacet contract. Note, that the caller needs to have the ADMIN role.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishId of dispute resolver to activate.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:502


addFeesToDisputeResolver

addFeesToDisputeResolver(disputeResolverId, fees): Promise<TransactionResponse>

Adds fees to a dispute resolver account by calling the AccountHandlerFacet contract. Note, that the caller must be the specified admin address of the dispute resolver account.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishId of dispute resolver.
feesDisputeResolutionFee[]Dispute resolution fees. Should only contain token addresses that are not already specified.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:521


addSellersToDisputeResolverAllowList

addSellersToDisputeResolverAllowList(disputeResolverId, sellerAllowList): Promise<TransactionResponse>

Adds sellers to the allow list of a dispute resolver account by calling the AccountHandlerFacet contract. Note, that the caller must be the specified admin address of the dispute resolver account.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishId of dispute resolver.
sellerAllowListBigNumberish[]List of seller ids that are allowed to use the dispute resolver. Should only contain seller ids that are not part of the current allow list.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:542


approveExchangeToken

approveExchangeToken(exchangeToken, value, overrides?): Promise<TransactionResponse>

Approves the given amount for the main protocol contract.

Parameters

NameTypeDescription
exchangeTokenstringAddress of token to approve.
valueBigNumberishAmount of allowance.
overridesPartial<{ spender: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/offers/mixin.ts:300


assertAndGetMetaTxConfig

Protected assertAndGetMetaTxConfig(overrides?): Object

Parameters

NameType
overridesPartial<{ contractAddress: string ; metaTransactionMethod: string ; metaTxConfig: Partial<Omit<MetaTxConfig, "apiIds"> & { apiId: string }> }>

Returns

Object

NameType
contractAddressstring
metaTxApiIdstring
metaTxApiKeystring
metaTxRelayerUrlstring

Inherited from

BaseCoreSDK.assertAndGetMetaTxConfig

Defined in

src/mixins/base-core-sdk.ts:46


cancelVoucher

cancelVoucher(exchangeId): Promise<TransactionResponse>

Cancels an existing voucher by calling the ExchangeHandlerContract. Callable by buyer.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange to cancel.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:107


checkMetaTxConfigSet

checkMetaTxConfigSet(args?): boolean

Parameters

NameType
argsObject
args.contractAddress?string
args.metaTransactionMethod?string

Returns

boolean

Defined in

src/core-sdk.ts:71


checkTokenGatedCondition

checkTokenGatedCondition(offerCondition, buyerAddress): Promise<boolean>

Parameters

NameType
offerConditionObject
offerCondition.__typename?"ConditionEntity"
offerCondition.idstring
offerCondition.maxCommitsstring
offerCondition.methodnumber
offerCondition.thresholdstring
offerCondition.tokenAddressstring
offerCondition.tokenIdstring
offerCondition.tokenTypenumber
buyerAddressstring

Returns

Promise<boolean>

Defined in

src/offers/mixin.ts:330


commitToOffer

commitToOffer(offerId, overrides?): Promise<TransactionResponse>

Commits to an offer by calling the ExchangeHandlerContract. This transaction only succeeds if the seller has deposited funds.

Parameters

NameTypeDescription
offerIdBigNumberishID of offer to commit to.
overridesPartial<{ buyer: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:54


completeExchange

completeExchange(exchangeId): Promise<TransactionResponse>

Completes an existing voucher by calling the ExchangeHandlerContract. Callable by buyer or seller operator.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange to complete.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:141


completeExchangeBatch

completeExchangeBatch(exchangeIds): Promise<TransactionResponse>

Completes a batch of existing vouchers by calling the ExchangeHandlerContract. Callable by buyer or seller operator.

Parameters

NameTypeDescription
exchangeIdsBigNumberish[]IDs of exchange to complete.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:158


createDisputeResolver

createDisputeResolver(disputeResolverToCreate): Promise<TransactionResponse>

Creates a dispute resolver account by calling the AccountHandlerFacet contract.

Parameters

NameTypeDescription
disputeResolverToCreateCreateDisputeResolverArgsDispute resolver arguments.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:387


createGroup

createGroup(groupToCreate, overrides?): Promise<TransactionResponse>

Creates a group of contract addresses

Parameters

NameTypeDescription
groupToCreateCreateGroupArgsgroup with the contract condition
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/groups/mixin.ts:12


createOffer

createOffer(offerToCreate, overrides?): Promise<TransactionResponse>

Creates offer by calling the OfferHandlerFacet contract. This transaction only succeeds if there is an existing seller account for connected signer.

Parameters

NameTypeDescription
offerToCreateCreateOfferArgsOffer arguments.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/offers/mixin.ts:32


createOfferBatch

createOfferBatch(offersToCreate, overrides?): Promise<TransactionResponse>

Creates a batch of offers by calling the OfferHandlerFacet contract. This transaction only succeeds if there is an existing seller account for connected signer.

Parameters

NameTypeDescription
offersToCreateCreateOfferArgs[]Offer arguments.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/offers/mixin.ts:54


createOfferWithCondition

createOfferWithCondition(offerToCreate, condition, overrides?): Promise<TransactionResponse>

Creates an offer with a specific conditions

Parameters

NameTypeDescription
offerToCreateCreateOfferArgsOffer arguments.
conditionConditionStructcontract condition applied to the offer
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/orchestration/mixin.ts:14


createSeller

createSeller(sellerToCreate, overrides?): Promise<TransactionResponse>

Creates seller account by calling the AccountHandlerFacet contract.

Parameters

NameTypeDescription
sellerToCreateCreateSellerArgsAddresses and contract URI to set in the seller account.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:219


createSellerAndOffer

createSellerAndOffer(sellerToCreate, offerToCreate, overrides?): Promise<TransactionResponse>

Creates seller account and offer by calling the OrchestrationHandlerFacet contract. This transaction only succeeds if there is no existing seller account for the connected signer.

Parameters

NameTypeDescription
sellerToCreateCreateSellerArgsAddresses to set in the seller account.
offerToCreateCreateOfferArgsOffer arguments.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:240


createSellerAndOfferWithCondition

createSellerAndOfferWithCondition(sellerToCreate, offerToCreate, condition, overrides?): Promise<TransactionResponse>

Creates a seller account and offer with a specific conditions This transaction only succeeds if there is no existing seller account for the connected signer.

Parameters

NameTypeDescription
sellerToCreateCreateSellerArgsAddresses to set in the seller account.
offerToCreateCreateOfferArgsOffer arguments.
conditionConditionStructcontract condition applied to the offer
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/orchestration/mixin.ts:39


decideDispute

decideDispute(exchangeId, buyerPercent): Promise<TransactionResponse>

Decides dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.
buyerPercentBigNumberishPercentage of deposit buyer gets.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:180


depositFunds

depositFunds(sellerId, fundsAmount, fundsTokenAddress?): Promise<TransactionResponse>

Deposit funds by calling the FundsHandlerFacet contract.

Parameters

NameTypeDefault valueDescription
sellerIdBigNumberishundefinedID of seller account to deposit funds for.
fundsAmountBigNumberishundefinedAmount of funds.
fundsTokenAddressstringAddressZeroAddress of funds token.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/funds/mixin.ts:25


escalateDispute

escalateDispute(exchangeId): Promise<TransactionResponse>

Escalates dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:164


expireDispute

expireDispute(exchangeId): Promise<TransactionResponse>

Expires a dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:107


expireDisputeBatch

expireDisputeBatch(exchangeIds): Promise<TransactionResponse>

Expires many disputes by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdsBigNumberish[]IDs of disputed exchanges.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:122


expireEscalatedDispute

expireEscalatedDispute(exchangeId): Promise<TransactionResponse>

Expires escalated dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:212


expireVoucher

expireVoucher(exchangeId): Promise<TransactionResponse>

Expires an existing voucher by calling the ExchangeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange to expire.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:174


extendDisputeTimeout

extendDisputeTimeout(exchangeId, newDisputeTimeout): Promise<TransactionResponse>

Extends the dispute timeout by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.
newDisputeTimeoutBigNumberishNew dispute timeout in seconds.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:90


fetchUserAuthTokens

fetchUserAuthTokens(address, tokenType): Promise<string[]>

Returns the array of LENS tokenIds owned by a specified address

Parameters

NameTypeDescription
addressstringAddress of seller entity to query for.
tokenTypenumber-

Returns

Promise<string[]>

Array of tokenIds

Defined in

src/accounts/mixin.ts:146


getAllProductsWithNotVoidedVariants

getAllProductsWithNotVoidedVariants(queryVars?): Promise<BaseProductV1ProductWithNotVoidedVariantsFieldsFragment[]>

Parameters

NameType
queryVars?Exact<{ productsFilter?: ProductV1Product_Filter ; productsFirst?: number ; productsOrderBy?: ProductV1Product_OrderBy ; productsOrderDirection?: OrderDirection ; productsSkip?: number }>

Returns

Promise<BaseProductV1ProductWithNotVoidedVariantsFieldsFragment[]>

Defined in

src/metadata/mixin.ts:90


getAllProductsWithVariants

getAllProductsWithVariants(queryVars?): Promise<BaseProductV1ProductWithVariantsFieldsFragment[]>

Parameters

NameType
queryVars?Exact<{ productsFilter?: ProductV1Product_Filter ; productsFirst?: number ; productsOrderBy?: ProductV1Product_OrderBy ; productsOrderDirection?: OrderDirection ; productsSkip?: number }>

Returns

Promise<BaseProductV1ProductWithVariantsFieldsFragment[]>

Defined in

src/metadata/mixin.ts:84


getBaseMetadataEntities

getBaseMetadataEntities(queryVars?): Promise<BaseMetadataEntityFieldsFragment[]>

Returns BASE type offer metadata entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ metadataFilter?: BaseMetadataEntity_Filter ; metadataFirst?: number ; metadataOrderBy?: BaseMetadataEntity_OrderBy ; metadataOrderDirection?: OrderDirection ; metadataSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<BaseMetadataEntityFieldsFragment[]>

BaseMetadataEntities from subgraph.

Defined in

src/metadata/mixin.ts:51


getBuyerById

getBuyerById(buyerId, queryVars?): Promise<BuyerFieldsFragment>

Returns buyer entity from subgraph.

Parameters

NameTypeDescription
buyerIdBigNumberishID of buyer entity to query for.
queryVars?SingleBuyerQueryVariablesOptional query variables to skip, order or filter.

Returns

Promise<BuyerFieldsFragment>

Buyer entity from subgraph.

Defined in

src/accounts/mixin.ts:358


getBuyers

getBuyers(queryVars?): Promise<BuyerFieldsFragment[]>

Returns buyer entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ buyersFilter?: Buyer_Filter ; buyersFirst?: number ; buyersOrderBy?: Buyer_OrderBy ; buyersOrderDirection?: OrderDirection ; buyersSkip?: number ; exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<BuyerFieldsFragment[]>

Buyer entities from subgraph.

Defined in

src/accounts/mixin.ts:374


getCommittedExchangeIdFromLogs

getCommittedExchangeIdFromLogs(logs): string

Utility method to retrieve the created exchangeId from logs after calling commitToOffer.

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

string

Created exchange id.

Defined in

src/exchanges/mixin.ts:75


getCreatedGroupIdsFromLogs

getCreatedGroupIdsFromLogs(logs): string[]

Utility method to retrieve the created groupIds from logs after calling createGroup

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

string[]

Array of group Ids.

Defined in

src/offers/mixin.ts:113


getCreatedOfferIdFromLogs

getCreatedOfferIdFromLogs(logs): string

Utility method to retrieve the created offerId from logs after calling createOffer or createOfferAndSeller.

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

string

Created offer id.

Defined in

src/offers/mixin.ts:75


getCreatedOfferIdsFromLogs

getCreatedOfferIdsFromLogs(logs): string[]

Utility method to retrieve the created offerIds from logs after calling createOfferBatch

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

string[]

Array of created offerIds.

Defined in

src/offers/mixin.ts:99


getCreatedSellerIdFromLogs

getCreatedSellerIdFromLogs(logs): string

Utility method to retrieve the created sellerId from logs after calling createSeller or createOfferAndSeller.

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

string

Created offer id.

Defined in

src/offers/mixin.ts:128


getDisputeById

getDisputeById(disputeId, queryVars?): Promise<DisputeFieldsFragment>

Returns dispute entity from subgraph.

Parameters

NameTypeDescription
disputeIdBigNumberishID of dispute entity.
queryVars?SingleDisputeQueryVariablesOptional query variables to skip, order or filter.

Returns

Promise<DisputeFieldsFragment>

Dispute entity from subgraph.

Defined in

src/disputes/mixin.ts:36


getDisputeResolverById

getDisputeResolverById(disputeResolverId, queryVars?): Promise<DisputeResolverFieldsFragment>

Returns dispute resolver entity from subgraph.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishID of dispute resolver entity to query for.
queryVars?SingleDisputeResolverQueryVariablesOptional query variables to skip, order or filter.

Returns

Promise<DisputeResolverFieldsFragment>

Dispute resolver entity from subgraph.

Defined in

src/accounts/mixin.ts:601


getDisputeResolverIdFromLogs

getDisputeResolverIdFromLogs(logs): string

Utility method to retrieve the created exchangeId from logs after calling commitToOffer.

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

string

Created exchange id.

Defined in

src/accounts/mixin.ts:402


getDisputeResolvers

getDisputeResolvers(queryVars?): Promise<DisputeResolverFieldsFragment[]>

Returns dispute resolver entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ disputeResolversFilter?: DisputeResolver_Filter ; disputeResolversFirst?: number ; disputeResolversOrderBy?: DisputeResolver_OrderBy ; disputeResolversOrderDirection?: OrderDirection ; disputeResolversSkip?: number ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<DisputeResolverFieldsFragment[]>

Dispute resolver entities from subgraph.

Defined in

src/accounts/mixin.ts:617


getDisputes

getDisputes(queryVars?): Promise<DisputeFieldsFragment[]>

Returns dispute entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ disputesFilter?: Dispute_Filter ; disputesFirst?: number ; disputesOrderBy?: Dispute_OrderBy ; disputesOrderDirection?: OrderDirection ; disputesSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<DisputeFieldsFragment[]>

Dispute entities from subgraph.

Defined in

src/disputes/mixin.ts:48


getEventLogs

getEventLogs(queryVars?): Promise<BaseEventLogFieldsFragment[]>

Returns event logs from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<BaseEventLogFieldsFragment[]>

Event log entities from subgraph.

Defined in

src/event-logs/mixin.ts:11


getExchangeById

getExchangeById(exchangeId, queryVars?): Promise<ExchangeFieldsFragment>

Returns exchange entity from subgraph.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange entity.
queryVars?Exact<{ exchangeId: string }>Optional query variables to skip, order or filter.

Returns

Promise<ExchangeFieldsFragment>

Exchange entity from subgraph.

Defined in

src/exchanges/mixin.ts:29


getExchangeTokenAllowance

getExchangeTokenAllowance(exchangeToken, overrides?): Promise<string>

Returns the current allowance of the given token by calling the contract.

Parameters

NameTypeDescription
exchangeTokenstringAddress of exchange token.
overridesPartial<{ owner: string ; spender: string }>Optional overrides.

Returns

Promise<string>

Allowance for given signer.

Defined in

src/offers/mixin.ts:259


getExchangeTokenInfo

getExchangeTokenInfo(exchangeToken): Promise<ITokenInfo>

Returns name, decimals and symbol of the given token by calling the contract.

Parameters

NameTypeDescription
exchangeTokenstringAddress exchange token.

Returns

Promise<ITokenInfo>

Decimals, name and symbol.

Defined in

src/offers/mixin.ts:279


getExchanges

getExchanges(queryVars?): Promise<ExchangeFieldsFragment[]>

Returns exchange entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<ExchangeFieldsFragment[]>

Exchange entities from subgraph.

Defined in

src/exchanges/mixin.ts:41


getFunds

getFunds(queryVars?): Promise<FundsEntityFieldsFragment[]>

Returns funds entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<FundsEntityFieldsFragment[]>

Funds entities from subgraph.

Defined in

src/funds/mixin.ts:57


getFundsById

getFundsById(fundsId, queryVars?): Promise<FundsEntityFieldsFragment>

Returns funds entity from subgraph.

Parameters

NameTypeDescription
fundsIdBigNumberishID of funds entity.
queryVars?Exact<{ fundsId: string }>Optional query variables to skip, order or filter.

Returns

Promise<FundsEntityFieldsFragment>

Funds entity from subgraph.

Defined in

src/funds/mixin.ts:45


getMetadata

getMetadata(metadataHashOrUri): Promise<AnyMetadata>

Returns supported offer metadata from passed in MetadataStorage instance.

Parameters

NameTypeDescription
metadataHashOrUristringMetadata hash or uri that can be handled by the storage instance.

Returns

Promise<AnyMetadata>

Offer metadata.

Defined in

src/metadata/mixin.ts:38


getOfferById

getOfferById(offerId, queryVars?): Promise<OfferFieldsFragment>

Returns offer from subgraph.

Parameters

NameTypeDescription
offerIdBigNumberishID of offer.
queryVars?SingleOfferQueryVariablesOptional query variables to skip, order or filter.

Returns

Promise<OfferFieldsFragment>

Offer entity from subgraph.

Defined in

src/offers/mixin.ts:196


getOffers

getOffers(queryVars?): Promise<OfferFieldsFragment[]>

Returns offers from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; includeExchanges?: boolean ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<OfferFieldsFragment[]>

Offer entities from subgraph.

Defined in

src/offers/mixin.ts:208


getPendingSellerUpdateFromLogs

getPendingSellerUpdateFromLogs(logs): Object

Utility method to retrieve the pending seller update fields from logs after calling updateSeller.

Parameters

NameTypeDescription
logsLog[]Logs to search in.

Returns

Object

Created exchange id.

NameType
adminstring
clerkstring
operatorstring
tokenIdBigNumber
tokenTypenumber

Defined in

src/accounts/mixin.ts:416


getProductV1MetadataEntities

getProductV1MetadataEntities(queryVars?): Promise<ProductV1MetadataEntityFieldsFragment[]>

Returns PRODUCT_V1 type offer metadata entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ metadataFilter?: ProductV1MetadataEntity_Filter ; metadataFirst?: number ; metadataOrderBy?: ProductV1MetadataEntity_OrderBy ; metadataOrderDirection?: OrderDirection ; metadataSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<ProductV1MetadataEntityFieldsFragment[]>

ProductV1MetadataEntities from subgraph.

Defined in

src/metadata/mixin.ts:62


getProductV1Products

getProductV1Products(queryVars?): Promise<BaseProductV1ProductFieldsFragment[]>

Parameters

NameType
queryVars?Exact<{ productsFilter?: ProductV1Product_Filter ; productsFirst?: number ; productsOrderBy?: ProductV1Product_OrderBy ; productsOrderDirection?: OrderDirection ; productsSkip?: number }>

Returns

Promise<BaseProductV1ProductFieldsFragment[]>

Defined in

src/metadata/mixin.ts:68


getProductWithVariants

getProductWithVariants(productUuid): Promise<{ product: BaseProductV1ProductFieldsFragment ; variants: { offer: OfferFieldsFragment ; variations: ProductV1Variation[] }[] }>

Parameters

NameType
productUuidstring

Returns

Promise<{ product: BaseProductV1ProductFieldsFragment ; variants: { offer: OfferFieldsFragment ; variations: ProductV1Variation[] }[] }>

Defined in

src/metadata/mixin.ts:74


getProtocolAllowance

getProtocolAllowance(exchangeToken, overrides?): Promise<string>

Parameters

NameType
exchangeTokenstring
overridesPartial<{ owner: string ; spender: string }>

Returns

Promise<string>

Defined in

src/offers/mixin.ts:315


getResubmittedMetaTx

getResubmittedMetaTx(originalMetaTxHash, overrides?): Promise<GetRetriedHashesData>

Returns information of submitted meta transaction. See https://docs.biconomy.io/api/native-meta-tx/get-retried-hashes.

Parameters

NameTypeDescription
originalMetaTxHashstringOriginal meta transaction as returned by coreSDK.relayMetaTransaction
overridesPartial<{ contractAddress: string ; metaTransactionMethod: string ; metaTxConfig: Partial<Omit<MetaTxConfig, "apiIds"> & { apiId: string }> }>Optional overrides for meta transaction config.

Returns

Promise<GetRetriedHashesData>

  • Additional meta transaction information.

Defined in

src/meta-tx/mixin.ts:492


getSellerByAdmin

getSellerByAdmin(admin, queryVars?): Promise<SellerFieldsFragment>

Returns seller entity from subgraph.

Parameters

NameTypeDescription
adminstringAdmin address of seller entity to query for.
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:75


getSellerByAuthToken

getSellerByAuthToken(tokenId, tokenType, queryVars?): Promise<SellerFieldsFragment>

Returns seller entity from subgraph that owns the given auth token (if any).

Parameters

NameTypeDescription
tokenIdstringtokenId of the Auth Token.
tokenTypenumberType of the Auth Token (1 for LENS, ...).
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:185


getSellerByClerk

getSellerByClerk(clerk, queryVars?): Promise<SellerFieldsFragment>

Returns seller entity from subgraph.

Parameters

NameTypeDescription
clerkstringClerk address of seller entity to query for.
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:58


getSellerById

getSellerById(sellerId, queryVars?): Promise<SellerFieldsFragment>

Returns seller entity from subgraph.

Parameters

NameTypeDescription
sellerIdBigNumberishID of seller entity to query for.
queryVars?SingleSellerQueryVariablesOptional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:24


getSellerByOperator

getSellerByOperator(operator, queryVars?): Promise<SellerFieldsFragment>

Returns seller entity from subgraph.

Parameters

NameTypeDescription
operatorstringOperator address of seller entity to query for.
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:41


getSellerByTreasury

getSellerByTreasury(treasury, queryVars?): Promise<SellerFieldsFragment>

Returns seller entity from subgraph.

Parameters

NameTypeDescription
treasurystringTreasury address of seller entity to query for.
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:92


getSellers

getSellers(queryVars?): Promise<SellerFieldsFragment[]>

Returns seller entities from subgraph.

Parameters

NameTypeDescription
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment[]>

Seller entities from subgraph.

Defined in

src/accounts/mixin.ts:207


getSellersByAddress

getSellersByAddress(address, queryVars?): Promise<SellerFieldsFragment[]>

Returns seller entity from subgraph. Matches operator, clerk, admin or treasury.

Parameters

NameTypeDescription
addressstringAddress of seller entity to query for.
queryVars?Exact<{ exchangesFilter?: Exchange_Filter ; exchangesFirst?: number ; exchangesOrderBy?: Exchange_OrderBy ; exchangesOrderDirection?: OrderDirection ; exchangesSkip?: number ; fundsFilter?: FundsEntity_Filter ; fundsFirst?: number ; fundsOrderBy?: FundsEntity_OrderBy ; fundsOrderDirection?: OrderDirection ; fundsSkip?: number ; includeExchanges?: boolean ; includeFunds?: boolean ; includeLogs?: boolean ; includeOffers?: boolean ; logsFilter?: EventLog_Filter ; logsFirst?: number ; logsOrderBy?: EventLog_OrderBy ; logsOrderDirection?: OrderDirection ; logsSkip?: number ; offersFilter?: Offer_Filter ; offersFirst?: number ; offersOrderBy?: Offer_OrderBy ; offersOrderDirection?: OrderDirection ; offersSkip?: number ; sellersFilter?: Seller_Filter ; sellersFirst?: number ; sellersOrderBy?: Seller_OrderBy ; sellersOrderDirection?: OrderDirection ; sellersSkip?: number }>Optional query variables to skip, order or filter.

Returns

Promise<SellerFieldsFragment[]>

Seller entity from subgraph.

Defined in

src/accounts/mixin.ts:109


optInToDisputeResolverUpdate

optInToDisputeResolverUpdate(disputeResolverUpdates, overrides?): Promise<TransactionResponse>

Parameters

NameType
disputeResolverUpdatesOptInToDisputeResolverUpdateArgs
overridesPartial<{ contractAddress: string }>

Returns

Promise<TransactionResponse>

Defined in

src/accounts/mixin.ts:483


optInToSellerUpdate

optInToSellerUpdate(sellerUpdates, overrides?): Promise<TransactionResponse>

Opt-in to a pending seller update by calling the AccountHandlerFacet contract. Only callable by admin.

Parameters

NameTypeDescription
sellerUpdatesOptInToSellerUpdateArgsValues to update.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:284


raiseDispute

raiseDispute(exchangeId): Promise<TransactionResponse>

Raises a dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange to dispute.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:59


redeemVoucher

redeemVoucher(exchangeId): Promise<TransactionResponse>

Redeems an existing voucher by calling the ExchangeHandlerContract. Callable by buyer.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange to redeem.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:124


refuseEscalatedDispute

refuseEscalatedDispute(exchangeId): Promise<TransactionResponse>

Refuses escalated dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:197


relayMetaTransaction

relayMetaTransaction(metaTxParams, overrides?): Promise<TransactionResponse>

Relay a meta transaction,

Parameters

NameTypeDescription
metaTxParamsObjectRequired params for meta transaction.
metaTxParams.functionNamestring-
metaTxParams.functionSignatureBytesLike-
metaTxParams.nonceBigNumberish-
metaTxParams.sigRBytesLike-
metaTxParams.sigSBytesLike-
metaTxParams.sigVBigNumberish-
overridesPartial<{ contractAddress: string ; metaTransactionMethod: string ; metaTxConfig: Partial<Omit<MetaTxConfig, "apiIds"> & { apiId: string }> ; userAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/meta-tx/mixin.ts:442


relayNativeMetaTransaction

relayNativeMetaTransaction(contractAddress, metaTxParams, overrides?): Promise<TransactionResponse>

Relay a native meta transaction,

Parameters

NameTypeDescription
contractAddressstring-
metaTxParamsObjectRequired params for meta transaction.
metaTxParams.functionSignatureBytesLike-
metaTxParams.sigRBytesLike-
metaTxParams.sigSBytesLike-
metaTxParams.sigVBigNumberish-
overridesPartial<{ metaTransactionMethod: string ; metaTxConfig: Partial<Omit<MetaTxConfig, "apiIds"> & { apiId: string }> ; userAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/native-meta-tx/mixin.ts:39


removeFeesFromDisputeResolver

removeFeesFromDisputeResolver(disputeResolverId, feeTokenAddresses): Promise<TransactionResponse>

Removes fees from a dispute resolver account by calling the AccountHandlerFacet contract. Note, that the caller must be the specified admin address of the dispute resolver account.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishId of dispute resolver.
feeTokenAddressesstring[]Addresses of fee tokens to remove.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:562


removeSellersFromDisputeResolverAllowList

removeSellersFromDisputeResolverAllowList(disputeResolverId, sellerAllowList): Promise<TransactionResponse>

Removes sellers from the allow list of a dispute resolver account by calling the AccountHandlerFacet contract. Note, that the caller must be the specified admin address of the dispute resolver account.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishId of dispute resolver.
sellerAllowListstring[]List of seller ids that should be removed from the allow list of a dispute resolver.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:583


renderContractualAgreement

renderContractualAgreement(template, offerData, offerMetadata): Promise<string>

Renders contractual agreement for given offer.

Parameters

NameTypeDescription
templatestringMustache syntax based template.
offerDataCreateOfferArgsOffer data.
offerMetadataAdditionalOfferMetadata-

Returns

Promise<string>

Contractual agreement as string.

Defined in

src/offers/mixin.ts:235


renderContractualAgreementForOffer

renderContractualAgreementForOffer(offerId): Promise<string>

Renders contractual agreement for given offer.

Parameters

NameTypeDescription
offerIdBigNumberishId of offer to render agreement for.

Returns

Promise<string>

Contractual agreement as string.

Defined in

src/offers/mixin.ts:219


resolveDispute

resolveDispute(args): Promise<TransactionResponse>

Resolves dispute by calling the DisputeHandlerContract. If caller is buyer then signature of seller is required as an argument. If caller if seller then vice-versa. The signature can be retrieved by calling the method CoreSDK.signDisputeResolutionProposal.

Parameters

NameTypeDescription
argsObjectDispute resolve arguments: - args.exchangeId - ID of disputed exchange. - args.buyerPercent - Percentage of deposit the buyer gets. - args.sigR - r signature value of counterparty. - args.sigS - s signature value of counterparty. - args.sigV - v signature value of counterparty.
args.buyerPercentBasisPointsBigNumberish-
args.exchangeIdBigNumberish-
args.sigRBytesLike-
args.sigSBytesLike-
args.sigVBigNumberish-

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:145


retractDispute

retractDispute(exchangeId): Promise<TransactionResponse>

Retracts a dispute by calling the DisputeHandlerContract.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of disputed exchange.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/disputes/mixin.ts:74


revokeVoucher

revokeVoucher(exchangeId): Promise<TransactionResponse>

Revokes an existing voucher by calling the ExchangeHandlerContract. Callable by seller operator.

Parameters

NameTypeDescription
exchangeIdBigNumberishID of exchange to revoke.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/exchanges/mixin.ts:90


signDisputeResolutionProposal

signDisputeResolutionProposal(args): Promise<{ r: string ; s: string ; v: number }>

Signs dispute resolution message.

Parameters

NameTypeDescription
argsObjectDispute resolve arguments: - args.exchangeId - ID of disputed exchange. - args.buyerPercentBasisPoints - Percentage of deposit the buyer gets.
args.buyerPercentBasisPointsBigNumberish-
args.exchangeIdBigNumberish-

Returns

Promise<{ r: string ; s: string ; v: number }>

Signature.

Defined in

src/disputes/mixin.ts:229


signMetaTx

signMetaTx(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { functionName: string ; functionSignature: string }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:17


signMetaTxCancelVoucher

signMetaTxCancelVoucher(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for cancelVoucher that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:232


signMetaTxCommitToOffer

signMetaTxCommitToOffer(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for commitToOffer that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { offerId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:213


signMetaTxCompleteExchange

signMetaTxCompleteExchange(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for completeExchangeBatch that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:175


signMetaTxCompleteExchangeBatch

signMetaTxCompleteExchangeBatch(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for completeExchangeBatch that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeIds: BigNumberish[] }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:194


signMetaTxCreateGroup

signMetaTxCreateGroup(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for createGroup that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { createGroupArgs: CreateGroupArgs }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:97


signMetaTxCreateOffer

signMetaTxCreateOffer(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for createOffer that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { createOfferArgs: CreateOfferArgs ; metadataStorage?: MetadataStorage ; theGraphStorage?: MetadataStorage }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:55


signMetaTxCreateOfferBatch

signMetaTxCreateOfferBatch(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for createOfferBatch that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { createOffersArgs: CreateOfferArgs[] ; metadataStorage?: MetadataStorage ; theGraphStorage?: MetadataStorage }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:76


signMetaTxCreateOfferWithCondition

signMetaTxCreateOfferWithCondition(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for createOfferWithCondition that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { condition: ConditionStruct ; metadataStorage?: MetadataStorage ; offerToCreate: CreateOfferArgs ; theGraphStorage?: MetadataStorage }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:116


signMetaTxCreateSeller

signMetaTxCreateSeller(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for createSeller that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { createSellerArgs: CreateSellerArgs }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:36


signMetaTxDepositFunds

signMetaTxDepositFunds(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for depositFunds that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { fundsAmount: BigNumberish ; fundsTokenAddress: string ; sellerId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:422


signMetaTxEscalateDispute

signMetaTxEscalateDispute(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for escalateDispute that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:327


signMetaTxExpireVoucher

signMetaTxExpireVoucher(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for expireVoucher that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:270


signMetaTxExtendDisputeTimeout

signMetaTxExtendDisputeTimeout(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for extendDisputeTimeout that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish ; newTimeout: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:384


signMetaTxRaiseDispute

signMetaTxRaiseDispute(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for raiseDispute that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:346


signMetaTxRedeemVoucher

signMetaTxRedeemVoucher(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for redeemVoucher that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:251


signMetaTxResolveDispute

signMetaTxResolveDispute(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for resolveDispute that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { buyerPercent: BigNumberish ; counterpartySig: { r: string ; s: string ; v: number } ; exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:365


signMetaTxRetractDispute

signMetaTxRetractDispute(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for retractDispute that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:308


signMetaTxRevokeVoucher

signMetaTxRevokeVoucher(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for revokeVoucher that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { exchangeId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:289


signMetaTxVoidOffer

signMetaTxVoidOffer(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for voidOffer that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { offerId: BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:137


signMetaTxVoidOfferBatch

signMetaTxVoidOfferBatch(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for voidOfferBatch that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { offerIds: BigNumberish[] }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:156


signMetaTxWithdrawFunds

signMetaTxWithdrawFunds(args): Promise<SignedMetaTx>

Encodes and signs a meta transaction for withdrawFunds that can be relayed.

Parameters

NameTypeDescription
argsOmit<BaseMetaTxArgs & { entityId: BigNumberish ; tokenAmounts: BigNumberish[] ; tokenList: string[] }, "chainId" | "web3Lib" | "metaTxHandlerAddress">Meta transaction args.

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/meta-tx/mixin.ts:403


signNativeMetaTxApproveExchangeToken

signNativeMetaTxApproveExchangeToken(exchangeToken, value, overrides?): Promise<SignedMetaTx>

Encodes and signs a native "token.approve()" meta transaction that can be relayed.

Parameters

NameTypeDescription
exchangeTokenstringThe address of the token contract.
valueBigNumberishThe value to be approved.
overridesPartial<{ spender: string }>Optionally specify a spender address (default is the protocol contract address).

Returns

Promise<SignedMetaTx>

Signature.

Defined in

src/native-meta-tx/mixin.ts:15


storeMetadata

storeMetadata(metadata): Promise<string>

Stores supported offer metadata via the MetadataStorage instance which was passed in at construction.

Parameters

NameTypeDescription
metadataAnyMetadataOffer metadata of type BASE or PRODUCT_V1.

Returns

Promise<string>

Metadata hash / identifier.

Defined in

src/metadata/mixin.ts:24


updateDisputeResolver

updateDisputeResolver(disputeResolverId, updates): Promise<TransactionResponse>

Updates a dispute resolver account by calling the AccountHandlerFacet contract. Note, that the caller must be the specified admin address of the dispute resolver account.

Parameters

NameTypeDescription
disputeResolverIdBigNumberishId of dispute resolver to update.
updatesPartial<Omit<DisputeResolverStruct, "id" | "active" | "escalationResponsePeriod"> & { escalationResponsePeriodInMS: BigNumberish }>Values to update for the given dispute resolver.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:470


updateSeller

updateSeller(sellerUpdates, overrides?): Promise<TransactionResponse>

Updates seller account by calling the AccountHandlerFacet contract. Only callable by admin.

Parameters

NameTypeDescription
sellerUpdatesUpdateSellerArgsValues to update.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:264


updateSellerAndOptIn

updateSellerAndOptIn(sellerUpdates, overrides?): Promise<TransactionResponse>

Updates seller account by calling the AccountHandlerFacet contract, then optIn for all updates doable by the same account. Only callable by admin.

Parameters

NameTypeDescription
sellerUpdatesUpdateSellerArgsValues to update.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/accounts/mixin.ts:305


voidOffer

voidOffer(offerId, overrides?): Promise<TransactionResponse>

Voids an existing offer by calling the OfferHandlerFacet contract. This transaction only succeeds if the connected signer is the operator.

Parameters

NameTypeDescription
offerIdBigNumberishID of offer to void.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/offers/mixin.ts:154


voidOfferBatch

voidOfferBatch(offerIds, overrides?): Promise<TransactionResponse>

Voids a batch of existing offers by calling the OfferHandlerFacet contract. This transaction only succeeds if the connected signer is the operator of all provided offers.

Parameters

NameTypeDescription
offerIdsBigNumberish[]IDs of offers to void.
overridesPartial<{ contractAddress: string }>Optional overrides.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/offers/mixin.ts:176


withdrawAllAvailableFunds

withdrawAllAvailableFunds(sellerId): Promise<TransactionResponse>

Withdraw all available funds by calling the FundsHandlerFacet contract.

Parameters

NameTypeDescription
sellerIdBigNumberishID of seller account to withdraw funds for.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/funds/mixin.ts:89


withdrawFunds

withdrawFunds(sellerId, tokensToWithdraw, amountsToWithdraw): Promise<TransactionResponse>

Withdraw selected funds by calling the FundsHandlerFacet contract.

Parameters

NameTypeDescription
sellerIdBigNumberishID of seller account to withdraw funds for.
tokensToWithdrawstring[]Addresses of funds tokens to withdraw.
amountsToWithdrawBigNumberish[]Amounts of funds token to withdraw.

Returns

Promise<TransactionResponse>

Transaction response.

Defined in

src/funds/mixin.ts:70


fromDefaultConfig

Static fromDefaultConfig(args): CoreSDK

Creates an instance of CoreSDK by using default values derived either from args.envName or args.chainId.

Example

Instance which uses the default contract address and subgraph url of mainnet:

const coreSdk = CoreSDK.fromDefaultConfig({
...otherArgs,
chainId: 137
})

Parameters

NameTypeDescription
argsObjectConstructor args.
args.envNameEnvironmentType-
args.metaTx?Partial<MetaTxConfig>-
args.metadataStorage?MetadataStorage-
args.theGraphStorage?MetadataStorage-
args.web3LibWeb3LibAdapter-

Returns

CoreSDK

CoreSDK instance with default values.

Defined in

src/core-sdk.ts:39