tollkit-wallet 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +133 -2
- package/THIRD_PARTY_NOTICES.md +13 -0
- package/dist/actions.d.ts +364 -0
- package/dist/actions.js +143 -0
- package/dist/actions.js.map +1 -0
- package/dist/agentkit.d.ts +24 -0
- package/dist/agentkit.js +40 -0
- package/dist/agentkit.js.map +1 -0
- package/dist/approvals.d.ts +21 -0
- package/dist/approvals.js +71 -0
- package/dist/approvals.js.map +1 -0
- package/dist/autopilot.d.ts +74 -0
- package/dist/autopilot.js +285 -0
- package/dist/autopilot.js.map +1 -0
- package/dist/chains.d.ts +16 -0
- package/dist/chains.js +26 -0
- package/dist/chains.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +292 -0
- package/dist/cli.js.map +1 -0
- package/dist/coin-icons.d.ts +9 -0
- package/dist/coin-icons.js +7 -0
- package/dist/coin-icons.js.map +1 -0
- package/dist/dashboard.d.ts +16 -0
- package/dist/dashboard.js +198 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/elizaos.d.ts +45 -0
- package/dist/elizaos.js +139 -0
- package/dist/elizaos.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/keystore.d.ts +53 -0
- package/dist/keystore.js +87 -0
- package/dist/keystore.js.map +1 -0
- package/dist/ledger.d.ts +40 -0
- package/dist/ledger.js +115 -0
- package/dist/ledger.js.map +1 -0
- package/dist/mcp.d.ts +8 -0
- package/dist/mcp.js +42 -0
- package/dist/mcp.js.map +1 -0
- package/dist/paper.d.ts +53 -0
- package/dist/paper.js +78 -0
- package/dist/paper.js.map +1 -0
- package/dist/parse.d.ts +22 -0
- package/dist/parse.js +113 -0
- package/dist/parse.js.map +1 -0
- package/dist/paths.d.ts +9 -0
- package/dist/paths.js +18 -0
- package/dist/paths.js.map +1 -0
- package/dist/pay.d.ts +85 -0
- package/dist/pay.js +310 -0
- package/dist/pay.js.map +1 -0
- package/dist/policy.d.ts +67 -0
- package/dist/policy.js +72 -0
- package/dist/policy.js.map +1 -0
- package/dist/prices.d.ts +28 -0
- package/dist/prices.js +41 -0
- package/dist/prices.js.map +1 -0
- package/dist/rules.d.ts +106 -0
- package/dist/rules.js +163 -0
- package/dist/rules.js.map +1 -0
- package/dist/sanctions.d.ts +22 -0
- package/dist/sanctions.js +76 -0
- package/dist/sanctions.js.map +1 -0
- package/dist/seller.d.ts +21 -0
- package/dist/seller.js +21 -0
- package/dist/seller.js.map +1 -0
- package/dist/send.d.ts +23 -0
- package/dist/send.js +71 -0
- package/dist/send.js.map +1 -0
- package/dist/swap.d.ts +54 -0
- package/dist/swap.js +120 -0
- package/dist/swap.js.map +1 -0
- package/dist/telegram.d.ts +12 -0
- package/dist/telegram.js +58 -0
- package/dist/telegram.js.map +1 -0
- package/dist/tokens.d.ts +11 -0
- package/dist/tokens.js +62 -0
- package/dist/tokens.js.map +1 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +268 -0
- package/dist/ui.js.map +1 -0
- package/dist/wallet.d.ts +141 -0
- package/dist/wallet.js +345 -0
- package/dist/wallet.js.map +1 -0
- package/dist/watch.d.ts +66 -0
- package/dist/watch.js +234 -0
- package/dist/watch.js.map +1 -0
- package/package.json +91 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tollkit LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,134 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tollkit Wallet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A wallet for AI trading agents. It holds its keys on your computer, encrypted with your password, and lets an agent:
|
|
4
|
+
|
|
5
|
+
- swap tokens on Base and Ethereum (via 0x) and Solana (via Jupiter)
|
|
6
|
+
- pay for APIs that charge per call (x402 and MPP, in USDC or USDT)
|
|
7
|
+
|
|
8
|
+
All of it happens inside limits that you set and the agent can't change.
|
|
9
|
+
|
|
10
|
+
## What it checks before spending
|
|
11
|
+
|
|
12
|
+
- **Limits:** per trade, per day, per payment, and per seller per day. These are counted under a lock, so parallel calls can't overspend.
|
|
13
|
+
- **Approval:** anything over your threshold waits for you to tap Approve in Telegram. No answer means no.
|
|
14
|
+
- **Sanctions:** every payment recipient is screened against the OFAC list.
|
|
15
|
+
- **Seller check:** the seller's price and pay-to address are compared with its public listing (Tollkit Weigh Station).
|
|
16
|
+
- **Swap safety:** the fee must be no more than 0.5%, the only contract ever approved is 0x AllowanceHolder (for exact amounts), and a minimum output is always set.
|
|
17
|
+
- **Receipts:** every trade and payment is logged, and you can export them as CSV.
|
|
18
|
+
|
|
19
|
+
## Fees
|
|
20
|
+
|
|
21
|
+
Swaps cost a flat 0.5%, shown before every trade. On some Base and Ethereum pairs, 0x charges its own 0.15% on top, and this is shown separately. Payments for APIs carry no Tollkit fee.
|
|
22
|
+
|
|
23
|
+
## Setup
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
npm install -g tollkit-wallet
|
|
27
|
+
tollkit-wallet init # choose a password; prints your Base/Ethereum and Solana addresses
|
|
28
|
+
tollkit-wallet budget # see limits; change with e.g. budget per_trade_usd=100
|
|
29
|
+
tollkit-wallet telegram <bot-token> <chat-id> # optional: approvals in Telegram
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then fund the addresses. Base and Solana are on by default; turn Ethereum on with `tollkit-wallet budget chains=base,solana,ethereum` (its network fees are higher).
|
|
33
|
+
|
|
34
|
+
## Withdrawals
|
|
35
|
+
|
|
36
|
+
Funds can only be withdrawn to addresses you've saved, and saving one needs your password:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
tollkit-wallet addresses add base 0xYourAddress "my coinbase"
|
|
40
|
+
tollkit-wallet withdraw base 25 USDC 0xYourAddress
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The agent has no tool for this.
|
|
44
|
+
|
|
45
|
+
## Use with an agent (MCP)
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"tollkit-wallet": {
|
|
51
|
+
"command": "tollkit-wallet",
|
|
52
|
+
"args": ["mcp"],
|
|
53
|
+
"env": { "TOLLKIT_WALLET_PASSWORD_FILE": "/path/to/a/file/with/your/password" }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Tools: `wallet_status`, `wallet_balances`, `swap_quote`, `swap`, `pay_fetch`, `seller_check`, `receipts`, `autopilot_propose`, `autopilot_rules`, `autopilot_cancel`, `paper_swap`, `paper_status`. There is no tool for changing limits, approvals or keys.
|
|
60
|
+
|
|
61
|
+
## Use with Coinbase AgentKit
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { AgentKit } from "@coinbase/agentkit";
|
|
65
|
+
import { TollkitWallet } from "tollkit-wallet";
|
|
66
|
+
import { tollkitWalletActionProvider } from "tollkit-wallet/agentkit";
|
|
67
|
+
|
|
68
|
+
const wallet = await TollkitWallet.open(process.env.TOLLKIT_WALLET_PASSWORD!);
|
|
69
|
+
const agentkit = await AgentKit.from({ walletProvider, actionProviders: [tollkitWalletActionProvider(wallet)] });
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This adds `tollkit_swap`, `tollkit_swap_quote`, `tollkit_pay_fetch`, `tollkit_wallet_balances`, `tollkit_wallet_status`, `tollkit_seller_check` and `tollkit_receipts`. They use the Tollkit wallet's own keys and limits, whatever AgentKit wallet provider you use.
|
|
73
|
+
|
|
74
|
+
## Use with ElizaOS
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { tollkitWalletPlugin } from "tollkit-wallet/elizaos";
|
|
78
|
+
// in your character or project: plugins: [tollkitWalletPlugin]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Set `TOLLKIT_WALLET_PASSWORD` (or `TOLLKIT_WALLET_PASSWORD_FILE`) in the agent's settings or environment. The agent's model reads the request ("swap 25 USDC to SOL"), and the wallet checks it against your limits before anything is signed.
|
|
82
|
+
|
|
83
|
+
## Use from code
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import { TollkitWallet } from "tollkit-wallet";
|
|
87
|
+
const w = await TollkitWallet.open(process.env.TOLLKIT_WALLET_PASSWORD!);
|
|
88
|
+
const r = await w.pay("https://api.example.com/paid-endpoint");
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Where things live
|
|
92
|
+
|
|
93
|
+
`~/.tollkit-wallet/` (or `TOLLKIT_WALLET_HOME`) holds:
|
|
94
|
+
|
|
95
|
+
- `keystore.json` (encrypted)
|
|
96
|
+
- `policy.json` (sealed with your password; editing it by hand pauses spending)
|
|
97
|
+
- `ledger.jsonl` (receipts)
|
|
98
|
+
- `telegram.json`
|
|
99
|
+
- the cached sanctions list
|
|
100
|
+
|
|
101
|
+
Swap quotes come through api.tollkit.dev. It holds the 0x and Jupiter API keys and adds the fee, and it only ever sees public data and signed transactions.
|
|
102
|
+
|
|
103
|
+
If you lose the password, the funds can't be recovered.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Autopilot (limit orders, stop-loss, take-profit, trailing stops, recurring buys)
|
|
107
|
+
|
|
108
|
+
Tell the wallet what to do in plain English, check the summary, and turn it on:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
tollkit-wallet rule add "buy $25 of SOL every Monday; sell half my ETH if it rises 10% and sell all ETH if it falls 8%"
|
|
112
|
+
tollkit-wallet rules # what's on, prices now, fills
|
|
113
|
+
tollkit-wallet rule pause <id> # or: rule on <id>, rule cancel <id>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Or use the **Autopilot** tab in the dashboard (`tollkit-wallet ui`). Rule types: limit buy, limit sell, take-profit, stop-loss, trailing stop, and recurring buys (hourly, daily, weekly or a set weekday, with an optional count and maximum price). A take-profit and a stop-loss on the same token are linked: when one fills, the other cancels.
|
|
117
|
+
|
|
118
|
+
- Every fill goes through the same limits, approvals and receipts as any swap, and pays the same 0.5% fee.
|
|
119
|
+
- Rules an agent suggests (`autopilot_propose`) wait for you to turn them on, unless you tick "Let agents turn on autopilot rules without asking me" in Limits (or `budget agent_rules=auto`).
|
|
120
|
+
- The autopilot runs while the wallet runs: keep the dashboard open, or run `tollkit-wallet autopilot` on a computer or small server that stays on. Only one copy runs rules at a time.
|
|
121
|
+
- Limit orders fill only at their price or better (within 1% for fees and spread). Stops always sell. When selling all of a chain's coin, a little is kept for network fees.
|
|
122
|
+
|
|
123
|
+
## Paper trading
|
|
124
|
+
|
|
125
|
+
Practise with pretend money at real live prices, fees included, under the same limits:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
tollkit-wallet paper reset 1000 # $1,000 pretend USDC on each chain
|
|
129
|
+
tollkit-wallet paper swap base 100 USDC ETH
|
|
130
|
+
tollkit-wallet autopilot --paper # run your rules on pretend money
|
|
131
|
+
tollkit-wallet paper # balances, fills, fees
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Agents get `paper_swap` and `paper_status`. Nothing is signed or sent.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## web3icons
|
|
4
|
+
|
|
5
|
+
Coin and chain logos in `src/coin-icons.ts` come from web3icons (`@web3icons/core` 4.0.58, https://web3icons.io), by 0xa3k5, released under the MIT License:
|
|
6
|
+
|
|
7
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
>
|
|
9
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
>
|
|
11
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
12
|
+
|
|
13
|
+
The coin and network names and logos are trademarks of their owners and are used only to identify the assets and networks the wallet supports.
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wallet's agent-facing actions, defined once and shared by the MCP
|
|
3
|
+
* server, the AgentKit provider and the ElizaOS plugin. Spending stays inside
|
|
4
|
+
* the owner's policy; nothing here can change limits, keys or withdrawal
|
|
5
|
+
* addresses.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import type { TollkitWallet } from "./wallet.js";
|
|
9
|
+
export declare const SwapArgs: z.ZodObject<{
|
|
10
|
+
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
11
|
+
sell: z.ZodString;
|
|
12
|
+
buy: z.ZodString;
|
|
13
|
+
amount: z.ZodString;
|
|
14
|
+
slippage_bps: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
chain: "base" | "ethereum" | "solana";
|
|
17
|
+
amount: string;
|
|
18
|
+
sell: string;
|
|
19
|
+
buy: string;
|
|
20
|
+
slippage_bps?: number | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
chain: "base" | "ethereum" | "solana";
|
|
23
|
+
amount: string;
|
|
24
|
+
sell: string;
|
|
25
|
+
buy: string;
|
|
26
|
+
slippage_bps?: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const PayArgs: z.ZodObject<{
|
|
29
|
+
url: z.ZodString;
|
|
30
|
+
method: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>>;
|
|
31
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
32
|
+
body: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
url: string;
|
|
35
|
+
method?: "POST" | "GET" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
36
|
+
headers?: Record<string, string> | undefined;
|
|
37
|
+
body?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
url: string;
|
|
40
|
+
method?: "POST" | "GET" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
41
|
+
headers?: Record<string, string> | undefined;
|
|
42
|
+
body?: string | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const SellerArgs: z.ZodObject<{
|
|
45
|
+
url: z.ZodString;
|
|
46
|
+
pay_to: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
url: string;
|
|
49
|
+
pay_to?: string | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
url: string;
|
|
52
|
+
pay_to?: string | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const ReceiptArgs: z.ZodObject<{
|
|
55
|
+
since: z.ZodOptional<z.ZodString>;
|
|
56
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
since?: string | undefined;
|
|
59
|
+
limit?: number | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
since?: string | undefined;
|
|
62
|
+
limit?: number | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const NoArgs: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
65
|
+
export declare const ProposeArgs: z.ZodObject<{
|
|
66
|
+
text: z.ZodOptional<z.ZodString>;
|
|
67
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
kind: z.ZodEnum<["limit_buy", "limit_sell", "stop_loss", "take_profit", "trailing_stop", "dca"]>;
|
|
69
|
+
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
70
|
+
token: z.ZodString;
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
amount_usd: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
sell_percent: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
sell_amount: z.ZodOptional<z.ZodString>;
|
|
75
|
+
trigger_price: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
trail_pct: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
every: z.ZodOptional<z.ZodEnum<["hour", "day", "week"]>>;
|
|
78
|
+
weekday: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
max_price: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
group: z.ZodOptional<z.ZodString>;
|
|
82
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
chain: "base" | "ethereum" | "solana";
|
|
85
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
86
|
+
token: string;
|
|
87
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
88
|
+
name?: string | undefined;
|
|
89
|
+
sell_amount?: string | undefined;
|
|
90
|
+
amount_usd?: number | undefined;
|
|
91
|
+
sell_percent?: number | undefined;
|
|
92
|
+
trigger_price?: number | undefined;
|
|
93
|
+
trail_pct?: number | undefined;
|
|
94
|
+
weekday?: number | undefined;
|
|
95
|
+
times?: number | undefined;
|
|
96
|
+
max_price?: number | undefined;
|
|
97
|
+
group?: string | undefined;
|
|
98
|
+
expires_at?: string | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
chain: "base" | "ethereum" | "solana";
|
|
101
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
102
|
+
token: string;
|
|
103
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
104
|
+
name?: string | undefined;
|
|
105
|
+
sell_amount?: string | undefined;
|
|
106
|
+
amount_usd?: number | undefined;
|
|
107
|
+
sell_percent?: number | undefined;
|
|
108
|
+
trigger_price?: number | undefined;
|
|
109
|
+
trail_pct?: number | undefined;
|
|
110
|
+
weekday?: number | undefined;
|
|
111
|
+
times?: number | undefined;
|
|
112
|
+
max_price?: number | undefined;
|
|
113
|
+
group?: string | undefined;
|
|
114
|
+
expires_at?: string | undefined;
|
|
115
|
+
}>, "many">>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
rules?: {
|
|
118
|
+
chain: "base" | "ethereum" | "solana";
|
|
119
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
120
|
+
token: string;
|
|
121
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
122
|
+
name?: string | undefined;
|
|
123
|
+
sell_amount?: string | undefined;
|
|
124
|
+
amount_usd?: number | undefined;
|
|
125
|
+
sell_percent?: number | undefined;
|
|
126
|
+
trigger_price?: number | undefined;
|
|
127
|
+
trail_pct?: number | undefined;
|
|
128
|
+
weekday?: number | undefined;
|
|
129
|
+
times?: number | undefined;
|
|
130
|
+
max_price?: number | undefined;
|
|
131
|
+
group?: string | undefined;
|
|
132
|
+
expires_at?: string | undefined;
|
|
133
|
+
}[] | undefined;
|
|
134
|
+
text?: string | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
rules?: {
|
|
137
|
+
chain: "base" | "ethereum" | "solana";
|
|
138
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
139
|
+
token: string;
|
|
140
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
141
|
+
name?: string | undefined;
|
|
142
|
+
sell_amount?: string | undefined;
|
|
143
|
+
amount_usd?: number | undefined;
|
|
144
|
+
sell_percent?: number | undefined;
|
|
145
|
+
trigger_price?: number | undefined;
|
|
146
|
+
trail_pct?: number | undefined;
|
|
147
|
+
weekday?: number | undefined;
|
|
148
|
+
times?: number | undefined;
|
|
149
|
+
max_price?: number | undefined;
|
|
150
|
+
group?: string | undefined;
|
|
151
|
+
expires_at?: string | undefined;
|
|
152
|
+
}[] | undefined;
|
|
153
|
+
text?: string | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
export declare const RulesListArgs: z.ZodObject<{
|
|
156
|
+
status: z.ZodOptional<z.ZodEnum<["proposed", "active", "paused", "done", "cancelled", "expired", "error"]>>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
status?: "done" | "error" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
status?: "done" | "error" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const RuleIdArgs: z.ZodObject<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
id: string;
|
|
166
|
+
}, {
|
|
167
|
+
id: string;
|
|
168
|
+
}>;
|
|
169
|
+
export interface WalletAction<S extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
170
|
+
name: string;
|
|
171
|
+
description: string;
|
|
172
|
+
schema: S;
|
|
173
|
+
spends: boolean;
|
|
174
|
+
run: (w: TollkitWallet, args: z.infer<S>) => Promise<unknown>;
|
|
175
|
+
}
|
|
176
|
+
export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>, WalletAction<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>, WalletAction<z.ZodObject<{
|
|
177
|
+
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
178
|
+
sell: z.ZodString;
|
|
179
|
+
buy: z.ZodString;
|
|
180
|
+
amount: z.ZodString;
|
|
181
|
+
slippage_bps: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
chain: "base" | "ethereum" | "solana";
|
|
184
|
+
amount: string;
|
|
185
|
+
sell: string;
|
|
186
|
+
buy: string;
|
|
187
|
+
slippage_bps?: number | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
chain: "base" | "ethereum" | "solana";
|
|
190
|
+
amount: string;
|
|
191
|
+
sell: string;
|
|
192
|
+
buy: string;
|
|
193
|
+
slippage_bps?: number | undefined;
|
|
194
|
+
}>>, WalletAction<z.ZodObject<{
|
|
195
|
+
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
196
|
+
sell: z.ZodString;
|
|
197
|
+
buy: z.ZodString;
|
|
198
|
+
amount: z.ZodString;
|
|
199
|
+
slippage_bps: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
chain: "base" | "ethereum" | "solana";
|
|
202
|
+
amount: string;
|
|
203
|
+
sell: string;
|
|
204
|
+
buy: string;
|
|
205
|
+
slippage_bps?: number | undefined;
|
|
206
|
+
}, {
|
|
207
|
+
chain: "base" | "ethereum" | "solana";
|
|
208
|
+
amount: string;
|
|
209
|
+
sell: string;
|
|
210
|
+
buy: string;
|
|
211
|
+
slippage_bps?: number | undefined;
|
|
212
|
+
}>>, WalletAction<z.ZodObject<{
|
|
213
|
+
url: z.ZodString;
|
|
214
|
+
method: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>>;
|
|
215
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
216
|
+
body: z.ZodOptional<z.ZodString>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
url: string;
|
|
219
|
+
method?: "POST" | "GET" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
220
|
+
headers?: Record<string, string> | undefined;
|
|
221
|
+
body?: string | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
url: string;
|
|
224
|
+
method?: "POST" | "GET" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
225
|
+
headers?: Record<string, string> | undefined;
|
|
226
|
+
body?: string | undefined;
|
|
227
|
+
}>>, WalletAction<z.ZodObject<{
|
|
228
|
+
url: z.ZodString;
|
|
229
|
+
pay_to: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
url: string;
|
|
232
|
+
pay_to?: string | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
url: string;
|
|
235
|
+
pay_to?: string | undefined;
|
|
236
|
+
}>>, WalletAction<z.ZodObject<{
|
|
237
|
+
since: z.ZodOptional<z.ZodString>;
|
|
238
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
since?: string | undefined;
|
|
241
|
+
limit?: number | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
since?: string | undefined;
|
|
244
|
+
limit?: number | undefined;
|
|
245
|
+
}>>, WalletAction<z.ZodObject<{
|
|
246
|
+
text: z.ZodOptional<z.ZodString>;
|
|
247
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
248
|
+
kind: z.ZodEnum<["limit_buy", "limit_sell", "stop_loss", "take_profit", "trailing_stop", "dca"]>;
|
|
249
|
+
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
250
|
+
token: z.ZodString;
|
|
251
|
+
name: z.ZodOptional<z.ZodString>;
|
|
252
|
+
amount_usd: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
sell_percent: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
sell_amount: z.ZodOptional<z.ZodString>;
|
|
255
|
+
trigger_price: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
trail_pct: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
every: z.ZodOptional<z.ZodEnum<["hour", "day", "week"]>>;
|
|
258
|
+
weekday: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
times: z.ZodOptional<z.ZodNumber>;
|
|
260
|
+
max_price: z.ZodOptional<z.ZodNumber>;
|
|
261
|
+
group: z.ZodOptional<z.ZodString>;
|
|
262
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
chain: "base" | "ethereum" | "solana";
|
|
265
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
266
|
+
token: string;
|
|
267
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
268
|
+
name?: string | undefined;
|
|
269
|
+
sell_amount?: string | undefined;
|
|
270
|
+
amount_usd?: number | undefined;
|
|
271
|
+
sell_percent?: number | undefined;
|
|
272
|
+
trigger_price?: number | undefined;
|
|
273
|
+
trail_pct?: number | undefined;
|
|
274
|
+
weekday?: number | undefined;
|
|
275
|
+
times?: number | undefined;
|
|
276
|
+
max_price?: number | undefined;
|
|
277
|
+
group?: string | undefined;
|
|
278
|
+
expires_at?: string | undefined;
|
|
279
|
+
}, {
|
|
280
|
+
chain: "base" | "ethereum" | "solana";
|
|
281
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
282
|
+
token: string;
|
|
283
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
284
|
+
name?: string | undefined;
|
|
285
|
+
sell_amount?: string | undefined;
|
|
286
|
+
amount_usd?: number | undefined;
|
|
287
|
+
sell_percent?: number | undefined;
|
|
288
|
+
trigger_price?: number | undefined;
|
|
289
|
+
trail_pct?: number | undefined;
|
|
290
|
+
weekday?: number | undefined;
|
|
291
|
+
times?: number | undefined;
|
|
292
|
+
max_price?: number | undefined;
|
|
293
|
+
group?: string | undefined;
|
|
294
|
+
expires_at?: string | undefined;
|
|
295
|
+
}>, "many">>;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
rules?: {
|
|
298
|
+
chain: "base" | "ethereum" | "solana";
|
|
299
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
300
|
+
token: string;
|
|
301
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
302
|
+
name?: string | undefined;
|
|
303
|
+
sell_amount?: string | undefined;
|
|
304
|
+
amount_usd?: number | undefined;
|
|
305
|
+
sell_percent?: number | undefined;
|
|
306
|
+
trigger_price?: number | undefined;
|
|
307
|
+
trail_pct?: number | undefined;
|
|
308
|
+
weekday?: number | undefined;
|
|
309
|
+
times?: number | undefined;
|
|
310
|
+
max_price?: number | undefined;
|
|
311
|
+
group?: string | undefined;
|
|
312
|
+
expires_at?: string | undefined;
|
|
313
|
+
}[] | undefined;
|
|
314
|
+
text?: string | undefined;
|
|
315
|
+
}, {
|
|
316
|
+
rules?: {
|
|
317
|
+
chain: "base" | "ethereum" | "solana";
|
|
318
|
+
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
319
|
+
token: string;
|
|
320
|
+
every?: "hour" | "day" | "week" | undefined;
|
|
321
|
+
name?: string | undefined;
|
|
322
|
+
sell_amount?: string | undefined;
|
|
323
|
+
amount_usd?: number | undefined;
|
|
324
|
+
sell_percent?: number | undefined;
|
|
325
|
+
trigger_price?: number | undefined;
|
|
326
|
+
trail_pct?: number | undefined;
|
|
327
|
+
weekday?: number | undefined;
|
|
328
|
+
times?: number | undefined;
|
|
329
|
+
max_price?: number | undefined;
|
|
330
|
+
group?: string | undefined;
|
|
331
|
+
expires_at?: string | undefined;
|
|
332
|
+
}[] | undefined;
|
|
333
|
+
text?: string | undefined;
|
|
334
|
+
}>>, WalletAction<z.ZodObject<{
|
|
335
|
+
status: z.ZodOptional<z.ZodEnum<["proposed", "active", "paused", "done", "cancelled", "expired", "error"]>>;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
337
|
+
status?: "done" | "error" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
338
|
+
}, {
|
|
339
|
+
status?: "done" | "error" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
340
|
+
}>>, WalletAction<z.ZodObject<{
|
|
341
|
+
id: z.ZodString;
|
|
342
|
+
}, "strip", z.ZodTypeAny, {
|
|
343
|
+
id: string;
|
|
344
|
+
}, {
|
|
345
|
+
id: string;
|
|
346
|
+
}>>, WalletAction<z.ZodObject<{
|
|
347
|
+
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
348
|
+
sell: z.ZodString;
|
|
349
|
+
buy: z.ZodString;
|
|
350
|
+
amount: z.ZodString;
|
|
351
|
+
slippage_bps: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
}, "strip", z.ZodTypeAny, {
|
|
353
|
+
chain: "base" | "ethereum" | "solana";
|
|
354
|
+
amount: string;
|
|
355
|
+
sell: string;
|
|
356
|
+
buy: string;
|
|
357
|
+
slippage_bps?: number | undefined;
|
|
358
|
+
}, {
|
|
359
|
+
chain: "base" | "ethereum" | "solana";
|
|
360
|
+
amount: string;
|
|
361
|
+
sell: string;
|
|
362
|
+
buy: string;
|
|
363
|
+
slippage_bps?: number | undefined;
|
|
364
|
+
}>>, WalletAction<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>];
|