-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { PublicKey } from "@solana/web3.js"; | ||
import { | ||
OptionValues, | ||
Command | ||
} from "commander"; | ||
import { getCommandContext } from "../utils"; | ||
|
||
export const managerUpdateMarginTradingEnabled= async (program: Command, cmdOpts: OptionValues) => { | ||
|
||
let vaultAddress: PublicKey; | ||
try { | ||
vaultAddress = new PublicKey(cmdOpts.vaultAddress as string); | ||
} catch (err) { | ||
console.error("Invalid vault address"); | ||
process.exit(1); | ||
} | ||
|
||
const { | ||
driftVault | ||
} = await getCommandContext(program, true); | ||
|
||
const enabled = cmdOpts.enabled ? (cmdOpts.enabled as string).toLowerCase() === "true" : false; | ||
|
||
const tx = await driftVault.updateMarginTradingEnabled(vaultAddress, enabled); | ||
console.log(`Updated margin trading vault manager: https://solscan.io/tx/${tx}`); | ||
console.log("Done!"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters