@@ -10,10 +10,8 @@ import {
1010import {
1111 envOrErr ,
1212 getMultisigCluster ,
13- isRemoteCluster ,
13+ MultisigVault ,
1414 PRICE_FEED_MULTISIG ,
15- proposeInstructions ,
16- WORMHOLE_ADDRESS ,
1715} from "xc_admin_common" ;
1816import * as fs from "fs" ;
1917import { getPythClusterApiUrl , PythCluster } from "@pythnetwork/client" ;
@@ -65,19 +63,24 @@ app.post("/api/propose", async (req: Request, res: Response) => {
6563
6664 const cluster : PythCluster = req . body . cluster ;
6765
66+ const wallet = new NodeWallet ( KEYPAIR ) ;
6867 const proposeSquads : SquadsMesh = new SquadsMesh ( {
6968 connection : new Connection ( RPC_URLS [ getMultisigCluster ( cluster ) ] ) ,
70- wallet : new NodeWallet ( KEYPAIR ) ,
69+ wallet,
7170 } ) ;
7271
73- const proposalPubkey = await proposeInstructions (
72+ const vault = new MultisigVault (
73+ wallet ,
74+ getMultisigCluster ( cluster ) ,
7475 proposeSquads ,
75- PRICE_FEED_MULTISIG [ getMultisigCluster ( cluster ) ] ,
76- instructions ,
77- isRemoteCluster ( cluster ) ,
78- WORMHOLE_ADDRESS [ getMultisigCluster ( cluster ) ]
76+ PRICE_FEED_MULTISIG [ getMultisigCluster ( cluster ) ]
7977 ) ;
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 } ) ;
8184 } catch ( error ) {
8285 if ( error instanceof Error ) {
8386 res . status ( 500 ) . json ( error . message ) ;
0 commit comments