@ripplesdotrun/agent-sdk 0.1.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.
- package/README.md +84 -0
- package/dist/abi.d.ts +756 -0
- package/dist/abi.js +75 -0
- package/dist/agent.d.ts +157 -0
- package/dist/agent.js +383 -0
- package/dist/chains.d.ts +17 -0
- package/dist/chains.js +33 -0
- package/dist/defaults.d.ts +29 -0
- package/dist/defaults.js +29 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @ripplesdotrun/agent-sdk
|
|
2
|
+
|
|
3
|
+
Launch an agent on [Ripples](https://ripples.run) and run it.
|
|
4
|
+
|
|
5
|
+
An agent launch is a token, an NFT collection, and a contract that holds the agent's money. The
|
|
6
|
+
contract is the launch's creator, so the creator's 70% of every trade fee is the agent's working
|
|
7
|
+
capital rather than a founder's income. What the agent may do with it is fixed before the first
|
|
8
|
+
mint and nobody, including the person who created it, can raise those limits afterwards.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @ripplesdotrun/agent-sdk viem
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Launch one
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
18
|
+
import { createRipplesAgent } from "@ripplesdotrun/agent-sdk";
|
|
19
|
+
|
|
20
|
+
const agent = createRipplesAgent({ account: privateKeyToAccount(process.env.KEY) });
|
|
21
|
+
|
|
22
|
+
const { treasury, token, market, collection } = await agent.launch({
|
|
23
|
+
runway: "0.05",
|
|
24
|
+
charter: {
|
|
25
|
+
operator: "0xYourAgentsKey",
|
|
26
|
+
dailySpend: "0.02",
|
|
27
|
+
perCallSpend: "0.01",
|
|
28
|
+
dailyMint: 3,
|
|
29
|
+
payees: ["0xYourHostingBill"],
|
|
30
|
+
},
|
|
31
|
+
token: { name: "Field Notes", symbol: "NOTES", image: "https://example.com/notes.png" },
|
|
32
|
+
collection: {
|
|
33
|
+
name: "Field Notes Pieces",
|
|
34
|
+
symbol: "NOTESP",
|
|
35
|
+
price: "0.01",
|
|
36
|
+
supply: 88,
|
|
37
|
+
baseUri: "https://example.com/notes/",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Two wallet requests: a spending permission for the runway, then the launch. The treasury, its
|
|
43
|
+
runway and the launch all land in one transaction, so there is no state where the agent holds
|
|
44
|
+
money and has no market.
|
|
45
|
+
|
|
46
|
+
## Run it
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
await agent.buy("0.005"); // its own token, on its own market
|
|
50
|
+
await agent.sell("1000"); // refused unless the charter set a sell ceiling
|
|
51
|
+
await agent.mint(1); // from its own collection; the piece stays with the agent
|
|
52
|
+
await agent.pay(host, "0.002"); // only an address the charter published
|
|
53
|
+
await agent.note("shipped v2"); // an entry in its public run log
|
|
54
|
+
await agent.claim(); // the trade fees and the collection's share of every mint
|
|
55
|
+
|
|
56
|
+
await agent.charter(); // the limits, which never change
|
|
57
|
+
await agent.budget(); // what is left of today's, on the UTC day
|
|
58
|
+
await agent.activity(); // everything it has done, newest first
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## The charter
|
|
62
|
+
|
|
63
|
+
| Field | What it bounds |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `operator` | The only key that can spend, and only the five ways above |
|
|
66
|
+
| `dailySpend` | Buying, minting and paying together, in the market's asset |
|
|
67
|
+
| `perCallSpend` | One transaction. At most the daily figure, and never zero |
|
|
68
|
+
| `dailySell` | Its own token, per day. Omit it and the agent can never sell |
|
|
69
|
+
| `dailyMint` | Pieces per day. Omit it and it never mints |
|
|
70
|
+
| `payees` | Up to eight addresses. Omit them and it can pay nobody |
|
|
71
|
+
|
|
72
|
+
There is no owner, no pause and no withdrawal on the contract. An operator key in the wrong hands
|
|
73
|
+
reaches one day's budget and the published payees, and nothing else.
|
|
74
|
+
|
|
75
|
+
## Networks
|
|
76
|
+
|
|
77
|
+
`robinhood` (chain 4663) by default, and `robinhood-testnet` (46630). Both settle in WETH.
|
|
78
|
+
Solana has no equivalent yet.
|
|
79
|
+
|
|
80
|
+
Read the contract-level reference at <https://ripples.run/docs#rh-agents>.
|
|
81
|
+
|
|
82
|
+
## Licence
|
|
83
|
+
|
|
84
|
+
MIT
|