@hypercerts-org/marketplace-sdk 0.3.12 → 0.3.14

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.
@@ -1,516 +1,10 @@
1
1
  import { Maker, QuoteType, StrategyType } from "../types";
2
- import { Database as HypercertsDatabase } from "./hypercerts-database-types";
3
- export declare const supabaseHypercerts: import("@supabase/supabase-js").SupabaseClient<HypercertsDatabase, "public", {
4
- Tables: {
5
- blueprints: {
6
- Row: {
7
- admin_id: string;
8
- created_at: string;
9
- display_size: number;
10
- form_values: import("./hypercerts-database-types").Json;
11
- id: number;
12
- minter_address: string;
13
- registry_id: string;
14
- };
15
- Insert: {
16
- admin_id: string;
17
- created_at?: string | undefined;
18
- display_size?: number | undefined;
19
- form_values: import("./hypercerts-database-types").Json;
20
- id?: number | undefined;
21
- minter_address: string;
22
- registry_id: string;
23
- };
24
- Update: {
25
- admin_id?: string | undefined;
26
- created_at?: string | undefined;
27
- display_size?: number | undefined;
28
- form_values?: import("./hypercerts-database-types").Json | undefined;
29
- id?: number | undefined;
30
- minter_address?: string | undefined;
31
- registry_id?: string | undefined;
32
- };
33
- Relationships: [{
34
- foreignKeyName: "blueprints_admin_id_fkey";
35
- columns: ["admin_id"];
36
- isOneToOne: false;
37
- referencedRelation: "users";
38
- referencedColumns: ["address"];
39
- }, {
40
- foreignKeyName: "blueprints_registry_id_fkey";
41
- columns: ["registry_id"];
42
- isOneToOne: false;
43
- referencedRelation: "registries";
44
- referencedColumns: ["id"];
45
- }];
46
- };
47
- claims: {
48
- Row: {
49
- admin_id: string;
50
- chain_id: number;
51
- created_at: string;
52
- display_size: number;
53
- hypercert_id: string;
54
- id: string;
55
- owner_id: string;
56
- registry_id: string;
57
- };
58
- Insert: {
59
- admin_id: string;
60
- chain_id: number;
61
- created_at?: string | undefined;
62
- display_size?: number | undefined;
63
- hypercert_id: string;
64
- id?: string | undefined;
65
- owner_id: string;
66
- registry_id: string;
67
- };
68
- Update: {
69
- admin_id?: string | undefined;
70
- chain_id?: number | undefined;
71
- created_at?: string | undefined;
72
- display_size?: number | undefined;
73
- hypercert_id?: string | undefined;
74
- id?: string | undefined;
75
- owner_id?: string | undefined;
76
- registry_id?: string | undefined;
77
- };
78
- Relationships: [{
79
- foreignKeyName: "claims_registry_id_fkey";
80
- columns: ["registry_id"];
81
- isOneToOne: false;
82
- referencedRelation: "registries";
83
- referencedColumns: ["id"];
84
- }];
85
- };
86
- default_sponsor_metadata: {
87
- Row: {
88
- address: string;
89
- companyName: string | null;
90
- created_at: string;
91
- firstName: string | null;
92
- image: string;
93
- lastName: string | null;
94
- type: string;
95
- };
96
- Insert: {
97
- address: string;
98
- companyName?: string | null | undefined;
99
- created_at?: string | undefined;
100
- firstName?: string | null | undefined;
101
- image: string;
102
- lastName?: string | null | undefined;
103
- type: string;
104
- };
105
- Update: {
106
- address?: string | undefined;
107
- companyName?: string | null | undefined;
108
- created_at?: string | undefined;
109
- firstName?: string | null | undefined;
110
- image?: string | undefined;
111
- lastName?: string | null | undefined;
112
- type?: string | undefined;
113
- };
114
- Relationships: [];
115
- };
116
- fraction_sponsor_metadata: {
117
- Row: {
118
- chain_id: number;
119
- companyName: string | null;
120
- created_at: string;
121
- firstName: string | null;
122
- fraction_id: string;
123
- hypercert_id: string;
124
- id: string;
125
- image: string;
126
- lastName: string | null;
127
- strategy: string;
128
- type: string;
129
- value: string;
130
- };
131
- Insert: {
132
- chain_id: number;
133
- companyName?: string | null | undefined;
134
- created_at?: string | undefined;
135
- firstName?: string | null | undefined;
136
- fraction_id: string;
137
- hypercert_id: string;
138
- id?: string | undefined;
139
- image: string;
140
- lastName?: string | null | undefined;
141
- strategy: string;
142
- type: string;
143
- value: string;
144
- };
145
- Update: {
146
- chain_id?: number | undefined;
147
- companyName?: string | null | undefined;
148
- created_at?: string | undefined;
149
- firstName?: string | null | undefined;
150
- fraction_id?: string | undefined;
151
- hypercert_id?: string | undefined;
152
- id?: string | undefined;
153
- image?: string | undefined;
154
- lastName?: string | null | undefined;
155
- strategy?: string | undefined;
156
- type?: string | undefined;
157
- value?: string | undefined;
158
- };
159
- Relationships: [];
160
- };
161
- hyperboard_registries: {
162
- Row: {
163
- created_at: string | null;
164
- hyperboard_id: string;
165
- label: string | null;
166
- registry_id: string;
167
- render_method: string;
168
- };
169
- Insert: {
170
- created_at?: string | null | undefined;
171
- hyperboard_id: string;
172
- label?: string | null | undefined;
173
- registry_id: string;
174
- render_method?: string | undefined;
175
- };
176
- Update: {
177
- created_at?: string | null | undefined;
178
- hyperboard_id?: string | undefined;
179
- label?: string | null | undefined;
180
- registry_id?: string | undefined;
181
- render_method?: string | undefined;
182
- };
183
- Relationships: [{
184
- foreignKeyName: "hyperboard_registries_hyperboard_id_fkey";
185
- columns: ["hyperboard_id"];
186
- isOneToOne: false;
187
- referencedRelation: "hyperboards";
188
- referencedColumns: ["id"];
189
- }, {
190
- foreignKeyName: "hyperboard_registries_registries_id_fk";
191
- columns: ["registry_id"];
192
- isOneToOne: false;
193
- referencedRelation: "registries";
194
- referencedColumns: ["id"];
195
- }];
196
- };
197
- hyperboards: {
198
- Row: {
199
- admin_id: string;
200
- background_image: string | null;
201
- chain_id: number;
202
- created_at: string | null;
203
- grayscale_images: boolean;
204
- id: string;
205
- name: string;
206
- tile_border_color: string | null;
207
- };
208
- Insert: {
209
- admin_id: string;
210
- background_image?: string | null | undefined;
211
- chain_id: number;
212
- created_at?: string | null | undefined;
213
- grayscale_images?: boolean | undefined;
214
- id?: string | undefined;
215
- name: string;
216
- tile_border_color?: string | null | undefined;
217
- };
218
- Update: {
219
- admin_id?: string | undefined;
220
- background_image?: string | null | undefined;
221
- chain_id?: number | undefined;
222
- created_at?: string | null | undefined;
223
- grayscale_images?: boolean | undefined;
224
- id?: string | undefined;
225
- name?: string | undefined;
226
- tile_border_color?: string | null | undefined;
227
- };
228
- Relationships: [];
229
- };
230
- marketplace_order_nonces: {
231
- Row: {
232
- address: string;
233
- chain_id: number;
234
- created_at: string;
235
- nonce_counter: number;
236
- };
237
- Insert: {
238
- address: string;
239
- chain_id: number;
240
- created_at?: string | undefined;
241
- nonce_counter?: number | undefined;
242
- };
243
- Update: {
244
- address?: string | undefined;
245
- chain_id?: number | undefined;
246
- created_at?: string | undefined;
247
- nonce_counter?: number | undefined;
248
- };
249
- Relationships: [];
250
- };
251
- marketplace_orders: {
252
- Row: {
253
- additionalParameters: string;
254
- amounts: number[];
255
- chainId: number;
256
- collection: string;
257
- collectionType: number;
258
- createdAt: string;
259
- currency: string;
260
- endTime: number;
261
- globalNonce: string;
262
- id: string;
263
- invalidated: boolean;
264
- itemIds: string[];
265
- orderNonce: string;
266
- price: string;
267
- quoteType: number;
268
- signature: string;
269
- signer: string;
270
- startTime: number;
271
- strategyId: number;
272
- subsetNonce: number;
273
- validator_codes: number[] | null;
274
- };
275
- Insert: {
276
- additionalParameters: string;
277
- amounts: number[];
278
- chainId: number;
279
- collection: string;
280
- collectionType: number;
281
- createdAt?: string | undefined;
282
- currency: string;
283
- endTime: number;
284
- globalNonce: string;
285
- id?: string | undefined;
286
- invalidated?: boolean | undefined;
287
- itemIds: string[];
288
- orderNonce: string;
289
- price: string;
290
- quoteType: number;
291
- signature: string;
292
- signer: string;
293
- startTime: number;
294
- strategyId: number;
295
- subsetNonce: number;
296
- validator_codes?: number[] | null | undefined;
297
- };
298
- Update: {
299
- additionalParameters?: string | undefined;
300
- amounts?: number[] | undefined;
301
- chainId?: number | undefined;
302
- collection?: string | undefined;
303
- collectionType?: number | undefined;
304
- createdAt?: string | undefined;
305
- currency?: string | undefined;
306
- endTime?: number | undefined;
307
- globalNonce?: string | undefined;
308
- id?: string | undefined;
309
- invalidated?: boolean | undefined;
310
- itemIds?: string[] | undefined;
311
- orderNonce?: string | undefined;
312
- price?: string | undefined;
313
- quoteType?: number | undefined;
314
- signature?: string | undefined;
315
- signer?: string | undefined;
316
- startTime?: number | undefined;
317
- strategyId?: number | undefined;
318
- subsetNonce?: number | undefined;
319
- validator_codes?: number[] | null | undefined;
320
- };
321
- Relationships: [];
322
- };
323
- registries: {
324
- Row: {
325
- admin_id: string;
326
- chain_id: number;
327
- created_at: string;
328
- description: string;
329
- hidden: boolean;
330
- id: string;
331
- name: string;
332
- };
333
- Insert: {
334
- admin_id: string;
335
- chain_id: number;
336
- created_at?: string | undefined;
337
- description: string;
338
- hidden?: boolean | undefined;
339
- id?: string | undefined;
340
- name: string;
341
- };
342
- Update: {
343
- admin_id?: string | undefined;
344
- chain_id?: number | undefined;
345
- created_at?: string | undefined;
346
- description?: string | undefined;
347
- hidden?: boolean | undefined;
348
- id?: string | undefined;
349
- name?: string | undefined;
350
- };
351
- Relationships: [];
352
- };
353
- users: {
354
- Row: {
355
- address: string;
356
- auth: import("./hypercerts-database-types").Json;
357
- created_at: string;
358
- email: string | null;
359
- id: string | null;
360
- };
361
- Insert: {
362
- address: string;
363
- auth?: import("./hypercerts-database-types").Json | undefined;
364
- created_at?: string | undefined;
365
- email?: string | null | undefined;
366
- id?: string | null | undefined;
367
- };
368
- Update: {
369
- address?: string | undefined;
370
- auth?: import("./hypercerts-database-types").Json | undefined;
371
- created_at?: string | undefined;
372
- email?: string | null | undefined;
373
- id?: string | null | undefined;
374
- };
375
- Relationships: [];
376
- };
377
- zuconnect_voting: {
378
- Row: {
379
- allocation_hc01: number | null;
380
- allocation_hc02: number | null;
381
- allocation_hc03: number | null;
382
- allocation_hc04: number | null;
383
- allocation_hc05: number | null;
384
- allocation_hc06: number | null;
385
- allocation_hc07: number | null;
386
- allocation_hc08: number | null;
387
- created_at: string;
388
- feedback: string | null;
389
- fid: string | null;
390
- id: number;
391
- link_to_image: string | null;
392
- percent_core_team: number | null;
393
- percent_direct_allocation: number | null;
394
- percent_matching_fund: number | null;
395
- };
396
- Insert: {
397
- allocation_hc01?: number | null | undefined;
398
- allocation_hc02?: number | null | undefined;
399
- allocation_hc03?: number | null | undefined;
400
- allocation_hc04?: number | null | undefined;
401
- allocation_hc05?: number | null | undefined;
402
- allocation_hc06?: number | null | undefined;
403
- allocation_hc07?: number | null | undefined;
404
- allocation_hc08?: number | null | undefined;
405
- created_at?: string | undefined;
406
- feedback?: string | null | undefined;
407
- fid?: string | null | undefined;
408
- id?: number | undefined;
409
- link_to_image?: string | null | undefined;
410
- percent_core_team?: number | null | undefined;
411
- percent_direct_allocation?: number | null | undefined;
412
- percent_matching_fund?: number | null | undefined;
413
- };
414
- Update: {
415
- allocation_hc01?: number | null | undefined;
416
- allocation_hc02?: number | null | undefined;
417
- allocation_hc03?: number | null | undefined;
418
- allocation_hc04?: number | null | undefined;
419
- allocation_hc05?: number | null | undefined;
420
- allocation_hc06?: number | null | undefined;
421
- allocation_hc07?: number | null | undefined;
422
- allocation_hc08?: number | null | undefined;
423
- created_at?: string | undefined;
424
- feedback?: string | null | undefined;
425
- fid?: string | null | undefined;
426
- id?: number | undefined;
427
- link_to_image?: string | null | undefined;
428
- percent_core_team?: number | null | undefined;
429
- percent_direct_allocation?: number | null | undefined;
430
- percent_matching_fund?: number | null | undefined;
431
- };
432
- Relationships: [];
433
- };
434
- zuzalu_donations: {
435
- Row: {
436
- address: string;
437
- amount: string | null;
438
- created_at: string;
439
- email: string;
440
- id: number;
441
- };
442
- Insert: {
443
- address: string;
444
- amount?: string | null | undefined;
445
- created_at?: string | undefined;
446
- email: string;
447
- id?: number | undefined;
448
- };
449
- Update: {
450
- address?: string | undefined;
451
- amount?: string | null | undefined;
452
- created_at?: string | undefined;
453
- email?: string | undefined;
454
- id?: number | undefined;
455
- };
456
- Relationships: [];
457
- };
458
- };
459
- Views: {};
460
- Functions: {
461
- add_claim_from_blueprint: {
462
- Args: {
463
- registry_id: string;
464
- hypercert_id: string;
465
- chain_id: number;
466
- admin_id: string;
467
- owner_id: string;
468
- blueprint_id: number;
469
- };
470
- Returns: string;
471
- };
472
- default_sponsor_metadata_by_address: {
473
- Args: {
474
- addresses: string[];
475
- };
476
- Returns: {
477
- address: string;
478
- companyName: string | null;
479
- created_at: string;
480
- firstName: string | null;
481
- image: string;
482
- lastName: string | null;
483
- type: string;
484
- }[];
485
- };
486
- fraction_sponsor_metadata_by_fraction_id: {
487
- Args: {
488
- fractions: string[];
489
- chain: number;
490
- };
491
- Returns: {
492
- chain_id: number;
493
- companyName: string | null;
494
- created_at: string;
495
- firstName: string | null;
496
- fraction_id: string;
497
- hypercert_id: string;
498
- id: string;
499
- image: string;
500
- lastName: string | null;
501
- strategy: string;
502
- type: string;
503
- value: string;
504
- }[];
505
- };
506
- };
507
- Enums: {};
508
- CompositeTypes: {};
509
- }>;
510
2
  export declare class ApiClient {
511
3
  private readonly baseUrl?;
512
4
  private _baseUrl;
513
- constructor(baseUrl?: string | undefined);
5
+ private _urqlClient;
6
+ private _supabaseHypercerts;
7
+ constructor(indexerEnvironment: "test" | "production", baseUrl?: string | undefined);
514
8
  /**
515
9
  * Fetches order nonce from api
516
10
  * @param address Address
@@ -1,6 +1,5 @@
1
1
  import { Client } from "@urql/core";
2
- export declare const urqlClient: Client;
3
- export declare const getFractionsById: (fractionId: string) => Promise<{
2
+ export declare const getFractionsById: (fractionId: string, client: Client) => Promise<{
4
3
  units: unknown;
5
4
  owner_address: string | null;
6
5
  last_update_block_timestamp: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypercerts-org/marketplace-sdk",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -24,6 +24,20 @@
24
24
  "engines": {
25
25
  "node": ">= 16.15.1 <= 20.x"
26
26
  },
27
+ "scripts": {
28
+ "prebuild": "rm -rf ./src/typechain ./src/artifacts cache dist",
29
+ "dev": "rollup -c --bundleConfigAsCjs -w",
30
+ "build:ts": "rollup -c --bundleConfigAsCjs",
31
+ "build:sc": "hardhat compile",
32
+ "build": "yarn build:sc && yarn build:ts",
33
+ "test": "nyc hardhat test",
34
+ "doc": "typedoc --plugin typedoc-plugin-markdown --tsconfig tsconfig.build.json",
35
+ "lint": "eslint --max-warnings 0 'src/**/*.{js,ts}'",
36
+ "format:check": "prettier --check 'src/**/*.{js,ts,json,yaml,yml,md}'",
37
+ "format:write": "prettier --write 'src/**/*.{js,ts,json,yaml,yml,md}'",
38
+ "release": "release-it --only-version --set-upstream",
39
+ "supabase:types:hypercerts": "npx supabase gen types typescript --project-id zgvoyckkistexkfdmjqc --schema public > src/utils/hypercerts-database-types.ts"
40
+ },
27
41
  "lint-staged": {
28
42
  "*.{js,jsx,ts,tsx,json,yaml,yml}": "yarn format:write"
29
43
  },
