@hypercerts-org/marketplace-sdk 0.3.37 → 0.4.0

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 (23) hide show
  1. package/dist/HypercertExchangeClient.d.ts +3 -4
  2. package/dist/abis/IERC20.json +13 -0
  3. package/dist/abis/OrderValidatorV2A.json +13 -0
  4. package/dist/index.cjs.js +249 -217
  5. package/dist/index.esm.js +250 -218
  6. package/dist/typechain/@looksrare/contracts-exchange-v2/contracts/helpers/OrderValidatorV2A.d.ts +5 -1
  7. package/dist/typechain/@looksrare/contracts-libs/contracts/interfaces/generic/IERC20.d.ts +5 -1
  8. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/ExecutionManager__factory.d.ts +1 -1
  9. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol__factory.d.ts +1 -1
  10. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/StrategyManager__factory.d.ts +1 -1
  11. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/TransferSelectorNFT__factory.d.ts +1 -1
  12. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/helpers/OrderValidatorV2A__factory.d.ts +11 -1
  13. package/dist/typechain/factories/@looksrare/contracts-exchange-v2/contracts/helpers/ProtocolHelpers__factory.d.ts +1 -1
  14. package/dist/typechain/factories/@looksrare/contracts-libs/contracts/interfaces/generic/IERC20__factory.d.ts +10 -0
  15. package/dist/typechain/factories/solmate/src/tokens/WETH__factory.d.ts +1 -1
  16. package/dist/typechain/factories/src/contracts/tests/Verifier__factory.d.ts +1 -1
  17. package/dist/types.d.ts +23 -0
  18. package/dist/utils/api.d.ts +50 -23
  19. package/dist/utils/graphl.d.ts +4 -3
  20. package/package.json +3 -5
  21. package/LICENSE-APACHE +0 -10
  22. package/LICENSE-MIT +0 -21
  23. package/dist/utils/hypercerts-database-types.d.ts +0 -568
