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
- _chainId
- _lensContracts
- _metaTxConfig
- _metadataStorage
- _protocolDiamond
- _subgraphUrl
- _theGraphStorage
- _tokenInfoManager
- _web3Lib
Accessors
Methods
- activateDisputeResolver
- addFeesToDisputeResolver
- addSellersToDisputeResolverAllowList
- approveExchangeToken
- assertAndGetMetaTxConfig
- cancelVoucher
- checkMetaTxConfigSet
- checkTokenGatedCondition
- commitToOffer
- completeExchange
- completeExchangeBatch
- createDisputeResolver
- createGroup
- createOffer
- createOfferBatch
- createOfferWithCondition
- createSeller
- createSellerAndOffer
- createSellerAndOfferWithCondition
- decideDispute
- depositFunds
- escalateDispute
- expireDispute
- expireDisputeBatch
- expireEscalatedDispute
- expireVoucher
- extendDisputeTimeout
- fetchUserAuthTokens
- getAllProductsWithNotVoidedVariants
- getAllProductsWithVariants
- getBaseMetadataEntities
- getBuyerById
- getBuyers
- getCommittedExchangeIdFromLogs
- getCreatedGroupIdsFromLogs
- getCreatedOfferIdFromLogs
- getCreatedOfferIdsFromLogs
- getCreatedSellerIdFromLogs
- getDisputeById
- getDisputeResolverById
- getDisputeResolverIdFromLogs
- getDisputeResolvers
- getDisputes
- getEventLogs
- getExchangeById
- getExchangeTokenAllowance
- getExchangeTokenInfo
- getExchanges
- getFunds
- getFundsById
- getMetadata
- getOfferById
- getOffers
- getPendingSellerUpdateFromLogs
- getProductV1MetadataEntities
- getProductV1Products
- getProductWithVariants
- getProtocolAllowance
- getResubmittedMetaTx
- getSellerByAdmin
- getSellerByAuthToken
- getSellerByClerk
- getSellerById
- getSellerByOperator
- getSellerByTreasury
- getSellers
- getSellersByAddress
- optInToDisputeResolverUpdate
- optInToSellerUpdate
- raiseDispute
- redeemVoucher
- refuseEscalatedDispute
- relayMetaTransaction
- relayNativeMetaTransaction
- removeFeesFromDisputeResolver
- removeSellersFromDisputeResolverAllowList
- renderContractualAgreement
- renderContractualAgreementForOffer
- resolveDispute
- retractDispute
- revokeVoucher
- signDisputeResolutionProposal
- signMetaTx
- signMetaTxCancelVoucher
- signMetaTxCommitToOffer
- signMetaTxCompleteExchange
- signMetaTxCompleteExchangeBatch
- signMetaTxCreateGroup
- signMetaTxCreateOffer
- signMetaTxCreateOfferBatch
- signMetaTxCreateOfferWithCondition
- signMetaTxCreateSeller
- signMetaTxDepositFunds
- signMetaTxEscalateDispute
- signMetaTxExpireVoucher
- signMetaTxExtendDisputeTimeout
- signMetaTxRaiseDispute
- signMetaTxRedeemVoucher
- signMetaTxResolveDispute
- signMetaTxRetractDispute
- signMetaTxRevokeVoucher
- signMetaTxVoidOffer
- signMetaTxVoidOfferBatch
- signMetaTxWithdrawFunds
- signNativeMetaTxApproveExchangeToken
- storeMetadata
- updateDisputeResolver
- updateSeller
- updateSellerAndOptIn
- voidOffer
- voidOfferBatch
- withdrawAllAvailableFunds
- withdrawFunds
- fromDefaultConfig
Constructors
constructor
• new CoreSDK(opts
)
Creates an instance of BaseCoreSDK
Parameters
Name | Type |
---|---|
opts | Object |
opts.chainId | number |
opts.lensContracts? | LensContracts |
opts.metaTx? | Partial <MetaTxConfig > |
opts.metadataStorage? | MetadataStorage |
opts.protocolDiamond | string |
opts.subgraphUrl | string |
opts.theGraphStorage? | MetadataStorage |
opts.web3Lib | Web3LibAdapter |
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
metaTxConfig
• get
metaTxConfig(): Partial
<MetaTxConfig
>
Returns
Partial
<MetaTxConfig
>
Defined in
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
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | Id of dispute resolver to activate. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | Id of dispute resolver. |
fees | DisputeResolutionFee [] | Dispute resolution fees. Should only contain token addresses that are not already specified. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | Id of dispute resolver. |
sellerAllowList | BigNumberish [] | 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
approveExchangeToken
▸ approveExchangeToken(exchangeToken
, value
, overrides?
): Promise
<TransactionResponse
>
Approves the given amount for the main protocol contract.
Parameters
Name | Type | Description |
---|---|---|
exchangeToken | string | Address of token to approve. |
value | BigNumberish | Amount of allowance. |
overrides | Partial <{ spender : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
assertAndGetMetaTxConfig
▸ Protected
assertAndGetMetaTxConfig(overrides?
): Object
Parameters
Name | Type |
---|---|
overrides | Partial <{ contractAddress : string ; metaTransactionMethod : string ; metaTxConfig : Partial <Omit <MetaTxConfig , "apiIds" > & { apiId : string }> }> |
Returns
Object
Name | Type |
---|---|
contractAddress | string |
metaTxApiId | string |
metaTxApiKey | string |
metaTxRelayerUrl | string |
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
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange to cancel. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
checkMetaTxConfigSet
▸ checkMetaTxConfigSet(args?
): boolean
Parameters
Name | Type |
---|---|
args | Object |
args.contractAddress? | string |
args.metaTransactionMethod? | string |
Returns
boolean
Defined in
checkTokenGatedCondition
▸ checkTokenGatedCondition(offerCondition
, buyerAddress
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
offerCondition | Object |
offerCondition.__typename? | "ConditionEntity" |
offerCondition.id | string |
offerCondition.maxCommits | string |
offerCondition.method | number |
offerCondition.threshold | string |
offerCondition.tokenAddress | string |
offerCondition.tokenId | string |
offerCondition.tokenType | number |
buyerAddress | string |
Returns
Promise
<boolean
>
Defined in
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
Name | Type | Description |
---|---|---|
offerId | BigNumberish | ID of offer to commit to. |
overrides | Partial <{ buyer : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
completeExchange
▸ completeExchange(exchangeId
): Promise
<TransactionResponse
>
Completes an existing voucher by calling the ExchangeHandlerContract
.
Callable by buyer or seller operator.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange to complete. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
completeExchangeBatch
▸ completeExchangeBatch(exchangeIds
): Promise
<TransactionResponse
>
Completes a batch of existing vouchers by calling the ExchangeHandlerContract
.
Callable by buyer or seller operator.
Parameters
Name | Type | Description |
---|---|---|
exchangeIds | BigNumberish [] | IDs of exchange to complete. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
createDisputeResolver
▸ createDisputeResolver(disputeResolverToCreate
): Promise
<TransactionResponse
>
Creates a dispute resolver account by calling the AccountHandlerFacet
contract.
Parameters
Name | Type | Description |
---|---|---|
disputeResolverToCreate | CreateDisputeResolverArgs | Dispute resolver arguments. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
createGroup
▸ createGroup(groupToCreate
, overrides?
): Promise
<TransactionResponse
>
Creates a group of contract addresses
Parameters
Name | Type | Description |
---|---|---|
groupToCreate | CreateGroupArgs | group with the contract condition |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
offerToCreate | CreateOfferArgs | Offer arguments. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
offersToCreate | CreateOfferArgs [] | Offer arguments. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
createOfferWithCondition
▸ createOfferWithCondition(offerToCreate
, condition
, overrides?
): Promise
<TransactionResponse
>
Creates an offer with a specific conditions
Parameters
Name | Type | Description |
---|---|---|
offerToCreate | CreateOfferArgs | Offer arguments. |
condition | ConditionStruct | contract condition applied to the offer |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
createSeller
▸ createSeller(sellerToCreate
, overrides?
): Promise
<TransactionResponse
>
Creates seller account by calling the AccountHandlerFacet
contract.
Parameters
Name | Type | Description |
---|---|---|
sellerToCreate | CreateSellerArgs | Addresses and contract URI to set in the seller account. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
sellerToCreate | CreateSellerArgs | Addresses to set in the seller account. |
offerToCreate | CreateOfferArgs | Offer arguments. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
sellerToCreate | CreateSellerArgs | Addresses to set in the seller account. |
offerToCreate | CreateOfferArgs | Offer arguments. |
condition | ConditionStruct | contract condition applied to the offer |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
decideDispute
▸ decideDispute(exchangeId
, buyerPercent
): Promise
<TransactionResponse
>
Decides dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
buyerPercent | BigNumberish | Percentage of deposit buyer gets. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
depositFunds
▸ depositFunds(sellerId
, fundsAmount
, fundsTokenAddress?
): Promise
<TransactionResponse
>
Deposit funds by calling the FundsHandlerFacet
contract.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
sellerId | BigNumberish | undefined | ID of seller account to deposit funds for. |
fundsAmount | BigNumberish | undefined | Amount of funds. |
fundsTokenAddress | string | AddressZero | Address of funds token. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
escalateDispute
▸ escalateDispute(exchangeId
): Promise
<TransactionResponse
>
Escalates dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
expireDispute
▸ expireDispute(exchangeId
): Promise
<TransactionResponse
>
Expires a dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
expireDisputeBatch
▸ expireDisputeBatch(exchangeIds
): Promise
<TransactionResponse
>
Expires many disputes by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeIds | BigNumberish [] | IDs of disputed exchanges. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
expireEscalatedDispute
▸ expireEscalatedDispute(exchangeId
): Promise
<TransactionResponse
>
Expires escalated dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
expireVoucher
▸ expireVoucher(exchangeId
): Promise
<TransactionResponse
>
Expires an existing voucher by calling the ExchangeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange to expire. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
extendDisputeTimeout
▸ extendDisputeTimeout(exchangeId
, newDisputeTimeout
): Promise
<TransactionResponse
>
Extends the dispute timeout by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
newDisputeTimeout | BigNumberish | New dispute timeout in seconds. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
fetchUserAuthTokens
▸ fetchUserAuthTokens(address
, tokenType
): Promise
<string
[]>
Returns the array of LENS tokenIds owned by a specified address
Parameters
Name | Type | Description |
---|---|---|
address | string | Address of seller entity to query for. |
tokenType | number | - |
Returns
Promise
<string
[]>
Array of tokenIds
Defined in
getAllProductsWithNotVoidedVariants
▸ getAllProductsWithNotVoidedVariants(queryVars?
): Promise
<BaseProductV1ProductWithNotVoidedVariantsFieldsFragment
[]>
Parameters
Name | Type |
---|---|
queryVars? | Exact <{ productsFilter? : ProductV1Product_Filter ; productsFirst? : number ; productsOrderBy? : ProductV1Product_OrderBy ; productsOrderDirection? : OrderDirection ; productsSkip? : number }> |
Returns
Promise
<BaseProductV1ProductWithNotVoidedVariantsFieldsFragment
[]>
Defined in
getAllProductsWithVariants
▸ getAllProductsWithVariants(queryVars?
): Promise
<BaseProductV1ProductWithVariantsFieldsFragment
[]>
Parameters
Name | Type |
---|---|
queryVars? | Exact <{ productsFilter? : ProductV1Product_Filter ; productsFirst? : number ; productsOrderBy? : ProductV1Product_OrderBy ; productsOrderDirection? : OrderDirection ; productsSkip? : number }> |
Returns
Promise
<BaseProductV1ProductWithVariantsFieldsFragment
[]>
Defined in
getBaseMetadataEntities
▸ getBaseMetadataEntities(queryVars?
): Promise
<BaseMetadataEntityFieldsFragment
[]>
Returns BASE
type offer metadata entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getBuyerById
▸ getBuyerById(buyerId
, queryVars?
): Promise
<BuyerFieldsFragment
>
Returns buyer entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
buyerId | BigNumberish | ID of buyer entity to query for. |
queryVars? | SingleBuyerQueryVariables | Optional query variables to skip, order or filter. |
Returns
Promise
<BuyerFieldsFragment
>
Buyer entity from subgraph.
Defined in
getBuyers
▸ getBuyers(queryVars?
): Promise
<BuyerFieldsFragment
[]>
Returns buyer entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getCommittedExchangeIdFromLogs
▸ getCommittedExchangeIdFromLogs(logs
): string
Utility method to retrieve the created exchangeId
from logs after calling commitToOffer
.
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
string
Created exchange id.
Defined in
getCreatedGroupIdsFromLogs
▸ getCreatedGroupIdsFromLogs(logs
): string
[]
Utility method to retrieve the created groupIds
from logs after calling createGroup
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
string
[]
Array of group Ids.
Defined in
getCreatedOfferIdFromLogs
▸ getCreatedOfferIdFromLogs(logs
): string
Utility method to retrieve the created offerId
from logs after calling createOffer
or createOfferAndSeller
.
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
string
Created offer id.
Defined in
getCreatedOfferIdsFromLogs
▸ getCreatedOfferIdsFromLogs(logs
): string
[]
Utility method to retrieve the created offerIds
from logs after calling createOfferBatch
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
string
[]
Array of created offerIds.
Defined in
getCreatedSellerIdFromLogs
▸ getCreatedSellerIdFromLogs(logs
): string
Utility method to retrieve the created sellerId
from logs after calling createSeller
or createOfferAndSeller
.
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
string
Created offer id.
Defined in
getDisputeById
▸ getDisputeById(disputeId
, queryVars?
): Promise
<DisputeFieldsFragment
>
Returns dispute entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
disputeId | BigNumberish | ID of dispute entity. |
queryVars? | SingleDisputeQueryVariables | Optional query variables to skip, order or filter. |
Returns
Promise
<DisputeFieldsFragment
>
Dispute entity from subgraph.
Defined in
getDisputeResolverById
▸ getDisputeResolverById(disputeResolverId
, queryVars?
): Promise
<DisputeResolverFieldsFragment
>
Returns dispute resolver entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | ID of dispute resolver entity to query for. |
queryVars? | SingleDisputeResolverQueryVariables | Optional query variables to skip, order or filter. |
Returns
Promise
<DisputeResolverFieldsFragment
>
Dispute resolver entity from subgraph.
Defined in
getDisputeResolverIdFromLogs
▸ getDisputeResolverIdFromLogs(logs
): string
Utility method to retrieve the created exchangeId
from logs after calling commitToOffer
.
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
string
Created exchange id.
Defined in
getDisputeResolvers
▸ getDisputeResolvers(queryVars?
): Promise
<DisputeResolverFieldsFragment
[]>
Returns dispute resolver entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getDisputes
▸ getDisputes(queryVars?
): Promise
<DisputeFieldsFragment
[]>
Returns dispute entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getEventLogs
▸ getEventLogs(queryVars?
): Promise
<BaseEventLogFieldsFragment
[]>
Returns event logs from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getExchangeById
▸ getExchangeById(exchangeId
, queryVars?
): Promise
<ExchangeFieldsFragment
>
Returns exchange entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange entity. |
queryVars? | Exact <{ exchangeId : string }> | Optional query variables to skip, order or filter. |
Returns
Promise
<ExchangeFieldsFragment
>
Exchange entity from subgraph.
Defined in
getExchangeTokenAllowance
▸ getExchangeTokenAllowance(exchangeToken
, overrides?
): Promise
<string
>
Returns the current allowance of the given token by calling the contract.
Parameters
Name | Type | Description |
---|---|---|
exchangeToken | string | Address of exchange token. |
overrides | Partial <{ owner : string ; spender : string }> | Optional overrides. |
Returns
Promise
<string
>
Allowance for given signer.
Defined in
getExchangeTokenInfo
▸ getExchangeTokenInfo(exchangeToken
): Promise
<ITokenInfo
>
Returns name
, decimals
and symbol
of the given token by calling the contract.
Parameters
Name | Type | Description |
---|---|---|
exchangeToken | string | Address exchange token. |
Returns
Promise
<ITokenInfo
>
Decimals, name and symbol.
Defined in
getExchanges
▸ getExchanges(queryVars?
): Promise
<ExchangeFieldsFragment
[]>
Returns exchange entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getFunds
▸ getFunds(queryVars?
): Promise
<FundsEntityFieldsFragment
[]>
Returns funds entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getFundsById
▸ getFundsById(fundsId
, queryVars?
): Promise
<FundsEntityFieldsFragment
>
Returns funds entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
fundsId | BigNumberish | ID of funds entity. |
queryVars? | Exact <{ fundsId : string }> | Optional query variables to skip, order or filter. |
Returns
Promise
<FundsEntityFieldsFragment
>
Funds entity from subgraph.
Defined in
getMetadata
▸ getMetadata(metadataHashOrUri
): Promise
<AnyMetadata
>
Returns supported offer metadata from passed in MetadataStorage
instance.
Parameters
Name | Type | Description |
---|---|---|
metadataHashOrUri | string | Metadata hash or uri that can be handled by the storage instance. |
Returns
Promise
<AnyMetadata
>
Offer metadata.
Defined in
getOfferById
▸ getOfferById(offerId
, queryVars?
): Promise
<OfferFieldsFragment
>
Returns offer from subgraph.
Parameters
Name | Type | Description |
---|---|---|
offerId | BigNumberish | ID of offer. |
queryVars? | SingleOfferQueryVariables | Optional query variables to skip, order or filter. |
Returns
Promise
<OfferFieldsFragment
>
Offer entity from subgraph.
Defined in
getOffers
▸ getOffers(queryVars?
): Promise
<OfferFieldsFragment
[]>
Returns offers from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getPendingSellerUpdateFromLogs
▸ getPendingSellerUpdateFromLogs(logs
): Object
Utility method to retrieve the pending seller update fields from logs after calling updateSeller
.
Parameters
Name | Type | Description |
---|---|---|
logs | Log [] | Logs to search in. |
Returns
Object
Created exchange id.
Name | Type |
---|---|
admin | string |
clerk | string |
operator | string |
tokenId | BigNumber |
tokenType | number |
Defined in
getProductV1MetadataEntities
▸ getProductV1MetadataEntities(queryVars?
): Promise
<ProductV1MetadataEntityFieldsFragment
[]>
Returns PRODUCT_V1
type offer metadata entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getProductV1Products
▸ getProductV1Products(queryVars?
): Promise
<BaseProductV1ProductFieldsFragment
[]>
Parameters
Name | Type |
---|---|
queryVars? | Exact <{ productsFilter? : ProductV1Product_Filter ; productsFirst? : number ; productsOrderBy? : ProductV1Product_OrderBy ; productsOrderDirection? : OrderDirection ; productsSkip? : number }> |
Returns
Promise
<BaseProductV1ProductFieldsFragment
[]>
Defined in
getProductWithVariants
▸ getProductWithVariants(productUuid
): Promise
<{ product
: BaseProductV1ProductFieldsFragment
; variants
: { offer
: OfferFieldsFragment
; variations
: ProductV1Variation
[] }[] }>
Parameters
Name | Type |
---|---|
productUuid | string |
Returns
Promise
<{ product
: BaseProductV1ProductFieldsFragment
; variants
: { offer
: OfferFieldsFragment
; variations
: ProductV1Variation
[] }[] }>
Defined in
getProtocolAllowance
▸ getProtocolAllowance(exchangeToken
, overrides?
): Promise
<string
>
Parameters
Name | Type |
---|---|
exchangeToken | string |
overrides | Partial <{ owner : string ; spender : string }> |
Returns
Promise
<string
>
Defined in
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
Name | Type | Description |
---|---|---|
originalMetaTxHash | string | Original meta transaction as returned by coreSDK.relayMetaTransaction |
overrides | Partial <{ 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
getSellerByAdmin
▸ getSellerByAdmin(admin
, queryVars?
): Promise
<SellerFieldsFragment
>
Returns seller entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
admin | string | Admin 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
getSellerByAuthToken
▸ getSellerByAuthToken(tokenId
, tokenType
, queryVars?
): Promise
<SellerFieldsFragment
>
Returns seller entity from subgraph that owns the given auth token (if any).
Parameters
Name | Type | Description |
---|---|---|
tokenId | string | tokenId of the Auth Token. |
tokenType | number | Type 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
getSellerByClerk
▸ getSellerByClerk(clerk
, queryVars?
): Promise
<SellerFieldsFragment
>
Returns seller entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
clerk | string | Clerk 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
getSellerById
▸ getSellerById(sellerId
, queryVars?
): Promise
<SellerFieldsFragment
>
Returns seller entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
sellerId | BigNumberish | ID of seller entity to query for. |
queryVars? | SingleSellerQueryVariables | Optional query variables to skip, order or filter. |
Returns
Promise
<SellerFieldsFragment
>
Seller entity from subgraph.
Defined in
getSellerByOperator
▸ getSellerByOperator(operator
, queryVars?
): Promise
<SellerFieldsFragment
>
Returns seller entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
operator | string | Operator 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
getSellerByTreasury
▸ getSellerByTreasury(treasury
, queryVars?
): Promise
<SellerFieldsFragment
>
Returns seller entity from subgraph.
Parameters
Name | Type | Description |
---|---|---|
treasury | string | Treasury 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
getSellers
▸ getSellers(queryVars?
): Promise
<SellerFieldsFragment
[]>
Returns seller entities from subgraph.
Parameters
Name | Type | Description |
---|---|---|
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
getSellersByAddress
▸ getSellersByAddress(address
, queryVars?
): Promise
<SellerFieldsFragment
[]>
Returns seller entity from subgraph. Matches operator
, clerk
, admin
or treasury
.
Parameters
Name | Type | Description |
---|---|---|
address | string | 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
optInToDisputeResolverUpdate
▸ optInToDisputeResolverUpdate(disputeResolverUpdates
, overrides?
): Promise
<TransactionResponse
>
Parameters
Name | Type |
---|---|
disputeResolverUpdates | OptInToDisputeResolverUpdateArgs |
overrides | Partial <{ contractAddress : string }> |
Returns
Promise
<TransactionResponse
>
Defined in
optInToSellerUpdate
▸ optInToSellerUpdate(sellerUpdates
, overrides?
): Promise
<TransactionResponse
>
Opt-in to a pending seller update by calling the AccountHandlerFacet
contract. Only callable
by admin.
Parameters
Name | Type | Description |
---|---|---|
sellerUpdates | OptInToSellerUpdateArgs | Values to update. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
raiseDispute
▸ raiseDispute(exchangeId
): Promise
<TransactionResponse
>
Raises a dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange to dispute. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
redeemVoucher
▸ redeemVoucher(exchangeId
): Promise
<TransactionResponse
>
Redeems an existing voucher by calling the ExchangeHandlerContract
.
Callable by buyer.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange to redeem. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
refuseEscalatedDispute
▸ refuseEscalatedDispute(exchangeId
): Promise
<TransactionResponse
>
Refuses escalated dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
relayMetaTransaction
▸ relayMetaTransaction(metaTxParams
, overrides?
): Promise
<TransactionResponse
>
Relay a meta transaction,
Parameters
Name | Type | Description |
---|---|---|
metaTxParams | Object | Required params for meta transaction. |
metaTxParams.functionName | string | - |
metaTxParams.functionSignature | BytesLike | - |
metaTxParams.nonce | BigNumberish | - |
metaTxParams.sigR | BytesLike | - |
metaTxParams.sigS | BytesLike | - |
metaTxParams.sigV | BigNumberish | - |
overrides | Partial <{ contractAddress : string ; metaTransactionMethod : string ; metaTxConfig : Partial <Omit <MetaTxConfig , "apiIds" > & { apiId : string }> ; userAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
relayNativeMetaTransaction
▸ relayNativeMetaTransaction(contractAddress
, metaTxParams
, overrides?
): Promise
<TransactionResponse
>
Relay a native meta transaction,
Parameters
Name | Type | Description |
---|---|---|
contractAddress | string | - |
metaTxParams | Object | Required params for meta transaction. |
metaTxParams.functionSignature | BytesLike | - |
metaTxParams.sigR | BytesLike | - |
metaTxParams.sigS | BytesLike | - |
metaTxParams.sigV | BigNumberish | - |
overrides | Partial <{ 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
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | Id of dispute resolver. |
feeTokenAddresses | string [] | Addresses of fee tokens to remove. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | Id of dispute resolver. |
sellerAllowList | string [] | List of seller ids that should be removed from the allow list of a dispute resolver. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
renderContractualAgreement
▸ renderContractualAgreement(template
, offerData
, offerMetadata
): Promise
<string
>
Renders contractual agreement for given offer.
Parameters
Name | Type | Description |
---|---|---|
template | string | Mustache syntax based template. |
offerData | CreateOfferArgs | Offer data. |
offerMetadata | AdditionalOfferMetadata | - |
Returns
Promise
<string
>
Contractual agreement as string.
Defined in
renderContractualAgreementForOffer
▸ renderContractualAgreementForOffer(offerId
): Promise
<string
>
Renders contractual agreement for given offer.
Parameters
Name | Type | Description |
---|---|---|
offerId | BigNumberish | Id of offer to render agreement for. |
Returns
Promise
<string
>
Contractual agreement as string.
Defined in
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
Name | Type | Description |
---|---|---|
args | Object | Dispute 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.buyerPercentBasisPoints | BigNumberish | - |
args.exchangeId | BigNumberish | - |
args.sigR | BytesLike | - |
args.sigS | BytesLike | - |
args.sigV | BigNumberish | - |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
retractDispute
▸ retractDispute(exchangeId
): Promise
<TransactionResponse
>
Retracts a dispute by calling the DisputeHandlerContract
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of disputed exchange. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
revokeVoucher
▸ revokeVoucher(exchangeId
): Promise
<TransactionResponse
>
Revokes an existing voucher by calling the ExchangeHandlerContract
.
Callable by seller operator
.
Parameters
Name | Type | Description |
---|---|---|
exchangeId | BigNumberish | ID of exchange to revoke. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
signDisputeResolutionProposal
▸ signDisputeResolutionProposal(args
): Promise
<{ r
: string
; s
: string
; v
: number
}>
Signs dispute resolution message.
Parameters
Name | Type | Description |
---|---|---|
args | Object | Dispute resolve arguments: - args.exchangeId - ID of disputed exchange. - args.buyerPercentBasisPoints - Percentage of deposit the buyer gets. |
args.buyerPercentBasisPoints | BigNumberish | - |
args.exchangeId | BigNumberish | - |
Returns
Promise
<{ r
: string
; s
: string
; v
: number
}>
Signature.
Defined in
signMetaTx
▸ signMetaTx(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { functionName : string ; functionSignature : string }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCancelVoucher
▸ signMetaTxCancelVoucher(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for cancelVoucher
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCommitToOffer
▸ signMetaTxCommitToOffer(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for commitToOffer
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { offerId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCompleteExchange
▸ signMetaTxCompleteExchange(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for completeExchangeBatch
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCompleteExchangeBatch
▸ signMetaTxCompleteExchangeBatch(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for completeExchangeBatch
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeIds : BigNumberish [] }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCreateGroup
▸ signMetaTxCreateGroup(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for createGroup
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { createGroupArgs : CreateGroupArgs }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCreateOffer
▸ signMetaTxCreateOffer(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for createOffer
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { createOfferArgs : CreateOfferArgs ; metadataStorage? : MetadataStorage ; theGraphStorage? : MetadataStorage }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCreateOfferBatch
▸ signMetaTxCreateOfferBatch(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for createOfferBatch
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { createOffersArgs : CreateOfferArgs [] ; metadataStorage? : MetadataStorage ; theGraphStorage? : MetadataStorage }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCreateOfferWithCondition
▸ signMetaTxCreateOfferWithCondition(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for createOfferWithCondition
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { condition : ConditionStruct ; metadataStorage? : MetadataStorage ; offerToCreate : CreateOfferArgs ; theGraphStorage? : MetadataStorage }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxCreateSeller
▸ signMetaTxCreateSeller(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for createSeller
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { createSellerArgs : CreateSellerArgs }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxDepositFunds
▸ signMetaTxDepositFunds(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for depositFunds
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { fundsAmount : BigNumberish ; fundsTokenAddress : string ; sellerId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxEscalateDispute
▸ signMetaTxEscalateDispute(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for escalateDispute
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxExpireVoucher
▸ signMetaTxExpireVoucher(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for expireVoucher
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxExtendDisputeTimeout
▸ signMetaTxExtendDisputeTimeout(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for extendDisputeTimeout
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish ; newTimeout : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxRaiseDispute
▸ signMetaTxRaiseDispute(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for raiseDispute
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxRedeemVoucher
▸ signMetaTxRedeemVoucher(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for redeemVoucher
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxResolveDispute
▸ signMetaTxResolveDispute(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for resolveDispute
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { buyerPercent : BigNumberish ; counterpartySig : { r : string ; s : string ; v : number } ; exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxRetractDispute
▸ signMetaTxRetractDispute(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for retractDispute
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxRevokeVoucher
▸ signMetaTxRevokeVoucher(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for revokeVoucher
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { exchangeId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxVoidOffer
▸ signMetaTxVoidOffer(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for voidOffer
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { offerId : BigNumberish }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxVoidOfferBatch
▸ signMetaTxVoidOfferBatch(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for voidOfferBatch
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { offerIds : BigNumberish [] }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signMetaTxWithdrawFunds
▸ signMetaTxWithdrawFunds(args
): Promise
<SignedMetaTx
>
Encodes and signs a meta transaction for withdrawFunds
that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
args | Omit <BaseMetaTxArgs & { entityId : BigNumberish ; tokenAmounts : BigNumberish [] ; tokenList : string [] }, "chainId" | "web3Lib" | "metaTxHandlerAddress" > | Meta transaction args. |
Returns
Promise
<SignedMetaTx
>
Signature.
Defined in
signNativeMetaTxApproveExchangeToken
▸ signNativeMetaTxApproveExchangeToken(exchangeToken
, value
, overrides?
): Promise
<SignedMetaTx
>
Encodes and signs a native "token.approve()" meta transaction that can be relayed.
Parameters
Name | Type | Description |
---|---|---|
exchangeToken | string | The address of the token contract. |
value | BigNumberish | The value to be approved. |
overrides | Partial <{ 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
Name | Type | Description |
---|---|---|
metadata | AnyMetadata | Offer metadata of type BASE or PRODUCT_V1 . |
Returns
Promise
<string
>
Metadata hash / identifier.
Defined in
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
Name | Type | Description |
---|---|---|
disputeResolverId | BigNumberish | Id of dispute resolver to update. |
updates | Partial <Omit <DisputeResolverStruct , "id" | "active" | "escalationResponsePeriod" > & { escalationResponsePeriodInMS : BigNumberish }> | Values to update for the given dispute resolver. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
updateSeller
▸ updateSeller(sellerUpdates
, overrides?
): Promise
<TransactionResponse
>
Updates seller account by calling the AccountHandlerFacet
contract. Only callable
by admin.
Parameters
Name | Type | Description |
---|---|---|
sellerUpdates | UpdateSellerArgs | Values to update. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
sellerUpdates | UpdateSellerArgs | Values to update. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
offerId | BigNumberish | ID of offer to void. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
offerIds | BigNumberish [] | IDs of offers to void. |
overrides | Partial <{ contractAddress : string }> | Optional overrides. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
withdrawAllAvailableFunds
▸ withdrawAllAvailableFunds(sellerId
): Promise
<TransactionResponse
>
Withdraw all available funds by calling the FundsHandlerFacet
contract.
Parameters
Name | Type | Description |
---|---|---|
sellerId | BigNumberish | ID of seller account to withdraw funds for. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
withdrawFunds
▸ withdrawFunds(sellerId
, tokensToWithdraw
, amountsToWithdraw
): Promise
<TransactionResponse
>
Withdraw selected funds by calling the FundsHandlerFacet
contract.
Parameters
Name | Type | Description |
---|---|---|
sellerId | BigNumberish | ID of seller account to withdraw funds for. |
tokensToWithdraw | string [] | Addresses of funds tokens to withdraw. |
amountsToWithdraw | BigNumberish [] | Amounts of funds token to withdraw. |
Returns
Promise
<TransactionResponse
>
Transaction response.
Defined in
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
Name | Type | Description |
---|---|---|
args | Object | Constructor args. |
args.envName | EnvironmentType | - |
args.metaTx? | Partial <MetaTxConfig > | - |
args.metadataStorage? | MetadataStorage | - |
args.theGraphStorage? | MetadataStorage | - |
args.web3Lib | Web3LibAdapter | - |
Returns
CoreSDK instance with default values.