@bosonprotocol/core-sdk 1.44.0 → 1.44.1-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.
Files changed (82) hide show
  1. package/dist/cjs/disputes/handler.d.ts +14 -0
  2. package/dist/cjs/disputes/handler.d.ts.map +1 -1
  3. package/dist/cjs/disputes/handler.js.map +1 -1
  4. package/dist/cjs/disputes/interface.d.ts +4 -0
  5. package/dist/cjs/disputes/interface.d.ts.map +1 -1
  6. package/dist/cjs/disputes/interface.js +13 -3
  7. package/dist/cjs/disputes/interface.js.map +1 -1
  8. package/dist/cjs/disputes/mixin.d.ts +10 -0
  9. package/dist/cjs/disputes/mixin.d.ts.map +1 -1
  10. package/dist/cjs/disputes/mixin.js +17 -9
  11. package/dist/cjs/disputes/mixin.js.map +1 -1
  12. package/dist/cjs/exchanges/interface.d.ts +1 -0
  13. package/dist/cjs/exchanges/interface.d.ts.map +1 -1
  14. package/dist/cjs/exchanges/interface.js +4 -3
  15. package/dist/cjs/exchanges/interface.js.map +1 -1
  16. package/dist/cjs/funds/handler.d.ts +2 -2
  17. package/dist/cjs/funds/handler.js +1 -1
  18. package/dist/cjs/funds/interface.d.ts +1 -1
  19. package/dist/cjs/funds/interface.js +2 -2
  20. package/dist/cjs/funds/mixin.d.ts +4 -4
  21. package/dist/cjs/funds/mixin.js +3 -3
  22. package/dist/cjs/groups/interface.js +1 -1
  23. package/dist/cjs/groups/interface.js.map +1 -1
  24. package/dist/cjs/meta-tx/handler.d.ts +2 -2
  25. package/dist/cjs/meta-tx/handler.d.ts.map +1 -1
  26. package/dist/cjs/meta-tx/handler.js +18 -23
  27. package/dist/cjs/meta-tx/handler.js.map +1 -1
  28. package/dist/cjs/offers/interface.d.ts +3 -2
  29. package/dist/cjs/offers/interface.d.ts.map +1 -1
  30. package/dist/cjs/offers/interface.js +16 -7
  31. package/dist/cjs/offers/interface.js.map +1 -1
  32. package/dist/cjs/utils/signature.d.ts +5 -0
  33. package/dist/cjs/utils/signature.d.ts.map +1 -1
  34. package/dist/cjs/utils/signature.js +13 -0
  35. package/dist/cjs/utils/signature.js.map +1 -1
  36. package/dist/esm/disputes/handler.d.ts +14 -0
  37. package/dist/esm/disputes/handler.d.ts.map +1 -1
  38. package/dist/esm/disputes/handler.js.map +1 -1
  39. package/dist/esm/disputes/interface.d.ts +4 -0
  40. package/dist/esm/disputes/interface.d.ts.map +1 -1
  41. package/dist/esm/disputes/interface.js +13 -3
  42. package/dist/esm/disputes/interface.js.map +1 -1
  43. package/dist/esm/disputes/mixin.d.ts +10 -0
  44. package/dist/esm/disputes/mixin.d.ts.map +1 -1
  45. package/dist/esm/disputes/mixin.js +17 -9
  46. package/dist/esm/disputes/mixin.js.map +1 -1
  47. package/dist/esm/exchanges/interface.d.ts +1 -0
  48. package/dist/esm/exchanges/interface.d.ts.map +1 -1
  49. package/dist/esm/exchanges/interface.js +3 -2
  50. package/dist/esm/exchanges/interface.js.map +1 -1
  51. package/dist/esm/funds/handler.d.ts +2 -2
  52. package/dist/esm/funds/handler.js +1 -1
  53. package/dist/esm/funds/interface.d.ts +1 -1
  54. package/dist/esm/funds/interface.js +2 -2
  55. package/dist/esm/funds/mixin.d.ts +4 -4
  56. package/dist/esm/funds/mixin.js +2 -2
  57. package/dist/esm/groups/interface.js +1 -1
  58. package/dist/esm/groups/interface.js.map +1 -1
  59. package/dist/esm/meta-tx/handler.d.ts +2 -2
  60. package/dist/esm/meta-tx/handler.d.ts.map +1 -1
  61. package/dist/esm/meta-tx/handler.js +20 -25
  62. package/dist/esm/meta-tx/handler.js.map +1 -1
  63. package/dist/esm/offers/interface.d.ts +3 -2
  64. package/dist/esm/offers/interface.d.ts.map +1 -1
  65. package/dist/esm/offers/interface.js +17 -7
  66. package/dist/esm/offers/interface.js.map +1 -1
  67. package/dist/esm/utils/signature.d.ts +5 -0
  68. package/dist/esm/utils/signature.d.ts.map +1 -1
  69. package/dist/esm/utils/signature.js +12 -0
  70. package/dist/esm/utils/signature.js.map +1 -1
  71. package/package.json +3 -3
  72. package/src/disputes/handler.ts +63 -30
  73. package/src/disputes/interface.ts +27 -10
  74. package/src/disputes/mixin.ts +69 -33
  75. package/src/exchanges/interface.ts +6 -2
  76. package/src/funds/handler.ts +4 -4
  77. package/src/funds/interface.ts +2 -2
  78. package/src/funds/mixin.ts +6 -6
  79. package/src/groups/interface.ts +1 -1
  80. package/src/meta-tx/handler.ts +35 -31
  81. package/src/offers/interface.ts +36 -11
  82. package/src/utils/signature.ts +24 -0