package/dist/index.esm.js CHANGED
@@ -2,8 +2,7 @@ import { Contract, ZeroAddress, AbiCoder, TypedDataEncoder, keccak256, solidityP
2
2
  import { HypercertExchangeAbi, TransferManagerAbi, OrderValidatorV2AAbi, deployments, asDeployedChain as asDeployedChain$2 } from '@hypercerts-org/contracts';
3
3
  import { MerkleTree } from 'merkletreejs';
4
4
  import { keccak256 as keccak256$1 } from 'js-sha3';
5
- import { createClient } from '@supabase/supabase-js';
6
- import { parseClaimOrFractionId, CONSTANTS } from '@hypercerts-org/sdk';
5
+ import { CONSTANTS } from '@hypercerts-org/sdk';
7
6
 
8
7
  var abiIERC721 = [
9
8
  {
@@ -397,6 +396,20 @@ var abiIERC20 = [
397
396
  stateMutability: "view",
398
397
  type: "function"
399
398
  },
399
+ {
400
+ inputs: [
401
+ ],
402
+ name: "decimals",
403
+ outputs: [
404
+ {
405
+ internalType: "uint8",
406
+ name: "",
407
+ type: "uint8"
408
+ }
409
+ ],
410
+ stateMutability: "view",
411
+ type: "function"
412
+ },
400
413
  {
401
414
  inputs: [
402
415
  ],
@@ -4580,6 +4593,20 @@ var OrderValidatorV2A = [
4580
4593
  stateMutability: "view",
4581
4594
  type: "function"
4582
4595
  },
4596
+ {
4597
+ inputs: [
4598
+ ],
4599
+ name: "royaltyFeeRegistry",
4600
+ outputs: [
4601
+ {
4602
+ internalType: "contract IRoyaltyFeeRegistry",
4603
+ name: "",
4604
+ type: "address"
4605
+ }
4606
+ ],
4607
+ stateMutability: "view",
4608
+ type: "function"
4609
+ },
4583
4610
  {
4584
4611
  inputs: [
4585
4612
  ],
@@ -5006,28 +5033,28 @@ var e$2 = {
5006
5033
  };
5007
5034
 
5008
5035
  class GraphQLError extends Error {
5009
- constructor(e, r, i, n, a, t, l) {
5036
+ constructor(e, r, n, i, t, a, l) {
5010
5037
  super(e);
5011
5038
  this.name = "GraphQLError";
5012
5039
  this.message = e;
5013
- if (a) {
5014
- this.path = a;
5040
+ if (t) {
5041
+ this.path = t;
5015
5042
  }
5016
5043
  if (r) {
5017
5044
  this.nodes = Array.isArray(r) ? r : [ r ];
5018
5045
  }
5019
- if (i) {
5020
- this.source = i;
5021
- }
5022
5046
  if (n) {
5023
- this.positions = n;
5047
+ this.source = n;
5024
5048
  }
5025
- if (t) {
5026
- this.originalError = t;
5049
+ if (i) {
5050
+ this.positions = i;
5051
+ }
5052
+ if (a) {
5053
+ this.originalError = a;
5027
5054
  }
5028
5055
  var o = l;
5029
- if (!o && t) {
5030
- var u = t.extensions;
5056
+ if (!o && a) {
5057
+ var u = a.extensions;
5031
5058
  if (u && "object" == typeof u) {
5032
5059
  o = u;
5033
5060
  }
@@ -5048,60 +5075,60 @@ class GraphQLError extends Error {
5048
5075
  }
5049
5076
  }
5050
5077
 
5051
- var i$1;
5052
-
5053
5078
  var n;
5054
5079
 
5080
+ var i$1;
5081
+
5055
5082
  function error(e) {
5056
- return new GraphQLError(`Syntax Error: Unexpected token at ${n} in ${e}`);
5083
+ return new GraphQLError(`Syntax Error: Unexpected token at ${i$1} in ${e}`);
5057
5084
  }
5058
5085
 
5059
5086
  function advance(e) {
5060
- e.lastIndex = n;
5061
- if (e.test(i$1)) {
5062
- return i$1.slice(n, n = e.lastIndex);
5087
+ e.lastIndex = i$1;
5088
+ if (e.test(n)) {
5089
+ return n.slice(i$1, i$1 = e.lastIndex);
5063
5090
  }
5064
5091
  }
5065
5092
 
5066
- var a = / +(?=[^\s])/y;
5093
+ var t = / +(?=[^\s])/y;
5067
5094
 
5068
5095
  function blockString(e) {
5069
5096
  var r = e.split("\n");
5070
- var i = "";
5071
- var n = 0;
5072
- var t = 0;
5097
+ var n = "";
5098
+ var i = 0;
5099
+ var a = 0;
5073
5100
  var l = r.length - 1;
5074
5101
  for (var o = 0; o < r.length; o++) {
5075
- a.lastIndex = 0;
5076
- if (a.test(r[o])) {
5077
- if (o && (!n || a.lastIndex < n)) {
5078
- n = a.lastIndex;
5102
+ t.lastIndex = 0;
5103
+ if (t.test(r[o])) {
5104
+ if (o && (!i || t.lastIndex < i)) {
5105
+ i = t.lastIndex;
5079
5106
  }
5080
- t = t || o;
5107
+ a = a || o;
5081
5108
  l = o;
5082
5109
  }
5083
5110
  }
5084
- for (var u = t; u <= l; u++) {
5085
- if (u !== t) {
5086
- i += "\n";
5111
+ for (var u = a; u <= l; u++) {
5112
+ if (u !== a) {
5113
+ n += "\n";
5087
5114
  }
5088
- i += r[u].slice(n).replace(/\\"""/g, '"""');
5115
+ n += r[u].slice(i).replace(/\\"""/g, '"""');
5089
5116
  }
5090
- return i;
5117
+ return n;
5091
5118
  }
5092
5119
 
5093
5120
  function ignored() {
5094
- for (var e = 0 | i$1.charCodeAt(n++); 9 === e || 10 === e || 13 === e || 32 === e || 35 === e || 44 === e || 65279 === e; e = 0 | i$1.charCodeAt(n++)) {
5121
+ for (var e = 0 | n.charCodeAt(i$1++); 9 === e || 10 === e || 13 === e || 32 === e || 35 === e || 44 === e || 65279 === e; e = 0 | n.charCodeAt(i$1++)) {
5095
5122
  if (35 === e) {
5096
- while (10 !== (e = i$1.charCodeAt(n++)) && 13 !== e) {}
5123
+ while (10 !== (e = n.charCodeAt(i$1++)) && 13 !== e) {}
5097
5124
  }
5098
5125
  }
5099
- n--;
5126
+ i$1--;
5100
5127
  }
5101
5128
 
5102
- var t = /[_A-Za-z]\w*/y;
5129
+ var a = /[_A-Za-z]\w*/y;
5103
5130
 
5104
- var l$1 = new RegExp("(?:(null|true|false)|\\$(" + t.source + ')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|(' + t.source + "))", "y");
5131
+ var l$1 = new RegExp("(?:(null|true|false)|\\$(" + a.source + ')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|(' + a.source + "))", "y");
5105
5132
 
5106
5133
  var o = function(e) {
5107
5134
  e[e.Const = 1] = "Const";
@@ -5114,39 +5141,39 @@ var o = function(e) {
5114
5141
  return e;
5115
5142
  }(o || {});
5116
5143
 
5117
- var u$1 = /\\/g;
5144
+ var u$1 = /\\/;
5118
5145
 
5119
5146
  function value(e) {
5120
5147
  var r;
5121
- var a;
5122
- l$1.lastIndex = n;
5123
- if (91 === i$1.charCodeAt(n)) {
5124
- n++;
5148
+ var t;
5149
+ l$1.lastIndex = i$1;
5150
+ if (91 === n.charCodeAt(i$1)) {
5151
+ i$1++;
5125
5152
  ignored();
5126
5153
  var d = [];
5127
- while (93 !== i$1.charCodeAt(n)) {
5154
+ while (93 !== n.charCodeAt(i$1)) {
5128
5155
  d.push(value(e));
5129
5156
  }
5130
- n++;
5157
+ i$1++;
5131
5158
  ignored();
5132
5159
  return {
5133
5160
  kind: "ListValue",
5134
5161
  values: d
5135
5162
  };
5136
- } else if (123 === i$1.charCodeAt(n)) {
5137
- n++;
5163
+ } else if (123 === n.charCodeAt(i$1)) {
5164
+ i$1++;
5138
5165
  ignored();
5139
- var v = [];
5140
- while (125 !== i$1.charCodeAt(n)) {
5141
- if (null == (r = advance(t))) {
5166
+ var s = [];
5167
+ while (125 !== n.charCodeAt(i$1)) {
5168
+ if (null == (r = advance(a))) {
5142
5169
  throw error("ObjectField");
5143
5170
  }
5144
5171
  ignored();
5145
- if (58 !== i$1.charCodeAt(n++)) {
5172
+ if (58 !== n.charCodeAt(i$1++)) {
5146
5173
  throw error("ObjectField");
5147
5174
  }
5148
5175
  ignored();
5149
- v.push({
5176
+ s.push({
5150
5177
  kind: "ObjectField",
5151
5178
  name: {
5152
5179
  kind: "Name",
@@ -5155,23 +5182,23 @@ function value(e) {
5155
5182
  value: value(e)
5156
5183
  });
5157
5184
  }
5158
- n++;
5185
+ i$1++;
5159
5186
  ignored();
5160
5187
  return {
5161
5188
  kind: "ObjectValue",
5162
- fields: v
5189
+ fields: s
5163
5190
  };
5164
- } else if (null != (a = l$1.exec(i$1))) {
5165
- n = l$1.lastIndex;
5191
+ } else if (null != (t = l$1.exec(n))) {
5192
+ i$1 = l$1.lastIndex;
5166
5193
  ignored();
5167
- if (null != (r = a[o.Const])) {
5194
+ if (null != (r = t[o.Const])) {
5168
5195
  return "null" === r ? {
5169
5196
  kind: "NullValue"
5170
5197
  } : {
5171
5198
  kind: "BooleanValue",
5172
5199
  value: "true" === r
5173
5200
  };
5174
- } else if (null != (r = a[o.Var])) {
5201
+ } else if (null != (r = t[o.Var])) {
5175
5202
  if (e) {
5176
5203
  throw error("Variable");
5177
5204
  } else {
@@ -5183,12 +5210,12 @@ function value(e) {
5183
5210
  }
5184
5211
  };
5185
5212
  }
5186
- } else if (null != (r = a[o.Int])) {
5187
- var s;
5188
- if (null != (s = a[o.Float])) {
5213
+ } else if (null != (r = t[o.Int])) {
5214
+ var v;
5215
+ if (null != (v = t[o.Float])) {
5189
5216
  return {
5190
5217
  kind: "FloatValue",
5191
- value: r + s
5218
+ value: r + v
5192
5219
  };
5193
5220
  } else {
5194
5221
  return {
@@ -5196,19 +5223,19 @@ function value(e) {
5196
5223
  value: r
5197
5224
  };
5198
5225
  }
5199
- } else if (null != (r = a[o.BlockString])) {
5226
+ } else if (null != (r = t[o.BlockString])) {
5200
5227
  return {
5201
5228
  kind: "StringValue",
5202
5229
  value: blockString(r.slice(3, -3)),
5203
5230
  block: !0
5204
5231
  };
5205
- } else if (null != (r = a[o.String])) {
5232
+ } else if (null != (r = t[o.String])) {
5206
5233
  return {
5207
5234
  kind: "StringValue",
5208
5235
  value: u$1.test(r) ? JSON.parse(r) : r.slice(1, -1),
5209
5236
  block: !1
5210
5237
  };
5211
- } else if (null != (r = a[o.Enum])) {
5238
+ } else if (null != (r = t[o.Enum])) {
5212
5239
  return {
5213
5240
  kind: "EnumValue",
5214
5241
  value: r
@@ -5219,17 +5246,17 @@ function value(e) {
5219
5246
  }
5220
5247
 
5221
5248
  function arguments_(e) {
5222
- if (40 === i$1.charCodeAt(n)) {
5249
+ if (40 === n.charCodeAt(i$1)) {
5223
5250
  var r = [];
5224
- n++;
5251
+ i$1++;
5225
5252
  ignored();
5226
- var a;
5253
+ var t;
5227
5254
  do {
5228
- if (null == (a = advance(t))) {
5255
+ if (null == (t = advance(a))) {
5229
5256
  throw error("Argument");
5230
5257
  }
5231
5258
  ignored();
5232
- if (58 !== i$1.charCodeAt(n++)) {
5259
+ if (58 !== n.charCodeAt(i$1++)) {
5233
5260
  throw error("Argument");
5234
5261
  }
5235
5262
  ignored();
@@ -5237,24 +5264,24 @@ function arguments_(e) {
5237
5264
  kind: "Argument",
5238
5265
  name: {
5239
5266
  kind: "Name",
5240
- value: a
5267
+ value: t
5241
5268
  },
5242
5269
  value: value(e)
5243
5270
  });
5244
- } while (41 !== i$1.charCodeAt(n));
5245
- n++;
5271
+ } while (41 !== n.charCodeAt(i$1));
5272
+ i$1++;
5246
5273
  ignored();
5247
5274
  return r;
5248
5275
  }
5249
5276
  }
5250
5277
 
5251
5278
  function directives(e) {
5252
- if (64 === i$1.charCodeAt(n)) {
5279
+ if (64 === n.charCodeAt(i$1)) {
5253
5280
  var r = [];
5254
- var a;
5281
+ var t;
5255
5282
  do {
5256
- n++;
5257
- if (null == (a = advance(t))) {
5283
+ i$1++;
5284
+ if (null == (t = advance(a))) {
5258
5285
  throw error("Directive");
5259
5286
  }
5260
5287
  ignored();
@@ -5262,11 +5289,11 @@ function directives(e) {
5262
5289
  kind: "Directive",
5263
5290
  name: {
5264
5291
  kind: "Name",
5265
- value: a
5292
+ value: t
5266
5293
  },
5267
5294
  arguments: arguments_(e)
5268
5295
  });
5269
- } while (64 === i$1.charCodeAt(n));
5296
+ } while (64 === n.charCodeAt(i$1));
5270
5297
  return r;
5271
5298
  }
5272
5299
  }
@@ -5274,16 +5301,16 @@ function directives(e) {
5274
5301
  function type() {
5275
5302
  var e;
5276
5303
  var r = 0;
5277
- while (91 === i$1.charCodeAt(n)) {
5304
+ while (91 === n.charCodeAt(i$1)) {
5278
5305
  r++;
5279
- n++;
5306
+ i$1++;
5280
5307
  ignored();
5281
5308
  }
5282
- if (null == (e = advance(t))) {
5309
+ if (null == (e = advance(a))) {
5283
5310
  throw error("NamedType");
5284
5311
  }
5285
5312
  ignored();
5286
- var a = {
5313
+ var t = {
5287
5314
  kind: "NamedType",
5288
5315
  name: {
5289
5316
  kind: "Name",
@@ -5291,47 +5318,47 @@ function type() {
5291
5318
  }
5292
5319
  };
5293
5320
  do {
5294
- if (33 === i$1.charCodeAt(n)) {
5295
- n++;
5321
+ if (33 === n.charCodeAt(i$1)) {
5322
+ i$1++;
5296
5323
  ignored();
5297
- a = {
5324
+ t = {
5298
5325
  kind: "NonNullType",
5299
- type: a
5326
+ type: t
5300
5327
  };
5301
5328
  }
5302
5329
  if (r) {
5303
- if (93 !== i$1.charCodeAt(n++)) {
5330
+ if (93 !== n.charCodeAt(i$1++)) {
5304
5331
  throw error("NamedType");
5305
5332
  }
5306
5333
  ignored();
5307
- a = {
5334
+ t = {
5308
5335
  kind: "ListType",
5309
- type: a
5336
+ type: t
5310
5337
  };
5311
5338
  }
5312
5339
  } while (r--);
5313
- return a;
5340
+ return t;
5314
5341
  }
5315
5342
 
5316
- var d$1 = new RegExp("(?:(\\.{3})|(" + t.source + "))", "y");
5343
+ var d$1 = new RegExp("(?:(\\.{3})|(" + a.source + "))", "y");
5317
5344
 
5318
- var v$1 = function(e) {
5345
+ var s = function(e) {
5319
5346
  e[e.Spread = 1] = "Spread";
5320
5347
  e[e.Name = 2] = "Name";
5321
5348
  return e;
5322
- }(v$1 || {});
5349
+ }(s || {});
5323
5350
 
5324
5351
  function selectionSet() {
5325
5352
  var e = [];
5326
5353
  var r;
5327
- var a;
5354
+ var t;
5328
5355
  do {
5329
- d$1.lastIndex = n;
5330
- if (null != (a = d$1.exec(i$1))) {
5331
- n = d$1.lastIndex;
5332
- if (null != a[v$1.Spread]) {
5356
+ d$1.lastIndex = i$1;
5357
+ if (null != (t = d$1.exec(n))) {
5358
+ i$1 = d$1.lastIndex;
5359
+ if (null != t[s.Spread]) {
5333
5360
  ignored();
5334
- var l = advance(t);
5361
+ var l = advance(a);
5335
5362
  if (null != l && "on" !== l) {
5336
5363
  ignored();
5337
5364
  e.push({
@@ -5345,13 +5372,13 @@ function selectionSet() {
5345
5372
  } else {
5346
5373
  ignored();
5347
5374
  if ("on" === l) {
5348
- if (null == (l = advance(t))) {
5375
+ if (null == (l = advance(a))) {
5349
5376
  throw error("NamedType");
5350
5377
  }
5351
5378
  ignored();
5352
5379
  }
5353
5380
  var o = directives(!1);
5354
- if (123 !== i$1.charCodeAt(n++)) {
5381
+ if (123 !== n.charCodeAt(i$1++)) {
5355
5382
  throw error("InlineFragment");
5356
5383
  }
5357
5384
  ignored();
@@ -5368,24 +5395,24 @@ function selectionSet() {
5368
5395
  selectionSet: selectionSet()
5369
5396
  });
5370
5397
  }
5371
- } else if (null != (r = a[v$1.Name])) {
5398
+ } else if (null != (r = t[s.Name])) {
5372
5399
  var u = void 0;
5373
5400
  ignored();
5374
- if (58 === i$1.charCodeAt(n)) {
5375
- n++;
5401
+ if (58 === n.charCodeAt(i$1)) {
5402
+ i$1++;
5376
5403
  ignored();
5377
5404
  u = r;
5378
- if (null == (r = advance(t))) {
5405
+ if (null == (r = advance(a))) {
5379
5406
  throw error("Field");
5380
5407
  }
5381
5408
  ignored();
5382
5409
  }
5383
- var s = arguments_(!1);
5410
+ var v = arguments_(!1);
5384
5411
  ignored();
5385
5412
  var c = directives(!1);
5386
5413
  var f = void 0;
5387
- if (123 === i$1.charCodeAt(n)) {
5388
- n++;
5414
+ if (123 === n.charCodeAt(i$1)) {
5415
+ i$1++;
5389
5416
  ignored();
5390
5417
  f = selectionSet();
5391
5418
  }
@@ -5399,7 +5426,7 @@ function selectionSet() {
5399
5426
  kind: "Name",
5400
5427
  value: r
5401
5428
  },
5402
- arguments: s,
5429
+ arguments: v,
5403
5430
  directives: c,
5404
5431
  selectionSet: f
5405
5432
  });
@@ -5407,8 +5434,8 @@ function selectionSet() {
5407
5434
  } else {
5408
5435
  throw error("SelectionSet");
5409
5436
  }
5410
- } while (125 !== i$1.charCodeAt(n));
5411
- n++;
5437
+ } while (125 !== n.charCodeAt(i$1));
5438
+ i$1++;
5412
5439
  ignored();
5413
5440
  return {
5414
5441
  kind: "SelectionSet",
@@ -5419,20 +5446,20 @@ function selectionSet() {
5419
5446
  function fragmentDefinition() {
5420
5447
  var e;
5421
5448
  var r;
5422
- if (null == (e = advance(t))) {
5449
+ if (null == (e = advance(a))) {
5423
5450
  throw error("FragmentDefinition");
5424
5451
  }
5425
5452
  ignored();
5426
- if ("on" !== advance(t)) {
5453
+ if ("on" !== advance(a)) {
5427
5454
  throw error("FragmentDefinition");
5428
5455
  }
5429
5456
  ignored();
5430
- if (null == (r = advance(t))) {
5457
+ if (null == (r = advance(a))) {
5431
5458
  throw error("FragmentDefinition");
5432
5459
  }
5433
5460
  ignored();
5434
- var a = directives(!1);
5435
- if (123 !== i$1.charCodeAt(n++)) {
5461
+ var t = directives(!1);
5462
+ if (123 !== n.charCodeAt(i$1++)) {
5436
5463
  throw error("FragmentDefinition");
5437
5464
  }
5438
5465
  ignored();
@@ -5449,43 +5476,43 @@ function fragmentDefinition() {
5449
5476
  value: r
5450
5477
  }
5451
5478
  },
5452
- directives: a,
5479
+ directives: t,
5453
5480
  selectionSet: selectionSet()
5454
5481
  };
5455
5482
  }
5456
5483
 
5457
- var s = /(?:query|mutation|subscription|fragment)/y;
5484
+ var v$1 = /(?:query|mutation|subscription|fragment)/y;
5458
5485
 
5459
5486
  function operationDefinition(e) {
5460
5487
  var r;
5461
- var a;
5488
+ var t;
5462
5489
  var l;
5463
5490
  if (e) {
5464
5491
  ignored();
5465
- r = advance(t);
5466
- a = function variableDefinitions() {
5492
+ r = advance(a);
5493
+ t = function variableDefinitions() {
5467
5494
  ignored();
5468
- if (40 === i$1.charCodeAt(n)) {
5495
+ if (40 === n.charCodeAt(i$1)) {
5469
5496
  var e = [];
5470
- n++;
5497
+ i$1++;
5471
5498
  ignored();
5472
5499
  var r;
5473
5500
  do {
5474
- if (36 !== i$1.charCodeAt(n++)) {
5501
+ if (36 !== n.charCodeAt(i$1++)) {
5475
5502
  throw error("Variable");
5476
5503
  }
5477
- if (null == (r = advance(t))) {
5504
+ if (null == (r = advance(a))) {
5478
5505
  throw error("Variable");
5479
5506
  }
5480
5507
  ignored();
5481
- if (58 !== i$1.charCodeAt(n++)) {
5508
+ if (58 !== n.charCodeAt(i$1++)) {
5482
5509
  throw error("VariableDefinition");
5483
5510
  }
5484
5511
  ignored();
5485
- var a = type();
5512
+ var t = type();
5486
5513
  var l = void 0;
5487
- if (61 === i$1.charCodeAt(n)) {
5488
- n++;
5514
+ if (61 === n.charCodeAt(i$1)) {
5515
+ i$1++;
5489
5516
  ignored();
5490
5517
  l = value(!0);
5491
5518
  }
@@ -5499,20 +5526,20 @@ function operationDefinition(e) {
5499
5526
  value: r
5500
5527
  }
5501
5528
  },
5502
- type: a,
5529
+ type: t,
5503
5530
  defaultValue: l,
5504
5531
  directives: directives(!0)
5505
5532
  });
5506
- } while (41 !== i$1.charCodeAt(n));
5507
- n++;
5533
+ } while (41 !== n.charCodeAt(i$1));
5534
+ i$1++;
5508
5535
  ignored();
5509
5536
  return e;
5510
5537
  }
5511
5538
  }();
5512
5539
  l = directives(!1);
5513
5540
  }
5514
- if (123 === i$1.charCodeAt(n)) {
5515
- n++;
5541
+ if (123 === n.charCodeAt(i$1)) {
5542
+ i$1++;
5516
5543
  ignored();
5517
5544
  return {
5518
5545
  kind: "OperationDefinition",
@@ -5521,7 +5548,7 @@ function operationDefinition(e) {
5521
5548
  kind: "Name",
5522
5549
  value: r
5523
5550
  } : void 0,
5524
- variableDefinitions: a,
5551
+ variableDefinitions: t,
5525
5552
  directives: l,
5526
5553
  selectionSet: selectionSet()
5527
5554
  };
@@ -5529,39 +5556,67 @@ function operationDefinition(e) {
5529
5556
  }
5530
5557
 
5531
5558
  function parse(e, r) {
5532
- i$1 = "string" == typeof e.body ? e.body : e;
5533
- n = 0;
5534
- return function document() {
5535
- var e;
5536
- var r;
5559
+ i$1 = 0;
5560
+ return function document(e, r) {
5561
+ var n;
5562
+ var t;
5537
5563
  ignored();
5538
5564
  var a = [];
5539
5565
  do {
5540
- if ("fragment" === (e = advance(s))) {
5566
+ if ("fragment" === (n = advance(v$1))) {
5541
5567
  ignored();
5542
5568
  a.push(fragmentDefinition());
5543
- } else if (null != (r = operationDefinition(e))) {
5544
- a.push(r);
5569
+ } else if (null != (t = operationDefinition(n))) {
5570
+ a.push(t);
5545
5571
  } else {
5546
5572
  throw error("Document");
5547
5573
  }
5548
- } while (n < i$1.length);
5574
+ } while (i$1 < e.length);
5575
+ if (!r) {
5576
+ var l;
5577
+ return {
5578
+ kind: "Document",
5579
+ definitions: a,
5580
+ set loc(e) {
5581
+ l = e;
5582
+ },
5583
+ get loc() {
5584
+ if (!l) {
5585
+ l = {
5586
+ start: 0,
5587
+ end: e.length,
5588
+ startToken: void 0,
5589
+ endToken: void 0,
5590
+ source: {
5591
+ body: e,
5592
+ name: "graphql.web",
5593
+ locationOffset: {
5594
+ line: 1,
5595
+ column: 1
5596
+ }
5597
+ }
5598
+ };
5599
+ }
5600
+ return l;
5601
+ }
5602
+ };
5603
+ }
5549
5604
  return {
5550
5605
  kind: "Document",
5551
5606
  definitions: a
5552
5607
  };
5553
- }();
5608
+ }(n = "string" == typeof e.body ? e.body : e, r && r.noLocation);
5554
5609
  }
5555
5610
 
5556
- function mapJoin(e, r, i) {
5557
- var n = "";
5558
- for (var a = 0; a < e.length; a++) {
5559
- if (a) {
5560
- n += r;
5611
+ function mapJoin(e, r, n) {
5612
+ var i = "";
5613
+ for (var t = 0; t < e.length; t++) {
5614
+ if (t) {
5615
+ i += r;
5561
5616
  }
5562
- n += i(e[a]);
5617
+ i += n(e[t]);
5563
5618
  }
5564
- return n;
5619
+ return i;
5565
5620
  }
5566
5621
 
5567
5622
  function printString(e) {
@@ -5574,7 +5629,7 @@ function printBlockString(e) {
5574
5629
 
5575
5630
  var f$1 = "\n";
5576
5631
 
5577
- var m$1 = {
5632
+ var g = {
5578
5633
  OperationDefinition(e) {
5579
5634
  var r = e.operation;
5580
5635
  if (e.name) {
@@ -5584,38 +5639,38 @@ var m$1 = {
5584
5639
  if (!e.name) {
5585
5640
  r += " ";
5586
5641
  }
5587
- r += "(" + mapJoin(e.variableDefinitions, ", ", m$1.VariableDefinition) + ")";
5642
+ r += "(" + mapJoin(e.variableDefinitions, ", ", g.VariableDefinition) + ")";
5588
5643
  }
5589
5644
  if (e.directives && e.directives.length) {
5590
- r += " " + mapJoin(e.directives, " ", m$1.Directive);
5645
+ r += " " + mapJoin(e.directives, " ", g.Directive);
5591
5646
  }
5592
- return "query" !== r ? r + " " + m$1.SelectionSet(e.selectionSet) : m$1.SelectionSet(e.selectionSet);
5647
+ return "query" !== r ? r + " " + g.SelectionSet(e.selectionSet) : g.SelectionSet(e.selectionSet);
5593
5648
  },
5594
5649
  VariableDefinition(e) {
5595
- var r = m$1.Variable(e.variable) + ": " + _print(e.type);
5650
+ var r = g.Variable(e.variable) + ": " + _print(e.type);
5596
5651
  if (e.defaultValue) {
5597
5652
  r += " = " + _print(e.defaultValue);
5598
5653
  }
5599
5654
  if (e.directives && e.directives.length) {
5600
- r += " " + mapJoin(e.directives, " ", m$1.Directive);
5655
+ r += " " + mapJoin(e.directives, " ", g.Directive);
5601
5656
  }
5602
5657
  return r;
5603
5658
  },
5604
5659
  Field(e) {
5605
5660
  var r = e.alias ? e.alias.value + ": " + e.name.value : e.name.value;
5606
5661
  if (e.arguments && e.arguments.length) {
5607
- var i = mapJoin(e.arguments, ", ", m$1.Argument);
5608
- if (r.length + i.length + 2 > 80) {
5609
- r += "(" + (f$1 += " ") + mapJoin(e.arguments, f$1, m$1.Argument) + (f$1 = f$1.slice(0, -2)) + ")";
5662
+ var n = mapJoin(e.arguments, ", ", g.Argument);
5663
+ if (r.length + n.length + 2 > 80) {
5664
+ r += "(" + (f$1 += " ") + mapJoin(e.arguments, f$1, g.Argument) + (f$1 = f$1.slice(0, -2)) + ")";
5610
5665
  } else {
5611
- r += "(" + i + ")";
5666
+ r += "(" + n + ")";
5612
5667
  }
5613
5668
  }
5614
5669
  if (e.directives && e.directives.length) {
5615
- r += " " + mapJoin(e.directives, " ", m$1.Directive);
5670
+ r += " " + mapJoin(e.directives, " ", g.Directive);
5616
5671
  }
5617
- if (e.selectionSet) {
5618
- r += " " + m$1.SelectionSet(e.selectionSet);
5672
+ if (e.selectionSet && e.selectionSet.selections.length) {
5673
+ r += " " + g.SelectionSet(e.selectionSet);
5619
5674
  }
5620
5675
  return r;
5621
5676
  },
@@ -5634,7 +5689,7 @@ var m$1 = {
5634
5689
  Name: e => e.value,
5635
5690
  Variable: e => "$" + e.name.value,
5636
5691
  ListValue: e => "[" + mapJoin(e.values, ", ", _print) + "]",
5637
- ObjectValue: e => "{" + mapJoin(e.fields, ", ", m$1.ObjectField) + "}",
5692
+ ObjectValue: e => "{" + mapJoin(e.fields, ", ", g.ObjectField) + "}",
5638
5693
  ObjectField: e => e.name.value + ": " + _print(e.value),
5639
5694
  Document(e) {
5640
5695
  if (!e.definitions || !e.definitions.length) {
@@ -5647,7 +5702,7 @@ var m$1 = {
5647
5702
  FragmentSpread(e) {
5648
5703
  var r = "..." + e.name.value;
5649
5704
  if (e.directives && e.directives.length) {
5650
- r += " " + mapJoin(e.directives, " ", m$1.Directive);
5705
+ r += " " + mapJoin(e.directives, " ", g.Directive);
5651
5706
  }
5652
5707
  return r;
5653
5708
  },
@@ -5657,22 +5712,22 @@ var m$1 = {
5657
5712
  r += " on " + e.typeCondition.name.value;
5658
5713
  }
5659
5714
  if (e.directives && e.directives.length) {
5660
- r += " " + mapJoin(e.directives, " ", m$1.Directive);
5715
+ r += " " + mapJoin(e.directives, " ", g.Directive);
5661
5716
  }
5662
- return r += " " + m$1.SelectionSet(e.selectionSet);
5717
+ return r += " " + g.SelectionSet(e.selectionSet);
5663
5718
  },
5664
5719
  FragmentDefinition(e) {
5665
5720
  var r = "fragment " + e.name.value;
5666
5721
  r += " on " + e.typeCondition.name.value;
5667
5722
  if (e.directives && e.directives.length) {
5668
- r += " " + mapJoin(e.directives, " ", m$1.Directive);
5723
+ r += " " + mapJoin(e.directives, " ", g.Directive);
5669
5724
  }
5670
- return r + " " + m$1.SelectionSet(e.selectionSet);
5725
+ return r + " " + g.SelectionSet(e.selectionSet);
5671
5726
  },
5672
5727
  Directive(e) {
5673
5728
  var r = "@" + e.name.value;
5674
5729
  if (e.arguments && e.arguments.length) {
5675
- r += "(" + mapJoin(e.arguments, ", ", m$1.Argument) + ")";
5730
+ r += "(" + mapJoin(e.arguments, ", ", g.Argument) + ")";
5676
5731
  }
5677
5732
  return r;
5678
5733
  },
@@ -5681,11 +5736,11 @@ var m$1 = {
5681
5736
  NonNullType: e => _print(e.type) + "!"
5682
5737
  };
5683
5738
 
5684
- var _print = e => m$1[e.kind](e);
5739
+ var _print = e => g[e.kind](e);
5685
5740
 
5686
5741
  function print(e) {
5687
5742
  f$1 = "\n";
5688
- return m$1[e.kind] ? m$1[e.kind](e) : "";
5743
+ return g[e.kind] ? g[e.kind](e) : "";
5689
5744
  }
5690
5745
 
5691
5746
  function initGraphQLTada() {
@@ -5723,7 +5778,7 @@ function initGraphQLTada() {
5723
5778
 
5724
5779
  var e$1 = initGraphQLTada();
5725
5780
 
5726
- const fractionsByIdQuery = e$1(`
5781
+ e$1(`
5727
5782
  query fractionsById($fraction_id: String!) {
5728
5783
  fractions(where: { hypercert_id: { eq: $fraction_id } }) {
5729
5784
  data {
@@ -5736,20 +5791,9 @@ const fractionsByIdQuery = e$1(`
5736
5791
  }
5737
5792
  }
5738
5793
  `);
5739
- const getFractionsById = async (fractionId, client) => {
5740
- const { data, error } = await client
5741
- .query(fractionsByIdQuery, {
5742
- fraction_id: fractionId,
5743
- })
5744
- .toPromise();
5745
- if (error) {
5746
- throw new Error(error.message);
5747
- }
5748
- return data?.fractions.data;
5749
- };
5750
5794
  const ordersQuery = e$1(`
5751
- query OrdersQuery($chainId: BigInt, $signer: String) {
5752
- orders(where: { chainId: { eq: $chainId }, signer: { eq: $signer } }) {
5795
+ query OrdersQuery($where: OrderWhereInput) {
5796
+ orders(where: $where) {
5753
5797
  count
5754
5798
  data {
5755
5799
  id
@@ -5805,11 +5849,20 @@ const ordersQuery = e$1(`
5805
5849
  }
5806
5850
  }
5807
5851
  `);
5808
- const getOrders = async ({ chainId, signer }, client) => {
5852
+ const getOrders = async (filter, client) => {
5853
+ const where = {};
5854
+ if (filter?.chainId) {
5855
+ where.chainId = { eq: filter.chainId.toString() };
5856
+ }
5857
+ if (filter?.signer) {
5858
+ where.signer = { eq: filter.signer };
5859
+ }
5860
+ if (filter?.hypercertId) {
5861
+ where.hypercert_id = { eq: filter.hypercertId };
5862
+ }
5809
5863
  const { data, error } = await client
5810
5864
  .query(ordersQuery, {
5811
- chainId,
5812
- signer,
5865
+ where,
5813
5866
  })
5814
5867
  .toPromise();
5815
5868
  if (error) {
@@ -6616,7 +6669,9 @@ var keyDocument = e => {
6616
6669
  var a;
6617
6670
  if ("string" == typeof e) {
6618
6671
  r = hashDocument(e);
6619
- a = u.get(r) || parse(e);
6672
+ a = u.get(r) || parse(e, {
6673
+ noLocation: !0
6674
+ });
6620
6675
  } else {
6621
6676
  r = e.__key || hashDocument(e);
6622
6677
  a = u.get(r) || e;
@@ -7544,10 +7599,6 @@ var C = function Client(e) {
7544
7599
  return p;
7545
7600
  };
7546
7601
 
7547
- const SUPABASE_HYPERCERTS_DATA_STAGING_URL = "https://zgvoyckkistexkfdmjqc.supabase.co";
7548
- const SUPABASE_HYPERCERTS_DATA_STAGING_ANON_KEY_STAGING = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inpndm95Y2traXN0ZXhrZmRtanFjIiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTc4ODM1MjAsImV4cCI6MjAxMzQ1OTUyMH0.6FWDhwP3ZOM1O3ObvyRKtOsvwhJjbrZL2B1N-0MSpFg";
7549
- const SUPABASE_HYPERCERTS_DATA_PRODUCTION_URL = "https://ueebbafxdbglaqtyslwv.supabase.co";
7550
- const SUPABASE_HYPERCERTS_DATA_PRODUCTION_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVlZWJiYWZ4ZGJnbGFxdHlzbHd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTc1NTA1MzUsImV4cCI6MjAxMzEyNjUzNX0.mhClRFe8QL6IQLMvTXjdprR6agr_OXF9g2CUJBww4mE";
7551
7602
  class ApiClient {
7552
7603
  constructor(indexerEnvironment, baseUrl) {
7553
7604
  this.baseUrl = baseUrl;
@@ -7603,20 +7654,7 @@ class ApiClient {
7603
7654
  * @param chainId chain id for the order
7604
7655
  * @param strategy strategy for the order
7605
7656
  */
7606
- this.fetchOrders = async ({ signer, claimTokenIds, chainId, strategy }) => {
7607
- let baseQuery = this._supabaseHypercerts.from("marketplace_orders").select("*");
7608
- if (signer) {
7609
- baseQuery.eq("signer", signer);
7610
- }
7611
- if (claimTokenIds) {
7612
- baseQuery = baseQuery.overlaps("itemIds", claimTokenIds);
7613
- }
7614
- if (chainId) {
7615
- baseQuery.eq("chainId", chainId);
7616
- }
7617
- if (strategy) {
7618
- baseQuery.eq("strategyId", strategy);
7619
- }
7657
+ this.fetchOrders = async ({ signer, chainId }) => {
7620
7658
  return await getOrders({ signer, chainId: chainId ? BigInt(chainId) : undefined }, this._urqlClient);
7621
7659
  };
7622
7660
  /**
@@ -7625,10 +7663,7 @@ class ApiClient {
7625
7663
  * @param chainId Chain ID
7626
7664
  */
7627
7665
  this.fetchOrdersByHypercertId = async ({ hypercertId }) => {
7628
- const fractions = await getFractionsById(hypercertId, this._urqlClient);
7629
- const tokenIds = fractions?.flatMap(() => fractions.map((fraction) => parseClaimOrFractionId(fraction.fraction_id).id)) || [];
7630
- const result = await this._supabaseHypercerts.from("marketplace_orders").select("*").overlaps("itemIds", tokenIds);
7631
- return result;
7666
+ return getOrders({ hypercertId }, this._urqlClient);
7632
7667
  };
7633
7668
  this.handleResponse = async (res) => {
7634
7669
  if (!res.ok) {
@@ -7674,9 +7709,6 @@ class ApiClient {
7674
7709
  url: `${CONSTANTS.ENDPOINTS[indexerEnvironment]}/v1/graphql`,
7675
7710
  exchanges: [cacheExchange, fetchExchange],
7676
7711
  });
7677
- this._supabaseHypercerts = createClient(indexerEnvironment === "test" ? SUPABASE_HYPERCERTS_DATA_STAGING_URL : SUPABASE_HYPERCERTS_DATA_PRODUCTION_URL, indexerEnvironment === "test"
7678
- ? SUPABASE_HYPERCERTS_DATA_STAGING_ANON_KEY_STAGING
7679
- : SUPABASE_HYPERCERTS_DATA_PRODUCTION_ANON_KEY);
7680
7712
  }
7681
7713
  }
7682
7714