Skip to content

Commit 20a99c6

Browse files
committed
fix error
1 parent 405c42a commit 20a99c6

File tree

2 files changed

+275
-4
lines changed

2 files changed

+275
-4
lines changed

governance/xc_admin/packages/xc_admin_common/src/multisig_transaction/LazerMultisigInstruction.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
import { AnchorAccounts, resolveAccountNames } from "./anchor";
77
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
88
import { Idl, BorshInstructionCoder } from "@coral-xyz/anchor";
9-
import * as pythLazerSolanaContractIdl from "../../../../../../lazer/contracts/solana/target/idl/pyth_lazer_solana_contract.json";
9+
import lazerIdl from "./idl/lazer.json";
1010

1111
export const LAZER_PROGRAM_ID = new PublicKey(
1212
"pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt"
@@ -33,9 +33,9 @@ export class LazerMultisigInstruction implements MultisigInstruction {
3333
): LazerMultisigInstruction {
3434
// TODO: This is a hack to transform the IDL to be compatible with the anchor version we are using, we can't upgrade anchor to 0.30.1 because then the existing idls will break
3535
const idl = {
36-
version: pythLazerSolanaContractIdl.metadata.version,
37-
name: pythLazerSolanaContractIdl.metadata.name,
38-
instructions: pythLazerSolanaContractIdl.instructions.map((ix) => ({
36+
version: lazerIdl.metadata.version,
37+
name: lazerIdl.metadata.name,
38+
instructions: lazerIdl.instructions.map((ix) => ({
3939
...ix,
4040
accounts: ix.accounts.map((acc) => ({
4141
name: acc.name,
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
{
2+
"address": "",
3+
"metadata": {
4+
"name": "pyth_lazer_solana_contract",
5+
"version": "0.2.0",
6+
"spec": "0.1.0",
7+
"description": "Pyth Lazer Solana contract and SDK.",
8+
"repository": "https://github.com/pyth-network/pyth-crosschain"
9+
},
10+
"instructions": [
11+
{
12+
"name": "initialize",
13+
"discriminator": [175, 175, 109, 31, 13, 152, 155, 237],
14+
"accounts": [
15+
{
16+
"name": "payer",
17+
"writable": true,
18+
"signer": true
19+
},
20+
{
21+
"name": "storage",
22+
"writable": true,
23+
"pda": {
24+
"seeds": [
25+
{
26+
"kind": "const",
27+
"value": [115, 116, 111, 114, 97, 103, 101]
28+
}
29+
]
30+
}
31+
},
32+
{
33+
"name": "system_program",
34+
"address": "11111111111111111111111111111111"
35+
}
36+
],
37+
"args": [
38+
{
39+
"name": "top_authority",
40+
"type": "pubkey"
41+
},
42+
{
43+
"name": "treasury",
44+
"type": "pubkey"
45+
}
46+
]
47+
},
48+
{
49+
"name": "migrate_from_0_1_0",
50+
"discriminator": [25, 185, 91, 207, 130, 36, 0, 255],
51+
"accounts": [
52+
{
53+
"name": "top_authority",
54+
"signer": true
55+
},
56+
{
57+
"name": "storage",
58+
"writable": true,
59+
"pda": {
60+
"seeds": [
61+
{
62+
"kind": "const",
63+
"value": [115, 116, 111, 114, 97, 103, 101]
64+
}
65+
]
66+
}
67+
},
68+
{
69+
"name": "system_program",
70+
"address": "11111111111111111111111111111111"
71+
}
72+
],
73+
"args": [
74+
{
75+
"name": "treasury",
76+
"type": "pubkey"
77+
}
78+
]
79+
},
80+
{
81+
"name": "update",
82+
"discriminator": [219, 200, 88, 176, 158, 63, 253, 127],
83+
"accounts": [
84+
{
85+
"name": "top_authority",
86+
"signer": true,
87+
"relations": ["storage"]
88+
},
89+
{
90+
"name": "storage",
91+
"writable": true,
92+
"pda": {
93+
"seeds": [
94+
{
95+
"kind": "const",
96+
"value": [115, 116, 111, 114, 97, 103, 101]
97+
}
98+
]
99+
}
100+
}
101+
],
102+
"args": [
103+
{
104+
"name": "trusted_signer",
105+
"type": "pubkey"
106+
},
107+
{
108+
"name": "expires_at",
109+
"type": "i64"
110+
}
111+
]
112+
},
113+
{
114+
"name": "verify_message",
115+
"docs": [
116+
"Verifies a ed25519 signature on Solana by checking that the transaction contains",
117+
"a correct call to the built-in `ed25519_program`.",
118+
"",
119+
"- `message_data` is the signed message that is being verified.",
120+
"- `ed25519_instruction_index` is the index of the `ed25519_program` instruction",
121+
"within the transaction. This instruction must precede the current instruction.",
122+
"- `signature_index` is the index of the signature within the inputs to the `ed25519_program`.",
123+
"- `message_offset` is the offset of the signed message within the",
124+
"input data for the current instruction."
125+
],
126+
"discriminator": [180, 193, 120, 55, 189, 135, 203, 83],
127+
"accounts": [
128+
{
129+
"name": "payer",
130+
"writable": true,
131+
"signer": true
132+
},
133+
{
134+
"name": "storage",
135+
"pda": {
136+
"seeds": [
137+
{
138+
"kind": "const",
139+
"value": [115, 116, 111, 114, 97, 103, 101]
140+
}
141+
]
142+
}
143+
},
144+
{
145+
"name": "treasury",
146+
"relations": ["storage"]
147+
},
148+
{
149+
"name": "system_program",
150+
"address": "11111111111111111111111111111111"
151+
},
152+
{
153+
"name": "instructions_sysvar",
154+
"docs": [
155+
"(e.g. in `sysvar::instructions::load_instruction_at_checked`).",
156+
"This account is not usable with anchor's `Program` account type because it's not executable."
157+
]
158+
}
159+
],
160+
"args": [
161+
{
162+
"name": "message_data",
163+
"type": "bytes"
164+
},
165+
{
166+
"name": "ed25519_instruction_index",
167+
"type": "u16"
168+
},
169+
{
170+
"name": "signature_index",
171+
"type": "u8"
172+
},
173+
{
174+
"name": "message_offset",
175+
"type": "u16"
176+
}
177+
],
178+
"returns": {
179+
"defined": {
180+
"name": "VerifiedMessage"
181+
}
182+
}
183+
}
184+
],
185+
"accounts": [
186+
{
187+
"name": "Storage",
188+
"discriminator": [209, 117, 255, 185, 196, 175, 68, 9]
189+
}
190+
],
191+
"types": [
192+
{
193+
"name": "Storage",
194+
"type": {
195+
"kind": "struct",
196+
"fields": [
197+
{
198+
"name": "top_authority",
199+
"type": "pubkey"
200+
},
201+
{
202+
"name": "treasury",
203+
"type": "pubkey"
204+
},
205+
{
206+
"name": "single_update_fee_in_lamports",
207+
"type": "u64"
208+
},
209+
{
210+
"name": "num_trusted_signers",
211+
"type": "u8"
212+
},
213+
{
214+
"name": "trusted_signers",
215+
"type": {
216+
"array": [
217+
{
218+
"defined": {
219+
"name": "TrustedSignerInfo"
220+
}
221+
},
222+
5
223+
]
224+
}
225+
},
226+
{
227+
"name": "_extra_space",
228+
"type": {
229+
"array": ["u8", 100]
230+
}
231+
}
232+
]
233+
}
234+
},
235+
{
236+
"name": "TrustedSignerInfo",
237+
"type": {
238+
"kind": "struct",
239+
"fields": [
240+
{
241+
"name": "pubkey",
242+
"type": "pubkey"
243+
},
244+
{
245+
"name": "expires_at",
246+
"type": "i64"
247+
}
248+
]
249+
}
250+
},
251+
{
252+
"name": "VerifiedMessage",
253+
"docs": ["A message with a verified ed25519 signature."],
254+
"type": {
255+
"kind": "struct",
256+
"fields": [
257+
{
258+
"name": "public_key",
259+
"docs": ["Public key that signed the message."],
260+
"type": "pubkey"
261+
},
262+
{
263+
"name": "payload",
264+
"docs": ["Signed message payload."],
265+
"type": "bytes"
266+
}
267+
]
268+
}
269+
}
270+
]
271+
}

0 commit comments

Comments
 (0)