Typescript components for Shadow Drive.
Install these dependencies:
yarn add @shadow-drive/sdk
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>;
}
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();
package | description |
---|---|
react | Using shadow-drive in a react/browser environment |
- Clone the project:
git clone https://github.com/genesysgo/shadow-drive.git
- Install dependencies:
cd shadow-drive
yarn install