Преглед на файлове

[xc-admin] Add activate (#609)

* Add activate

* Rebase

* Remove extra file

* Restore other part of code
guibescos преди 2 години
родител
ревизия
0b35be7015
променени са 1 файла, в които са добавени 22 реда и са изтрити 0 реда
  1. 22 0
      governance/xc_admin/packages/xc_admin_cli/src/index.ts

+ 22 - 0
governance/xc_admin/packages/xc_admin_cli/src/index.ts

@@ -360,4 +360,26 @@ mutlisigCommand("propose-token-transfer", "Propose token transfer")
     await proposeInstructions(squad, vault, [proposalInstruction], false);
   });
 
+/**
+ * Activate proposal, mostly useful for cleaning up draft proposals that happen when the browser wallet fails to send all transactions succesfully
+ */
+mutlisigCommand("activate", "Activate a transaction sitting in the multisig")
+  .requiredOption(
+    "-t, --transaction <pubkey>",
+    "address of the draft transaction"
+  )
+  .action(async (options: any) => {
+    const wallet = await loadHotWalletOrLedger(
+      options.wallet,
+      options.ledgerDerivationAccount,
+      options.ledgerDerivationChange
+    );
+
+    const transaction: PublicKey = new PublicKey(options.transaction);
+    const cluster: PythCluster = options.cluster;
+
+    const squad = SquadsMesh.endpoint(getPythClusterApiUrl(cluster), wallet);
+    await squad.activateTransaction(transaction);
+  });
+
 program.parse();