@d8x/perpetuals-sdk 1.0.13 → 1.0.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.
Files changed (40) hide show
  1. package/dist/cjs/abi/OnDemandOracleUpgradeable.json +816 -0
  2. package/dist/cjs/config/defaultConfig.json +12 -0
  3. package/dist/cjs/contracts/OnDemandOracleUpgradeable.d.ts +476 -0
  4. package/dist/cjs/contracts/OnDemandOracleUpgradeable.js +3 -0
  5. package/dist/cjs/contracts/OnDemandOracleUpgradeable.js.map +1 -0
  6. package/dist/cjs/contracts/factories/OnDemandOracleUpgradeable__factory.d.ts +634 -0
  7. package/dist/cjs/contracts/factories/OnDemandOracleUpgradeable__factory.js +834 -0
  8. package/dist/cjs/contracts/factories/OnDemandOracleUpgradeable__factory.js.map +1 -0
  9. package/dist/cjs/contracts/factories/index.d.ts +1 -0
  10. package/dist/cjs/contracts/factories/index.js +3 -1
  11. package/dist/cjs/contracts/factories/index.js.map +1 -1
  12. package/dist/cjs/contracts/index.d.ts +2 -0
  13. package/dist/cjs/contracts/index.js +3 -1
  14. package/dist/cjs/contracts/index.js.map +1 -1
  15. package/dist/cjs/version.d.ts +1 -1
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/esm/abi/OnDemandOracleUpgradeable.json +816 -0
  18. package/dist/esm/config/defaultConfig.json +12 -0
  19. package/dist/esm/contracts/OnDemandOracleUpgradeable.d.ts +476 -0
  20. package/dist/esm/contracts/OnDemandOracleUpgradeable.js +2 -0
  21. package/dist/esm/contracts/OnDemandOracleUpgradeable.js.map +1 -0
  22. package/dist/esm/contracts/factories/OnDemandOracleUpgradeable__factory.d.ts +634 -0
  23. package/dist/esm/contracts/factories/OnDemandOracleUpgradeable__factory.js +830 -0
  24. package/dist/esm/contracts/factories/OnDemandOracleUpgradeable__factory.js.map +1 -0
  25. package/dist/esm/contracts/factories/index.d.ts +1 -0
  26. package/dist/esm/contracts/factories/index.js +1 -0
  27. package/dist/esm/contracts/factories/index.js.map +1 -1
  28. package/dist/esm/contracts/index.d.ts +2 -0
  29. package/dist/esm/contracts/index.js +1 -0
  30. package/dist/esm/contracts/index.js.map +1 -1
  31. package/dist/esm/version.d.ts +1 -1
  32. package/dist/esm/version.js +1 -1
  33. package/package.json +1 -1
  34. package/src/abi/OnDemandOracleUpgradeable.json +816 -0
  35. package/src/config/defaultConfig.json +12 -0
  36. package/src/contracts/OnDemandOracleUpgradeable.ts +1053 -0
  37. package/src/contracts/factories/OnDemandOracleUpgradeable__factory.ts +844 -0
  38. package/src/contracts/factories/index.ts +1 -0
  39. package/src/contracts/index.ts +2 -0
  40. package/src/version.ts +1 -1
