@rareprotocol/rare-sdk
v0.1.1
Published
SuperRare / Rare Protocol TypeScript SDK: marketplace, minting, auctions, offers, releases, and the Rare API client
Readme
@rareprotocol/rare-sdk
SuperRare / Rare Protocol TypeScript SDK: marketplace listings, offers, auctions, minting, releases, bridging, liquid editions, and a typed client for the public Rare API.
Extracted from @rareprotocol/rare-cli
so applications can consume the SDK without the CLI (and without its
CLI-only dependencies).
Install
npm install @rareprotocol/rare-sdk viemUsage
import { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';
import { createRareClient } from '@rareprotocol/rare-sdk';
const publicClient = createPublicClient({ chain: mainnet, transport: http() });
const rare = createRareClient({ publicClient });
const status = await rare.listing.status({
contract: '0x…',
tokenId: '1',
target: '0x0000000000000000000000000000000000000000',
});Subpath exports mirror the ones previously published by the CLI package:
| Import | Contents |
| --- | --- |
| @rareprotocol/rare-sdk (or ./client) | createRareClient + SDK namespaces |
| @rareprotocol/rare-sdk/contracts | contract addresses + ABIs per chain |
| @rareprotocol/rare-sdk/utils | public helpers |
Regenerating the Rare API types
npm run generate:types