@sentio/sdk 2.5.1-rc.1 → 2.5.1-rc.2

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 (245) hide show
  1. package/lib/eth/codegen/event-handler.js.map +1 -1
  2. package/lib/eth/codegen/functions-handler.js +4 -9
  3. package/lib/eth/codegen/functions-handler.js.map +1 -1
  4. package/lib/eth/context.js.map +1 -1
  5. package/lib/eth/index.d.ts +0 -1
  6. package/lib/eth/index.js +0 -1
  7. package/lib/eth/index.js.map +1 -1
  8. package/lib/move/abstract-codegen.js +3 -9
  9. package/lib/move/abstract-codegen.js.map +1 -1
  10. package/lib/sui/sui-processor.js.map +1 -1
  11. package/lib/utils/dex-price.test.js.map +1 -1
  12. package/lib/utils/erc20.test.js.map +1 -1
  13. package/package.json +5 -8
  14. package/src/eth/codegen/event-handler.ts +1 -1
  15. package/src/eth/codegen/functions-handler.ts +4 -10
  16. package/src/eth/context.ts +0 -1
  17. package/src/eth/index.ts +0 -1
  18. package/src/move/abstract-codegen.ts +3 -10
  19. package/src/sui/sui-processor.ts +1 -1
  20. package/lib/aptos/tests/aptos.test.d.ts +0 -1
  21. package/lib/aptos/tests/aptos.test.js.map +0 -1
  22. package/lib/aptos/tests/souffl3.d.ts +0 -1
  23. package/lib/aptos/tests/souffl3.js +0 -43
  24. package/lib/aptos/tests/souffl3.js.map +0 -1
  25. package/lib/aptos/tests/types/index.d.ts +0 -3
  26. package/lib/aptos/tests/types/index.js +0 -7
  27. package/lib/aptos/tests/types/index.js.map +0 -1
  28. package/lib/aptos/tests/types/reserved.d.ts +0 -340
  29. package/lib/aptos/tests/types/reserved.js +0 -287
  30. package/lib/aptos/tests/types/reserved.js.map +0 -1
  31. package/lib/aptos/tests/types/soffl3.d.ts +0 -801
  32. package/lib/aptos/tests/types/soffl3.js +0 -514
  33. package/lib/aptos/tests/types/soffl3.js.map +0 -1
  34. package/lib/aptos/tests/types/souffle.d.ts +0 -335
  35. package/lib/aptos/tests/types/souffle.js +0 -281
  36. package/lib/aptos/tests/types/souffle.js.map +0 -1
  37. package/lib/eth/error.d.ts +0 -1
  38. package/lib/eth/error.js +0 -3
  39. package/lib/eth/error.js.map +0 -1
  40. package/lib/eth/tests/account.test.d.ts +0 -1
  41. package/lib/eth/tests/account.test.js.map +0 -1
  42. package/lib/eth/tests/codegen.test.d.ts +0 -1
  43. package/lib/eth/tests/codegen.test.js.map +0 -1
  44. package/lib/eth/tests/erc20-template.test.d.ts +0 -1
  45. package/lib/eth/tests/erc20-template.test.js.map +0 -1
  46. package/lib/eth/tests/erc20.d.ts +0 -1
  47. package/lib/eth/tests/erc20.js +0 -52
  48. package/lib/eth/tests/erc20.js.map +0 -1
  49. package/lib/eth/tests/erc20.test.d.ts +0 -1
  50. package/lib/eth/tests/erc20.test.js.map +0 -1
  51. package/lib/eth/tests/error-capture.test.d.ts +0 -1
  52. package/lib/eth/tests/error-capture.test.js.map +0 -1
  53. package/lib/eth/tests/logger.test.d.ts +0 -1
  54. package/lib/eth/tests/logger.test.js.map +0 -1
  55. package/lib/eth/tests/types/anyswaprouter.d.ts +0 -3
  56. package/lib/eth/tests/types/anyswaprouter.js +0 -7
  57. package/lib/eth/tests/types/anyswaprouter.js.map +0 -1
  58. package/lib/eth/tests/types/commitmentpool.d.ts +0 -3
  59. package/lib/eth/tests/types/commitmentpool.js +0 -7
  60. package/lib/eth/tests/types/commitmentpool.js.map +0 -1
  61. package/lib/eth/tests/types/index.d.ts +0 -12
  62. package/lib/eth/tests/types/index.js +0 -16
  63. package/lib/eth/tests/types/index.js.map +0 -1
  64. package/lib/eth/tests/types/internal/AnyswapRouter.d.ts +0 -122
  65. package/lib/eth/tests/types/internal/AnyswapRouter.js +0 -2
  66. package/lib/eth/tests/types/internal/AnyswapRouter.js.map +0 -1
  67. package/lib/eth/tests/types/internal/CommitmentPool.d.ts +0 -176
  68. package/lib/eth/tests/types/internal/CommitmentPool.js +0 -2
  69. package/lib/eth/tests/types/internal/CommitmentPool.js.map +0 -1
  70. package/lib/eth/tests/types/internal/MembershipStakerV3.d.ts +0 -81
  71. package/lib/eth/tests/types/internal/MembershipStakerV3.js +0 -2
  72. package/lib/eth/tests/types/internal/MembershipStakerV3.js.map +0 -1
  73. package/lib/eth/tests/types/internal/Pyth.d.ts +0 -204
  74. package/lib/eth/tests/types/internal/Pyth.js +0 -2
  75. package/lib/eth/tests/types/internal/Pyth.js.map +0 -1
  76. package/lib/eth/tests/types/internal/Seaport.d.ts +0 -350
  77. package/lib/eth/tests/types/internal/Seaport.js +0 -2
  78. package/lib/eth/tests/types/internal/Seaport.js.map +0 -1
  79. package/lib/eth/tests/types/internal/TokenExchange.d.ts +0 -128
  80. package/lib/eth/tests/types/internal/TokenExchange.js +0 -2
  81. package/lib/eth/tests/types/internal/TokenExchange.js.map +0 -1
  82. package/lib/eth/tests/types/internal/anyswaprouter-processor.d.ts +0 -463
  83. package/lib/eth/tests/types/internal/anyswaprouter-processor.js +0 -425
  84. package/lib/eth/tests/types/internal/anyswaprouter-processor.js.map +0 -1
  85. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.d.ts +0 -9
  86. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.js +0 -124
  87. package/lib/eth/tests/types/internal/anyswaprouter-test-utils.js.map +0 -1
  88. package/lib/eth/tests/types/internal/commitmentpool-processor.d.ts +0 -348
  89. package/lib/eth/tests/types/internal/commitmentpool-processor.js +0 -607
  90. package/lib/eth/tests/types/internal/commitmentpool-processor.js.map +0 -1
  91. package/lib/eth/tests/types/internal/commitmentpool-test-utils.d.ts +0 -9
  92. package/lib/eth/tests/types/internal/commitmentpool-test-utils.js +0 -87
  93. package/lib/eth/tests/types/internal/commitmentpool-test-utils.js.map +0 -1
  94. package/lib/eth/tests/types/internal/common.d.ts +0 -10
  95. package/lib/eth/tests/types/internal/common.js +0 -8
  96. package/lib/eth/tests/types/internal/common.js.map +0 -1
  97. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.d.ts +0 -988
  98. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.js +0 -1269
  99. package/lib/eth/tests/types/internal/factories/AnyswapRouter__factory.js.map +0 -1
  100. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.d.ts +0 -792
  101. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.js +0 -1040
  102. package/lib/eth/tests/types/internal/factories/CommitmentPool__factory.js.map +0 -1
  103. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.d.ts +0 -549
  104. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.js +0 -721
  105. package/lib/eth/tests/types/internal/factories/MembershipStakerV3__factory.js.map +0 -1
  106. package/lib/eth/tests/types/internal/factories/Pyth__factory.d.ts +0 -1130
  107. package/lib/eth/tests/types/internal/factories/Pyth__factory.js +0 -1486
  108. package/lib/eth/tests/types/internal/factories/Pyth__factory.js.map +0 -1
  109. package/lib/eth/tests/types/internal/factories/Seaport__factory.d.ts +0 -2018
  110. package/lib/eth/tests/types/internal/factories/Seaport__factory.js +0 -2610
  111. package/lib/eth/tests/types/internal/factories/Seaport__factory.js.map +0 -1
  112. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.d.ts +0 -651
  113. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.js +0 -853
  114. package/lib/eth/tests/types/internal/factories/TokenExchange__factory.js.map +0 -1
  115. package/lib/eth/tests/types/internal/factories/index.d.ts +0 -6
  116. package/lib/eth/tests/types/internal/factories/index.js +0 -10
  117. package/lib/eth/tests/types/internal/factories/index.js.map +0 -1
  118. package/lib/eth/tests/types/internal/index.d.ts +0 -13
  119. package/lib/eth/tests/types/internal/index.js +0 -8
  120. package/lib/eth/tests/types/internal/index.js.map +0 -1
  121. package/lib/eth/tests/types/internal/membershipstakerv3-processor.d.ts +0 -287
  122. package/lib/eth/tests/types/internal/membershipstakerv3-processor.js +0 -596
  123. package/lib/eth/tests/types/internal/membershipstakerv3-processor.js.map +0 -1
  124. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.d.ts +0 -11
  125. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.js +0 -109
  126. package/lib/eth/tests/types/internal/membershipstakerv3-test-utils.js.map +0 -1
  127. package/lib/eth/tests/types/internal/pyth-processor.d.ts +0 -422
  128. package/lib/eth/tests/types/internal/pyth-processor.js +0 -890
  129. package/lib/eth/tests/types/internal/pyth-processor.js.map +0 -1
  130. package/lib/eth/tests/types/internal/pyth-test-utils.d.ts +0 -13
  131. package/lib/eth/tests/types/internal/pyth-test-utils.js +0 -131
  132. package/lib/eth/tests/types/internal/pyth-test-utils.js.map +0 -1
  133. package/lib/eth/tests/types/internal/seaport-processor.d.ts +0 -211
  134. package/lib/eth/tests/types/internal/seaport-processor.js +0 -237
  135. package/lib/eth/tests/types/internal/seaport-processor.js.map +0 -1
  136. package/lib/eth/tests/types/internal/seaport-test-utils.d.ts +0 -6
  137. package/lib/eth/tests/types/internal/seaport-test-utils.js +0 -61
  138. package/lib/eth/tests/types/internal/seaport-test-utils.js.map +0 -1
  139. package/lib/eth/tests/types/internal/tokenexchange-processor.d.ts +0 -334
  140. package/lib/eth/tests/types/internal/tokenexchange-processor.js +0 -667
  141. package/lib/eth/tests/types/internal/tokenexchange-processor.js.map +0 -1
  142. package/lib/eth/tests/types/internal/tokenexchange-test-utils.d.ts +0 -13
  143. package/lib/eth/tests/types/internal/tokenexchange-test-utils.js +0 -149
  144. package/lib/eth/tests/types/internal/tokenexchange-test-utils.js.map +0 -1
  145. package/lib/eth/tests/types/membershipstakerv3.d.ts +0 -3
  146. package/lib/eth/tests/types/membershipstakerv3.js +0 -7
  147. package/lib/eth/tests/types/membershipstakerv3.js.map +0 -1
  148. package/lib/eth/tests/types/pyth.d.ts +0 -3
  149. package/lib/eth/tests/types/pyth.js +0 -7
  150. package/lib/eth/tests/types/pyth.js.map +0 -1
  151. package/lib/eth/tests/types/seaport.d.ts +0 -3
  152. package/lib/eth/tests/types/seaport.js +0 -7
  153. package/lib/eth/tests/types/seaport.js.map +0 -1
  154. package/lib/eth/tests/types/tokenexchange.d.ts +0 -3
  155. package/lib/eth/tests/types/tokenexchange.js +0 -7
  156. package/lib/eth/tests/types/tokenexchange.js.map +0 -1
  157. package/lib/solana/tests/solana.test.d.ts +0 -1
  158. package/lib/solana/tests/solana.test.js.map +0 -1
  159. package/lib/solana/tests/types/basic_1.d.ts +0 -26
  160. package/lib/solana/tests/types/basic_1.js +0 -63
  161. package/lib/solana/tests/types/basic_1.js.map +0 -1
  162. package/lib/solana/tests/types/basic_1_processor.d.ts +0 -21
  163. package/lib/solana/tests/types/basic_1_processor.js +0 -35
  164. package/lib/solana/tests/types/basic_1_processor.js.map +0 -1
  165. package/lib/solana/tests/types/token_bridge.d.ts +0 -29
  166. package/lib/solana/tests/types/token_bridge.js +0 -938
  167. package/lib/solana/tests/types/token_bridge.js.map +0 -1
  168. package/lib/solana/tests/types/token_bridge_processor.d.ts +0 -212
  169. package/lib/solana/tests/types/token_bridge_processor.js +0 -134
  170. package/lib/solana/tests/types/token_bridge_processor.js.map +0 -1
  171. package/lib/solana/tests/wormhole-token-bridge.d.ts +0 -15
  172. package/lib/solana/tests/wormhole-token-bridge.js +0 -79
  173. package/lib/solana/tests/wormhole-token-bridge.js.map +0 -1
  174. package/lib/sui/tests/sui.test.d.ts +0 -1
  175. package/lib/sui/tests/sui.test.js.map +0 -1
  176. package/lib/sui/tests/types/index.d.ts +0 -1
  177. package/lib/sui/tests/types/index.js +0 -5
  178. package/lib/sui/tests/types/index.js.map +0 -1
  179. package/lib/sui/tests/types/testnet/index.d.ts +0 -1
  180. package/lib/sui/tests/types/testnet/index.js +0 -5
  181. package/lib/sui/tests/types/testnet/index.js.map +0 -1
  182. package/lib/sui/tests/types/testnet/swap.d.ts +0 -249
  183. package/lib/sui/tests/types/testnet/swap.js +0 -310
  184. package/lib/sui/tests/types/testnet/swap.js.map +0 -1
  185. package/src/aptos/tests/abis/reserved.json +0 -402
  186. package/src/aptos/tests/abis/soffl3.json +0 -1411
  187. package/src/aptos/tests/abis/souffle.json +0 -389
  188. package/src/aptos/tests/souffl3.ts +0 -56
  189. package/src/aptos/tests/types/index.ts +0 -6
  190. package/src/aptos/tests/types/reserved.ts +0 -766
  191. package/src/aptos/tests/types/soffl3.ts +0 -1528
  192. package/src/aptos/tests/types/souffle.ts +0 -765
  193. package/src/eth/error.ts +0 -4
  194. package/src/eth/tests/abis/eth/CommitmentPool.json +0 -1034
  195. package/src/eth/tests/abis/eth/MembershipStakerV3.json +0 -706
  196. package/src/eth/tests/abis/eth/Pyth.json +0 -1471
  197. package/src/eth/tests/abis/eth/Seaport.json +0 -2595
  198. package/src/eth/tests/abis/eth/TokenExchange.json +0 -838
  199. package/src/eth/tests/abis/eth/anyswapRouter.json +0 -490
  200. package/src/eth/tests/erc20.ts +0 -63
  201. package/src/eth/tests/types/anyswaprouter.ts +0 -7
  202. package/src/eth/tests/types/commitmentpool.ts +0 -7
  203. package/src/eth/tests/types/index.ts +0 -33
  204. package/src/eth/tests/types/internal/AnyswapRouter.ts +0 -122
  205. package/src/eth/tests/types/internal/CommitmentPool.ts +0 -208
  206. package/src/eth/tests/types/internal/MembershipStakerV3.ts +0 -108
  207. package/src/eth/tests/types/internal/Pyth.ts +0 -246
  208. package/src/eth/tests/types/internal/Seaport.ts +0 -389
  209. package/src/eth/tests/types/internal/TokenExchange.ts +0 -142
  210. package/src/eth/tests/types/internal/anyswaprouter-processor.ts +0 -1396
  211. package/src/eth/tests/types/internal/anyswaprouter-test-utils.ts +0 -187
  212. package/src/eth/tests/types/internal/commitmentpool-processor.ts +0 -1575
  213. package/src/eth/tests/types/internal/commitmentpool-test-utils.ts +0 -150
  214. package/src/eth/tests/types/internal/common.ts +0 -23
  215. package/src/eth/tests/types/internal/factories/AnyswapRouter__factory.ts +0 -1278
  216. package/src/eth/tests/types/internal/factories/CommitmentPool__factory.ts +0 -1049
  217. package/src/eth/tests/types/internal/factories/MembershipStakerV3__factory.ts +0 -730
  218. package/src/eth/tests/types/internal/factories/Pyth__factory.ts +0 -1492
  219. package/src/eth/tests/types/internal/factories/Seaport__factory.ts +0 -2616
  220. package/src/eth/tests/types/internal/factories/TokenExchange__factory.ts +0 -862
  221. package/src/eth/tests/types/internal/factories/index.ts +0 -9
  222. package/src/eth/tests/types/internal/index.ts +0 -16
  223. package/src/eth/tests/types/internal/membershipstakerv3-processor.ts +0 -1399
  224. package/src/eth/tests/types/internal/membershipstakerv3-test-utils.ts +0 -188
  225. package/src/eth/tests/types/internal/pyth-processor.ts +0 -2043
  226. package/src/eth/tests/types/internal/pyth-test-utils.ts +0 -226
  227. package/src/eth/tests/types/internal/seaport-processor.ts +0 -678
  228. package/src/eth/tests/types/internal/seaport-test-utils.ts +0 -100
  229. package/src/eth/tests/types/internal/tokenexchange-processor.ts +0 -1570
  230. package/src/eth/tests/types/internal/tokenexchange-test-utils.ts +0 -244
  231. package/src/eth/tests/types/membershipstakerv3.ts +0 -7
  232. package/src/eth/tests/types/pyth.ts +0 -7
  233. package/src/eth/tests/types/seaport.ts +0 -7
  234. package/src/eth/tests/types/tokenexchange.ts +0 -7
  235. package/src/solana/tests/abis/basic_1.json +0 -62
  236. package/src/solana/tests/abis/token_bridge.json +0 -937
  237. package/src/solana/tests/types/basic_1.ts +0 -62
  238. package/src/solana/tests/types/basic_1_processor.ts +0 -42
  239. package/src/solana/tests/types/token_bridge.ts +0 -937
  240. package/src/solana/tests/types/token_bridge_processor.ts +0 -150
  241. package/src/solana/tests/wormhole-token-bridge.ts +0 -96
  242. package/src/sui/tests/abis/testnet/swap.json +0 -1752
  243. package/src/sui/tests/types/index.ts +0 -3
  244. package/src/sui/tests/types/testnet/index.ts +0 -4
  245. package/src/sui/tests/types/testnet/swap.ts +0 -698
