Observed since 21 Oct, 11:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Type-safe SDK for the 0xSlots protocol — reads (subgraph) + writes (viem)
Type-safe SDK for the 0xSlots protocol — contract reads and writes over viem, with ERC-20 approval handled for you. Full reference: docs.0xslots.org.
pnpm add @0xslots/sdk @0xslots/contracts viem
import { SlotsClient } from "@0xslots/sdk";
import { slotFactoryAddress } from "@0xslots/contracts";
const client = new SlotsClient({
publicClient, // viem PublicClient
walletClient, // viem WalletClient, for writes
factoryAddress: slotFactoryAddress[chainId], // only createSlot / collectAll need it
});
const state = await client.slotState(slot); // one SlotLens.getSlotInfo call
// `account` is who becomes occupant — it need not be the signer.
await client.buy({
slot,
account,
selfAssessedPrice: 5_000_000n,
depositAmount: 1_000_000n,
});
await client.topUp(slot, 500_000n);
await client.release(slot);
await client.collect(slot);
SlotsClient reads the chain, not the indexer. The indexer endpoints are
exported as DEFAULT_API_URL, LOCAL_API_URL, API_URLS and apiUrlFor(env)
for querying it directly — see Indexer.
| Area | Methods |
|---|---|
| Reads | slotState, slotStates, quoteBuy, minDepositForBuy, minDepositToHold, pending, hasRipeTerms, terms, module, scopes, fee, moduleUpdate, debtOf, claimableOf, isOperator, and getters for the common fields |
| Create | createSlot, simulateCreateSlot |
| Occupancy | buy, simulateBuy, liquidateAndBuy, release, liquidate |
| Holding | selfAssess, topUp, withdraw, manageTerms, setOperator |
| Money out | collect, collectAll, simulateCollectAll, collectFrom, claim |
| Manager | proposeTerms, cancelTerms, acceptFee, acceptScopes, setManager |
| Modules | validateSettings, readScopes, readFee, moduleMetadata, moduleSettings |
| OfferBook | offerBoard, offerAt, isOfferFundable, offerCost, postOffer, cancelOffer, approveOfferBook, authorizeOfferBook, acceptOffer |
buy sends the quote it just read as maxPayment, so it pays what it was
quoted or reverts; pass maxPayment: 0n to disable the ceiling on purpose.
Call simulateBuy first to surface a module's refusal with its own error.
Terms are proposed by presence, and land at the next buy after a one-day delay:
import { NO_MODULE, TERMS } from "@0xslots/sdk";
await client.proposeTerms(slot, { taxRateBps: 200 });
await client.proposeTerms(slot, { moduleTerms: { module, settings } });
await client.proposeTerms(slot, { moduleTerms: NO_MODULE }); // remove the module
await client.cancelTerms(slot, TERMS.MODULE);
CollectionsClient (slot-bound NFT collections) and CollectivesClient
(SlotCollective governance, roles in COLLECTIVE_ROLES) ship beside it.
import { useSlotAction, useSlotsClient } from "@0xslots/sdk/react";
Requires wagmi, viem and @tanstack/react-query as peer dependencies.
useSlotsClient({ factoryAddress?, offerBookAddress?, chainId? }) memoizes a
client from wagmi's clients; useSlotAction wraps every write with shared
pending and receipt state. useCollectivesClient does the same for collectives.
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.1Registry latest | 30 Sept 2026 | 17 | |
| 1.0.0 | 30 Sept 2026 | 17 | |
| 0.30.2 | 11 Sept 2026 | 17 | |
| 0.30.1 | 9 Sept 2026 | 17 | |
| 0.30.0 | 8 Sept 2026 | 17 | |
| 0.29.0 | 7 Sept 2026 | 17 | |
| 0.28.0 | 1 Sept 2026 | 17 | |
| 0.27.0 | 15 Aug 2026 | 17 | |
| 0.26.1 | 14 Aug 2026 | 17 | |
| 0.26.0 | 12 Aug 2026 | 17 | |
| 0.25.0 | 12 Aug 2026 | 17 | |
| 0.24.0 | 12 Aug 2026 | 17 | |
| 0.23.0 | 12 Aug 2026 | 17 | |
| 0.22.0 | 11 Aug 2026 | 17 | |
| 0.21.0 | 11 Aug 2026 | 17 | |
| 0.20.1 | 10 Aug 2026 | 17 | |
| 0.20.0 | 8 Aug 2026 | 17 | |
| 0.19.0 | 8 Aug 2026 | 16 | |
| 0.18.1 | 4 Aug 2026 | 16 | |
| 0.18.0 | 3 Aug 2026 | 16 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:9ef2ad80c8e7502a18390b17c3fc5bd8eceaf9a374df1d2cbf0342c04554c6d9