πGetting started with JS
Simplifies blockchain app development with tools for smart accounts, blockchain interaction, and workflow management.
Installation
npm install @ditto-network/core @ditto-network/web3.js web3Getting Started
Initialize SDK
import { Provider, SmartWalletFactory, BrowserStorage } from '@ditto-network/core';
import { EthersSigner, EthersContractFactory } from '@ditto-network/ethers';
const provider = new Provider({
signer: new EthersSigner(signer),
storage: new BrowserStorage(),
contractFactory: new EthersContractFactory(signer),
});
const swFactory = new SmartWalletFactory(provider);
const sw = await swFactory.getDefaultOrCreateVault();
const vaultAddress = sw.getAddress();
console.log('Vault address:', vaultAddress);Documentation
Examples
Last updated