Skip to main content

INTU SDK

The INTU SDK is a traditional NPM package that allows you to customize how you want INTU built into your dapp. With as little or as much integration as you want.

Using the full SDK, you could allow your users to use their INTU MPC account in more advanced ways like creating multiple accounts, leaning heavy into cross chain integration, or wanting to provide the users with more safeguards.

However, the full SDK is not intimidating, and a minimal integration can be accomplished with just the code provided on this one page.

npm i ethers @intuweb3/exp-web
import { ethers } from "ethers";
import { getVaults, createIntuAccount, preRegistration, automateRegistration, registerAllSteps, completeVault, submitTransaction, signTx,combineSignedTx } from "@intuweb3";

// We assume you get your signer from ethers similarly to:
// Using a wallet like Metamask
const provider = new ethers.providers.Web3Provider(window.ethereum);
await provider.send("eth_requestAccounts", []);
const signer = await provider.getSigner();

// OR
// Raw private key connection
const provider = new ethers.providers.StaticJsonRpcProvider("RPC_URL");
const wallet = new ethers.Wallet("SECRET_KEY");
const signer = await wallet.connect(provider);

Then, you can start integrating the functions in your application.

1. Check if the user has any existing accounts:

Get Vaults 📜

2. Create INTU Account

If the user doesn't have any Vaults, we'll need to create one.

  • The following assumes we have 2 listeners (human or robot) available to particpate in the creation of the MPC with the user. Documentation for those first few steps here:
Create Vault 🤔 Pre Registration 💻 Registration 🚀 Complete Registration 🗄 Generate Address & Finish 🍹 FAQ

3. Create Transaction

Alright! You have a working MPC account created on a decentralized network! Lets send a transaction from it, first we must create a transaction.

Submit Tx 💰

4. Sign and Send

If you are using our node-signer code [link to node signer], then they likely already detected the transaction you submitted and signed it, in which case you jsut need to combine their signatures. If not, or if you created an MPC account with real-life users, here is how to sign and send.

Sign 🖊 Combine 📬

That's it --- we have confirmed that your new INTU MPC account can successfully send transactions when enough signers reach a threshold to do so. If you want to dig in more, please proceed ahead!