@0xslots/sdk 0.4.0 → 0.5.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.
package/dist/index.js CHANGED
@@ -1,327 +1,538 @@
1
- import { GraphQLClient } from 'graphql-request';
1
+ import { gql as gql$1, GraphQLClient } from 'graphql-request';
2
2
  import gql from 'graphql-tag';
3
3
 
4
4
  // src/client.ts
5
- var GetSlotPurchasesDocument = gql`
6
- query GetSlotPurchases($first: Int = 100, $skip: Int = 0, $orderBy: SlotPurchase_orderBy, $orderDirection: OrderDirection, $where: SlotPurchase_filter) {
7
- slotPurchases(
5
+ var AccountFieldsFragmentDoc = gql`
6
+ fragment AccountFields on Account {
7
+ id
8
+ slotCount
9
+ occupiedCount
10
+ slotsAsRecipient {
11
+ id
12
+ }
13
+ slotsAsOccupant {
14
+ id
15
+ }
16
+ }
17
+ `;
18
+ var SlotFieldsFragmentDoc = gql`
19
+ fragment SlotFields on Slot {
20
+ id
21
+ recipient
22
+ recipientAccount {
23
+ id
24
+ slotCount
25
+ occupiedCount
26
+ }
27
+ currency
28
+ currencyName
29
+ currencySymbol
30
+ currencyDecimals
31
+ manager
32
+ mutableTax
33
+ mutableModule
34
+ taxPercentage
35
+ module
36
+ occupant
37
+ occupantAccount {
38
+ id
39
+ slotCount
40
+ occupiedCount
41
+ }
42
+ price
43
+ deposit
44
+ collectedTax
45
+ totalCollected
46
+ liquidationBountyBps
47
+ minDepositSeconds
48
+ createdAt
49
+ createdTx
50
+ updatedAt
51
+ }
52
+ `;
53
+ var GetAccountDocument = gql`
54
+ query GetAccount($id: ID!, $block: Block_height) {
55
+ account(id: $id, block: $block) {
56
+ ...AccountFields
57
+ }
58
+ }
59
+ ${AccountFieldsFragmentDoc}`;
60
+ var GetAccountsDocument = gql`
61
+ query GetAccounts($first: Int!, $skip: Int, $orderBy: Account_orderBy, $orderDirection: OrderDirection, $where: Account_filter, $block: Block_height) {
62
+ accounts(
8
63
  first: $first
9
64
  skip: $skip
10
65
  orderBy: $orderBy
11
66
  orderDirection: $orderDirection
12
67
  where: $where
68
+ block: $block
13
69
  ) {
70
+ ...AccountFields
71
+ }
72
+ }
73
+ ${AccountFieldsFragmentDoc}`;
74
+ var GetRecentEventsDocument = gql`
75
+ query GetRecentEvents($first: Int!) {
76
+ boughtEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
14
77
  id
15
78
  slot {
16
79
  id
17
- slotId
18
- land {
19
- id
20
- }
21
80
  }
22
- newOccupant
81
+ buyer
23
82
  previousOccupant
83
+ price
84
+ selfAssessedPrice
85
+ deposit
86
+ timestamp
87
+ tx
88
+ }
89
+ releasedEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
90
+ id
91
+ slot {
92
+ id
93
+ }
94
+ occupant
95
+ refund
96
+ timestamp
97
+ tx
98
+ }
99
+ liquidatedEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
100
+ id
101
+ slot {
102
+ id
103
+ }
104
+ liquidator
105
+ occupant
106
+ bounty
107
+ timestamp
108
+ tx
109
+ }
110
+ priceUpdatedEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
111
+ id
112
+ slot {
113
+ id
114
+ }
115
+ oldPrice
116
+ newPrice
117
+ timestamp
118
+ tx
119
+ }
120
+ depositedEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
121
+ id
122
+ slot {
123
+ id
124
+ }
125
+ depositor
126
+ amount
127
+ timestamp
128
+ tx
129
+ }
130
+ withdrawnEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
131
+ id
132
+ slot {
133
+ id
134
+ }
135
+ occupant
136
+ amount
137
+ timestamp
138
+ tx
139
+ }
140
+ taxCollectedEvents(first: $first, orderBy: timestamp, orderDirection: desc) {
141
+ id
142
+ slot {
143
+ id
144
+ }
145
+ recipient
146
+ amount
24
147
  timestamp
25
- blockNumber
26
148
  tx
27
149
  }
