2.1.0-alpha ā€¢ Published 2 years ago

juice-sdk-v1 v2.1.0-alpha

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

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-v1

Usage

  1. Import the factory function for a Juicebox contract.

    import { getProjects as getProjectsContract } from "juice-sdk-v1";
  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 ProjectContract = getProjectsContract(provider);
  4. 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.

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

2.1.0-alpha

2 years ago

2.0.0-alpha

2 years ago

1.1.0-alpha

2 years ago

1.0.1-alpha

2 years ago

1.0.0-alpha

2 years ago