@shippedcalls/sdk 0.2.0 → 0.3.1
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 +12 -0
- package/dist/abi.d.ts +1061 -0
- package/dist/abi.js +1363 -0
- package/dist/abi.js.map +1 -1
- package/dist/cli.js +87 -4
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +68 -1
- package/dist/client.js +132 -6
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/odds.d.ts +4 -0
- package/dist/odds.js +13 -0
- package/dist/odds.js.map +1 -1
- package/dist/types.d.ts +128 -0
- package/package.json +1 -1
- package/skill/SKILL.md +9 -2
- package/skill/references/api.md +7 -1
- package/skill/references/rounds.md +56 -0
- package/skill/references/write-path.md +4 -0
- package/skill/scripts/calls.sh +1 -1
- package/src/abi.ts +1364 -0
- package/src/cli.ts +76 -4
- package/src/client.ts +133 -7
- package/src/errors.ts +13 -0
- package/src/index.ts +4 -4
- package/src/odds.ts +14 -0
- package/src/types.ts +80 -0
package/README.md
CHANGED
|
@@ -21,6 +21,13 @@ calls bet <address> <holds|breaks> <eth> [--quote] [--yes] [--max-stake <eth>]
|
|
|
21
21
|
calls claim <address> [--opener]
|
|
22
22
|
calls open --text <sentence> --spec <json|@file> [--handle <x handle>] [--post-url <url>] [--bond <eth>] [--yes]
|
|
23
23
|
calls open --text <sentence> --bond-number <n> [--yes]
|
|
24
|
+
|
|
25
|
+
calls rounds [<market>]
|
|
26
|
+
calls rounds history [<wallet>]
|
|
27
|
+
calls rounds bet <market> <up|down> <eth> [--quote] [--yes] [--max-stake <eth>]
|
|
28
|
+
calls rounds claim [<market>]
|
|
29
|
+
calls rounds plain-wins <on|off>
|
|
30
|
+
calls rounds limit <eth>
|
|
24
31
|
```
|
|
25
32
|
|
|
26
33
|
`--json` works on every command. A failure is `{"error": "...", "code": "..."}` with a non-zero exit.
|
|
@@ -40,6 +47,8 @@ npx @shippedcalls/sdk bet <address> holds 0.001 --yes
|
|
|
40
47
|
| `CALLS_RPC_URL` | RPC endpoints, comma-separated, tried in order. A public list by default. |
|
|
41
48
|
| `CALLS_API_URL` | https://calls.shipped.bond by default. |
|
|
42
49
|
|
|
50
|
+
The CLI and the MCP server read these. The library takes them as options: `createClient({ privateKey, api, rpc })`.
|
|
51
|
+
|
|
43
52
|
## The library
|
|
44
53
|
|
|
45
54
|
```ts
|
|
@@ -60,6 +69,9 @@ Bring a private key or any viem account as `account`; reads need neither.
|
|
|
60
69
|
| From the chain | `quote()` `pool()` `status()` `disputeWindow()` `odds()` `payoutOf()` `stake()` `balance()` `isCall()` |
|
|
61
70
|
| Both | `positions()` `verifySettlement()` |
|
|
62
71
|
| Writes | `bet()` `claim()` `claimOpener()` `finalize()` `dispute()` `open()` |
|
|
72
|
+
| Rounds | `rounds.markets()` `rounds.state()` `rounds.quote()` `rounds.history()` `rounds.bet()` `rounds.claim()` `rounds.setPlainWins()` `rounds.setLimit()` |
|
|
73
|
+
|
|
74
|
+
Rounds are five-minute markets on whether ETH, BTC or SOL goes up or down: `calls.rounds.bet("ETH", "up", ethToWei("0.001"))` stakes on the round taking bets now, and `calls.rounds.claim()` collects everything the wallet is owed. Only matched stake plays: a fully matched win pays 1.94 times the stake, after a 3% fee on what played, and whatever isn't matched comes back win or lose. A stake alone in a round comes back, except that close to the lock a Shipped agent may match up to 0.005 ETH of it. A win that earns a card pays 10% of its profit as $SHIPPED; `calls.rounds.setPlainWins(true)` or `calls rounds plain-wins on` takes every win in ETH instead. A bet is refused while `rounds.markets()` answers `open: false`, because rounds aren't being priced and the stake would wait an hour to come back.
|
|
63
75
|
|
|
64
76
|
A Call's result stays open to dispute for `disputeWindow` seconds after it settles: 1 hour on a Price Call, 24 hours on a Post or contract-read Call and on every Call opened on an earlier factory, none on a bond Call. `isCall()` and every write accept Calls of the earlier factories too.
|
|
65
77
|
|