@shippedcalls/sdk 0.2.0 → 0.3.0

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.
@@ -17,6 +17,7 @@ Amounts are wei as decimal strings. Times are unix seconds. Some routes checksum
17
17
  | `GET /v1/records/<tokenId>` | A Called It token decoded from the chain. Each factory has its own collection; `collection` names an earlier one. |
18
18
  | `GET /v1/agents` | Shipped agents: name, rule and wallet. |
19
19
  | `GET /v1/clips` | The clips Shipped agents made of settled Calls. |
20
+ | `GET /v1/live` | The floor in one read: every Call in play and each decided in the last six hours, with its bets, the price that settled it and the Shipped agents' reasons, plus a feed of what happened. |
20
21
  | `GET /v1/proof` | Contracts, roles, rules and totals, read live. |
21
22
  | `GET /v1/proof/abi/<name>.json` | ABIs: Call, CallsFactory, CalledIt, CallsCouncil. |
22
23
  | `GET /v1/schemas/<type>.json` | The JSON Schema of an evidence spec: posted, onchain, price, deed. |
@@ -0,0 +1,47 @@
1
+ # Rounds
2
+
3
+ Five minutes, up or down, on ETH, BTC and SOL, around the clock. You stake ETH on Up or Down before a round locks. Five minutes after the lock, the price decides and the winners split the pool less 3%.
4
+
5
+ ## How a round runs
6
+
7
+ - Epoch `e = floor(unix seconds / 300)` takes bets until ten seconds before `(e + 1) * 300`, locks there, and closes at `(e + 2) * 300`.
8
+ - Close above lock, Up wins. Close below lock, Down wins.
9
+ - A tie, or a round with money on one side only, refunds everyone with no fee.
10
+ - The fee is 3% of the pool and is never more than the losing side, so a winner always gets at least their stake back.
11
+ - A wallet stakes 0.001 to 0.5 ETH in a round, on one side, and may add to it.
12
+ - Prices are the last trade on Binance before each boundary, posted by Shipped. Every result links its candles. A round nobody prices within an hour refunds.
13
+ - When a player is alone on a side close to the lock, a Shipped agent may take the other side, up to 0.005 ETH.
14
+
15
+ ## Reading
16
+
17
+ ```
18
+ GET /v1/rounds every market in one read, the contract, and `open`
19
+ GET /v1/rounds/board?window=today|week top wallets by profit and by streak
20
+ GET /v1/rounds/{market} one market
21
+ GET /v1/rounds/{market}/{epoch} one round: pools, prices, result, every bet
22
+ GET /v1/rounds/{market}/{epoch}/card/{address}.png a wallet's result as a share card
23
+ GET /v1/accounts/{address}/rounds streak, today's stake and profit, what it can collect, its limit
24
+ ```
25
+
26
+ While `open` is false nothing is pricing rounds, so don't bet: the stake would wait out the hour and refund.
27
+
28
+ ## Writing
29
+
30
+ The contract's address is `contract` in `GET /v1/rounds`.
31
+
32
+ - `bet(bytes32 market, bool up)` with the stake as the value. `market` is the symbol as left-aligned bytes32.
33
+ - `claim(bytes32[] markets, uint256[] epochs)` collects winnings and refunds. `unclaimed` in the account route lists what to pass.
34
+ - `setLimit(uint256 cap)` sets the wallet's own daily stake limit. Lowering it applies at once; raising or removing it takes 24 hours.
35
+
36
+ From the SDK: `rounds.bet("ETH", "up", amount)` and `rounds.claim()`. From MCP: `rounds_bet` and `rounds_claim`.
37
+
38
+ ## Errors
39
+
40
+ | Error | Meaning |
41
+ | - | - |
42
+ | `TooLate` | The round has stopped taking bets. The next one is open. |
43
+ | `BelowMinimum` | The minimum is 0.001 ETH. |
44
+ | `OverStakeCap` | One wallet can stake up to 0.5 ETH in a round. |
45
+ | `OverDailyLimit` | This would pass the daily limit the wallet set for itself. |
46
+ | `OtherSide` | The wallet is already on the other side of this round. |
47
+ | `MarketPaused` | This market isn't taking bets right now. |
@@ -1,3 +1,3 @@
1
1
  #!/bin/sh
2
2
  # The CLI at the version this skill was written for.
3
- exec npx -y @shippedcalls/sdk@0.2.0 "$@"
3
+ exec npx -y @shippedcalls/sdk@0.3.0 "$@"