πŸš€Getting started with JS

Simplifies blockchain app development with tools for smart accounts, blockchain interaction, and workflow management.

We are in the process of migration to new Execution Layer architecture and SDK will be updated accordingly. Right now SDK supports only Ditto Vaults (legacy). Please contact us at into@dittonetwork.io if you have interest as there are dramatic changes on the horizon.

Installation

To install the SDK, use the following commands:

npm install @ditto-network/core @ditto-network/web3.js web3

Getting Started

Here’s a quick guide to get you started with the Ditto Network SDK:

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);

For more detailed examples, check the examples section.

Documentation

For comprehensive documentation and details on how to use the Ditto Network, please refer to the main documentation in the @ditto-network/core package.

Examples

We provide a variety of examples to help you get started with different environments:

Last updated