@@ -1,2043 +0,0 @@
1
- /* Autogenerated file. Do not edit manually. */
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- import { BigNumberish, Overrides, BytesLike } from "ethers";
5
- import { Networkish } from "ethers/providers";
6
- import {
7
- addContractByABI,
8
- getContractByABI,
9
- addProcessor,
10
- getProcessor,
11
- getProvider,
12
- transformEtherError,
13
- Trace,
14
- BindOptions,
15
- BaseProcessor,
16
- BaseProcessorTemplate,
17
- BoundContractView,
18
- ContractContext,
19
- ContractView,
20
- DummyProvider,
21
- TypedCallTrace,
22
- toBlockTag,
23
- } from "@sentio/sdk/eth";
24
- import { EthFetchConfig } from "@sentio/protos";
25
-
26
- import { Pyth, Pyth__factory } from "./index.js";
27
- import {
28
- AdminChangedEvent,
29
- AdminChangedEventFilter,
30
- BatchPriceFeedUpdateEvent,
31
- BatchPriceFeedUpdateEventFilter,
32
- BeaconUpgradedEvent,
33
- BeaconUpgradedEventFilter,
34
- ContractUpgradedEvent,
35
- ContractUpgradedEventFilter,
36
- DataSourcesSetEvent,
37
- DataSourcesSetEventFilter,
38
- FeeSetEvent,
39
- FeeSetEventFilter,
40
- GovernanceDataSourceSetEvent,
41
- GovernanceDataSourceSetEventFilter,
42
- OwnershipTransferredEvent,
43
- OwnershipTransferredEventFilter,
44
- PriceFeedUpdateEvent,
45
- PriceFeedUpdateEventFilter,
46
- UpgradedEvent,
47
- UpgradedEventFilter,
48
- ValidPeriodSetEvent,
49
- ValidPeriodSetEventFilter,
50
- PythInternalStructs,
51
- PythStructs,
52
- PythGovernanceInstructions,
53
- } from "./Pyth.js";
54
-
55
- export interface ChainIdCallObject {}
56
-
57
- export type ChainIdCallTrace = TypedCallTrace<[], ChainIdCallObject> & Trace;
58
-
59
- export interface ExecuteGovernanceInstructionCallObject {
60
- encodedVM: string;
61
- }
62
-
63
- export type ExecuteGovernanceInstructionCallTrace = TypedCallTrace<
64
- [string],
65
- ExecuteGovernanceInstructionCallObject
66
- > &
67
- Trace;
68
-
69
- export interface GetEmaPriceCallObject {
70
- id: string;
71
- }
72
-
73
- export type GetEmaPriceCallTrace = TypedCallTrace<
74
- [string],
75
- GetEmaPriceCallObject
76
- > &
77
- Trace;
78
-
79
- export interface GetEmaPriceNoOlderThanCallObject {
80
- id: string;
81
- age: bigint;
82
- }
83
-
84
- export type GetEmaPriceNoOlderThanCallTrace = TypedCallTrace<
85
- [string, bigint],
86
- GetEmaPriceNoOlderThanCallObject
87
- > &
88
- Trace;
89
-
90
- export interface GetEmaPriceUnsafeCallObject {
91
- id: string;
92
- }
93
-
94
- export type GetEmaPriceUnsafeCallTrace = TypedCallTrace<
95
- [string],
96
- GetEmaPriceUnsafeCallObject
97
- > &
98
- Trace;
99
-
100
- export interface GetPriceCallObject {
101
- id: string;
102
- }
103
-
104
- export type GetPriceCallTrace = TypedCallTrace<[string], GetPriceCallObject> &
105
- Trace;
106
-
107
- export interface GetPriceNoOlderThanCallObject {
108
- id: string;
109
- age: bigint;
110
- }
111
-
112
- export type GetPriceNoOlderThanCallTrace = TypedCallTrace<
113
- [string, bigint],
114
- GetPriceNoOlderThanCallObject
115
- > &
116
- Trace;
117
-
118
- export interface GetPriceUnsafeCallObject {
119
- id: string;
120
- }
121
-
122
- export type GetPriceUnsafeCallTrace = TypedCallTrace<
123
- [string],
124
- GetPriceUnsafeCallObject
125
- > &
126
- Trace;
127
-
128
- export interface GetUpdateFee_bytes_arrayCallObject {
129
- updateData: string[];
130
- }
131
-
132
- export type GetUpdateFee_bytes_arrayCallTrace = TypedCallTrace<
133
- [string[]],
134
- GetUpdateFee_bytes_arrayCallObject
135
- > &
136
- Trace;
137
-
138
- export interface GetUpdateFee_uint256CallObject {
139
- updateDataSize: bigint;
140
- }
141
-
142
- export type GetUpdateFee_uint256CallTrace = TypedCallTrace<
143
- [bigint],
144
- GetUpdateFee_uint256CallObject
145
- > &
146
- Trace;
147
-
148
- export interface GetValidTimePeriodCallObject {}
149
-
150
- export type GetValidTimePeriodCallTrace = TypedCallTrace<
151
- [],
152
- GetValidTimePeriodCallObject
153
- > &
154
- Trace;
155
-
156
- export interface GovernanceDataSourceCallObject {}
157
-
158
- export type GovernanceDataSourceCallTrace = TypedCallTrace<
159
- [],
160
- GovernanceDataSourceCallObject
161
- > &
162
- Trace;
163
-
164
- export interface GovernanceDataSourceIndexCallObject {}
165
-
166
- export type GovernanceDataSourceIndexCallTrace = TypedCallTrace<
167
- [],
168
- GovernanceDataSourceIndexCallObject
169
- > &
170
- Trace;
171
-
172
- export interface HashDataSourceCallObject {
173
- ds: PythInternalStructs.DataSourceStructOutput;
174
- }
175
-
176
- export type HashDataSourceCallTrace = TypedCallTrace<
177
- [PythInternalStructs.DataSourceStructOutput],
178
- HashDataSourceCallObject
179
- > &
180
- Trace;
181
-
182
- export interface InitializeCallObject {
183
- wormhole: string;
184
- dataSourceEmitterChainIds: bigint[];
185
- dataSourceEmitterAddresses: string[];
186
- governanceEmitterChainId: bigint;
187
- governanceEmitterAddress: string;
188
- governanceInitialSequence: bigint;
189
- validTimePeriodSeconds: bigint;
190
- singleUpdateFeeInWei: bigint;
191
- }
192
-
193
- export type InitializeCallTrace = TypedCallTrace<
194
- [string, bigint[], string[], bigint, string, bigint, bigint, bigint],
195
- InitializeCallObject
196
- > &
197
- Trace;
198
-
199
- export interface IsValidDataSourceCallObject {
200
- dataSourceChainId: bigint;
201
- dataSourceEmitterAddress: string;
202
- }
203
-
204
- export type IsValidDataSourceCallTrace = TypedCallTrace<
205
- [bigint, string],
206
- IsValidDataSourceCallObject
207
- > &
208
- Trace;
209
-
210
- export interface IsValidGovernanceDataSourceCallObject {
211
- governanceChainId: bigint;
212
- governanceEmitterAddress: string;
213
- }
214
-
215
- export type IsValidGovernanceDataSourceCallTrace = TypedCallTrace<
216
- [bigint, string],
217
- IsValidGovernanceDataSourceCallObject
218
- > &
219
- Trace;
220
-
221
- export interface LastExecutedGovernanceSequenceCallObject {}
222
-
223
- export type LastExecutedGovernanceSequenceCallTrace = TypedCallTrace<
224
- [],
225
- LastExecutedGovernanceSequenceCallObject
226
- > &
227
- Trace;
228
-
229
- export interface LatestPriceInfoPublishTimeCallObject {
230
- priceId: string;
231
- }
232
-
233
- export type LatestPriceInfoPublishTimeCallTrace = TypedCallTrace<
234
- [string],
235
- LatestPriceInfoPublishTimeCallObject
236
- > &
237
- Trace;
238
-
239
- export interface OwnerCallObject {}
240
-
241
- export type OwnerCallTrace = TypedCallTrace<[], OwnerCallObject> & Trace;
242
-
243
- export interface ParseAuthorizeGovernanceDataSourceTransferPayloadCallObject {
244
- encodedPayload: string;
245
- }
246
-
247
- export type ParseAuthorizeGovernanceDataSourceTransferPayloadCallTrace =
248
- TypedCallTrace<
249
- [string],
250
- ParseAuthorizeGovernanceDataSourceTransferPayloadCallObject
251
- > &
252
- Trace;
253
-
254
- export interface ParseGovernanceInstructionCallObject {
255
- encodedInstruction: string;
256
- }
257
-
258
- export type ParseGovernanceInstructionCallTrace = TypedCallTrace<
259
- [string],
260
- ParseGovernanceInstructionCallObject
261
- > &
262
- Trace;
263
-
264
- export interface ParsePriceFeedUpdatesCallObject {
265
- updateData: string[];
266
- priceIds: string[];
267
- minPublishTime: bigint;
268
- maxPublishTime: bigint;
269
- }
270
-
271
- export type ParsePriceFeedUpdatesCallTrace = TypedCallTrace<
272
- [string[], string[], bigint, bigint],
273
- ParsePriceFeedUpdatesCallObject
274
- > &
275
- Trace;
276
-
277
- export interface ParseRequestGovernanceDataSourceTransferPayloadCallObject {
278
- encodedPayload: string;
279
- }
280
-
281
- export type ParseRequestGovernanceDataSourceTransferPayloadCallTrace =
282
- TypedCallTrace<
283
- [string],
284
- ParseRequestGovernanceDataSourceTransferPayloadCallObject
285
- > &
286
- Trace;
287
-
288
- export interface ParseSetDataSourcesPayloadCallObject {
289
- encodedPayload: string;
290
- }
291
-
292
- export type ParseSetDataSourcesPayloadCallTrace = TypedCallTrace<
293
- [string],
294
- ParseSetDataSourcesPayloadCallObject
295
- > &
296
- Trace;
297
-
298
- export interface ParseSetFeePayloadCallObject {
299
- encodedPayload: string;
300
- }
301
-
302
- export type ParseSetFeePayloadCallTrace = TypedCallTrace<
303
- [string],
304
- ParseSetFeePayloadCallObject
305
- > &
306
- Trace;
307
-
308
- export interface ParseSetValidPeriodPayloadCallObject {
309
- encodedPayload: string;
310
- }
311
-
312
- export type ParseSetValidPeriodPayloadCallTrace = TypedCallTrace<
313
- [string],
314
- ParseSetValidPeriodPayloadCallObject
315
- > &
316
- Trace;
317
-
318
- export interface ParseUpgradeContractPayloadCallObject {
319
- encodedPayload: string;
320
- }
321
-
322
- export type ParseUpgradeContractPayloadCallTrace = TypedCallTrace<
323
- [string],
324
- ParseUpgradeContractPayloadCallObject
325
- > &
326
- Trace;
327
-
328
- export interface PriceFeedExistsCallObject {
329
- id: string;
330
- }
331
-
332
- export type PriceFeedExistsCallTrace = TypedCallTrace<
333
- [string],
334
- PriceFeedExistsCallObject
335
- > &
336
- Trace;
337
-
338
- export interface ProxiableUUIDCallObject {}
339
-
340
- export type ProxiableUUIDCallTrace = TypedCallTrace<
341
- [],
342
- ProxiableUUIDCallObject
343
- > &
344
- Trace;
345
-
346
- export interface PythUpgradableMagicCallObject {}
347
-
348
- export type PythUpgradableMagicCallTrace = TypedCallTrace<
349
- [],
350
- PythUpgradableMagicCallObject
351
- > &
352
- Trace;
353
-
354
- export interface QueryPriceFeedCallObject {
355
- id: string;
356
- }
357
-
358
- export type QueryPriceFeedCallTrace = TypedCallTrace<
359
- [string],
360
- QueryPriceFeedCallObject
361
- > &
362
- Trace;
363
-
364
- export interface RenounceOwnershipCallObject {}
365
-
366
- export type RenounceOwnershipCallTrace = TypedCallTrace<
367
- [],
368
- RenounceOwnershipCallObject
369
- > &
370
- Trace;
371
-
372
- export interface SingleUpdateFeeInWeiCallObject {}
373
-
374
- export type SingleUpdateFeeInWeiCallTrace = TypedCallTrace<
375
- [],
376
- SingleUpdateFeeInWeiCallObject
377
- > &
378
- Trace;
379
-
380
- export interface TransferOwnershipCallObject {
381
- newOwner: string;
382
- }
383
-
384
- export type TransferOwnershipCallTrace = TypedCallTrace<
385
- [string],
386
- TransferOwnershipCallObject
387
- > &
388
- Trace;
389
-
390
- export interface UpdatePriceFeedsCallObject {
391
- updateData: string[];
392
- }
393
-
394
- export type UpdatePriceFeedsCallTrace = TypedCallTrace<
395
- [string[]],
396
- UpdatePriceFeedsCallObject
397
- > &
398
- Trace;
399
-
400
- export interface UpdatePriceFeedsIfNecessaryCallObject {
401
- updateData: string[];
402
- priceIds: string[];
403
- publishTimes: bigint[];
404
- }
405
-
406
- export type UpdatePriceFeedsIfNecessaryCallTrace = TypedCallTrace<
407
- [string[], string[], bigint[]],
408
- UpdatePriceFeedsIfNecessaryCallObject
409
- > &
410
- Trace;
411
-
412
- export interface UpgradeToCallObject {
413
- newImplementation: string;
414
- }
415
-
416
- export type UpgradeToCallTrace = TypedCallTrace<[string], UpgradeToCallObject> &
417
- Trace;
418
-
419
- export interface UpgradeToAndCallCallObject {
420
- newImplementation: string;
421
- data: string;
422
- }
423
-
424
- export type UpgradeToAndCallCallTrace = TypedCallTrace<
425
- [string, string],
426
- UpgradeToAndCallCallObject
427
- > &
428
- Trace;
429
-
430
- export interface ValidDataSourcesCallObject {}
431
-
432
- export type ValidDataSourcesCallTrace = TypedCallTrace<
433
- [],
434
- ValidDataSourcesCallObject
435
- > &
436
- Trace;
437
-
438
- export interface ValidTimePeriodSecondsCallObject {}
439
-
440
- export type ValidTimePeriodSecondsCallTrace = TypedCallTrace<
441
- [],
442
- ValidTimePeriodSecondsCallObject
443
- > &
444
- Trace;
445
-
446
- export interface VersionCallObject {}
447
-
448
- export type VersionCallTrace = TypedCallTrace<[], VersionCallObject> & Trace;
449
-
450
- export interface WormholeCallObject {}
451
-
452
- export type WormholeCallTrace = TypedCallTrace<[], WormholeCallObject> & Trace;
453
-
454
- const templateContract = Pyth__factory.connect("0x0", DummyProvider);
455
-
456
- export class PythContractView extends ContractView<Pyth> {
457
- constructor(contract: Pyth) {
458
- super(contract);
459
- }
460
-
461
- async chainId(overrides?: Overrides): Promise<bigint> {
462
- try {
463
- return await this.contract.getFunction("chainId()")(overrides || {});
464
- } catch (e) {
465
- throw transformEtherError(e, undefined);
466
- }
467
- }
468
-
469
- async getEmaPrice(
470
- id: BytesLike,
471
- overrides?: Overrides
472
- ): Promise<PythStructs.PriceStructOutput> {
473
- try {
474
- return await this.contract.getFunction("getEmaPrice(bytes32)")(
475
- id,
476
- overrides || {}
477
- );
478
- } catch (e) {
479
- throw transformEtherError(e, undefined);
480
- }
481
- }
482
-
483
- async getEmaPriceNoOlderThan(
484
- id: BytesLike,
485
- age: BigNumberish,
486
- overrides?: Overrides
487
- ): Promise<PythStructs.PriceStructOutput> {
488
- try {
489
- return await this.contract.getFunction(
490
- "getEmaPriceNoOlderThan(bytes32,uint256)"
491
- )(id, age, overrides || {});
492
- } catch (e) {
493
- throw transformEtherError(e, undefined);
494
- }
495
- }
496
-
497
- async getEmaPriceUnsafe(
498
- id: BytesLike,
499
- overrides?: Overrides
500
- ): Promise<PythStructs.PriceStructOutput> {
501
- try {
502
- return await this.contract.getFunction("getEmaPriceUnsafe(bytes32)")(
503
- id,
504
- overrides || {}
505
- );
506
- } catch (e) {
507
- throw transformEtherError(e, undefined);
508
- }
509
- }
510
-
511
- async getPrice(
512
- id: BytesLike,
513
- overrides?: Overrides
514
- ): Promise<PythStructs.PriceStructOutput> {
515
- try {
516
- return await this.contract.getFunction("getPrice(bytes32)")(
517
- id,
518
- overrides || {}
519
- );
520
- } catch (e) {
521
- throw transformEtherError(e, undefined);
522
- }
523
- }
524
-
525
- async getPriceNoOlderThan(
526
- id: BytesLike,
527
- age: BigNumberish,
528
- overrides?: Overrides
529
- ): Promise<PythStructs.PriceStructOutput> {
530
- try {
531
- return await this.contract.getFunction(
532
- "getPriceNoOlderThan(bytes32,uint256)"
533
- )(id, age, overrides || {});
534
- } catch (e) {
535
- throw transformEtherError(e, undefined);
536
- }
537
- }
538
-
539
- async getPriceUnsafe(
540
- id: BytesLike,
541
- overrides?: Overrides
542
- ): Promise<PythStructs.PriceStructOutput> {
543
- try {
544
- return await this.contract.getFunction("getPriceUnsafe(bytes32)")(
545
- id,
546
- overrides || {}
547
- );
548
- } catch (e) {
549
- throw transformEtherError(e, undefined);
550
- }
551
- }
552
-
553
- async getUpdateFee_bytes_array(
554
- updateData: BytesLike[],
555
- overrides?: Overrides
556
- ): Promise<bigint> {
557
- try {
558
- return await this.contract.getFunction("getUpdateFee(bytes[])")(
559
- updateData,
560
- overrides || {}
561
- );
562
- } catch (e) {
563
- throw transformEtherError(e, undefined);
564
- }
565
- }
566
-
567
- async getUpdateFee_uint256(
568
- updateDataSize: BigNumberish,
569
- overrides?: Overrides
570
- ): Promise<bigint> {
571
- try {
572
- return await this.contract.getFunction("getUpdateFee(uint256)")(
573
- updateDataSize,
574
- overrides || {}
575
- );
576
- } catch (e) {
577
- throw transformEtherError(e, undefined);
578
- }
579
- }
580
-
581
- async getValidTimePeriod(overrides?: Overrides): Promise<bigint> {
582
- try {
583
- return await this.contract.getFunction("getValidTimePeriod()")(
584
- overrides || {}
585
- );
586
- } catch (e) {
587
- throw transformEtherError(e, undefined);
588
- }
589
- }
590
-
591
- async governanceDataSource(
592
- overrides?: Overrides
593
- ): Promise<PythInternalStructs.DataSourceStructOutput> {
594
- try {
595
- return await this.contract.getFunction("governanceDataSource()")(
596
- overrides || {}
597
- );
598
- } catch (e) {
599
- throw transformEtherError(e, undefined);
600
- }
601
- }
602
-
603
- async governanceDataSourceIndex(overrides?: Overrides): Promise<bigint> {
604
- try {
605
- return await this.contract.getFunction("governanceDataSourceIndex()")(
606
- overrides || {}
607
- );
608
- } catch (e) {
609
- throw transformEtherError(e, undefined);
610
- }
611
- }
612
-
613
- async hashDataSource(
614
- ds: PythInternalStructs.DataSourceStruct,
615
- overrides?: Overrides
616
- ): Promise<string> {
617
- try {
618
- return await this.contract.getFunction(
619
- "hashDataSource((uint16,bytes32))"
620
- )(ds, overrides || {});
621
- } catch (e) {
622
- throw transformEtherError(e, undefined);
623
- }
624
- }
625
-
626
- async isValidDataSource(
627
- dataSourceChainId: BigNumberish,
628
- dataSourceEmitterAddress: BytesLike,
629
- overrides?: Overrides
630
- ): Promise<boolean> {
631
- try {
632
- return await this.contract.getFunction(
633
- "isValidDataSource(uint16,bytes32)"
634
- )(dataSourceChainId, dataSourceEmitterAddress, overrides || {});
635
- } catch (e) {
636
- throw transformEtherError(e, undefined);
637
- }
638
- }
639
-
640
- async isValidGovernanceDataSource(
641
- governanceChainId: BigNumberish,
642
- governanceEmitterAddress: BytesLike,
643
- overrides?: Overrides
644
- ): Promise<boolean> {
645
- try {
646
- return await this.contract.getFunction(
647
- "isValidGovernanceDataSource(uint16,bytes32)"
648
- )(governanceChainId, governanceEmitterAddress, overrides || {});
649
- } catch (e) {
650
- throw transformEtherError(e, undefined);
651
- }
652
- }
653
-
654
- async lastExecutedGovernanceSequence(overrides?: Overrides): Promise<bigint> {
655
- try {
656
- return await this.contract.getFunction(
657
- "lastExecutedGovernanceSequence()"
658
- )(overrides || {});
659
- } catch (e) {
660
- throw transformEtherError(e, undefined);
661
- }
662
- }
663
-
664
- async latestPriceInfoPublishTime(
665
- priceId: BytesLike,
666
- overrides?: Overrides
667
- ): Promise<bigint> {
668
- try {
669
- return await this.contract.getFunction(
670
- "latestPriceInfoPublishTime(bytes32)"
671
- )(priceId, overrides || {});
672
- } catch (e) {
673
- throw transformEtherError(e, undefined);
674
- }
675
- }
676
-
677
- async owner(overrides?: Overrides): Promise<string> {
678
- try {
679
- return await this.contract.getFunction("owner()")(overrides || {});
680
- } catch (e) {
681
- throw transformEtherError(e, undefined);
682
- }
683
- }
684
-
685
- async parseAuthorizeGovernanceDataSourceTransferPayload(
686
- encodedPayload: BytesLike,
687
- overrides?: Overrides
688
- ): Promise<PythGovernanceInstructions.AuthorizeGovernanceDataSourceTransferPayloadStructOutput> {
689
- try {
690
- return await this.contract.getFunction(
691
- "parseAuthorizeGovernanceDataSourceTransferPayload(bytes)"
692
- )(encodedPayload, overrides || {});
693
- } catch (e) {
694
- throw transformEtherError(e, undefined);
695
- }
696
- }
697
-
698
- async parseGovernanceInstruction(
699
- encodedInstruction: BytesLike,
700
- overrides?: Overrides
701
- ): Promise<PythGovernanceInstructions.GovernanceInstructionStructOutput> {
702
- try {
703
- return await this.contract.getFunction(
704
- "parseGovernanceInstruction(bytes)"
705
- )(encodedInstruction, overrides || {});
706
- } catch (e) {
707
- throw transformEtherError(e, undefined);
708
- }
709
- }
710
-
711
- async parseRequestGovernanceDataSourceTransferPayload(
712
- encodedPayload: BytesLike,
713
- overrides?: Overrides
714
- ): Promise<PythGovernanceInstructions.RequestGovernanceDataSourceTransferPayloadStructOutput> {
715
- try {
716
- return await this.contract.getFunction(
717
- "parseRequestGovernanceDataSourceTransferPayload(bytes)"
718
- )(encodedPayload, overrides || {});
719
- } catch (e) {
720
- throw transformEtherError(e, undefined);
721
- }
722
- }
723
-
724
- async parseSetDataSourcesPayload(
725
- encodedPayload: BytesLike,
726
- overrides?: Overrides
727
- ): Promise<PythGovernanceInstructions.SetDataSourcesPayloadStructOutput> {
728
- try {
729
- return await this.contract.getFunction(
730
- "parseSetDataSourcesPayload(bytes)"
731
- )(encodedPayload, overrides || {});
732
- } catch (e) {
733
- throw transformEtherError(e, undefined);
734
- }
735
- }
736
-
737
- async parseSetFeePayload(
738
- encodedPayload: BytesLike,
739
- overrides?: Overrides
740
- ): Promise<PythGovernanceInstructions.SetFeePayloadStructOutput> {
741
- try {
742
- return await this.contract.getFunction("parseSetFeePayload(bytes)")(
743
- encodedPayload,
744
- overrides || {}
745
- );
746
- } catch (e) {
747
- throw transformEtherError(e, undefined);
748
- }
749
- }
750
-
751
- async parseSetValidPeriodPayload(
752
- encodedPayload: BytesLike,
753
- overrides?: Overrides
754
- ): Promise<PythGovernanceInstructions.SetValidPeriodPayloadStructOutput> {
755
- try {
756
- return await this.contract.getFunction(
757
- "parseSetValidPeriodPayload(bytes)"
758
- )(encodedPayload, overrides || {});
759
- } catch (e) {
760
- throw transformEtherError(e, undefined);
761
- }
762
- }
763
-
764
- async parseUpgradeContractPayload(
765
- encodedPayload: BytesLike,
766
- overrides?: Overrides
767
- ): Promise<PythGovernanceInstructions.UpgradeContractPayloadStructOutput> {
768
- try {
769
- return await this.contract.getFunction(
770
- "parseUpgradeContractPayload(bytes)"
771
- )(encodedPayload, overrides || {});
772
- } catch (e) {
773
- throw transformEtherError(e, undefined);
774
- }
775
- }
776
-
777
- async priceFeedExists(
778
- id: BytesLike,
779
- overrides?: Overrides
780
- ): Promise<boolean> {
781
- try {
782
- return await this.contract.getFunction("priceFeedExists(bytes32)")(
783
- id,
784
- overrides || {}
785
- );
786
- } catch (e) {
787
- throw transformEtherError(e, undefined);
788
- }
789
- }
790
-
791
- async proxiableUUID(overrides?: Overrides): Promise<string> {
792
- try {
793
- return await this.contract.getFunction("proxiableUUID()")(
794
- overrides || {}
795
- );
796
- } catch (e) {
797
- throw transformEtherError(e, undefined);
798
- }
799
- }
800
-
801
- async pythUpgradableMagic(overrides?: Overrides): Promise<bigint> {
802
- try {
803
- return await this.contract.getFunction("pythUpgradableMagic()")(
804
- overrides || {}
805
- );
806
- } catch (e) {
807
- throw transformEtherError(e, undefined);
808
- }
809
- }
810
-
811
- async queryPriceFeed(
812
- id: BytesLike,
813
- overrides?: Overrides
814
- ): Promise<PythStructs.PriceFeedStructOutput> {
815
- try {
816
- return await this.contract.getFunction("queryPriceFeed(bytes32)")(
817
- id,
818
- overrides || {}
819
- );
820
- } catch (e) {
821
- throw transformEtherError(e, undefined);
822
- }
823
- }
824
-
825
- async singleUpdateFeeInWei(overrides?: Overrides): Promise<bigint> {
826
- try {
827
- return await this.contract.getFunction("singleUpdateFeeInWei()")(
828
- overrides || {}
829
- );
830
- } catch (e) {
831
- throw transformEtherError(e, undefined);
832
- }
833
- }
834
-
835
- async validDataSources(
836
- overrides?: Overrides
837
- ): Promise<PythInternalStructs.DataSourceStructOutput[]> {
838
- try {
839
- return await this.contract.getFunction("validDataSources()")(
840
- overrides || {}
841
- );
842
- } catch (e) {
843
- throw transformEtherError(e, undefined);
844
- }
845
- }
846
-
847
- async validTimePeriodSeconds(overrides?: Overrides): Promise<bigint> {
848
- try {
849
- return await this.contract.getFunction("validTimePeriodSeconds()")(
850
- overrides || {}
851
- );
852
- } catch (e) {
853
- throw transformEtherError(e, undefined);
854
- }
855
- }
856
-
857
- async version(overrides?: Overrides): Promise<string> {
858
- try {
859
- return await this.contract.getFunction("version()")(overrides || {});
860
- } catch (e) {
861
- throw transformEtherError(e, undefined);
862
- }
863
- }
864
-
865
- async wormhole(overrides?: Overrides): Promise<string> {
866
- try {
867
- return await this.contract.getFunction("wormhole()")(overrides || {});
868
- } catch (e) {
869
- throw transformEtherError(e, undefined);
870
- }
871
- }
872
- }
873
-
874
- export class PythBoundContractView extends BoundContractView<
875
- Pyth,
876
- PythContractView
877
- > {
878
- async chainId(overrides?: Overrides): Promise<bigint> {
879
- if (!overrides && this.context) {
880
- overrides = {
881
- blockTag: toBlockTag(this.context.blockNumber),
882
- };
883
- }
884
- return await this.view.chainId(overrides || {});
885
- }
886
-
887
- async getEmaPrice(
888
- id: BytesLike,
889
- overrides?: Overrides
890
- ): Promise<PythStructs.PriceStructOutput> {
891
- if (!overrides && this.context) {
892
- overrides = {
893
- blockTag: toBlockTag(this.context.blockNumber),
894
- };
895
- }
896
- return await this.view.getEmaPrice(id, overrides || {});
897
- }
898
-
899
- async getEmaPriceNoOlderThan(
900
- id: BytesLike,
901
- age: BigNumberish,
902
- overrides?: Overrides
903
- ): Promise<PythStructs.PriceStructOutput> {
904
- if (!overrides && this.context) {
905
- overrides = {
906
- blockTag: toBlockTag(this.context.blockNumber),
907
- };
908
- }
909
- return await this.view.getEmaPriceNoOlderThan(id, age, overrides || {});
910
- }
911
-
912
- async getEmaPriceUnsafe(
913
- id: BytesLike,
914
- overrides?: Overrides
915
- ): Promise<PythStructs.PriceStructOutput> {
916
- if (!overrides && this.context) {
917
- overrides = {
918
- blockTag: toBlockTag(this.context.blockNumber),
919
- };
920
- }
921
- return await this.view.getEmaPriceUnsafe(id, overrides || {});
922
- }
923
-
924
- async getPrice(
925
- id: BytesLike,
926
- overrides?: Overrides
927
- ): Promise<PythStructs.PriceStructOutput> {
928
- if (!overrides && this.context) {
929
- overrides = {
930
- blockTag: toBlockTag(this.context.blockNumber),
931
- };
932
- }
933
- return await this.view.getPrice(id, overrides || {});
934
- }
935
-
936
- async getPriceNoOlderThan(
937
- id: BytesLike,
938
- age: BigNumberish,
939
- overrides?: Overrides
940
- ): Promise<PythStructs.PriceStructOutput> {
941
- if (!overrides && this.context) {
942
- overrides = {
943
- blockTag: toBlockTag(this.context.blockNumber),
944
- };
945
- }
946
- return await this.view.getPriceNoOlderThan(id, age, overrides || {});
947
- }
948
-
949
- async getPriceUnsafe(
950
- id: BytesLike,
951
- overrides?: Overrides
952
- ): Promise<PythStructs.PriceStructOutput> {
953
- if (!overrides && this.context) {
954
- overrides = {
955
- blockTag: toBlockTag(this.context.blockNumber),
956
- };
957
- }
958
- return await this.view.getPriceUnsafe(id, overrides || {});
959
- }
960
-
961
- async getUpdateFee_bytes_array(
962
- updateData: BytesLike[],
963
- overrides?: Overrides
964
- ): Promise<bigint> {
965
- if (!overrides && this.context) {
966
- overrides = {
967
- blockTag: toBlockTag(this.context.blockNumber),
968
- };
969
- }
970
- return await this.view.getUpdateFee_bytes_array(
971
- updateData,
972
- overrides || {}
973
- );
974
- }
975
-
976
- async getUpdateFee_uint256(
977
- updateDataSize: BigNumberish,
978
- overrides?: Overrides
979
- ): Promise<bigint> {
980
- if (!overrides && this.context) {
981
- overrides = {
982
- blockTag: toBlockTag(this.context.blockNumber),
983
- };
984
- }
985
- return await this.view.getUpdateFee_uint256(
986
- updateDataSize,
987
- overrides || {}
988
- );
989
- }
990
-
991
- async getValidTimePeriod(overrides?: Overrides): Promise<bigint> {
992
- if (!overrides && this.context) {
993
- overrides = {
994
- blockTag: toBlockTag(this.context.blockNumber),
995
- };
996
- }
997
- return await this.view.getValidTimePeriod(overrides || {});
998
- }
999
-
1000
- async governanceDataSource(
1001
- overrides?: Overrides
1002
- ): Promise<PythInternalStructs.DataSourceStructOutput> {
1003
- if (!overrides && this.context) {
1004
- overrides = {
1005
- blockTag: toBlockTag(this.context.blockNumber),
1006
- };
1007
- }
1008
- return await this.view.governanceDataSource(overrides || {});
1009
- }
1010
-
1011
- async governanceDataSourceIndex(overrides?: Overrides): Promise<bigint> {
1012
- if (!overrides && this.context) {
1013
- overrides = {
1014
- blockTag: toBlockTag(this.context.blockNumber),
1015
- };
1016
- }
1017
- return await this.view.governanceDataSourceIndex(overrides || {});
1018
- }
1019
-
1020
- async hashDataSource(
1021
- ds: PythInternalStructs.DataSourceStruct,
1022
- overrides?: Overrides
1023
- ): Promise<string> {
1024
- if (!overrides && this.context) {
1025
- overrides = {
1026
- blockTag: toBlockTag(this.context.blockNumber),
1027
- };
1028
- }
1029
- return await this.view.hashDataSource(ds, overrides || {});
1030
- }
1031
-
1032
- async isValidDataSource(
1033
- dataSourceChainId: BigNumberish,
1034
- dataSourceEmitterAddress: BytesLike,
1035
- overrides?: Overrides
1036
- ): Promise<boolean> {
1037
- if (!overrides && this.context) {
1038
- overrides = {
1039
- blockTag: toBlockTag(this.context.blockNumber),
1040
- };
1041
- }
1042
- return await this.view.isValidDataSource(
1043
- dataSourceChainId,
1044
- dataSourceEmitterAddress,
1045
- overrides || {}
1046
- );
1047
- }
1048
-
1049
- async isValidGovernanceDataSource(
1050
- governanceChainId: BigNumberish,
1051
- governanceEmitterAddress: BytesLike,
1052
- overrides?: Overrides
1053
- ): Promise<boolean> {
1054
- if (!overrides && this.context) {
1055
- overrides = {
1056
- blockTag: toBlockTag(this.context.blockNumber),
1057
- };
1058
- }
1059
- return await this.view.isValidGovernanceDataSource(
1060
- governanceChainId,
1061
- governanceEmitterAddress,
1062
- overrides || {}
1063
- );
1064
- }
1065
-
1066
- async lastExecutedGovernanceSequence(overrides?: Overrides): Promise<bigint> {
1067
- if (!overrides && this.context) {
1068
- overrides = {
1069
- blockTag: toBlockTag(this.context.blockNumber),
1070
- };
1071
- }
1072
- return await this.view.lastExecutedGovernanceSequence(overrides || {});
1073
- }
1074
-
1075
- async latestPriceInfoPublishTime(
1076
- priceId: BytesLike,
1077
- overrides?: Overrides
1078
- ): Promise<bigint> {
1079
- if (!overrides && this.context) {
1080
- overrides = {
1081
- blockTag: toBlockTag(this.context.blockNumber),
1082
- };
1083
- }
1084
- return await this.view.latestPriceInfoPublishTime(priceId, overrides || {});
1085
- }
1086
-
1087
- async owner(overrides?: Overrides): Promise<string> {
1088
- if (!overrides && this.context) {
1089
- overrides = {
1090
- blockTag: toBlockTag(this.context.blockNumber),
1091
- };
1092
- }
1093
- return await this.view.owner(overrides || {});
1094
- }
1095
-
1096
- async parseAuthorizeGovernanceDataSourceTransferPayload(
1097
- encodedPayload: BytesLike,
1098
- overrides?: Overrides
1099
- ): Promise<PythGovernanceInstructions.AuthorizeGovernanceDataSourceTransferPayloadStructOutput> {
1100
- if (!overrides && this.context) {
1101
- overrides = {
1102
- blockTag: toBlockTag(this.context.blockNumber),
1103
- };
1104
- }
1105
- return await this.view.parseAuthorizeGovernanceDataSourceTransferPayload(
1106
- encodedPayload,
1107
- overrides || {}
1108
- );
1109
- }
1110
-
1111
- async parseGovernanceInstruction(
1112
- encodedInstruction: BytesLike,
1113
- overrides?: Overrides
1114
- ): Promise<PythGovernanceInstructions.GovernanceInstructionStructOutput> {
1115
- if (!overrides && this.context) {
1116
- overrides = {
1117
- blockTag: toBlockTag(this.context.blockNumber),
1118
- };
1119
- }
1120
- return await this.view.parseGovernanceInstruction(
1121
- encodedInstruction,
1122
- overrides || {}
1123
- );
1124
- }
1125
-
1126
- async parseRequestGovernanceDataSourceTransferPayload(
1127
- encodedPayload: BytesLike,
1128
- overrides?: Overrides
1129
- ): Promise<PythGovernanceInstructions.RequestGovernanceDataSourceTransferPayloadStructOutput> {
1130
- if (!overrides && this.context) {
1131
- overrides = {
1132
- blockTag: toBlockTag(this.context.blockNumber),
1133
- };
1134
- }
1135
- return await this.view.parseRequestGovernanceDataSourceTransferPayload(
1136
- encodedPayload,
1137
- overrides || {}
1138
- );
1139
- }
1140
-
1141
- async parseSetDataSourcesPayload(
1142
- encodedPayload: BytesLike,
1143
- overrides?: Overrides
1144
- ): Promise<PythGovernanceInstructions.SetDataSourcesPayloadStructOutput> {
1145
- if (!overrides && this.context) {
1146
- overrides = {
1147
- blockTag: toBlockTag(this.context.blockNumber),
1148
- };
1149
- }
1150
- return await this.view.parseSetDataSourcesPayload(
1151
- encodedPayload,
1152
- overrides || {}
1153
- );
1154
- }
1155
-
1156
- async parseSetFeePayload(
1157
- encodedPayload: BytesLike,
1158
- overrides?: Overrides
1159
- ): Promise<PythGovernanceInstructions.SetFeePayloadStructOutput> {
1160
- if (!overrides && this.context) {
1161
- overrides = {
1162
- blockTag: toBlockTag(this.context.blockNumber),
1163
- };
1164
- }
1165
- return await this.view.parseSetFeePayload(encodedPayload, overrides || {});
1166
- }
1167
-
1168
- async parseSetValidPeriodPayload(
1169
- encodedPayload: BytesLike,
1170
- overrides?: Overrides
1171
- ): Promise<PythGovernanceInstructions.SetValidPeriodPayloadStructOutput> {
1172
- if (!overrides && this.context) {
1173
- overrides = {
1174
- blockTag: toBlockTag(this.context.blockNumber),
1175
- };
1176
- }
1177
- return await this.view.parseSetValidPeriodPayload(
1178
- encodedPayload,
1179
- overrides || {}
1180
- );
1181
- }
1182
-
1183
- async parseUpgradeContractPayload(
1184
- encodedPayload: BytesLike,
1185
- overrides?: Overrides
1186
- ): Promise<PythGovernanceInstructions.UpgradeContractPayloadStructOutput> {
1187
- if (!overrides && this.context) {
1188
- overrides = {
1189
- blockTag: toBlockTag(this.context.blockNumber),
1190
- };
1191
- }
1192
- return await this.view.parseUpgradeContractPayload(
1193
- encodedPayload,
1194
- overrides || {}
1195
- );
1196
- }
1197
-
1198
- async priceFeedExists(
1199
- id: BytesLike,
1200
- overrides?: Overrides
1201
- ): Promise<boolean> {
1202
- if (!overrides && this.context) {
1203
- overrides = {
1204
- blockTag: toBlockTag(this.context.blockNumber),
1205
- };
1206
- }
1207
- return await this.view.priceFeedExists(id, overrides || {});
1208
- }
1209
-
1210
- async proxiableUUID(overrides?: Overrides): Promise<string> {
1211
- if (!overrides && this.context) {
1212
- overrides = {
1213
- blockTag: toBlockTag(this.context.blockNumber),
1214
- };
1215
- }
1216
- return await this.view.proxiableUUID(overrides || {});
1217
- }
1218
-
1219
- async pythUpgradableMagic(overrides?: Overrides): Promise<bigint> {
1220
- if (!overrides && this.context) {
1221
- overrides = {
1222
- blockTag: toBlockTag(this.context.blockNumber),
1223
- };
1224
- }
1225
- return await this.view.pythUpgradableMagic(overrides || {});
1226
- }
1227
-
1228
- async queryPriceFeed(
1229
- id: BytesLike,
1230
- overrides?: Overrides
1231
- ): Promise<PythStructs.PriceFeedStructOutput> {
1232
- if (!overrides && this.context) {
1233
- overrides = {
1234
- blockTag: toBlockTag(this.context.blockNumber),
1235
- };
1236
- }
1237
- return await this.view.queryPriceFeed(id, overrides || {});
1238
- }
1239
-
1240
- async singleUpdateFeeInWei(overrides?: Overrides): Promise<bigint> {
1241
- if (!overrides && this.context) {
1242
- overrides = {
1243
- blockTag: toBlockTag(this.context.blockNumber),
1244
- };
1245
- }
1246
- return await this.view.singleUpdateFeeInWei(overrides || {});
1247
- }
1248
-
1249
- async validDataSources(
1250
- overrides?: Overrides
1251
- ): Promise<PythInternalStructs.DataSourceStructOutput[]> {
1252
- if (!overrides && this.context) {
1253
- overrides = {
1254
- blockTag: toBlockTag(this.context.blockNumber),
1255
- };
1256
- }
1257
- return await this.view.validDataSources(overrides || {});
1258
- }
1259
-
1260
- async validTimePeriodSeconds(overrides?: Overrides): Promise<bigint> {
1261
- if (!overrides && this.context) {
1262
- overrides = {
1263
- blockTag: toBlockTag(this.context.blockNumber),
1264
- };
1265
- }
1266
- return await this.view.validTimePeriodSeconds(overrides || {});
1267
- }
1268
-
1269
- async version(overrides?: Overrides): Promise<string> {
1270
- if (!overrides && this.context) {
1271
- overrides = {
1272
- blockTag: toBlockTag(this.context.blockNumber),
1273
- };
1274
- }
1275
- return await this.view.version(overrides || {});
1276
- }
1277
-
1278
- async wormhole(overrides?: Overrides): Promise<string> {
1279
- if (!overrides && this.context) {
1280
- overrides = {
1281
- blockTag: toBlockTag(this.context.blockNumber),
1282
- };
1283
- }
1284
- return await this.view.wormhole(overrides || {});
1285
- }
1286
- }
1287
-
1288
- export type PythContext = ContractContext<Pyth, PythBoundContractView>;
1289
-
1290
- export class PythProcessor extends BaseProcessor<Pyth, PythBoundContractView> {
1291
- onEventAdminChanged(
1292
- handler: (event: AdminChangedEvent, ctx: PythContext) => void,
1293
- filter?: AdminChangedEventFilter | AdminChangedEventFilter[],
1294
- fetchConfig?: EthFetchConfig
1295
- ) {
1296
- if (!filter) {
1297
- filter = templateContract.filters["AdminChanged(address,address)"](
1298
- null,
1299
- null
1300
- );
1301
- }
1302
- return super.onEvent(handler, filter!, fetchConfig);
1303
- }
1304
-
1305
- onEventBatchPriceFeedUpdate(
1306
- handler: (event: BatchPriceFeedUpdateEvent, ctx: PythContext) => void,
1307
- filter?:
1308
- | BatchPriceFeedUpdateEventFilter
1309
- | BatchPriceFeedUpdateEventFilter[],
1310
- fetchConfig?: EthFetchConfig
1311
- ) {
1312
- if (!filter) {
1313
- filter = templateContract.filters["BatchPriceFeedUpdate(uint16,uint64)"](
1314
- null,
1315
- null
1316
- );
1317
- }
1318
- return super.onEvent(handler, filter!, fetchConfig);
1319
- }
1320
-
1321
- onEventBeaconUpgraded(
1322
- handler: (event: BeaconUpgradedEvent, ctx: PythContext) => void,
1323
- filter?: BeaconUpgradedEventFilter | BeaconUpgradedEventFilter[],
1324
- fetchConfig?: EthFetchConfig
1325
- ) {
1326
- if (!filter) {
1327
- filter = templateContract.filters["BeaconUpgraded(address)"](null);
1328
- }
1329
- return super.onEvent(handler, filter!, fetchConfig);
1330
- }
1331
-
1332
- onEventContractUpgraded(
1333
- handler: (event: ContractUpgradedEvent, ctx: PythContext) => void,
1334
- filter?: ContractUpgradedEventFilter | ContractUpgradedEventFilter[],
1335
- fetchConfig?: EthFetchConfig
1336
- ) {
1337
- if (!filter) {
1338
- filter = templateContract.filters["ContractUpgraded(address,address)"](
1339
- null,
1340
- null
1341
- );
1342
- }
1343
- return super.onEvent(handler, filter!, fetchConfig);
1344
- }
1345
-
1346
- onEventDataSourcesSet(
1347
- handler: (event: DataSourcesSetEvent, ctx: PythContext) => void,
1348
- filter?: DataSourcesSetEventFilter | DataSourcesSetEventFilter[],
1349
- fetchConfig?: EthFetchConfig
1350
- ) {
1351
- if (!filter) {
1352
- filter = templateContract.filters[
1353
- "DataSourcesSet((uint16,bytes32)[],(uint16,bytes32)[])"
1354
- ](null, null);
1355
- }
1356
- return super.onEvent(handler, filter!, fetchConfig);
1357
- }
1358
-
1359
- onEventFeeSet(
1360
- handler: (event: FeeSetEvent, ctx: PythContext) => void,
1361
- filter?: FeeSetEventFilter | FeeSetEventFilter[],
1362
- fetchConfig?: EthFetchConfig
1363
- ) {
1364
- if (!filter) {
1365
- filter = templateContract.filters["FeeSet(uint256,uint256)"](null, null);
1366
- }
1367
- return super.onEvent(handler, filter!, fetchConfig);
1368
- }
1369
-
1370
- onEventGovernanceDataSourceSet(
1371
- handler: (event: GovernanceDataSourceSetEvent, ctx: PythContext) => void,
1372
- filter?:
1373
- | GovernanceDataSourceSetEventFilter
1374
- | GovernanceDataSourceSetEventFilter[],
1375
- fetchConfig?: EthFetchConfig
1376
- ) {
1377
- if (!filter) {
1378
- filter = templateContract.filters[
1379
- "GovernanceDataSourceSet((uint16,bytes32),(uint16,bytes32),uint64)"
1380
- ](null, null, null);
1381
- }
1382
- return super.onEvent(handler, filter!, fetchConfig);
1383
- }
1384
-
1385
- onEventOwnershipTransferred(
1386
- handler: (event: OwnershipTransferredEvent, ctx: PythContext) => void,
1387
- filter?:
1388
- | OwnershipTransferredEventFilter
1389
- | OwnershipTransferredEventFilter[],
1390
- fetchConfig?: EthFetchConfig
1391
- ) {
1392
- if (!filter) {
1393
- filter = templateContract.filters[
1394
- "OwnershipTransferred(address,address)"
1395
- ](null, null);
1396
- }
1397
- return super.onEvent(handler, filter!, fetchConfig);
1398
- }
1399
-
1400
- onEventPriceFeedUpdate(
1401
- handler: (event: PriceFeedUpdateEvent, ctx: PythContext) => void,
1402
- filter?: PriceFeedUpdateEventFilter | PriceFeedUpdateEventFilter[],
1403
- fetchConfig?: EthFetchConfig
1404
- ) {
1405
- if (!filter) {
1406
- filter = templateContract.filters[
1407
- "PriceFeedUpdate(bytes32,uint64,int64,uint64)"
1408
- ](null, null, null, null);
1409
- }
1410
- return super.onEvent(handler, filter!, fetchConfig);
1411
- }
1412
-
1413
- onEventUpgraded(
1414
- handler: (event: UpgradedEvent, ctx: PythContext) => void,
1415
- filter?: UpgradedEventFilter | UpgradedEventFilter[],
1416
- fetchConfig?: EthFetchConfig
1417
- ) {
1418
- if (!filter) {
1419
- filter = templateContract.filters["Upgraded(address)"](null);
1420
- }
1421
- return super.onEvent(handler, filter!, fetchConfig);
1422
- }
1423
-
1424
- onEventValidPeriodSet(
1425
- handler: (event: ValidPeriodSetEvent, ctx: PythContext) => void,
1426
- filter?: ValidPeriodSetEventFilter | ValidPeriodSetEventFilter[],
1427
- fetchConfig?: EthFetchConfig
1428
- ) {
1429
- if (!filter) {
1430
- filter = templateContract.filters["ValidPeriodSet(uint256,uint256)"](
1431
- null,
1432
- null
1433
- );
1434
- }
1435
- return super.onEvent(handler, filter!, fetchConfig);
1436
- }
1437
-
1438
- onCallChainId(
1439
- handler: (call: ChainIdCallTrace, ctx: PythContext) => void,
1440
- fetchConfig?: EthFetchConfig
1441
- ) {
1442
- return super.onTrace("0x9a8a0592", handler, fetchConfig);
1443
- }
1444
-
1445
- onCallExecuteGovernanceInstruction(
1446
- handler: (
1447
- call: ExecuteGovernanceInstructionCallTrace,
1448
- ctx: PythContext
1449
- ) => void,
1450
- fetchConfig?: EthFetchConfig
1451
- ) {
1452
- return super.onTrace("0xb6ed701e", handler, fetchConfig);
1453
- }
1454
-
1455
- onCallGetEmaPrice(
1456
- handler: (call: GetEmaPriceCallTrace, ctx: PythContext) => void,
1457
- fetchConfig?: EthFetchConfig
1458
- ) {
1459
- return super.onTrace("0xb5dcc911", handler, fetchConfig);
1460
- }
1461
-
1462
- onCallGetEmaPriceNoOlderThan(
1463
- handler: (call: GetEmaPriceNoOlderThanCallTrace, ctx: PythContext) => void,
1464
- fetchConfig?: EthFetchConfig
1465
- ) {
1466
- return super.onTrace("0x711a2e28", handler, fetchConfig);
1467
- }
1468
-
1469
- onCallGetEmaPriceUnsafe(
1470
- handler: (call: GetEmaPriceUnsafeCallTrace, ctx: PythContext) => void,
1471
- fetchConfig?: EthFetchConfig
1472
- ) {
1473
- return super.onTrace("0x9474f45b", handler, fetchConfig);
1474
- }
1475
-
1476
- onCallGetPrice(
1477
- handler: (call: GetPriceCallTrace, ctx: PythContext) => void,
1478
- fetchConfig?: EthFetchConfig
1479
- ) {
1480
- return super.onTrace("0x31d98b3f", handler, fetchConfig);
1481
- }
1482
-
1483
- onCallGetPriceNoOlderThan(
1484
- handler: (call: GetPriceNoOlderThanCallTrace, ctx: PythContext) => void,
1485
- fetchConfig?: EthFetchConfig
1486
- ) {
1487
- return super.onTrace("0xa4ae35e0", handler, fetchConfig);
1488
- }
1489
-
1490
- onCallGetPriceUnsafe(
1491
- handler: (call: GetPriceUnsafeCallTrace, ctx: PythContext) => void,
1492
- fetchConfig?: EthFetchConfig
1493
- ) {
1494
- return super.onTrace("0x96834ad3", handler, fetchConfig);
1495
- }
1496
-
1497
- onCallGetUpdateFee_bytes_array(
1498
- handler: (
1499
- call: GetUpdateFee_bytes_arrayCallTrace,
1500
- ctx: PythContext
1501
- ) => void,
1502
- fetchConfig?: EthFetchConfig
1503
- ) {
1504
- return super.onTrace("0xd47eed45", handler, fetchConfig);
1505
- }
1506
-
1507
- onCallGetUpdateFee_uint256(
1508
- handler: (call: GetUpdateFee_uint256CallTrace, ctx: PythContext) => void,
1509
- fetchConfig?: EthFetchConfig
1510
- ) {
1511
- return super.onTrace("0xe17efd48", handler, fetchConfig);
1512
- }
1513
-
1514
- onCallGetValidTimePeriod(
1515
- handler: (call: GetValidTimePeriodCallTrace, ctx: PythContext) => void,
1516
- fetchConfig?: EthFetchConfig
1517
- ) {
1518
- return super.onTrace("0xe18910a3", handler, fetchConfig);
1519
- }
1520
-
1521
- onCallGovernanceDataSource(
1522
- handler: (call: GovernanceDataSourceCallTrace, ctx: PythContext) => void,
1523
- fetchConfig?: EthFetchConfig
1524
- ) {
1525
- return super.onTrace("0x426234e4", handler, fetchConfig);
1526
- }
1527
-
1528
- onCallGovernanceDataSourceIndex(
1529
- handler: (
1530
- call: GovernanceDataSourceIndexCallTrace,
1531
- ctx: PythContext
1532
- ) => void,
1533
- fetchConfig?: EthFetchConfig
1534
- ) {
1535
- return super.onTrace("0x6c72f51b", handler, fetchConfig);
1536
- }
1537
-
1538
- onCallHashDataSource(
1539
- handler: (call: HashDataSourceCallTrace, ctx: PythContext) => void,
1540
- fetchConfig?: EthFetchConfig
1541
- ) {
1542
- return super.onTrace("0x89a5bb4d", handler, fetchConfig);
1543
- }
1544
-
1545
- onCallInitialize(
1546
- handler: (call: InitializeCallTrace, ctx: PythContext) => void,
1547
- fetchConfig?: EthFetchConfig
1548
- ) {
1549
- return super.onTrace("0x146faf77", handler, fetchConfig);
1550
- }
1551
-
1552
- onCallIsValidDataSource(
1553
- handler: (call: IsValidDataSourceCallTrace, ctx: PythContext) => void,
1554
- fetchConfig?: EthFetchConfig
1555
- ) {
1556
- return super.onTrace("0x437209a7", handler, fetchConfig);
1557
- }
1558
-
1559
- onCallIsValidGovernanceDataSource(
1560
- handler: (
1561
- call: IsValidGovernanceDataSourceCallTrace,
1562
- ctx: PythContext
1563
- ) => void,
1564
- fetchConfig?: EthFetchConfig
1565
- ) {
1566
- return super.onTrace("0x58c67635", handler, fetchConfig);
1567
- }
1568
-
1569
- onCallLastExecutedGovernanceSequence(
1570
- handler: (
1571
- call: LastExecutedGovernanceSequenceCallTrace,
1572
- ctx: PythContext
1573
- ) => void,
1574
- fetchConfig?: EthFetchConfig
1575
- ) {
1576
- return super.onTrace("0x586d3cf8", handler, fetchConfig);
1577
- }
1578
-
1579
- onCallLatestPriceInfoPublishTime(
1580
- handler: (
1581
- call: LatestPriceInfoPublishTimeCallTrace,
1582
- ctx: PythContext
1583
- ) => void,
1584
- fetchConfig?: EthFetchConfig
1585
- ) {
1586
- return super.onTrace("0x4c469d8c", handler, fetchConfig);
1587
- }
1588
-
1589
- onCallOwner(
1590
- handler: (call: OwnerCallTrace, ctx: PythContext) => void,
1591
- fetchConfig?: EthFetchConfig
1592
- ) {
1593
- return super.onTrace("0x8da5cb5b", handler, fetchConfig);
1594
- }
1595
-
1596
- onCallParseAuthorizeGovernanceDataSourceTransferPayload(
1597
- handler: (
1598
- call: ParseAuthorizeGovernanceDataSourceTransferPayloadCallTrace,
1599
- ctx: PythContext
1600
- ) => void,
1601
- fetchConfig?: EthFetchConfig
1602
- ) {
1603
- return super.onTrace("0xd82d58a5", handler, fetchConfig);
1604
- }
1605
-
1606
- onCallParseGovernanceInstruction(
1607
- handler: (
1608
- call: ParseGovernanceInstructionCallTrace,
1609
- ctx: PythContext
1610
- ) => void,
1611
- fetchConfig?: EthFetchConfig
1612
- ) {
1613
- return super.onTrace("0x6b7f53ca", handler, fetchConfig);
1614
- }
1615
-
1616
- onCallParsePriceFeedUpdates(
1617
- handler: (call: ParsePriceFeedUpdatesCallTrace, ctx: PythContext) => void,
1618
- fetchConfig?: EthFetchConfig
1619
- ) {
1620
- return super.onTrace("0x4716e9c5", handler, fetchConfig);
1621
- }
1622
-
1623
- onCallParseRequestGovernanceDataSourceTransferPayload(
1624
- handler: (
1625
- call: ParseRequestGovernanceDataSourceTransferPayloadCallTrace,
1626
- ctx: PythContext
1627
- ) => void,
1628
- fetchConfig?: EthFetchConfig
1629
- ) {
1630
- return super.onTrace("0x7b72bcae", handler, fetchConfig);
1631
- }
1632
-
1633
- onCallParseSetDataSourcesPayload(
1634
- handler: (
1635
- call: ParseSetDataSourcesPayloadCallTrace,
1636
- ctx: PythContext
1637
- ) => void,
1638
- fetchConfig?: EthFetchConfig
1639
- ) {
1640
- return super.onTrace("0x87c5bd1b", handler, fetchConfig);
1641
- }
1642
-
1643
- onCallParseSetFeePayload(
1644
- handler: (call: ParseSetFeePayloadCallTrace, ctx: PythContext) => void,
1645
- fetchConfig?: EthFetchConfig
1646
- ) {
1647
- return super.onTrace("0x4d7a734e", handler, fetchConfig);
1648
- }
1649
-
1650
- onCallParseSetValidPeriodPayload(
1651
- handler: (
1652
- call: ParseSetValidPeriodPayloadCallTrace,
1653
- ctx: PythContext
1654
- ) => void,
1655
- fetchConfig?: EthFetchConfig
1656
- ) {
1657
- return super.onTrace("0x14dd317f", handler, fetchConfig);
1658
- }
1659
-
1660
- onCallParseUpgradeContractPayload(
1661
- handler: (
1662
- call: ParseUpgradeContractPayloadCallTrace,
1663
- ctx: PythContext
1664
- ) => void,
1665
- fetchConfig?: EthFetchConfig
1666
- ) {
1667
- return super.onTrace("0x8881016f", handler, fetchConfig);
1668
- }
1669
-
1670
- onCallPriceFeedExists(
1671
- handler: (call: PriceFeedExistsCallTrace, ctx: PythContext) => void,
1672
- fetchConfig?: EthFetchConfig
1673
- ) {
1674
- return super.onTrace("0xb5ec0261", handler, fetchConfig);
1675
- }
1676
-
1677
- onCallProxiableUUID(
1678
- handler: (call: ProxiableUUIDCallTrace, ctx: PythContext) => void,
1679
- fetchConfig?: EthFetchConfig
1680
- ) {
1681
- return super.onTrace("0x52d1902d", handler, fetchConfig);
1682
- }
1683
-
1684
- onCallPythUpgradableMagic(
1685
- handler: (call: PythUpgradableMagicCallTrace, ctx: PythContext) => void,
1686
- fetchConfig?: EthFetchConfig
1687
- ) {
1688
- return super.onTrace("0xe3795cc1", handler, fetchConfig);
1689
- }
1690
-
1691
- onCallQueryPriceFeed(
1692
- handler: (call: QueryPriceFeedCallTrace, ctx: PythContext) => void,
1693
- fetchConfig?: EthFetchConfig
1694
- ) {
1695
- return super.onTrace("0xcaaf43f1", handler, fetchConfig);
1696
- }
1697
-
1698
- onCallRenounceOwnership(
1699
- handler: (call: RenounceOwnershipCallTrace, ctx: PythContext) => void,
1700
- fetchConfig?: EthFetchConfig
1701
- ) {
1702
- return super.onTrace("0x715018a6", handler, fetchConfig);
1703
- }
1704
-
1705
- onCallSingleUpdateFeeInWei(
1706
- handler: (call: SingleUpdateFeeInWeiCallTrace, ctx: PythContext) => void,
1707
- fetchConfig?: EthFetchConfig
1708
- ) {
1709
- return super.onTrace("0x48b6404d", handler, fetchConfig);
1710
- }
1711
-
1712
- onCallTransferOwnership(
1713
- handler: (call: TransferOwnershipCallTrace, ctx: PythContext) => void,
1714
- fetchConfig?: EthFetchConfig
1715
- ) {
1716
- return super.onTrace("0xf2fde38b", handler, fetchConfig);
1717
- }
1718
-
1719
- onCallUpdatePriceFeeds(
1720
- handler: (call: UpdatePriceFeedsCallTrace, ctx: PythContext) => void,
1721
- fetchConfig?: EthFetchConfig
1722
- ) {
1723
- return super.onTrace("0xef9e5e28", handler, fetchConfig);
1724
- }
1725
-
1726
- onCallUpdatePriceFeedsIfNecessary(
1727
- handler: (
1728
- call: UpdatePriceFeedsIfNecessaryCallTrace,
1729
- ctx: PythContext
1730
- ) => void,
1731
- fetchConfig?: EthFetchConfig
1732
- ) {
1733
- return super.onTrace("0xb9256d28", handler, fetchConfig);
1734
- }
1735
-
1736
- onCallUpgradeTo(
1737
- handler: (call: UpgradeToCallTrace, ctx: PythContext) => void,
1738
- fetchConfig?: EthFetchConfig
1739
- ) {
1740
- return super.onTrace("0x3659cfe6", handler, fetchConfig);
1741
- }
1742
-
1743
- onCallUpgradeToAndCall(
1744
- handler: (call: UpgradeToAndCallCallTrace, ctx: PythContext) => void,
1745
- fetchConfig?: EthFetchConfig
1746
- ) {
1747
- return super.onTrace("0x4f1ef286", handler, fetchConfig);
1748
- }
1749
-
1750
- onCallValidDataSources(
1751
- handler: (call: ValidDataSourcesCallTrace, ctx: PythContext) => void,
1752
- fetchConfig?: EthFetchConfig
1753
- ) {
1754
- return super.onTrace("0xa38d81c6", handler, fetchConfig);
1755
- }
1756
-
1757
- onCallValidTimePeriodSeconds(
1758
- handler: (call: ValidTimePeriodSecondsCallTrace, ctx: PythContext) => void,
1759
- fetchConfig?: EthFetchConfig
1760
- ) {
1761
- return super.onTrace("0xcb718a9b", handler, fetchConfig);
1762
- }
1763
-
1764
- onCallVersion(
1765
- handler: (call: VersionCallTrace, ctx: PythContext) => void,
1766
- fetchConfig?: EthFetchConfig
1767
- ) {
1768
- return super.onTrace("0x54fd4d50", handler, fetchConfig);
1769
- }
1770
-
1771
- onCallWormhole(
1772
- handler: (call: WormholeCallTrace, ctx: PythContext) => void,
1773
- fetchConfig?: EthFetchConfig
1774
- ) {
1775
- return super.onTrace("0x84acd1bb", handler, fetchConfig);
1776
- }
1777
-
1778
- public static filters = {
1779
- AdminChanged(previousAdmin?: null, newAdmin?: null) {
1780
- return templateContract.filters["AdminChanged(address,address)"](
1781
- previousAdmin,
1782
- newAdmin
1783
- );
1784
- },
1785
- BatchPriceFeedUpdate(chainId?: null, sequenceNumber?: null) {
1786
- return templateContract.filters["BatchPriceFeedUpdate(uint16,uint64)"](
1787
- chainId,
1788
- sequenceNumber
1789
- );
1790
- },
1791
- BeaconUpgraded(beacon?: string | null) {
1792
- return templateContract.filters["BeaconUpgraded(address)"](beacon);
1793
- },
1794
- ContractUpgraded(oldImplementation?: null, newImplementation?: null) {
1795
- return templateContract.filters["ContractUpgraded(address,address)"](
1796
- oldImplementation,
1797
- newImplementation
1798
- );
1799
- },
1800
- DataSourcesSet(oldDataSources?: null, newDataSources?: null) {
1801
- return templateContract.filters[
1802
- "DataSourcesSet((uint16,bytes32)[],(uint16,bytes32)[])"
1803
- ](oldDataSources, newDataSources);
1804
- },
1805
- FeeSet(oldFee?: null, newFee?: null) {
1806
- return templateContract.filters["FeeSet(uint256,uint256)"](
1807
- oldFee,
1808
- newFee
1809
- );
1810
- },
1811
- GovernanceDataSourceSet(
1812
- oldDataSource?: null,
1813
- newDataSource?: null,
1814
- initialSequence?: null
1815
- ) {
1816
- return templateContract.filters[
1817
- "GovernanceDataSourceSet((uint16,bytes32),(uint16,bytes32),uint64)"
1818
- ](oldDataSource, newDataSource, initialSequence);
1819
- },
1820
- OwnershipTransferred(
1821
- previousOwner?: string | null,
1822
- newOwner?: string | null
1823
- ) {
1824
- return templateContract.filters["OwnershipTransferred(address,address)"](
1825
- previousOwner,
1826
- newOwner
1827
- );
1828
- },
1829
- PriceFeedUpdate(
1830
- id?: BytesLike | null,
1831
- publishTime?: null,
1832
- price?: null,
1833
- conf?: null
1834
- ) {
1835
- return templateContract.filters[
1836
- "PriceFeedUpdate(bytes32,uint64,int64,uint64)"
1837
- ](id, publishTime, price, conf);
1838
- },
1839
- Upgraded(implementation?: string | null) {
1840
- return templateContract.filters["Upgraded(address)"](implementation);
1841
- },
1842
- ValidPeriodSet(oldValidPeriod?: null, newValidPeriod?: null) {
1843
- return templateContract.filters["ValidPeriodSet(uint256,uint256)"](
1844
- oldValidPeriod,
1845
- newValidPeriod
1846
- );
1847
- },
1848
- };
1849
-
1850
- protected CreateBoundContractView(): PythBoundContractView {
1851
- const view = getPythContract(this.config.address, this.config.network);
1852
- return new PythBoundContractView(this.config.address, view);
1853
- }
1854
-
1855
- public static bind(options: BindOptions): PythProcessor {
1856
- if (!options.name) {
1857
- options.name = "Pyth";
1858
- }
1859
- let processor = getProcessor(options) as PythProcessor;
1860
- if (!processor) {
1861
- processor = new PythProcessor(options);
1862
- addProcessor(options, processor);
1863
- }
1864
- return processor;
1865
- }
1866
- }
1867
-
1868
- export class PythProcessorTemplate extends BaseProcessorTemplate<
1869
- Pyth,
1870
- PythBoundContractView
1871
- > {
1872
- bindInternal(options: BindOptions) {
1873
- if (!options.name) {
1874
- options.name = "Pyth";
1875
- }
1876
- let processor = getProcessor(options) as PythProcessor;
1877
- if (!processor) {
1878
- processor = new PythProcessor(options);
1879
- addProcessor(options, processor);
1880
- }
1881
- return processor;
1882
- }
1883
-
1884
- onEventAdminChanged(
1885
- handler: (event: AdminChangedEvent, ctx: PythContext) => void,
1886
- filter?: AdminChangedEventFilter | AdminChangedEventFilter[],
1887
- fetchConfig?: EthFetchConfig
1888
- ) {
1889
- if (!filter) {
1890
- filter = templateContract.filters["AdminChanged(address,address)"](
1891
- null,
1892
- null
1893
- );
1894
- }
1895
- return super.onEvent(handler, filter!, fetchConfig);
1896
- }
1897
-
1898
- onEventBatchPriceFeedUpdate(
1899
- handler: (event: BatchPriceFeedUpdateEvent, ctx: PythContext) => void,
1900
- filter?:
1901
- | BatchPriceFeedUpdateEventFilter
1902
- | BatchPriceFeedUpdateEventFilter[],
1903
- fetchConfig?: EthFetchConfig
1904
- ) {
1905
- if (!filter) {
1906
- filter = templateContract.filters["BatchPriceFeedUpdate(uint16,uint64)"](
1907
- null,
1908
- null
1909
- );
1910
- }
1911
- return super.onEvent(handler, filter!, fetchConfig);
1912
- }
1913
-
1914
- onEventBeaconUpgraded(
1915
- handler: (event: BeaconUpgradedEvent, ctx: PythContext) => void,
1916
- filter?: BeaconUpgradedEventFilter | BeaconUpgradedEventFilter[],
1917
- fetchConfig?: EthFetchConfig
1918
- ) {
1919
- if (!filter) {
1920
- filter = templateContract.filters["BeaconUpgraded(address)"](null);
1921
- }
1922
- return super.onEvent(handler, filter!, fetchConfig);
1923
- }
1924
-
1925
- onEventContractUpgraded(
1926
- handler: (event: ContractUpgradedEvent, ctx: PythContext) => void,
1927
- filter?: ContractUpgradedEventFilter | ContractUpgradedEventFilter[],
1928
- fetchConfig?: EthFetchConfig
1929
- ) {
1930
- if (!filter) {
1931
- filter = templateContract.filters["ContractUpgraded(address,address)"](
1932
- null,
1933
- null
1934
- );
1935
- }
1936
- return super.onEvent(handler, filter!, fetchConfig);
1937
- }
1938
-
1939
- onEventDataSourcesSet(
1940
- handler: (event: DataSourcesSetEvent, ctx: PythContext) => void,
1941
- filter?: DataSourcesSetEventFilter | DataSourcesSetEventFilter[],
1942
- fetchConfig?: EthFetchConfig
1943
- ) {
1944
- if (!filter) {
1945
- filter = templateContract.filters[
1946
- "DataSourcesSet((uint16,bytes32)[],(uint16,bytes32)[])"
1947
- ](null, null);
1948
- }
1949
- return super.onEvent(handler, filter!, fetchConfig);
1950
- }
1951
-
1952
- onEventFeeSet(
1953
- handler: (event: FeeSetEvent, ctx: PythContext) => void,
1954
- filter?: FeeSetEventFilter | FeeSetEventFilter[],
1955
- fetchConfig?: EthFetchConfig
1956
- ) {
1957
- if (!filter) {
1958
- filter = templateContract.filters["FeeSet(uint256,uint256)"](null, null);
1959
- }
1960
- return super.onEvent(handler, filter!, fetchConfig);
1961
- }
1962
-
1963
- onEventGovernanceDataSourceSet(
1964
- handler: (event: GovernanceDataSourceSetEvent, ctx: PythContext) => void,
1965
- filter?:
1966
- | GovernanceDataSourceSetEventFilter
1967
- | GovernanceDataSourceSetEventFilter[],
1968
- fetchConfig?: EthFetchConfig
1969
- ) {
1970
- if (!filter) {
1971
- filter = templateContract.filters[
1972
- "GovernanceDataSourceSet((uint16,bytes32),(uint16,bytes32),uint64)"
1973
- ](null, null, null);
1974
- }
1975
- return super.onEvent(handler, filter!, fetchConfig);
1976
- }
1977
-
1978
- onEventOwnershipTransferred(
1979
- handler: (event: OwnershipTransferredEvent, ctx: PythContext) => void,
1980
- filter?:
1981
- | OwnershipTransferredEventFilter
1982
- | OwnershipTransferredEventFilter[],
1983
- fetchConfig?: EthFetchConfig
1984
- ) {
1985
- if (!filter) {
1986
- filter = templateContract.filters[
1987
- "OwnershipTransferred(address,address)"
1988
- ](null, null);
1989
- }
1990
- return super.onEvent(handler, filter!, fetchConfig);
1991
- }
1992
-
1993
- onEventPriceFeedUpdate(
1994
- handler: (event: PriceFeedUpdateEvent, ctx: PythContext) => void,
1995
- filter?: PriceFeedUpdateEventFilter | PriceFeedUpdateEventFilter[],
1996
- fetchConfig?: EthFetchConfig
1997
- ) {
1998
- if (!filter) {
1999
- filter = templateContract.filters[
2000
- "PriceFeedUpdate(bytes32,uint64,int64,uint64)"
2001
- ](null, null, null, null);
2002
- }
2003
- return super.onEvent(handler, filter!, fetchConfig);
2004
- }
2005
-
2006
- onEventUpgraded(
2007
- handler: (event: UpgradedEvent, ctx: PythContext) => void,
2008
- filter?: UpgradedEventFilter | UpgradedEventFilter[],
2009
- fetchConfig?: EthFetchConfig
2010
- ) {
2011
- if (!filter) {
2012
- filter = templateContract.filters["Upgraded(address)"](null);
2013
- }
2014
- return super.onEvent(handler, filter!, fetchConfig);
2015
- }
2016
-
2017
- onEventValidPeriodSet(
2018
- handler: (event: ValidPeriodSetEvent, ctx: PythContext) => void,
2019
- filter?: ValidPeriodSetEventFilter | ValidPeriodSetEventFilter[],
2020
- fetchConfig?: EthFetchConfig
2021
- ) {
2022
- if (!filter) {
2023
- filter = templateContract.filters["ValidPeriodSet(uint256,uint256)"](
2024
- null,
2025
- null
2026
- );
2027
- }
2028
- return super.onEvent(handler, filter!, fetchConfig);
2029
- }
2030
- }
2031
-
2032
- export function getPythContract(
2033
- address: string,
2034
- network: Networkish = 1
2035
- ): PythContractView {
2036
- let contract = getContractByABI("Pyth", address, network) as PythContractView;
2037
- if (!contract) {
2038
- const rawContract = Pyth__factory.connect(address, getProvider(network));
2039
- contract = new PythContractView(rawContract);
2040
- addContractByABI("Pyth", address, network, contract);
2041
- }
2042
- return contract;
2043
- }