Options
All
  • Public
  • Public/Protected
  • All
Menu

@genesygo/shadowdrive

Shadow Drive

Docs

Typescript components for Shadow Drive.

Quick Setup

Install

Install these dependencies:

yarn add @genesysgo/shadow-drive

Setup (React)

import React, { useEffect } from "react";
import * as anchor from "@project-serum/anchor";
import ShdwDrive from "@genesygo/shadowdrive";
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 as AnchorWallet).init();
}
})();
}, [wallet?.publicKey])
return (
<div></div>
)
}

Setup (NodeJS)

import ShdwDrive from "@genesygo/shadowdrive";
const drive = await new ShdwDrive(connection, wallet as AnchorWallet).init();

Examples

package description
node Using shadow-drive in a nodejs environment components
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
    
  2. Install dependencies:

    cd shadow-drive
    yarn install

Generated using TypeDoc