Skip to main content

signTx


A user can sign a proposed transaction with their keyshare

This allows us to send a transaction that has been voted on (a signature of the transaction = a vote in our case) by a > threshold participants.

This function needs the person to gather some data from the smart contract to pass to it.

import { signTx, getVaults } from "@intuweb3/web-exp";
let myVaults = getVaults("0x12345_user_address", provider);
let vaultaddress = myVaults[i].vaultAddress;
let transactions = myVaults[i].transactions;
let txId = //the ID of the transaction you want to sign. NOT the index of the transaction, the ID.
await signTx(vaultAddress, txId, signer);

Arguments:

InputType of InputDescription
vaultAddressStringUser signed vault message
txIdNumberId of the transaction, identified from the transactions array in getVaults
signerobjectSigner object from ethers

The result of this needs to be stored in the smart contract. This happens automatically!

OutputType of OutputDescription
signedTxForStorageStringThis is a signed transaction for a single participant. To be combined with other participant's signatures once threshold is reached.

Returns:

signedTxForStorage

String of signed transaction, encoded in base64 for storage: