@manifoldxyz/studio-apps-client-public
v1.0.0-beta.0
Published
Public SDK for Studio Apps public endpoints
Keywords
Readme
@manifoldxyz/studio-apps-client-public
Public SDK for interacting with Manifold Studio Apps public endpoints.
Installation
npm install @manifoldxyz/studio-apps-client-publicUsage
import { StudioAppsClientForPublic } from '@manifoldxyz/studio-apps-client-public';
// Initialize the client
const client = new StudioAppsClientForPublic({
baseUrl: 'https://apps.api.manifoldxyz.dev/'
});
// Get instance data
const instance = await client.public.getInstance({
instanceId: 123,
maxMediaWidth: 500
});
// Get instance previews
const { instancePreviews, count } = await client.public.getPreviews({
instanceIds: [123, 456, 789],
maxSize: 10
});
// Get merkle tree info for an address
const merkleInfo = await client.public.getMerkleInfo({
merkleTreeId: 789,
address: '0x1234567890abcdef...',
appId: 1
});
// Get merkle root
const merkleRoot = await client.public.getMerkleRoot({
merkleTreeId: 789,
appId: 1
});API Reference
StudioAppsClientForPublic
The main client class for accessing public endpoints.
Constructor Options
baseUrl(string): The base URL for the APIgetHeaders(function, optional): Function to get custom headers for requestsdefaultTimeout(number, optional): Default timeout for requests in millisecondsgetDefaultQueryParams(function, optional): Function to get default query parameters
Available Methods
All methods are available through the public module:
getInstance(options)
Returns public instance data for a given instance ID.
getPreviews(options)
Returns instance previews for given instance IDs.
getMerkleInfo(options)
Returns merkle proof and value for a wallet address.
getMerkleRoot(options)
Returns the merkle root for a merkle tree.
License
MIT
