@velocity-exchange/sdk 0.4.0 → 0.6.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.
Files changed (323) hide show
  1. package/README.md +3 -3
  2. package/lib/browser/adminClient.d.ts +35 -0
  3. package/lib/browser/adminClient.js +65 -0
  4. package/lib/browser/config.js +6 -7
  5. package/lib/browser/constants/numericConstants.d.ts +1 -1
  6. package/lib/browser/constants/numericConstants.js +1 -1
  7. package/lib/browser/decode/user.js +5 -1
  8. package/lib/browser/idl/velocity.d.ts +146 -3
  9. package/lib/browser/idl/velocity.json +147 -4
  10. package/lib/browser/orderSubscriber/OrderSubscriber.js +3 -0
  11. package/lib/browser/pyth/pythLazerSubscriber.js +37 -27
  12. package/lib/browser/types.d.ts +4 -0
  13. package/lib/browser/user.d.ts +15 -0
  14. package/lib/browser/user.js +37 -1
  15. package/lib/browser/velocityClient.d.ts +46 -10
  16. package/lib/browser/velocityClient.js +107 -35
  17. package/lib/node/adminClient.d.ts +35 -0
  18. package/lib/node/adminClient.d.ts.map +1 -1
  19. package/lib/node/adminClient.js +65 -0
  20. package/lib/node/config.d.ts.map +1 -1
  21. package/lib/node/config.js +6 -7
  22. package/lib/node/constants/numericConstants.d.ts +1 -1
  23. package/lib/node/constants/numericConstants.d.ts.map +1 -1
  24. package/lib/node/constants/numericConstants.js +1 -1
  25. package/lib/node/decode/user.d.ts.map +1 -1
  26. package/lib/node/decode/user.js +5 -1
  27. package/lib/node/idl/velocity.d.ts +146 -3
  28. package/lib/node/idl/velocity.d.ts.map +1 -1
  29. package/lib/node/idl/velocity.json +147 -4
  30. package/lib/node/orderSubscriber/OrderSubscriber.d.ts.map +1 -1
  31. package/lib/node/orderSubscriber/OrderSubscriber.js +3 -0
  32. package/lib/node/pyth/pythLazerSubscriber.d.ts.map +1 -1
  33. package/lib/node/pyth/pythLazerSubscriber.js +37 -27
  34. package/lib/node/types.d.ts +4 -0
  35. package/lib/node/types.d.ts.map +1 -1
  36. package/lib/node/user.d.ts +15 -0
  37. package/lib/node/user.d.ts.map +1 -1
  38. package/lib/node/user.js +37 -1
  39. package/lib/node/velocityClient.d.ts +46 -10
  40. package/lib/node/velocityClient.d.ts.map +1 -1
  41. package/lib/node/velocityClient.js +107 -35
  42. package/package.json +7 -3
  43. package/.prettierignore +0 -1
  44. package/CHANGELOG.md +0 -132
  45. package/build-browser.js +0 -58
  46. package/bunfig.toml +0 -3
  47. package/esbuild-shims.js +0 -12
  48. package/scripts/deposit-isolated-positions.ts +0 -110
  49. package/scripts/find-flagged-users.ts +0 -213
  50. package/scripts/grpc-client-test-comparison.ts +0 -372
  51. package/scripts/grpc-multiuser-client-test-comparison.ts +0 -158
  52. package/scripts/postbuild.js +0 -95
  53. package/scripts/single-grpc-client-test.ts +0 -284
  54. package/scripts/withdraw-isolated-positions.ts +0 -174
  55. package/src/accounts/README_WebSocketAccountSubscriberV2.md +0 -95
  56. package/src/accounts/README_WebSocketProgramAccountSubscriberV2.md +0 -135
  57. package/src/accounts/basicUserAccountSubscriber.ts +0 -79
  58. package/src/accounts/basicUserStatsAccountSubscriber.ts +0 -87
  59. package/src/accounts/bulkAccountLoader.ts +0 -358
  60. package/src/accounts/bulkUserStatsSubscription.ts +0 -40
  61. package/src/accounts/bulkUserSubscription.ts +0 -39
  62. package/src/accounts/customizedCadenceBulkAccountLoader.ts +0 -250
  63. package/src/accounts/fetch.ts +0 -200
  64. package/src/accounts/grpcAccountSubscriber.ts +0 -225
  65. package/src/accounts/grpcInsuranceFundStakeAccountSubscriber.ts +0 -73
  66. package/src/accounts/grpcMultiAccountSubscriber.ts +0 -566
  67. package/src/accounts/grpcMultiUserAccountSubscriber.ts +0 -328
  68. package/src/accounts/grpcProgramAccountSubscriber.ts +0 -264
  69. package/src/accounts/grpcUserAccountSubscriber.ts +0 -63
  70. package/src/accounts/grpcUserStatsAccountSubscriber.ts +0 -65
  71. package/src/accounts/grpcVelocityClientAccountSubscriber.ts +0 -257
  72. package/src/accounts/grpcVelocityClientAccountSubscriberV2.ts +0 -941
  73. package/src/accounts/laserProgramAccountSubscriber.ts +0 -266
  74. package/src/accounts/oneShotUserAccountSubscriber.ts +0 -88
  75. package/src/accounts/oneShotUserStatsAccountSubscriber.ts +0 -94
  76. package/src/accounts/pollingInsuranceFundStakeAccountSubscriber.ts +0 -223
  77. package/src/accounts/pollingOracleAccountSubscriber.ts +0 -151
  78. package/src/accounts/pollingTokenAccountSubscriber.ts +0 -147
  79. package/src/accounts/pollingUserAccountSubscriber.ts +0 -198
  80. package/src/accounts/pollingUserStatsAccountSubscriber.ts +0 -180
  81. package/src/accounts/pollingVelocityClientAccountSubscriber.ts +0 -774
  82. package/src/accounts/testBulkAccountLoader.ts +0 -59
  83. package/src/accounts/types.ts +0 -428
  84. package/src/accounts/utils.ts +0 -90
  85. package/src/accounts/webSocketAccountSubscriber.ts +0 -304
  86. package/src/accounts/webSocketAccountSubscriberV2.ts +0 -536
  87. package/src/accounts/webSocketInsuranceFundStakeAccountSubscriber.ts +0 -171
  88. package/src/accounts/webSocketProgramAccountSubscriber.ts +0 -244
  89. package/src/accounts/webSocketProgramAccountSubscriberV2.ts +0 -1048
  90. package/src/accounts/webSocketProgramAccountsSubscriberV2.ts +0 -1042
  91. package/src/accounts/webSocketUserAccountSubscriber.ts +0 -139
  92. package/src/accounts/webSocketUserStatsAccountSubsriber.ts +0 -131
  93. package/src/accounts/webSocketVelocityClientAccountSubscriber.ts +0 -865
  94. package/src/accounts/webSocketVelocityClientAccountSubscriberV2.ts +0 -897
  95. package/src/accounts/websocketProgramUserAccountSubscriber.ts +0 -127
  96. package/src/addresses/marketAddresses.ts +0 -28
  97. package/src/addresses/pda.ts +0 -620
  98. package/src/adminClient.ts +0 -8136
  99. package/src/assert/assert.ts +0 -5
  100. package/src/auctionSubscriber/auctionSubscriber.ts +0 -86
  101. package/src/auctionSubscriber/auctionSubscriberGrpc.ts +0 -99
  102. package/src/auctionSubscriber/index.ts +0 -9
  103. package/src/auctionSubscriber/types.ts +0 -30
  104. package/src/bankrun/bankrunConnection.ts +0 -630
  105. package/src/blockhashSubscriber/BlockhashSubscriber.ts +0 -160
  106. package/src/blockhashSubscriber/index.ts +0 -6
  107. package/src/blockhashSubscriber/types.ts +0 -13
  108. package/src/clock/clockSubscriber.ts +0 -146
  109. package/src/config.ts +0 -312
  110. package/src/constants/index.ts +0 -9
  111. package/src/constants/numericConstants.ts +0 -194
  112. package/src/constants/perpMarkets.ts +0 -127
  113. package/src/constants/spotMarkets.ts +0 -104
  114. package/src/constants/txConstants.ts +0 -2
  115. package/src/constituentMap/constituentMap.ts +0 -305
  116. package/src/constituentMap/pollingConstituentAccountSubscriber.ts +0 -99
  117. package/src/constituentMap/webSocketConstituentAccountSubscriber.ts +0 -121
  118. package/src/core/VelocityCore.ts +0 -606
  119. package/src/core/index.ts +0 -12
  120. package/src/core/instructions/deposit.ts +0 -64
  121. package/src/core/instructions/fill.ts +0 -51
  122. package/src/core/instructions/funding.ts +0 -33
  123. package/src/core/instructions/liquidation.ts +0 -55
  124. package/src/core/instructions/orders.ts +0 -84
  125. package/src/core/instructions/perpOrders.ts +0 -312
  126. package/src/core/instructions/settlement.ts +0 -40
  127. package/src/core/instructions/trigger.ts +0 -41
  128. package/src/core/instructions/withdraw.ts +0 -65
  129. package/src/core/remainingAccounts.ts +0 -320
  130. package/src/core/signedMsg.ts +0 -109
  131. package/src/decode/customCoder.ts +0 -148
  132. package/src/decode/user.ts +0 -401
  133. package/src/dlob/DLOB.ts +0 -2793
  134. package/src/dlob/DLOBNode.ts +0 -305
  135. package/src/dlob/DLOBSubscriber.ts +0 -269
  136. package/src/dlob/NodeList.ts +0 -244
  137. package/src/dlob/orderBookLevels.ts +0 -695
  138. package/src/dlob/types.ts +0 -37
  139. package/src/events/eventList.ts +0 -114
  140. package/src/events/eventSubscriber.ts +0 -521
  141. package/src/events/eventsServerLogProvider.ts +0 -189
  142. package/src/events/fetchLogs.ts +0 -219
  143. package/src/events/parse.ts +0 -271
  144. package/src/events/pollingLogProvider.ts +0 -113
  145. package/src/events/sort.ts +0 -51
  146. package/src/events/txEventCache.ts +0 -92
  147. package/src/events/types.ts +0 -337
  148. package/src/events/webSocketLogProvider.ts +0 -152
  149. package/src/factory/bigNum.ts +0 -709
  150. package/src/factory/oracleClient.ts +0 -73
  151. package/src/idl/pyth.json +0 -142
  152. package/src/idl/pyth.ts +0 -97
  153. package/src/idl/pyth_solana_receiver.json +0 -628
  154. package/src/idl/token_faucet.json +0 -229
  155. package/src/idl/token_faucet.ts +0 -197
  156. package/src/idl/velocity.json +0 -23974
  157. package/src/idl/velocity.ts +0 -23980
  158. package/src/index.ts +0 -150
  159. package/src/indicative-quotes/indicativeQuotesSender.ts +0 -233
  160. package/src/isomorphic/README.md +0 -19
  161. package/src/isomorphic/anchor.browser.ts +0 -44
  162. package/src/isomorphic/anchor.node.ts +0 -1
  163. package/src/isomorphic/anchor.ts +0 -1
  164. package/src/isomorphic/anchor29.browser.ts +0 -24
  165. package/src/isomorphic/anchor29.node.ts +0 -1
  166. package/src/isomorphic/anchor29.ts +0 -1
  167. package/src/isomorphic/grpc.browser.ts +0 -4
  168. package/src/isomorphic/grpc.node.ts +0 -130
  169. package/src/isomorphic/grpc.ts +0 -1
  170. package/src/jupiter/jupiterClient.ts +0 -502
  171. package/src/keypair.ts +0 -32
  172. package/src/margin/README.md +0 -138
  173. package/src/marginCalculation.ts +0 -407
  174. package/src/marinade/idl/idl.json +0 -1962
  175. package/src/marinade/index.ts +0 -73
  176. package/src/marinade/types.ts +0 -3925
  177. package/src/math/amm.ts +0 -1758
  178. package/src/math/auction.ts +0 -480
  179. package/src/math/bankruptcy.ts +0 -138
  180. package/src/math/builder.ts +0 -130
  181. package/src/math/conversion.ts +0 -45
  182. package/src/math/exchangeStatus.ts +0 -261
  183. package/src/math/funding.ts +0 -498
  184. package/src/math/insurance.ts +0 -171
  185. package/src/math/liquidation.ts +0 -433
  186. package/src/math/margin.ts +0 -327
  187. package/src/math/market.ts +0 -487
  188. package/src/math/oracles.ts +0 -477
  189. package/src/math/orders.ts +0 -500
  190. package/src/math/position.ts +0 -381
  191. package/src/math/repeg.ts +0 -223
  192. package/src/math/spotBalance.ts +0 -996
  193. package/src/math/spotMarket.ts +0 -115
  194. package/src/math/spotPosition.ts +0 -263
  195. package/src/math/state.ts +0 -71
  196. package/src/math/superStake.ts +0 -602
  197. package/src/math/tiers.ts +0 -73
  198. package/src/math/trade.ts +0 -879
  199. package/src/math/utils.ts +0 -183
  200. package/src/memcmp.ts +0 -279
  201. package/src/oracles/oracleClientCache.ts +0 -41
  202. package/src/oracles/oracleId.ts +0 -99
  203. package/src/oracles/prelaunchOracleClient.ts +0 -63
  204. package/src/oracles/pythClient.ts +0 -125
  205. package/src/oracles/pythLazerClient.ts +0 -141
  206. package/src/oracles/quoteAssetOracleClient.ts +0 -43
  207. package/src/oracles/strictOraclePrice.ts +0 -40
  208. package/src/oracles/types.ts +0 -82
  209. package/src/oracles/utils.ts +0 -45
  210. package/src/orderParams.ts +0 -117
  211. package/src/orderSubscriber/OrderSubscriber.ts +0 -378
  212. package/src/orderSubscriber/PollingSubscription.ts +0 -50
  213. package/src/orderSubscriber/WebsocketSubscription.ts +0 -137
  214. package/src/orderSubscriber/grpcSubscription.ts +0 -155
  215. package/src/orderSubscriber/index.ts +0 -7
  216. package/src/orderSubscriber/types.ts +0 -64
  217. package/src/priorityFee/averageOverSlotsStrategy.ts +0 -17
  218. package/src/priorityFee/averageStrategy.ts +0 -13
  219. package/src/priorityFee/ewmaStrategy.ts +0 -51
  220. package/src/priorityFee/heliusPriorityFeeMethod.ts +0 -68
  221. package/src/priorityFee/index.ts +0 -16
  222. package/src/priorityFee/maxOverSlotsStrategy.ts +0 -18
  223. package/src/priorityFee/maxStrategy.ts +0 -8
  224. package/src/priorityFee/priorityFeeSubscriber.ts +0 -328
  225. package/src/priorityFee/priorityFeeSubscriberMap.ts +0 -134
  226. package/src/priorityFee/solanaPriorityFeeMethod.ts +0 -46
  227. package/src/priorityFee/types.ts +0 -82
  228. package/src/priorityFee/velocityPriorityFeeMethod.ts +0 -53
  229. package/src/pyth/constants.ts +0 -9
  230. package/src/pyth/index.ts +0 -15
  231. package/src/pyth/pythLazerSubscriber.ts +0 -365
  232. package/src/pyth/types.ts +0 -4451
  233. package/src/pyth/utils.ts +0 -13
  234. package/src/slot/SlotSubscriber.ts +0 -126
  235. package/src/slot/SlothashSubscriber.ts +0 -163
  236. package/src/swap/UnifiedSwapClient.ts +0 -315
  237. package/src/swift/grpcSignedMsgUserAccountSubscriber.ts +0 -81
  238. package/src/swift/index.ts +0 -10
  239. package/src/swift/signedMsgUserAccountSubscriber.ts +0 -251
  240. package/src/swift/swiftOrderSubscriber.ts +0 -351
  241. package/src/testClient.ts +0 -42
  242. package/src/titan/titanClient.ts +0 -438
  243. package/src/token/index.ts +0 -13
  244. package/src/tokenFaucet.ts +0 -296
  245. package/src/tx/baseTxSender.ts +0 -651
  246. package/src/tx/blockhashFetcher/baseBlockhashFetcher.ts +0 -31
  247. package/src/tx/blockhashFetcher/cachedBlockhashFetcher.ts +0 -105
  248. package/src/tx/blockhashFetcher/types.ts +0 -9
  249. package/src/tx/fastSingleTxSender.ts +0 -200
  250. package/src/tx/forwardOnlyTxSender.ts +0 -193
  251. package/src/tx/priorityFeeCalculator.ts +0 -117
  252. package/src/tx/reportTransactionError.ts +0 -176
  253. package/src/tx/retryTxSender.ts +0 -177
  254. package/src/tx/txHandler.ts +0 -1009
  255. package/src/tx/txParamProcessor.ts +0 -225
  256. package/src/tx/types.ts +0 -117
  257. package/src/tx/utils.ts +0 -133
  258. package/src/tx/whileValidTxSender.ts +0 -377
  259. package/src/types.ts +0 -2575
  260. package/src/user.ts +0 -5316
  261. package/src/userConfig.ts +0 -38
  262. package/src/userMap/PollingSubscription.ts +0 -61
  263. package/src/userMap/WebsocketSubscription.ts +0 -93
  264. package/src/userMap/grpcSubscription.ts +0 -93
  265. package/src/userMap/referrerMap.ts +0 -360
  266. package/src/userMap/revenueShareEscrowMap.ts +0 -342
  267. package/src/userMap/userMap.ts +0 -784
  268. package/src/userMap/userMapConfig.ts +0 -82
  269. package/src/userMap/userStatsMap.ts +0 -393
  270. package/src/userName.ts +0 -37
  271. package/src/userStats.ts +0 -159
  272. package/src/userStatsConfig.ts +0 -35
  273. package/src/util/TransactionConfirmationManager.ts +0 -333
  274. package/src/util/chainClock.ts +0 -65
  275. package/src/util/computeUnits.ts +0 -101
  276. package/src/util/digest.ts +0 -33
  277. package/src/util/ed25519Utils.ts +0 -95
  278. package/src/util/promiseTimeout.ts +0 -23
  279. package/src/velocityClient.ts +0 -14802
  280. package/src/velocityClientConfig.ts +0 -119
  281. package/src/wallet.ts +0 -91
  282. package/tests/VelocityCore/builder_escrow.test.ts +0 -121
  283. package/tests/VelocityCore/decode.test.ts +0 -16
  284. package/tests/VelocityCore/fill_trigger.test.ts +0 -73
  285. package/tests/VelocityCore/instructions.test.ts +0 -46
  286. package/tests/VelocityCore/pdas.test.ts +0 -30
  287. package/tests/VelocityCore/perp_orders.test.ts +0 -205
  288. package/tests/VelocityCore/remainingAccounts.test.ts +0 -72
  289. package/tests/VelocityCore/settlement_liquidation.test.ts +0 -69
  290. package/tests/accounts/customizedCadenceBulkAccountLoader.test.ts +0 -211
  291. package/tests/amm/test.ts +0 -2402
  292. package/tests/auctions/test.ts +0 -81
  293. package/tests/bn/test.ts +0 -355
  294. package/tests/builder/builderFee.test.ts +0 -42
  295. package/tests/ci/verifyConstants.ts +0 -393
  296. package/tests/decode/test.ts +0 -262
  297. package/tests/decode/userAccountBufferStrings.ts +0 -102
  298. package/tests/dlob/helpers.ts +0 -748
  299. package/tests/dlob/test.ts +0 -6969
  300. package/tests/dlob/tickSizeStandardization.ts +0 -545
  301. package/tests/events/parseLogsForCuUsage.ts +0 -139
  302. package/tests/exchangeStatus/test.ts +0 -45
  303. package/tests/insurance/test.ts +0 -40
  304. package/tests/liquidation/test.ts +0 -125
  305. package/tests/oracles/mmOracleGate.test.ts +0 -379
  306. package/tests/oracles/pythPegSnap.test.ts +0 -76
  307. package/tests/sdkParity/enumParity.test.ts +0 -84
  308. package/tests/sdkParity/marginCategoryFill.test.ts +0 -143
  309. package/tests/sdkParity/memcmpOffsets.test.ts +0 -139
  310. package/tests/spot/test.ts +0 -281
  311. package/tests/tx/TransactionConfirmationManager.test.ts +0 -312
  312. package/tests/tx/cachedBlockhashFetcher.test.ts +0 -96
  313. package/tests/tx/priorityFeeCalculator.ts +0 -77
  314. package/tests/tx/priorityFeeStrategy.ts +0 -95
  315. package/tests/user/bankruptcy.ts +0 -165
  316. package/tests/user/feeAndWithdrawLimits.ts +0 -284
  317. package/tests/user/getMarginCalculation.ts +0 -586
  318. package/tests/user/helpers.ts +0 -184
  319. package/tests/user/liquidations.ts +0 -129
  320. package/tests/user/marginCalculations.test.ts +0 -321
  321. package/tests/user/test.ts +0 -833
  322. package/tsconfig.browser.json +0 -18
  323. package/tsconfig.json +0 -36
