-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathescrow.ts
38 lines (31 loc) · 879 Bytes
/
escrow.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import {
Keypair,
Connection,
LAMPORTS_PER_SOL,
PublicKey,
TransactionMessage,
clusterApiUrl
} from "@solana/web3.js"
import * as multisig from "@sqds/multisig"
import { createLogger } from "vite"
async function main() {
// create new multisig wallet with squads
const creator = await generateFundedKeypair(createLocalhostConnection())
const createKey = Keypair.generate()
const [multisigPda] = multisig.getMultisigPda({
createKey: createKey.publicKey
})
}
await main()
export function createLocalhostConnection() {
return new Connection(clusterApiUrl("devnet"), "confirmed")
}
export async function generateFundedKeypair(connection: Connection) {
const keypair = Keypair.generate()
const tx = await connection.requestAirdrop(
keypair.publicKey,
1 * LAMPORTS_PER_SOL
)
await connection.confirmTransaction(tx)
return keypair
}