@bosonprotocol/core-sdk 1.43.3 → 1.44.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/accounts/handler.d.ts +115 -1
- package/dist/cjs/accounts/handler.d.ts.map +1 -1
- package/dist/cjs/accounts/handler.js +126 -28
- package/dist/cjs/accounts/handler.js.map +1 -1
- package/dist/cjs/accounts/mixin.d.ts +105 -8
- package/dist/cjs/accounts/mixin.d.ts.map +1 -1
- package/dist/cjs/accounts/mixin.js +162 -122
- package/dist/cjs/accounts/mixin.js.map +1 -1
- package/dist/cjs/core-sdk.d.ts +6 -6
- package/dist/cjs/core-sdk.d.ts.map +1 -1
- package/dist/cjs/core-sdk.js.map +1 -1
- package/dist/cjs/disputes/handler.d.ts +77 -1
- package/dist/cjs/disputes/handler.d.ts.map +1 -1
- package/dist/cjs/disputes/handler.js +90 -20
- package/dist/cjs/disputes/handler.js.map +1 -1
- package/dist/cjs/disputes/mixin.d.ts +29 -11
- package/dist/cjs/disputes/mixin.d.ts.map +1 -1
- package/dist/cjs/disputes/mixin.js +97 -88
- package/dist/cjs/disputes/mixin.js.map +1 -1
- package/dist/cjs/erc1155/mixin.d.ts +2 -1
- package/dist/cjs/erc1155/mixin.d.ts.map +1 -1
- package/dist/cjs/erc1155/mixin.js.map +1 -1
- package/dist/cjs/erc165/mixin.d.ts +2 -1
- package/dist/cjs/erc165/mixin.d.ts.map +1 -1
- package/dist/cjs/erc165/mixin.js.map +1 -1
- package/dist/cjs/erc20/handler.d.ts +11 -2
- package/dist/cjs/erc20/handler.d.ts.map +1 -1
- package/dist/cjs/erc20/handler.js +8 -1
- package/dist/cjs/erc20/handler.js.map +1 -1
- package/dist/cjs/erc20/mixin.d.ts +20 -3
- package/dist/cjs/erc20/mixin.d.ts.map +1 -1
- package/dist/cjs/erc20/mixin.js +15 -10
- package/dist/cjs/erc20/mixin.js.map +1 -1
- package/dist/cjs/erc721/handler.d.ts +11 -2
- package/dist/cjs/erc721/handler.d.ts.map +1 -1
- package/dist/cjs/erc721/handler.js +8 -2
- package/dist/cjs/erc721/handler.js.map +1 -1
- package/dist/cjs/erc721/mixin.d.ts +2 -1
- package/dist/cjs/erc721/mixin.d.ts.map +1 -1
- package/dist/cjs/erc721/mixin.js.map +1 -1
- package/dist/cjs/errors/mixin.d.ts +2 -1
- package/dist/cjs/errors/mixin.d.ts.map +1 -1
- package/dist/cjs/errors/mixin.js.map +1 -1
- package/dist/cjs/event-logs/mixin.d.ts +2 -1
- package/dist/cjs/event-logs/mixin.d.ts.map +1 -1
- package/dist/cjs/event-logs/mixin.js.map +1 -1
- package/dist/cjs/exchanges/handler.d.ts +44 -1
- package/dist/cjs/exchanges/handler.d.ts.map +1 -1
- package/dist/cjs/exchanges/handler.js +76 -17
- package/dist/cjs/exchanges/handler.js.map +1 -1
- package/dist/cjs/exchanges/mixin.d.ts +24 -8
- package/dist/cjs/exchanges/mixin.d.ts.map +1 -1
- package/dist/cjs/exchanges/mixin.js +72 -72
- package/dist/cjs/exchanges/mixin.js.map +1 -1
- package/dist/cjs/funds/handler.d.ts +27 -1
- package/dist/cjs/funds/handler.d.ts.map +1 -1
- package/dist/cjs/funds/handler.js +28 -7
- package/dist/cjs/funds/handler.js.map +1 -1
- package/dist/cjs/funds/mixin.d.ts +50 -17
- package/dist/cjs/funds/mixin.d.ts.map +1 -1
- package/dist/cjs/funds/mixin.js +48 -46
- package/dist/cjs/funds/mixin.js.map +1 -1
- package/dist/cjs/groups/handler.d.ts +8 -1
- package/dist/cjs/groups/handler.d.ts.map +1 -1
- package/dist/cjs/groups/handler.js +9 -2
- package/dist/cjs/groups/handler.js.map +1 -1
- package/dist/cjs/groups/mixin.d.ts +12 -4
- package/dist/cjs/groups/mixin.d.ts.map +1 -1
- package/dist/cjs/groups/mixin.js +10 -8
- package/dist/cjs/groups/mixin.js.map +1 -1
- package/dist/cjs/marketplaces/mixin.d.ts +2 -1
- package/dist/cjs/marketplaces/mixin.d.ts.map +1 -1
- package/dist/cjs/marketplaces/mixin.js.map +1 -1
- package/dist/cjs/meta-tx/handler.d.ts.map +1 -1
- package/dist/cjs/meta-tx/handler.js +4 -2
- package/dist/cjs/meta-tx/handler.js.map +1 -1
- package/dist/cjs/meta-tx/mixin.d.ts +2 -2
- package/dist/cjs/meta-tx/mixin.d.ts.map +1 -1
- package/dist/cjs/meta-tx/mixin.js.map +1 -1
- package/dist/cjs/metadata/mixin.d.ts +2 -1
- package/dist/cjs/metadata/mixin.d.ts.map +1 -1
- package/dist/cjs/metadata/mixin.js.map +1 -1
- package/dist/cjs/mixins/base-core-sdk.d.ts +4 -4
- package/dist/cjs/mixins/base-core-sdk.d.ts.map +1 -1
- package/dist/cjs/mixins/base-core-sdk.js.map +1 -1
- package/dist/cjs/native-meta-tx/handler.d.ts.map +1 -1
- package/dist/cjs/native-meta-tx/handler.js +2 -1
- package/dist/cjs/native-meta-tx/handler.js.map +1 -1
- package/dist/cjs/native-meta-tx/mixin.d.ts +2 -2
- package/dist/cjs/native-meta-tx/mixin.d.ts.map +1 -1
- package/dist/cjs/native-meta-tx/mixin.js.map +1 -1
- package/dist/cjs/offers/handler.d.ts +81 -1
- package/dist/cjs/offers/handler.d.ts.map +1 -1
- package/dist/cjs/offers/handler.js +81 -20
- package/dist/cjs/offers/handler.js.map +1 -1
- package/dist/cjs/offers/mixin.d.ts +54 -2
- package/dist/cjs/offers/mixin.d.ts.map +1 -1
- package/dist/cjs/offers/mixin.js +102 -97
- package/dist/cjs/offers/mixin.js.map +1 -1
- package/dist/cjs/orchestration/handler.d.ts +86 -1
- package/dist/cjs/orchestration/handler.d.ts.map +1 -1
- package/dist/cjs/orchestration/handler.js +64 -16
- package/dist/cjs/orchestration/handler.js.map +1 -1
- package/dist/cjs/orchestration/mixin.d.ts +2 -2
- package/dist/cjs/orchestration/mixin.d.ts.map +1 -1
- package/dist/cjs/orchestration/mixin.js.map +1 -1
- package/dist/cjs/price-discovery/handler.d.ts +11 -1
- package/dist/cjs/price-discovery/handler.d.ts.map +1 -1
- package/dist/cjs/price-discovery/handler.js +9 -2
- package/dist/cjs/price-discovery/handler.js.map +1 -1
- package/dist/cjs/price-discovery/mixin.d.ts +16 -4
- package/dist/cjs/price-discovery/mixin.d.ts.map +1 -1
- package/dist/cjs/price-discovery/mixin.js +14 -12
- package/dist/cjs/price-discovery/mixin.js.map +1 -1
- package/dist/cjs/protocol-config/handler.d.ts +9 -0
- package/dist/cjs/protocol-config/handler.d.ts.map +1 -1
- package/dist/cjs/protocol-config/handler.js +10 -3
- package/dist/cjs/protocol-config/handler.js.map +1 -1
- package/dist/cjs/protocol-config/mixin.d.ts +2 -1
- package/dist/cjs/protocol-config/mixin.d.ts.map +1 -1
- package/dist/cjs/protocol-config/mixin.js.map +1 -1
- package/dist/cjs/subgraph/mixin.d.ts +2 -2
- package/dist/cjs/subgraph/mixin.d.ts.map +1 -1
- package/dist/cjs/subgraph/mixin.js.map +1 -1
- package/dist/cjs/voucher/handler.d.ts +56 -1
- package/dist/cjs/voucher/handler.d.ts.map +1 -1
- package/dist/cjs/voucher/handler.js +56 -14
- package/dist/cjs/voucher/handler.js.map +1 -1
- package/dist/cjs/voucher/mixin.d.ts +66 -22
- package/dist/cjs/voucher/mixin.d.ts.map +1 -1
- package/dist/cjs/voucher/mixin.js +75 -61
- package/dist/cjs/voucher/mixin.js.map +1 -1
- package/dist/esm/accounts/handler.d.ts +115 -1
- package/dist/esm/accounts/handler.d.ts.map +1 -1
- package/dist/esm/accounts/handler.js +126 -28
- package/dist/esm/accounts/handler.js.map +1 -1
- package/dist/esm/accounts/mixin.d.ts +105 -8
- package/dist/esm/accounts/mixin.d.ts.map +1 -1
- package/dist/esm/accounts/mixin.js +249 -116
- package/dist/esm/accounts/mixin.js.map +1 -1
- package/dist/esm/core-sdk.d.ts +6 -6
- package/dist/esm/core-sdk.d.ts.map +1 -1
- package/dist/esm/core-sdk.js.map +1 -1
- package/dist/esm/disputes/handler.d.ts +77 -1
- package/dist/esm/disputes/handler.d.ts.map +1 -1
- package/dist/esm/disputes/handler.js +90 -20
- package/dist/esm/disputes/handler.js.map +1 -1
- package/dist/esm/disputes/mixin.d.ts +29 -11
- package/dist/esm/disputes/mixin.d.ts.map +1 -1
- package/dist/esm/disputes/mixin.js +155 -90
- package/dist/esm/disputes/mixin.js.map +1 -1
- package/dist/esm/erc1155/mixin.d.ts +2 -1
- package/dist/esm/erc1155/mixin.d.ts.map +1 -1
- package/dist/esm/erc1155/mixin.js.map +1 -1
- package/dist/esm/erc165/mixin.d.ts +2 -1
- package/dist/esm/erc165/mixin.d.ts.map +1 -1
- package/dist/esm/erc165/mixin.js.map +1 -1
- package/dist/esm/erc20/handler.d.ts +11 -2
- package/dist/esm/erc20/handler.d.ts.map +1 -1
- package/dist/esm/erc20/handler.js +9 -2
- package/dist/esm/erc20/handler.js.map +1 -1
- package/dist/esm/erc20/mixin.d.ts +20 -3
- package/dist/esm/erc20/mixin.d.ts.map +1 -1
- package/dist/esm/erc20/mixin.js +24 -8
- package/dist/esm/erc20/mixin.js.map +1 -1
- package/dist/esm/erc721/handler.d.ts +11 -2
- package/dist/esm/erc721/handler.d.ts.map +1 -1
- package/dist/esm/erc721/handler.js +8 -2
- package/dist/esm/erc721/handler.js.map +1 -1
- package/dist/esm/erc721/mixin.d.ts +2 -1
- package/dist/esm/erc721/mixin.d.ts.map +1 -1
- package/dist/esm/erc721/mixin.js.map +1 -1
- package/dist/esm/errors/mixin.d.ts +2 -1
- package/dist/esm/errors/mixin.d.ts.map +1 -1
- package/dist/esm/errors/mixin.js.map +1 -1
- package/dist/esm/event-logs/mixin.d.ts +2 -1
- package/dist/esm/event-logs/mixin.d.ts.map +1 -1
- package/dist/esm/event-logs/mixin.js.map +1 -1
- package/dist/esm/exchanges/handler.d.ts +44 -1
- package/dist/esm/exchanges/handler.d.ts.map +1 -1
- package/dist/esm/exchanges/handler.js +80 -16
- package/dist/esm/exchanges/handler.js.map +1 -1
- package/dist/esm/exchanges/mixin.d.ts +24 -8
- package/dist/esm/exchanges/mixin.d.ts.map +1 -1
- package/dist/esm/exchanges/mixin.js +120 -72
- package/dist/esm/exchanges/mixin.js.map +1 -1
- package/dist/esm/funds/handler.d.ts +27 -1
- package/dist/esm/funds/handler.d.ts.map +1 -1
- package/dist/esm/funds/handler.js +28 -7
- package/dist/esm/funds/handler.js.map +1 -1
- package/dist/esm/funds/mixin.d.ts +50 -17
- package/dist/esm/funds/mixin.d.ts.map +1 -1
- package/dist/esm/funds/mixin.js +62 -42
- package/dist/esm/funds/mixin.js.map +1 -1
- package/dist/esm/groups/handler.d.ts +8 -1
- package/dist/esm/groups/handler.d.ts.map +1 -1
- package/dist/esm/groups/handler.js +9 -2
- package/dist/esm/groups/handler.js.map +1 -1
- package/dist/esm/groups/mixin.d.ts +12 -4
- package/dist/esm/groups/mixin.d.ts.map +1 -1
- package/dist/esm/groups/mixin.js +16 -8
- package/dist/esm/groups/mixin.js.map +1 -1
- package/dist/esm/marketplaces/mixin.d.ts +2 -1
- package/dist/esm/marketplaces/mixin.d.ts.map +1 -1
- package/dist/esm/marketplaces/mixin.js.map +1 -1
- package/dist/esm/meta-tx/handler.d.ts.map +1 -1
- package/dist/esm/meta-tx/handler.js +4 -2
- package/dist/esm/meta-tx/handler.js.map +1 -1
- package/dist/esm/meta-tx/mixin.d.ts +2 -2
- package/dist/esm/meta-tx/mixin.d.ts.map +1 -1
- package/dist/esm/meta-tx/mixin.js.map +1 -1
- package/dist/esm/metadata/mixin.d.ts +2 -1
- package/dist/esm/metadata/mixin.d.ts.map +1 -1
- package/dist/esm/metadata/mixin.js.map +1 -1
- package/dist/esm/mixins/base-core-sdk.d.ts +4 -4
- package/dist/esm/mixins/base-core-sdk.d.ts.map +1 -1
- package/dist/esm/mixins/base-core-sdk.js.map +1 -1
- package/dist/esm/native-meta-tx/handler.d.ts.map +1 -1
- package/dist/esm/native-meta-tx/handler.js +2 -1
- package/dist/esm/native-meta-tx/handler.js.map +1 -1
- package/dist/esm/native-meta-tx/mixin.d.ts +2 -2
- package/dist/esm/native-meta-tx/mixin.d.ts.map +1 -1
- package/dist/esm/native-meta-tx/mixin.js.map +1 -1
- package/dist/esm/offers/handler.d.ts +81 -1
- package/dist/esm/offers/handler.d.ts.map +1 -1
- package/dist/esm/offers/handler.js +83 -18
- package/dist/esm/offers/handler.js.map +1 -1
- package/dist/esm/offers/mixin.d.ts +54 -2
- package/dist/esm/offers/mixin.d.ts.map +1 -1
- package/dist/esm/offers/mixin.js +162 -97
- package/dist/esm/offers/mixin.js.map +1 -1
- package/dist/esm/orchestration/handler.d.ts +86 -1
- package/dist/esm/orchestration/handler.d.ts.map +1 -1
- package/dist/esm/orchestration/handler.js +64 -16
- package/dist/esm/orchestration/handler.js.map +1 -1
- package/dist/esm/orchestration/mixin.d.ts +2 -2
- package/dist/esm/orchestration/mixin.d.ts.map +1 -1
- package/dist/esm/orchestration/mixin.js.map +1 -1
- package/dist/esm/price-discovery/handler.d.ts +11 -1
- package/dist/esm/price-discovery/handler.d.ts.map +1 -1
- package/dist/esm/price-discovery/handler.js +9 -2
- package/dist/esm/price-discovery/handler.js.map +1 -1
- package/dist/esm/price-discovery/mixin.d.ts +16 -4
- package/dist/esm/price-discovery/mixin.d.ts.map +1 -1
- package/dist/esm/price-discovery/mixin.js +19 -11
- package/dist/esm/price-discovery/mixin.js.map +1 -1
- package/dist/esm/protocol-config/handler.d.ts +9 -0
- package/dist/esm/protocol-config/handler.d.ts.map +1 -1
- package/dist/esm/protocol-config/handler.js +10 -3
- package/dist/esm/protocol-config/handler.js.map +1 -1
- package/dist/esm/protocol-config/mixin.d.ts +2 -1
- package/dist/esm/protocol-config/mixin.d.ts.map +1 -1
- package/dist/esm/protocol-config/mixin.js.map +1 -1
- package/dist/esm/subgraph/mixin.d.ts +2 -2
- package/dist/esm/subgraph/mixin.d.ts.map +1 -1
- package/dist/esm/subgraph/mixin.js.map +1 -1
- package/dist/esm/voucher/handler.d.ts +56 -1
- package/dist/esm/voucher/handler.d.ts.map +1 -1
- package/dist/esm/voucher/handler.js +56 -14
- package/dist/esm/voucher/handler.js.map +1 -1
- package/dist/esm/voucher/mixin.d.ts +66 -22
- package/dist/esm/voucher/mixin.d.ts.map +1 -1
- package/dist/esm/voucher/mixin.js +93 -55
- package/dist/esm/voucher/mixin.js.map +1 -1
- package/package.json +3 -3
- package/src/accounts/handler.ts +369 -42
- package/src/accounts/mixin.ts +644 -57
- package/src/core-sdk.ts +26 -26
- package/src/disputes/handler.ts +257 -31
- package/src/disputes/mixin.ts +273 -42
- package/src/erc1155/mixin.ts +2 -1
- package/src/erc165/mixin.ts +2 -1
- package/src/erc20/handler.ts +36 -4
- package/src/erc20/mixin.ts +77 -10
- package/src/erc721/handler.ts +34 -4
- package/src/erc721/mixin.ts +2 -1
- package/src/errors/mixin.ts +2 -2
- package/src/event-logs/mixin.ts +2 -1
- package/src/exchanges/handler.ts +235 -25
- package/src/exchanges/mixin.ts +223 -32
- package/src/funds/handler.ts +99 -13
- package/src/funds/mixin.ts +177 -39
- package/src/groups/handler.ts +28 -3
- package/src/groups/mixin.ts +50 -7
- package/src/marketplaces/mixin.ts +2 -1
- package/src/meta-tx/handler.ts +4 -2
- package/src/meta-tx/mixin.ts +3 -2
- package/src/metadata/mixin.ts +2 -1
- package/src/mixins/base-core-sdk.ts +5 -5
- package/src/native-meta-tx/handler.ts +2 -1
- package/src/native-meta-tx/mixin.ts +8 -2
- package/src/offers/handler.ts +280 -28
- package/src/offers/mixin.ts +401 -35
- package/src/orchestration/handler.ts +259 -24
- package/src/orchestration/mixin.ts +8 -2
- package/src/price-discovery/handler.ts +35 -4
- package/src/price-discovery/mixin.ts +60 -9
- package/src/protocol-config/handler.ts +26 -4
- package/src/protocol-config/mixin.ts +4 -1
- package/src/subgraph/mixin.ts +6 -2
- package/src/voucher/handler.ts +192 -22
- package/src/voucher/mixin.ts +244 -66
package/src/accounts/mixin.ts
CHANGED
|
@@ -2,13 +2,19 @@ import { BaseCoreSDK } from "./../mixins/base-core-sdk";
|
|
|
2
2
|
import * as accounts from ".";
|
|
3
3
|
import * as subgraph from "../subgraph";
|
|
4
4
|
import * as erc721 from "../erc721";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
AuthTokenType,
|
|
7
|
+
TransactionResponse,
|
|
8
|
+
TransactionRequest,
|
|
9
|
+
Log,
|
|
10
|
+
Web3LibAdapter
|
|
11
|
+
} from "@bosonprotocol/common";
|
|
6
12
|
import { BigNumberish, BigNumber } from "@ethersproject/bignumber";
|
|
7
13
|
import { AddressZero } from "@ethersproject/constants";
|
|
8
14
|
import { offers, orchestration } from "..";
|
|
9
15
|
import { getValueFromLogs, getValuesFromLogsExt } from "../utils/logs";
|
|
10
16
|
|
|
11
|
-
export class AccountsMixin extends BaseCoreSDK {
|
|
17
|
+
export class AccountsMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
|
|
12
18
|
/* -------------------------------------------------------------------------- */
|
|
13
19
|
/* Account related methods */
|
|
14
20
|
/* -------------------------------------------------------------------------- */
|
|
@@ -203,19 +209,56 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
203
209
|
* @param overrides - Optional overrides.
|
|
204
210
|
* @returns Transaction response.
|
|
205
211
|
*/
|
|
212
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
206
213
|
public async createSeller(
|
|
207
214
|
sellerToCreate: accounts.CreateSellerArgs,
|
|
208
215
|
overrides: Partial<{
|
|
209
216
|
contractAddress: string;
|
|
217
|
+
txRequest: TransactionRequest;
|
|
218
|
+
returnTxInfo: true;
|
|
219
|
+
}>
|
|
220
|
+
): Promise<TransactionRequest>;
|
|
221
|
+
|
|
222
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
223
|
+
public async createSeller(
|
|
224
|
+
sellerToCreate: accounts.CreateSellerArgs,
|
|
225
|
+
overrides?: Partial<{
|
|
226
|
+
contractAddress: string;
|
|
227
|
+
txRequest: TransactionRequest;
|
|
228
|
+
returnTxInfo?: false | undefined;
|
|
229
|
+
}>
|
|
230
|
+
): Promise<TransactionResponse>;
|
|
231
|
+
|
|
232
|
+
// Implementation
|
|
233
|
+
public async createSeller(
|
|
234
|
+
sellerToCreate: accounts.CreateSellerArgs,
|
|
235
|
+
overrides: Partial<{
|
|
236
|
+
contractAddress: string;
|
|
237
|
+
txRequest: TransactionRequest;
|
|
238
|
+
returnTxInfo?: boolean;
|
|
210
239
|
}> = {}
|
|
211
|
-
): Promise<TransactionResponse> {
|
|
212
|
-
|
|
240
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
241
|
+
const { returnTxInfo } = overrides;
|
|
242
|
+
|
|
243
|
+
const sellerArgs = {
|
|
213
244
|
sellerToCreate,
|
|
214
245
|
web3Lib: this._web3Lib,
|
|
215
246
|
theGraphStorage: this._theGraphStorage,
|
|
216
247
|
metadataStorage: this._metadataStorage,
|
|
217
248
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
218
|
-
}
|
|
249
|
+
} as const satisfies Parameters<typeof accounts.handler.createSeller>[0];
|
|
250
|
+
|
|
251
|
+
if (returnTxInfo === true) {
|
|
252
|
+
return accounts.handler.createSeller({
|
|
253
|
+
...sellerArgs,
|
|
254
|
+
returnTxInfo: true
|
|
255
|
+
});
|
|
256
|
+
} else {
|
|
257
|
+
return accounts.handler.createSeller({
|
|
258
|
+
...sellerArgs,
|
|
259
|
+
returnTxInfo: false
|
|
260
|
+
});
|
|
261
|
+
}
|
|
219
262
|
}
|
|
220
263
|
|
|
221
264
|
/**
|
|
@@ -226,21 +269,62 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
226
269
|
* @param overrides - Optional overrides.
|
|
227
270
|
* @returns Transaction response.
|
|
228
271
|
*/
|
|
272
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
273
|
+
public async createSellerAndOffer(
|
|
274
|
+
sellerToCreate: accounts.CreateSellerArgs,
|
|
275
|
+
offerToCreate: offers.CreateOfferArgs,
|
|
276
|
+
overrides: Partial<{
|
|
277
|
+
contractAddress: string;
|
|
278
|
+
txRequest: TransactionRequest;
|
|
279
|
+
returnTxInfo: true;
|
|
280
|
+
}>
|
|
281
|
+
): Promise<TransactionRequest>;
|
|
282
|
+
|
|
283
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
284
|
+
public async createSellerAndOffer(
|
|
285
|
+
sellerToCreate: accounts.CreateSellerArgs,
|
|
286
|
+
offerToCreate: offers.CreateOfferArgs,
|
|
287
|
+
overrides?: Partial<{
|
|
288
|
+
contractAddress: string;
|
|
289
|
+
txRequest: TransactionRequest;
|
|
290
|
+
returnTxInfo?: false | undefined;
|
|
291
|
+
}>
|
|
292
|
+
): Promise<TransactionResponse>;
|
|
293
|
+
|
|
294
|
+
// Implementation
|
|
229
295
|
public async createSellerAndOffer(
|
|
230
296
|
sellerToCreate: accounts.CreateSellerArgs,
|
|
231
297
|
offerToCreate: offers.CreateOfferArgs,
|
|
232
298
|
overrides: Partial<{
|
|
233
299
|
contractAddress: string;
|
|
300
|
+
txRequest: TransactionRequest;
|
|
301
|
+
returnTxInfo?: boolean;
|
|
234
302
|
}> = {}
|
|
235
|
-
): Promise<TransactionResponse> {
|
|
236
|
-
|
|
303
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
304
|
+
const { returnTxInfo } = overrides;
|
|
305
|
+
|
|
306
|
+
const orchestrationArgs = {
|
|
237
307
|
sellerToCreate,
|
|
238
308
|
offerToCreate,
|
|
239
309
|
web3Lib: this._web3Lib,
|
|
240
310
|
theGraphStorage: this._theGraphStorage,
|
|
241
311
|
metadataStorage: this._metadataStorage,
|
|
242
312
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
243
|
-
}
|
|
313
|
+
} as const satisfies Parameters<
|
|
314
|
+
typeof orchestration.handler.createOfferAndSeller
|
|
315
|
+
>[0];
|
|
316
|
+
|
|
317
|
+
if (returnTxInfo === true) {
|
|
318
|
+
return orchestration.handler.createOfferAndSeller({
|
|
319
|
+
...orchestrationArgs,
|
|
320
|
+
returnTxInfo: true
|
|
321
|
+
});
|
|
322
|
+
} else {
|
|
323
|
+
return orchestration.handler.createOfferAndSeller({
|
|
324
|
+
...orchestrationArgs,
|
|
325
|
+
returnTxInfo: false
|
|
326
|
+
});
|
|
327
|
+
}
|
|
244
328
|
}
|
|
245
329
|
|
|
246
330
|
/**
|
|
@@ -250,19 +334,56 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
250
334
|
* @param overrides - Optional overrides.
|
|
251
335
|
* @returns Transaction response.
|
|
252
336
|
*/
|
|
337
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
253
338
|
public async updateSeller(
|
|
254
339
|
sellerUpdates: accounts.UpdateSellerArgs,
|
|
255
340
|
overrides: Partial<{
|
|
256
341
|
contractAddress: string;
|
|
342
|
+
txRequest: TransactionRequest;
|
|
343
|
+
returnTxInfo: true;
|
|
344
|
+
}>
|
|
345
|
+
): Promise<TransactionRequest>;
|
|
346
|
+
|
|
347
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
348
|
+
public async updateSeller(
|
|
349
|
+
sellerUpdates: accounts.UpdateSellerArgs,
|
|
350
|
+
overrides?: Partial<{
|
|
351
|
+
contractAddress: string;
|
|
352
|
+
txRequest: TransactionRequest;
|
|
353
|
+
returnTxInfo?: false | undefined;
|
|
354
|
+
}>
|
|
355
|
+
): Promise<TransactionResponse>;
|
|
356
|
+
|
|
357
|
+
// Implementation
|
|
358
|
+
public async updateSeller(
|
|
359
|
+
sellerUpdates: accounts.UpdateSellerArgs,
|
|
360
|
+
overrides: Partial<{
|
|
361
|
+
contractAddress: string;
|
|
362
|
+
txRequest: TransactionRequest;
|
|
363
|
+
returnTxInfo?: boolean;
|
|
257
364
|
}> = {}
|
|
258
|
-
): Promise<TransactionResponse> {
|
|
259
|
-
|
|
365
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
366
|
+
const { returnTxInfo } = overrides;
|
|
367
|
+
|
|
368
|
+
const sellerArgs = {
|
|
260
369
|
sellerUpdates,
|
|
261
370
|
web3Lib: this._web3Lib,
|
|
262
371
|
theGraphStorage: this._theGraphStorage,
|
|
263
372
|
metadataStorage: this._metadataStorage,
|
|
264
373
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
265
|
-
}
|
|
374
|
+
} as const satisfies Parameters<typeof accounts.handler.updateSeller>[0];
|
|
375
|
+
|
|
376
|
+
if (returnTxInfo === true) {
|
|
377
|
+
return accounts.handler.updateSeller({
|
|
378
|
+
...sellerArgs,
|
|
379
|
+
returnTxInfo: true
|
|
380
|
+
});
|
|
381
|
+
} else {
|
|
382
|
+
return accounts.handler.updateSeller({
|
|
383
|
+
...sellerArgs,
|
|
384
|
+
returnTxInfo: false
|
|
385
|
+
});
|
|
386
|
+
}
|
|
266
387
|
}
|
|
267
388
|
|
|
268
389
|
/**
|
|
@@ -272,17 +393,56 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
272
393
|
* @param overrides - Optional overrides.
|
|
273
394
|
* @returns Transaction response.
|
|
274
395
|
*/
|
|
396
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
275
397
|
public async optInToSellerUpdate(
|
|
276
398
|
sellerUpdates: accounts.OptInToSellerUpdateArgs,
|
|
277
399
|
overrides: Partial<{
|
|
278
400
|
contractAddress: string;
|
|
401
|
+
txRequest: TransactionRequest;
|
|
402
|
+
returnTxInfo: true;
|
|
403
|
+
}>
|
|
404
|
+
): Promise<TransactionRequest>;
|
|
405
|
+
|
|
406
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
407
|
+
public async optInToSellerUpdate(
|
|
408
|
+
sellerUpdates: accounts.OptInToSellerUpdateArgs,
|
|
409
|
+
overrides?: Partial<{
|
|
410
|
+
contractAddress: string;
|
|
411
|
+
txRequest: TransactionRequest;
|
|
412
|
+
returnTxInfo?: false | undefined;
|
|
413
|
+
}>
|
|
414
|
+
): Promise<TransactionResponse>;
|
|
415
|
+
|
|
416
|
+
// Implementation
|
|
417
|
+
public async optInToSellerUpdate(
|
|
418
|
+
sellerUpdates: accounts.OptInToSellerUpdateArgs,
|
|
419
|
+
overrides: Partial<{
|
|
420
|
+
contractAddress: string;
|
|
421
|
+
txRequest: TransactionRequest;
|
|
422
|
+
returnTxInfo?: boolean;
|
|
279
423
|
}> = {}
|
|
280
|
-
): Promise<TransactionResponse> {
|
|
281
|
-
|
|
424
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
425
|
+
const { returnTxInfo } = overrides;
|
|
426
|
+
|
|
427
|
+
const sellerArgs = {
|
|
282
428
|
sellerUpdates,
|
|
283
429
|
web3Lib: this._web3Lib,
|
|
284
430
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
285
|
-
}
|
|
431
|
+
} as const satisfies Parameters<
|
|
432
|
+
typeof accounts.handler.optInToSellerUpdate
|
|
433
|
+
>[0];
|
|
434
|
+
|
|
435
|
+
if (returnTxInfo === true) {
|
|
436
|
+
return accounts.handler.optInToSellerUpdate({
|
|
437
|
+
...sellerArgs,
|
|
438
|
+
returnTxInfo: true
|
|
439
|
+
});
|
|
440
|
+
} else {
|
|
441
|
+
return accounts.handler.optInToSellerUpdate({
|
|
442
|
+
...sellerArgs,
|
|
443
|
+
returnTxInfo: false
|
|
444
|
+
});
|
|
445
|
+
}
|
|
286
446
|
}
|
|
287
447
|
|
|
288
448
|
/**
|
|
@@ -299,7 +459,10 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
299
459
|
contractAddress: string;
|
|
300
460
|
}> = {}
|
|
301
461
|
): Promise<TransactionResponse> {
|
|
302
|
-
const updateTx = await this.updateSeller(sellerUpdates,
|
|
462
|
+
const updateTx = await this.updateSeller(sellerUpdates, {
|
|
463
|
+
...overrides,
|
|
464
|
+
returnTxInfo: false
|
|
465
|
+
});
|
|
303
466
|
const txReceipt = await updateTx.wait();
|
|
304
467
|
const pendingSellerUpdate = this.getPendingSellerUpdateFromLogs(
|
|
305
468
|
txReceipt.logs
|
|
@@ -373,14 +536,56 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
373
536
|
* @param disputeResolverToCreate - Dispute resolver arguments.
|
|
374
537
|
* @returns Transaction response.
|
|
375
538
|
*/
|
|
539
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
376
540
|
public async createDisputeResolver(
|
|
377
|
-
disputeResolverToCreate: accounts.CreateDisputeResolverArgs
|
|
378
|
-
|
|
379
|
-
|
|
541
|
+
disputeResolverToCreate: accounts.CreateDisputeResolverArgs,
|
|
542
|
+
overrides: Partial<{
|
|
543
|
+
contractAddress: string;
|
|
544
|
+
txRequest: TransactionRequest;
|
|
545
|
+
returnTxInfo: true;
|
|
546
|
+
}>
|
|
547
|
+
): Promise<TransactionRequest>;
|
|
548
|
+
|
|
549
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
550
|
+
public async createDisputeResolver(
|
|
551
|
+
disputeResolverToCreate: accounts.CreateDisputeResolverArgs,
|
|
552
|
+
overrides?: Partial<{
|
|
553
|
+
contractAddress: string;
|
|
554
|
+
txRequest: TransactionRequest;
|
|
555
|
+
returnTxInfo?: false | undefined;
|
|
556
|
+
}>
|
|
557
|
+
): Promise<TransactionResponse>;
|
|
558
|
+
|
|
559
|
+
// Implementation
|
|
560
|
+
public async createDisputeResolver(
|
|
561
|
+
disputeResolverToCreate: accounts.CreateDisputeResolverArgs,
|
|
562
|
+
overrides: Partial<{
|
|
563
|
+
contractAddress: string;
|
|
564
|
+
txRequest: TransactionRequest;
|
|
565
|
+
returnTxInfo?: boolean;
|
|
566
|
+
}> = {}
|
|
567
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
568
|
+
const { returnTxInfo } = overrides;
|
|
569
|
+
|
|
570
|
+
const disputeArgs = {
|
|
380
571
|
disputeResolverToCreate,
|
|
381
|
-
contractAddress: this._protocolDiamond,
|
|
572
|
+
contractAddress: overrides.contractAddress || this._protocolDiamond,
|
|
382
573
|
web3Lib: this._web3Lib
|
|
383
|
-
}
|
|
574
|
+
} as const satisfies Parameters<
|
|
575
|
+
typeof accounts.handler.createDisputeResolver
|
|
576
|
+
>[0];
|
|
577
|
+
|
|
578
|
+
if (returnTxInfo === true) {
|
|
579
|
+
return accounts.handler.createDisputeResolver({
|
|
580
|
+
...disputeArgs,
|
|
581
|
+
returnTxInfo: true
|
|
582
|
+
});
|
|
583
|
+
} else {
|
|
584
|
+
return accounts.handler.createDisputeResolver({
|
|
585
|
+
...disputeArgs,
|
|
586
|
+
returnTxInfo: false
|
|
587
|
+
});
|
|
588
|
+
}
|
|
384
589
|
}
|
|
385
590
|
|
|
386
591
|
/**
|
|
@@ -456,30 +661,113 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
456
661
|
* @param updates - Values to update for the given dispute resolver.
|
|
457
662
|
* @returns Transaction response.
|
|
458
663
|
*/
|
|
664
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
459
665
|
public async updateDisputeResolver(
|
|
460
666
|
disputeResolverId: BigNumberish,
|
|
461
|
-
updates: accounts.DisputeResolverUpdates
|
|
462
|
-
|
|
463
|
-
|
|
667
|
+
updates: accounts.DisputeResolverUpdates,
|
|
668
|
+
overrides: Partial<{
|
|
669
|
+
contractAddress: string;
|
|
670
|
+
txRequest: TransactionRequest;
|
|
671
|
+
returnTxInfo: true;
|
|
672
|
+
}>
|
|
673
|
+
): Promise<TransactionRequest>;
|
|
674
|
+
|
|
675
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
676
|
+
public async updateDisputeResolver(
|
|
677
|
+
disputeResolverId: BigNumberish,
|
|
678
|
+
updates: accounts.DisputeResolverUpdates,
|
|
679
|
+
overrides?: Partial<{
|
|
680
|
+
contractAddress: string;
|
|
681
|
+
txRequest: TransactionRequest;
|
|
682
|
+
returnTxInfo?: false | undefined;
|
|
683
|
+
}>
|
|
684
|
+
): Promise<TransactionResponse>;
|
|
685
|
+
|
|
686
|
+
// Implementation
|
|
687
|
+
public async updateDisputeResolver(
|
|
688
|
+
disputeResolverId: BigNumberish,
|
|
689
|
+
updates: accounts.DisputeResolverUpdates,
|
|
690
|
+
overrides: Partial<{
|
|
691
|
+
contractAddress: string;
|
|
692
|
+
txRequest: TransactionRequest;
|
|
693
|
+
returnTxInfo?: boolean;
|
|
694
|
+
}> = {}
|
|
695
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
696
|
+
const { returnTxInfo } = overrides;
|
|
697
|
+
|
|
698
|
+
const disputeArgs = {
|
|
464
699
|
disputeResolverId,
|
|
465
700
|
updates,
|
|
466
701
|
subgraphUrl: this._subgraphUrl,
|
|
467
|
-
contractAddress: this._protocolDiamond,
|
|
702
|
+
contractAddress: overrides.contractAddress || this._protocolDiamond,
|
|
468
703
|
web3Lib: this._web3Lib
|
|
469
|
-
}
|
|
704
|
+
} as const satisfies Parameters<
|
|
705
|
+
typeof accounts.handler.updateDisputeResolver
|
|
706
|
+
>[0];
|
|
707
|
+
|
|
708
|
+
if (returnTxInfo === true) {
|
|
709
|
+
return accounts.handler.updateDisputeResolver({
|
|
710
|
+
...disputeArgs,
|
|
711
|
+
returnTxInfo: true
|
|
712
|
+
});
|
|
713
|
+
} else {
|
|
714
|
+
return accounts.handler.updateDisputeResolver({
|
|
715
|
+
...disputeArgs,
|
|
716
|
+
returnTxInfo: false
|
|
717
|
+
});
|
|
718
|
+
}
|
|
470
719
|
}
|
|
471
720
|
|
|
721
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
472
722
|
public async optInToDisputeResolverUpdate(
|
|
473
723
|
disputeResolverUpdates: accounts.OptInToDisputeResolverUpdateArgs,
|
|
474
724
|
overrides: Partial<{
|
|
475
725
|
contractAddress: string;
|
|
726
|
+
txRequest: TransactionRequest;
|
|
727
|
+
returnTxInfo: true;
|
|
728
|
+
}>
|
|
729
|
+
): Promise<TransactionRequest>;
|
|
730
|
+
|
|
731
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
732
|
+
public async optInToDisputeResolverUpdate(
|
|
733
|
+
disputeResolverUpdates: accounts.OptInToDisputeResolverUpdateArgs,
|
|
734
|
+
overrides?: Partial<{
|
|
735
|
+
contractAddress: string;
|
|
736
|
+
txRequest: TransactionRequest;
|
|
737
|
+
returnTxInfo?: false | undefined;
|
|
738
|
+
}>
|
|
739
|
+
): Promise<TransactionResponse>;
|
|
740
|
+
|
|
741
|
+
// Implementation
|
|
742
|
+
public async optInToDisputeResolverUpdate(
|
|
743
|
+
disputeResolverUpdates: accounts.OptInToDisputeResolverUpdateArgs,
|
|
744
|
+
overrides: Partial<{
|
|
745
|
+
contractAddress: string;
|
|
746
|
+
txRequest: TransactionRequest;
|
|
747
|
+
returnTxInfo?: boolean;
|
|
476
748
|
}> = {}
|
|
477
|
-
): Promise<TransactionResponse> {
|
|
478
|
-
|
|
749
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
750
|
+
const { returnTxInfo } = overrides;
|
|
751
|
+
|
|
752
|
+
const disputeArgs = {
|
|
479
753
|
disputeResolverUpdates,
|
|
480
754
|
web3Lib: this._web3Lib,
|
|
481
755
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
482
|
-
}
|
|
756
|
+
} as const satisfies Parameters<
|
|
757
|
+
typeof accounts.handler.optInToDisputeResolverUpdate
|
|
758
|
+
>[0];
|
|
759
|
+
|
|
760
|
+
if (returnTxInfo === true) {
|
|
761
|
+
return accounts.handler.optInToDisputeResolverUpdate({
|
|
762
|
+
...disputeArgs,
|
|
763
|
+
returnTxInfo: true
|
|
764
|
+
});
|
|
765
|
+
} else {
|
|
766
|
+
return accounts.handler.optInToDisputeResolverUpdate({
|
|
767
|
+
...disputeArgs,
|
|
768
|
+
returnTxInfo: false
|
|
769
|
+
});
|
|
770
|
+
}
|
|
483
771
|
}
|
|
484
772
|
|
|
485
773
|
/**
|
|
@@ -491,16 +779,60 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
491
779
|
* not already specified.
|
|
492
780
|
* @returns Transaction response.
|
|
493
781
|
*/
|
|
782
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
494
783
|
public async addFeesToDisputeResolver(
|
|
495
784
|
disputeResolverId: BigNumberish,
|
|
496
|
-
fees: accounts.DisputeResolutionFee[]
|
|
497
|
-
|
|
498
|
-
|
|
785
|
+
fees: accounts.DisputeResolutionFee[],
|
|
786
|
+
overrides: Partial<{
|
|
787
|
+
contractAddress: string;
|
|
788
|
+
txRequest: TransactionRequest;
|
|
789
|
+
returnTxInfo: true;
|
|
790
|
+
}>
|
|
791
|
+
): Promise<TransactionRequest>;
|
|
792
|
+
|
|
793
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
794
|
+
public async addFeesToDisputeResolver(
|
|
795
|
+
disputeResolverId: BigNumberish,
|
|
796
|
+
fees: accounts.DisputeResolutionFee[],
|
|
797
|
+
overrides?: Partial<{
|
|
798
|
+
contractAddress: string;
|
|
799
|
+
txRequest: TransactionRequest;
|
|
800
|
+
returnTxInfo?: false | undefined;
|
|
801
|
+
}>
|
|
802
|
+
): Promise<TransactionResponse>;
|
|
803
|
+
|
|
804
|
+
// Implementation
|
|
805
|
+
public async addFeesToDisputeResolver(
|
|
806
|
+
disputeResolverId: BigNumberish,
|
|
807
|
+
fees: accounts.DisputeResolutionFee[],
|
|
808
|
+
overrides: Partial<{
|
|
809
|
+
contractAddress: string;
|
|
810
|
+
txRequest: TransactionRequest;
|
|
811
|
+
returnTxInfo?: boolean;
|
|
812
|
+
}> = {}
|
|
813
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
814
|
+
const { returnTxInfo } = overrides;
|
|
815
|
+
|
|
816
|
+
const disputeArgs = {
|
|
499
817
|
disputeResolverId,
|
|
500
818
|
fees,
|
|
501
|
-
contractAddress: this._protocolDiamond,
|
|
819
|
+
contractAddress: overrides.contractAddress || this._protocolDiamond,
|
|
502
820
|
web3Lib: this._web3Lib
|
|
503
|
-
}
|
|
821
|
+
} as const satisfies Parameters<
|
|
822
|
+
typeof accounts.handler.addFeesToDisputeResolver
|
|
823
|
+
>[0];
|
|
824
|
+
|
|
825
|
+
if (returnTxInfo === true) {
|
|
826
|
+
return accounts.handler.addFeesToDisputeResolver({
|
|
827
|
+
...disputeArgs,
|
|
828
|
+
returnTxInfo: true
|
|
829
|
+
});
|
|
830
|
+
} else {
|
|
831
|
+
return accounts.handler.addFeesToDisputeResolver({
|
|
832
|
+
...disputeArgs,
|
|
833
|
+
returnTxInfo: false
|
|
834
|
+
});
|
|
835
|
+
}
|
|
504
836
|
}
|
|
505
837
|
|
|
506
838
|
/**
|
|
@@ -512,16 +844,54 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
512
844
|
* Should only contain seller ids that are not part of the current allow list.
|
|
513
845
|
* @returns Transaction response.
|
|
514
846
|
*/
|
|
847
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
515
848
|
public async addSellersToDisputeResolverAllowList(
|
|
516
849
|
disputeResolverId: BigNumberish,
|
|
517
|
-
sellerAllowList: BigNumberish[]
|
|
518
|
-
|
|
519
|
-
|
|
850
|
+
sellerAllowList: BigNumberish[],
|
|
851
|
+
overrides: Partial<{
|
|
852
|
+
returnTxInfo: true;
|
|
853
|
+
}>
|
|
854
|
+
): Promise<TransactionRequest>;
|
|
855
|
+
|
|
856
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
857
|
+
public async addSellersToDisputeResolverAllowList(
|
|
858
|
+
disputeResolverId: BigNumberish,
|
|
859
|
+
sellerAllowList: BigNumberish[],
|
|
860
|
+
overrides?: Partial<{
|
|
861
|
+
returnTxInfo?: false | undefined;
|
|
862
|
+
}>
|
|
863
|
+
): Promise<TransactionResponse>;
|
|
864
|
+
|
|
865
|
+
// Implementation
|
|
866
|
+
public async addSellersToDisputeResolverAllowList(
|
|
867
|
+
disputeResolverId: BigNumberish,
|
|
868
|
+
sellerAllowList: BigNumberish[],
|
|
869
|
+
overrides: Partial<{
|
|
870
|
+
returnTxInfo?: boolean;
|
|
871
|
+
}> = {}
|
|
872
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
873
|
+
const { returnTxInfo } = overrides;
|
|
874
|
+
|
|
875
|
+
const args = {
|
|
520
876
|
disputeResolverId,
|
|
521
877
|
sellerAllowList,
|
|
522
878
|
contractAddress: this._protocolDiamond,
|
|
523
879
|
web3Lib: this._web3Lib
|
|
524
|
-
}
|
|
880
|
+
} as const satisfies Parameters<
|
|
881
|
+
typeof accounts.handler.addSellersToAllowList
|
|
882
|
+
>[0];
|
|
883
|
+
|
|
884
|
+
if (returnTxInfo === true) {
|
|
885
|
+
return accounts.handler.addSellersToAllowList({
|
|
886
|
+
...args,
|
|
887
|
+
returnTxInfo: true
|
|
888
|
+
});
|
|
889
|
+
} else {
|
|
890
|
+
return accounts.handler.addSellersToAllowList({
|
|
891
|
+
...args,
|
|
892
|
+
returnTxInfo: false
|
|
893
|
+
});
|
|
894
|
+
}
|
|
525
895
|
}
|
|
526
896
|
|
|
527
897
|
/**
|
|
@@ -532,16 +902,54 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
532
902
|
* @param feeTokenAddresses - Addresses of fee tokens to remove.
|
|
533
903
|
* @returns Transaction response.
|
|
534
904
|
*/
|
|
905
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
535
906
|
public async removeFeesFromDisputeResolver(
|
|
536
907
|
disputeResolverId: BigNumberish,
|
|
537
|
-
feeTokenAddresses: string[]
|
|
538
|
-
|
|
539
|
-
|
|
908
|
+
feeTokenAddresses: string[],
|
|
909
|
+
overrides: Partial<{
|
|
910
|
+
returnTxInfo: true;
|
|
911
|
+
}>
|
|
912
|
+
): Promise<TransactionRequest>;
|
|
913
|
+
|
|
914
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
915
|
+
public async removeFeesFromDisputeResolver(
|
|
916
|
+
disputeResolverId: BigNumberish,
|
|
917
|
+
feeTokenAddresses: string[],
|
|
918
|
+
overrides?: Partial<{
|
|
919
|
+
returnTxInfo?: false | undefined;
|
|
920
|
+
}>
|
|
921
|
+
): Promise<TransactionResponse>;
|
|
922
|
+
|
|
923
|
+
// Implementation
|
|
924
|
+
public async removeFeesFromDisputeResolver(
|
|
925
|
+
disputeResolverId: BigNumberish,
|
|
926
|
+
feeTokenAddresses: string[],
|
|
927
|
+
overrides: Partial<{
|
|
928
|
+
returnTxInfo?: boolean;
|
|
929
|
+
}> = {}
|
|
930
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
931
|
+
const { returnTxInfo } = overrides;
|
|
932
|
+
|
|
933
|
+
const args = {
|
|
540
934
|
disputeResolverId,
|
|
541
935
|
feeTokenAddresses,
|
|
542
936
|
contractAddress: this._protocolDiamond,
|
|
543
937
|
web3Lib: this._web3Lib
|
|
544
|
-
}
|
|
938
|
+
} as const satisfies Parameters<
|
|
939
|
+
typeof accounts.handler.removeFeesFromDisputeResolver
|
|
940
|
+
>[0];
|
|
941
|
+
|
|
942
|
+
if (returnTxInfo === true) {
|
|
943
|
+
return accounts.handler.removeFeesFromDisputeResolver({
|
|
944
|
+
...args,
|
|
945
|
+
returnTxInfo: true
|
|
946
|
+
});
|
|
947
|
+
} else {
|
|
948
|
+
return accounts.handler.removeFeesFromDisputeResolver({
|
|
949
|
+
...args,
|
|
950
|
+
returnTxInfo: false
|
|
951
|
+
});
|
|
952
|
+
}
|
|
545
953
|
}
|
|
546
954
|
|
|
547
955
|
/**
|
|
@@ -553,16 +961,54 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
553
961
|
* list of a dispute resolver.
|
|
554
962
|
* @returns Transaction response.
|
|
555
963
|
*/
|
|
964
|
+
// Overload: returnTxInfo is true → returns TransactionRequest
|
|
556
965
|
public async removeSellersFromDisputeResolverAllowList(
|
|
557
966
|
disputeResolverId: BigNumberish,
|
|
558
|
-
sellerAllowList: string[]
|
|
559
|
-
|
|
560
|
-
|
|
967
|
+
sellerAllowList: string[],
|
|
968
|
+
overrides: Partial<{
|
|
969
|
+
returnTxInfo: true;
|
|
970
|
+
}>
|
|
971
|
+
): Promise<TransactionRequest>;
|
|
972
|
+
|
|
973
|
+
// Overload: returnTxInfo is false or undefined → returns TransactionResponse
|
|
974
|
+
public async removeSellersFromDisputeResolverAllowList(
|
|
975
|
+
disputeResolverId: BigNumberish,
|
|
976
|
+
sellerAllowList: string[],
|
|
977
|
+
overrides?: Partial<{
|
|
978
|
+
returnTxInfo?: false | undefined;
|
|
979
|
+
}>
|
|
980
|
+
): Promise<TransactionResponse>;
|
|
981
|
+
|
|
982
|
+
// Implementation
|
|
983
|
+
public async removeSellersFromDisputeResolverAllowList(
|
|
984
|
+
disputeResolverId: BigNumberish,
|
|
985
|
+
sellerAllowList: string[],
|
|
986
|
+
overrides: Partial<{
|
|
987
|
+
returnTxInfo?: boolean;
|
|
988
|
+
}> = {}
|
|
989
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
990
|
+
const { returnTxInfo } = overrides;
|
|
991
|
+
|
|
992
|
+
const args = {
|
|
561
993
|
disputeResolverId,
|
|
562
994
|
sellerAllowList,
|
|
563
995
|
contractAddress: this._protocolDiamond,
|
|
564
996
|
web3Lib: this._web3Lib
|
|
565
|
-
}
|
|
997
|
+
} as const satisfies Parameters<
|
|
998
|
+
typeof accounts.handler.removeSellersFromAllowList
|
|
999
|
+
>[0];
|
|
1000
|
+
|
|
1001
|
+
if (returnTxInfo === true) {
|
|
1002
|
+
return accounts.handler.removeSellersFromAllowList({
|
|
1003
|
+
...args,
|
|
1004
|
+
returnTxInfo: true
|
|
1005
|
+
});
|
|
1006
|
+
} else {
|
|
1007
|
+
return accounts.handler.removeSellersFromAllowList({
|
|
1008
|
+
...args,
|
|
1009
|
+
returnTxInfo: false
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
566
1012
|
}
|
|
567
1013
|
|
|
568
1014
|
/**
|
|
@@ -597,8 +1043,27 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
597
1043
|
collectionToCreate: accounts.CreateCollectionArgs,
|
|
598
1044
|
overrides: Partial<{
|
|
599
1045
|
contractAddress: string;
|
|
1046
|
+
returnTxInfo: true;
|
|
1047
|
+
}>
|
|
1048
|
+
): Promise<TransactionRequest>;
|
|
1049
|
+
|
|
1050
|
+
public async createNewCollection(
|
|
1051
|
+
collectionToCreate: accounts.CreateCollectionArgs,
|
|
1052
|
+
overrides?: Partial<{
|
|
1053
|
+
contractAddress: string;
|
|
1054
|
+
returnTxInfo?: false | undefined;
|
|
1055
|
+
}>
|
|
1056
|
+
): Promise<TransactionResponse>;
|
|
1057
|
+
|
|
1058
|
+
public async createNewCollection(
|
|
1059
|
+
collectionToCreate: accounts.CreateCollectionArgs,
|
|
1060
|
+
overrides: Partial<{
|
|
1061
|
+
contractAddress: string;
|
|
1062
|
+
returnTxInfo?: boolean;
|
|
600
1063
|
}> = {}
|
|
601
|
-
): Promise<TransactionResponse> {
|
|
1064
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
1065
|
+
const { returnTxInfo } = overrides;
|
|
1066
|
+
|
|
602
1067
|
if (!collectionToCreate.sellerId) {
|
|
603
1068
|
const { id: sellerId } = await this.getSellerByAssistant(
|
|
604
1069
|
await this._web3Lib.getSignerAddress()
|
|
@@ -606,13 +1071,28 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
606
1071
|
// If the caller is not a seller, the sellerId remains undefined
|
|
607
1072
|
collectionToCreate.sellerId = sellerId;
|
|
608
1073
|
}
|
|
609
|
-
|
|
1074
|
+
|
|
1075
|
+
const args = {
|
|
610
1076
|
collectionToCreate,
|
|
611
1077
|
web3Lib: this._web3Lib,
|
|
612
1078
|
contractAddress: overrides.contractAddress || this._protocolDiamond,
|
|
613
1079
|
theGraphStorage: this._theGraphStorage,
|
|
614
1080
|
metadataStorage: this._metadataStorage
|
|
615
|
-
}
|
|
1081
|
+
} as const satisfies Parameters<
|
|
1082
|
+
typeof accounts.handler.createNewCollection
|
|
1083
|
+
>[0];
|
|
1084
|
+
|
|
1085
|
+
if (returnTxInfo === true) {
|
|
1086
|
+
return accounts.handler.createNewCollection({
|
|
1087
|
+
...args,
|
|
1088
|
+
returnTxInfo: true
|
|
1089
|
+
});
|
|
1090
|
+
} else {
|
|
1091
|
+
return accounts.handler.createNewCollection({
|
|
1092
|
+
...args,
|
|
1093
|
+
returnTxInfo: false
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
616
1096
|
}
|
|
617
1097
|
|
|
618
1098
|
public async getOfferCollections(
|
|
@@ -626,14 +1106,49 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
626
1106
|
royaltyRecipients: accounts.RoyaltyRecipientInfo[],
|
|
627
1107
|
overrides: Partial<{
|
|
628
1108
|
contractAddress: string;
|
|
1109
|
+
returnTxInfo: true;
|
|
1110
|
+
}>
|
|
1111
|
+
): Promise<TransactionRequest>;
|
|
1112
|
+
|
|
1113
|
+
public async addRoyaltyRecipients(
|
|
1114
|
+
sellerId: BigNumberish,
|
|
1115
|
+
royaltyRecipients: accounts.RoyaltyRecipientInfo[],
|
|
1116
|
+
overrides?: Partial<{
|
|
1117
|
+
contractAddress: string;
|
|
1118
|
+
returnTxInfo?: false | undefined;
|
|
1119
|
+
}>
|
|
1120
|
+
): Promise<TransactionResponse>;
|
|
1121
|
+
|
|
1122
|
+
public async addRoyaltyRecipients(
|
|
1123
|
+
sellerId: BigNumberish,
|
|
1124
|
+
royaltyRecipients: accounts.RoyaltyRecipientInfo[],
|
|
1125
|
+
overrides: Partial<{
|
|
1126
|
+
contractAddress: string;
|
|
1127
|
+
returnTxInfo?: boolean;
|
|
629
1128
|
}> = {}
|
|
630
|
-
) {
|
|
631
|
-
|
|
1129
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
1130
|
+
const { returnTxInfo } = overrides;
|
|
1131
|
+
|
|
1132
|
+
const args = {
|
|
632
1133
|
sellerId,
|
|
633
1134
|
royaltyRecipients,
|
|
634
1135
|
web3Lib: this._web3Lib,
|
|
635
1136
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
636
|
-
}
|
|
1137
|
+
} as const satisfies Parameters<
|
|
1138
|
+
typeof accounts.handler.addRoyaltyRecipients
|
|
1139
|
+
>[0];
|
|
1140
|
+
|
|
1141
|
+
if (returnTxInfo === true) {
|
|
1142
|
+
return accounts.handler.addRoyaltyRecipients({
|
|
1143
|
+
...args,
|
|
1144
|
+
returnTxInfo: true
|
|
1145
|
+
});
|
|
1146
|
+
} else {
|
|
1147
|
+
return accounts.handler.addRoyaltyRecipients({
|
|
1148
|
+
...args,
|
|
1149
|
+
returnTxInfo: false
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
637
1152
|
}
|
|
638
1153
|
|
|
639
1154
|
public async updateRoyaltyRecipients(
|
|
@@ -642,15 +1157,52 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
642
1157
|
royaltyRecipients: accounts.RoyaltyRecipientInfo[],
|
|
643
1158
|
overrides: Partial<{
|
|
644
1159
|
contractAddress: string;
|
|
1160
|
+
returnTxInfo: true;
|
|
1161
|
+
}>
|
|
1162
|
+
): Promise<TransactionRequest>;
|
|
1163
|
+
|
|
1164
|
+
public async updateRoyaltyRecipients(
|
|
1165
|
+
sellerId: BigNumberish,
|
|
1166
|
+
royaltyRecipientIds: BigNumberish[],
|
|
1167
|
+
royaltyRecipients: accounts.RoyaltyRecipientInfo[],
|
|
1168
|
+
overrides?: Partial<{
|
|
1169
|
+
contractAddress: string;
|
|
1170
|
+
returnTxInfo?: false | undefined;
|
|
1171
|
+
}>
|
|
1172
|
+
): Promise<TransactionResponse>;
|
|
1173
|
+
|
|
1174
|
+
public async updateRoyaltyRecipients(
|
|
1175
|
+
sellerId: BigNumberish,
|
|
1176
|
+
royaltyRecipientIds: BigNumberish[],
|
|
1177
|
+
royaltyRecipients: accounts.RoyaltyRecipientInfo[],
|
|
1178
|
+
overrides: Partial<{
|
|
1179
|
+
contractAddress: string;
|
|
1180
|
+
returnTxInfo?: boolean;
|
|
645
1181
|
}> = {}
|
|
646
|
-
) {
|
|
647
|
-
|
|
1182
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
1183
|
+
const { returnTxInfo } = overrides;
|
|
1184
|
+
|
|
1185
|
+
const args = {
|
|
648
1186
|
sellerId,
|
|
649
1187
|
royaltyRecipientIds,
|
|
650
1188
|
royaltyRecipients,
|
|
651
1189
|
web3Lib: this._web3Lib,
|
|
652
1190
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
653
|
-
}
|
|
1191
|
+
} as const satisfies Parameters<
|
|
1192
|
+
typeof accounts.handler.updateRoyaltyRecipients
|
|
1193
|
+
>[0];
|
|
1194
|
+
|
|
1195
|
+
if (returnTxInfo === true) {
|
|
1196
|
+
return accounts.handler.updateRoyaltyRecipients({
|
|
1197
|
+
...args,
|
|
1198
|
+
returnTxInfo: true
|
|
1199
|
+
});
|
|
1200
|
+
} else {
|
|
1201
|
+
return accounts.handler.updateRoyaltyRecipients({
|
|
1202
|
+
...args,
|
|
1203
|
+
returnTxInfo: false
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
654
1206
|
}
|
|
655
1207
|
|
|
656
1208
|
public async removeRoyaltyRecipients(
|
|
@@ -658,14 +1210,49 @@ export class AccountsMixin extends BaseCoreSDK {
|
|
|
658
1210
|
royaltyRecipientIds: BigNumberish[],
|
|
659
1211
|
overrides: Partial<{
|
|
660
1212
|
contractAddress: string;
|
|
1213
|
+
returnTxInfo: true;
|
|
1214
|
+
}>
|
|
1215
|
+
): Promise<TransactionRequest>;
|
|
1216
|
+
|
|
1217
|
+
public async removeRoyaltyRecipients(
|
|
1218
|
+
sellerId: BigNumberish,
|
|
1219
|
+
royaltyRecipientIds: BigNumberish[],
|
|
1220
|
+
overrides?: Partial<{
|
|
1221
|
+
contractAddress: string;
|
|
1222
|
+
returnTxInfo?: false | undefined;
|
|
1223
|
+
}>
|
|
1224
|
+
): Promise<TransactionResponse>;
|
|
1225
|
+
|
|
1226
|
+
public async removeRoyaltyRecipients(
|
|
1227
|
+
sellerId: BigNumberish,
|
|
1228
|
+
royaltyRecipientIds: BigNumberish[],
|
|
1229
|
+
overrides: Partial<{
|
|
1230
|
+
contractAddress: string;
|
|
1231
|
+
returnTxInfo?: boolean;
|
|
661
1232
|
}> = {}
|
|
662
|
-
) {
|
|
663
|
-
|
|
1233
|
+
): Promise<TransactionResponse | TransactionRequest> {
|
|
1234
|
+
const { returnTxInfo } = overrides;
|
|
1235
|
+
|
|
1236
|
+
const args = {
|
|
664
1237
|
sellerId,
|
|
665
1238
|
royaltyRecipientIds,
|
|
666
1239
|
web3Lib: this._web3Lib,
|
|
667
1240
|
contractAddress: overrides.contractAddress || this._protocolDiamond
|
|
668
|
-
}
|
|
1241
|
+
} as const satisfies Parameters<
|
|
1242
|
+
typeof accounts.handler.removeRoyaltyRecipients
|
|
1243
|
+
>[0];
|
|
1244
|
+
|
|
1245
|
+
if (returnTxInfo === true) {
|
|
1246
|
+
return accounts.handler.removeRoyaltyRecipients({
|
|
1247
|
+
...args,
|
|
1248
|
+
returnTxInfo: true
|
|
1249
|
+
});
|
|
1250
|
+
} else {
|
|
1251
|
+
return accounts.handler.removeRoyaltyRecipients({
|
|
1252
|
+
...args,
|
|
1253
|
+
returnTxInfo: false
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
669
1256
|
}
|
|
670
1257
|
|
|
671
1258
|
public async getRoyaltyRecipients(
|