8.0.3-alpha • Published 4 days ago
juice-sdk-core v8.0.3-alpha
juice-sdk-core
Core utilities and helpers for building client and server-side applications on Juicebox.
Installation
npm install juice-sdk-core
Usage
Inspect the utils/
directory for helpers and utilities. The following is a brief overview:
data.ts
- utilities for working with Juicebox datatypes.token.ts
- utilities for calculating price quotes, token redemption value, etc.ruleset.ts
- utilities for calculating ruleset-related data e.g. past and future weightsipfs.ts
- utilities for working with ipfs as it relates to JBhook.ts
- utilities for working with Juicebox Hooks, creating metadata for Pay/Redeem hooks
Common usecases
Fetch project metadata
import { createPublicClient, http } from "viem";
import { mainnet } from "viem/chains";
const publicClient = createPublicClient({
chain: mainnet,
transport: http(),
});
const projectId = 1n;
const ipfsGatewayHostname = ;
// read the project's Controller address from JBDirectory
const jbControllerAddress = await readJbDirectory({
functionName: "controllerOf",
args: [args.projectId],
});
const projectMetadata = await getProjectMetadata(
publicClient,
{
projectId,
jbControllerAddress,
},
{
ipfsGatewayHostname: "jbm.infura-ipfs.io", // use a custom ipfs host if needed
}
);
console.log(projectMetadata.name);
8.0.3-alpha
4 days ago
8.0.1-alpha
12 days ago
8.0.2-alpha
12 days ago
8.0.0-alpha
15 days ago
7.1.2-alpha
15 days ago
7.1.0-alpha
25 days ago
7.0.0-alpha
25 days ago
7.1.1-alpha
25 days ago
6.0.0-alpha
30 days ago
5.0.0-alpha
1 month ago
4.0.0-alpha
2 months ago
3.0.0-alpha
2 months ago
2.0.22-alpha
2 months ago
2.0.21-alpha
2 months ago
2.0.19-alpha
2 months ago
2.0.16-alpha
2 months ago
2.0.20-alpha
2 months ago
2.0.18-alpha
2 months ago
2.0.17-alpha
2 months ago
2.0.15-alpha
3 months ago
2.0.14-alpha
3 months ago
2.0.12-alpha
3 months ago
2.0.13-alpha
3 months ago
2.0.10-alpha
3 months ago
2.0.11-alpha
3 months ago
2.0.9-alpha
3 months ago
2.0.8-alpha
4 months ago
2.0.7-alpha
4 months ago
2.0.2-alpha
4 months ago
2.0.4-alpha
4 months ago
2.0.5-alpha
4 months ago
2.0.6-alpha
4 months ago
2.0.1-alpha
4 months ago
1.0.7-alpha
5 months ago
1.0.6-alpha
5 months ago
1.0.5-alpha
5 months ago
1.0.4-alpha
5 months ago
1.0.3-alpha
5 months ago
1.0.1-alpha
5 months ago
1.0.0-alpha
5 months ago