@cloakely/sdk 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -105,6 +105,31 @@ console.log(await shared.balances()); // every token this accoun
105
105
 
106
106
  The private account comes from one EIP-712 signature bound to the chain only (never to a contract), so it and the `cloak:` address never change. The same wallet always restores it, and nothing is stored on a server. In Node, read the circuit files yourself and pass them to `createProver(wasm, zkey)`.
107
107
 
108
+ ## NFT drops and WL spot sales
109
+
110
+ ```ts
111
+ import { CloakDrops, CloakSpots, deploymentFor, elysiumTestnet, parseEther } from "@cloakely/sdk";
112
+ const dep = deploymentFor(elysiumTestnet.id);
113
+ const drops = new CloakDrops(publicClient, walletClient, dep.dropFactory!, dep.dropFactoryBlock);
114
+
115
+ const { drop } = await drops.create({ name: "Moonfoxes", symbol: "MOON", baseURI: "", supply: 1000, floor: parseEther("0.5"),
116
+ gtd: { list: [{ wallet: "0x…", spots: 2 }], price: parseEther("0.4"), durationSecs: 86400 },
117
+ wl: { list: ["0x…"], boostBps: 2000 }, biddingSecs: 86400 });
118
+ await drops.bid(drop, { price: parseEther("0.7"), quantity: 1 }); // sealed to a drand round; WL wallets pass wl: true
119
+ await drops.claim(drop, bidId); // or claimTo(drop, bidId, freshWallet)
120
+
121
+ // sell a partner collection's WL spots: winners name the wallet to whitelist
122
+ const spots = new CloakSpots(drops, dep.spotBook!);
123
+ const sale = await spots.create({ name: "Moonfoxes WL spots", symbol: "MOONWL", supply: 5, floor: parseEther("0.5"), biddingSecs: 86400, partner: "Moonfoxes" });
124
+ await spots.setWallets(sale.drop, bidId, ["0x…"]); // one per spot won, until the deadline
125
+ const csv = CloakSpots.csv(await spots.winners(sale.drop)); // the list for the partner
126
+ ```
127
+
128
+ The creator's price is the floor. Bids rank by price (WL bids by price × (1 + boost)), every winner pays one clearing
129
+ price (WL winners pay it ÷ (1 + boost), never under the floor), ties are drawn from every bid's sealed salt, and a drop
130
+ settles as soon as every bid is open. Every bid must cover one NFT at the floor; a bid still sealed at the end of the
131
+ reveal window loses 10%.
132
+
108
133
  ## Fees (testnet beta)
109
134
 
110
135
  | Action | Fee |
@@ -122,6 +147,8 @@ Rules live in the on-chain `CloakConfig`, and no function in any Cloak contract
122
147
  |---|---|
123
148
  | `Cloak` | Launches: `createLaunch`, `bid`, `revealAll`, `settle`, `claimAll`, `payOut`, `getAuction`, `listLaunches` |
124
149
  | `CloakPrivate` | Private balances: `shieldHype`, `shieldToken`, `buy`, `sell`, `batch`, `send`, `unshieldHype`, `unshieldToken`, `addAsset`, `balance`, `maxSpendable`, `migrateFrom` |
150
+ | `CloakDrops` | Sealed NFT drops: `create`, `get`, `details`, `listed`, `gtdMint`, `bid`, `bids`, `revealAll`, `settle`, `claim`, `claimTo`, `claimAll`, `withdrawRefund`, `payOut`, `mintUnsold` |
151
+ | `CloakSpots` | WL spot sales: `create`, `open`, `sale`, `sales`, `winners`, `setWallets`, `CloakSpots.csv` |
125
152
  | `relayerSubmitter`, `walletSubmitter` | How private calls are submitted: through a relayer (private), or from a wallet (for tests) |
126
153
  | `loadProver`, `createProver` | The Groth16 prover, running on the device |
127
154
  | `deployments`, `deploymentFor` | Addresses, start blocks, relayer and circuit URLs per chain |