From 57b54c477458b7da20f6ea3da8ef64e32f006d23 Mon Sep 17 00:00:00 2001 From: dankelleher Date: Tue, 7 Mar 2023 09:43:38 +0100 Subject: [PATCH] Post-cherry-pick minimal changes to allow the old UI to work against the new program --- packages/client/src/constants.ts | 17 ----------------- packages/client/src/marinade.ts | 31 ++++++++++++++++++------------- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/packages/client/src/constants.ts b/packages/client/src/constants.ts index 4e47bdbd..5be966f8 100644 --- a/packages/client/src/constants.ts +++ b/packages/client/src/constants.ts @@ -50,9 +50,6 @@ export const Environment: Record = { holdingAccount: new PublicKey( "dhcB568T3skiP2D9ujf4eAJEnW2gACaaA9BUCVbwbXD" ), - yieldControllerState: new PublicKey( - "77aJfgRudbv9gFfjRQw3tuYzgnjoDgs9jorVTmK7cv73" - ), yieldControllerState: new PublicKey( "77aJfgRudbv9gFfjRQw3tuYzgnjoDgs9jorVTmK7cv73" ), @@ -62,20 +59,6 @@ export const Environment: Record = { bsolMint: new PublicKey("bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1"), }, }, - localnet: { - state: new PublicKey("28SkW4iD7UJc9zkxcq6yNb1MFX2hxqdJjxjZs67Jwr2b"), - holdingAccount: new PublicKey( - "dhcB568T3skiP2D9ujf4eAJEnW2gACaaA9BUCVbwbXD" - ), - yieldControllerState: new PublicKey( - "77aJfgRudbv9gFfjRQw3tuYzgnjoDgs9jorVTmK7cv73" - ), - percentageStakeToMarinade: 75, - blaze: { - pool: new PublicKey("azFVdHtAJN8BX3sbGAYkXvtdjdrT5U6rj9rovvUFos9"), - bsolMint: new PublicKey("bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1"), - }, - }, }; const ActiveEnvironment = diff --git a/packages/client/src/marinade.ts b/packages/client/src/marinade.ts index 72bad69e..efcd21df 100644 --- a/packages/client/src/marinade.ts +++ b/packages/client/src/marinade.ts @@ -247,20 +247,25 @@ export const liquidUnstake = async ( marinadeProgram, }; - const { instruction: rebalanceInstruction } = await triggerRebalance( - config, - marinade, - marinadeState, - program, - stateAddress, - staker - ); + // Disable triggerRebalance - this allows the old client (with minimal additional changes) + // to be used against the new program - return program.methods - .liquidUnstake(lamports) - .accounts(accounts) - .postInstructions([rebalanceInstruction]) - .transaction(); + // const { instruction: rebalanceInstruction } = await triggerRebalance( + // config, + // marinade, + // marinadeState, + // program, + // stateAddress, + // staker + // ); + + return ( + program.methods + .liquidUnstake(lamports) + .accounts(accounts) + // .postInstructions([rebalanceInstruction]) + .transaction() + ); }; export const orders = async (