@@ -12,7 +12,7 @@ import {
12
12
PublicKey ,
13
13
SystemProgram ,
14
14
} from "@solana/web3.js" ;
15
- import Squads from "@sqds/sdk " ;
15
+ import Squads from "@sqds/mesh " ;
16
16
import bs58 from "bs58" ;
17
17
import { program } from "commander" ;
18
18
import * as fs from "fs" ;
@@ -180,11 +180,11 @@ async function createMultisigTx(
180
180
) ;
181
181
console . log ( `Loaded wallet with address: ${ wallet . publicKey . toBase58 ( ) } ` ) ;
182
182
}
183
- const squads =
183
+ const squad =
184
184
cluster === "devnet" ? Squads . devnet ( wallet ) : Squads . mainnet ( wallet ) ;
185
- const msAccount = await squads . getMultisig ( vault ) ;
185
+ const msAccount = await squad . getMultisig ( vault ) ;
186
186
187
- const emitter = squads . getAuthorityPDA (
187
+ const emitter = squad . getAuthorityPDA (
188
188
msAccount . publicKey ,
189
189
msAccount . authorityIndex
190
190
) ;
@@ -193,7 +193,7 @@ async function createMultisigTx(
193
193
console . log ( "Creating new transaction..." ) ;
194
194
if ( ledger )
195
195
console . log ( "Please approve the transaction on your ledger device..." ) ;
196
- const newTx = await squads . createTransaction (
196
+ const newTx = await squad . createTransaction (
197
197
msAccount . publicKey ,
198
198
msAccount . authorityIndex
199
199
) ;
@@ -210,7 +210,7 @@ async function createMultisigTx(
210
210
emitter ,
211
211
emitter ,
212
212
message . publicKey ,
213
- squads . connection ,
213
+ squad . connection ,
214
214
payload
215
215
) ;
216
216
console . log ( "Wormhole instructions created." ) ;
@@ -219,17 +219,17 @@ async function createMultisigTx(
219
219
if ( ledger )
220
220
console . log ( "Please approve the transaction on your ledger device..." ) ;
221
221
// transfer sol to the message account
222
- await squads . addInstruction ( newTx . publicKey , wormholeIxs [ 0 ] ) ;
222
+ await squad . addInstruction ( newTx . publicKey , wormholeIxs [ 0 ] ) ;
223
223
console . log ( "Adding instruction 2/2 to transaction..." ) ;
224
224
if ( ledger )
225
225
console . log ( "Please approve the transaction on your ledger device..." ) ;
226
226
// wormhole post message ix
227
- await squads . addInstruction ( newTx . publicKey , wormholeIxs [ 1 ] ) ;
227
+ await squad . addInstruction ( newTx . publicKey , wormholeIxs [ 1 ] ) ;
228
228
229
229
console . log ( "Activating transaction..." ) ;
230
230
if ( ledger )
231
231
console . log ( "Please approve the transaction on your ledger device..." ) ;
232
- await squads . activateTransaction ( newTx . publicKey ) ;
232
+ await squad . activateTransaction ( newTx . publicKey ) ;
233
233
console . log ( "Transaction created." ) ;
234
234
}
235
235
@@ -268,16 +268,16 @@ async function executeMultisigTx(
268
268
`Loaded message account with address: ${ message . publicKey . toBase58 ( ) } `
269
269
) ;
270
270
271
- const squads =
271
+ const squad =
272
272
cluster === "devnet" ? Squads . devnet ( wallet ) : Squads . mainnet ( wallet ) ;
273
- const msAccount = await squads . getMultisig ( vault ) ;
273
+ const msAccount = await squad . getMultisig ( vault ) ;
274
274
275
- const emitter = squads . getAuthorityPDA (
275
+ const emitter = squad . getAuthorityPDA (
276
276
msAccount . publicKey ,
277
277
msAccount . authorityIndex
278
278
) ;
279
279
280
- const executeIx = await squads . buildExecuteTransaction (
280
+ const executeIx = await squad . buildExecuteTransaction (
281
281
txPDA ,
282
282
wallet . publicKey
283
283
) ;
@@ -290,13 +290,13 @@ async function executeMultisigTx(
290
290
// airdrop 0.1 SOL to emitter if on devnet
291
291
if ( cluster === "devnet" ) {
292
292
console . log ( "Airdropping 0.1 SOL to emitter..." ) ;
293
- const airdropSignature = await squads . connection . requestAirdrop (
293
+ const airdropSignature = await squad . connection . requestAirdrop (
294
294
emitter ,
295
295
0.1 * LAMPORTS_PER_SOL
296
296
) ;
297
297
const { blockhash, lastValidBlockHeight } =
298
- await squads . connection . getLatestBlockhash ( ) ;
299
- await squads . connection . confirmTransaction ( {
298
+ await squad . connection . getLatestBlockhash ( ) ;
299
+ await squad . connection . confirmTransaction ( {
300
300
blockhash,
301
301
lastValidBlockHeight,
302
302
signature : airdropSignature ,
@@ -305,13 +305,13 @@ async function executeMultisigTx(
305
305
}
306
306
307
307
const { blockhash, lastValidBlockHeight } =
308
- await squads . connection . getLatestBlockhash ( ) ;
308
+ await squad . connection . getLatestBlockhash ( ) ;
309
309
const executeTx = new anchor . web3 . Transaction ( {
310
310
blockhash,
311
311
lastValidBlockHeight,
312
312
feePayer : wallet . publicKey ,
313
313
} ) ;
314
- const provider = new anchor . AnchorProvider ( squads . connection , wallet , {
314
+ const provider = new anchor . AnchorProvider ( squad . connection , wallet , {
315
315
commitment : "confirmed" ,
316
316
preflightCommitment : "confirmed" ,
317
317
} ) ;
@@ -328,7 +328,7 @@ async function executeMultisigTx(
328
328
} `
329
329
) ;
330
330
331
- const txDetails = await squads . connection . getParsedTransaction (
331
+ const txDetails = await squad . connection . getParsedTransaction (
332
332
signature ,
333
333
"confirmed"
334
334
) ;
0 commit comments