Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit fe1f1da

Browse files
authored
Add ABI for all contracts in the sdk (#21)
* Generate Abi for all contracts * Bump version from 0.4.0-beta.0 to 0.4.0 * Update README * Update readme
1 parent a8e3e6c commit fe1f1da

File tree

8 files changed

+815
-17
lines changed

8 files changed

+815
-17
lines changed

.github/workflows/abi-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Check ABI changes
2121
# Fails if the ABI files are not up to date. Please use npm run generate-abi to regenerate the ABI files for
2222
# the current version of the contracts.
23-
run: git diff --exit-code IPythAbi.json
23+
run: git diff --exit-code abis/*

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ You can find a list of available price feeds [here](https://pyth.network/develop
6565

6666
## Development
6767

68-
When making changes to the contract, please make sure to update the ABI. You can update it using `npm run generate-abi` and it will update `IPythAbi.json` file.
68+
### ABIs
69+
70+
When making changes to a contract interface, please make sure to update the ABI files too. You can update it using `npm run generate-abi` and it will update the ABI files in [abis](./abis) directory. If you create a new contract, you also need to add the contract name in [the ABI generation script](./scripts/generateAbi.js#L5) so the script can create the ABI file for the new contract as well.
6971

7072
### Releases
7173

abis/AbstractPyth.json

Lines changed: 349 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,349 @@
1+
[
2+
{
3+
"anonymous": false,
4+
"inputs": [
5+
{
6+
"indexed": false,
7+
"internalType": "uint16",
8+
"name": "chainId",
9+
"type": "uint16"
10+
},
11+
{
12+
"indexed": false,
13+
"internalType": "uint64",
14+
"name": "sequenceNumber",
15+
"type": "uint64"
16+
},
17+
{
18+
"indexed": false,
19+
"internalType": "uint256",
20+
"name": "batchSize",
21+
"type": "uint256"
22+
},
23+
{
24+
"indexed": false,
25+
"internalType": "uint256",
26+
"name": "freshPricesInBatch",
27+
"type": "uint256"
28+
}
29+
],
30+
"name": "BatchPriceFeedUpdate",
31+
"type": "event"
32+
},
33+
{
34+
"anonymous": false,
35+
"inputs": [
36+
{
37+
"indexed": true,
38+
"internalType": "bytes32",
39+
"name": "id",
40+
"type": "bytes32"
41+
},
42+
{
43+
"indexed": true,
44+
"internalType": "bool",
45+
"name": "fresh",
46+
"type": "bool"
47+
},
48+
{
49+
"indexed": false,
50+
"internalType": "uint16",
51+
"name": "chainId",
52+
"type": "uint16"
53+
},
54+
{
55+
"indexed": false,
56+
"internalType": "uint64",
57+
"name": "sequenceNumber",
58+
"type": "uint64"
59+
},
60+
{
61+
"indexed": false,
62+
"internalType": "uint64",
63+
"name": "lastPublishTime",
64+
"type": "uint64"
65+
},
66+
{
67+
"indexed": false,
68+
"internalType": "uint64",
69+
"name": "publishTime",
70+
"type": "uint64"
71+
},
72+
{
73+
"indexed": false,
74+
"internalType": "int64",
75+
"name": "price",
76+
"type": "int64"
77+
},
78+
{
79+
"indexed": false,
80+
"internalType": "uint64",
81+
"name": "conf",
82+
"type": "uint64"
83+
}
84+
],
85+
"name": "PriceFeedUpdate",
86+
"type": "event"
87+
},
88+
{
89+
"anonymous": false,
90+
"inputs": [
91+
{
92+
"indexed": true,
93+
"internalType": "address",
94+
"name": "sender",
95+
"type": "address"
96+
},
97+
{
98+
"indexed": false,
99+
"internalType": "uint256",
100+
"name": "batchCount",
101+
"type": "uint256"
102+
},
103+
{
104+
"indexed": false,
105+
"internalType": "uint256",
106+
"name": "fee",
107+
"type": "uint256"
108+
}
109+
],
110+
"name": "UpdatePriceFeeds",
111+
"type": "event"
112+
},
113+
{
114+
"inputs": [
115+
{
116+
"internalType": "bytes32",
117+
"name": "id",
118+
"type": "bytes32"
119+
}
120+
],
121+
"name": "getCurrentPrice",
122+
"outputs": [
123+
{
124+
"components": [
125+
{
126+
"internalType": "int64",
127+
"name": "price",
128+
"type": "int64"
129+
},
130+
{
131+
"internalType": "uint64",
132+
"name": "conf",
133+
"type": "uint64"
134+
},
135+
{
136+
"internalType": "int32",
137+
"name": "expo",
138+
"type": "int32"
139+
}
140+
],
141+
"internalType": "struct PythStructs.Price",
142+
"name": "price",
143+
"type": "tuple"
144+
}
145+
],
146+
"stateMutability": "view",
147+
"type": "function"
148+
},
149+
{
150+
"inputs": [
151+
{
152+
"internalType": "bytes32",
153+
"name": "id",
154+
"type": "bytes32"
155+
}
156+
],
157+
"name": "getEmaPrice",
158+
"outputs": [
159+
{
160+
"components": [
161+
{
162+
"internalType": "int64",
163+
"name": "price",
164+
"type": "int64"
165+
},
166+
{
167+
"internalType": "uint64",
168+
"name": "conf",
169+
"type": "uint64"
170+
},
171+
{
172+
"internalType": "int32",
173+
"name": "expo",
174+
"type": "int32"
175+
}
176+
],
177+
"internalType": "struct PythStructs.Price",
178+
"name": "price",
179+
"type": "tuple"
180+
}
181+
],
182+
"stateMutability": "view",
183+
"type": "function"
184+
},
185+
{
186+
"inputs": [
187+
{
188+
"internalType": "bytes32",
189+
"name": "id",
190+
"type": "bytes32"
191+
}
192+
],
193+
"name": "getPrevPriceUnsafe",
194+
"outputs": [
195+
{
196+
"components": [
197+
{
198+
"internalType": "int64",
199+
"name": "price",
200+
"type": "int64"
201+
},
202+
{
203+
"internalType": "uint64",
204+
"name": "conf",
205+
"type": "uint64"
206+
},
207+
{
208+
"internalType": "int32",
209+
"name": "expo",
210+
"type": "int32"
211+
}
212+
],
213+
"internalType": "struct PythStructs.Price",
214+
"name": "price",
215+
"type": "tuple"
216+
},
217+
{
218+
"internalType": "uint64",
219+
"name": "publishTime",
220+
"type": "uint64"
221+
}
222+
],
223+
"stateMutability": "view",
224+
"type": "function"
225+
},
226+
{
227+
"inputs": [
228+
{
229+
"internalType": "uint256",
230+
"name": "updateDataSize",
231+
"type": "uint256"
232+
}
233+
],
234+
"name": "getUpdateFee",
235+
"outputs": [
236+
{
237+
"internalType": "uint256",
238+
"name": "feeAmount",
239+
"type": "uint256"
240+
}
241+
],
242+
"stateMutability": "view",
243+
"type": "function"
244+
},
245+
{
246+
"inputs": [
247+
{
248+
"internalType": "bytes32",
249+
"name": "id",
250+
"type": "bytes32"
251+
}
252+
],
253+
"name": "queryPriceFeed",
254+
"outputs": [
255+
{
256+
"components": [
257+
{
258+
"internalType": "bytes32",
259+
"name": "id",
260+
"type": "bytes32"
261+
},
262+
{
263+
"internalType": "bytes32",
264+
"name": "productId",
265+
"type": "bytes32"
266+
},
267+
{
268+
"internalType": "int64",
269+
"name": "price",
270+
"type": "int64"
271+
},
272+
{
273+
"internalType": "uint64",
274+
"name": "conf",
275+
"type": "uint64"
276+
},
277+
{
278+
"internalType": "int32",
279+
"name": "expo",
280+
"type": "int32"
281+
},
282+
{
283+
"internalType": "enum PythStructs.PriceStatus",
284+
"name": "status",
285+
"type": "uint8"
286+
},
287+
{
288+
"internalType": "uint32",
289+
"name": "maxNumPublishers",
290+
"type": "uint32"
291+
},
292+
{
293+
"internalType": "uint32",
294+
"name": "numPublishers",
295+
"type": "uint32"
296+
},
297+
{
298+
"internalType": "int64",
299+
"name": "emaPrice",
300+
"type": "int64"
301+
},
302+
{
303+
"internalType": "uint64",
304+
"name": "emaConf",
305+
"type": "uint64"
306+
},
307+
{
308+
"internalType": "uint64",
309+
"name": "publishTime",
310+
"type": "uint64"
311+
},
312+
{
313+
"internalType": "int64",
314+
"name": "prevPrice",
315+
"type": "int64"
316+
},
317+
{
318+
"internalType": "uint64",
319+
"name": "prevConf",
320+
"type": "uint64"
321+
},
322+
{
323+
"internalType": "uint64",
324+
"name": "prevPublishTime",
325+
"type": "uint64"
326+
}
327+
],
328+
"internalType": "struct PythStructs.PriceFeed",
329+
"name": "priceFeed",
330+
"type": "tuple"
331+
}
332+
],
333+
"stateMutability": "view",
334+
"type": "function"
335+
},
336+
{
337+
"inputs": [
338+
{
339+
"internalType": "bytes[]",
340+
"name": "updateData",
341+
"type": "bytes[]"
342+
}
343+
],
344+
"name": "updatePriceFeeds",
345+
"outputs": [],
346+
"stateMutability": "payable",
347+
"type": "function"
348+
}
349+
]
File renamed without changes.

0 commit comments

Comments
 (0)