Intent SDK (Beta)

The Verdant Intent SDK is a TypeScript library that simplifies the process of managing Personas, generating Shards, and submitting private transfer intents.

Installation

Install the package via NPM or Yarn.

Bash

npm install @verdant-protocol/sdk @solana/web3.js

Initialization

Initialize the client by connecting it to a Solana Connection and a Wallet Adapter.

TypeScript

import { Connection, Keypair } from '@solana/web3.js';
import { VerdantClient, NetworkType } from '@verdant-protocol/sdk';

// 1. Setup Solana Connection
const connection = new Connection('https://api.devnet.solana.com');

// 2. Initialize Verdant Client
const client = new VerdantClient({
  connection: connection,
  network: NetworkType.DEVNET,
  wallet: userWallet // From your wallet adapter
});

Creating an Intent

To send a private transaction, you must build an IntentObject.

TypeScript

Listening for Updates

You can subscribe to the status of an intent using the WebSocket method.

TypeScript

Last updated