2.1.0-alpha ā€¢ Published 2 years ago

juice-sdk v2.1.0-alpha

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

juice-sdk

šŸ§ƒ A JavaScript SDK for the Juicebox V2 protocol.

āš ļø This library is experimental and we provide no guarantees. Use at your own risk.

Overview

juice-sdk 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)

Check out the examples to get started šŸš€.

Installation

npm install juice-sdk

Usage

  1. Import the factory function for a Juicebox contract.

    import { getJBDirectory } from "juice-sdk";
  2. Create a JsonRpcProvider. The example below uses the ethers library.

    import { JsonRpcProvider } from "@ethersproject/providers";
    // ...);
    const provider = new JsonRpcProvider(YOUR_GATEWAY_HOST_URL);
  3. Call the factory function to get an instance of the ethers.js Contract.

    const JBDirectory = getJBDirectory(provider);
  4. Start interacting with the contract.

    const const terminals = await JBDirectory.terminalsOf(projectId);

Examples

Inspect the examples/ directory to learn how to use juice-sdk for your project.

EnvironmentExample
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

0.0.15-alpha

3 years ago

0.0.10-alpha

3 years ago

0.0.9-alpha

3 years ago

2.0.2-alpha

2 years ago

0.0.20-alpha

3 years ago

0.0.18-alpha

3 years ago

2.0.4-alpha

2 years ago

0.0.12-alpha

3 years ago

0.0.17-alpha

3 years ago

0.0.13-alpha

3 years ago

0.0.7-alpha

3 years ago

2.1.0-alpha

2 years ago

2.0.0-alpha

3 years ago

0.0.19-alpha

3 years ago

0.0.11-alpha

3 years ago

0.0.14-alpha

3 years ago

0.0.5-alpha

3 years ago

0.0.21-alpha

3 years ago

2.0.3-alpha

2 years ago

0.0.6-alpha

3 years ago

2.0.1-alpha

3 years ago

1.0.0-alpha

3 years ago

0.0.16-alpha

3 years ago

0.0.8-alpha

3 years ago

0.0.4-alpha

3 years ago

0.0.3-alpha

3 years ago

0.0.2-alpha

3 years ago

0.0.1-alpha

3 years ago