Skip to content

Commit

Permalink
feat: tc multisig sort keys flag (#505)
Browse files Browse the repository at this point in the history
Co-authored-by: towanTG <[email protected]>
  • Loading branch information
towanTG and towanTG authored Dec 19, 2023
1 parent 46224df commit 876a4af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/serious-mayflies-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swapkit/toolbox-cosmos": patch
---

Adds sort flag for multisig pubkeys
3 changes: 2 additions & 1 deletion packages/toolboxes/cosmos/src/toolbox/thorchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,12 @@ const broadcastMultisigTx =
return transactionHash;
};

const createMultisig = async (pubKeys: string[], threshold: number) => {
const createMultisig = async (pubKeys: string[], threshold: number, noSortPubKeys = true) => {
const { encodeSecp256k1Pubkey, createMultisigThresholdPubkey } = await import('@cosmjs/amino');
return createMultisigThresholdPubkey(
pubKeys.map((pubKey) => encodeSecp256k1Pubkey(base64.decode(pubKey))),
threshold,
noSortPubKeys,
);
};

Expand Down

0 comments on commit 876a4af

Please sign in to comment.