@@ -0,0 +1,844 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import type { Provider } from "@ethersproject/providers";
7
+ import type {
8
+ OnDemandOracleUpgradeable,
9
+ OnDemandOracleUpgradeableInterface,
10
+ } from "../OnDemandOracleUpgradeable";
11
+
12
+ const _abi = [
13
+ {
14
+ inputs: [],
15
+ name: "InsufficientFee",
16
+ type: "error",
17
+ },
18
+ {
19
+ inputs: [],
20
+ name: "InvalidArgument",
21
+ type: "error",
22
+ },
23
+ {
24
+ inputs: [],
25
+ name: "NoFreshUpdate",
26
+ type: "error",
27
+ },
28
+ {
29
+ inputs: [],
30
+ name: "StalePrice",
31
+ type: "error",
32
+ },
33
+ {
34
+ anonymous: false,
35
+ inputs: [
36
+ {
37
+ indexed: false,
38
+ internalType: "address",
39
+ name: "previousAdmin",
40
+ type: "address",
41
+ },
42
+ {
43
+ indexed: false,
44
+ internalType: "address",
45
+ name: "newAdmin",
46
+ type: "address",
47
+ },
48
+ ],
49
+ name: "AdminChanged",
50
+ type: "event",
51
+ },
52
+ {
53
+ anonymous: false,
54
+ inputs: [
55
+ {
56
+ indexed: false,
57
+ internalType: "uint16",
58
+ name: "chainId",
59
+ type: "uint16",
60
+ },
61
+ {
62
+ indexed: false,
63
+ internalType: "uint64",
64
+ name: "sequenceNumber",
65
+ type: "uint64",
66
+ },
67
+ ],
68
+ name: "BatchPriceFeedUpdate",
69
+ type: "event",
70
+ },
71
+ {
72
+ anonymous: false,
73
+ inputs: [
74
+ {
75
+ indexed: true,
76
+ internalType: "address",
77
+ name: "beacon",
78
+ type: "address",
79
+ },
80
+ ],
81
+ name: "BeaconUpgraded",
82
+ type: "event",
83
+ },
84
+ {
85
+ anonymous: false,
86
+ inputs: [
87
+ {
88
+ indexed: true,
89
+ internalType: "address",
90
+ name: "previousOwner",
91
+ type: "address",
92
+ },
93
+ {
94
+ indexed: true,
95
+ internalType: "address",
96
+ name: "newOwner",
97
+ type: "address",
98
+ },
99
+ ],
100
+ name: "OwnershipTransferred",
101
+ type: "event",
102
+ },
103
+ {
104
+ anonymous: false,
105
+ inputs: [
106
+ {
107
+ indexed: true,
108
+ internalType: "bytes32",
109
+ name: "id",
110
+ type: "bytes32",
111
+ },
112
+ {
113
+ indexed: false,
114
+ internalType: "uint64",
115
+ name: "publishTime",
116
+ type: "uint64",
117
+ },
118
+ {
119
+ indexed: false,
120
+ internalType: "int64",
121
+ name: "price",
122
+ type: "int64",
123
+ },
124
+ {
125
+ indexed: false,
126
+ internalType: "uint64",
127
+ name: "conf",
128
+ type: "uint64",
129
+ },
130
+ ],
131
+ name: "PriceFeedUpdate",
132
+ type: "event",
133
+ },
134
+ {
135
+ anonymous: false,
136
+ inputs: [
137
+ {
138
+ indexed: false,
139
+ internalType: "address",
140
+ name: "newSigner",
141
+ type: "address",
142
+ },
143
+ ],
144
+ name: "SignerAdded",
145
+ type: "event",
146
+ },
147
+ {
148
+ anonymous: false,
149
+ inputs: [
150
+ {
151
+ indexed: false,
152
+ internalType: "address",
153
+ name: "signer",
154
+ type: "address",
155
+ },
156
+ ],
157
+ name: "SignerRemoved",
158
+ type: "event",
159
+ },
160
+ {
161
+ anonymous: false,
162
+ inputs: [
163
+ {
164
+ indexed: true,
165
+ internalType: "address",
166
+ name: "implementation",
167
+ type: "address",
168
+ },
169
+ ],
170
+ name: "Upgraded",
171
+ type: "event",
172
+ },
173
+ {
174
+ inputs: [
175
+ {
176
+ internalType: "address",
177
+ name: "_newSigner",
178
+ type: "address",
179
+ },
180
+ ],
181
+ name: "addSigner",
182
+ outputs: [],
183
+ stateMutability: "nonpayable",
184
+ type: "function",
185
+ },
186
+ {
187
+ inputs: [
188
+ {
189
+ internalType: "bytes32",
190
+ name: "id",
191
+ type: "bytes32",
192
+ },
193
+ ],
194
+ name: "getEmaPrice",
195
+ outputs: [
196
+ {
197
+ components: [
198
+ {
199
+ internalType: "int64",
200
+ name: "price",
201
+ type: "int64",
202
+ },
203
+ {
204
+ internalType: "uint64",
205
+ name: "conf",
206
+ type: "uint64",
207
+ },
208
+ {
209
+ internalType: "int32",
210
+ name: "expo",
211
+ type: "int32",
212
+ },
213
+ {
214
+ internalType: "uint256",
215
+ name: "publishTime",
216
+ type: "uint256",
217
+ },
218
+ ],
219
+ internalType: "struct PythStructs.Price",
220
+ name: "price",
221
+ type: "tuple",
222
+ },
223
+ ],
224
+ stateMutability: "view",
225
+ type: "function",
226
+ },
227
+ {
228
+ inputs: [
229
+ {
230
+ internalType: "bytes32",
231
+ name: "id",
232
+ type: "bytes32",
233
+ },
234
+ {
235
+ internalType: "uint256",
236
+ name: "age",
237
+ type: "uint256",
238
+ },
239
+ ],
240
+ name: "getEmaPriceNoOlderThan",
241
+ outputs: [
242
+ {
243
+ components: [
244
+ {
245
+ internalType: "int64",
246
+ name: "price",
247
+ type: "int64",
248
+ },
249
+ {
250
+ internalType: "uint64",
251
+ name: "conf",
252
+ type: "uint64",
253
+ },
254
+ {
255
+ internalType: "int32",
256
+ name: "expo",
257
+ type: "int32",
258
+ },
259
+ {
260
+ internalType: "uint256",
261
+ name: "publishTime",
262
+ type: "uint256",
263
+ },
264
+ ],
265
+ internalType: "struct PythStructs.Price",
266
+ name: "price",
267
+ type: "tuple",
268
+ },
269
+ ],
270
+ stateMutability: "view",
271
+ type: "function",
272
+ },
273
+ {
274
+ inputs: [
275
+ {
276
+ internalType: "bytes32",
277
+ name: "id",
278
+ type: "bytes32",
279
+ },
280
+ ],
281
+ name: "getEmaPriceUnsafe",
282
+ outputs: [
283
+ {
284
+ components: [
285
+ {
286
+ internalType: "int64",
287
+ name: "price",
288
+ type: "int64",
289
+ },
290
+ {
291
+ internalType: "uint64",
292
+ name: "conf",
293
+ type: "uint64",
294
+ },
295
+ {
296
+ internalType: "int32",
297
+ name: "expo",
298
+ type: "int32",
299
+ },
300
+ {
301
+ internalType: "uint256",
302
+ name: "publishTime",
303
+ type: "uint256",
304
+ },
305
+ ],
306
+ internalType: "struct PythStructs.Price",
307
+ name: "price",
308
+ type: "tuple",
309
+ },
310
+ ],
311
+ stateMutability: "view",
312
+ type: "function",
313
+ },
314
+ {
315
+ inputs: [
316
+ {
317
+ internalType: "bytes32",
318
+ name: "id",
319
+ type: "bytes32",
320
+ },
321
+ ],
322
+ name: "getPrice",
323
+ outputs: [
324
+ {
325
+ components: [
326
+ {
327
+ internalType: "int64",
328
+ name: "price",
329
+ type: "int64",
330
+ },
331
+ {
332
+ internalType: "uint64",
333
+ name: "conf",
334
+ type: "uint64",
335
+ },
336
+ {
337
+ internalType: "int32",
338
+ name: "expo",
339
+ type: "int32",
340
+ },
341
+ {
342
+ internalType: "uint256",
343
+ name: "publishTime",
344
+ type: "uint256",
345
+ },
346
+ ],
347
+ internalType: "struct PythStructs.Price",
348
+ name: "price",
349
+ type: "tuple",
350
+ },
351
+ ],
352
+ stateMutability: "view",
353
+ type: "function",
354
+ },
355
+ {
356
+ inputs: [
357
+ {
358
+ internalType: "bytes32",
359
+ name: "id",
360
+ type: "bytes32",
361
+ },
362
+ {
363
+ internalType: "uint256",
364
+ name: "age",
365
+ type: "uint256",
366
+ },
367
+ ],
368
+ name: "getPriceNoOlderThan",
369
+ outputs: [
370
+ {
371
+ components: [
372
+ {
373
+ internalType: "int64",
374
+ name: "price",
375
+ type: "int64",
376
+ },
377
+ {
378
+ internalType: "uint64",
379
+ name: "conf",
380
+ type: "uint64",
381
+ },
382
+ {
383
+ internalType: "int32",
384
+ name: "expo",
385
+ type: "int32",
386
+ },
387
+ {
388
+ internalType: "uint256",
389
+ name: "publishTime",
390
+ type: "uint256",
391
+ },
392
+ ],
393
+ internalType: "struct PythStructs.Price",
394
+ name: "price",
395
+ type: "tuple",
396
+ },
397
+ ],
398
+ stateMutability: "view",
399
+ type: "function",
400
+ },
401
+ {
402
+ inputs: [
403
+ {
404
+ internalType: "bytes32",
405
+ name: "id",
406
+ type: "bytes32",
407
+ },
408
+ ],
409
+ name: "getPriceUnsafe",
410
+ outputs: [
411
+ {
412
+ components: [
413
+ {
414
+ internalType: "int64",
415
+ name: "price",
416
+ type: "int64",
417
+ },
418
+ {
419
+ internalType: "uint64",
420
+ name: "conf",
421
+ type: "uint64",
422
+ },
423
+ {
424
+ internalType: "int32",
425
+ name: "expo",
426
+ type: "int32",
427
+ },
428
+ {
429
+ internalType: "uint256",
430
+ name: "publishTime",
431
+ type: "uint256",
432
+ },
433
+ ],
434
+ internalType: "struct PythStructs.Price",
435
+ name: "price",
436
+ type: "tuple",
437
+ },
438
+ ],
439
+ stateMutability: "view",
440
+ type: "function",
441
+ },
442
+ {
443
+ inputs: [
444
+ {
445
+ internalType: "bytes[]",
446
+ name: "updateData",
447
+ type: "bytes[]",
448
+ },
449
+ ],
450
+ name: "getUpdateFee",
451
+ outputs: [
452
+ {
453
+ internalType: "uint256",
454
+ name: "feeAmount",
455
+ type: "uint256",
456
+ },
457
+ ],
458
+ stateMutability: "view",
459
+ type: "function",
460
+ },
461
+ {
462
+ inputs: [],
463
+ name: "getValidTimePeriod",
464
+ outputs: [
465
+ {
466
+ internalType: "uint256",
467
+ name: "",
468
+ type: "uint256",
469
+ },
470
+ ],
471
+ stateMutability: "view",
472
+ type: "function",
473
+ },
474
+ {
475
+ inputs: [],
476
+ name: "initialize",
477
+ outputs: [],
478
+ stateMutability: "nonpayable",
479
+ type: "function",
480
+ },
481
+ {
482
+ inputs: [],
483
+ name: "owner",
484
+ outputs: [
485
+ {
486
+ internalType: "address",
487
+ name: "",
488
+ type: "address",
489
+ },
490
+ ],
491
+ stateMutability: "view",
492
+ type: "function",
493
+ },
494
+ {
495
+ inputs: [
496
+ {
497
+ internalType: "bytes[]",
498
+ name: "",
499
+ type: "bytes[]",
500
+ },
501
+ {
502
+ internalType: "bytes32[]",
503
+ name: "",
504
+ type: "bytes32[]",
505
+ },
506
+ {
507
+ internalType: "uint64",
508
+ name: "",
509
+ type: "uint64",
510
+ },
511
+ {
512
+ internalType: "uint64",
513
+ name: "",
514
+ type: "uint64",
515
+ },
516
+ ],
517
+ name: "parsePriceFeedUpdates",
518
+ outputs: [
519
+ {
520
+ components: [
521
+ {
522
+ internalType: "bytes32",
523
+ name: "id",
524
+ type: "bytes32",
525
+ },
526
+ {
527
+ components: [
528
+ {
529
+ internalType: "int64",
530
+ name: "price",
531
+ type: "int64",
532
+ },
533
+ {
534
+ internalType: "uint64",
535
+ name: "conf",
536
+ type: "uint64",
537
+ },
538
+ {
539
+ internalType: "int32",
540
+ name: "expo",
541
+ type: "int32",
542
+ },
543
+ {
544
+ internalType: "uint256",
545
+ name: "publishTime",
546
+ type: "uint256",
547
+ },
548
+ ],
549
+ internalType: "struct PythStructs.Price",
550
+ name: "price",
551
+ type: "tuple",
552
+ },
553
+ {
554
+ components: [
555
+ {
556
+ internalType: "int64",
557
+ name: "price",
558
+ type: "int64",
559
+ },
560
+ {
561
+ internalType: "uint64",
562
+ name: "conf",
563
+ type: "uint64",
564
+ },
565
+ {
566
+ internalType: "int32",
567
+ name: "expo",
568
+ type: "int32",
569
+ },
570
+ {
571
+ internalType: "uint256",
572
+ name: "publishTime",
573
+ type: "uint256",
574
+ },
575
+ ],
576
+ internalType: "struct PythStructs.Price",
577
+ name: "emaPrice",
578
+ type: "tuple",
579
+ },
580
+ ],
581
+ internalType: "struct PythStructs.PriceFeed[]",
582
+ name: "",
583
+ type: "tuple[]",
584
+ },
585
+ ],
586
+ stateMutability: "payable",
587
+ type: "function",
588
+ },
589
+ {
590
+ inputs: [
591
+ {
592
+ internalType: "bytes32",
593
+ name: "id",
594
+ type: "bytes32",
595
+ },
596
+ ],
597
+ name: "priceFeedExists",
598
+ outputs: [
599
+ {
600
+ internalType: "bool",
601
+ name: "",
602
+ type: "bool",
603
+ },
604
+ ],
605
+ stateMutability: "view",
606
+ type: "function",
607
+ },
608
+ {
609
+ inputs: [],
610
+ name: "proxiableUUID",
611
+ outputs: [
612
+ {
613
+ internalType: "bytes32",
614
+ name: "",
615
+ type: "bytes32",
616
+ },
617
+ ],
618
+ stateMutability: "view",
619
+ type: "function",
620
+ },
621
+ {
622
+ inputs: [
623
+ {
624
+ internalType: "bytes32",
625
+ name: "id",
626
+ type: "bytes32",
627
+ },
628
+ ],
629
+ name: "queryPriceFeed",
630
+ outputs: [
631
+ {
632
+ components: [
633
+ {
634
+ internalType: "bytes32",
635
+ name: "id",
636
+ type: "bytes32",
637
+ },
638
+ {
639
+ components: [
640
+ {
641
+ internalType: "int64",
642
+ name: "price",
643
+ type: "int64",
644
+ },
645
+ {
646
+ internalType: "uint64",
647
+ name: "conf",
648
+ type: "uint64",
649
+ },
650
+ {
651
+ internalType: "int32",
652
+ name: "expo",
653
+ type: "int32",
654
+ },
655
+ {
656
+ internalType: "uint256",
657
+ name: "publishTime",
658
+ type: "uint256",
659
+ },
660
+ ],
661
+ internalType: "struct PythStructs.Price",
662
+ name: "price",
663
+ type: "tuple",
664
+ },
665
+ {
666
+ components: [
667
+ {
668
+ internalType: "int64",
669
+ name: "price",
670
+ type: "int64",
671
+ },
672
+ {
673
+ internalType: "uint64",
674
+ name: "conf",
675
+ type: "uint64",
676
+ },
677
+ {
678
+ internalType: "int32",
679
+ name: "expo",
680
+ type: "int32",
681
+ },
682
+ {
683
+ internalType: "uint256",
684
+ name: "publishTime",
685
+ type: "uint256",
686
+ },
687
+ ],
688
+ internalType: "struct PythStructs.Price",
689
+ name: "emaPrice",
690
+ type: "tuple",
691
+ },
692
+ ],
693
+ internalType: "struct PythStructs.PriceFeed",
694
+ name: "priceFeed",
695
+ type: "tuple",
696
+ },
697
+ ],
698
+ stateMutability: "view",
699
+ type: "function",
700
+ },
701
+ {
702
+ inputs: [
703
+ {
704
+ internalType: "address",
705
+ name: "_signer",
706
+ type: "address",
707
+ },
708
+ ],
709
+ name: "removeSigner",
710
+ outputs: [],
711
+ stateMutability: "nonpayable",
712
+ type: "function",
713
+ },
714
+ {
715
+ inputs: [],
716
+ name: "renounceOwnership",
717
+ outputs: [],
718
+ stateMutability: "nonpayable",
719
+ type: "function",
720
+ },
721
+ {
722
+ inputs: [
723
+ {
724
+ internalType: "address",
725
+ name: "newOwner",
726
+ type: "address",
727
+ },
728
+ ],
729
+ name: "transferOwnership",
730
+ outputs: [],
731
+ stateMutability: "nonpayable",
732
+ type: "function",
733
+ },
734
+ {
735
+ inputs: [
736
+ {
737
+ internalType: "bytes[]",
738
+ name: "updateData",
739
+ type: "bytes[]",
740
+ },
741
+ ],
742
+ name: "updatePriceFeeds",
743
+ outputs: [],
744
+ stateMutability: "payable",
745
+ type: "function",
746
+ },
747
+ {
748
+ inputs: [
749
+ {
750
+ internalType: "bytes[]",
751
+ name: "updateData",
752
+ type: "bytes[]",
753
+ },
754
+ {
755
+ internalType: "bytes32[]",
756
+ name: "priceIds",
757
+ type: "bytes32[]",
758
+ },
759
+ {
760
+ internalType: "uint64[]",
761
+ name: "publishTimes",
762
+ type: "uint64[]",
763
+ },
764
+ ],
765
+ name: "updatePriceFeedsIfNecessary",
766
+ outputs: [],
767
+ stateMutability: "payable",
768
+ type: "function",
769
+ },
770
+ {
771
+ inputs: [
772
+ {
773
+ internalType: "uint256",
774
+ name: "newFee",
775
+ type: "uint256",
776
+ },
777
+ ],
778
+ name: "updateSingleUpdateFeeInWei",
779
+ outputs: [],
780
+ stateMutability: "nonpayable",
781
+ type: "function",
782
+ },
783
+ {
784
+ inputs: [
785
+ {
786
+ internalType: "uint256",
787
+ name: "newValidTimePeriodSeconds",
788
+ type: "uint256",
789
+ },
790
+ ],
791
+ name: "updateValidTimePeriodSeconds",
792
+ outputs: [],
793
+ stateMutability: "nonpayable",
794
+ type: "function",
795
+ },
796
+ {
797
+ inputs: [
798
+ {
799
+ internalType: "address",
800
+ name: "newImplementation",
801
+ type: "address",
802
+ },
803
+ ],
804
+ name: "upgradeTo",
805
+ outputs: [],
806
+ stateMutability: "nonpayable",
807
+ type: "function",
808
+ },
809
+ {
810
+ inputs: [
811
+ {
812
+ internalType: "address",
813
+ name: "newImplementation",
814
+ type: "address",
815
+ },
816
+ {
817
+ internalType: "bytes",
818
+ name: "data",
819
+ type: "bytes",
820
+ },
821
+ ],
822
+ name: "upgradeToAndCall",
823
+ outputs: [],
824
+ stateMutability: "payable",
825
+ type: "function",
826
+ },
827
+ ] as const;
828
+
829
+ export class OnDemandOracleUpgradeable__factory {
830
+ static readonly abi = _abi;
831
+ static createInterface(): OnDemandOracleUpgradeableInterface {
832
+ return new utils.Interface(_abi) as OnDemandOracleUpgradeableInterface;
833
+ }
834
+ static connect(
835
+ address: string,
836
+ signerOrProvider: Signer | Provider
837
+ ): OnDemandOracleUpgradeable {
838
+ return new Contract(
839
+ address,
840
+ _abi,
841
+ signerOrProvider
842
+ ) as OnDemandOracleUpgradeable;
843
+ }
844
+ }