2.1.0-alpha ⢠Published 3 years ago
juice-sdk-v1 v2.1.0-alpha
juice-sdk-v1
š§ A JavaScript SDK for the Juicebox V1 protocol.
ā ļø This library is experimental and we provide no guarantees. Use at your own risk.
Overview
juice-sdk-v1 helps you interact with the Juicebox V2 contracts using JavaScript.
Supports your favorite dev environment:
- ā Node.js
- ā Typescript
- ā Webpack (supports tree-shaking)
- ā Rollup (supports tree-shaking)
- ā Vite (supports tree-shaking)
Installation
npm install juice-sdk-v1Usage
Import the factory function for a Juicebox contract.
import { getProjects as getProjectsContract } from "juice-sdk-v1";Create a JsonRpcProvider. The example below uses the ethers library.
import { JsonRpcProvider } from "@ethersproject/providers"; // ...); const provider = new JsonRpcProvider(YOUR_GATEWAY_HOST_URL);Call the factory function to get an instance of the ethers.js
Contract.const ProjectContract = getProjectsContract(provider);Start interacting with the contract.
const const terminals = await ProjectContract.uriOf(projectId);
Examples
Inspect the examples/ directory to learn how to use juice-sdk-v1 for your project.
| Environment | Example |
|---|---|
| node.js | ./examples/node |
| node.js with Typescript | ./examples/typescript-node |
| create-react-app (webpack) | ./examples/create-react-app |
| Vue | ./examples/vue |
| Svelte | ./examples/svelte |
| Vanilla JavaScript (with Vite) | juice-tools/embed/project/balance |
Development
2.1.0-alpha
3 years ago
2.0.0-alpha
3 years ago
1.1.0-alpha
3 years ago
1.0.1-alpha
4 years ago
1.0.0-alpha
4 years ago