@0xslots/sdk 0.3.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,351 +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
- price
66
- taxPercentage
191
+ occupant
192
+ refund
67
193
  timestamp
68
194
  blockNumber
69
195
  tx
70
196
  }
71
197
  }
72
198
  `;
73
- var GetPriceUpdatesDocument = gql`
74
- query GetPriceUpdates($first: Int = 100, $orderBy: PriceUpdate_orderBy, $orderDirection: OrderDirection, $where: PriceUpdate_filter) {
75
- 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(
76
202
  first: $first
203
+ skip: $skip
77
204
  orderBy: $orderBy
78
205
  orderDirection: $orderDirection
79
206
  where: $where
207
+ block: $block
80
208
  ) {
81
209
  id
82
210
  slot {
83
211
  id
84
- slotId
85
212
  }
86
- oldPrice
87
- newPrice
213
+ liquidator
214
+ occupant
215
+ bounty
88
216
  timestamp
89
217
  blockNumber
90
218
  tx
91
219
  }
92
220
  }
93
221
  `;
94
- var GetFlowChangesDocument = gql`
95
- query GetFlowChanges($first: Int = 100, $where: FlowChange_filter) {
96
- flowChanges(
222
+ var GetSettledEventsDocument = gql`
223
+ query GetSettledEvents($first: Int!, $skip: Int, $orderBy: SettledEvent_orderBy, $orderDirection: OrderDirection, $where: SettledEvent_filter, $block: Block_height) {
224
+ settledEvents(
97
225
  first: $first
226
+ skip: $skip
227
+ orderBy: $orderBy
228
+ orderDirection: $orderDirection
98
229
  where: $where
99
- orderBy: timestamp
100
- orderDirection: desc
230
+ block: $block
101
231
  ) {
102
232
  id
103
- from
104
- to
105
- oldRate
106
- newRate
107
- operation
233
+ slot {
234
+ id
235
+ }
236
+ taxOwed
237
+ taxPaid
238
+ depositRemaining
108
239
  timestamp
109
240
  blockNumber
110
241
  tx
111
242
  }
112
243
  }
113
244
  `;
114
- var GetHubDocument = gql`
115
- query GetHub($id: ID!) {
116
- hub(id: $id) {
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
+ ) {
117
255
  id
118
- protocolFeeBps
119
- protocolFeeRecipient
120
- slotPrice
121
- defaultCurrency {
256
+ slot {
122
257
  id
123
- name
124
- symbol
125
- decimals
126
258
  }
127
- defaultSlotCount
128
- defaultPrice
129
- defaultTaxPercentage
130
- defaultMaxTaxPercentage
131
- defaultMinTaxUpdatePeriod
132
- defaultModule
259
+ recipient
260
+ amount
261
+ timestamp
262
+ blockNumber
263
+ tx
133
264
  }
134
265
  }
135
266
  `;
136
- var GetAllowedModulesDocument = gql`
137
- query GetAllowedModules($hubId: String!) {
138
- modules(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
+ ) {
139
277
  id
140
- name
141
- version
142
- allowed
278
+ slot {
279
+ id
280
+ }
281
+ depositor
282
+ amount
283
+ timestamp
284
+ blockNumber
285
+ tx
143
286
  }
144
287
  }
145
288
  `;
146
- var GetAllowedCurrenciesDocument = gql`
147
- query GetAllowedCurrencies($hubId: String!) {
148
- currencies(where: {hub: $hubId, allowed: true}) {
289
+ var GetWithdrawnEventsDocument = gql`
290
+ query GetWithdrawnEvents($first: Int!, $skip: Int, $orderBy: WithdrawnEvent_orderBy, $orderDirection: OrderDirection, $where: WithdrawnEvent_filter, $block: Block_height) {
291
+ withdrawnEvents(
292
+ first: $first
293
+ skip: $skip
294
+ orderBy: $orderBy
295
+ orderDirection: $orderDirection
296
+ where: $where
297
+ block: $block
298
+ ) {
149
299
  id
150
- name
151
- symbol
152
- decimals
153
- underlyingToken
154
- underlyingName
155
- underlyingSymbol
156
- underlyingDecimals
300
+ slot {
301
+ id
302
+ }
303
+ occupant
304
+ amount
305
+ timestamp
306
+ blockNumber
307
+ tx
157
308
  }
158
309
  }
159
310
  `;
160
- var GetLandsDocument = gql`
161
- query GetLands($first: Int = 100, $skip: Int = 0, $orderBy: Land_orderBy, $orderDirection: OrderDirection) {
162
- lands(
311
+ var GetPriceUpdatedEventsDocument = gql`
312
+ query GetPriceUpdatedEvents($first: Int!, $skip: Int, $orderBy: PriceUpdatedEvent_orderBy, $orderDirection: OrderDirection, $where: PriceUpdatedEvent_filter, $block: Block_height) {
313
+ priceUpdatedEvents(
163
314
  first: $first
164
315
  skip: $skip
165
316
  orderBy: $orderBy
166
317
  orderDirection: $orderDirection
318
+ where: $where
319
+ block: $block
167
320
  ) {
168
321
  id
169
- owner
170
- hub {
322
+ slot {
171
323
  id
172
324
  }
173
- createdAt
174
- createdTx
325
+ oldPrice
326
+ newPrice
327
+ timestamp
328
+ blockNumber
329
+ tx
330
+ }
331
+ }
332
+ `;
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
+ ) {
368
+ id
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
175
422
  }
176
423
  }
177
424
  `;
178
- var GetLandDocument = gql`
179
- query GetLand($id: ID!) {
180
- land(id: $id) {
425
+ var GetFactoryDocument = gql`
426
+ query GetFactory {
427
+ factories(first: 1) {
181
428
  id
182
- owner
183
- hub {
184
- id
185
- }
186
- createdAt
187
- createdTx
188
- slots {
189
- id
190
- slotId
191
- occupant
192
- currency
193
- price
194
- taxPercentage
195
- active
196
- }
429
+ slotCount
197
430
  }
198
431
  }
199
432
  `;
200
- var GetLandsByOwnerDocument = gql`
201
- query GetLandsByOwner($owner: Bytes!, $first: Int = 100) {
202
- lands(where: {owner: $owner}, first: $first) {
433
+ var GetModulesDocument = gql`
434
+ query GetModules($first: Int!) {
435
+ modules(first: $first) {
203
436
  id
204
- owner
205
- createdAt
206
- createdTx
437
+ verified
438
+ name
439
+ version
207
440
  }
208
441
  }
209
442
  `;
210
443
  var GetSlotsDocument = gql`
211
- 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) {
212
445
  slots(
213
446
  first: $first
214
447
  skip: $skip
215
448
  orderBy: $orderBy
216
449
  orderDirection: $orderDirection
217
450
  where: $where
451
+ block: $block
218
452
  ) {
219
- id
220
- land {
221
- id
222
- owner
223
- }
224
- slotId
225
- occupant
226
- currency
227
- basePrice
228
- price
229
- taxPercentage
230
- maxTaxPercentage
231
- minTaxUpdatePeriod
232
- module
233
- active
234
- createdAt
235
- updatedAt
453
+ ...SlotFields
236
454
  }
237
455
  }
238
- `;
456
+ ${SlotFieldsFragmentDoc}`;
239
457
  var GetSlotDocument = gql`
240
- query GetSlot($id: ID!) {
241
- slot(id: $id) {
242
- id
243
- land {
244
- id
245
- owner
246
- }
247
- slotId
248
- occupant
249
- currency
250
- basePrice
251
- price
252
- taxPercentage
253
- maxTaxPercentage
254
- minTaxUpdatePeriod
255
- module
256
- active
257
- createdAt
258
- updatedAt
259
- priceHistory(orderBy: timestamp, orderDirection: desc, first: 10) {
260
- id
261
- oldPrice
262
- newPrice
263
- timestamp
264
- tx
265
- }
266
- taxUpdates(orderBy: timestamp, orderDirection: desc, first: 10) {
267
- id
268
- kind
269
- oldPercentage
270
- newPercentage
271
- confirmableAt
272
- timestamp
273
- tx
274
- }
458
+ query GetSlot($id: ID!, $block: Block_height) {
459
+ slot(id: $id, block: $block) {
460
+ ...SlotFields
275
461
  }
276
462
  }
277
- `;
278
- var GetSlotsByOccupantDocument = gql`
279
- query GetSlotsByOccupant($occupant: Bytes!, $first: Int = 100) {
280
- slots(where: {occupant: $occupant, active: true}, first: $first) {
281
- id
282
- land {
283
- id
284
- }
285
- slotId
286
- occupant
287
- price
288
- taxPercentage
289
- 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
290
475
  }
291
476
  }
292
- `;
293
- var GetAvailableSlotsDocument = gql`
294
- 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) {
295
480
  slots(
296
- where: {occupant: null, active: true}
297
481
  first: $first
298
482
  skip: $skip
299
- orderBy: price
300
- orderDirection: asc
483
+ orderBy: $orderBy
484
+ orderDirection: $orderDirection
485
+ where: {occupant: $occupant}
486
+ block: $block
301
487
  ) {
302
- id
303
- land {
304
- id
305
- owner
306
- }
307
- slotId
308
- currency
309
- price
310
- taxPercentage
488
+ ...SlotFields
311
489
  }
312
490
  }
313
- `;
491
+ ${SlotFieldsFragmentDoc}`;
314
492
  var defaultWrapper = (action, _operationName, _operationType, _variables) => action();
315
493
  function getSdk(client, withWrapper = defaultWrapper) {
316
494
  return {
317
- GetSlotPurchases(variables, requestHeaders, signal) {
318
- 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);
319
500
  },
320
- GetLandOpenedEvents(variables, requestHeaders, signal) {
321
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandOpenedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLandOpenedEvents", "query", variables);
501
+ GetRecentEvents(variables, requestHeaders, signal) {
502
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetRecentEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetRecentEvents", "query", variables);
322
503
  },
323
- GetSlotCreatedEvents(variables, requestHeaders, signal) {
324
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotCreatedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotCreatedEvents", "query", variables);
504
+ GetBoughtEvents(variables, requestHeaders, signal) {
505
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetBoughtEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetBoughtEvents", "query", variables);
325
506
  },
326
- GetPriceUpdates(variables, requestHeaders, signal) {
327
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetPriceUpdatesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetPriceUpdates", "query", variables);
507
+ GetReleasedEvents(variables, requestHeaders, signal) {
508
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetReleasedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetReleasedEvents", "query", variables);
328
509
  },
329
- GetFlowChanges(variables, requestHeaders, signal) {
330
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetFlowChangesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetFlowChanges", "query", variables);
510
+ GetLiquidatedEvents(variables, requestHeaders, signal) {
511
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLiquidatedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLiquidatedEvents", "query", variables);
331
512
  },
332
- GetHub(variables, requestHeaders, signal) {
333
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetHubDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetHub", "query", variables);
513
+ GetSettledEvents(variables, requestHeaders, signal) {
514
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSettledEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSettledEvents", "query", variables);
334
515
  },
335
- GetAllowedModules(variables, requestHeaders, signal) {
336
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAllowedModulesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAllowedModules", "query", variables);
516
+ GetTaxCollectedEvents(variables, requestHeaders, signal) {
517
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetTaxCollectedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetTaxCollectedEvents", "query", variables);
337
518
  },
338
- GetAllowedCurrencies(variables, requestHeaders, signal) {
339
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAllowedCurrenciesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAllowedCurrencies", "query", variables);
519
+ GetDepositedEvents(variables, requestHeaders, signal) {
520
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetDepositedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetDepositedEvents", "query", variables);
340
521
  },
341
- GetLands(variables, requestHeaders, signal) {
342
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLands", "query", variables);
522
+ GetWithdrawnEvents(variables, requestHeaders, signal) {
523
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetWithdrawnEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetWithdrawnEvents", "query", variables);
343
524
  },
344
- GetLand(variables, requestHeaders, signal) {
345
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLand", "query", variables);
525
+ GetPriceUpdatedEvents(variables, requestHeaders, signal) {
526
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetPriceUpdatedEventsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetPriceUpdatedEvents", "query", variables);
346
527
  },
347
- GetLandsByOwner(variables, requestHeaders, signal) {
348
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetLandsByOwnerDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetLandsByOwner", "query", variables);
528
+ GetSlotActivity(variables, requestHeaders, signal) {
529
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotActivityDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotActivity", "query", variables);
530
+ },
531
+ GetFactory(variables, requestHeaders, signal) {
532
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetFactoryDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetFactory", "query", variables);
533
+ },
534
+ GetModules(variables, requestHeaders, signal) {
535
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetModulesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetModules", "query", variables);
349
536
  },
350
537
  GetSlots(variables, requestHeaders, signal) {
351
538
  return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlots", "query", variables);
@@ -353,90 +540,54 @@ function getSdk(client, withWrapper = defaultWrapper) {
353
540
  GetSlot(variables, requestHeaders, signal) {
354
541
  return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlot", "query", variables);
355
542
  },
543
+ GetSlotsByRecipient(variables, requestHeaders, signal) {
544
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotsByRecipientDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotsByRecipient", "query", variables);
545
+ },
356
546
  GetSlotsByOccupant(variables, requestHeaders, signal) {
357
547
  return withWrapper((wrappedRequestHeaders) => client.request({ document: GetSlotsByOccupantDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetSlotsByOccupant", "query", variables);
358
- },
359
- GetAvailableSlots(variables, requestHeaders, signal) {
360
- return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAvailableSlotsDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAvailableSlots", "query", variables);
361
548
  }
362
549
  };
363
550
  }
364
551
 
365
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
+ `;
366
565
  var SlotsChain = /* @__PURE__ */ ((SlotsChain2) => {
367
566
  SlotsChain2[SlotsChain2["BASE_SEPOLIA"] = 84532] = "BASE_SEPOLIA";
567
+ SlotsChain2[SlotsChain2["ARBITRUM"] = 42161] = "ARBITRUM";
368
568
  return SlotsChain2;
369
569
  })(SlotsChain || {});
370
570
  var SUBGRAPH_URLS = {
371
- [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",
572
+ [42161 /* ARBITRUM */]: "https://api.studio.thegraph.com/query/958/0-x-slots-arb/version/latest"
372
573
  };
373
574
  var SlotsClient = class {
374
- /**
375
- * Create a new SlotsClient instance
376
- *
377
- * @param config - Client configuration
378
- *
379
- * @example
380
- * ```typescript
381
- * import { SlotsClient, SlotsChain } from '@0xslots/sdk';
382
- *
383
- * const client = new SlotsClient({
384
- * chainId: SlotsChain.BASE_SEPOLIA,
385
- * });
386
- *
387
- * const hub = await client.getHub({ id: '0x...' });
388
- * ```
389
- */
390
575
  constructor(config) {
391
576
  this.chainId = config.chainId;
392
577
  const url = config.subgraphUrl || SUBGRAPH_URLS[config.chainId];
393
- if (!url) {
394
- throw new Error(`No subgraph URL configured for chain ${config.chainId}`);
395
- }
396
- this.client = new GraphQLClient(url, {
397
- headers: config.headers
398
- });
578
+ if (!url) throw new Error(`No subgraph URL for chain ${config.chainId}`);
579
+ this.client = new GraphQLClient(url, { headers: config.headers });
399
580
  this.sdk = getSdk(this.client);
400
581
  }
401
- /**
402
- * Get the current chain ID
403
- */
404
582
  getChainId() {
405
583
  return this.chainId;
406
584
  }
407
- /**
408
- * Get the underlying GraphQL client
409
- */
410
585
  getClient() {
411
586
  return this.client;
412
587
  }
413
- /**
414
- * Get the generated SDK with all typed query methods
415
- */
416
588
  getSdk() {
417
589
  return this.sdk;
418
590
  }
419
- // Convenience methods that proxy to the SDK
420
- // Hub queries
421
- getHub(...args) {
422
- return this.sdk.GetHub(...args);
423
- }
424
- getAllowedModules(...args) {
425
- return this.sdk.GetAllowedModules(...args);
426
- }
427
- getAllowedCurrencies(...args) {
428
- return this.sdk.GetAllowedCurrencies(...args);
429
- }
430
- // Land queries
431
- getLands(...args) {
432
- return this.sdk.GetLands(...args);
433
- }
434
- getLand(...args) {
435
- return this.sdk.GetLand(...args);
436
- }
437
- getLandsByOwner(...args) {
438
- return this.sdk.GetLandsByOwner(...args);
439
- }
440
591
  // Slot queries
441
592
  getSlots(...args) {
442
593
  return this.sdk.GetSlots(...args);
@@ -444,33 +595,67 @@ var SlotsClient = class {
444
595
  getSlot(...args) {
445
596
  return this.sdk.GetSlot(...args);
446
597
  }
598
+ getSlotsByRecipient(...args) {
599
+ return this.sdk.GetSlotsByRecipient(...args);
600
+ }
447
601
  getSlotsByOccupant(...args) {
448
602
  return this.sdk.GetSlotsByOccupant(...args);
449
603
  }
450
- getAvailableSlots(...args) {
451
- 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);
452
610
  }
453
611
  // Event queries
454
- getSlotPurchases(...args) {
455
- 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);
456
640
  }
457
- getLandOpenedEvents(...args) {
458
- return this.sdk.GetLandOpenedEvents(...args);
641
+ getDepositedEvents(...args) {
642
+ return this.sdk.GetDepositedEvents(...args);
459
643
  }
460
- getSlotCreatedEvents(...args) {
461
- return this.sdk.GetSlotCreatedEvents(...args);
644
+ getWithdrawnEvents(...args) {
645
+ return this.sdk.GetWithdrawnEvents(...args);
462
646
  }
463
- getFlowChanges(...args) {
464
- return this.sdk.GetFlowChanges(...args);
647
+ getPriceUpdatedEvents(...args) {
648
+ return this.sdk.GetPriceUpdatedEvents(...args);
465
649
  }
466
- getPriceUpdates(...args) {
467
- return this.sdk.GetPriceUpdates(...args);
650
+ // Meta
651
+ getMeta() {
652
+ return this.client.request(META_QUERY);
468
653
  }
469
654
  };
470
655
  function createSlotsClient(config) {
471
656
  return new SlotsClient(config);
472
657
  }
473
658
 
474
- export { GetAllowedCurrenciesDocument, GetAllowedModulesDocument, GetAvailableSlotsDocument, GetFlowChangesDocument, 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 };
475
660
  //# sourceMappingURL=index.js.map
476
661
  //# sourceMappingURL=index.js.map