package/src/pyth/types.ts DELETED
@@ -1,4451 +0,0 @@
1
- import type { IdlAccounts } from '../isomorphic/anchor29';
2
-
3
- export type WormholeCoreBridgeSolana = {
4
- version: '0.0.1-alpha.5';
5
- name: 'wormhole_core_bridge_solana';
6
- constants: [
7
- {
8
- name: 'SOLANA_CHAIN';
9
- type: 'u16';
10
- value: '1';
11
- },
12
- {
13
- name: 'FEE_COLLECTOR_SEED_PREFIX';
14
- type: 'bytes';
15
- value: '[102, 101, 101, 95, 99, 111, 108, 108, 101, 99, 116, 111, 114]';
16
- },
17
- {
18
- name: 'UPGRADE_SEED_PREFIX';
19
- type: 'bytes';
20
- value: '[117, 112, 103, 114, 97, 100, 101]';
21
- },
22
- {
23
- name: 'PROGRAM_EMITTER_SEED_PREFIX';
24
- type: 'bytes';
25
- value: '[101, 109, 105, 116, 116, 101, 114]';
26
- },
27
- {
28
- name: 'MAX_MESSAGE_PAYLOAD_SIZE';
29
- type: {
30
- defined: 'usize';
31
- };
32
- value: '30 * 1_024';
33
- },
34
- ];
35
- instructions: [
36
- {
37
- name: 'initMessageV1';
38
- docs: [
39
- 'Processor for initializing a new draft [PostedMessageV1](crate::state::PostedMessageV1)',
40
- 'account for writing. The emitter authority is established at this point and the payload size',
41
- 'is inferred from the size of the created account. This instruction handler also allows an',
42
- "integrator to publish Wormhole messages using his program's ID as the emitter address",
43
- '(by passing `Some(crate::ID)` to the [cpi_program_id](InitMessageV1Args::cpi_program_id)',
44
- 'argument). **Be aware that the emitter authority\'s seeds must only be \\[b"emitter"\\] in this',
45
- 'case.**',
46
- '',
47
- 'This instruction should be followed up with `write_message_v1` and `finalize_message_v1` to',
48
- 'write and indicate that the message is ready for publishing respectively (to prepare it for',
49
- 'publishing via the',
50
- '[post message instruction](crate::legacy::instruction::LegacyInstruction::PostMessage)).',
51
- '',
52
- 'NOTE: If you wish to publish a small message (one where the data does not overflow the',
53
- 'Solana transaction size), it is recommended that you use an [sdk](crate::sdk::cpi) method to',
54
- 'either prepare your message or post a message as a program ID emitter.',
55
- ];
56
- accounts: [
57
- {
58
- name: 'emitterAuthority';
59
- isMut: false;
60
- isSigner: true;
61
- docs: [
62
- 'This authority is the only one who can write to the draft message account.',
63
- ];
64
- },
65
- {
66
- name: 'draftMessage';
67
- isMut: true;
68
- isSigner: false;
69
- docs: ['Bridge.'];
70
- },
71
- ];
72
- args: [
73
- {
74
- name: 'args';
75
- type: {
76
- defined: 'InitMessageV1Args';
77
- };
78
- },
79
- ];
80
- },
81
- {
82
- name: 'writeMessageV1';
83
- docs: [
84
- 'Processor used to write to a draft [PostedMessageV1](crate::state::PostedMessageV1) account.',
85
- 'This instruction requires an authority (the emitter authority) to interact with the message',
86
- 'account.',
87
- ];
88
- accounts: [
89
- {
90
- name: 'emitterAuthority';
91
- isMut: false;
92
- isSigner: true;
93
- },
94
- {
95
- name: 'draftMessage';
96
- isMut: true;
97
- isSigner: false;
98
- docs: ['only be published when the message is finalized.'];
99
- },
100
- ];
101
- args: [
102
- {
103
- name: 'args';
104
- type: {
105
- defined: 'WriteMessageV1Args';
106
- };
107
- },
108
- ];
109
- },
110
- {
111
- name: 'finalizeMessageV1';
112
- docs: [
113
- 'Processor used to finalize a draft [PostedMessageV1](crate::state::PostedMessageV1) account.',
114
- 'Once finalized, this message account cannot be written to again. A finalized message is the',
115
- 'only state the legacy post message instruction can accept before publishing. This',
116
- 'instruction requires an authority (the emitter authority) to interact with the message',
117
- 'account.',
118
- ];
119
- accounts: [
120
- {
121
- name: 'emitterAuthority';
122
- isMut: false;
123
- isSigner: true;
124
- },
125
- {
126
- name: 'draftMessage';
127
- isMut: true;
128
- isSigner: false;
129
- docs: ['only be published when the message is finalized.'];
130
- },
131
- ];
132
- args: [];
133
- },
134
- {
135
- name: 'closeMessageV1';
136
- docs: [
137
- 'Processor used to process a draft [PostedMessageV1](crate::state::PostedMessageV1) account.',
138
- 'This instruction requires an authority (the emitter authority) to interact with the message',
139
- 'account.',
140
- ];
141
- accounts: [
142
- {
143
- name: 'emitterAuthority';
144
- isMut: false;
145
- isSigner: true;
146
- },
147
- {
148
- name: 'draftMessage';
149
- isMut: true;
150
- isSigner: false;
151
- docs: ['only be published when the message is finalized.'];
152
- },
153
- {
154
- name: 'closeAccountDestination';
155
- isMut: true;
156
- isSigner: false;
157
- },
158
- ];
159
- args: [];
160
- },
161
- {
162
- name: 'initEncodedVaa';
163
- docs: [
164
- 'Processor used to intialize a created account as [EncodedVaa](crate::state::EncodedVaa). An',
165
- 'authority (the write authority) is established with this instruction.',
166
- ];
167
- accounts: [
168
- {
169
- name: 'writeAuthority';
170
- isMut: false;
171
- isSigner: true;
172
- docs: [
173
- 'The authority who can write to the VAA account when it is being processed.',
174
- ];
175
- },
176
- {
177
- name: 'encodedVaa';
178
- isMut: true;
179
- isSigner: false;
180
- docs: ['Bridge.'];
181
- },
182
- ];
183
- args: [];
184
- },
185
- {
186
- name: 'closeEncodedVaa';
187
- docs: [
188
- 'Processor used to close an [EncodedVaa](crate::state::EncodedVaa). This instruction requires',
189
- 'an authority (the write authority) to interact witht he encoded VAA account.',
190
- ];
191
- accounts: [
192
- {
193
- name: 'writeAuthority';
194
- isMut: true;
195
- isSigner: true;
196
- docs: [
197
- 'This account is only required to be mutable for the `CloseVaaAccount` directive. This',
198
- 'authority is the same signer that originally created the VAA accounts, so he is the one that',
199
- 'will receive the lamports back for the closed accounts.',
200
- ];
201
- },
202
- {
203
- name: 'encodedVaa';
204
- isMut: true;
205
- isSigner: false;
206
- docs: ['written to and then verified.'];
207
- },
208
- ];
209
- args: [];
210
- },
211
- {
212
- name: 'writeEncodedVaa';
213
- docs: [
214
- 'Processor used to write to an [EncodedVaa](crate::state::EncodedVaa) account. This',
215
- 'instruction requires an authority (the write authority) to interact with the encoded VAA',
216
- 'account.',
217
- ];
218
- accounts: [
219
- {
220
- name: 'writeAuthority';
221
- isMut: false;
222
- isSigner: true;
223
- docs: [
224
- 'The only authority that can write to the encoded VAA account.',
225
- ];
226
- },
227
- {
228
- name: 'draftVaa';
229
- isMut: true;
230
- isSigner: false;
231
- docs: ['written to and then verified.'];
232
- },
233
- ];
234
- args: [
235
- {
236
- name: 'args';
237
- type: {
238
- defined: 'WriteEncodedVaaArgs';
239
- };
240
- },
241
- ];
242
- },
243
- {
244
- name: 'verifyEncodedVaaV1';
245
- docs: [
246
- 'Processor used to verify an [EncodedVaa](crate::state::EncodedVaa) account as a version 1',
247
- 'VAA (guardian signatures attesting to this observation). This instruction requires an',
248
- 'authority (the write authority) to interact with the encoded VAA account.',
249
- ];
250
- accounts: [
251
- {
252
- name: 'writeAuthority';
253
- isMut: false;
254
- isSigner: true;
255
- },
256
- {
257
- name: 'draftVaa';
258
- isMut: true;
259
- isSigner: false;
260
- docs: ['written to and then verified.'];
261
- },
262
- {
263
- name: 'guardianSet';
264
- isMut: false;
265
- isSigner: false;
266
- docs: [
267
- 'Guardian set account, which should be the same one that was used to attest for the VAA. The',
268
- 'signatures in the encoded VAA are verified against this guardian set.',
269
- ];
270
- },
271
- ];
272
- args: [];
273
- },
274
- {
275
- name: 'postVaaV1';
276
- docs: [
277
- 'Processor used to close an [EncodedVaa](crate::state::EncodedVaa) account to create a',
278
- '[PostedMessageV1](crate::state::PostedMessageV1) account in its place.',
279
- '',
280
- 'NOTE: Because the legacy verify signatures instruction was not required for the Posted VAA',
281
- 'account to exist, the encoded [SignatureSet](crate::state::SignatureSet) is the default',
282
- '[Pubkey].',
283
- ];
284
- accounts: [
285
- {
286
- name: 'payer';
287
- isMut: true;
288
- isSigner: true;
289
- docs: [
290
- 'Payer to create the posted VAA account. This instruction allows anyone with an encoded VAA',
291
- 'to create a posted VAA account.',
292
- ];
293
- },
294
- {
295
- name: 'encodedVaa';
296
- isMut: false;
297
- isSigner: false;
298
- docs: [
299
- 'Encoded VAA, whose body will be serialized into the posted VAA account.',
300
- '',
301
- 'NOTE: This instruction handler only exists to support integrators that still rely on posted',
302
- 'VAA accounts. While we encourage integrators to use the encoded VAA account instead, we',
303
- 'allow a pathway to convert the encoded VAA into a posted VAA. However, the payload is',
304
- 'restricted to 9.5KB, which is much larger than what was possible with the old implementation',
305
- 'using the legacy post vaa instruction. The Core Bridge program will not support posting VAAs',
306
- 'larger than this payload size.',
307
- ];
308
- },
309
- {
310
- name: 'postedVaa';
311
- isMut: true;
312
- isSigner: false;
313
- },
314
- {
315
- name: 'systemProgram';
316
- isMut: false;
317
- isSigner: false;
318
- },
319
- ];
320
- args: [];
321
- },
322
- {
323
- name: 'closeSignatureSet';
324
- docs: [
325
- 'Processor used to close a [SignatureSet](crate::state::SignatureSet), which was used to',
326
- 'verify the VAA using the legacy parse and verify procedure.',
327
- ];
328
- accounts: [
329
- {
330
- name: 'solDestination';
331
- isMut: true;
332
- isSigner: true;
333
- },
334
- {
335
- name: 'postedVaa';
336
- isMut: false;
337
- isSigner: false;
338
- docs: ['Posted VAA.'];
339
- },
340
- {
341
- name: 'signatureSet';
342
- isMut: true;
343
- isSigner: false;
344
- docs: [
345
- 'Signature set that may have been used to create the posted VAA account. If the `post_vaa_v1`',
346
- 'instruction were used to create the posted VAA account, then the encoded signature set',
347
- 'pubkey would be all zeroes.',
348
- ];
349
- },
350
- ];
351
- args: [];
352
- },
353
- ];
354
- accounts: [
355
- {
356
- name: 'guardianSet';
357
- docs: [
358
- 'Account used to store a guardian set. The keys encoded in this account are Ethereum pubkeys.',
359
- 'Its expiration time is determined at the time a guardian set is updated to a new set, where the',
360
- 'current network clock time is used with',
361
- '[guardian_set_ttl](crate::state::Config::guardian_set_ttl).',
362
- '',
363
- 'NOTE: The account schema is the same as legacy guardian sets, but this account now has a',
364
- "discriminator generated by Anchor's [account] macro. When the Core Bridge program performs a",
365
- 'guardian set update with this implementation, guardian sets will now have this Anchor-generated',
366
- 'discriminator.',
367
- ];
368
- type: {
369
- kind: 'struct';
370
- fields: [
371
- {
372
- name: 'index';
373
- docs: [
374
- 'Index representing an incrementing version number for this guardian set.',
375
- ];
376
- type: 'u32';
377
- },
378
- {
379
- name: 'keys';
380
- docs: ['Ethereum-style public keys.'];
381
- type: {
382
- vec: {
383
- array: ['u8', 20];
384
- };
385
- };
386
- },
387
- {
388
- name: 'creationTime';
389
- docs: [
390
- 'Timestamp representing the time this guardian became active.',
391
- ];
392
- type: {
393
- defined: 'Timestamp';
394
- };
395
- },
396
- {
397
- name: 'expirationTime';
398
- docs: [
399
- 'Expiration time when VAAs issued by this set are no longer valid.',
400
- ];
401
- type: {
402
- defined: 'Timestamp';
403
- };
404
- },
405
- ];
406
- };
407
- },
408
- {
409
- name: 'signatureSet';
410
- docs: [
411
- 'Account used to store information about a guardian set used to sign a VAA. There is only one',
412
- 'signature set for each verified VAA (associated with a',
413
- '[PostedVaaV1](crate::legacy::state::PostedVaaV1) account). This account is created using the',
414
- 'verify signatures legacy instruction.',
415
- '',
416
- 'NOTE: The account schema is the same as legacy signature sets, but this account now has a',
417
- "discriminator generated by Anchor's [account] macro. When the Core Bridge program upgrades to",
418
- 'this implementation from the old one, integrators in the middle of verifying signatures will',
419
- 'have to use a new keypair for this account and try again.',
420
- ];
421
- type: {
422
- kind: 'struct';
423
- fields: [
424
- {
425
- name: 'sigVerifySuccesses';
426
- docs: ['Signatures of validators'];
427
- type: {
428
- vec: 'bool';
429
- };
430
- },
431
- {
432
- name: 'messageHash';
433
- docs: ['Hash of the VAA message body.'];
434
- type: {
435
- defined: 'MessageHash';
436
- };
437
- },
438
- {
439
- name: 'guardianSetIndex';
440
- docs: ['Index of the guardian set'];
441
- type: 'u32';
442
- },
443
- ];
444
- };
445
- },
446
- {
447
- name: 'encodedVaa';
448
- docs: [
449
- 'Account used to warehouse VAA buffer.',
450
- '',
451
- "NOTE: This account should not be used by an external application unless the header's status is",
452
- '`Verified`. It is encouraged to use the `EncodedVaa` zero-copy account struct instead.',
453
- ];
454
- type: {
455
- kind: 'struct';
456
- fields: [
457
- {
458
- name: 'header';
459
- docs: ['Status, write authority and VAA version.'];
460
- type: {
461
- defined: 'Header';
462
- };
463
- },
464
- {
465
- name: 'buf';
466
- docs: ['VAA buffer.'];
467
- type: 'bytes';
468
- },
469
- ];
470
- };
471
- },
472
- ];
473
- types: [
474
- {
475
- name: 'InitializeArgs';
476
- docs: ['Arguments used to initialize the Core Bridge program.'];
477
- type: {
478
- kind: 'struct';
479
- fields: [
480
- {
481
- name: 'guardianSetTtlSeconds';
482
- type: 'u32';
483
- },
484
- {
485
- name: 'feeLamports';
486
- type: 'u64';
487
- },
488
- {
489
- name: 'initialGuardians';
490
- type: {
491
- vec: {
492
- array: ['u8', 20];
493
- };
494
- };
495
- },
496
- ];
497
- };
498
- },
499
- {
500
- name: 'PostMessageArgs';
501
- docs: [
502
- 'Arguments used to post a new Wormhole (Core Bridge) message either using',
503
- '[post_message](crate::legacy::instruction::post_message) or',
504
- '[post_message_unreliable](crate::legacy::instruction::post_message_unreliable).',
505
- ];
506
- type: {
507
- kind: 'struct';
508
- fields: [
509
- {
510
- name: 'nonce';
511
- docs: ['Unique id for this message.'];
512
- type: 'u32';
513
- },
514
- {
515
- name: 'payload';
516
- docs: ['Encoded message.'];
517
- type: 'bytes';
518
- },
519
- {
520
- name: 'commitment';
521
- docs: ['Solana commitment level for Guardian observation.'];
522
- type: {
523
- defined: 'Commitment';
524
- };
525
- },
526
- ];
527
- };
528
- },
529
- {
530
- name: 'PostVaaArgs';
531
- docs: [
532
- 'Arguments to post new VAA data after signature verification.',
533
- '',
534
- 'NOTE: It is preferred to use the new process of verifying a VAA using the new Core Bridge Anchor',
535
- 'instructions. See [init_encoded_vaa](crate::wormhole_core_bridge_solana::init_encoded_vaa) and',
536
- '[write_encoded_vaa](crate::wormhole_core_bridge_solana::write_encoded_vaa) for more info.',
537
- ];
538
- type: {
539
- kind: 'struct';
540
- fields: [
541
- {
542
- name: 'gap0';
543
- docs: ['Unused data.'];
544
- type: {
545
- array: ['u8', 5];
546
- };
547
- },
548
- {
549
- name: 'timestamp';
550
- docs: ['Time the message was submitted.'];
551
- type: 'u32';
552
- },
553
- {
554
- name: 'nonce';
555
- docs: ['Unique ID for this message.'];
556
- type: 'u32';
557
- },
558
- {
559
- name: 'emitterChain';
560
- docs: [
561
- 'The Wormhole chain ID denoting the origin of this message.',
562
- ];
563
- type: 'u16';
564
- },
565
- {
566
- name: 'emitterAddress';
567
- docs: ['Emitter of the message.'];
568
- type: {
569
- array: ['u8', 32];
570
- };
571
- },
572
- {
573
- name: 'sequence';
574
- docs: ['Sequence number of this message.'];
575
- type: 'u64';
576
- },
577
- {
578
- name: 'consistencyLevel';
579
- docs: ['Level of consistency requested by the emitter.'];
580
- type: 'u8';
581
- },
582
- {
583
- name: 'payload';
584
- docs: ['Message payload.'];
585
- type: 'bytes';
586
- },
587
- ];
588
- };
589
- },
590
- {
591
- name: 'VerifySignaturesArgs';
592
- docs: [
593
- 'Arguments to verify specific guardian indices.',
594
- '',
595
- 'NOTE: It is preferred to use the new process of verifying a VAA using the new Core Bridge Anchor',
596
- 'instructions. See [init_encoded_vaa](crate::wormhole_core_bridge_solana::init_encoded_vaa) and',
597
- '[write_encoded_vaa](crate::wormhole_core_bridge_solana::write_encoded_vaa) for more info.',
598
- ];
599
- type: {
600
- kind: 'struct';
601
- fields: [
602
- {
603
- name: 'signerIndices';
604
- docs: [
605
- 'Indices of verified guardian signatures, where -1 indicates a missing value. There is a',
606
- 'missing value if the guardian at this index is not expected to have its signature verfied by',
607
- 'the Sig Verify native program in the instruction invoked prior).',
608
- '',
609
- 'NOTE: In the legacy implementation, this argument being a fixed-sized array of 19 only',
610
- 'allows the first 19 guardians of any size guardian set to be verified. Because of this, it',
611
- 'is absolutely important to use the new process of verifying a VAA.',
612
- ];
613
- type: {
614
- array: ['i8', 19];
615
- };
616
- },
617
- ];
618
- };
619
- },
620
- {
621
- name: 'EmptyArgs';
622
- docs: ['Unit struct used to represent an empty instruction argument.'];
623
- type: {
624
- kind: 'struct';
625
- fields: [];
626
- };
627
- },
628
- {
629
- name: 'Config';
630
- docs: [
631
- 'Account used to store the current configuration of the bridge, including tracking Wormhole fee',
632
- 'payments. For governance decrees, the guardian set index is used to determine whether a decree',
633
- 'was attested for using the latest guardian set.',
634
- ];
635
- type: {
636
- kind: 'struct';
637
- fields: [
638
- {
639
- name: 'guardianSetIndex';
640
- docs: [
641
- 'The current guardian set index, used to decide which signature sets to accept.',
642
- ];
643
- type: 'u32';
644
- },
645
- {
646
- name: 'gap0';
647
- docs: [
648
- 'Gap. In the old implementation, this was an amount that kept track of message fees that',
649
- "were paid to the program's fee collector.",
650
- ];
651
- type: {
652
- array: ['u8', 8];
653
- };
654
- },
655
- {
656
- name: 'guardianSetTtl';
657
- docs: [
658
- 'Period for how long a guardian set is valid after it has been replaced by a new one. This',
659
- 'guarantees that VAAs issued by that set can still be submitted for a certain period. In',
660
- 'this period we still trust the old guardian set.',
661
- ];
662
- type: {
663
- defined: 'Duration';
664
- };
665
- },
666
- {
667
- name: 'feeLamports';
668
- docs: [
669
- 'Amount of lamports that needs to be paid to the protocol to post a message',
670
- ];
671
- type: 'u64';
672
- },
673
- ];
674
- };
675
- },
676
- {
677
- name: 'LegacyEmitterSequence';
678
- docs: [
679
- 'Account used to store the current sequence number for a given emitter.',
680
- ];
681
- type: {
682
- kind: 'struct';
683
- fields: [
684
- {
685
- name: 'value';
686
- docs: [
687
- 'Current sequence number, which will be used the next time this emitter publishes a message.',
688
- ];
689
- type: 'u64';
690
- },
691
- ];
692
- };
693
- },
694
- {
695
- name: 'EmitterSequence';
696
- type: {
697
- kind: 'struct';
698
- fields: [
699
- {
700
- name: 'legacy';
701
- type: {
702
- defined: 'LegacyEmitterSequence';
703
- };
704
- },
705
- {
706
- name: 'bump';
707
- type: 'u8';
708
- },
709
- {
710
- name: 'emitterType';
711
- type: {
712
- defined: 'EmitterType';
713
- };
714
- },
715
- ];
716
- };
717
- },
718
- {
719
- name: 'PostedMessageV1Unreliable';
720
- docs: ['Account used to store a published (reusable) Wormhole message.'];
721
- type: {
722
- kind: 'struct';
723
- fields: [
724
- {
725
- name: 'data';
726
- type: {
727
- defined: 'PostedMessageV1Data';
728
- };
729
- },
730
- ];
731
- };
732
- },
733
- {
734
- name: 'PostedMessageV1Info';
735
- docs: [
736
- 'Message metadata defining information about a published Wormhole message.',
737
- ];
738
- type: {
739
- kind: 'struct';
740
- fields: [
741
- {
742
- name: 'consistencyLevel';
743
- docs: ['Level of consistency requested by the emitter.'];
744
- type: 'u8';
745
- },
746
- {
747
- name: 'emitterAuthority';
748
- docs: [
749
- 'Authority used to write the message. This field is set to default when the message is',
750
- 'posted.',
751
- ];
752
- type: 'publicKey';
753
- },
754
- {
755
- name: 'status';
756
- docs: [
757
- 'If a message is being written to, this status is used to determine which state this',
758
- 'account is in (e.g. [MessageStatus::Writing] indicates that the emitter authority is still',
759
- 'writing its message to this account). When this message is posted, this value will be',
760
- 'set to [MessageStatus::Published].',
761
- ];
762
- type: {
763
- defined: 'MessageStatus';
764
- };
765
- },
766
- {
767
- name: 'gap0';
768
- docs: ['No data is stored here.'];
769
- type: {
770
- array: ['u8', 3];
771
- };
772
- },
773
- {
774
- name: 'postedTimestamp';
775
- docs: ['Time the posted message was created.'];
776
- type: {
777
- defined: 'Timestamp';
778
- };
779
- },
780
- {
781
- name: 'nonce';
782
- docs: ['Unique id for this message.'];
783
- type: 'u32';
784
- },
785
- {
786
- name: 'sequence';
787
- docs: ['Sequence number of this message.'];
788
- type: 'u64';
789
- },
790
- {
791
- name: 'solanaChainId';
792
- docs: [
793
- 'Always `1`.',
794
- '',
795
- 'NOTE: Saving this value is silly, but we are keeping it to be consistent with how the posted',
796
- 'message account is written.',
797
- ];
798
- type: {
799
- defined: 'ChainIdSolanaOnly';
800
- };
801
- },
802
- {
803
- name: 'emitter';
804
- docs: [
805
- 'Emitter of the message. This may either be the emitter authority or a program ID.',
806
- ];
807
- type: 'publicKey';
808
- },
809
- ];
810
- };
811
- },
812
- {
813
- name: 'PostedMessageV1Data';
814
- docs: [
815
- 'Underlying data for either [PostedMessageV1](crate::legacy::state::PostedMessageV1) or',
816
- '[PostedMessageV1Unreliable](crate::legacy::state::PostedMessageV1Unreliable).',
817
- ];
818
- type: {
819
- kind: 'struct';
820
- fields: [
821
- {
822
- name: 'info';
823
- docs: ['Message metadata.'];
824
- type: {
825
- defined: 'PostedMessageV1Info';
826
- };
827
- },
828
- {
829
- name: 'payload';
830
- docs: ['Encoded message.'];
831
- type: 'bytes';
832
- },
833
- ];
834
- };
835
- },
836
- {
837
- name: 'PostedMessageV1';
838
- docs: [
839
- 'Account used to store a published Wormhole message.',
840
- '',
841
- 'NOTE: If your integration requires reusable message accounts, please see',
842
- '[PostedMessageV1Unreliable](crate::legacy::state::PostedMessageV1Unreliable).',
843
- ];
844
- type: {
845
- kind: 'struct';
846
- fields: [
847
- {
848
- name: 'data';
849
- docs: ['Message data.'];
850
- type: {
851
- defined: 'PostedMessageV1Data';
852
- };
853
- },
854
- ];
855
- };
856
- },
857
- {
858
- name: 'PostedVaaV1Info';
859
- docs: [
860
- 'VAA metadata defining information about a Wormhole message attested for by an active guardian',
861
- 'set.',
862
- ];
863
- type: {
864
- kind: 'struct';
865
- fields: [
866
- {
867
- name: 'consistencyLevel';
868
- docs: ['Level of consistency requested by the emitter.'];
869
- type: 'u8';
870
- },
871
- {
872
- name: 'timestamp';
873
- docs: ['Time the message was submitted.'];
874
- type: {
875
- defined: 'Timestamp';
876
- };
877
- },
878
- {
879
- name: 'signatureSet';
880
- docs: [
881
- "Pubkey of [SignatureSet](crate::state::SignatureSet) account that represents this VAA's",
882
- 'signature verification.',
883
- ];
884
- type: 'publicKey';
885
- },
886
- {
887
- name: 'guardianSetIndex';
888
- docs: [
889
- 'Guardian set index used to verify signatures for [SignatureSet](crate::state::SignatureSet).',
890
- '',
891
- 'NOTE: In the previous implementation, this member was referred to as the "posted timestamp",',
892
- 'which is zero for VAA data (posted messages and VAAs resemble the same account schema). By',
893
- 'changing this to the guardian set index, we patch a bug with verifying governance VAAs for',
894
- 'the Core Bridge (other Core Bridge implementations require that the guardian set that',
895
- 'attested for the governance VAA is the current one).',
896
- ];
897
- type: 'u32';
898
- },
899
- {
900
- name: 'nonce';
901
- docs: ['Unique ID for this message.'];
902
- type: 'u32';
903
- },
904
- {
905
- name: 'sequence';
906
- docs: ['Sequence number of this message.'];
907
- type: 'u64';
908
- },
909
- {
910
- name: 'emitterChain';
911
- docs: [
912
- 'The Wormhole chain ID denoting the origin of this message.',
913
- ];
914
- type: 'u16';
915
- },
916
- {
917
- name: 'emitterAddress';
918
- docs: ['Emitter of the message.'];
919
- type: {
920
- array: ['u8', 32];
921
- };
922
- },
923
- ];
924
- };
925
- },
926
- {
927
- name: 'PostedVaaV1';
928
- docs: ['Account used to store a verified VAA.'];
929
- type: {
930
- kind: 'struct';
931
- fields: [
932
- {
933
- name: 'info';
934
- docs: ['VAA metadata.'];
935
- type: {
936
- defined: 'PostedVaaV1Info';
937
- };
938
- },
939
- {
940
- name: 'payload';
941
- docs: ['Message payload.'];
942
- type: 'bytes';
943
- },
944
- ];
945
- };
946
- },
947
- {
948
- name: 'WriteEncodedVaaArgs';
949
- docs: [
950
- 'Arguments for the [write_encoded_vaa](crate::wormhole_core_bridge_solana::write_encoded_vaa)',
951
- 'instruction.',
952
- ];
953
- type: {
954
- kind: 'struct';
955
- fields: [
956
- {
957
- name: 'index';
958
- docs: ['Index of VAA buffer.'];
959
- type: 'u32';
960
- },
961
- {
962
- name: 'data';
963
- docs: [
964
- 'Data representing subset of VAA buffer starting at specified index.',
965
- ];
966
- type: 'bytes';
967
- },
968
- ];
969
- };
970
- },
971
- {
972
- name: 'InitMessageV1Args';
973
- docs: [
974
- 'Arguments for the [init_message_v1](crate::wormhole_core_bridge_solana::init_message_v1)',
975
- 'instruction.',
976
- ];
977
- type: {
978
- kind: 'struct';
979
- fields: [
980
- {
981
- name: 'nonce';
982
- docs: ['Unique id for this message.'];
983
- type: 'u32';
984
- },
985
- {
986
- name: 'commitment';
987
- docs: ['Solana commitment level for Guardian observation.'];
988
- type: {
989
- defined: 'Commitment';
990
- };
991
- },
992
- {
993
- name: 'cpiProgramId';
994
- docs: [
995
- 'Optional program ID if the emitter address will be your program ID.',
996
- '',
997
- 'NOTE: If `Some(program_id)`, your emitter authority seeds to be \\[b"emitter\\].',
998
- ];
999
- type: {
1000
- option: 'publicKey';
1001
- };
1002
- },
1003
- ];
1004
- };
1005
- },
1006
- {
1007
- name: 'WriteMessageV1Args';
1008
- docs: [
1009
- 'Arguments for the [write_message_v1](crate::wormhole_core_bridge_solana::write_message_v1)',
1010
- 'instruction.',
1011
- ];
1012
- type: {
1013
- kind: 'struct';
1014
- fields: [
1015
- {
1016
- name: 'index';
1017
- docs: ['Index of message buffer.'];
1018
- type: 'u32';
1019
- },
1020
- {
1021
- name: 'data';
1022
- docs: [
1023
- 'Data representing subset of message buffer starting at specified index.',
1024
- ];
1025
- type: 'bytes';
1026
- },
1027
- ];
1028
- };
1029
- },
1030
- {
1031
- name: 'Header';
1032
- docs: ['`EncodedVaa` account header.'];
1033
- type: {
1034
- kind: 'struct';
1035
- fields: [
1036
- {
1037
- name: 'status';
1038
- docs: [
1039
- 'Processing status. **This encoded VAA is only considered usable when this status is set',
1040
- 'to [Verified](ProcessingStatus::Verified).**',
1041
- ];
1042
- type: {
1043
- defined: 'ProcessingStatus';
1044
- };
1045
- },
1046
- {
1047
- name: 'writeAuthority';
1048
- docs: ['The authority that has write privilege to this account.'];
1049
- type: 'publicKey';
1050
- },
1051
- {
1052
- name: 'version';
1053
- docs: [
1054
- 'VAA version. Only when the VAA is verified is this version set to a value.',
1055
- ];
1056
- type: 'u8';
1057
- },
1058
- ];
1059
- };
1060
- },
1061
- {
1062
- name: 'Timestamp';
1063
- docs: [
1064
- 'This struct defines unix timestamp as u32 (as opposed to more modern systems that have adopted',
1065
- "i64). Methods for this struct are meant to convert Solana's clock type to this type assuming we",
1066
- 'are far from year 2038.',
1067
- ];
1068
- type: {
1069
- kind: 'struct';
1070
- fields: [
1071
- {
1072
- name: 'value';
1073
- type: 'u32';
1074
- },
1075
- ];
1076
- };
1077
- },
1078
- {
1079
- name: 'Duration';
1080
- docs: [
1081
- 'To be used with the [Timestamp] type, this struct defines a duration in seconds.',
1082
- ];
1083
- type: {
1084
- kind: 'struct';
1085
- fields: [
1086
- {
1087
- name: 'seconds';
1088
- type: 'u32';
1089
- },
1090
- ];
1091
- };
1092
- },
1093
- {
1094
- name: 'MessageHash';
1095
- docs: ['This type is used to represent a message hash (keccak).'];
1096
- type: {
1097
- kind: 'struct';
1098
- fields: [
1099
- {
1100
- name: 'bytes';
1101
- type: {
1102
- array: ['u8', 32];
1103
- };
1104
- },
1105
- ];
1106
- };
1107
- },
1108
- {
1109
- name: 'ChainIdSolanaOnly';
1110
- docs: [
1111
- 'This type is kind of silly. But because [PostedMessageV1](crate::state::PostedMessageV1) has the',
1112
- "emitter chain ID as a field, which is unnecessary since it is always Solana's chain ID, we use",
1113
- 'this type to guarantee that the encoded chain ID is always `1`.',
1114
- ];
1115
- type: {
1116
- kind: 'struct';
1117
- fields: [
1118
- {
1119
- name: 'chainId';
1120
- type: 'u16';
1121
- },
1122
- ];
1123
- };
1124
- },
1125
- {
1126
- name: 'EmitterInfo';
1127
- type: {
1128
- kind: 'struct';
1129
- fields: [
1130
- {
1131
- name: 'chain';
1132
- type: 'u16';
1133
- },
1134
- {
1135
- name: 'address';
1136
- type: {
1137
- array: ['u8', 32];
1138
- };
1139
- },
1140
- {
1141
- name: 'sequence';
1142
- type: 'u64';
1143
- },
1144
- ];
1145
- };
1146
- },
1147
- {
1148
- name: 'LegacyInstruction';
1149
- docs: [
1150
- 'Legacy instruction selector.',
1151
- '',
1152
- 'NOTE: No more instructions should be added to this enum. Instead, add them as Anchor instruction',
1153
- 'handlers, which will inevitably live in',
1154
- '[wormhole_core_bridge_solana](crate::wormhole_core_bridge_solana).',
1155
- ];
1156
- type: {
1157
- kind: 'enum';
1158
- variants: [
1159
- {
1160
- name: 'Initialize';
1161
- },
1162
- {
1163
- name: 'PostMessage';
1164
- },
1165
- {
1166
- name: 'PostVaa';
1167
- },
1168
- {
1169
- name: 'SetMessageFee';
1170
- },
1171
- {
1172
- name: 'TransferFees';
1173
- },
1174
- {
1175
- name: 'UpgradeContract';
1176
- },
1177
- {
1178
- name: 'GuardianSetUpdate';
1179
- },
1180
- {
1181
- name: 'VerifySignatures';
1182
- },
1183
- {
1184
- name: 'PostMessageUnreliable';
1185
- },
1186
- ];
1187
- };
1188
- },
1189
- {
1190
- name: 'EmitterType';
1191
- type: {
1192
- kind: 'enum';
1193
- variants: [
1194
- {
1195
- name: 'Unset';
1196
- },
1197
- {
1198
- name: 'Legacy';
1199
- },
1200
- {
1201
- name: 'Executable';
1202
- },
1203
- ];
1204
- };
1205
- },
1206
- {
1207
- name: 'MessageStatus';
1208
- docs: [
1209
- 'Status of a message. When a message is posted, its status is',
1210
- '[Published](MessageStatus::Published).',
1211
- ];
1212
- type: {
1213
- kind: 'enum';
1214
- variants: [
1215
- {
1216
- name: 'Published';
1217
- },
1218
- {
1219
- name: 'Writing';
1220
- },
1221
- {
1222
- name: 'ReadyForPublishing';
1223
- },
1224
- ];
1225
- };
1226
- },
1227
- {
1228
- name: 'PublishMessageDirective';
1229
- docs: ['Directive used to determine how to post a Core Bridge message.'];
1230
- type: {
1231
- kind: 'enum';
1232
- variants: [
1233
- {
1234
- name: 'Message';
1235
- fields: [
1236
- {
1237
- name: 'nonce';
1238
- type: 'u32';
1239
- },
1240
- {
1241
- name: 'payload';
1242
- type: 'bytes';
1243
- },
1244
- {
1245
- name: 'commitment';
1246
- type: {
1247
- defined: 'Commitment';
1248
- };
1249
- },
1250
- ];
1251
- },
1252
- {
1253
- name: 'ProgramMessage';
1254
- fields: [
1255
- {
1256
- name: 'programId';
1257
- type: 'publicKey';
1258
- },
1259
- {
1260
- name: 'nonce';
1261
- type: 'u32';
1262
- },
1263
- {
1264
- name: 'payload';
1265
- type: 'bytes';
1266
- },
1267
- {
1268
- name: 'commitment';
1269
- type: {
1270
- defined: 'Commitment';
1271
- };
1272
- },
1273
- ];
1274
- },
1275
- {
1276
- name: 'PreparedMessage';
1277
- },
1278
- ];
1279
- };
1280
- },
1281
- {
1282
- name: 'ProcessingStatus';
1283
- docs: ["Encoded VAA's processing status."];
1284
- type: {
1285
- kind: 'enum';
1286
- variants: [
1287
- {
1288
- name: 'Unset';
1289
- },
1290
- {
1291
- name: 'Writing';
1292
- },
1293
- {
1294
- name: 'Verified';
1295
- },
1296
- ];
1297
- };
1298
- },
1299
- {
1300
- name: 'Commitment';
1301
- docs: [
1302
- "Representation of Solana's commitment levels. This enum is not exhaustive because Wormhole only",
1303
- 'considers these two commitment levels in its Guardian observation.',
1304
- '',
1305
- 'See <https://docs.solana.com/cluster/commitments> for more info.',
1306
- ];
1307
- type: {
1308
- kind: 'enum';
1309
- variants: [
1310
- {
1311
- name: 'Confirmed';
1312
- },
1313
- {
1314
- name: 'Finalized';
1315
- },
1316
- ];
1317
- };
1318
- },
1319
- ];
1320
- errors: [
1321
- {
1322
- code: 6002;
1323
- name: 'InvalidInstructionArgument';
1324
- msg: 'InvalidInstructionArgument';
1325
- },
1326
- {
1327
- code: 6003;
1328
- name: 'AccountNotZeroed';
1329
- msg: 'AccountNotZeroed';
1330
- },
1331
- {
1332
- code: 6004;
1333
- name: 'InvalidDataConversion';
1334
- msg: 'InvalidDataConversion';
1335
- },
1336
- {
1337
- code: 6006;
1338
- name: 'U64Overflow';
1339
- msg: 'U64Overflow';
1340
- },
1341
- {
1342
- code: 6008;
1343
- name: 'InvalidComputeSize';
1344
- msg: 'InvalidComputeSize';
1345
- },
1346
- {
1347
- code: 6016;
1348
- name: 'InvalidChain';
1349
- msg: 'InvalidChain';
1350
- },
1351
- {
1352
- code: 6032;
1353
- name: 'InvalidGovernanceEmitter';
1354
- msg: 'InvalidGovernanceEmitter';
1355
- },
1356
- {
1357
- code: 6034;
1358
- name: 'InvalidGovernanceAction';
1359
- msg: 'InvalidGovernanceAction';
1360
- },
1361
- {
1362
- code: 6036;
1363
- name: 'LatestGuardianSetRequired';
1364
- msg: 'LatestGuardianSetRequired';
1365
- },
1366
- {
1367
- code: 6038;
1368
- name: 'GovernanceForAnotherChain';
1369
- msg: 'GovernanceForAnotherChain';
1370
- },
1371
- {
1372
- code: 6040;
1373
- name: 'InvalidGovernanceVaa';
1374
- msg: 'InvalidGovernanceVaa';
1375
- },
1376
- {
1377
- code: 6256;
1378
- name: 'InsufficientFees';
1379
- msg: 'InsufficientFees';
1380
- },
1381
- {
1382
- code: 6258;
1383
- name: 'EmitterMismatch';
1384
- msg: 'EmitterMismatch';
1385
- },
1386
- {
1387
- code: 6260;
1388
- name: 'NotReadyForPublishing';
1389
- msg: 'NotReadyForPublishing';
1390
- },
1391
- {
1392
- code: 6262;
1393
- name: 'InvalidPreparedMessage';
1394
- msg: 'InvalidPreparedMessage';
1395
- },
1396
- {
1397
- code: 6264;
1398
- name: 'ExecutableEmitter';
1399
- msg: 'ExecutableEmitter';
1400
- },
1401
- {
1402
- code: 6266;
1403
- name: 'LegacyEmitter';
1404
- msg: 'LegacyEmitter';
1405
- },
1406
- {
1407
- code: 6512;
1408
- name: 'InvalidSignatureSet';
1409
- msg: 'InvalidSignatureSet';
1410
- },
1411
- {
1412
- code: 6514;
1413
- name: 'InvalidMessageHash';
1414
- msg: 'InvalidMessageHash';
1415
- },
1416
- {
1417
- code: 6515;
1418
- name: 'NoQuorum';
1419
- msg: 'NoQuorum';
1420
- },
1421
- {
1422
- code: 6516;
1423
- name: 'MessageMismatch';
1424
- msg: 'MessageMismatch';
1425
- },
1426
- {
1427
- code: 7024;
1428
- name: 'NotEnoughLamports';
1429
- msg: 'NotEnoughLamports';
1430
- },
1431
- {
1432
- code: 7026;
1433
- name: 'InvalidFeeRecipient';
1434
- msg: 'InvalidFeeRecipient';
1435
- },
1436
- {
1437
- code: 7280;
1438
- name: 'ImplementationMismatch';
1439
- msg: 'ImplementationMismatch';
1440
- },
1441
- {
1442
- code: 7536;
1443
- name: 'InvalidGuardianSetIndex';
1444
- msg: 'InvalidGuardianSetIndex';
1445
- },
1446
- {
1447
- code: 7792;
1448
- name: 'GuardianSetMismatch';
1449
- msg: 'GuardianSetMismatch';
1450
- },
1451
- {
1452
- code: 7794;
1453
- name: 'InstructionAtWrongIndex';
1454
- msg: 'InstructionAtWrongIndex';
1455
- },
1456
- {
1457
- code: 7795;
1458
- name: 'EmptySigVerifyInstruction';
1459
- msg: 'EmptySigVerifyInstruction';
1460
- },
1461
- {
1462
- code: 7796;
1463
- name: 'InvalidSigVerifyInstruction';
1464
- msg: 'InvalidSigVerifyInstruction';
1465
- },
1466
- {
1467
- code: 7798;
1468
- name: 'GuardianSetExpired';
1469
- msg: 'GuardianSetExpired';
1470
- },
1471
- {
1472
- code: 7800;
1473
- name: 'InvalidGuardianKeyRecovery';
1474
- msg: 'InvalidGuardianKeyRecovery';
1475
- },
1476
- {
1477
- code: 7802;
1478
- name: 'SignerIndicesMismatch';
1479
- msg: 'SignerIndicesMismatch';
1480
- },
1481
- {
1482
- code: 8048;
1483
- name: 'PayloadSizeMismatch';
1484
- msg: 'PayloadSizeMismatch';
1485
- },
1486
- {
1487
- code: 10112;
1488
- name: 'ZeroGuardians';
1489
- msg: 'ZeroGuardians';
1490
- },
1491
- {
1492
- code: 10128;
1493
- name: 'GuardianZeroAddress';
1494
- msg: 'GuardianZeroAddress';
1495
- },
1496
- {
1497
- code: 10144;
1498
- name: 'DuplicateGuardianAddress';
1499
- msg: 'DuplicateGuardianAddress';
1500
- },
1501
- {
1502
- code: 10160;
1503
- name: 'MessageAlreadyPublished';
1504
- msg: 'MessageAlreadyPublished';
1505
- },
1506
- {
1507
- code: 10176;
1508
- name: 'VaaWritingDisallowed';
1509
- msg: 'VaaWritingDisallowed';
1510
- },
1511
- {
1512
- code: 10192;
1513
- name: 'VaaAlreadyVerified';
1514
- msg: 'VaaAlreadyVerified';
1515
- },
1516
- {
1517
- code: 10208;
1518
- name: 'InvalidGuardianIndex';
1519
- msg: 'InvalidGuardianIndex';
1520
- },
1521
- {
1522
- code: 10224;
1523
- name: 'InvalidSignature';
1524
- msg: 'InvalidSignature';
1525
- },
1526
- {
1527
- code: 10256;
1528
- name: 'UnverifiedVaa';
1529
- msg: 'UnverifiedVaa';
1530
- },
1531
- {
1532
- code: 10258;
1533
- name: 'VaaStillProcessing';
1534
- msg: 'VaaStillProcessing';
1535
- },
1536
- {
1537
- code: 10260;
1538
- name: 'InWritingStatus';
1539
- msg: 'InWritingStatus';
1540
- },
1541
- {
1542
- code: 10262;
1543
- name: 'NotInWritingStatus';
1544
- msg: 'NotInWritingStatus';
1545
- },
1546
- {
1547
- code: 10264;
1548
- name: 'InvalidMessageStatus';
1549
- msg: 'InvalidMessageStatus';
1550
- },
1551
- {
1552
- code: 10266;
1553
- name: 'HashNotComputed';
1554
- msg: 'HashNotComputed';
1555
- },
1556
- {
1557
- code: 10268;
1558
- name: 'InvalidVaaVersion';
1559
- msg: 'InvalidVaaVersion';
1560
- },
1561
- {
1562
- code: 10270;
1563
- name: 'InvalidCreatedAccountSize';
1564
- msg: 'InvalidCreatedAccountSize';
1565
- },
1566
- {
1567
- code: 10272;
1568
- name: 'DataOverflow';
1569
- msg: 'DataOverflow';
1570
- },
1571
- {
1572
- code: 10274;
1573
- name: 'ExceedsMaxPayloadSize';
1574
- msg: 'ExceedsMaxPayloadSize (30KB)';
1575
- },
1576
- {
1577
- code: 10276;
1578
- name: 'CannotParseVaa';
1579
- msg: 'CannotParseVaa';
1580
- },
1581
- {
1582
- code: 10278;
1583
- name: 'EmitterAuthorityMismatch';
1584
- msg: 'EmitterAuthorityMismatch';
1585
- },
1586
- {
1587
- code: 10280;
1588
- name: 'InvalidProgramEmitter';
1589
- msg: 'InvalidProgramEmitter';
1590
- },
1591
- {
1592
- code: 10282;
1593
- name: 'WriteAuthorityMismatch';
1594
- msg: 'WriteAuthorityMismatch';
1595
- },
1596
- {
1597
- code: 10284;
1598
- name: 'PostedVaaPayloadTooLarge';
1599
- msg: 'PostedVaaPayloadTooLarge';
1600
- },
1601
- {
1602
- code: 10286;
1603
- name: 'ExecutableDisallowed';
1604
- msg: 'ExecutableDisallowed';
1605
- },
1606
- ];
1607
- };
1608
-
1609
- export const WORMHOLE_CORE_BRIDGE_SOLANA_IDL: WormholeCoreBridgeSolana = {
1610
- version: '0.0.1-alpha.5',
1611
- name: 'wormhole_core_bridge_solana',
1612
- constants: [
1613
- {
1614
- name: 'SOLANA_CHAIN',
1615
- type: 'u16',
1616
- value: '1',
1617
- },
1618
- {
1619
- name: 'FEE_COLLECTOR_SEED_PREFIX',
1620
- type: 'bytes',
1621
- value: '[102, 101, 101, 95, 99, 111, 108, 108, 101, 99, 116, 111, 114]',
1622
- },
1623
- {
1624
- name: 'UPGRADE_SEED_PREFIX',
1625
- type: 'bytes',
1626
- value: '[117, 112, 103, 114, 97, 100, 101]',
1627
- },
1628
- {
1629
- name: 'PROGRAM_EMITTER_SEED_PREFIX',
1630
- type: 'bytes',
1631
- value: '[101, 109, 105, 116, 116, 101, 114]',
1632
- },
1633
- {
1634
- name: 'MAX_MESSAGE_PAYLOAD_SIZE',
1635
- type: {
1636
- defined: 'usize',
1637
- },
1638
- value: '30 * 1_024',
1639
- },
1640
- ],
1641
- instructions: [
1642
- {
1643
- name: 'initMessageV1',
1644
- docs: [
1645
- 'Processor for initializing a new draft [PostedMessageV1](crate::state::PostedMessageV1)',
1646
- 'account for writing. The emitter authority is established at this point and the payload size',
1647
- 'is inferred from the size of the created account. This instruction handler also allows an',
1648
- "integrator to publish Wormhole messages using his program's ID as the emitter address",
1649
- '(by passing `Some(crate::ID)` to the [cpi_program_id](InitMessageV1Args::cpi_program_id)',
1650
- 'argument). **Be aware that the emitter authority\'s seeds must only be \\[b"emitter"\\] in this',
1651
- 'case.**',
1652
- '',
1653
- 'This instruction should be followed up with `write_message_v1` and `finalize_message_v1` to',
1654
- 'write and indicate that the message is ready for publishing respectively (to prepare it for',
1655
- 'publishing via the',
1656
- '[post message instruction](crate::legacy::instruction::LegacyInstruction::PostMessage)).',
1657
- '',
1658
- 'NOTE: If you wish to publish a small message (one where the data does not overflow the',
1659
- 'Solana transaction size), it is recommended that you use an [sdk](crate::sdk::cpi) method to',
1660
- 'either prepare your message or post a message as a program ID emitter.',
1661
- ],
1662
- accounts: [
1663
- {
1664
- name: 'emitterAuthority',
1665
- isMut: false,
1666
- isSigner: true,
1667
- docs: [
1668
- 'This authority is the only one who can write to the draft message account.',
1669
- ],
1670
- },
1671
- {
1672
- name: 'draftMessage',
1673
- isMut: true,
1674
- isSigner: false,
1675
- docs: ['Bridge.'],
1676
- },
1677
- ],
1678
- args: [
1679
- {
1680
- name: 'args',
1681
- type: {
1682
- defined: 'InitMessageV1Args',
1683
- },
1684
- },
1685
- ],
1686
- },
1687
- {
1688
- name: 'writeMessageV1',
1689
- docs: [
1690
- 'Processor used to write to a draft [PostedMessageV1](crate::state::PostedMessageV1) account.',
1691
- 'This instruction requires an authority (the emitter authority) to interact with the message',
1692
- 'account.',
1693
- ],
1694
- accounts: [
1695
- {
1696
- name: 'emitterAuthority',
1697
- isMut: false,
1698
- isSigner: true,
1699
- },
1700
- {
1701
- name: 'draftMessage',
1702
- isMut: true,
1703
- isSigner: false,
1704
- docs: ['only be published when the message is finalized.'],
1705
- },
1706
- ],
1707
- args: [
1708
- {
1709
- name: 'args',
1710
- type: {
1711
- defined: 'WriteMessageV1Args',
1712
- },
1713
- },
1714
- ],
1715
- },
1716
- {
1717
- name: 'finalizeMessageV1',
1718
- docs: [
1719
- 'Processor used to finalize a draft [PostedMessageV1](crate::state::PostedMessageV1) account.',
1720
- 'Once finalized, this message account cannot be written to again. A finalized message is the',
1721
- 'only state the legacy post message instruction can accept before publishing. This',
1722
- 'instruction requires an authority (the emitter authority) to interact with the message',
1723
- 'account.',
1724
- ],
1725
- accounts: [
1726
- {
1727
- name: 'emitterAuthority',
1728
- isMut: false,
1729
- isSigner: true,
1730
- },
1731
- {
1732
- name: 'draftMessage',
1733
- isMut: true,
1734
- isSigner: false,
1735
- docs: ['only be published when the message is finalized.'],
1736
- },
1737
- ],
1738
- args: [],
1739
- },
1740
- {
1741
- name: 'closeMessageV1',
1742
- docs: [
1743
- 'Processor used to process a draft [PostedMessageV1](crate::state::PostedMessageV1) account.',
1744
- 'This instruction requires an authority (the emitter authority) to interact with the message',
1745
- 'account.',
1746
- ],
1747
- accounts: [
1748
- {
1749
- name: 'emitterAuthority',
1750
- isMut: false,
1751
- isSigner: true,
1752
- },
1753
- {
1754
- name: 'draftMessage',
1755
- isMut: true,
1756
- isSigner: false,
1757
- docs: ['only be published when the message is finalized.'],
1758
- },
1759
- {
1760
- name: 'closeAccountDestination',
1761
- isMut: true,
1762
- isSigner: false,
1763
- },
1764
- ],
1765
- args: [],
1766
- },
1767
- {
1768
- name: 'initEncodedVaa',
1769
- docs: [
1770
- 'Processor used to intialize a created account as [EncodedVaa](crate::state::EncodedVaa). An',
1771
- 'authority (the write authority) is established with this instruction.',
1772
- ],
1773
- accounts: [
1774
- {
1775
- name: 'writeAuthority',
1776
- isMut: false,
1777
- isSigner: true,
1778
- docs: [
1779
- 'The authority who can write to the VAA account when it is being processed.',
1780
- ],
1781
- },
1782
- {
1783
- name: 'encodedVaa',
1784
- isMut: true,
1785
- isSigner: false,
1786
- docs: ['Bridge.'],
1787
- },
1788
- ],
1789
- args: [],
1790
- },
1791
- {
1792
- name: 'closeEncodedVaa',
1793
- docs: [
1794
- 'Processor used to close an [EncodedVaa](crate::state::EncodedVaa). This instruction requires',
1795
- 'an authority (the write authority) to interact witht he encoded VAA account.',
1796
- ],
1797
- accounts: [
1798
- {
1799
- name: 'writeAuthority',
1800
- isMut: true,
1801
- isSigner: true,
1802
- docs: [
1803
- 'This account is only required to be mutable for the `CloseVaaAccount` directive. This',
1804
- 'authority is the same signer that originally created the VAA accounts, so he is the one that',
1805
- 'will receive the lamports back for the closed accounts.',
1806
- ],
1807
- },
1808
- {
1809
- name: 'encodedVaa',
1810
- isMut: true,
1811
- isSigner: false,
1812
- docs: ['written to and then verified.'],
1813
- },
1814
- ],
1815
- args: [],
1816
- },
1817
- {
1818
- name: 'writeEncodedVaa',
1819
- docs: [
1820
- 'Processor used to write to an [EncodedVaa](crate::state::EncodedVaa) account. This',
1821
- 'instruction requires an authority (the write authority) to interact with the encoded VAA',
1822
- 'account.',
1823
- ],
1824
- accounts: [
1825
- {
1826
- name: 'writeAuthority',
1827
- isMut: false,
1828
- isSigner: true,
1829
- docs: [
1830
- 'The only authority that can write to the encoded VAA account.',
1831
- ],
1832
- },
1833
- {
1834
- name: 'draftVaa',
1835
- isMut: true,
1836
- isSigner: false,
1837
- docs: ['written to and then verified.'],
1838
- },
1839
- ],
1840
- args: [
1841
- {
1842
- name: 'args',
1843
- type: {
1844
- defined: 'WriteEncodedVaaArgs',
1845
- },
1846
- },
1847
- ],
1848
- },
1849
- {
1850
- name: 'verifyEncodedVaaV1',
1851
- docs: [
1852
- 'Processor used to verify an [EncodedVaa](crate::state::EncodedVaa) account as a version 1',
1853
- 'VAA (guardian signatures attesting to this observation). This instruction requires an',
1854
- 'authority (the write authority) to interact with the encoded VAA account.',
1855
- ],
1856
- accounts: [
1857
- {
1858
- name: 'writeAuthority',
1859
- isMut: false,
1860
- isSigner: true,
1861
- },
1862
- {
1863
- name: 'draftVaa',
1864
- isMut: true,
1865
- isSigner: false,
1866
- docs: ['written to and then verified.'],
1867
- },
1868
- {
1869
- name: 'guardianSet',
1870
- isMut: false,
1871
- isSigner: false,
1872
- docs: [
1873
- 'Guardian set account, which should be the same one that was used to attest for the VAA. The',
1874
- 'signatures in the encoded VAA are verified against this guardian set.',
1875
- ],
1876
- },
1877
- ],
1878
- args: [],
1879
- },
1880
- {
1881
- name: 'postVaaV1',
1882
- docs: [
1883
- 'Processor used to close an [EncodedVaa](crate::state::EncodedVaa) account to create a',
1884
- '[PostedMessageV1](crate::state::PostedMessageV1) account in its place.',
1885
- '',
1886
- 'NOTE: Because the legacy verify signatures instruction was not required for the Posted VAA',
1887
- 'account to exist, the encoded [SignatureSet](crate::state::SignatureSet) is the default',
1888
- '[Pubkey].',
1889
- ],
1890
- accounts: [
1891
- {
1892
- name: 'payer',
1893
- isMut: true,
1894
- isSigner: true,
1895
- docs: [
1896
- 'Payer to create the posted VAA account. This instruction allows anyone with an encoded VAA',
1897
- 'to create a posted VAA account.',
1898
- ],
1899
- },
1900
- {
1901
- name: 'encodedVaa',
1902
- isMut: false,
1903
- isSigner: false,
1904
- docs: [
1905
- 'Encoded VAA, whose body will be serialized into the posted VAA account.',
1906
- '',
1907
- 'NOTE: This instruction handler only exists to support integrators that still rely on posted',
1908
- 'VAA accounts. While we encourage integrators to use the encoded VAA account instead, we',
1909
- 'allow a pathway to convert the encoded VAA into a posted VAA. However, the payload is',
1910
- 'restricted to 9.5KB, which is much larger than what was possible with the old implementation',
1911
- 'using the legacy post vaa instruction. The Core Bridge program will not support posting VAAs',
1912
- 'larger than this payload size.',
1913
- ],
1914
- },
1915
- {
1916
- name: 'postedVaa',
1917
- isMut: true,
1918
- isSigner: false,
1919
- },
1920
- {
1921
- name: 'systemProgram',
1922
- isMut: false,
1923
- isSigner: false,
1924
- },
1925
- ],
1926
- args: [],
1927
- },
1928
- {
1929
- name: 'closeSignatureSet',
1930
- docs: [
1931
- 'Processor used to close a [SignatureSet](crate::state::SignatureSet), which was used to',
1932
- 'verify the VAA using the legacy parse and verify procedure.',
1933
- ],
1934
- accounts: [
1935
- {
1936
- name: 'solDestination',
1937
- isMut: true,
1938
- isSigner: true,
1939
- },
1940
- {
1941
- name: 'postedVaa',
1942
- isMut: false,
1943
- isSigner: false,
1944
- docs: ['Posted VAA.'],
1945
- },
1946
- {
1947
- name: 'signatureSet',
1948
- isMut: true,
1949
- isSigner: false,
1950
- docs: [
1951
- 'Signature set that may have been used to create the posted VAA account. If the `post_vaa_v1`',
1952
- 'instruction were used to create the posted VAA account, then the encoded signature set',
1953
- 'pubkey would be all zeroes.',
1954
- ],
1955
- },
1956
- ],
1957
- args: [],
1958
- },
1959
- ],
1960
- accounts: [
1961
- {
1962
- name: 'guardianSet',
1963
- docs: [
1964
- 'Account used to store a guardian set. The keys encoded in this account are Ethereum pubkeys.',
1965
- 'Its expiration time is determined at the time a guardian set is updated to a new set, where the',
1966
- 'current network clock time is used with',
1967
- '[guardian_set_ttl](crate::state::Config::guardian_set_ttl).',
1968
- '',
1969
- 'NOTE: The account schema is the same as legacy guardian sets, but this account now has a',
1970
- "discriminator generated by Anchor's [account] macro. When the Core Bridge program performs a",
1971
- 'guardian set update with this implementation, guardian sets will now have this Anchor-generated',
1972
- 'discriminator.',
1973
- ],
1974
- type: {
1975
- kind: 'struct',
1976
- fields: [
1977
- {
1978
- name: 'index',
1979
- docs: [
1980
- 'Index representing an incrementing version number for this guardian set.',
1981
- ],
1982
- type: 'u32',
1983
- },
1984
- {
1985
- name: 'keys',
1986
- docs: ['Ethereum-style public keys.'],
1987
- type: {
1988
- vec: {
1989
- array: ['u8', 20],
1990
- },
1991
- },
1992
- },
1993
- {
1994
- name: 'creationTime',
1995
- docs: [
1996
- 'Timestamp representing the time this guardian became active.',
1997
- ],
1998
- type: {
1999
- defined: 'Timestamp',
2000
- },
2001
- },
2002
- {
2003
- name: 'expirationTime',
2004
- docs: [
2005
- 'Expiration time when VAAs issued by this set are no longer valid.',
2006
- ],
2007
- type: {
2008
- defined: 'Timestamp',
2009
- },
2010
- },
2011
- ],
2012
- },
2013
- },
2014
- {
2015
- name: 'signatureSet',
2016
- docs: [
2017
- 'Account used to store information about a guardian set used to sign a VAA. There is only one',
2018
- 'signature set for each verified VAA (associated with a',
2019
- '[PostedVaaV1](crate::legacy::state::PostedVaaV1) account). This account is created using the',
2020
- 'verify signatures legacy instruction.',
2021
- '',
2022
- 'NOTE: The account schema is the same as legacy signature sets, but this account now has a',
2023
- "discriminator generated by Anchor's [account] macro. When the Core Bridge program upgrades to",
2024
- 'this implementation from the old one, integrators in the middle of verifying signatures will',
2025
- 'have to use a new keypair for this account and try again.',
2026
- ],
2027
- type: {
2028
- kind: 'struct',
2029
- fields: [
2030
- {
2031
- name: 'sigVerifySuccesses',
2032
- docs: ['Signatures of validators'],
2033
- type: {
2034
- vec: 'bool',
2035
- },
2036
- },
2037
- {
2038
- name: 'messageHash',
2039
- docs: ['Hash of the VAA message body.'],
2040
- type: {
2041
- defined: 'MessageHash',
2042
- },
2043
- },
2044
- {
2045
- name: 'guardianSetIndex',
2046
- docs: ['Index of the guardian set'],
2047
- type: 'u32',
2048
- },
2049
- ],
2050
- },
2051
- },
2052
- {
2053
- name: 'encodedVaa',
2054
- docs: [
2055
- 'Account used to warehouse VAA buffer.',
2056
- '',
2057
- "NOTE: This account should not be used by an external application unless the header's status is",
2058
- '`Verified`. It is encouraged to use the `EncodedVaa` zero-copy account struct instead.',
2059
- ],
2060
- type: {
2061
- kind: 'struct',
2062
- fields: [
2063
- {
2064
- name: 'header',
2065
- docs: ['Status, write authority and VAA version.'],
2066
- type: {
2067
- defined: 'Header',
2068
- },
2069
- },
2070
- {
2071
- name: 'buf',
2072
- docs: ['VAA buffer.'],
2073
- type: 'bytes',
2074
- },
2075
- ],
2076
- },
2077
- },
2078
- ],
2079
- types: [
2080
- {
2081
- name: 'InitializeArgs',
2082
- docs: ['Arguments used to initialize the Core Bridge program.'],
2083
- type: {
2084
- kind: 'struct',
2085
- fields: [
2086
- {
2087
- name: 'guardianSetTtlSeconds',
2088
- type: 'u32',
2089
- },
2090
- {
2091
- name: 'feeLamports',
2092
- type: 'u64',
2093
- },
2094
- {
2095
- name: 'initialGuardians',
2096
- type: {
2097
- vec: {
2098
- array: ['u8', 20],
2099
- },
2100
- },
2101
- },
2102
- ],
2103
- },
2104
- },
2105
- {
2106
- name: 'PostMessageArgs',
2107
- docs: [
2108
- 'Arguments used to post a new Wormhole (Core Bridge) message either using',
2109
- '[post_message](crate::legacy::instruction::post_message) or',
2110
- '[post_message_unreliable](crate::legacy::instruction::post_message_unreliable).',
2111
- ],
2112
- type: {
2113
- kind: 'struct',
2114
- fields: [
2115
- {
2116
- name: 'nonce',
2117
- docs: ['Unique id for this message.'],
2118
- type: 'u32',
2119
- },
2120
- {
2121
- name: 'payload',
2122
- docs: ['Encoded message.'],
2123
- type: 'bytes',
2124
- },
2125
- {
2126
- name: 'commitment',
2127
- docs: ['Solana commitment level for Guardian observation.'],
2128
- type: {
2129
- defined: 'Commitment',
2130
- },
2131
- },
2132
- ],
2133
- },
2134
- },
2135
- {
2136
- name: 'PostVaaArgs',
2137
- docs: [
2138
- 'Arguments to post new VAA data after signature verification.',
2139
- '',
2140
- 'NOTE: It is preferred to use the new process of verifying a VAA using the new Core Bridge Anchor',
2141
- 'instructions. See [init_encoded_vaa](crate::wormhole_core_bridge_solana::init_encoded_vaa) and',
2142
- '[write_encoded_vaa](crate::wormhole_core_bridge_solana::write_encoded_vaa) for more info.',
2143
- ],
2144
- type: {
2145
- kind: 'struct',
2146
- fields: [
2147
- {
2148
- name: 'gap0',
2149
- docs: ['Unused data.'],
2150
- type: {
2151
- array: ['u8', 5],
2152
- },
2153
- },
2154
- {
2155
- name: 'timestamp',
2156
- docs: ['Time the message was submitted.'],
2157
- type: 'u32',
2158
- },
2159
- {
2160
- name: 'nonce',
2161
- docs: ['Unique ID for this message.'],
2162
- type: 'u32',
2163
- },
2164
- {
2165
- name: 'emitterChain',
2166
- docs: [
2167
- 'The Wormhole chain ID denoting the origin of this message.',
2168
- ],
2169
- type: 'u16',
2170
- },
2171
- {
2172
- name: 'emitterAddress',
2173
- docs: ['Emitter of the message.'],
2174
- type: {
2175
- array: ['u8', 32],
2176
- },
2177
- },
2178
- {
2179
- name: 'sequence',
2180
- docs: ['Sequence number of this message.'],
2181
- type: 'u64',
2182
- },
2183
- {
2184
- name: 'consistencyLevel',
2185
- docs: ['Level of consistency requested by the emitter.'],
2186
- type: 'u8',
2187
- },
2188
- {
2189
- name: 'payload',
2190
- docs: ['Message payload.'],
2191
- type: 'bytes',
2192
- },
2193
- ],
2194
- },
2195
- },
2196
- {
2197
- name: 'VerifySignaturesArgs',
2198
- docs: [
2199
- 'Arguments to verify specific guardian indices.',
2200
- '',
2201
- 'NOTE: It is preferred to use the new process of verifying a VAA using the new Core Bridge Anchor',
2202
- 'instructions. See [init_encoded_vaa](crate::wormhole_core_bridge_solana::init_encoded_vaa) and',
2203
- '[write_encoded_vaa](crate::wormhole_core_bridge_solana::write_encoded_vaa) for more info.',
2204
- ],
2205
- type: {
2206
- kind: 'struct',
2207
- fields: [
2208
- {
2209
- name: 'signerIndices',
2210
- docs: [
2211
- 'Indices of verified guardian signatures, where -1 indicates a missing value. There is a',
2212
- 'missing value if the guardian at this index is not expected to have its signature verfied by',
2213
- 'the Sig Verify native program in the instruction invoked prior).',
2214
- '',
2215
- 'NOTE: In the legacy implementation, this argument being a fixed-sized array of 19 only',
2216
- 'allows the first 19 guardians of any size guardian set to be verified. Because of this, it',
2217
- 'is absolutely important to use the new process of verifying a VAA.',
2218
- ],
2219
- type: {
2220
- array: ['i8', 19],
2221
- },
2222
- },
2223
- ],
2224
- },
2225
- },
2226
- {
2227
- name: 'EmptyArgs',
2228
- docs: ['Unit struct used to represent an empty instruction argument.'],
2229
- type: {
2230
- kind: 'struct',
2231
- fields: [],
2232
- },
2233
- },
2234
- {
2235
- name: 'Config',
2236
- docs: [
2237
- 'Account used to store the current configuration of the bridge, including tracking Wormhole fee',
2238
- 'payments. For governance decrees, the guardian set index is used to determine whether a decree',
2239
- 'was attested for using the latest guardian set.',
2240
- ],
2241
- type: {
2242
- kind: 'struct',
2243
- fields: [
2244
- {
2245
- name: 'guardianSetIndex',
2246
- docs: [
2247
- 'The current guardian set index, used to decide which signature sets to accept.',
2248
- ],
2249
- type: 'u32',
2250
- },
2251
- {
2252
- name: 'gap0',
2253
- docs: [
2254
- 'Gap. In the old implementation, this was an amount that kept track of message fees that',
2255
- "were paid to the program's fee collector.",
2256
- ],
2257
- type: {
2258
- array: ['u8', 8],
2259
- },
2260
- },
2261
- {
2262
- name: 'guardianSetTtl',
2263
- docs: [
2264
- 'Period for how long a guardian set is valid after it has been replaced by a new one. This',
2265
- 'guarantees that VAAs issued by that set can still be submitted for a certain period. In',
2266
- 'this period we still trust the old guardian set.',
2267
- ],
2268
- type: {
2269
- defined: 'Duration',
2270
- },
2271
- },
2272
- {
2273
- name: 'feeLamports',
2274
- docs: [
2275
- 'Amount of lamports that needs to be paid to the protocol to post a message',
2276
- ],
2277
- type: 'u64',
2278
- },
2279
- ],
2280
- },
2281
- },
2282
- {
2283
- name: 'LegacyEmitterSequence',
2284
- docs: [
2285
- 'Account used to store the current sequence number for a given emitter.',
2286
- ],
2287
- type: {
2288
- kind: 'struct',
2289
- fields: [
2290
- {
2291
- name: 'value',
2292
- docs: [
2293
- 'Current sequence number, which will be used the next time this emitter publishes a message.',
2294
- ],
2295
- type: 'u64',
2296
- },
2297
- ],
2298
- },
2299
- },
2300
- {
2301
- name: 'EmitterSequence',
2302
- type: {
2303
- kind: 'struct',
2304
- fields: [
2305
- {
2306
- name: 'legacy',
2307
- type: {
2308
- defined: 'LegacyEmitterSequence',
2309
- },
2310
- },
2311
- {
2312
- name: 'bump',
2313
- type: 'u8',
2314
- },
2315
- {
2316
- name: 'emitterType',
2317
- type: {
2318
- defined: 'EmitterType',
2319
- },
2320
- },
2321
- ],
2322
- },
2323
- },
2324
- {
2325
- name: 'PostedMessageV1Unreliable',
2326
- docs: ['Account used to store a published (reusable) Wormhole message.'],
2327
- type: {
2328
- kind: 'struct',
2329
- fields: [
2330
- {
2331
- name: 'data',
2332
- type: {
2333
- defined: 'PostedMessageV1Data',
2334
- },
2335
- },
2336
- ],
2337
- },
2338
- },
2339
- {
2340
- name: 'PostedMessageV1Info',
2341
- docs: [
2342
- 'Message metadata defining information about a published Wormhole message.',
2343
- ],
2344
- type: {
2345
- kind: 'struct',
2346
- fields: [
2347
- {
2348
- name: 'consistencyLevel',
2349
- docs: ['Level of consistency requested by the emitter.'],
2350
- type: 'u8',
2351
- },
2352
- {
2353
- name: 'emitterAuthority',
2354
- docs: [
2355
- 'Authority used to write the message. This field is set to default when the message is',
2356
- 'posted.',
2357
- ],
2358
- type: 'publicKey',
2359
- },
2360
- {
2361
- name: 'status',
2362
- docs: [
2363
- 'If a message is being written to, this status is used to determine which state this',
2364
- 'account is in (e.g. [MessageStatus::Writing] indicates that the emitter authority is still',
2365
- 'writing its message to this account). When this message is posted, this value will be',
2366
- 'set to [MessageStatus::Published].',
2367
- ],
2368
- type: {
2369
- defined: 'MessageStatus',
2370
- },
2371
- },
2372
- {
2373
- name: 'gap0',
2374
- docs: ['No data is stored here.'],
2375
- type: {
2376
- array: ['u8', 3],
2377
- },
2378
- },
2379
- {
2380
- name: 'postedTimestamp',
2381
- docs: ['Time the posted message was created.'],
2382
- type: {
2383
- defined: 'Timestamp',
2384
- },
2385
- },
2386
- {
2387
- name: 'nonce',
2388
- docs: ['Unique id for this message.'],
2389
- type: 'u32',
2390
- },
2391
- {
2392
- name: 'sequence',
2393
- docs: ['Sequence number of this message.'],
2394
- type: 'u64',
2395
- },
2396
- {
2397
- name: 'solanaChainId',
2398
- docs: [
2399
- 'Always `1`.',
2400
- '',
2401
- 'NOTE: Saving this value is silly, but we are keeping it to be consistent with how the posted',
2402
- 'message account is written.',
2403
- ],
2404
- type: {
2405
- defined: 'ChainIdSolanaOnly',
2406
- },
2407
- },
2408
- {
2409
- name: 'emitter',
2410
- docs: [
2411
- 'Emitter of the message. This may either be the emitter authority or a program ID.',
2412
- ],
2413
- type: 'publicKey',
2414
- },
2415
- ],
2416
- },
2417
- },
2418
- {
2419
- name: 'PostedMessageV1Data',
2420
- docs: [
2421
- 'Underlying data for either [PostedMessageV1](crate::legacy::state::PostedMessageV1) or',
2422
- '[PostedMessageV1Unreliable](crate::legacy::state::PostedMessageV1Unreliable).',
2423
- ],
2424
- type: {
2425
- kind: 'struct',
2426
- fields: [
2427
- {
2428
- name: 'info',
2429
- docs: ['Message metadata.'],
2430
- type: {
2431
- defined: 'PostedMessageV1Info',
2432
- },
2433
- },
2434
- {
2435
- name: 'payload',
2436
- docs: ['Encoded message.'],
2437
- type: 'bytes',
2438
- },
2439
- ],
2440
- },
2441
- },
2442
- {
2443
- name: 'PostedMessageV1',
2444
- docs: [
2445
- 'Account used to store a published Wormhole message.',
2446
- '',
2447
- 'NOTE: If your integration requires reusable message accounts, please see',
2448
- '[PostedMessageV1Unreliable](crate::legacy::state::PostedMessageV1Unreliable).',
2449
- ],
2450
- type: {
2451
- kind: 'struct',
2452
- fields: [
2453
- {
2454
- name: 'data',
2455
- docs: ['Message data.'],
2456
- type: {
2457
- defined: 'PostedMessageV1Data',
2458
- },
2459
- },
2460
- ],
2461
- },
2462
- },
2463
- {
2464
- name: 'PostedVaaV1Info',
2465
- docs: [
2466
- 'VAA metadata defining information about a Wormhole message attested for by an active guardian',
2467
- 'set.',
2468
- ],
2469
- type: {
2470
- kind: 'struct',
2471
- fields: [
2472
- {
2473
- name: 'consistencyLevel',
2474
- docs: ['Level of consistency requested by the emitter.'],
2475
- type: 'u8',
2476
- },
2477
- {
2478
- name: 'timestamp',
2479
- docs: ['Time the message was submitted.'],
2480
- type: {
2481
- defined: 'Timestamp',
2482
- },
2483
- },
2484
- {
2485
- name: 'signatureSet',
2486
- docs: [
2487
- "Pubkey of [SignatureSet](crate::state::SignatureSet) account that represents this VAA's",
2488
- 'signature verification.',
2489
- ],
2490
- type: 'publicKey',
2491
- },
2492
- {
2493
- name: 'guardianSetIndex',
2494
- docs: [
2495
- 'Guardian set index used to verify signatures for [SignatureSet](crate::state::SignatureSet).',
2496
- '',
2497
- 'NOTE: In the previous implementation, this member was referred to as the "posted timestamp",',
2498
- 'which is zero for VAA data (posted messages and VAAs resemble the same account schema). By',
2499
- 'changing this to the guardian set index, we patch a bug with verifying governance VAAs for',
2500
- 'the Core Bridge (other Core Bridge implementations require that the guardian set that',
2501
- 'attested for the governance VAA is the current one).',
2502
- ],
2503
- type: 'u32',
2504
- },
2505
- {
2506
- name: 'nonce',
2507
- docs: ['Unique ID for this message.'],
2508
- type: 'u32',
2509
- },
2510
- {
2511
- name: 'sequence',
2512
- docs: ['Sequence number of this message.'],
2513
- type: 'u64',
2514
- },
2515
- {
2516
- name: 'emitterChain',
2517
- docs: [
2518
- 'The Wormhole chain ID denoting the origin of this message.',
2519
- ],
2520
- type: 'u16',
2521
- },
2522
- {
2523
- name: 'emitterAddress',
2524
- docs: ['Emitter of the message.'],
2525
- type: {
2526
- array: ['u8', 32],
2527
- },
2528
- },
2529
- ],
2530
- },
2531
- },
2532
- {
2533
- name: 'PostedVaaV1',
2534
- docs: ['Account used to store a verified VAA.'],
2535
- type: {
2536
- kind: 'struct',
2537
- fields: [
2538
- {
2539
- name: 'info',
2540
- docs: ['VAA metadata.'],
2541
- type: {
2542
- defined: 'PostedVaaV1Info',
2543
- },
2544
- },
2545
- {
2546
- name: 'payload',
2547
- docs: ['Message payload.'],
2548
- type: 'bytes',
2549
- },
2550
- ],
2551
- },
2552
- },
2553
- {
2554
- name: 'WriteEncodedVaaArgs',
2555
- docs: [
2556
- 'Arguments for the [write_encoded_vaa](crate::wormhole_core_bridge_solana::write_encoded_vaa)',
2557
- 'instruction.',
2558
- ],
2559
- type: {
2560
- kind: 'struct',
2561
- fields: [
2562
- {
2563
- name: 'index',
2564
- docs: ['Index of VAA buffer.'],
2565
- type: 'u32',
2566
- },
2567
- {
2568
- name: 'data',
2569
- docs: [
2570
- 'Data representing subset of VAA buffer starting at specified index.',
2571
- ],
2572
- type: 'bytes',
2573
- },
2574
- ],
2575
- },
2576
- },
2577
- {
2578
- name: 'InitMessageV1Args',
2579
- docs: [
2580
- 'Arguments for the [init_message_v1](crate::wormhole_core_bridge_solana::init_message_v1)',
2581
- 'instruction.',
2582
- ],
2583
- type: {
2584
- kind: 'struct',
2585
- fields: [
2586
- {
2587
- name: 'nonce',
2588
- docs: ['Unique id for this message.'],
2589
- type: 'u32',
2590
- },
2591
- {
2592
- name: 'commitment',
2593
- docs: ['Solana commitment level for Guardian observation.'],
2594
- type: {
2595
- defined: 'Commitment',
2596
- },
2597
- },
2598
- {
2599
- name: 'cpiProgramId',
2600
- docs: [
2601
- 'Optional program ID if the emitter address will be your program ID.',
2602
- '',
2603
- 'NOTE: If `Some(program_id)`, your emitter authority seeds to be \\[b"emitter\\].',
2604
- ],
2605
- type: {
2606
- option: 'publicKey',
2607
- },
2608
- },
2609
- ],
2610
- },
2611
- },
2612
- {
2613
- name: 'WriteMessageV1Args',
2614
- docs: [
2615
- 'Arguments for the [write_message_v1](crate::wormhole_core_bridge_solana::write_message_v1)',
2616
- 'instruction.',
2617
- ],
2618
- type: {
2619
- kind: 'struct',
2620
- fields: [
2621
- {
2622
- name: 'index',
2623
- docs: ['Index of message buffer.'],
2624
- type: 'u32',
2625
- },
2626
- {
2627
- name: 'data',
2628
- docs: [
2629
- 'Data representing subset of message buffer starting at specified index.',
2630
- ],
2631
- type: 'bytes',
2632
- },
2633
- ],
2634
- },
2635
- },
2636
- {
2637
- name: 'Header',
2638
- docs: ['`EncodedVaa` account header.'],
2639
- type: {
2640
- kind: 'struct',
2641
- fields: [
2642
- {
2643
- name: 'status',
2644
- docs: [
2645
- 'Processing status. **This encoded VAA is only considered usable when this status is set',
2646
- 'to [Verified](ProcessingStatus::Verified).**',
2647
- ],
2648
- type: {
2649
- defined: 'ProcessingStatus',
2650
- },
2651
- },
2652
- {
2653
- name: 'writeAuthority',
2654
- docs: ['The authority that has write privilege to this account.'],
2655
- type: 'publicKey',
2656
- },
2657
- {
2658
- name: 'version',
2659
- docs: [
2660
- 'VAA version. Only when the VAA is verified is this version set to a value.',
2661
- ],
2662
- type: 'u8',
2663
- },
2664
- ],
2665
- },
2666
- },
2667
- {
2668
- name: 'Timestamp',
2669
- docs: [
2670
- 'This struct defines unix timestamp as u32 (as opposed to more modern systems that have adopted',
2671
- "i64). Methods for this struct are meant to convert Solana's clock type to this type assuming we",
2672
- 'are far from year 2038.',
2673
- ],
2674
- type: {
2675
- kind: 'struct',
2676
- fields: [
2677
- {
2678
- name: 'value',
2679
- type: 'u32',
2680
- },
2681
- ],
2682
- },
2683
- },
2684
- {
2685
- name: 'Duration',
2686
- docs: [
2687
- 'To be used with the [Timestamp] type, this struct defines a duration in seconds.',
2688
- ],
2689
- type: {
2690
- kind: 'struct',
2691
- fields: [
2692
- {
2693
- name: 'seconds',
2694
- type: 'u32',
2695
- },
2696
- ],
2697
- },
2698
- },
2699
- {
2700
- name: 'MessageHash',
2701
- docs: ['This type is used to represent a message hash (keccak).'],
2702
- type: {
2703
- kind: 'struct',
2704
- fields: [
2705
- {
2706
- name: 'bytes',
2707
- type: {
2708
- array: ['u8', 32],
2709
- },
2710
- },
2711
- ],
2712
- },
2713
- },
2714
- {
2715
- name: 'ChainIdSolanaOnly',
2716
- docs: [
2717
- 'This type is kind of silly. But because [PostedMessageV1](crate::state::PostedMessageV1) has the',
2718
- "emitter chain ID as a field, which is unnecessary since it is always Solana's chain ID, we use",
2719
- 'this type to guarantee that the encoded chain ID is always `1`.',
2720
- ],
2721
- type: {
2722
- kind: 'struct',
2723
- fields: [
2724
- {
2725
- name: 'chainId',
2726
- type: 'u16',
2727
- },
2728
- ],
2729
- },
2730
- },
2731
- {
2732
- name: 'EmitterInfo',
2733
- type: {
2734
- kind: 'struct',
2735
- fields: [
2736
- {
2737
- name: 'chain',
2738
- type: 'u16',
2739
- },
2740
- {
2741
- name: 'address',
2742
- type: {
2743
- array: ['u8', 32],
2744
- },
2745
- },
2746
- {
2747
- name: 'sequence',
2748
- type: 'u64',
2749
- },
2750
- ],
2751
- },
2752
- },
2753
- {
2754
- name: 'LegacyInstruction',
2755
- docs: [
2756
- 'Legacy instruction selector.',
2757
- '',
2758
- 'NOTE: No more instructions should be added to this enum. Instead, add them as Anchor instruction',
2759
- 'handlers, which will inevitably live in',
2760
- '[wormhole_core_bridge_solana](crate::wormhole_core_bridge_solana).',
2761
- ],
2762
- type: {
2763
- kind: 'enum',
2764
- variants: [
2765
- {
2766
- name: 'Initialize',
2767
- },
2768
- {
2769
- name: 'PostMessage',
2770
- },
2771
- {
2772
- name: 'PostVaa',
2773
- },
2774
- {
2775
- name: 'SetMessageFee',
2776
- },
2777
- {
2778
- name: 'TransferFees',
2779
- },
2780
- {
2781
- name: 'UpgradeContract',
2782
- },
2783
- {
2784
- name: 'GuardianSetUpdate',
2785
- },
2786
- {
2787
- name: 'VerifySignatures',
2788
- },
2789
- {
2790
- name: 'PostMessageUnreliable',
2791
- },
2792
- ],
2793
- },
2794
- },
2795
- {
2796
- name: 'EmitterType',
2797
- type: {
2798
- kind: 'enum',
2799
- variants: [
2800
- {
2801
- name: 'Unset',
2802
- },
2803
- {
2804
- name: 'Legacy',
2805
- },
2806
- {
2807
- name: 'Executable',
2808
- },
2809
- ],
2810
- },
2811
- },
2812
- {
2813
- name: 'MessageStatus',
2814
- docs: [
2815
- 'Status of a message. When a message is posted, its status is',
2816
- '[Published](MessageStatus::Published).',
2817
- ],
2818
- type: {
2819
- kind: 'enum',
2820
- variants: [
2821
- {
2822
- name: 'Published',
2823
- },
2824
- {
2825
- name: 'Writing',
2826
- },
2827
- {
2828
- name: 'ReadyForPublishing',
2829
- },
2830
- ],
2831
- },
2832
- },
2833
- {
2834
- name: 'PublishMessageDirective',
2835
- docs: ['Directive used to determine how to post a Core Bridge message.'],
2836
- type: {
2837
- kind: 'enum',
2838
- variants: [
2839
- {
2840
- name: 'Message',
2841
- fields: [
2842
- {
2843
- name: 'nonce',
2844
- type: 'u32',
2845
- },
2846
- {
2847
- name: 'payload',
2848
- type: 'bytes',
2849
- },
2850
- {
2851
- name: 'commitment',
2852
- type: {
2853
- defined: 'Commitment',
2854
- },
2855
- },
2856
- ],
2857
- },
2858
- {
2859
- name: 'ProgramMessage',
2860
- fields: [
2861
- {
2862
- name: 'programId',
2863
- type: 'publicKey',
2864
- },
2865
- {
2866
- name: 'nonce',
2867
- type: 'u32',
2868
- },
2869
- {
2870
- name: 'payload',
2871
- type: 'bytes',
2872
- },
2873
- {
2874
- name: 'commitment',
2875
- type: {
2876
- defined: 'Commitment',
2877
- },
2878
- },
2879
- ],
2880
- },
2881
- {
2882
- name: 'PreparedMessage',
2883
- },
2884
- ],
2885
- },
2886
- },
2887
- {
2888
- name: 'ProcessingStatus',
2889
- docs: ["Encoded VAA's processing status."],
2890
- type: {
2891
- kind: 'enum',
2892
- variants: [
2893
- {
2894
- name: 'Unset',
2895
- },
2896
- {
2897
- name: 'Writing',
2898
- },
2899
- {
2900
- name: 'Verified',
2901
- },
2902
- ],
2903
- },
2904
- },
2905
- {
2906
- name: 'Commitment',
2907
- docs: [
2908
- "Representation of Solana's commitment levels. This enum is not exhaustive because Wormhole only",
2909
- 'considers these two commitment levels in its Guardian observation.',
2910
- '',
2911
- 'See <https://docs.solana.com/cluster/commitments> for more info.',
2912
- ],
2913
- type: {
2914
- kind: 'enum',
2915
- variants: [
2916
- {
2917
- name: 'Confirmed',
2918
- },
2919
- {
2920
- name: 'Finalized',
2921
- },
2922
- ],
2923
- },
2924
- },
2925
- ],
2926
- errors: [
2927
- {
2928
- code: 6002,
2929
- name: 'InvalidInstructionArgument',
2930
- msg: 'InvalidInstructionArgument',
2931
- },
2932
- {
2933
- code: 6003,
2934
- name: 'AccountNotZeroed',
2935
- msg: 'AccountNotZeroed',
2936
- },
2937
- {
2938
- code: 6004,
2939
- name: 'InvalidDataConversion',
2940
- msg: 'InvalidDataConversion',
2941
- },
2942
- {
2943
- code: 6006,
2944
- name: 'U64Overflow',
2945
- msg: 'U64Overflow',
2946
- },
2947
- {
2948
- code: 6008,
2949
- name: 'InvalidComputeSize',
2950
- msg: 'InvalidComputeSize',
2951
- },
2952
- {
2953
- code: 6016,
2954
- name: 'InvalidChain',
2955
- msg: 'InvalidChain',
2956
- },
2957
- {
2958
- code: 6032,
2959
- name: 'InvalidGovernanceEmitter',
2960
- msg: 'InvalidGovernanceEmitter',
2961
- },
2962
- {
2963
- code: 6034,
2964
- name: 'InvalidGovernanceAction',
2965
- msg: 'InvalidGovernanceAction',
2966
- },
2967
- {
2968
- code: 6036,
2969
- name: 'LatestGuardianSetRequired',
2970
- msg: 'LatestGuardianSetRequired',
2971
- },
2972
- {
2973
- code: 6038,
2974
- name: 'GovernanceForAnotherChain',
2975
- msg: 'GovernanceForAnotherChain',
2976
- },
2977
- {
2978
- code: 6040,
2979
- name: 'InvalidGovernanceVaa',
2980
- msg: 'InvalidGovernanceVaa',
2981
- },
2982
- {
2983
- code: 6256,
2984
- name: 'InsufficientFees',
2985
- msg: 'InsufficientFees',
2986
- },
2987
- {
2988
- code: 6258,
2989
- name: 'EmitterMismatch',
2990
- msg: 'EmitterMismatch',
2991
- },
2992
- {
2993
- code: 6260,
2994
- name: 'NotReadyForPublishing',
2995
- msg: 'NotReadyForPublishing',
2996
- },
2997
- {
2998
- code: 6262,
2999
- name: 'InvalidPreparedMessage',
3000
- msg: 'InvalidPreparedMessage',
3001
- },
3002
- {
3003
- code: 6264,
3004
- name: 'ExecutableEmitter',
3005
- msg: 'ExecutableEmitter',
3006
- },
3007
- {
3008
- code: 6266,
3009
- name: 'LegacyEmitter',
3010
- msg: 'LegacyEmitter',
3011
- },
3012
- {
3013
- code: 6512,
3014
- name: 'InvalidSignatureSet',
3015
- msg: 'InvalidSignatureSet',
3016
- },
3017
- {
3018
- code: 6514,
3019
- name: 'InvalidMessageHash',
3020
- msg: 'InvalidMessageHash',
3021
- },
3022
- {
3023
- code: 6515,
3024
- name: 'NoQuorum',
3025
- msg: 'NoQuorum',
3026
- },
3027
- {
3028
- code: 6516,
3029
- name: 'MessageMismatch',
3030
- msg: 'MessageMismatch',
3031
- },
3032
- {
3033
- code: 7024,
3034
- name: 'NotEnoughLamports',
3035
- msg: 'NotEnoughLamports',
3036
- },
3037
- {
3038
- code: 7026,
3039
- name: 'InvalidFeeRecipient',
3040
- msg: 'InvalidFeeRecipient',
3041
- },
3042
- {
3043
- code: 7280,
3044
- name: 'ImplementationMismatch',
3045
- msg: 'ImplementationMismatch',
3046
- },
3047
- {
3048
- code: 7536,
3049
- name: 'InvalidGuardianSetIndex',
3050
- msg: 'InvalidGuardianSetIndex',
3051
- },
3052
- {
3053
- code: 7792,
3054
- name: 'GuardianSetMismatch',
3055
- msg: 'GuardianSetMismatch',
3056
- },
3057
- {
3058
- code: 7794,
3059
- name: 'InstructionAtWrongIndex',
3060
- msg: 'InstructionAtWrongIndex',
3061
- },
3062
- {
3063
- code: 7795,
3064
- name: 'EmptySigVerifyInstruction',
3065
- msg: 'EmptySigVerifyInstruction',
3066
- },
3067
- {
3068
- code: 7796,
3069
- name: 'InvalidSigVerifyInstruction',
3070
- msg: 'InvalidSigVerifyInstruction',
3071
- },
3072
- {
3073
- code: 7798,
3074
- name: 'GuardianSetExpired',
3075
- msg: 'GuardianSetExpired',
3076
- },
3077
- {
3078
- code: 7800,
3079
- name: 'InvalidGuardianKeyRecovery',
3080
- msg: 'InvalidGuardianKeyRecovery',
3081
- },
3082
- {
3083
- code: 7802,
3084
- name: 'SignerIndicesMismatch',
3085
- msg: 'SignerIndicesMismatch',
3086
- },
3087
- {
3088
- code: 8048,
3089
- name: 'PayloadSizeMismatch',
3090
- msg: 'PayloadSizeMismatch',
3091
- },
3092
- {
3093
- code: 10112,
3094
- name: 'ZeroGuardians',
3095
- msg: 'ZeroGuardians',
3096
- },
3097
- {
3098
- code: 10128,
3099
- name: 'GuardianZeroAddress',
3100
- msg: 'GuardianZeroAddress',
3101
- },
3102
- {
3103
- code: 10144,
3104
- name: 'DuplicateGuardianAddress',
3105
- msg: 'DuplicateGuardianAddress',
3106
- },
3107
- {
3108
- code: 10160,
3109
- name: 'MessageAlreadyPublished',
3110
- msg: 'MessageAlreadyPublished',
3111
- },
3112
- {
3113
- code: 10176,
3114
- name: 'VaaWritingDisallowed',
3115
- msg: 'VaaWritingDisallowed',
3116
- },
3117
- {
3118
- code: 10192,
3119
- name: 'VaaAlreadyVerified',
3120
- msg: 'VaaAlreadyVerified',
3121
- },
3122
- {
3123
- code: 10208,
3124
- name: 'InvalidGuardianIndex',
3125
- msg: 'InvalidGuardianIndex',
3126
- },
3127
- {
3128
- code: 10224,
3129
- name: 'InvalidSignature',
3130
- msg: 'InvalidSignature',
3131
- },
3132
- {
3133
- code: 10256,
3134
- name: 'UnverifiedVaa',
3135
- msg: 'UnverifiedVaa',
3136
- },
3137
- {
3138
- code: 10258,
3139
- name: 'VaaStillProcessing',
3140
- msg: 'VaaStillProcessing',
3141
- },
3142
- {
3143
- code: 10260,
3144
- name: 'InWritingStatus',
3145
- msg: 'InWritingStatus',
3146
- },
3147
- {
3148
- code: 10262,
3149
- name: 'NotInWritingStatus',
3150
- msg: 'NotInWritingStatus',
3151
- },
3152
- {
3153
- code: 10264,
3154
- name: 'InvalidMessageStatus',
3155
- msg: 'InvalidMessageStatus',
3156
- },
3157
- {
3158
- code: 10266,
3159
- name: 'HashNotComputed',
3160
- msg: 'HashNotComputed',
3161
- },
3162
- {
3163
- code: 10268,
3164
- name: 'InvalidVaaVersion',
3165
- msg: 'InvalidVaaVersion',
3166
- },
3167
- {
3168
- code: 10270,
3169
- name: 'InvalidCreatedAccountSize',
3170
- msg: 'InvalidCreatedAccountSize',
3171
- },
3172
- {
3173
- code: 10272,
3174
- name: 'DataOverflow',
3175
- msg: 'DataOverflow',
3176
- },
3177
- {
3178
- code: 10274,
3179
- name: 'ExceedsMaxPayloadSize',
3180
- msg: 'ExceedsMaxPayloadSize (30KB)',
3181
- },
3182
- {
3183
- code: 10276,
3184
- name: 'CannotParseVaa',
3185
- msg: 'CannotParseVaa',
3186
- },
3187
- {
3188
- code: 10278,
3189
- name: 'EmitterAuthorityMismatch',
3190
- msg: 'EmitterAuthorityMismatch',
3191
- },
3192
- {
3193
- code: 10280,
3194
- name: 'InvalidProgramEmitter',
3195
- msg: 'InvalidProgramEmitter',
3196
- },
3197
- {
3198
- code: 10282,
3199
- name: 'WriteAuthorityMismatch',
3200
- msg: 'WriteAuthorityMismatch',
3201
- },
3202
- {
3203
- code: 10284,
3204
- name: 'PostedVaaPayloadTooLarge',
3205
- msg: 'PostedVaaPayloadTooLarge',
3206
- },
3207
- {
3208
- code: 10286,
3209
- name: 'ExecutableDisallowed',
3210
- msg: 'ExecutableDisallowed',
3211
- },
3212
- ],
3213
- };
3214
-
3215
- export type PythSolanaReceiver = {
3216
- version: '0.1.0';
3217
- name: 'pyth_solana_receiver';
3218
- instructions: [
3219
- {
3220
- name: 'initialize';
3221
- accounts: [
3222
- {
3223
- name: 'payer';
3224
- isMut: true;
3225
- isSigner: true;
3226
- },
3227
- {
3228
- name: 'config';
3229
- isMut: true;
3230
- isSigner: false;
3231
- },
3232
- {
3233
- name: 'systemProgram';
3234
- isMut: false;
3235
- isSigner: false;
3236
- },
3237
- ];
3238
- args: [
3239
- {
3240
- name: 'initialConfig';
3241
- type: {
3242
- defined: 'Config';
3243
- };
3244
- },
3245
- ];
3246
- },
3247
- {
3248
- name: 'requestGovernanceAuthorityTransfer';
3249
- accounts: [
3250
- {
3251
- name: 'payer';
3252
- isMut: false;
3253
- isSigner: true;
3254
- },
3255
- {
3256
- name: 'config';
3257
- isMut: true;
3258
- isSigner: false;
3259
- },
3260
- ];
3261
- args: [
3262
- {
3263
- name: 'targetGovernanceAuthority';
3264
- type: 'publicKey';
3265
- },
3266
- ];
3267
- },
3268
- {
3269
- name: 'acceptGovernanceAuthorityTransfer';
3270
- accounts: [
3271
- {
3272
- name: 'payer';
3273
- isMut: false;
3274
- isSigner: true;
3275
- },
3276
- {
3277
- name: 'config';
3278
- isMut: true;
3279
- isSigner: false;
3280
- },
3281
- ];
3282
- args: [];
3283
- },
3284
- {
3285
- name: 'setDataSources';
3286
- accounts: [
3287
- {
3288
- name: 'payer';
3289
- isMut: false;
3290
- isSigner: true;
3291
- },
3292
- {
3293
- name: 'config';
3294
- isMut: true;
3295
- isSigner: false;
3296
- },
3297
- ];
3298
- args: [
3299
- {
3300
- name: 'validDataSources';
3301
- type: {
3302
- vec: {
3303
- defined: 'DataSource';
3304
- };
3305
- };
3306
- },
3307
- ];
3308
- },
3309
- {
3310
- name: 'setFee';
3311
- accounts: [
3312
- {
3313
- name: 'payer';
3314
- isMut: false;
3315
- isSigner: true;
3316
- },
3317
- {
3318
- name: 'config';
3319
- isMut: true;
3320
- isSigner: false;
3321
- },
3322
- ];
3323
- args: [
3324
- {
3325
- name: 'singleUpdateFeeInLamports';
3326
- type: 'u64';
3327
- },
3328
- ];
3329
- },
3330
- {
3331
- name: 'setWormholeAddress';
3332
- accounts: [
3333
- {
3334
- name: 'payer';
3335
- isMut: false;
3336
- isSigner: true;
3337
- },
3338
- {
3339
- name: 'config';
3340
- isMut: true;
3341
- isSigner: false;
3342
- },
3343
- ];
3344
- args: [
3345
- {
3346
- name: 'wormhole';
3347
- type: 'publicKey';
3348
- },
3349
- ];
3350
- },
3351
- {
3352
- name: 'setMinimumSignatures';
3353
- accounts: [
3354
- {
3355
- name: 'payer';
3356
- isMut: false;
3357
- isSigner: true;
3358
- },
3359
- {
3360
- name: 'config';
3361
- isMut: true;
3362
- isSigner: false;
3363
- },
3364
- ];
3365
- args: [
3366
- {
3367
- name: 'minimumSignatures';
3368
- type: 'u8';
3369
- },
3370
- ];
3371
- },
3372
- {
3373
- name: 'postUpdateAtomic';
3374
- docs: [
3375
- 'Post a price update using a VAA and a MerklePriceUpdate.',
3376
- 'This function allows you to post a price update in a single transaction.',
3377
- "Compared to post_update, it is less secure since you won't be able to verify all guardian signatures if you use this function because of transaction size limitations.",
3378
- 'Typically, you can fit 5 guardian signatures in a transaction that uses this.',
3379
- ];
3380
- accounts: [
3381
- {
3382
- name: 'payer';
3383
- isMut: true;
3384
- isSigner: true;
3385
- },
3386
- {
3387
- name: 'guardianSet';
3388
- isMut: false;
3389
- isSigner: false;
3390
- docs: [
3391
- 'Instead we do the same steps in deserialize_guardian_set_checked.',
3392
- ];
3393
- },
3394
- {
3395
- name: 'config';
3396
- isMut: false;
3397
- isSigner: false;
3398
- },
3399
- {
3400
- name: 'treasury';
3401
- isMut: true;
3402
- isSigner: false;
3403
- },
3404
- {
3405
- name: 'priceUpdateAccount';
3406
- isMut: true;
3407
- isSigner: true;
3408
- docs: [
3409
- 'The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.',
3410
- "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",
3411
- ];
3412
- },
3413
- {
3414
- name: 'systemProgram';
3415
- isMut: false;
3416
- isSigner: false;
3417
- },
3418
- {
3419
- name: 'writeAuthority';
3420
- isMut: false;
3421
- isSigner: true;
3422
- },
3423
- ];
3424
- args: [
3425
- {
3426
- name: 'params';
3427
- type: {
3428
- defined: 'PostUpdateAtomicParams';
3429
- };
3430
- },
3431
- ];
3432
- },
3433
- {
3434
- name: 'postUpdate';
3435
- docs: [
3436
- 'Post a price update using an encoded_vaa account and a MerklePriceUpdate calldata.',
3437
- 'This should be called after the client has already verified the Vaa via the Wormhole contract.',
3438
- 'Check out target_chains/solana/cli/src/main.rs for an example of how to do this.',
3439
- ];
3440
- accounts: [
3441
- {
3442
- name: 'payer';
3443
- isMut: true;
3444
- isSigner: true;
3445
- },
3446
- {
3447
- name: 'encodedVaa';
3448
- isMut: false;
3449
- isSigner: false;
3450
- },
3451
- {
3452
- name: 'config';
3453
- isMut: false;
3454
- isSigner: false;
3455
- },
3456
- {
3457
- name: 'treasury';
3458
- isMut: true;
3459
- isSigner: false;
3460
- },
3461
- {
3462
- name: 'priceUpdateAccount';
3463
- isMut: true;
3464
- isSigner: true;
3465
- docs: [
3466
- 'The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.',
3467
- "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",
3468
- ];
3469
- },
3470
- {
3471
- name: 'systemProgram';
3472
- isMut: false;
3473
- isSigner: false;
3474
- },
3475
- {
3476
- name: 'writeAuthority';
3477
- isMut: false;
3478
- isSigner: true;
3479
- },
3480
- ];
3481
- args: [
3482
- {
3483
- name: 'params';
3484
- type: {
3485
- defined: 'PostUpdateParams';
3486
- };
3487
- },
3488
- ];
3489
- },
3490
- {
3491
- name: 'reclaimRent';
3492
- accounts: [
3493
- {
3494
- name: 'payer';
3495
- isMut: true;
3496
- isSigner: true;
3497
- },
3498
- {
3499
- name: 'priceUpdateAccount';
3500
- isMut: true;
3501
- isSigner: false;
3502
- },
3503
- ];
3504
- args: [];
3505
- },
3506
- ];
3507
- accounts: [
3508
- {
3509
- name: 'Config';
3510
- type: {
3511
- kind: 'struct';
3512
- fields: [
3513
- {
3514
- name: 'governanceAuthority';
3515
- type: 'publicKey';
3516
- },
3517
- {
3518
- name: 'targetGovernanceAuthority';
3519
- type: {
3520
- option: 'publicKey';
3521
- };
3522
- },
3523
- {
3524
- name: 'wormhole';
3525
- type: 'publicKey';
3526
- },
3527
- {
3528
- name: 'validDataSources';
3529
- type: {
3530
- vec: {
3531
- defined: 'DataSource';
3532
- };
3533
- };
3534
- },
3535
- {
3536
- name: 'singleUpdateFeeInLamports';
3537
- type: 'u64';
3538
- },
3539
- {
3540
- name: 'minimumSignatures';
3541
- type: 'u8';
3542
- },
3543
- ];
3544
- };
3545
- },
3546
- {
3547
- name: 'priceUpdateV2';
3548
- type: {
3549
- kind: 'struct';
3550
- fields: [
3551
- {
3552
- name: 'writeAuthority';
3553
- type: 'publicKey';
3554
- },
3555
- {
3556
- name: 'verificationLevel';
3557
- type: {
3558
- defined: 'VerificationLevel';
3559
- };
3560
- },
3561
- {
3562
- name: 'priceMessage';
3563
- type: {
3564
- defined: 'PriceFeedMessage';
3565
- };
3566
- },
3567
- {
3568
- name: 'postedSlot';
3569
- type: 'u64';
3570
- },
3571
- ];
3572
- };
3573
- },
3574
- ];
3575
- types: [
3576
- {
3577
- name: 'PriceFeedMessage';
3578
- type: {
3579
- kind: 'struct';
3580
- fields: [
3581
- {
3582
- name: 'feedId';
3583
- type: {
3584
- array: ['u8', 32];
3585
- };
3586
- },
3587
- {
3588
- name: 'price';
3589
- type: 'i64';
3590
- },
3591
- {
3592
- name: 'conf';
3593
- type: 'u64';
3594
- },
3595
- {
3596
- name: 'exponent';
3597
- type: 'i32';
3598
- },
3599
- {
3600
- name: 'publishTime';
3601
- type: 'i64';
3602
- },
3603
- {
3604
- name: 'prevPublishTime';
3605
- type: 'i64';
3606
- },
3607
- {
3608
- name: 'emaPrice';
3609
- type: 'i64';
3610
- },
3611
- {
3612
- name: 'emaConf';
3613
- type: 'u64';
3614
- },
3615
- ];
3616
- };
3617
- },
3618
- {
3619
- name: 'MerklePriceUpdate';
3620
- type: {
3621
- kind: 'struct';
3622
- fields: [
3623
- {
3624
- name: 'message';
3625
- type: 'bytes';
3626
- },
3627
- {
3628
- name: 'proof';
3629
- type: {
3630
- vec: {
3631
- array: ['u8', 20];
3632
- };
3633
- };
3634
- },
3635
- ];
3636
- };
3637
- },
3638
- {
3639
- name: 'DataSource';
3640
- type: {
3641
- kind: 'struct';
3642
- fields: [
3643
- {
3644
- name: 'chain';
3645
- type: 'u16';
3646
- },
3647
- {
3648
- name: 'emitter';
3649
- type: 'publicKey';
3650
- },
3651
- ];
3652
- };
3653
- },
3654
- {
3655
- name: 'PostUpdateAtomicParams';
3656
- type: {
3657
- kind: 'struct';
3658
- fields: [
3659
- {
3660
- name: 'vaa';
3661
- type: 'bytes';
3662
- },
3663
- {
3664
- name: 'merklePriceUpdate';
3665
- type: {
3666
- defined: 'MerklePriceUpdate';
3667
- };
3668
- },
3669
- {
3670
- name: 'treasuryId';
3671
- type: 'u8';
3672
- },
3673
- ];
3674
- };
3675
- },
3676
- {
3677
- name: 'PostUpdateParams';
3678
- type: {
3679
- kind: 'struct';
3680
- fields: [
3681
- {
3682
- name: 'merklePriceUpdate';
3683
- type: {
3684
- defined: 'MerklePriceUpdate';
3685
- };
3686
- },
3687
- {
3688
- name: 'treasuryId';
3689
- type: 'u8';
3690
- },
3691
- ];
3692
- };
3693
- },
3694
- {
3695
- name: 'VerificationLevel';
3696
- docs: [
3697
- '* 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',
3698
- ];
3699
- type: {
3700
- kind: 'enum';
3701
- variants: [
3702
- {
3703
- name: 'Partial';
3704
- fields: [
3705
- {
3706
- name: 'numSignatures';
3707
- type: 'u8';
3708
- },
3709
- ];
3710
- },
3711
- {
3712
- name: 'Full';
3713
- },
3714
- ];
3715
- };
3716
- },
3717
- ];
3718
- errors: [
3719
- {
3720
- code: 6000;
3721
- name: 'InvalidWormholeMessage';
3722
- msg: 'Received an invalid wormhole message';
3723
- },
3724
- {
3725
- code: 6001;
3726
- name: 'DeserializeMessageFailed';
3727
- msg: 'An error occurred when deserializing the message';
3728
- },
3729
- {
3730
- code: 6002;
3731
- name: 'InvalidPriceUpdate';
3732
- msg: 'Received an invalid price update';
3733
- },
3734
- {
3735
- code: 6003;
3736
- name: 'UnsupportedMessageType';
3737
- msg: 'This type of message is not supported currently';
3738
- },
3739
- {
3740
- code: 6004;
3741
- name: 'InvalidDataSource';
3742
- msg: "The tuple emitter chain, emitter doesn't match one of the valid data sources.";
3743
- },
3744
- {
3745
- code: 6005;
3746
- name: 'InsufficientFunds';
3747
- msg: 'Funds are insufficient to pay the receiving fee';
3748
- },
3749
- {
3750
- code: 6006;
3751
- name: 'WrongWriteAuthority';
3752
- msg: "This signer can't write to price update account";
3753
- },
3754
- {
3755
- code: 6007;
3756
- name: 'WrongVaaOwner';
3757
- msg: 'The posted VAA account has the wrong owner.';
3758
- },
3759
- {
3760
- code: 6008;
3761
- name: 'DeserializeVaaFailed';
3762
- msg: 'An error occurred when deserializing the VAA.';
3763
- },
3764
- {
3765
- code: 6009;
3766
- name: 'InsufficientGuardianSignatures';
3767
- msg: 'The number of guardian signatures is below the minimum';
3768
- },
3769
- {
3770
- code: 6010;
3771
- name: 'InvalidVaaVersion';
3772
- msg: 'Invalid VAA version';
3773
- },
3774
- {
3775
- code: 6011;
3776
- name: 'GuardianSetMismatch';
3777
- msg: "Guardian set version in the VAA doesn't match the guardian set passed";
3778
- },
3779
- {
3780
- code: 6012;
3781
- name: 'InvalidGuardianOrder';
3782
- msg: 'Guardian signature indices must be increasing';
3783
- },
3784
- {
3785
- code: 6013;
3786
- name: 'InvalidGuardianIndex';
3787
- msg: 'Guardian index exceeds the number of guardians in the set';
3788
- },
3789
- {
3790
- code: 6014;
3791
- name: 'InvalidSignature';
3792
- msg: 'A VAA signature is invalid';
3793
- },
3794
- {
3795
- code: 6015;
3796
- name: 'InvalidGuardianKeyRecovery';
3797
- msg: "The recovered guardian public key doesn't match the guardian set";
3798
- },
3799
- {
3800
- code: 6016;
3801
- name: 'WrongGuardianSetOwner';
3802
- msg: 'The guardian set account is owned by the wrong program';
3803
- },
3804
- {
3805
- code: 6017;
3806
- name: 'InvalidGuardianSetPda';
3807
- msg: "The Guardian Set account doesn't match the PDA derivation";
3808
- },
3809
- {
3810
- code: 6018;
3811
- name: 'GuardianSetExpired';
3812
- msg: 'The Guardian Set is expired';
3813
- },
3814
- {
3815
- code: 6019;
3816
- name: 'GovernanceAuthorityMismatch';
3817
- msg: 'The signer is not authorized to perform this governance action';
3818
- },
3819
- {
3820
- code: 6020;
3821
- name: 'TargetGovernanceAuthorityMismatch';
3822
- msg: 'The signer is not authorized to accept the governance authority';
3823
- },
3824
- {
3825
- code: 6021;
3826
- name: 'NonexistentGovernanceAuthorityTransferRequest';
3827
- msg: 'The governance authority needs to request a transfer first';
3828
- },
3829
- ];
3830
- };
3831
-
3832
- export const IDL: PythSolanaReceiver = {
3833
- version: '0.1.0',
3834
- name: 'pyth_solana_receiver',
3835
- instructions: [
3836
- {
3837
- name: 'initialize',
3838
- accounts: [
3839
- {
3840
- name: 'payer',
3841
- isMut: true,
3842
- isSigner: true,
3843
- },
3844
- {
3845
- name: 'config',
3846
- isMut: true,
3847
- isSigner: false,
3848
- },
3849
- {
3850
- name: 'systemProgram',
3851
- isMut: false,
3852
- isSigner: false,
3853
- },
3854
- ],
3855
- args: [
3856
- {
3857
- name: 'initialConfig',
3858
- type: {
3859
- defined: 'Config',
3860
- },
3861
- },
3862
- ],
3863
- },
3864
- {
3865
- name: 'requestGovernanceAuthorityTransfer',
3866
- accounts: [
3867
- {
3868
- name: 'payer',
3869
- isMut: false,
3870
- isSigner: true,
3871
- },
3872
- {
3873
- name: 'config',
3874
- isMut: true,
3875
- isSigner: false,
3876
- },
3877
- ],
3878
- args: [
3879
- {
3880
- name: 'targetGovernanceAuthority',
3881
- type: 'publicKey',
3882
- },
3883
- ],
3884
- },
3885
- {
3886
- name: 'acceptGovernanceAuthorityTransfer',
3887
- accounts: [
3888
- {
3889
- name: 'payer',
3890
- isMut: false,
3891
- isSigner: true,
3892
- },
3893
- {
3894
- name: 'config',
3895
- isMut: true,
3896
- isSigner: false,
3897
- },
3898
- ],
3899
- args: [],
3900
- },
3901
- {
3902
- name: 'setDataSources',
3903
- accounts: [
3904
- {
3905
- name: 'payer',
3906
- isMut: false,
3907
- isSigner: true,
3908
- },
3909
- {
3910
- name: 'config',
3911
- isMut: true,
3912
- isSigner: false,
3913
- },
3914
- ],
3915
- args: [
3916
- {
3917
- name: 'validDataSources',
3918
- type: {
3919
- vec: {
3920
- defined: 'DataSource',
3921
- },
3922
- },
3923
- },
3924
- ],
3925
- },
3926
- {
3927
- name: 'setFee',
3928
- accounts: [
3929
- {
3930
- name: 'payer',
3931
- isMut: false,
3932
- isSigner: true,
3933
- },
3934
- {
3935
- name: 'config',
3936
- isMut: true,
3937
- isSigner: false,
3938
- },
3939
- ],
3940
- args: [
3941
- {
3942
- name: 'singleUpdateFeeInLamports',
3943
- type: 'u64',
3944
- },
3945
- ],
3946
- },
3947
- {
3948
- name: 'setWormholeAddress',
3949
- accounts: [
3950
- {
3951
- name: 'payer',
3952
- isMut: false,
3953
- isSigner: true,
3954
- },
3955
- {
3956
- name: 'config',
3957
- isMut: true,
3958
- isSigner: false,
3959
- },
3960
- ],
3961
- args: [
3962
- {
3963
- name: 'wormhole',
3964
- type: 'publicKey',
3965
- },
3966
- ],
3967
- },
3968
- {
3969
- name: 'setMinimumSignatures',
3970
- accounts: [
3971
- {
3972
- name: 'payer',
3973
- isMut: false,
3974
- isSigner: true,
3975
- },
3976
- {
3977
- name: 'config',
3978
- isMut: true,
3979
- isSigner: false,
3980
- },
3981
- ],
3982
- args: [
3983
- {
3984
- name: 'minimumSignatures',
3985
- type: 'u8',
3986
- },
3987
- ],
3988
- },
3989
- {
3990
- name: 'postUpdateAtomic',
3991
- docs: [
3992
- 'Post a price update using a VAA and a MerklePriceUpdate.',
3993
- 'This function allows you to post a price update in a single transaction.',
3994
- "Compared to post_update, it is less secure since you won't be able to verify all guardian signatures if you use this function because of transaction size limitations.",
3995
- 'Typically, you can fit 5 guardian signatures in a transaction that uses this.',
3996
- ],
3997
- accounts: [
3998
- {
3999
- name: 'payer',
4000
- isMut: true,
4001
- isSigner: true,
4002
- },
4003
- {
4004
- name: 'guardianSet',
4005
- isMut: false,
4006
- isSigner: false,
4007
- docs: [
4008
- 'Instead we do the same steps in deserialize_guardian_set_checked.',
4009
- ],
4010
- },
4011
- {
4012
- name: 'config',
4013
- isMut: false,
4014
- isSigner: false,
4015
- },
4016
- {
4017
- name: 'treasury',
4018
- isMut: true,
4019
- isSigner: false,
4020
- },
4021
- {
4022
- name: 'priceUpdateAccount',
4023
- isMut: true,
4024
- isSigner: true,
4025
- docs: [
4026
- 'The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.',
4027
- "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",
4028
- ],
4029
- },
4030
- {
4031
- name: 'systemProgram',
4032
- isMut: false,
4033
- isSigner: false,
4034
- },
4035
- {
4036
- name: 'writeAuthority',
4037
- isMut: false,
4038
- isSigner: true,
4039
- },
4040
- ],
4041
- args: [
4042
- {
4043
- name: 'params',
4044
- type: {
4045
- defined: 'PostUpdateAtomicParams',
4046
- },
4047
- },
4048
- ],
4049
- },
4050
- {
4051
- name: 'postUpdate',
4052
- docs: [
4053
- 'Post a price update using an encoded_vaa account and a MerklePriceUpdate calldata.',
4054
- 'This should be called after the client has already verified the Vaa via the Wormhole contract.',
4055
- 'Check out target_chains/solana/cli/src/main.rs for an example of how to do this.',
4056
- ],
4057
- accounts: [
4058
- {
4059
- name: 'payer',
4060
- isMut: true,
4061
- isSigner: true,
4062
- },
4063
- {
4064
- name: 'encodedVaa',
4065
- isMut: false,
4066
- isSigner: false,
4067
- },
4068
- {
4069
- name: 'config',
4070
- isMut: false,
4071
- isSigner: false,
4072
- },
4073
- {
4074
- name: 'treasury',
4075
- isMut: true,
4076
- isSigner: false,
4077
- },
4078
- {
4079
- name: 'priceUpdateAccount',
4080
- isMut: true,
4081
- isSigner: true,
4082
- docs: [
4083
- 'The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.',
4084
- "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",
4085
- ],
4086
- },
4087
- {
4088
- name: 'systemProgram',
4089
- isMut: false,
4090
- isSigner: false,
4091
- },
4092
- {
4093
- name: 'writeAuthority',
4094
- isMut: false,
4095
- isSigner: true,
4096
- },
4097
- ],
4098
- args: [
4099
- {
4100
- name: 'params',
4101
- type: {
4102
- defined: 'PostUpdateParams',
4103
- },
4104
- },
4105
- ],
4106
- },
4107
- {
4108
- name: 'reclaimRent',
4109
- accounts: [
4110
- {
4111
- name: 'payer',
4112
- isMut: true,
4113
- isSigner: true,
4114
- },
4115
- {
4116
- name: 'priceUpdateAccount',
4117
- isMut: true,
4118
- isSigner: false,
4119
- },
4120
- ],
4121
- args: [],
4122
- },
4123
- ],
4124
- accounts: [
4125
- {
4126
- name: 'Config',
4127
- type: {
4128
- kind: 'struct',
4129
- fields: [
4130
- {
4131
- name: 'governanceAuthority',
4132
- type: 'publicKey',
4133
- },
4134
- {
4135
- name: 'targetGovernanceAuthority',
4136
- type: {
4137
- option: 'publicKey',
4138
- },
4139
- },
4140
- {
4141
- name: 'wormhole',
4142
- type: 'publicKey',
4143
- },
4144
- {
4145
- name: 'validDataSources',
4146
- type: {
4147
- vec: {
4148
- defined: 'DataSource',
4149
- },
4150
- },
4151
- },
4152
- {
4153
- name: 'singleUpdateFeeInLamports',
4154
- type: 'u64',
4155
- },
4156
- {
4157
- name: 'minimumSignatures',
4158
- type: 'u8',
4159
- },
4160
- ],
4161
- },
4162
- },
4163
- {
4164
- name: 'priceUpdateV2',
4165
- type: {
4166
- kind: 'struct',
4167
- fields: [
4168
- {
4169
- name: 'writeAuthority',
4170
- type: 'publicKey',
4171
- },
4172
- {
4173
- name: 'verificationLevel',
4174
- type: {
4175
- defined: 'VerificationLevel',
4176
- },
4177
- },
4178
- {
4179
- name: 'priceMessage',
4180
- type: {
4181
- defined: 'PriceFeedMessage',
4182
- },
4183
- },
4184
- {
4185
- name: 'postedSlot',
4186
- type: 'u64',
4187
- },
4188
- ],
4189
- },
4190
- },
4191
- ],
4192
- types: [
4193
- {
4194
- name: 'PriceFeedMessage',
4195
- type: {
4196
- kind: 'struct',
4197
- fields: [
4198
- {
4199
- name: 'feedId',
4200
- type: {
4201
- array: ['u8', 32],
4202
- },
4203
- },
4204
- {
4205
- name: 'price',
4206
- type: 'i64',
4207
- },
4208
- {
4209
- name: 'conf',
4210
- type: 'u64',
4211
- },
4212
- {
4213
- name: 'exponent',
4214
- type: 'i32',
4215
- },
4216
- {
4217
- name: 'publishTime',
4218
- type: 'i64',
4219
- },
4220
- {
4221
- name: 'prevPublishTime',
4222
- type: 'i64',
4223
- },
4224
- {
4225
- name: 'emaPrice',
4226
- type: 'i64',
4227
- },
4228
- {
4229
- name: 'emaConf',
4230
- type: 'u64',
4231
- },
4232
- ],
4233
- },
4234
- },
4235
- {
4236
- name: 'MerklePriceUpdate',
4237
- type: {
4238
- kind: 'struct',
4239
- fields: [
4240
- {
4241
- name: 'message',
4242
- type: 'bytes',
4243
- },
4244
- {
4245
- name: 'proof',
4246
- type: {
4247
- vec: {
4248
- array: ['u8', 20],
4249
- },
4250
- },
4251
- },
4252
- ],
4253
- },
4254
- },
4255
- {
4256
- name: 'DataSource',
4257
- type: {
4258
- kind: 'struct',
4259
- fields: [
4260
- {
4261
- name: 'chain',
4262
- type: 'u16',
4263
- },
4264
- {
4265
- name: 'emitter',
4266
- type: 'publicKey',
4267
- },
4268
- ],
4269
- },
4270
- },
4271
- {
4272
- name: 'PostUpdateAtomicParams',
4273
- type: {
4274
- kind: 'struct',
4275
- fields: [
4276
- {
4277
- name: 'vaa',
4278
- type: 'bytes',
4279
- },
4280
- {
4281
- name: 'merklePriceUpdate',
4282
- type: {
4283
- defined: 'MerklePriceUpdate',
4284
- },
4285
- },
4286
- {
4287
- name: 'treasuryId',
4288
- type: 'u8',
4289
- },
4290
- ],
4291
- },
4292
- },
4293
- {
4294
- name: 'PostUpdateParams',
4295
- type: {
4296
- kind: 'struct',
4297
- fields: [
4298
- {
4299
- name: 'merklePriceUpdate',
4300
- type: {
4301
- defined: 'MerklePriceUpdate',
4302
- },
4303
- },
4304
- {
4305
- name: 'treasuryId',
4306
- type: 'u8',
4307
- },
4308
- ],
4309
- },
4310
- },
4311
- {
4312
- name: 'VerificationLevel',
4313
- docs: [
4314
- '* 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',
4315
- ],
4316
- type: {
4317
- kind: 'enum',
4318
- variants: [
4319
- {
4320
- name: 'Partial',
4321
- fields: [
4322
- {
4323
- name: 'numSignatures',
4324
- type: 'u8',
4325
- },
4326
- ],
4327
- },
4328
- {
4329
- name: 'Full',
4330
- },
4331
- ],
4332
- },
4333
- },
4334
- ],
4335
- errors: [
4336
- {
4337
- code: 6000,
4338
- name: 'InvalidWormholeMessage',
4339
- msg: 'Received an invalid wormhole message',
4340
- },
4341
- {
4342
- code: 6001,
4343
- name: 'DeserializeMessageFailed',
4344
- msg: 'An error occurred when deserializing the message',
4345
- },
4346
- {
4347
- code: 6002,
4348
- name: 'InvalidPriceUpdate',
4349
- msg: 'Received an invalid price update',
4350
- },
4351
- {
4352
- code: 6003,
4353
- name: 'UnsupportedMessageType',
4354
- msg: 'This type of message is not supported currently',
4355
- },
4356
- {
4357
- code: 6004,
4358
- name: 'InvalidDataSource',
4359
- msg: "The tuple emitter chain, emitter doesn't match one of the valid data sources.",
4360
- },
4361
- {
4362
- code: 6005,
4363
- name: 'InsufficientFunds',
4364
- msg: 'Funds are insufficient to pay the receiving fee',
4365
- },
4366
- {
4367
- code: 6006,
4368
- name: 'WrongWriteAuthority',
4369
- msg: "This signer can't write to price update account",
4370
- },
4371
- {
4372
- code: 6007,
4373
- name: 'WrongVaaOwner',
4374
- msg: 'The posted VAA account has the wrong owner.',
4375
- },
4376
- {
4377
- code: 6008,
4378
- name: 'DeserializeVaaFailed',
4379
- msg: 'An error occurred when deserializing the VAA.',
4380
- },
4381
- {
4382
- code: 6009,
4383
- name: 'InsufficientGuardianSignatures',
4384
- msg: 'The number of guardian signatures is below the minimum',
4385
- },
4386
- {
4387
- code: 6010,
4388
- name: 'InvalidVaaVersion',
4389
- msg: 'Invalid VAA version',
4390
- },
4391
- {
4392
- code: 6011,
4393
- name: 'GuardianSetMismatch',
4394
- msg: "Guardian set version in the VAA doesn't match the guardian set passed",
4395
- },
4396
- {
4397
- code: 6012,
4398
- name: 'InvalidGuardianOrder',
4399
- msg: 'Guardian signature indices must be increasing',
4400
- },
4401
- {
4402
- code: 6013,
4403
- name: 'InvalidGuardianIndex',
4404
- msg: 'Guardian index exceeds the number of guardians in the set',
4405
- },
4406
- {
4407
- code: 6014,
4408
- name: 'InvalidSignature',
4409
- msg: 'A VAA signature is invalid',
4410
- },
4411
- {
4412
- code: 6015,
4413
- name: 'InvalidGuardianKeyRecovery',
4414
- msg: "The recovered guardian public key doesn't match the guardian set",
4415
- },
4416
- {
4417
- code: 6016,
4418
- name: 'WrongGuardianSetOwner',
4419
- msg: 'The guardian set account is owned by the wrong program',
4420
- },
4421
- {
4422
- code: 6017,
4423
- name: 'InvalidGuardianSetPda',
4424
- msg: "The Guardian Set account doesn't match the PDA derivation",
4425
- },
4426
- {
4427
- code: 6018,
4428
- name: 'GuardianSetExpired',
4429
- msg: 'The Guardian Set is expired',
4430
- },
4431
- {
4432
- code: 6019,
4433
- name: 'GovernanceAuthorityMismatch',
4434
- msg: 'The signer is not authorized to perform this governance action',
4435
- },
4436
- {
4437
- code: 6020,
4438
- name: 'TargetGovernanceAuthorityMismatch',
4439
- msg: 'The signer is not authorized to accept the governance authority',
4440
- },
4441
- {
4442
- code: 6021,
4443
- name: 'NonexistentGovernanceAuthorityTransferRequest',
4444
- msg: 'The governance authority needs to request a transfer first',
4445
- },
4446
- ],
4447
- };
4448
- //# sourceMappingURL=pyth_solana_receiver.d.ts.map
4449
-
4450
- export type PriceUpdateAccount =
4451
- IdlAccounts<PythSolanaReceiver>['priceUpdateV2'];