π Getting Started
We offer two APIs: a general Typescript API, and one specifically for React. You can use this Typescript API in any Node.js app, and the React API supports both queries, suspense queries, and mutations
Installation
pnpm install @owlprotocol/core-trpc
Note: we recommend using pnpm
instead of npm
, but you can also use npm
to install our package (pnpm)
Typescript API
Import and initialize the client:
import { createClient } from "@owlprotocol/core-trpc";
const client = createClient({apiKey: "API_KEY"})
// Example query
const contract = await client.collection.deploy.mutate({
chainId,
name: "My Collection",
symbol: "MY",
});
Using the Typescript API requires having a Project API key. To do so, you need to log into the dashboard, create a project if you havenβt done so yet, and copy your project API key.
Sample API functions
Endpoints (client. ) | Information |
---|---|
collection.deploy.mutate | Deploy collection |
collection.erc721AutoId.templateMintBatch.mutate | Mint collection assets from template (ERC721AutoId) |
projectTokenTemplate.createOrSet.mutate | Create or set project token template |
projectUser.createOrSet.mutate | Create or set project user |
projectUser.get.query | Get project user |
teamMember.create.mutate | Create team member |
React API
Under development
Updated 18 days ago