Skip to main content

automateRegistration


  • You can either use this single automateRegistration function or you can use the registerStep1,2,3 functions
  • automateRegistration uses a decentralized database build on libp2p - automatically, where the register steps rely on blockchain writes between steps for each user

This endpoint needs to be hit by each user involved with a vault during the vaults registration phase. If all users are online when this function is hit by each user, the registration process will complete in ~10 seconds.

Here is an example of the automatic registration in progress Automatic Registration


This step requires that all the other participants have performed the preRegistration step.

preregistration.md

Arguments:

import { registerStep1, getVaults } from "@intuweb3/web-exp";
let myVaults = getVaults("0x12345_user_address", provider);
//whichever vault address you need to interact with in myvaults
//example, myVaults[0].vaultAddress;
await automateRegistration(vaultAddress, signer, blockRange?, nostrNode?, intuSignature?);
//bonus: You can use it as follows to automatically register once all steps are complete
//
//
let ar = await automateRegistration(vaultAddress, signerAddress, signer1)
.then(async (result) => {
await registerAllSteps(vaultAddress, signer1);
return true;
})
.catch((error) => {
console.log(error);
});
InputTypeDescription
vaultAddressnumberAddress of the vault
signerObjectSigner object acquired from ethers or equivalent
blockRangenumberOptional - Block range to traverse logs (default 250000)
nostrNodestringOptional - If you want to use your own nostr node
intuSignaturestringOptional - If you create the users signature