@shadow-drive/sdk
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

Shadow Drive

Docs

Typescript components for Shadow Drive.

Quick Setup

Install

Install these dependencies:

yarn add @shadow-drive/sdk

Setup (React)

import React, { useEffect } from "react";
import * as anchor from "@coral-xyz/anchor";
import { ShdwDrive } from "@shadow-drive/sdk";
import {
    AnchorWallet,
    useAnchorWallet,
    useConnection,
} from "@solana/wallet-adapter-react";

export default function Drive() {
    const { connection } = useConnection();
    const wallet = useAnchorWallet();
    useEffect(() => {
        (async () => {
            if (wallet?.publicKey) {
                const drive = await new ShdwDrive(connection, wallet).init();
            }
        })();
    }, [wallet?.publicKey]);
    return <div></div>;
}

Setup (NodeJS)

import { ShdwDrive } from "@shadow-drive/sdk";
import * as web3 from "@solana/web3.js";
const connection = new web3.Connection("{rpc-url}", "confirmed");
const drive = await new ShdwDrive(connection, wallet).init();

Examples

package description
react Using shadow-drive in a react/browser environment

Build From Source

  1. Clone the project:
git clone https://github.com/genesysgo/shadow-drive.git
  1. Install dependencies:
cd shadow-drive
yarn install

Readme

Keywords

none

Package Sidebar

Install

npm i @shadow-drive/sdk

Weekly Downloads

469

Version

5.0.0

License

SEE LICENSE IN LICENSE

Unpacked Size

784 kB

Total Files

203

Last publish

Collaborators

  • gengotracy
  • khalilnafis