Skip to main content

submitTransaction


This endpoint forms a transaction for users of an INTU vault to sign

submitTransaction

This allows us to form a transaction for participants to sign. The base64 string output is what we store in the smart contract. Most of this input will come from a form you create on your page.
The other information will come from the getVaults function.

  • Example included to propose sending an NFT at the bottom of this page!

getvaults.md

import { submitTransaction, getVaults } from "@intuweb3/web-exp";
let myVaults = getVaults("0x12345_user_address", provider)
let nonce = myVaults[i].transactionCount // the first nonce in a vault should always be 0
let value = ethers.utils.parseEther(String(AMOUNTFROMYOURFORM))._hex // in eth
let to = FROMYOURFORM
let chainId = FROMYOURFORM
let data = 0x1...
let gasPrice = "" // or an amount of your choosing
let gas = "" // or an amount of your choosing

await submitTransaction(to, value, chainId, nonce, data, gasPrice, gas, vaultAddress, signer, notes?)
InputType of InputDescription
tostringThe address to send funds to
valuestringThe amount to send to the address (in eth)
chainIdstring | numberThe network ID to send the transaction on
noncestring | numberCurrent transaction nonce of the vault's EOA
datastringSend an NFT or contract interaction - In encoded form - Example: https://docs.sequence.xyz/wallet/guides/send-erc721/
gasPricestring | numberBlank if you want current market conditions
gasstring | numberBlank if you want current market conditions
signerobjectSigner object from ethers
notesstringOptional, gives you the option to store additional data with the transaction
//example for sending a simple transaction
import { submitTransaction, getVaults } from "@intuweb3/web-exp";
let myVaults = getVaults("0x12345_user_address", provider);

let chainId = "1";
let value = "0.00001";
let to = "0x12345";
let gasPrice = 100000; //or leave blank and we'll figure it out
let gas = 21000; //or leave blank and we'll figure it out
let nonce = await provider.getTransactionCount(myVaults[0].getTransactionCount);
let data = "";

await submitTransaction(
to, //contract address - the contract that launched the NFT Iwas trying to transfer
value, //always 0 for contract interaction I think...
String(chainId),
String(nonce),
data, // encodedData
gasPrice, // ""
gas, // ""
myVaultAddress, //address of vault you are interacting with
signer
);
//example for sending a NFT!
import { submitTransaction, getVaults } from "@intuweb3/web-exp";
let myVaults = getVaults("0x12345_user_address", provider);

const erc721Interface = new ethers.utils.Interface(["function safeTransferFrom(address _from, address _to, uint256 _tokenId)"]); //boilerplate
const encodedData = erc721Interface.encodeFunctionData("safeTransferFrom", [
"0x1111111111111111111111111111111111111111",
"0x2222222222222222222222222222222222222222",
4, //token id
]); // we just plug this const into the data field of submitTransaction

await submitTransaction(
to, //contract address - the contract that launched the NFT Iwas trying to transfer
value, //always 0 for contract interaction I think...
String(chainId),
String(nonce),
data, // encodedData
gasPrice, // ""
gas, // ""
myVaultAddress, //address of vault you are interacting with
signer
);