@pythnetwork/price-pusher 7.1.0 → 8.0.0-alpha

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pyth-abi.d.ts","sourceRoot":"","sources":["../../src/evm/pyth-abi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkiBX,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EAgCjB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuEhB,CAAC;AAEX,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIV,CAAC"}
@@ -0,0 +1,660 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PythAbi = exports.PythErrorsAbi = exports.IPythEventsAbi = exports.IPythAbi = void 0;
4
+ exports.IPythAbi = [
5
+ {
6
+ anonymous: false,
7
+ inputs: [
8
+ {
9
+ indexed: true,
10
+ internalType: "bytes32",
11
+ name: "id",
12
+ type: "bytes32",
13
+ },
14
+ {
15
+ indexed: false,
16
+ internalType: "uint64",
17
+ name: "publishTime",
18
+ type: "uint64",
19
+ },
20
+ {
21
+ indexed: false,
22
+ internalType: "int64",
23
+ name: "price",
24
+ type: "int64",
25
+ },
26
+ {
27
+ indexed: false,
28
+ internalType: "uint64",
29
+ name: "conf",
30
+ type: "uint64",
31
+ },
32
+ ],
33
+ name: "PriceFeedUpdate",
34
+ type: "event",
35
+ },
36
+ {
37
+ inputs: [
38
+ {
39
+ internalType: "bytes32",
40
+ name: "id",
41
+ type: "bytes32",
42
+ },
43
+ ],
44
+ name: "getEmaPrice",
45
+ outputs: [
46
+ {
47
+ components: [
48
+ {
49
+ internalType: "int64",
50
+ name: "price",
51
+ type: "int64",
52
+ },
53
+ {
54
+ internalType: "uint64",
55
+ name: "conf",
56
+ type: "uint64",
57
+ },
58
+ {
59
+ internalType: "int32",
60
+ name: "expo",
61
+ type: "int32",
62
+ },
63
+ {
64
+ internalType: "uint256",
65
+ name: "publishTime",
66
+ type: "uint256",
67
+ },
68
+ ],
69
+ internalType: "struct PythStructs.Price",
70
+ name: "price",
71
+ type: "tuple",
72
+ },
73
+ ],
74
+ stateMutability: "view",
75
+ type: "function",
76
+ },
77
+ {
78
+ inputs: [
79
+ {
80
+ internalType: "bytes32",
81
+ name: "id",
82
+ type: "bytes32",
83
+ },
84
+ {
85
+ internalType: "uint256",
86
+ name: "age",
87
+ type: "uint256",
88
+ },
89
+ ],
90
+ name: "getEmaPriceNoOlderThan",
91
+ outputs: [
92
+ {
93
+ components: [
94
+ {
95
+ internalType: "int64",
96
+ name: "price",
97
+ type: "int64",
98
+ },
99
+ {
100
+ internalType: "uint64",
101
+ name: "conf",
102
+ type: "uint64",
103
+ },
104
+ {
105
+ internalType: "int32",
106
+ name: "expo",
107
+ type: "int32",
108
+ },
109
+ {
110
+ internalType: "uint256",
111
+ name: "publishTime",
112
+ type: "uint256",
113
+ },
114
+ ],
115
+ internalType: "struct PythStructs.Price",
116
+ name: "price",
117
+ type: "tuple",
118
+ },
119
+ ],
120
+ stateMutability: "view",
121
+ type: "function",
122
+ },
123
+ {
124
+ inputs: [
125
+ {
126
+ internalType: "bytes32",
127
+ name: "id",
128
+ type: "bytes32",
129
+ },
130
+ ],
131
+ name: "getEmaPriceUnsafe",
132
+ outputs: [
133
+ {
134
+ components: [
135
+ {
136
+ internalType: "int64",
137
+ name: "price",
138
+ type: "int64",
139
+ },
140
+ {
141
+ internalType: "uint64",
142
+ name: "conf",
143
+ type: "uint64",
144
+ },
145
+ {
146
+ internalType: "int32",
147
+ name: "expo",
148
+ type: "int32",
149
+ },
150
+ {
151
+ internalType: "uint256",
152
+ name: "publishTime",
153
+ type: "uint256",
154
+ },
155
+ ],
156
+ internalType: "struct PythStructs.Price",
157
+ name: "price",
158
+ type: "tuple",
159
+ },
160
+ ],
161
+ stateMutability: "view",
162
+ type: "function",
163
+ },
164
+ {
165
+ inputs: [
166
+ {
167
+ internalType: "bytes32",
168
+ name: "id",
169
+ type: "bytes32",
170
+ },
171
+ ],
172
+ name: "getPrice",
173
+ outputs: [
174
+ {
175
+ components: [
176
+ {
177
+ internalType: "int64",
178
+ name: "price",
179
+ type: "int64",
180
+ },
181
+ {
182
+ internalType: "uint64",
183
+ name: "conf",
184
+ type: "uint64",
185
+ },
186
+ {
187
+ internalType: "int32",
188
+ name: "expo",
189
+ type: "int32",
190
+ },
191
+ {
192
+ internalType: "uint256",
193
+ name: "publishTime",
194
+ type: "uint256",
195
+ },
196
+ ],
197
+ internalType: "struct PythStructs.Price",
198
+ name: "price",
199
+ type: "tuple",
200
+ },
201
+ ],
202
+ stateMutability: "view",
203
+ type: "function",
204
+ },
205
+ {
206
+ inputs: [
207
+ {
208
+ internalType: "bytes32",
209
+ name: "id",
210
+ type: "bytes32",
211
+ },
212
+ {
213
+ internalType: "uint256",
214
+ name: "age",
215
+ type: "uint256",
216
+ },
217
+ ],
218
+ name: "getPriceNoOlderThan",
219
+ outputs: [
220
+ {
221
+ components: [
222
+ {
223
+ internalType: "int64",
224
+ name: "price",
225
+ type: "int64",
226
+ },
227
+ {
228
+ internalType: "uint64",
229
+ name: "conf",
230
+ type: "uint64",
231
+ },
232
+ {
233
+ internalType: "int32",
234
+ name: "expo",
235
+ type: "int32",
236
+ },
237
+ {
238
+ internalType: "uint256",
239
+ name: "publishTime",
240
+ type: "uint256",
241
+ },
242
+ ],
243
+ internalType: "struct PythStructs.Price",
244
+ name: "price",
245
+ type: "tuple",
246
+ },
247
+ ],
248
+ stateMutability: "view",
249
+ type: "function",
250
+ },
251
+ {
252
+ inputs: [
253
+ {
254
+ internalType: "bytes32",
255
+ name: "id",
256
+ type: "bytes32",
257
+ },
258
+ ],
259
+ name: "getPriceUnsafe",
260
+ outputs: [
261
+ {
262
+ components: [
263
+ {
264
+ internalType: "int64",
265
+ name: "price",
266
+ type: "int64",
267
+ },
268
+ {
269
+ internalType: "uint64",
270
+ name: "conf",
271
+ type: "uint64",
272
+ },
273
+ {
274
+ internalType: "int32",
275
+ name: "expo",
276
+ type: "int32",
277
+ },
278
+ {
279
+ internalType: "uint256",
280
+ name: "publishTime",
281
+ type: "uint256",
282
+ },
283
+ ],
284
+ internalType: "struct PythStructs.Price",
285
+ name: "price",
286
+ type: "tuple",
287
+ },
288
+ ],
289
+ stateMutability: "view",
290
+ type: "function",
291
+ },
292
+ {
293
+ inputs: [
294
+ {
295
+ internalType: "bytes[]",
296
+ name: "updateData",
297
+ type: "bytes[]",
298
+ },
299
+ ],
300
+ name: "getUpdateFee",
301
+ outputs: [
302
+ {
303
+ internalType: "uint256",
304
+ name: "feeAmount",
305
+ type: "uint256",
306
+ },
307
+ ],
308
+ stateMutability: "view",
309
+ type: "function",
310
+ },
311
+ {
312
+ inputs: [],
313
+ name: "getValidTimePeriod",
314
+ outputs: [
315
+ {
316
+ internalType: "uint256",
317
+ name: "validTimePeriod",
318
+ type: "uint256",
319
+ },
320
+ ],
321
+ stateMutability: "view",
322
+ type: "function",
323
+ },
324
+ {
325
+ inputs: [
326
+ {
327
+ internalType: "bytes[]",
328
+ name: "updateData",
329
+ type: "bytes[]",
330
+ },
331
+ {
332
+ internalType: "bytes32[]",
333
+ name: "priceIds",
334
+ type: "bytes32[]",
335
+ },
336
+ {
337
+ internalType: "uint64",
338
+ name: "minPublishTime",
339
+ type: "uint64",
340
+ },
341
+ {
342
+ internalType: "uint64",
343
+ name: "maxPublishTime",
344
+ type: "uint64",
345
+ },
346
+ ],
347
+ name: "parsePriceFeedUpdates",
348
+ outputs: [
349
+ {
350
+ components: [
351
+ {
352
+ internalType: "bytes32",
353
+ name: "id",
354
+ type: "bytes32",
355
+ },
356
+ {
357
+ components: [
358
+ {
359
+ internalType: "int64",
360
+ name: "price",
361
+ type: "int64",
362
+ },
363
+ {
364
+ internalType: "uint64",
365
+ name: "conf",
366
+ type: "uint64",
367
+ },
368
+ {
369
+ internalType: "int32",
370
+ name: "expo",
371
+ type: "int32",
372
+ },
373
+ {
374
+ internalType: "uint256",
375
+ name: "publishTime",
376
+ type: "uint256",
377
+ },
378
+ ],
379
+ internalType: "struct PythStructs.Price",
380
+ name: "price",
381
+ type: "tuple",
382
+ },
383
+ {
384
+ components: [
385
+ {
386
+ internalType: "int64",
387
+ name: "price",
388
+ type: "int64",
389
+ },
390
+ {
391
+ internalType: "uint64",
392
+ name: "conf",
393
+ type: "uint64",
394
+ },
395
+ {
396
+ internalType: "int32",
397
+ name: "expo",
398
+ type: "int32",
399
+ },
400
+ {
401
+ internalType: "uint256",
402
+ name: "publishTime",
403
+ type: "uint256",
404
+ },
405
+ ],
406
+ internalType: "struct PythStructs.Price",
407
+ name: "emaPrice",
408
+ type: "tuple",
409
+ },
410
+ ],
411
+ internalType: "struct PythStructs.PriceFeed[]",
412
+ name: "priceFeeds",
413
+ type: "tuple[]",
414
+ },
415
+ ],
416
+ stateMutability: "payable",
417
+ type: "function",
418
+ },
419
+ {
420
+ inputs: [
421
+ {
422
+ internalType: "bytes[]",
423
+ name: "updateData",
424
+ type: "bytes[]",
425
+ },
426
+ {
427
+ internalType: "bytes32[]",
428
+ name: "priceIds",
429
+ type: "bytes32[]",
430
+ },
431
+ {
432
+ internalType: "uint64",
433
+ name: "minPublishTime",
434
+ type: "uint64",
435
+ },
436
+ {
437
+ internalType: "uint64",
438
+ name: "maxPublishTime",
439
+ type: "uint64",
440
+ },
441
+ ],
442
+ name: "parsePriceFeedUpdatesUnique",
443
+ outputs: [
444
+ {
445
+ components: [
446
+ {
447
+ internalType: "bytes32",
448
+ name: "id",
449
+ type: "bytes32",
450
+ },
451
+ {
452
+ components: [
453
+ {
454
+ internalType: "int64",
455
+ name: "price",
456
+ type: "int64",
457
+ },
458
+ {
459
+ internalType: "uint64",
460
+ name: "conf",
461
+ type: "uint64",
462
+ },
463
+ {
464
+ internalType: "int32",
465
+ name: "expo",
466
+ type: "int32",
467
+ },
468
+ {
469
+ internalType: "uint256",
470
+ name: "publishTime",
471
+ type: "uint256",
472
+ },
473
+ ],
474
+ internalType: "struct PythStructs.Price",
475
+ name: "price",
476
+ type: "tuple",
477
+ },
478
+ {
479
+ components: [
480
+ {
481
+ internalType: "int64",
482
+ name: "price",
483
+ type: "int64",
484
+ },
485
+ {
486
+ internalType: "uint64",
487
+ name: "conf",
488
+ type: "uint64",
489
+ },
490
+ {
491
+ internalType: "int32",
492
+ name: "expo",
493
+ type: "int32",
494
+ },
495
+ {
496
+ internalType: "uint256",
497
+ name: "publishTime",
498
+ type: "uint256",
499
+ },
500
+ ],
501
+ internalType: "struct PythStructs.Price",
502
+ name: "emaPrice",
503
+ type: "tuple",
504
+ },
505
+ ],
506
+ internalType: "struct PythStructs.PriceFeed[]",
507
+ name: "priceFeeds",
508
+ type: "tuple[]",
509
+ },
510
+ ],
511
+ stateMutability: "payable",
512
+ type: "function",
513
+ },
514
+ {
515
+ inputs: [
516
+ {
517
+ internalType: "bytes[]",
518
+ name: "updateData",
519
+ type: "bytes[]",
520
+ },
521
+ ],
522
+ name: "updatePriceFeeds",
523
+ outputs: [],
524
+ stateMutability: "payable",
525
+ type: "function",
526
+ },
527
+ {
528
+ inputs: [
529
+ {
530
+ internalType: "bytes[]",
531
+ name: "updateData",
532
+ type: "bytes[]",
533
+ },
534
+ {
535
+ internalType: "bytes32[]",
536
+ name: "priceIds",
537
+ type: "bytes32[]",
538
+ },
539
+ {
540
+ internalType: "uint64[]",
541
+ name: "publishTimes",
542
+ type: "uint64[]",
543
+ },
544
+ ],
545
+ name: "updatePriceFeedsIfNecessary",
546
+ outputs: [],
547
+ stateMutability: "payable",
548
+ type: "function",
549
+ },
550
+ ];
551
+ exports.IPythEventsAbi = [
552
+ {
553
+ anonymous: false,
554
+ inputs: [
555
+ {
556
+ indexed: true,
557
+ internalType: "bytes32",
558
+ name: "id",
559
+ type: "bytes32",
560
+ },
561
+ {
562
+ indexed: false,
563
+ internalType: "uint64",
564
+ name: "publishTime",
565
+ type: "uint64",
566
+ },
567
+ {
568
+ indexed: false,
569
+ internalType: "int64",
570
+ name: "price",
571
+ type: "int64",
572
+ },
573
+ {
574
+ indexed: false,
575
+ internalType: "uint64",
576
+ name: "conf",
577
+ type: "uint64",
578
+ },
579
+ ],
580
+ name: "PriceFeedUpdate",
581
+ type: "event",
582
+ },
583
+ ];
584
+ exports.PythErrorsAbi = [
585
+ {
586
+ inputs: [],
587
+ name: "InsufficientFee",
588
+ type: "error",
589
+ },
590
+ {
591
+ inputs: [],
592
+ name: "InvalidArgument",
593
+ type: "error",
594
+ },
595
+ {
596
+ inputs: [],
597
+ name: "InvalidGovernanceDataSource",
598
+ type: "error",
599
+ },
600
+ {
601
+ inputs: [],
602
+ name: "InvalidGovernanceMessage",
603
+ type: "error",
604
+ },
605
+ {
606
+ inputs: [],
607
+ name: "InvalidGovernanceTarget",
608
+ type: "error",
609
+ },
610
+ {
611
+ inputs: [],
612
+ name: "InvalidUpdateData",
613
+ type: "error",
614
+ },
615
+ {
616
+ inputs: [],
617
+ name: "InvalidUpdateDataSource",
618
+ type: "error",
619
+ },
620
+ {
621
+ inputs: [],
622
+ name: "InvalidWormholeAddressToSet",
623
+ type: "error",
624
+ },
625
+ {
626
+ inputs: [],
627
+ name: "InvalidWormholeVaa",
628
+ type: "error",
629
+ },
630
+ {
631
+ inputs: [],
632
+ name: "NoFreshUpdate",
633
+ type: "error",
634
+ },
635
+ {
636
+ inputs: [],
637
+ name: "OldGovernanceMessage",
638
+ type: "error",
639
+ },
640
+ {
641
+ inputs: [],
642
+ name: "PriceFeedNotFound",
643
+ type: "error",
644
+ },
645
+ {
646
+ inputs: [],
647
+ name: "PriceFeedNotFoundWithinRange",
648
+ type: "error",
649
+ },
650
+ {
651
+ inputs: [],
652
+ name: "StalePrice",
653
+ type: "error",
654
+ },
655
+ ];
656
+ exports.PythAbi = [
657
+ ...exports.IPythAbi,
658
+ ...exports.IPythEventsAbi,
659
+ ...exports.PythErrorsAbi,
660
+ ];
@@ -0,0 +1,6 @@
1
+ import { Address, GetContractReturnType } from "viem";
2
+ import { PythAbi } from "./pyth-abi";
3
+ import { SuperWalletClient } from "./super-wallet";
4
+ export type PythContract = GetContractReturnType<typeof PythAbi, SuperWalletClient>;
5
+ export declare const createPythContract: (client: SuperWalletClient, address: Address) => PythContract;
6
+ //# sourceMappingURL=pyth-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pyth-contract.d.ts","sourceRoot":"","sources":["../../src/evm/pyth-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,OAAO,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAC9C,OAAO,OAAO,EACd,iBAAiB,CAClB,CAAC;AAEF,eAAO,MAAM,kBAAkB,WACrB,iBAAiB,WAChB,OAAO,KACf,YAKC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createPythContract = void 0;
4
+ const viem_1 = require("viem");
5
+ const pyth_abi_1 = require("./pyth-abi");
6
+ const createPythContract = (client, address) => (0, viem_1.getContract)({
7
+ client,
8
+ abi: pyth_abi_1.PythAbi,
9
+ address,
10
+ });
11
+ exports.createPythContract = createPythContract;
@@ -0,0 +1,4 @@
1
+ import { Account, Chain, Client, RpcSchema, WalletActions, PublicActions, Transport } from "viem";
2
+ export type SuperWalletClient = Client<Transport, Chain, Account, RpcSchema, PublicActions<Transport, Chain, Account> & WalletActions<Chain, Account>>;
3
+ export declare const createClient: (endpoint: string, mnemonic: string) => Promise<SuperWalletClient>;
4
+ //# sourceMappingURL=super-wallet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"super-wallet.d.ts","sourceRoot":"","sources":["../../src/evm/super-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,OAAO,EACP,KAAK,EAEL,MAAM,EACN,SAAS,EACT,aAAa,EACb,aAAa,EAGb,SAAS,EACV,MAAM,MAAM,CAAC;AAmBd,MAAM,MAAM,iBAAiB,GAAG,MAAM,CACpC,SAAS,EACT,KAAK,EACL,OAAO,EACP,SAAS,EACT,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CACzE,CAAC;AAcF,eAAO,MAAM,YAAY,aACb,MAAM,YACN,MAAM,KACf,QAAQ,iBAAiB,CAY3B,CAAC"}