28
150
  }
29
151
  `;
30
- var GetLandOpenedEventsDocument = gql`
31
- query GetLandOpenedEvents($first: Int = 100, $orderBy: LandOpenedEvent_orderBy, $orderDirection: OrderDirection) {
32
- landOpenedEvents(
152
+ var GetBoughtEventsDocument = gql`
153
+ query GetBoughtEvents($first: Int!, $skip: Int, $orderBy: BoughtEvent_orderBy, $orderDirection: OrderDirection, $where: BoughtEvent_filter, $block: Block_height) {
154
+ boughtEvents(
33
155
  first: $first
156
+ skip: $skip
34
157
  orderBy: $orderBy
35
158
  orderDirection: $orderDirection
159
+ where: $where
160
+ block: $block
36
161
  ) {
37
162
  id
38
- land {
163
+ slot {
39
164
  id
40
165
  }
41
- account
166
+ buyer
167
+ previousOccupant
168
+ price
169
+ deposit
170
+ selfAssessedPrice
42
171
  timestamp
43
172
  blockNumber
44
173
  tx
45
174
  }
46
175
  }
47
176
  `;
48
- var GetSlotCreatedEventsDocument = gql`
49
- query GetSlotCreatedEvents($first: Int = 100, $orderBy: SlotCreatedEvent_orderBy, $orderDirection: OrderDirection, $where: SlotCreatedEvent_filter) {
50
- slotCreatedEvents(
177
+ var GetReleasedEventsDocument = gql`
178
+ query GetReleasedEvents($first: Int!, $skip: Int, $orderBy: ReleasedEvent_orderBy, $orderDirection: OrderDirection, $where: ReleasedEvent_filter, $block: Block_height) {
179
+ releasedEvents(
51
180
  first: $first
181
+ skip: $skip
52
182
  orderBy: $orderBy
53
183
  orderDirection: $orderDirection
54
184
  where: $where
185
+ block: $block
55
186
  ) {
56
187
  id
57
188
  slot {
58
189
  id
59
- slotId
60
190
  }
61
- land
62
- slotId
63
- currency
64
- basePrice
65
- taxPercentage
191
+ occupant
192
+ refund
66
193
  timestamp
67
194
  blockNumber
68
195
  tx
69
196
  }
70
197
  }
71
198
  `;
72
- var GetPriceUpdatesDocument = gql`
73
- query GetPriceUpdates($first: Int = 100, $orderBy: PriceUpdate_orderBy, $orderDirection: OrderDirection, $where: PriceUpdate_filter) {
74
- priceUpdates(
199
+ var GetLiquidatedEventsDocument = gql`
200
+ query GetLiquidatedEvents($first: Int!, $skip: Int, $orderBy: LiquidatedEvent_orderBy, $orderDirection: OrderDirection, $where: LiquidatedEvent_filter, $block: Block_height) {
201
+ liquidatedEvents(
75
202
  first: $first
203
+ skip: $skip
76
204
  orderBy: $orderBy
77
205
  orderDirection: $orderDirection
78
206
  where: $where
207
+ block: $block
79
208
  ) {
80
209
  id
81
210
  slot {
82
211
  id
83
- slotId
84
212
  }
85
- oldPrice
86
- newPrice
213
+ liquidator
214
+ occupant
215
+ bounty
87
216
  timestamp
88
217
  blockNumber
89
218
  tx
90
219
  }
91
220
  }
92
221
  `;
93
- var GetHubDocument = gql`
94
- query GetHub($id: ID!) {
95
- hub(id: $id) {
222
+ var GetSettledEventsDocument = gql`
223
+ query GetSettledEvents($first: Int!, $skip: Int, $orderBy: SettledEvent_orderBy, $orderDirection: OrderDirection, $where: SettledEvent_filter, $block: Block_height) {
224
+ settledEvents(
225
+ first: $first
226
+ skip: $skip
227
+ orderBy: $orderBy
228
+ orderDirection: $orderDirection
229
+ where: $where
230
+ block: $block
231
+ ) {
96
232
  id
97
- protocolFeeBps
98
- protocolFeeRecipient
99
- landCreationFee
100
- slotExpansionFee
101
- defaultCurrency {
233
+ slot {
102
234
  id
103
- name
104
- symbol
105
- decimals
106
235
  }
107
- defaultSlotCount
108
- defaultPrice
109
- defaultTaxPercentage
110
- defaultMaxTaxPercentage
111
- defaultMinTaxUpdatePeriod
112
- defaultModule
113
- moduleCallGasLimit
114
- liquidationBountyBps
115
- minDepositSeconds
236
+ taxOwed
237
+ taxPaid
238
+ depositRemaining
239
+ timestamp
240
+ blockNumber
241
+ tx
116
242
  }
117
243
  }
118
244
  `;
119
- var GetAllowedModulesDocument = gql`
120
- query GetAllowedModules($hubId: String!) {
121
- modules(where: {hub: $hubId, allowed: true}) {
245
+ var GetTaxCollectedEventsDocument = gql`
246
+ query GetTaxCollectedEvents($first: Int!, $skip: Int, $orderBy: TaxCollectedEvent_orderBy, $orderDirection: OrderDirection, $where: TaxCollectedEvent_filter, $block: Block_height) {
247
+ taxCollectedEvents(
248
+ first: $first
249
+ skip: $skip
250
+ orderBy: $orderBy
251
+ orderDirection: $orderDirection
252
+ where: $where
253
+ block: $block
254
+ ) {
122
255
  id
123
- name
124
- version
125
- allowed
256
+ slot {
257
+ id
258
+ }
259
+ recipient
260
+ amount
261
+ timestamp
262
+ blockNumber
263
+ tx
126
264
  }
127
265
  }
128
266
  `;
129
- var GetAllowedCurrenciesDocument = gql`
130
- query GetAllowedCurrencies($hubId: String!) {
131
- currencies(where: {hub: $hubId, allowed: true}) {
267
+ var GetDepositedEventsDocument = gql`
268
+ query GetDepositedEvents($first: Int!, $skip: Int, $orderBy: DepositedEvent_orderBy, $orderDirection: OrderDirection, $where: DepositedEvent_filter, $block: Block_height) {
269
+ depositedEvents(
270
+ first: $first
271
+ skip: $skip
272
+ orderBy: $orderBy
273
+ orderDirection: $orderDirection
274
+ where: $where
275
+ block: $block
276
+ ) {
132
277
  id
133
- name
134
- symbol
135
- decimals
278
+ slot {
279
+ id
280
+ }
281
+ depositor
282
+ amount
283
+ timestamp
284
+ blockNumber
285
+ tx
136
286
  }
137
287
  }
138
288
  `;
139
- var GetLandsDocument = gql`
140
- query GetLands($first: Int = 100, $skip: Int = 0, $orderBy: Land_orderBy, $orderDirection: OrderDirection) {
141
- lands(
289
+ var GetWithdrawnEventsDocument = gql`
290
+ query GetWithdrawnEvents($first: Int!, $skip: Int, $orderBy: WithdrawnEvent_orderBy, $orderDirection: OrderDirection, $where: WithdrawnEvent_filter, $block: Block_height) {
291
+ withdrawnEvents(
142
292
  first: $first
143
293
  skip: $skip
144
294
  orderBy: $orderBy
145
295
  orderDirection: $orderDirection
296
+ where: $where
297
+ block: $block
146
298
  ) {
147
299
  id
148
- owner
149
- hub {
300
+ slot {
150
301
  id
151
302
  }
152
- createdAt
153
- createdTx
303
+ occupant
304
+ amount
305
+ timestamp
306
+ blockNumber
307
+ tx
154
308
  }
155
309
  }
156
310
  `;
157
- var GetLandDocument = gql`
158
- query GetLand($id: ID!) {
159
- land(id: $id) {
311
+ var GetPriceUpdatedEventsDocument = gql`
312
+ query GetPriceUpdatedEvents($first: Int!, $skip: Int, $orderBy: PriceUpdatedEvent_orderBy, $orderDirection: OrderDirection, $where: PriceUpdatedEvent_filter, $block: Block_height) {
313
+ priceUpdatedEvents(
314
+ first: $first
315
+ skip: $skip
316
+ orderBy: $orderBy
317
+ orderDirection: $orderDirection
318
+ where: $where
319
+ block: $block
320
+ ) {
160
321
  id
161
- owner
162
- hub {
163
- id
164
- }
165
- createdAt
166
- createdTx
167
- slots {
322
+ slot {
168
323
  id
169
- slotId
170
- occupant
171
- currency
172
- price
173
- taxPercentage
174
- active
175
324
  }
325
+ oldPrice
326
+ newPrice
327
+ timestamp
328
+ blockNumber
329
+ tx
176
330
  }
177
331
  }
178
332
  `;
179
- var GetLandsByOwnerDocument = gql`
180
- query GetLandsByOwner($owner: Bytes!, $first: Int = 100) {
181
- lands(where: {owner: $owner}, first: $first) {
333
+ var GetSlotActivityDocument = gql`
334
+ query GetSlotActivity($slotId: String!, $first: Int!) {
335
+ boughtEvents(
336
+ first: $first
337
+ orderBy: timestamp
338
+ orderDirection: desc
339
+ where: {slot: $slotId}
340
+ ) {
341
+ id
342
+ buyer
343
+ previousOccupant
344
+ price
345
+ selfAssessedPrice
346
+ deposit
347
+ timestamp
348
+ tx
349
+ }
350
+ releasedEvents(
351
+ first: $first
352
+ orderBy: timestamp
353
+ orderDirection: desc
354
+ where: {slot: $slotId}
355
+ ) {
356
+ id
357
+ occupant
358
+ refund
359
+ timestamp
360
+ tx
361
+ }
362
+ liquidatedEvents(
363
+ first: $first
364
+ orderBy: timestamp
365
+ orderDirection: desc
366
+ where: {slot: $slotId}
367
+ ) {
182
368
  id
183
- owner
184
- createdAt
185
- createdTx
369
+ liquidator
370
+ occupant
371
+ bounty
372
+ timestamp
373
+ tx
374
+ }
375
+ priceUpdatedEvents(
376
+ first: $first
377
+ orderBy: timestamp
378
+ orderDirection: desc
379
+ where: {slot: $slotId}
380
+ ) {
381
+ id
382
+ oldPrice
383
+ newPrice
384
+ timestamp
385
+ tx
386
+ }
387
+ depositedEvents(
388
+ first: $first
389
+ orderBy: timestamp
390
+ orderDirection: desc
391
+ where: {slot: $slotId}
392
+ ) {
393
+ id
394
+ depositor
395
+ amount
396
+ timestamp
397
+ tx
398
+ }
399
+ withdrawnEvents(
400
+ first: $first
401
+ orderBy: timestamp
402
+ orderDirection: desc
403
+ where: {slot: $slotId}
404
+ ) {
405
+ id
406
+ occupant
407
+ amount
408
+ timestamp
409
+ tx
410
+ }
411
+ taxCollectedEvents(
412
+ first: $first
413
+ orderBy: timestamp
414
+ orderDirection: desc
415
+ where: {slot: $slotId}
416
+ ) {
417
+ id
418
+ recipient
419
+ amount
420
+ timestamp
421
+ tx
422
+ }
423
+ }
424
+ `;
425
+ var GetFactoryDocument = gql`
426
+ query GetFactory {
427
+ factories(first: 1) {
428
+ id
429
+ slotCount
430
+ }
431
+ }
432
+ `;
433
+ var GetModulesDocument = gql`
434
+ query GetModules($first: Int!) {
435
+ modules(first: $first) {
436
+ id
437
+ verified
438
+ name
439
+ version
186
440
  }
187
441
  }
188
442
  `;
189
443
  var GetSlotsDocument = gql`
190
- query GetSlots($first: Int = 100, $skip: Int = 0, $orderBy: Slot_orderBy, $orderDirection: OrderDirection, $where: Slot_filter) {
444
+ query GetSlots($first: Int!, $skip: Int, $orderBy: Slot_orderBy, $orderDirection: OrderDirection, $where: Slot_filter, $block: Block_height) {
191
445
  slots(
192
446
  first: $first
193
447
  skip: $skip
194
448
  orderBy: $orderBy
195
449
  orderDirection: $orderDirection
196
450
  where: $where
451
+ block: $block
197
452
  ) {
198
- id
199
- land {
200
- id
201
- owner
202
- }
203
- slotId
204
- occupant
205
- currency
206
- basePrice
207
- price
208
- taxPercentage
209
- maxTaxPercentage
210
- minTaxUpdatePeriod
211
- module
212
- active
213
- createdAt
214
- updatedAt
453
+ ...SlotFields
215
454
  }
216
455
  }
217
- `;
456
+ ${SlotFieldsFragmentDoc}`;
218
457
  var GetSlotDocument = gql`
219
- query GetSlot($id: ID!) {
220
- slot(id: $id) {
221
- id
222
- land {
223
- id
224
- owner
225
- }
226
- slotId
227
- occupant
228
- currency
229
- basePrice
230
- price
231
- taxPercentage
232
- maxTaxPercentage
233
- minTaxUpdatePeriod
234
- module
235
- active
236
- createdAt
237
- updatedAt
238
- priceHistory(orderBy: timestamp, orderDirection: desc, first: 10) {
239
- id
240
- oldPrice
241
- newPrice
242
- timestamp
243
- tx
244
- }
245
- taxUpdates(orderBy: timestamp, orderDirection: desc, first: 10) {
246
- id
247
- kind
248
- oldPercentage
249
- newPercentage
250
- confirmableAt
251
- timestamp
252
- tx
253
- }
458
+ query GetSlot($id: ID!, $block: Block_height) {
459
+ slot(id: $id, block: $block) {
460
+ ...SlotFields
254
461
  }
255
462
  }
256
- `;
257
- var GetSlotsByOccupantDocument = gql`
258
- query GetSlotsByOccupant($occupant: Bytes!, $first: Int = 100) {
259
- slots(where: {occupant: $occupant, active: true}, first: $first) {
260
- id
261
- land {
262
- id
263
- }
264
- slotId
265
- occupant
266
- price
267
- taxPercentage
268
- active
463
+ ${SlotFieldsFragmentDoc}`;
464
+ var GetSlotsByRecipientDocument = gql`
465
+ query GetSlotsByRecipient($recipient: Bytes!, $first: Int!, $skip: Int, $orderBy: Slot_orderBy, $orderDirection: OrderDirection, $block: Block_height) {
466
+ slots(
467
+ first: $first
468
+ skip: $skip
469
+ orderBy: $orderBy
470
+ orderDirection: $orderDirection
471
+ where: {recipient: $recipient}
472
+ block: $block
473
+ ) {
474
+ ...SlotFields
269
475
  }
270
476
  }
271
- `;
272
- var GetAvailableSlotsDocument = gql`
273
- query GetAvailableSlots($first: Int = 100, $skip: Int = 0) {
477
+ ${SlotFieldsFragmentDoc}`;
478
+ var GetSlotsByOccupantDocument = gql`
479
+ query GetSlotsByOccupant($occupant: Bytes!, $first: Int!, $skip: Int, $orderBy: Slot_orderBy, $orderDirection: OrderDirection, $block: Block_height) {
274
480
  slots(
275
- where: {occupant: null, active: true}
276
481
  first: $first
277
482
  skip: $skip
278
- orderBy: price
279
- orderDirection: asc
483
+ orderBy: $orderBy
484
+ orderDirection: $orderDirection
485
+ where: {occupant: $occupant}
486
+ block: $block
280
487
  ) {
281
- id
282
- land {
283
- id
284
- owner
285
- }
286
- slotId
287
- currency
288
- price
289
- taxPercentage
488
+ ...SlotFields
290
489
  }
291
490
  }
292
- `;
491
+ ${SlotFieldsFragmentDoc}`;
293
492
  var defaultWrapper = (action, _operationName, _operationType, _variables) => action();
294
493
  function getSdk(client, withWrapper = defaultWrapper) {
295
494
  return {
296
- GetSlotPurchases(variables, requestHeaders, signal) {
297
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotPurchasesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotPurchases", "query", variables);
495
+ GetAccount(variables, requestHeaders, signal) {
496
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAccountDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAccount", "query", variables);
497
+ },
498
+ GetAccounts(variables, requestHeaders, signal) {
499
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAccountsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAccounts", "query", variables);
500
+ },
501
+ GetRecentEvents(variables, requestHeaders, signal) {
502
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetRecentEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetRecentEvents", "query", variables);
503
+ },
504
+ GetBoughtEvents(variables, requestHeaders, signal) {
505
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetBoughtEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetBoughtEvents", "query", variables);
506
+ },
507
+ GetReleasedEvents(variables, requestHeaders, signal) {
508
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetReleasedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetReleasedEvents", "query", variables);
298
509
  },
299
- GetLandOpenedEvents(variables, requestHeaders, signal) {
300
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandOpenedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLandOpenedEvents", "query", variables);
510
+ GetLiquidatedEvents(variables, requestHeaders, signal) {
511
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLiquidatedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLiquidatedEvents", "query", variables);
301
512
  },
302
- GetSlotCreatedEvents(variables, requestHeaders, signal) {
303
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotCreatedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotCreatedEvents", "query", variables);
513
+ GetSettledEvents(variables, requestHeaders, signal) {
514
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSettledEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSettledEvents", "query", variables);
304
515
  },
305
- GetPriceUpdates(variables, requestHeaders, signal) {
306
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetPriceUpdatesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetPriceUpdates", "query", variables);
516
+ GetTaxCollectedEvents(variables, requestHeaders, signal) {
517
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetTaxCollectedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetTaxCollectedEvents", "query", variables);
307
518
  },
308
- GetHub(variables, requestHeaders, signal) {
309
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetHubDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetHub", "query", variables);
519
+ GetDepositedEvents(variables, requestHeaders, signal) {
520
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetDepositedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetDepositedEvents", "query", variables);
310
521
  },
311
- GetAllowedModules(variables, requestHeaders, signal) {
312
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAllowedModulesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAllowedModules", "query", variables);
522
+ GetWithdrawnEvents(variables, requestHeaders, signal) {
523
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetWithdrawnEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetWithdrawnEvents", "query", variables);
313
524
  },
314
- GetAllowedCurrencies(variables, requestHeaders, signal) {
315
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAllowedCurrenciesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAllowedCurrencies", "query", variables);
525
+ GetPriceUpdatedEvents(variables, requestHeaders, signal) {
526
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetPriceUpdatedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetPriceUpdatedEvents", "query", variables);
316
527
  },
317
- GetLands(variables, requestHeaders, signal) {
318
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLands", "query", variables);
528
+ GetSlotActivity(variables, requestHeaders, signal) {
529
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotActivityDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotActivity", "query", variables);
319
530
  },
320
- GetLand(variables, requestHeaders, signal) {
321
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLand", "query", variables);
531
+ GetFactory(variables, requestHeaders, signal) {
532
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetFactoryDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetFactory", "query", variables);
322
533
  },
323
- GetLandsByOwner(variables, requestHeaders, signal) {
324
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandsByOwnerDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLandsByOwner", "query", variables);
534
+ GetModules(variables, requestHeaders, signal) {
535
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetModulesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetModules", "query", variables);
325
536
  },
326
537
  GetSlots(variables, requestHeaders, signal) {
327
538
  return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlots", "query", variables);
@@ -329,92 +540,54 @@ function getSdk(client, withWrapper = defaultWrapper) {
329
540
  GetSlot(variables, requestHeaders, signal) {
330
541
  return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlot", "query", variables);
331
542
  },
543
+ GetSlotsByRecipient(variables, requestHeaders, signal) {
544
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotsByRecipientDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotsByRecipient", "query", variables);
545
+ },
332
546
  GetSlotsByOccupant(variables, requestHeaders, signal) {
333
547
  return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotsByOccupantDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotsByOccupant", "query", variables);
334
- },
335
- GetAvailableSlots(variables, requestHeaders, signal) {
336
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAvailableSlotsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAvailableSlots", "query", variables);
337
548
  }
338
549
  };
339
550
  }
340
551
 
341
552
  // src/client.ts
553
+ var META_QUERY = gql$1`
554
+ query GetMeta {
555
+ _meta {
556
+ block {
557
+ number
558
+ hash
559
+ timestamp
560
+ }
561
+ hasIndexingErrors
562
+ }
563
+ }
564
+ `;
342
565
  var SlotsChain = /* @__PURE__ */ ((SlotsChain2) => {
343
566
  SlotsChain2[SlotsChain2["BASE_SEPOLIA"] = 84532] = "BASE_SEPOLIA";
344
567
  SlotsChain2[SlotsChain2["ARBITRUM"] = 42161] = "ARBITRUM";
345
568
  return SlotsChain2;
346
569
  })(SlotsChain || {});
347
570
  var SUBGRAPH_URLS = {
348
- [84532 /* BASE_SEPOLIA */]: "https://api.studio.thegraph.com/query/958/0-x-slots-base-sepolia/version/latest",
571
+ [84532 /* BASE_SEPOLIA */]: "https://api.studio.thegraph.com/query/958/0-x-slots-base-sepolia/v3.5.0",
349
572
  [42161 /* ARBITRUM */]: "https://api.studio.thegraph.com/query/958/0-x-slots-arb/version/latest"
350
573
  };
351
574
  var SlotsClient = class {
352
- /**
353
- * Create a new SlotsClient instance
354
- *
355
- * @param config - Client configuration
356
- *
357
- * @example
358
- * ```typescript
359
- * import { SlotsClient, SlotsChain } from '@0xslots/sdk';
360
- *
361
- * const client = new SlotsClient({
362
- * chainId: SlotsChain.BASE_SEPOLIA,
363
- * });
364
- *
365
- * const hub = await client.getHub({ id: '0x...' });
366
- * ```
367
- */
368
575
  constructor(config) {
369
576
  this.chainId = config.chainId;
370
577
  const url = config.subgraphUrl || SUBGRAPH_URLS[config.chainId];
371
- if (!url) {
372
- throw new Error(`No subgraph URL configured for chain ${config.chainId}`);
373
- }
374
- this.client = new GraphQLClient(url, {
375
- headers: config.headers
376
- });
578
+ if (!url) throw new Error(`No subgraph URL for chain ${config.chainId}`);
579
+ this.client = new GraphQLClient(url, { headers: config.headers });
377
580
  this.sdk = getSdk(this.client);
378
581
  }
379
- /**
380
- * Get the current chain ID
381
- */
382
582
  getChainId() {
383
583
  return this.chainId;
384
584
  }
385
- /**
386
- * Get the underlying GraphQL client
387
- */
388
585
  getClient() {
389
586
  return this.client;
390
587
  }
391
- /**
392
- * Get the generated SDK with all typed query methods
393
- */
394
588
  getSdk() {
395
589
  return this.sdk;
396
590
  }
397
- // Convenience methods that proxy to the SDK
398
- // Hub queries
399
- getHub(...args) {
400
- return this.sdk.GetHub(...args);
401
- }
402
- getAllowedModules(...args) {
403
- return this.sdk.GetAllowedModules(...args);
404
- }
405
- getAllowedCurrencies(...args) {
406
- return this.sdk.GetAllowedCurrencies(...args);
407
- }
408
- // Land queries
409
- getLands(...args) {
410
- return this.sdk.GetLands(...args);
411
- }
412
- getLand(...args) {
413
- return this.sdk.GetLand(...args);
414
- }
415
- getLandsByOwner(...args) {
416
- return this.sdk.GetLandsByOwner(...args);
417
- }
418
591
  // Slot queries
419
592
  getSlots(...args) {
420
593
  return this.sdk.GetSlots(...args);
@@ -422,30 +595,67 @@ var SlotsClient = class {
422
595
  getSlot(...args) {
423
596
  return this.sdk.GetSlot(...args);
424
597
  }
598
+ getSlotsByRecipient(...args) {
599
+ return this.sdk.GetSlotsByRecipient(...args);
600
+ }
425
601
  getSlotsByOccupant(...args) {
426
602
  return this.sdk.GetSlotsByOccupant(...args);
427
603
  }
428
- getAvailableSlots(...args) {
429
- return this.sdk.GetAvailableSlots(...args);
604
+ // Factory queries
605
+ getFactory() {
606
+ return this.sdk.GetFactory();
607
+ }
608
+ getModules(...args) {
609
+ return this.sdk.GetModules(...args);
430
610
  }
431
611
  // Event queries
432
- getSlotPurchases(...args) {
433
- return this.sdk.GetSlotPurchases(...args);
612
+ getBoughtEvents(...args) {
613
+ return this.sdk.GetBoughtEvents(...args);
614
+ }
615
+ getSettledEvents(...args) {
616
+ return this.sdk.GetSettledEvents(...args);
617
+ }
618
+ getTaxCollectedEvents(...args) {
619
+ return this.sdk.GetTaxCollectedEvents(...args);
620
+ }
621
+ getSlotActivity(...args) {
622
+ return this.sdk.GetSlotActivity(...args);
623
+ }
624
+ getRecentEvents(...args) {
625
+ return this.sdk.GetRecentEvents(...args);
626
+ }
627
+ // Account queries
628
+ getAccount(...args) {
629
+ return this.sdk.GetAccount(...args);
630
+ }
631
+ getAccounts(...args) {
632
+ return this.sdk.GetAccounts(...args);
633
+ }
634
+ // Individual event queries (full params)
635
+ getReleasedEvents(...args) {
636
+ return this.sdk.GetReleasedEvents(...args);
637
+ }
638
+ getLiquidatedEvents(...args) {
639
+ return this.sdk.GetLiquidatedEvents(...args);
640
+ }
641
+ getDepositedEvents(...args) {
642
+ return this.sdk.GetDepositedEvents(...args);
434
643
  }
435
- getLandOpenedEvents(...args) {
436
- return this.sdk.GetLandOpenedEvents(...args);
644
+ getWithdrawnEvents(...args) {
645
+ return this.sdk.GetWithdrawnEvents(...args);
437
646
  }
438
- getSlotCreatedEvents(...args) {
439
- return this.sdk.GetSlotCreatedEvents(...args);
647
+ getPriceUpdatedEvents(...args) {
648
+ return this.sdk.GetPriceUpdatedEvents(...args);
440
649
  }
441
- getPriceUpdates(...args) {
442
- return this.sdk.GetPriceUpdates(...args);
650
+ // Meta
651
+ getMeta() {
652
+ return this.client.request(META_QUERY);
443
653
  }
444
654
  };
445
655
  function createSlotsClient(config) {
446
656
  return new SlotsClient(config);
447
657
  }
448
658
 
449
- export { GetAllowedCurrenciesDocument, GetAllowedModulesDocument, GetAvailableSlotsDocument, GetHubDocument, GetLandDocument, GetLandOpenedEventsDocument, GetLandsByOwnerDocument, GetLandsDocument, GetPriceUpdatesDocument, GetSlotCreatedEventsDocument, GetSlotDocument, GetSlotPurchasesDocument, GetSlotsByOccupantDocument, GetSlotsDocument, SUBGRAPH_URLS, SlotsChain, SlotsClient, createSlotsClient, getSdk };
659
+ export { AccountFieldsFragmentDoc, GetAccountDocument, GetAccountsDocument, GetBoughtEventsDocument, GetDepositedEventsDocument, GetFactoryDocument, GetLiquidatedEventsDocument, GetModulesDocument, GetPriceUpdatedEventsDocument, GetRecentEventsDocument, GetReleasedEventsDocument, GetSettledEventsDocument, GetSlotActivityDocument, GetSlotDocument, GetSlotsByOccupantDocument, GetSlotsByRecipientDocument, GetSlotsDocument, GetTaxCollectedEventsDocument, GetWithdrawnEventsDocument, SUBGRAPH_URLS, SlotFieldsFragmentDoc, SlotsChain, SlotsClient, createSlotsClient, getSdk };
450
660
  //# sourceMappingURL=index.js.map
451
661
  //# sourceMappingURL=index.js.map