diff --git a/src/action/multi-sig/commitment.ts b/src/action/multi-sig/commitment.ts index 0b13bc3..a18d3f1 100644 --- a/src/action/multi-sig/commitment.ts +++ b/src/action/multi-sig/commitment.ts @@ -86,7 +86,7 @@ const generateCommitments = async ( const hintBagToArray = async ( wallet: StateWallet, signerWallet: StateWallet, - tx: wasm.UnsignedTransaction, + tx: wasm.UnsignedTransaction | wasm.Transaction, boxes: Array, commitment: wasm.TransactionHintsBag, password?: string, diff --git a/src/action/multi-sig/signing.ts b/src/action/multi-sig/signing.ts index 19bde98..3c6241c 100644 --- a/src/action/multi-sig/signing.ts +++ b/src/action/multi-sig/signing.ts @@ -174,18 +174,8 @@ const extractAndAddSignedHints = async ( partial?: wasm.Transaction, boxes: Array = [], ) => { - const simulatedPropositions = new wasm.Propositions(); - simulated.forEach((item) => { - simulatedPropositions.add_proposition_from_byte( - Uint8Array.from(Buffer.from('cd' + item, 'hex')), - ); - }); - const realPropositions = new wasm.Propositions(); - signed.forEach((item) => { - realPropositions.add_proposition_from_byte( - Uint8Array.from(Buffer.from('cd' + item, 'hex')), - ); - }); + const simulatedPropositions = arrayToProposition(simulated); + const realPropositions = arrayToProposition(signed); const context = await getChain(wallet.networkType).fakeContext(); if (partial) { const ergoBoxes = wasm.ErgoBoxes.empty(); @@ -337,3 +327,9 @@ export const sign = async ( currentTime, }; }; + +export const arrayToProposition = (input: Array): wasm.Propositions => { + const output = new wasm.Propositions() + input.forEach(pk => Uint8Array.from(Buffer.from('cd' + pk, 'hex')),) + return output +} \ No newline at end of file diff --git a/src/action/multi-sig/wallet-keys.ts b/src/action/multi-sig/wallet-keys.ts index 6ea5828..4059f07 100644 --- a/src/action/multi-sig/wallet-keys.ts +++ b/src/action/multi-sig/wallet-keys.ts @@ -58,7 +58,7 @@ const getMultiSigWalletMyPublicKeys = async ( const getInputPks = async ( wallet: StateWallet, signerWallet: StateWallet, - tx: wasm.UnsignedTransaction, + tx: wasm.UnsignedTransaction | wasm.Transaction, boxes: Array, ): Promise>> => { const pks = await getMultiSigWalletPublicKeys(wallet, signerWallet);