@@ -10,10 +10,8 @@ import {
10
10
import {
11
11
envOrErr ,
12
12
getMultisigCluster ,
13
- isRemoteCluster ,
13
+ MultisigVault ,
14
14
PRICE_FEED_MULTISIG ,
15
- proposeInstructions ,
16
- WORMHOLE_ADDRESS ,
17
15
} from "xc_admin_common" ;
18
16
import * as fs from "fs" ;
19
17
import { getPythClusterApiUrl , PythCluster } from "@pythnetwork/client" ;
@@ -65,19 +63,24 @@ app.post("/api/propose", async (req: Request, res: Response) => {
65
63
66
64
const cluster : PythCluster = req . body . cluster ;
67
65
66
+ const wallet = new NodeWallet ( KEYPAIR ) ;
68
67
const proposeSquads : SquadsMesh = new SquadsMesh ( {
69
68
connection : new Connection ( RPC_URLS [ getMultisigCluster ( cluster ) ] ) ,
70
- wallet : new NodeWallet ( KEYPAIR ) ,
69
+ wallet,
71
70
} ) ;
72
71
73
- const proposalPubkey = await proposeInstructions (
72
+ const vault = new MultisigVault (
73
+ wallet ,
74
+ getMultisigCluster ( cluster ) ,
74
75
proposeSquads ,
75
- PRICE_FEED_MULTISIG [ getMultisigCluster ( cluster ) ] ,
76
- instructions ,
77
- isRemoteCluster ( cluster ) ,
78
- WORMHOLE_ADDRESS [ getMultisigCluster ( cluster ) ]
76
+ PRICE_FEED_MULTISIG [ getMultisigCluster ( cluster ) ]
79
77
) ;
80
- res . status ( 200 ) . json ( { proposalPubkey } ) ;
78
+
79
+ // preserve the existing API by returning only the first pubkey
80
+ const proposalPubkey = (
81
+ await vault . proposeInstructions ( instructions , cluster )
82
+ ) [ 0 ] ;
83
+ res . status ( 200 ) . json ( { proposalPubkey : proposalPubkey } ) ;
81
84
} catch ( error ) {
82
85
if ( error instanceof Error ) {
83
86
res . status ( 500 ) . json ( error . message ) ;
0 commit comments