@@ -85,19 +99,5 @@
85
99
  "ethers": "^6.6.2",
86
100
  "gql.tada": "^1.7.6",
87
101
  "merkletreejs": "^0.3.9"
88
- },
89
- "scripts": {
90
- "prebuild": "rm -rf ./src/typechain ./src/artifacts cache dist",
91
- "dev": "rollup -c --bundleConfigAsCjs -w",
92
- "build:ts": "rollup -c --bundleConfigAsCjs",
93
- "build:sc": "hardhat compile",
94
- "build": "yarn build:sc && yarn build:ts",
95
- "test": "nyc hardhat test",
96
- "doc": "typedoc --plugin typedoc-plugin-markdown --tsconfig tsconfig.build.json",
97
- "lint": "eslint --max-warnings 0 'src/**/*.{js,ts}'",
98
- "format:check": "prettier --check 'src/**/*.{js,ts,json,yaml,yml,md}'",
99
- "format:write": "prettier --write 'src/**/*.{js,ts,json,yaml,yml,md}'",
100
- "release": "release-it --only-version --set-upstream",
101
- "supabase:types:hypercerts": "npx supabase gen types typescript --project-id zgvoyckkistexkfdmjqc --schema public > src/utils/hypercerts-database-types.ts"
102
102
  }
103
- }
103
+ }