1.1.7 • Published 4 years ago
connext-store v1.1.7
connext-store
Connext Store Module
Install
Install NPM package in your project
npm install --save connext-store
Setup
For Browsers
import ConnextStore from "connext-store";
const store = new ConnextStore(window.localStorage);
For React-Native
import AsyncStorage from "@react-native-community/async-storage";
import ConnextStore from "connext-store";
const store = new ConnextStore(AsyncStorage);
For NodeJS
import ConnextStore, { NodeStorage } from "connext-store";
const store = new ConnextStore(new NodeStorage());
Advanced Options
import AsyncStorage from "@react-native-community/async-storage";
import ConnextStore, { NodeStorage } from "connext-store";
import PisaClient from "pisa-client";
import ethers from "ethers";
const store = new ConnextStore(
window.localStorage || AsyncStorage || new NodeStorage(), // REQUIRED
{
prefix: "INDRA_CLIENT_CF_CORE",
separator: "/",
asyncDataKey: "CONNEXT_STORE",
pisaClient: new PisaClient(pisaUrl, contractAddress),
wallet: new ethers.Wallet(privateKey)
}
);