INTU SDK Quickstart

Overview:

🏮 If you need to chat with us, please visit our discord: https://discord.gg/sc9SjTewph 🏮

Intu is comprised of two parts, the cryptographic functionality which is the bulk of our offering, and the smart contract which acts primarily as a database and confirmation layer. Our SDK performs the task of combining the cryptographic output with the method and order to be stored and retrieved in the SC.

Assuming we want the most basic setup (3 users, requiring 2 signatures to send a transaction), we will need just a handful of functions to achieve that.

The process to create and use an Intu account is roughly:

  • Import Intu SDK & Ethers
  • Retrieve your user intu vaults
  • Propose a vault
  • Have each user register into the vault
  • Complete! Now the vault can be used to send threshold signatures

Prerequisites:

With our SDK, you can get started in just a few steps.

First, get the appropriate @intuweb3 package for the project you are building (web or nodejs), and the ethers package.

Web: npm version
Node: npm version

1. Install Packages:

npm i @intuweb3/exp-web OR npm i @intuweb3/exp-node
npm i ethers (or whatever you prefer)

2. Initial Code Setup:

Signer Object & Retrieve Intu Vaults

For the purposes of the code examples, we are going to use the 'web' version.

import { ethers } from "ethers";
import { getVaults } from "@intuweb3/web";

const provider = new ethers.providers.Web3Provider(window.ethereum);
await provider.send("eth_requestAccounts", []);
const signer = await provider.getSigner();
const signerAddress = await signer.getAddress();

await getVaults("0x12345", provider);

Nice! Any accounts your user has ever created will pull right up.

3. Vault Creation & Use:

Create an INTU account

import { vaultCreation } from "@intuweb3/web";

/*
The first parameter to pass is an array of the addresses that should be a part of this new vault
RotateThreshold = % of participants required to add or remove someone from the vault
TransactionThreshold = % of participants required to send a transaction from the vault
AdminThreshold = % of participants required to change a threshold %, change the name, etc.
*/
await vaultCreation([0x1, 0x2, 0x3], "MyEasyToReadVaultName", rotateThreshold, txThreshold, adminThreshold, signer);

Now that we've created a vault, the users included in that vault can all register into it and then start using it, lets see that additional functionality!