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