@@ -188,38 +188,71 @@ export async function expireDisputeBatch(args: {
188
188
  }
189
189
 
190
190
  // Overload: returnTxInfo is true → returns TransactionRequest
191
- export async function resolveDispute(args: {
192
- exchangeId: BigNumberish;
193
- buyerPercentBasisPoints: BigNumberish;
194
- sigR: BytesLike;
195
- sigS: BytesLike;
196
- sigV: BigNumberish;
197
- contractAddress: string;
198
- web3Lib: Web3LibAdapter;
199
- returnTxInfo: true;
200
- }): Promise<TransactionRequest>;
191
+ export async function resolveDispute(
192
+ args:
193
+ | {
194
+ exchangeId: BigNumberish;
195
+ buyerPercentBasisPoints: BigNumberish;
196
+ sigR: BytesLike;
197
+ sigS: BytesLike;
198
+ sigV: BigNumberish;
199
+ contractAddress: string;
200
+ web3Lib: Web3LibAdapter;
201
+ returnTxInfo: true;
202
+ }
203
+ | {
204
+ exchangeId: BigNumberish;
205
+ buyerPercentBasisPoints: BigNumberish;
206
+ signature: string;
207
+ contractAddress: string;
208
+ web3Lib: Web3LibAdapter;
209
+ returnTxInfo: true;
210
+ }
211
+ ): Promise<TransactionRequest>;
201
212
  // Overload: returnTxInfo is false or undefined → returns TransactionResponse
202
- export async function resolveDispute(args: {
203
- exchangeId: BigNumberish;
204
- buyerPercentBasisPoints: BigNumberish;
205
- sigR: BytesLike;
206
- sigS: BytesLike;
207
- sigV: BigNumberish;
208
- contractAddress: string;
209
- web3Lib: Web3LibAdapter;
210
- returnTxInfo?: false | undefined;
211
- }): Promise<TransactionResponse>;
213
+ export async function resolveDispute(
214
+ args:
215
+ | {
216
+ exchangeId: BigNumberish;
217
+ buyerPercentBasisPoints: BigNumberish;
218
+ sigR: BytesLike;
219
+ sigS: BytesLike;
220
+ sigV: BigNumberish;
221
+ contractAddress: string;
222
+ web3Lib: Web3LibAdapter;
223
+ returnTxInfo?: false | undefined;
224
+ }
225
+ | {
226
+ exchangeId: BigNumberish;
227
+ buyerPercentBasisPoints: BigNumberish;
228
+ signature: string;
229
+ contractAddress: string;
230
+ web3Lib: Web3LibAdapter;
231
+ returnTxInfo?: false | undefined;
232
+ }
233
+ ): Promise<TransactionResponse>;
212
234
  // Implementation
213
- export async function resolveDispute(args: {
214
- exchangeId: BigNumberish;
215
- buyerPercentBasisPoints: BigNumberish;
216
- sigR: BytesLike;
217
- sigS: BytesLike;
218
- sigV: BigNumberish;
219
- contractAddress: string;
220
- web3Lib: Web3LibAdapter;
221
- returnTxInfo?: boolean;
222
- }): Promise<TransactionResponse | TransactionRequest> {
235
+ export async function resolveDispute(
236
+ args:
237
+ | {
238
+ exchangeId: BigNumberish;
239
+ buyerPercentBasisPoints: BigNumberish;
240
+ sigR: BytesLike;
241
+ sigS: BytesLike;
242
+ sigV: BigNumberish;
243
+ contractAddress: string;
244
+ web3Lib: Web3LibAdapter;
245
+ returnTxInfo?: boolean;
246
+ }
247
+ | {
248
+ exchangeId: BigNumberish;
249
+ buyerPercentBasisPoints: BigNumberish;
250
+ signature: string;
251
+ contractAddress: string;
252
+ web3Lib: Web3LibAdapter;
253
+ returnTxInfo?: boolean;
254
+ }
255
+ ): Promise<TransactionResponse | TransactionRequest> {
223
256
  const transactionRequest = {
224
257
  to: args.contractAddress,
225
258
  data: encodeResolveDispute(args)
@@ -2,6 +2,7 @@ import { abis } from "@bosonprotocol/common";
2
2
  import { Interface } from "@ethersproject/abi";
3
3
  import { BigNumberish } from "@ethersproject/bignumber";
4
4
  import { BytesLike } from "@ethersproject/bytes";
5
+ import { rebuildSignature } from "../utils/signature";
5
6
 
6
7
  export const bosonDisputeHandlerIface = new Interface(
7
8
  abis.IBosonDisputeHandlerABI
@@ -63,19 +64,35 @@ export function encodeRefuseEscalatedDispute(exchangeId: BigNumberish) {
63
64
  ]);
64
65
  }
65
66
 
66
- export function encodeResolveDispute(args: {
67
- exchangeId: BigNumberish;
68
- buyerPercentBasisPoints: BigNumberish;
69
- sigR: BytesLike;
70
- sigS: BytesLike;
71
- sigV: BigNumberish;
72
- }) {
67
+ export function encodeResolveDispute(
68
+ args:
69
+ | {
70
+ exchangeId: BigNumberish;
71
+ buyerPercentBasisPoints: BigNumberish;
72
+ sigR: BytesLike;
73
+ sigS: BytesLike;
74
+ sigV: BigNumberish;
75
+ }
76
+ | {
77
+ exchangeId: BigNumberish;
78
+ buyerPercentBasisPoints: BigNumberish;
79
+ signature: string;
80
+ }
81
+ ) {
82
+ let signature: string;
83
+ if (!("signature" in args)) {
84
+ signature = rebuildSignature({
85
+ r: args.sigR.toString(),
86
+ s: args.sigS.toString(),
87
+ v: Number(args.sigV)
88
+ });
89
+ } else {
90
+ signature = args.signature;
91
+ }
73
92
  return bosonDisputeHandlerIface.encodeFunctionData("resolveDispute", [
74
93
  args.exchangeId,
75
94
  args.buyerPercentBasisPoints,
76
- args.sigR,
77
- args.sigS,
78
- args.sigV
95
+ signature
79
96
  ]);
80
97
  }
81
98
 
@@ -254,40 +254,76 @@ export class DisputesMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
254
254
  * - `args.sigV` - v signature value of counterparty.
255
255
  * @returns Transaction response.
256
256
  */
257
- public async resolveDispute(args: {
258
- exchangeId: BigNumberish;
259
- buyerPercentBasisPoints: BigNumberish;
260
- sigR: BytesLike;
261
- sigS: BytesLike;
262
- sigV: BigNumberish;
263
- returnTxInfo: true;
264
- }): Promise<TransactionRequest>;
265
- public async resolveDispute(args: {
266
- exchangeId: BigNumberish;
267
- buyerPercentBasisPoints: BigNumberish;
268
- sigR: BytesLike;
269
- sigS: BytesLike;
270
- sigV: BigNumberish;
271
- returnTxInfo?: false | undefined;
272
- }): Promise<TransactionResponse>;
273
- public async resolveDispute(args: {
274
- exchangeId: BigNumberish;
275
- buyerPercentBasisPoints: BigNumberish;
276
- sigR: BytesLike;
277
- sigS: BytesLike;
278
- sigV: BigNumberish;
279
- returnTxInfo?: boolean;
280
- }): Promise<TransactionResponse | TransactionRequest> {
257
+ public async resolveDispute(
258
+ args:
259
+ | {
260
+ exchangeId: BigNumberish;
261
+ buyerPercentBasisPoints: BigNumberish;
262
+ sigR: BytesLike;
263
+ sigS: BytesLike;
264
+ sigV: BigNumberish;
265
+ returnTxInfo: true;
266
+ }
267
+ | {
268
+ exchangeId: BigNumberish;
269
+ buyerPercentBasisPoints: BigNumberish;
270
+ signature: string;
271
+ returnTxInfo: true;
272
+ }
273
+ ): Promise<TransactionRequest>;
274
+ public async resolveDispute(
275
+ args:
276
+ | {
277
+ exchangeId: BigNumberish;
278
+ buyerPercentBasisPoints: BigNumberish;
279
+ sigR: BytesLike;
280
+ sigS: BytesLike;
281
+ sigV: BigNumberish;
282
+ returnTxInfo?: false | undefined;
283
+ }
284
+ | {
285
+ exchangeId: BigNumberish;
286
+ buyerPercentBasisPoints: BigNumberish;
287
+ signature: string;
288
+ returnTxInfo?: false | undefined;
289
+ }
290
+ ): Promise<TransactionResponse>;
291
+ public async resolveDispute(
292
+ args:
293
+ | {
294
+ exchangeId: BigNumberish;
295
+ buyerPercentBasisPoints: BigNumberish;
296
+ sigR: BytesLike;
297
+ sigS: BytesLike;
298
+ sigV: BigNumberish;
299
+ returnTxInfo?: boolean;
300
+ }
301
+ | {
302
+ exchangeId: BigNumberish;
303
+ buyerPercentBasisPoints: BigNumberish;
304
+ signature: string;
305
+ returnTxInfo?: boolean;
306
+ }
307
+ ): Promise<TransactionResponse | TransactionRequest> {
281
308
  const { returnTxInfo } = args;
282
- const resolveArgs = {
283
- exchangeId: args.exchangeId,
284
- buyerPercentBasisPoints: args.buyerPercentBasisPoints,
285
- sigR: args.sigR,
286
- sigS: args.sigS,
287
- sigV: args.sigV,
288
- contractAddress: this._protocolDiamond,
289
- web3Lib: this._web3Lib
290
- } as const satisfies Parameters<typeof resolveDispute>[0];
309
+ const resolveArgs =
310
+ "signature" in args
311
+ ? {
312
+ exchangeId: args.exchangeId,
313
+ buyerPercentBasisPoints: args.buyerPercentBasisPoints,
314
+ signature: args.signature,
315
+ contractAddress: this._protocolDiamond,
316
+ web3Lib: this._web3Lib
317
+ }
318
+ : ({
319
+ exchangeId: args.exchangeId,
320
+ buyerPercentBasisPoints: args.buyerPercentBasisPoints,
321
+ sigR: args.sigR,
322
+ sigS: args.sigS,
323
+ sigV: args.sigV,
324
+ contractAddress: this._protocolDiamond,
325
+ web3Lib: this._web3Lib
326
+ } as const satisfies Parameters<typeof resolveDispute>[0]);
291
327
 
292
328
  if (returnTxInfo === true) {
293
329
  return resolveDispute({
@@ -6,8 +6,12 @@ export const bosonExchangeHandlerIface = new Interface(
6
6
  abis.IBosonExchangeHandlerABI
7
7
  );
8
8
 
9
+ export const bosonExchangeCommitHandlerIface = new Interface(
10
+ abis.IBosonExchangeCommitHandlerABI
11
+ );
12
+
9
13
  export function encodeCommitToOffer(buyer: string, offerId: BigNumberish) {
10
- return bosonExchangeHandlerIface.encodeFunctionData("commitToOffer", [
14
+ return bosonExchangeCommitHandlerIface.encodeFunctionData("commitToOffer", [
11
15
  buyer,
12
16
  offerId
13
17
  ]);
@@ -18,7 +22,7 @@ export function encodeCommitToConditionalOffer(
18
22
  offerId: BigNumberish,
19
23
  tokenId: BigNumberish
20
24
  ) {
21
- return bosonExchangeHandlerIface.encodeFunctionData(
25
+ return bosonExchangeCommitHandlerIface.encodeFunctionData(
22
26
  "commitToConditionalOffer",
23
27
  [buyer, offerId, tokenId]
24
28
  );
@@ -11,7 +11,7 @@ import { getFunds } from "./subgraph";
11
11
 
12
12
  // Overload: returnTxInfo is true -> returns TransactionRequest
13
13
  export async function depositFunds(args: {
14
- sellerId: BigNumberish;
14
+ entityId: BigNumberish;
15
15
  fundsTokenAddress?: string;
16
16
  fundsAmount: BigNumberish;
17
17
  contractAddress: string;
@@ -21,7 +21,7 @@ export async function depositFunds(args: {
21
21
 
22
22
  // Overload: returnTxInfo is false or undefined -> returns TransactionResponse
23
23
  export async function depositFunds(args: {
24
- sellerId: BigNumberish;
24
+ entityId: BigNumberish;
25
25
  fundsTokenAddress?: string;
26
26
  fundsAmount: BigNumberish;
27
27
  contractAddress: string;
@@ -31,7 +31,7 @@ export async function depositFunds(args: {
31
31
 
32
32
  // Implementation
33
33
  export async function depositFunds(args: {
34
- sellerId: BigNumberish;
34
+ entityId: BigNumberish;
35
35
  fundsTokenAddress?: string;
36
36
  fundsAmount: BigNumberish;
37
37
  contractAddress: string;
@@ -49,7 +49,7 @@ export async function depositFunds(args: {
49
49
  const transactionRequest: TransactionRequest = {
50
50
  to: args.contractAddress,
51
51
  data: encodeDepositFunds(
52
- args.sellerId,
52
+ args.entityId,
53
53
  fundsTokenAddress,
54
54
  args.fundsAmount
55
55
  ),
@@ -5,12 +5,12 @@ import { BigNumberish } from "@ethersproject/bignumber";
5
5
  export const bosonFundsHandlerIface = new Interface(abis.IBosonFundsHandlerABI);
6
6
 
7
7
  export function encodeDepositFunds(
8
- sellerId: BigNumberish,
8
+ entityId: BigNumberish,
9
9
  tokenAddress: string,
10
10
  amount: BigNumberish
11
11
  ) {
12
12
  return bosonFundsHandlerIface.encodeFunctionData("depositFunds", [
13
- sellerId,
13
+ entityId,
14
14
  tokenAddress,
15
15
  amount
16
16
  ]);
@@ -21,8 +21,8 @@ export class FundsMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
21
21
 
22
22
  /**
23
23
  * Deposit funds by calling the `FundsHandlerFacet` contract.
24
- * This transaction only succeeds if there is an existing seller account for connected signer.
25
- * @param sellerId - ID of seller account to deposit funds for.
24
+ * This transaction only succeeds if there is an existing entity account for connected signer.
25
+ * @param entityId - ID of the account to deposit funds for.
26
26
  * @param fundsAmount - Amount of funds.
27
27
  * @param fundsTokenAddress - Address of funds token.
28
28
  * @param overrides - Optional overrides.
@@ -30,7 +30,7 @@ export class FundsMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
30
30
  */
31
31
  // Overload: returnTxInfo is true → returns TransactionRequest
32
32
  public async depositFunds(
33
- sellerId: BigNumberish,
33
+ entityId: BigNumberish,
34
34
  fundsAmount: BigNumberish,
35
35
  fundsTokenAddress: string,
36
36
  overrides: Partial<{
@@ -42,7 +42,7 @@ export class FundsMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
42
42
 
43
43
  // Overload: returnTxInfo is false or undefined → returns TransactionResponse
44
44
  public async depositFunds(
45
- sellerId: BigNumberish,
45
+ entityId: BigNumberish,
46
46
  fundsAmount: BigNumberish,
47
47
  fundsTokenAddress?: string,
48
48
  overrides?: Partial<{
@@ -54,7 +54,7 @@ export class FundsMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
54
54
 
55
55
  // Implementation
56
56
  public async depositFunds(
57
- sellerId: BigNumberish,
57
+ entityId: BigNumberish,
58
58
  fundsAmount: BigNumberish,
59
59
  fundsTokenAddress: string = AddressZero,
60
60
  overrides: Partial<{
@@ -66,7 +66,7 @@ export class FundsMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
66
66
  const { returnTxInfo } = overrides;
67
67
 
68
68
  const depositArgs = {
69
- sellerId,
69
+ entityId,
70
70
  fundsAmount,
71
71
  fundsTokenAddress,
72
72
  web3Lib: this._web3Lib,
@@ -21,7 +21,7 @@ export function createGroupArgsToStructs(
21
21
  return [
22
22
  {
23
23
  id: "0",
24
- sellerId: "0",
24
+ sellerId: args.sellerId,
25
25
  offerIds: args.offerIds
26
26
  },
27
27
  conditionArgsToStructs(args)
@@ -22,14 +22,20 @@ import {
22
22
  encodeOptInToSellerUpdate,
23
23
  encodeUpdateSeller
24
24
  } from "../accounts/interface";
25
- import { bosonExchangeHandlerIface } from "../exchanges/interface";
25
+ import {
26
+ bosonExchangeCommitHandlerIface,
27
+ bosonExchangeHandlerIface
28
+ } from "../exchanges/interface";
26
29
  import {
27
30
  bosonOfferHandlerIface,
28
31
  encodeCreateOffer,
29
32
  encodeCreateOfferBatch,
30
33
  encodeReserveRange
31
34
  } from "../offers/interface";
32
- import { prepareDataSignatureParameters } from "../utils/signature";
35
+ import {
36
+ prepareDataSignatureParameters,
37
+ rebuildSignature
38
+ } from "../utils/signature";
33
39
  import {
34
40
  Biconomy,
35
41
  ForwarderDomainData,
@@ -476,7 +482,7 @@ export async function signMetaTxCreateOffer(
476
482
  return signMetaTx({
477
483
  ...args,
478
484
  functionName:
479
- "createOffer((uint256,uint256,uint256,uint256,uint256,uint256,address,uint8,string,string,bool,uint256,(address[],uint256[])[]),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,uint256,uint256)",
485
+ "createOffer((uint256,uint256,uint256,uint256,uint256,uint256,address,uint8,uint8,string,string,bool,uint256,(address[],uint256[])[],uint256),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),(uint256,address),uint256,uint256)",
480
486
  functionSignature: encodeCreateOffer(args.createOfferArgs)
481
487
  });
482
488
  }
@@ -508,7 +514,7 @@ export async function signMetaTxCreateOfferBatch(
508
514
  return signMetaTx({
509
515
  ...args,
510
516
  functionName:
511
- "createOfferBatch((uint256,uint256,uint256,uint256,uint256,uint256,address,uint8,string,string,bool,uint256,(address[],uint256[])[])[],(uint256,uint256,uint256,uint256)[],(uint256,uint256,uint256)[],uint256[],uint256[],uint256[])",
517
+ "createOfferBatch((uint256,uint256,uint256,uint256,uint256,uint256,address,uint8,uint8,string,string,bool,uint256,(address[],uint256[])[],uint256)[],(uint256,uint256,uint256,uint256)[],(uint256,uint256,uint256)[],(uint256,address)[],uint256[],uint256[])",
512
518
  functionSignature: encodeCreateOfferBatch(args.createOffersArgs)
513
519
  });
514
520
  }
@@ -813,7 +819,7 @@ export async function signMetaTxCreateOfferWithCondition(
813
819
  return signMetaTx({
814
820
  ...args,
815
821
  functionName:
816
- "createOfferWithCondition((uint256,uint256,uint256,uint256,uint256,uint256,address,uint8,string,string,bool,uint256,(address[],uint256[])[]),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),uint256,(uint8,uint8,address,uint8,uint256,uint256,uint256,uint256),uint256,uint256)",
822
+ "createOfferWithCondition((uint256,uint256,uint256,uint256,uint256,uint256,address,uint8,uint8,string,string,bool,uint256,(address[],uint256[])[],uint256),(uint256,uint256,uint256,uint256),(uint256,uint256,uint256),(uint256,address),(uint8,uint8,address,uint8,uint256,uint256,uint256,uint256),uint256,uint256)",
817
823
  functionSignature: encodeCreateOfferWithCondition(
818
824
  args.offerToCreate,
819
825
  args.condition
@@ -871,7 +877,7 @@ export async function signMetaTxCommitToOffer(
871
877
  return {
872
878
  ...signatureParams,
873
879
  functionName,
874
- functionSignature: bosonExchangeHandlerIface.encodeFunctionData(
880
+ functionSignature: bosonExchangeCommitHandlerIface.encodeFunctionData(
875
881
  "commitToOffer",
876
882
  [buyerAddress, args.offerId]
877
883
  )
@@ -931,7 +937,7 @@ export async function signMetaTxCommitToConditionalOffer(
931
937
  return {
932
938
  ...signatureParams,
933
939
  functionName,
934
- functionSignature: bosonExchangeHandlerIface.encodeFunctionData(
940
+ functionSignature: bosonExchangeCommitHandlerIface.encodeFunctionData(
935
941
  "commitToConditionalOffer",
936
942
  [buyerAddress, args.offerId, args.tokenId]
937
943
  )
@@ -999,21 +1005,25 @@ export async function signMetaTxResolveDispute(
999
1005
  args: BaseMetaTxArgs & {
1000
1006
  exchangeId: BigNumberish;
1001
1007
  buyerPercent: BigNumberish;
1002
- counterpartySig: {
1003
- r: string;
1004
- s: string;
1005
- v: number;
1006
- };
1008
+ counterpartySig:
1009
+ | {
1010
+ r: string;
1011
+ s: string;
1012
+ v: number;
1013
+ }
1014
+ | string;
1007
1015
  }
1008
1016
  ): Promise<SignedMetaTx> {
1009
- const functionName = "resolveDispute(uint256,uint256,bytes32,bytes32,uint8)";
1017
+ const functionName = "resolveDispute(uint256,uint256,bytes)";
1018
+ const counterpartySig =
1019
+ typeof args.counterpartySig === "string"
1020
+ ? args.counterpartySig
1021
+ : rebuildSignature(args.counterpartySig);
1010
1022
 
1011
1023
  const disputeResolutionType = [
1012
1024
  { name: "exchangeId", type: "uint256" },
1013
1025
  { name: "buyerPercentBasisPoints", type: "uint256" },
1014
- { name: "sigR", type: "bytes32" },
1015
- { name: "sigS", type: "bytes32" },
1016
- { name: "sigV", type: "uint8" }
1026
+ { name: "signature", type: "bytes" }
1017
1027
  ];
1018
1028
 
1019
1029
  const metaTransactionType = [
@@ -1037,9 +1047,7 @@ export async function signMetaTxResolveDispute(
1037
1047
  disputeResolutionDetails: {
1038
1048
  exchangeId: args.exchangeId.toString(),
1039
1049
  buyerPercentBasisPoints: args.buyerPercent.toString(),
1040
- sigR: args.counterpartySig.r,
1041
- sigS: args.counterpartySig.s,
1042
- sigV: args.counterpartySig.v
1050
+ signature: counterpartySig
1043
1051
  }
1044
1052
  };
1045
1053
 
@@ -1058,13 +1066,7 @@ export async function signMetaTxResolveDispute(
1058
1066
  functionSignature: bosonDisputeHandlerIface.encodeFunctionData(
1059
1067
  // remove params in brackets from string
1060
1068
  functionName.replace(/\(([^)]*)\)[^(]*$/, ""),
1061
- [
1062
- args.exchangeId,
1063
- args.buyerPercent,
1064
- args.counterpartySig.r,
1065
- args.counterpartySig.s,
1066
- args.counterpartySig.v
1067
- ]
1069
+ [args.exchangeId, args.buyerPercent, counterpartySig]
1068
1070
  )
1069
1071
  };
1070
1072
  }
@@ -1147,7 +1149,7 @@ export async function signMetaTxWithdrawFunds(
1147
1149
 
1148
1150
  export async function signMetaTxDepositFunds(
1149
1151
  args: BaseMetaTxArgs & {
1150
- sellerId: BigNumberish;
1152
+ entityId: BigNumberish;
1151
1153
  fundsTokenAddress: string;
1152
1154
  fundsAmount: BigNumberish;
1153
1155
  }
@@ -1166,7 +1168,7 @@ export async function signMetaTxDepositFunds(
1166
1168
  ...args,
1167
1169
  functionName: "depositFunds(uint256,address,uint256)",
1168
1170
  functionSignature: encodeDepositFunds(
1169
- args.sellerId,
1171
+ args.entityId,
1170
1172
  args.fundsTokenAddress,
1171
1173
  args.fundsAmount
1172
1174
  )
@@ -1268,9 +1270,11 @@ export async function relayMetaTransaction(args: {
1268
1270
  metaTx.params.functionName,
1269
1271
  metaTx.params.functionSignature,
1270
1272
  metaTx.params.nonce,
1271
- metaTx.params.sigR,
1272
- metaTx.params.sigS,
1273
- metaTx.params.sigV
1273
+ rebuildSignature({
1274
+ r: metaTx.params.sigR.toString(),
1275
+ s: metaTx.params.sigS.toString(),
1276
+ v: Number(metaTx.params.sigV)
1277
+ })
1274
1278
  ],
1275
1279
  from: metaTx.params.userAddress
1276
1280
  });