@pythnetwork/pyth-solana-receiver 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PythSolanaReceiver.cjs +581 -0
- package/{lib → dist}/PythSolanaReceiver.d.ts +10 -10
- package/dist/address.cjs +61 -0
- package/{lib → dist}/address.d.ts +0 -1
- package/dist/compute_budget.cjs +46 -0
- package/{lib → dist}/compute_budget.d.ts +0 -1
- package/{lib/idl/pyth_push_oracle.js → dist/idl/pyth_push_oracle.cjs} +50 -37
- package/{lib → dist}/idl/pyth_push_oracle.d.ts +0 -1
- package/{lib/idl/pyth_solana_receiver.js → dist/idl/pyth_solana_receiver.cjs} +309 -236
- package/{lib → dist}/idl/pyth_solana_receiver.d.ts +79 -23
- package/{lib/idl/wormhole_core_bridge_solana.js → dist/idl/wormhole_core_bridge_solana.cjs} +607 -464
- package/{lib → dist}/idl/wormhole_core_bridge_solana.d.ts +0 -1
- package/dist/index.cjs +44 -0
- package/dist/index.d.ts +5 -0
- package/dist/package.json +1 -0
- package/dist/vaa.cjs +221 -0
- package/{lib → dist}/vaa.d.ts +6 -7
- package/package.json +52 -13
- package/lib/PythSolanaReceiver.d.ts.map +0 -1
- package/lib/PythSolanaReceiver.js +0 -633
- package/lib/address.d.ts.map +0 -1
- package/lib/address.js +0 -46
- package/lib/compute_budget.d.ts.map +0 -1
- package/lib/compute_budget.js +0 -35
- package/lib/idl/pyth_push_oracle.d.ts.map +0 -1
- package/lib/idl/pyth_solana_receiver.d.ts.map +0 -1
- package/lib/idl/wormhole_core_bridge_solana.d.ts.map +0 -1
- package/lib/index.d.ts +0 -6
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -17
- package/lib/vaa.d.ts.map +0 -1
- package/lib/vaa.js +0 -270
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "IDL", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return IDL;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const IDL = {
|
|
12
|
+
version: "0.2.1",
|
|
6
13
|
name: "pyth_solana_receiver",
|
|
7
14
|
instructions: [
|
|
8
15
|
{
|
|
@@ -11,27 +18,27 @@ exports.IDL = {
|
|
|
11
18
|
{
|
|
12
19
|
name: "payer",
|
|
13
20
|
isMut: true,
|
|
14
|
-
isSigner: true
|
|
21
|
+
isSigner: true
|
|
15
22
|
},
|
|
16
23
|
{
|
|
17
24
|
name: "config",
|
|
18
25
|
isMut: true,
|
|
19
|
-
isSigner: false
|
|
26
|
+
isSigner: false
|
|
20
27
|
},
|
|
21
28
|
{
|
|
22
29
|
name: "systemProgram",
|
|
23
30
|
isMut: false,
|
|
24
|
-
isSigner: false
|
|
25
|
-
}
|
|
31
|
+
isSigner: false
|
|
32
|
+
}
|
|
26
33
|
],
|
|
27
34
|
args: [
|
|
28
35
|
{
|
|
29
36
|
name: "initialConfig",
|
|
30
37
|
type: {
|
|
31
|
-
defined: "Config"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
38
|
+
defined: "Config"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
35
42
|
},
|
|
36
43
|
{
|
|
37
44
|
name: "requestGovernanceAuthorityTransfer",
|
|
@@ -39,20 +46,36 @@ exports.IDL = {
|
|
|
39
46
|
{
|
|
40
47
|
name: "payer",
|
|
41
48
|
isMut: false,
|
|
42
|
-
isSigner: true
|
|
49
|
+
isSigner: true
|
|
43
50
|
},
|
|
44
51
|
{
|
|
45
52
|
name: "config",
|
|
46
53
|
isMut: true,
|
|
47
|
-
isSigner: false
|
|
48
|
-
}
|
|
54
|
+
isSigner: false
|
|
55
|
+
}
|
|
49
56
|
],
|
|
50
57
|
args: [
|
|
51
58
|
{
|
|
52
59
|
name: "targetGovernanceAuthority",
|
|
53
|
-
type: "publicKey"
|
|
60
|
+
type: "publicKey"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "cancelGovernanceAuthorityTransfer",
|
|
66
|
+
accounts: [
|
|
67
|
+
{
|
|
68
|
+
name: "payer",
|
|
69
|
+
isMut: false,
|
|
70
|
+
isSigner: true
|
|
54
71
|
},
|
|
72
|
+
{
|
|
73
|
+
name: "config",
|
|
74
|
+
isMut: true,
|
|
75
|
+
isSigner: false
|
|
76
|
+
}
|
|
55
77
|
],
|
|
78
|
+
args: []
|
|
56
79
|
},
|
|
57
80
|
{
|
|
58
81
|
name: "acceptGovernanceAuthorityTransfer",
|
|
@@ -60,15 +83,15 @@ exports.IDL = {
|
|
|
60
83
|
{
|
|
61
84
|
name: "payer",
|
|
62
85
|
isMut: false,
|
|
63
|
-
isSigner: true
|
|
86
|
+
isSigner: true
|
|
64
87
|
},
|
|
65
88
|
{
|
|
66
89
|
name: "config",
|
|
67
90
|
isMut: true,
|
|
68
|
-
isSigner: false
|
|
69
|
-
}
|
|
91
|
+
isSigner: false
|
|
92
|
+
}
|
|
70
93
|
],
|
|
71
|
-
args: []
|
|
94
|
+
args: []
|
|
72
95
|
},
|
|
73
96
|
{
|
|
74
97
|
name: "setDataSources",
|
|
@@ -76,24 +99,24 @@ exports.IDL = {
|
|
|
76
99
|
{
|
|
77
100
|
name: "payer",
|
|
78
101
|
isMut: false,
|
|
79
|
-
isSigner: true
|
|
102
|
+
isSigner: true
|
|
80
103
|
},
|
|
81
104
|
{
|
|
82
105
|
name: "config",
|
|
83
106
|
isMut: true,
|
|
84
|
-
isSigner: false
|
|
85
|
-
}
|
|
107
|
+
isSigner: false
|
|
108
|
+
}
|
|
86
109
|
],
|
|
87
110
|
args: [
|
|
88
111
|
{
|
|
89
112
|
name: "validDataSources",
|
|
90
113
|
type: {
|
|
91
114
|
vec: {
|
|
92
|
-
defined: "DataSource"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
115
|
+
defined: "DataSource"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
]
|
|
97
120
|
},
|
|
98
121
|
{
|
|
99
122
|
name: "setFee",
|
|
@@ -101,20 +124,20 @@ exports.IDL = {
|
|
|
101
124
|
{
|
|
102
125
|
name: "payer",
|
|
103
126
|
isMut: false,
|
|
104
|
-
isSigner: true
|
|
127
|
+
isSigner: true
|
|
105
128
|
},
|
|
106
129
|
{
|
|
107
130
|
name: "config",
|
|
108
131
|
isMut: true,
|
|
109
|
-
isSigner: false
|
|
110
|
-
}
|
|
132
|
+
isSigner: false
|
|
133
|
+
}
|
|
111
134
|
],
|
|
112
135
|
args: [
|
|
113
136
|
{
|
|
114
137
|
name: "singleUpdateFeeInLamports",
|
|
115
|
-
type: "u64"
|
|
116
|
-
}
|
|
117
|
-
]
|
|
138
|
+
type: "u64"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
118
141
|
},
|
|
119
142
|
{
|
|
120
143
|
name: "setWormholeAddress",
|
|
@@ -122,20 +145,20 @@ exports.IDL = {
|
|
|
122
145
|
{
|
|
123
146
|
name: "payer",
|
|
124
147
|
isMut: false,
|
|
125
|
-
isSigner: true
|
|
148
|
+
isSigner: true
|
|
126
149
|
},
|
|
127
150
|
{
|
|
128
151
|
name: "config",
|
|
129
152
|
isMut: true,
|
|
130
|
-
isSigner: false
|
|
131
|
-
}
|
|
153
|
+
isSigner: false
|
|
154
|
+
}
|
|
132
155
|
],
|
|
133
156
|
args: [
|
|
134
157
|
{
|
|
135
158
|
name: "wormhole",
|
|
136
|
-
type: "publicKey"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
159
|
+
type: "publicKey"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
139
162
|
},
|
|
140
163
|
{
|
|
141
164
|
name: "setMinimumSignatures",
|
|
@@ -143,200 +166,206 @@ exports.IDL = {
|
|
|
143
166
|
{
|
|
144
167
|
name: "payer",
|
|
145
168
|
isMut: false,
|
|
146
|
-
isSigner: true
|
|
169
|
+
isSigner: true
|
|
147
170
|
},
|
|
148
171
|
{
|
|
149
172
|
name: "config",
|
|
150
173
|
isMut: true,
|
|
151
|
-
isSigner: false
|
|
152
|
-
}
|
|
174
|
+
isSigner: false
|
|
175
|
+
}
|
|
153
176
|
],
|
|
154
177
|
args: [
|
|
155
178
|
{
|
|
156
179
|
name: "minimumSignatures",
|
|
157
|
-
type: "u8"
|
|
158
|
-
}
|
|
159
|
-
]
|
|
180
|
+
type: "u8"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
160
183
|
},
|
|
161
184
|
{
|
|
162
185
|
name: "postUpdateAtomic",
|
|
163
186
|
docs: [
|
|
164
187
|
"Post a price update using a VAA and a MerklePriceUpdate.",
|
|
165
188
|
"This function allows you to post a price update in a single transaction.",
|
|
166
|
-
"Compared to post_update
|
|
167
|
-
"
|
|
189
|
+
"Compared to `post_update`, it only checks whatever signatures are present in the provided VAA and doesn't fail if the number of signatures is lower than the Wormhole quorum of two thirds of the guardians.",
|
|
190
|
+
"The number of signatures that were in the VAA is stored in the `VerificationLevel` of the `PriceUpdateV2` account.",
|
|
191
|
+
"",
|
|
192
|
+
"We recommend using `post_update_atomic` with 5 signatures. This is close to the maximum signatures you can verify in one transaction without exceeding the transaction size limit.",
|
|
193
|
+
"",
|
|
194
|
+
"# Warning",
|
|
195
|
+
"",
|
|
196
|
+
"Using partially verified price updates is dangerous, as it lowers the threshold of guardians that need to collude to produce a malicious price update."
|
|
168
197
|
],
|
|
169
198
|
accounts: [
|
|
170
199
|
{
|
|
171
200
|
name: "payer",
|
|
172
201
|
isMut: true,
|
|
173
|
-
isSigner: true
|
|
202
|
+
isSigner: true
|
|
174
203
|
},
|
|
175
204
|
{
|
|
176
205
|
name: "guardianSet",
|
|
177
206
|
isMut: false,
|
|
178
207
|
isSigner: false,
|
|
179
208
|
docs: [
|
|
180
|
-
"Instead we do the same steps in deserialize_guardian_set_checked."
|
|
181
|
-
]
|
|
209
|
+
"Instead we do the same steps in deserialize_guardian_set_checked."
|
|
210
|
+
]
|
|
182
211
|
},
|
|
183
212
|
{
|
|
184
213
|
name: "config",
|
|
185
214
|
isMut: false,
|
|
186
|
-
isSigner: false
|
|
215
|
+
isSigner: false
|
|
187
216
|
},
|
|
188
217
|
{
|
|
189
218
|
name: "treasury",
|
|
190
219
|
isMut: true,
|
|
191
|
-
isSigner: false
|
|
220
|
+
isSigner: false
|
|
192
221
|
},
|
|
193
222
|
{
|
|
194
223
|
name: "priceUpdateAccount",
|
|
195
224
|
isMut: true,
|
|
196
225
|
isSigner: true,
|
|
197
226
|
docs: [
|
|
198
|
-
"The
|
|
199
|
-
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
|
|
200
|
-
]
|
|
227
|
+
"The constraint is such that either the price_update_account is uninitialized or the write_authority is the write_authority.",
|
|
228
|
+
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
|
|
229
|
+
]
|
|
201
230
|
},
|
|
202
231
|
{
|
|
203
232
|
name: "systemProgram",
|
|
204
233
|
isMut: false,
|
|
205
|
-
isSigner: false
|
|
234
|
+
isSigner: false
|
|
206
235
|
},
|
|
207
236
|
{
|
|
208
237
|
name: "writeAuthority",
|
|
209
238
|
isMut: false,
|
|
210
|
-
isSigner: true
|
|
211
|
-
}
|
|
239
|
+
isSigner: true
|
|
240
|
+
}
|
|
212
241
|
],
|
|
213
242
|
args: [
|
|
214
243
|
{
|
|
215
244
|
name: "params",
|
|
216
245
|
type: {
|
|
217
|
-
defined: "PostUpdateAtomicParams"
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
]
|
|
246
|
+
defined: "PostUpdateAtomicParams"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
]
|
|
221
250
|
},
|
|
222
251
|
{
|
|
223
252
|
name: "postUpdate",
|
|
224
253
|
docs: [
|
|
225
254
|
"Post a price update using an encoded_vaa account and a MerklePriceUpdate calldata.",
|
|
226
255
|
"This should be called after the client has already verified the Vaa via the Wormhole contract.",
|
|
227
|
-
"Check out target_chains/solana/cli/src/main.rs for an example of how to do this."
|
|
256
|
+
"Check out target_chains/solana/cli/src/main.rs for an example of how to do this."
|
|
228
257
|
],
|
|
229
258
|
accounts: [
|
|
230
259
|
{
|
|
231
260
|
name: "payer",
|
|
232
261
|
isMut: true,
|
|
233
|
-
isSigner: true
|
|
262
|
+
isSigner: true
|
|
234
263
|
},
|
|
235
264
|
{
|
|
236
265
|
name: "encodedVaa",
|
|
237
266
|
isMut: false,
|
|
238
|
-
isSigner: false
|
|
267
|
+
isSigner: false
|
|
239
268
|
},
|
|
240
269
|
{
|
|
241
270
|
name: "config",
|
|
242
271
|
isMut: false,
|
|
243
|
-
isSigner: false
|
|
272
|
+
isSigner: false
|
|
244
273
|
},
|
|
245
274
|
{
|
|
246
275
|
name: "treasury",
|
|
247
276
|
isMut: true,
|
|
248
|
-
isSigner: false
|
|
277
|
+
isSigner: false
|
|
249
278
|
},
|
|
250
279
|
{
|
|
251
280
|
name: "priceUpdateAccount",
|
|
252
281
|
isMut: true,
|
|
253
282
|
isSigner: true,
|
|
254
283
|
docs: [
|
|
255
|
-
"The
|
|
256
|
-
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
|
|
257
|
-
]
|
|
284
|
+
"The constraint is such that either the price_update_account is uninitialized or the write_authority is the write_authority.",
|
|
285
|
+
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
|
|
286
|
+
]
|
|
258
287
|
},
|
|
259
288
|
{
|
|
260
289
|
name: "systemProgram",
|
|
261
290
|
isMut: false,
|
|
262
|
-
isSigner: false
|
|
291
|
+
isSigner: false
|
|
263
292
|
},
|
|
264
293
|
{
|
|
265
294
|
name: "writeAuthority",
|
|
266
295
|
isMut: false,
|
|
267
|
-
isSigner: true
|
|
268
|
-
}
|
|
296
|
+
isSigner: true
|
|
297
|
+
}
|
|
269
298
|
],
|
|
270
299
|
args: [
|
|
271
300
|
{
|
|
272
301
|
name: "params",
|
|
273
302
|
type: {
|
|
274
|
-
defined: "PostUpdateParams"
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
]
|
|
303
|
+
defined: "PostUpdateParams"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
]
|
|
278
307
|
},
|
|
279
308
|
{
|
|
280
309
|
name: "postTwapUpdate",
|
|
281
310
|
docs: [
|
|
282
311
|
"Post a TWAP (time weighted average price) update for a given time window.",
|
|
283
312
|
"This should be called after the client has already verified the VAAs via the Wormhole contract.",
|
|
284
|
-
"Check out target_chains/solana/cli/src/main.rs for an example of how to do this."
|
|
313
|
+
"Check out target_chains/solana/cli/src/main.rs for an example of how to do this."
|
|
285
314
|
],
|
|
286
315
|
accounts: [
|
|
287
316
|
{
|
|
288
317
|
name: "payer",
|
|
289
318
|
isMut: true,
|
|
290
|
-
isSigner: true
|
|
319
|
+
isSigner: true
|
|
291
320
|
},
|
|
292
321
|
{
|
|
293
322
|
name: "startEncodedVaa",
|
|
294
323
|
isMut: false,
|
|
295
|
-
isSigner: false
|
|
324
|
+
isSigner: false
|
|
296
325
|
},
|
|
297
326
|
{
|
|
298
327
|
name: "endEncodedVaa",
|
|
299
328
|
isMut: false,
|
|
300
|
-
isSigner: false
|
|
329
|
+
isSigner: false
|
|
301
330
|
},
|
|
302
331
|
{
|
|
303
332
|
name: "config",
|
|
304
333
|
isMut: false,
|
|
305
|
-
isSigner: false
|
|
334
|
+
isSigner: false
|
|
306
335
|
},
|
|
307
336
|
{
|
|
308
337
|
name: "treasury",
|
|
309
338
|
isMut: true,
|
|
310
|
-
isSigner: false
|
|
339
|
+
isSigner: false
|
|
311
340
|
},
|
|
312
341
|
{
|
|
313
342
|
name: "twapUpdateAccount",
|
|
314
343
|
isMut: true,
|
|
315
344
|
isSigner: true,
|
|
316
345
|
docs: [
|
|
317
|
-
"The
|
|
318
|
-
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that
|
|
319
|
-
]
|
|
346
|
+
"The constraint is such that either the price_update_account is uninitialized or the write_authority is the write_authority.",
|
|
347
|
+
"Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
|
|
348
|
+
]
|
|
320
349
|
},
|
|
321
350
|
{
|
|
322
351
|
name: "systemProgram",
|
|
323
352
|
isMut: false,
|
|
324
|
-
isSigner: false
|
|
353
|
+
isSigner: false
|
|
325
354
|
},
|
|
326
355
|
{
|
|
327
356
|
name: "writeAuthority",
|
|
328
357
|
isMut: false,
|
|
329
|
-
isSigner: true
|
|
330
|
-
}
|
|
358
|
+
isSigner: true
|
|
359
|
+
}
|
|
331
360
|
],
|
|
332
361
|
args: [
|
|
333
362
|
{
|
|
334
363
|
name: "params",
|
|
335
364
|
type: {
|
|
336
|
-
defined: "PostTwapUpdateParams"
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
]
|
|
365
|
+
defined: "PostTwapUpdateParams"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
]
|
|
340
369
|
},
|
|
341
370
|
{
|
|
342
371
|
name: "reclaimRent",
|
|
@@ -344,15 +373,15 @@ exports.IDL = {
|
|
|
344
373
|
{
|
|
345
374
|
name: "payer",
|
|
346
375
|
isMut: true,
|
|
347
|
-
isSigner: true
|
|
376
|
+
isSigner: true
|
|
348
377
|
},
|
|
349
378
|
{
|
|
350
379
|
name: "priceUpdateAccount",
|
|
351
380
|
isMut: true,
|
|
352
|
-
isSigner: false
|
|
353
|
-
}
|
|
381
|
+
isSigner: false
|
|
382
|
+
}
|
|
354
383
|
],
|
|
355
|
-
args: []
|
|
384
|
+
args: []
|
|
356
385
|
},
|
|
357
386
|
{
|
|
358
387
|
name: "reclaimTwapRent",
|
|
@@ -360,16 +389,16 @@ exports.IDL = {
|
|
|
360
389
|
{
|
|
361
390
|
name: "payer",
|
|
362
391
|
isMut: true,
|
|
363
|
-
isSigner: true
|
|
392
|
+
isSigner: true
|
|
364
393
|
},
|
|
365
394
|
{
|
|
366
395
|
name: "twapUpdateAccount",
|
|
367
396
|
isMut: true,
|
|
368
|
-
isSigner: false
|
|
369
|
-
}
|
|
397
|
+
isSigner: false
|
|
398
|
+
}
|
|
370
399
|
],
|
|
371
|
-
args: []
|
|
372
|
-
}
|
|
400
|
+
args: []
|
|
401
|
+
}
|
|
373
402
|
],
|
|
374
403
|
accounts: [
|
|
375
404
|
{
|
|
@@ -379,36 +408,36 @@ exports.IDL = {
|
|
|
379
408
|
fields: [
|
|
380
409
|
{
|
|
381
410
|
name: "governanceAuthority",
|
|
382
|
-
type: "publicKey"
|
|
411
|
+
type: "publicKey"
|
|
383
412
|
},
|
|
384
413
|
{
|
|
385
414
|
name: "targetGovernanceAuthority",
|
|
386
415
|
type: {
|
|
387
|
-
option: "publicKey"
|
|
388
|
-
}
|
|
416
|
+
option: "publicKey"
|
|
417
|
+
}
|
|
389
418
|
},
|
|
390
419
|
{
|
|
391
420
|
name: "wormhole",
|
|
392
|
-
type: "publicKey"
|
|
421
|
+
type: "publicKey"
|
|
393
422
|
},
|
|
394
423
|
{
|
|
395
424
|
name: "validDataSources",
|
|
396
425
|
type: {
|
|
397
426
|
vec: {
|
|
398
|
-
defined: "DataSource"
|
|
399
|
-
}
|
|
400
|
-
}
|
|
427
|
+
defined: "DataSource"
|
|
428
|
+
}
|
|
429
|
+
}
|
|
401
430
|
},
|
|
402
431
|
{
|
|
403
432
|
name: "singleUpdateFeeInLamports",
|
|
404
|
-
type: "u64"
|
|
433
|
+
type: "u64"
|
|
405
434
|
},
|
|
406
435
|
{
|
|
407
436
|
name: "minimumSignatures",
|
|
408
|
-
type: "u8"
|
|
409
|
-
}
|
|
410
|
-
]
|
|
411
|
-
}
|
|
437
|
+
type: "u8"
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
}
|
|
412
441
|
},
|
|
413
442
|
{
|
|
414
443
|
name: "priceUpdateV2",
|
|
@@ -417,26 +446,26 @@ exports.IDL = {
|
|
|
417
446
|
fields: [
|
|
418
447
|
{
|
|
419
448
|
name: "writeAuthority",
|
|
420
|
-
type: "publicKey"
|
|
449
|
+
type: "publicKey"
|
|
421
450
|
},
|
|
422
451
|
{
|
|
423
452
|
name: "verificationLevel",
|
|
424
453
|
type: {
|
|
425
|
-
defined: "VerificationLevel"
|
|
426
|
-
}
|
|
454
|
+
defined: "VerificationLevel"
|
|
455
|
+
}
|
|
427
456
|
},
|
|
428
457
|
{
|
|
429
458
|
name: "priceMessage",
|
|
430
459
|
type: {
|
|
431
|
-
defined: "PriceFeedMessage"
|
|
432
|
-
}
|
|
460
|
+
defined: "PriceFeedMessage"
|
|
461
|
+
}
|
|
433
462
|
},
|
|
434
463
|
{
|
|
435
464
|
name: "postedSlot",
|
|
436
|
-
type: "u64"
|
|
437
|
-
}
|
|
438
|
-
]
|
|
439
|
-
}
|
|
465
|
+
type: "u64"
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
}
|
|
440
469
|
},
|
|
441
470
|
{
|
|
442
471
|
name: "twapUpdate",
|
|
@@ -445,17 +474,17 @@ exports.IDL = {
|
|
|
445
474
|
fields: [
|
|
446
475
|
{
|
|
447
476
|
name: "writeAuthority",
|
|
448
|
-
type: "publicKey"
|
|
477
|
+
type: "publicKey"
|
|
449
478
|
},
|
|
450
479
|
{
|
|
451
480
|
name: "twap",
|
|
452
481
|
type: {
|
|
453
|
-
defined: "TwapPrice"
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
]
|
|
457
|
-
}
|
|
458
|
-
}
|
|
482
|
+
defined: "TwapPrice"
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
}
|
|
487
|
+
}
|
|
459
488
|
],
|
|
460
489
|
types: [
|
|
461
490
|
{
|
|
@@ -466,45 +495,48 @@ exports.IDL = {
|
|
|
466
495
|
{
|
|
467
496
|
name: "feedId",
|
|
468
497
|
type: {
|
|
469
|
-
array: [
|
|
470
|
-
|
|
498
|
+
array: [
|
|
499
|
+
"u8",
|
|
500
|
+
32
|
|
501
|
+
]
|
|
502
|
+
}
|
|
471
503
|
},
|
|
472
504
|
{
|
|
473
505
|
name: "price",
|
|
474
|
-
type: "i64"
|
|
506
|
+
type: "i64"
|
|
475
507
|
},
|
|
476
508
|
{
|
|
477
509
|
name: "conf",
|
|
478
|
-
type: "u64"
|
|
510
|
+
type: "u64"
|
|
479
511
|
},
|
|
480
512
|
{
|
|
481
513
|
name: "exponent",
|
|
482
|
-
type: "i32"
|
|
514
|
+
type: "i32"
|
|
483
515
|
},
|
|
484
516
|
{
|
|
485
517
|
name: "publishTime",
|
|
486
|
-
type: "i64"
|
|
518
|
+
type: "i64"
|
|
487
519
|
},
|
|
488
520
|
{
|
|
489
521
|
name: "prevPublishTime",
|
|
490
|
-
type: "i64"
|
|
522
|
+
type: "i64"
|
|
491
523
|
},
|
|
492
524
|
{
|
|
493
525
|
name: "emaPrice",
|
|
494
|
-
type: "i64"
|
|
526
|
+
type: "i64"
|
|
495
527
|
},
|
|
496
528
|
{
|
|
497
529
|
name: "emaConf",
|
|
498
|
-
type: "u64"
|
|
499
|
-
}
|
|
500
|
-
]
|
|
501
|
-
}
|
|
530
|
+
type: "u64"
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
}
|
|
502
534
|
},
|
|
503
535
|
{
|
|
504
536
|
name: "TwapPrice",
|
|
505
537
|
docs: [
|
|
506
538
|
"The time weighted average price & conf for a feed over the window [start_time, end_time].",
|
|
507
|
-
"This type is used to persist the calculated TWAP in TwapUpdate accounts on Solana."
|
|
539
|
+
"This type is used to persist the calculated TWAP in TwapUpdate accounts on Solana."
|
|
508
540
|
],
|
|
509
541
|
type: {
|
|
510
542
|
kind: "struct",
|
|
@@ -512,39 +544,42 @@ exports.IDL = {
|
|
|
512
544
|
{
|
|
513
545
|
name: "feedId",
|
|
514
546
|
type: {
|
|
515
|
-
array: [
|
|
516
|
-
|
|
547
|
+
array: [
|
|
548
|
+
"u8",
|
|
549
|
+
32
|
|
550
|
+
]
|
|
551
|
+
}
|
|
517
552
|
},
|
|
518
553
|
{
|
|
519
554
|
name: "startTime",
|
|
520
|
-
type: "i64"
|
|
555
|
+
type: "i64"
|
|
521
556
|
},
|
|
522
557
|
{
|
|
523
558
|
name: "endTime",
|
|
524
|
-
type: "i64"
|
|
559
|
+
type: "i64"
|
|
525
560
|
},
|
|
526
561
|
{
|
|
527
562
|
name: "price",
|
|
528
|
-
type: "i64"
|
|
563
|
+
type: "i64"
|
|
529
564
|
},
|
|
530
565
|
{
|
|
531
566
|
name: "conf",
|
|
532
|
-
type: "u64"
|
|
567
|
+
type: "u64"
|
|
533
568
|
},
|
|
534
569
|
{
|
|
535
570
|
name: "exponent",
|
|
536
|
-
type: "i32"
|
|
571
|
+
type: "i32"
|
|
537
572
|
},
|
|
538
573
|
{
|
|
539
574
|
name: "downSlotsRatio",
|
|
540
575
|
docs: [
|
|
541
576
|
"Ratio out of 1_000_000, where a value of 1_000_000 represents",
|
|
542
|
-
"all slots were missed and 0 represents no slots were missed."
|
|
577
|
+
"all slots were missed and 0 represents no slots were missed."
|
|
543
578
|
],
|
|
544
|
-
type: "u32"
|
|
545
|
-
}
|
|
546
|
-
]
|
|
547
|
-
}
|
|
579
|
+
type: "u32"
|
|
580
|
+
}
|
|
581
|
+
]
|
|
582
|
+
}
|
|
548
583
|
},
|
|
549
584
|
{
|
|
550
585
|
name: "MerklePriceUpdate",
|
|
@@ -553,18 +588,21 @@ exports.IDL = {
|
|
|
553
588
|
fields: [
|
|
554
589
|
{
|
|
555
590
|
name: "message",
|
|
556
|
-
type: "bytes"
|
|
591
|
+
type: "bytes"
|
|
557
592
|
},
|
|
558
593
|
{
|
|
559
594
|
name: "proof",
|
|
560
595
|
type: {
|
|
561
596
|
vec: {
|
|
562
|
-
array: [
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
597
|
+
array: [
|
|
598
|
+
"u8",
|
|
599
|
+
20
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
}
|
|
568
606
|
},
|
|
569
607
|
{
|
|
570
608
|
name: "DataSource",
|
|
@@ -573,14 +611,14 @@ exports.IDL = {
|
|
|
573
611
|
fields: [
|
|
574
612
|
{
|
|
575
613
|
name: "chain",
|
|
576
|
-
type: "u16"
|
|
614
|
+
type: "u16"
|
|
577
615
|
},
|
|
578
616
|
{
|
|
579
617
|
name: "emitter",
|
|
580
|
-
type: "publicKey"
|
|
581
|
-
}
|
|
582
|
-
]
|
|
583
|
-
}
|
|
618
|
+
type: "publicKey"
|
|
619
|
+
}
|
|
620
|
+
]
|
|
621
|
+
}
|
|
584
622
|
},
|
|
585
623
|
{
|
|
586
624
|
name: "PostUpdateAtomicParams",
|
|
@@ -589,20 +627,20 @@ exports.IDL = {
|
|
|
589
627
|
fields: [
|
|
590
628
|
{
|
|
591
629
|
name: "vaa",
|
|
592
|
-
type: "bytes"
|
|
630
|
+
type: "bytes"
|
|
593
631
|
},
|
|
594
632
|
{
|
|
595
633
|
name: "merklePriceUpdate",
|
|
596
634
|
type: {
|
|
597
|
-
defined: "MerklePriceUpdate"
|
|
598
|
-
}
|
|
635
|
+
defined: "MerklePriceUpdate"
|
|
636
|
+
}
|
|
599
637
|
},
|
|
600
638
|
{
|
|
601
639
|
name: "treasuryId",
|
|
602
|
-
type: "u8"
|
|
603
|
-
}
|
|
604
|
-
]
|
|
605
|
-
}
|
|
640
|
+
type: "u8"
|
|
641
|
+
}
|
|
642
|
+
]
|
|
643
|
+
}
|
|
606
644
|
},
|
|
607
645
|
{
|
|
608
646
|
name: "PostUpdateParams",
|
|
@@ -612,15 +650,15 @@ exports.IDL = {
|
|
|
612
650
|
{
|
|
613
651
|
name: "merklePriceUpdate",
|
|
614
652
|
type: {
|
|
615
|
-
defined: "MerklePriceUpdate"
|
|
616
|
-
}
|
|
653
|
+
defined: "MerklePriceUpdate"
|
|
654
|
+
}
|
|
617
655
|
},
|
|
618
656
|
{
|
|
619
657
|
name: "treasuryId",
|
|
620
|
-
type: "u8"
|
|
621
|
-
}
|
|
622
|
-
]
|
|
623
|
-
}
|
|
658
|
+
type: "u8"
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
}
|
|
624
662
|
},
|
|
625
663
|
{
|
|
626
664
|
name: "PostTwapUpdateParams",
|
|
@@ -630,26 +668,26 @@ exports.IDL = {
|
|
|
630
668
|
{
|
|
631
669
|
name: "startMerklePriceUpdate",
|
|
632
670
|
type: {
|
|
633
|
-
defined: "MerklePriceUpdate"
|
|
634
|
-
}
|
|
671
|
+
defined: "MerklePriceUpdate"
|
|
672
|
+
}
|
|
635
673
|
},
|
|
636
674
|
{
|
|
637
675
|
name: "endMerklePriceUpdate",
|
|
638
676
|
type: {
|
|
639
|
-
defined: "MerklePriceUpdate"
|
|
640
|
-
}
|
|
677
|
+
defined: "MerklePriceUpdate"
|
|
678
|
+
}
|
|
641
679
|
},
|
|
642
680
|
{
|
|
643
681
|
name: "treasuryId",
|
|
644
|
-
type: "u8"
|
|
645
|
-
}
|
|
646
|
-
]
|
|
647
|
-
}
|
|
682
|
+
type: "u8"
|
|
683
|
+
}
|
|
684
|
+
]
|
|
685
|
+
}
|
|
648
686
|
},
|
|
649
687
|
{
|
|
650
688
|
name: "VerificationLevel",
|
|
651
689
|
docs: [
|
|
652
|
-
"* This enum represents how many guardian signatures were checked for a Pythnet price update\n * If full, guardian quorum has been attained\n * If partial, at least config.minimum signatures have been verified, but in the case config.minimum_signatures changes in the future we also include the number of signatures that were checked"
|
|
690
|
+
"* This enum represents how many guardian signatures were checked for a Pythnet price update\n * If full, guardian quorum has been attained\n * If partial, at least config.minimum signatures have been verified, but in the case config.minimum_signatures changes in the future we also include the number of signatures that were checked"
|
|
653
691
|
],
|
|
654
692
|
type: {
|
|
655
693
|
kind: "enum",
|
|
@@ -659,127 +697,162 @@ exports.IDL = {
|
|
|
659
697
|
fields: [
|
|
660
698
|
{
|
|
661
699
|
name: "numSignatures",
|
|
662
|
-
type: "u8"
|
|
663
|
-
}
|
|
664
|
-
]
|
|
700
|
+
type: "u8"
|
|
701
|
+
}
|
|
702
|
+
]
|
|
665
703
|
},
|
|
666
704
|
{
|
|
667
|
-
name: "Full"
|
|
668
|
-
}
|
|
669
|
-
]
|
|
670
|
-
}
|
|
671
|
-
}
|
|
705
|
+
name: "Full"
|
|
706
|
+
}
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
}
|
|
672
710
|
],
|
|
673
711
|
errors: [
|
|
674
712
|
{
|
|
675
713
|
code: 6000,
|
|
676
714
|
name: "InvalidWormholeMessage",
|
|
677
|
-
msg: "Received an invalid wormhole message"
|
|
715
|
+
msg: "Received an invalid wormhole message"
|
|
678
716
|
},
|
|
679
717
|
{
|
|
680
718
|
code: 6001,
|
|
681
719
|
name: "DeserializeMessageFailed",
|
|
682
|
-
msg: "An error occurred when deserializing the message"
|
|
720
|
+
msg: "An error occurred when deserializing the message"
|
|
683
721
|
},
|
|
684
722
|
{
|
|
685
723
|
code: 6002,
|
|
686
724
|
name: "InvalidPriceUpdate",
|
|
687
|
-
msg: "Received an invalid price update"
|
|
725
|
+
msg: "Received an invalid price update"
|
|
688
726
|
},
|
|
689
727
|
{
|
|
690
728
|
code: 6003,
|
|
691
729
|
name: "UnsupportedMessageType",
|
|
692
|
-
msg: "This type of message is not supported currently"
|
|
730
|
+
msg: "This type of message is not supported currently"
|
|
693
731
|
},
|
|
694
732
|
{
|
|
695
733
|
code: 6004,
|
|
696
734
|
name: "InvalidDataSource",
|
|
697
|
-
msg: "The tuple emitter chain, emitter doesn't match one of the valid data sources."
|
|
735
|
+
msg: "The tuple emitter chain, emitter doesn't match one of the valid data sources."
|
|
698
736
|
},
|
|
699
737
|
{
|
|
700
738
|
code: 6005,
|
|
701
739
|
name: "InsufficientFunds",
|
|
702
|
-
msg: "Funds are insufficient to pay the receiving fee"
|
|
740
|
+
msg: "Funds are insufficient to pay the receiving fee"
|
|
703
741
|
},
|
|
704
742
|
{
|
|
705
743
|
code: 6006,
|
|
706
|
-
name: "
|
|
707
|
-
msg: "
|
|
744
|
+
name: "FeedIdMismatch",
|
|
745
|
+
msg: "Cannot calculate TWAP, end slot must be greater than start slot"
|
|
708
746
|
},
|
|
709
747
|
{
|
|
710
748
|
code: 6007,
|
|
711
|
-
name: "
|
|
712
|
-
msg: "The
|
|
749
|
+
name: "ExponentMismatch",
|
|
750
|
+
msg: "The start and end messages must have the same feed ID"
|
|
713
751
|
},
|
|
714
752
|
{
|
|
715
753
|
code: 6008,
|
|
716
|
-
name: "
|
|
717
|
-
msg: "
|
|
754
|
+
name: "InvalidTwapSlots",
|
|
755
|
+
msg: "The start and end messages must have the same exponent"
|
|
718
756
|
},
|
|
719
757
|
{
|
|
720
758
|
code: 6009,
|
|
721
|
-
name: "
|
|
722
|
-
msg: "
|
|
759
|
+
name: "InvalidTwapStartMessage",
|
|
760
|
+
msg: "Start message is not the first update for its timestamp"
|
|
723
761
|
},
|
|
724
762
|
{
|
|
725
763
|
code: 6010,
|
|
726
|
-
name: "
|
|
727
|
-
msg: "
|
|
764
|
+
name: "InvalidTwapEndMessage",
|
|
765
|
+
msg: "End message is not the first update for its timestamp"
|
|
728
766
|
},
|
|
729
767
|
{
|
|
730
768
|
code: 6011,
|
|
731
|
-
name: "
|
|
732
|
-
msg: "
|
|
769
|
+
name: "TwapCalculationOverflow",
|
|
770
|
+
msg: "Overflow in TWAP calculation"
|
|
733
771
|
},
|
|
734
772
|
{
|
|
735
773
|
code: 6012,
|
|
736
|
-
name: "
|
|
737
|
-
msg: "
|
|
774
|
+
name: "WrongWriteAuthority",
|
|
775
|
+
msg: "This signer can't write to price update account"
|
|
738
776
|
},
|
|
739
777
|
{
|
|
740
778
|
code: 6013,
|
|
741
|
-
name: "
|
|
742
|
-
msg: "
|
|
779
|
+
name: "WrongVaaOwner",
|
|
780
|
+
msg: "The posted VAA account has the wrong owner."
|
|
743
781
|
},
|
|
744
782
|
{
|
|
745
783
|
code: 6014,
|
|
746
|
-
name: "
|
|
747
|
-
msg: "
|
|
784
|
+
name: "DeserializeVaaFailed",
|
|
785
|
+
msg: "An error occurred when deserializing the VAA."
|
|
748
786
|
},
|
|
749
787
|
{
|
|
750
788
|
code: 6015,
|
|
751
|
-
name: "
|
|
752
|
-
msg: "The
|
|
789
|
+
name: "InsufficientGuardianSignatures",
|
|
790
|
+
msg: "The number of guardian signatures is below the minimum"
|
|
753
791
|
},
|
|
754
792
|
{
|
|
755
793
|
code: 6016,
|
|
756
|
-
name: "
|
|
757
|
-
msg: "
|
|
794
|
+
name: "InvalidVaaVersion",
|
|
795
|
+
msg: "Invalid VAA version"
|
|
758
796
|
},
|
|
759
797
|
{
|
|
760
798
|
code: 6017,
|
|
761
|
-
name: "
|
|
762
|
-
msg: "
|
|
799
|
+
name: "GuardianSetMismatch",
|
|
800
|
+
msg: "Guardian set version in the VAA doesn't match the guardian set passed"
|
|
763
801
|
},
|
|
764
802
|
{
|
|
765
803
|
code: 6018,
|
|
766
|
-
name: "
|
|
767
|
-
msg: "
|
|
804
|
+
name: "InvalidGuardianOrder",
|
|
805
|
+
msg: "Guardian signature indices must be increasing"
|
|
768
806
|
},
|
|
769
807
|
{
|
|
770
808
|
code: 6019,
|
|
771
|
-
name: "
|
|
772
|
-
msg: "
|
|
809
|
+
name: "InvalidGuardianIndex",
|
|
810
|
+
msg: "Guardian index exceeds the number of guardians in the set"
|
|
773
811
|
},
|
|
774
812
|
{
|
|
775
813
|
code: 6020,
|
|
776
|
-
name: "
|
|
777
|
-
msg: "
|
|
814
|
+
name: "InvalidSignature",
|
|
815
|
+
msg: "A VAA signature is invalid"
|
|
778
816
|
},
|
|
779
817
|
{
|
|
780
818
|
code: 6021,
|
|
819
|
+
name: "InvalidGuardianKeyRecovery",
|
|
820
|
+
msg: "The recovered guardian public key doesn't match the guardian set"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
code: 6022,
|
|
824
|
+
name: "WrongGuardianSetOwner",
|
|
825
|
+
msg: "The guardian set account is owned by the wrong program"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
code: 6023,
|
|
829
|
+
name: "InvalidGuardianSetPda",
|
|
830
|
+
msg: "The Guardian Set account doesn't match the PDA derivation"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
code: 6024,
|
|
834
|
+
name: "GuardianSetExpired",
|
|
835
|
+
msg: "The Guardian Set is expired"
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
code: 6025,
|
|
839
|
+
name: "GovernanceAuthorityMismatch",
|
|
840
|
+
msg: "The signer is not authorized to perform this governance action"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
code: 6026,
|
|
844
|
+
name: "TargetGovernanceAuthorityMismatch",
|
|
845
|
+
msg: "The signer is not authorized to accept the governance authority"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
code: 6027,
|
|
781
849
|
name: "NonexistentGovernanceAuthorityTransferRequest",
|
|
782
|
-
msg: "The governance authority needs to request a transfer first"
|
|
850
|
+
msg: "The governance authority needs to request a transfer first"
|
|
783
851
|
},
|
|
784
|
-
|
|
852
|
+
{
|
|
853
|
+
code: 6028,
|
|
854
|
+
name: "ZeroMinimumSignatures",
|
|
855
|
+
msg: "The minimum number of signatures should be at least 1"
|
|
856
|
+
}
|
|
857
|
+
]
|
|
785
858
|
};
|