tollkit-wallet 0.2.1 → 0.2.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 +49 -2
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/actions.d.ts +34 -33
- package/dist/actions.js +5 -1
- package/dist/actions.js.map +1 -1
- package/dist/bridge.d.ts +148 -0
- package/dist/bridge.js +460 -0
- package/dist/bridge.js.map +1 -0
- package/dist/buy.d.ts +17 -0
- package/dist/buy.js +23 -0
- package/dist/buy.js.map +1 -0
- package/dist/cli.js +68 -2
- package/dist/cli.js.map +1 -1
- package/dist/dapp.d.ts +89 -0
- package/dist/dapp.js +505 -0
- package/dist/dapp.js.map +1 -0
- package/dist/dashboard.d.ts +2 -0
- package/dist/dashboard.js +145 -2
- package/dist/dashboard.js.map +1 -1
- package/dist/holdings.d.ts +92 -0
- package/dist/holdings.js +200 -0
- package/dist/holdings.js.map +1 -0
- package/dist/keystore.d.ts +58 -11
- package/dist/keystore.js +87 -11
- package/dist/keystore.js.map +1 -1
- package/dist/ledger.d.ts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/netguard.d.ts +8 -0
- package/dist/netguard.js +44 -0
- package/dist/netguard.js.map +1 -0
- package/dist/paths.d.ts +1 -0
- package/dist/paths.js +1 -0
- package/dist/paths.js.map +1 -1
- package/dist/policy.d.ts +4 -4
- package/dist/rules.d.ts +4 -4
- package/dist/sell.d.ts +60 -0
- package/dist/sell.js +71 -0
- package/dist/sell.js.map +1 -0
- package/dist/stake.d.ts +84 -0
- package/dist/stake.js +158 -0
- package/dist/stake.js.map +1 -0
- package/dist/ui.js +306 -32
- package/dist/ui.js.map +1 -1
- package/dist/wallet.d.ts +57 -2
- package/dist/wallet.js +185 -4
- package/dist/wallet.js.map +1 -1
- package/extension/PRIVACY.md +19 -0
- package/extension/README.md +16 -0
- package/extension/background.js +88 -0
- package/extension/content.js +34 -0
- package/extension/icons/icon.svg +1 -0
- package/extension/icons/icon128.png +0 -0
- package/extension/icons/icon16.png +0 -0
- package/extension/icons/icon32.png +0 -0
- package/extension/icons/icon48.png +0 -0
- package/extension/inpage.js +129 -0
- package/extension/manifest.json +15 -0
- package/extension/popup.html +35 -0
- package/extension/popup.js +39 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Swaps cost a flat 0.5%, shown before every trade. On some Base and Ethereum pair
|
|
|
25
25
|
```
|
|
26
26
|
npm install -g tollkit-wallet
|
|
27
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
|
|
28
|
+
tollkit-wallet budget # see limits; change with e.g. budget per_trade_usd=100 (or in the dashboard's Settings tab)
|
|
29
29
|
tollkit-wallet telegram <bot-token> <chat-id> # optional: approvals in Telegram
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -84,6 +84,14 @@ import { tollkitWalletPlugin } from "tollkit-wallet/elizaos";
|
|
|
84
84
|
|
|
85
85
|
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.
|
|
86
86
|
|
|
87
|
+
## Use with websites (browser extension)
|
|
88
|
+
|
|
89
|
+
The Tollkit extension for Chrome, Brave and Edge lets websites connect to this wallet the way they connect to MetaMask or Phantom: Base and Ethereum apps through the standard Ethereum provider (EIP-1193/EIP-6963), Solana apps through the Wallet Standard.
|
|
90
|
+
|
|
91
|
+
Keys stay in Tollkit. When a site asks to connect, sign or send, the request shows up in the dashboard's Approvals tab with the site's name and the details. Transactions are checked against the network first. Nothing happens until you approve. Read-only calls go straight through.
|
|
92
|
+
|
|
93
|
+
To add it: run `tollkit-wallet extension` for the folder and steps (Developer mode, then Load unpacked), then pair it from **Settings → Pair a browser**. Connected sites are listed in Settings, where you can disconnect them. The dashboard has to be open for sites to use the wallet.
|
|
94
|
+
|
|
87
95
|
## Use from code
|
|
88
96
|
|
|
89
97
|
```ts
|
|
@@ -92,6 +100,45 @@ const w = await TollkitWallet.open(process.env.TOLLKIT_WALLET_PASSWORD!);
|
|
|
92
100
|
const r = await w.pay("https://api.example.com/paid-endpoint");
|
|
93
101
|
```
|
|
94
102
|
|
|
103
|
+
## Backup and recovery
|
|
104
|
+
|
|
105
|
+
New wallets (0.2.2 and later) are made from a 12-word recovery phrase. It's shown once when you create the wallet, and you can see it again with `tollkit-wallet backup` or **Back up** in the dashboard (password needed). The dashboard asks you to confirm three of the words before it counts as backed up.
|
|
106
|
+
|
|
107
|
+
The phrase uses the same derivation paths as MetaMask and Phantom (Base/Ethereum `m/44'/60'/0'/0/0`, Solana `m/44'/501'/0'/0'`), so it restores the same addresses there too.
|
|
108
|
+
|
|
109
|
+
To restore: `tollkit-wallet restore` and type the phrase. Wallets made before 0.2.2 have no phrase; their backup is the two private keys (`tollkit-wallet backup` shows them), restored with `tollkit-wallet restore --keys`. Add `--replace` to restore over an existing wallet; its files are kept, renamed with `.replaced-<time>`.
|
|
110
|
+
|
|
111
|
+
## Tokens and price charts
|
|
112
|
+
|
|
113
|
+
The dashboard's Home tab lists every token the wallet holds that has a price, with its value and 24-hour change. Tap a token for a price chart (1D, 1W, 1M, 1Y). Prices and charts come from DefiLlama.
|
|
114
|
+
|
|
115
|
+
How tokens are found:
|
|
116
|
+
- Solana: every SPL and Token-2022 token account the address owns.
|
|
117
|
+
- Ethereum: Blockscout's public token list for the address.
|
|
118
|
+
- Base: tokens you've swapped into with this wallet, plus any you add with **Add a token** (paste the contract address). Base has no free public token index that works without a key, so the wallet doesn't scan for others.
|
|
119
|
+
|
|
120
|
+
Tokens with no price (most airdropped spam) are hidden and counted below the list. Added tokens are saved in `tokens.json` in the wallet folder.
|
|
121
|
+
|
|
122
|
+
## Buy crypto with a card
|
|
123
|
+
|
|
124
|
+
**Buy** on the Home tab opens Coinbase's checkout to buy USDC or ETH on Base or Ethereum, or USDC or SOL on Solana, sent straight to this wallet's address. The wallet asks Tollkit's server for a single-use Coinbase Onramp link; only your public address, the network, the coin and the amount are sent. Coinbase handles the payment and any ID checks, and its own fees and limits apply.
|
|
125
|
+
|
|
126
|
+
## Cash out to your bank
|
|
127
|
+
|
|
128
|
+
**Sell** on the Home tab sells USDC, ETH or SOL through Coinbase to your bank or PayPal. You need a Coinbase account. The wallet opens Coinbase's sell page; you choose where the money goes and click **Cash out now**. Coinbase then gives an address to send the crypto to, and the dashboard shows it with the amount, Coinbase's fee and what you'll receive. Nothing is sent until you confirm with your password. Coinbase allows 30 minutes for the send. Only your public address, the network, the coin and the amount go to Tollkit's server.
|
|
129
|
+
|
|
130
|
+
## Move between networks
|
|
131
|
+
|
|
132
|
+
**Move** on the Home tab sends your own USDC between Base, Ethereum and Solana, or ETH between Base and Ethereum, to this wallet's address on the other network.
|
|
133
|
+
|
|
134
|
+
- USDC uses Circle's own transfer (CCTP): it's burned on one network and minted on the other by Circle, usually in 8 to 20 seconds. Circle's forwarding service pays the network fee on arrival, so you don't need gas there.
|
|
135
|
+
- ETH goes through Across, usually in under a minute.
|
|
136
|
+
- Tollkit's fee is 0.25%. Circle's or Across's fee, and the amount you'll receive at least, are shown before you confirm. Moves need your password and don't count against your spending limits.
|
|
137
|
+
|
|
138
|
+
## Stake SOL
|
|
139
|
+
|
|
140
|
+
**Stake** on the Home tab stakes SOL with a validator you pick from the ones currently voting, listed by how much SOL is staked with them, with their fee. The minimum is set by the network (1 SOL as of October 2026) and read live. Stakes start earning after the current epoch ends (about a day). Unstake any time; once the epoch ends, **Withdraw** returns the SOL to your wallet. The wallet keeps both stake and withdraw authority, and staking needs your password.
|
|
141
|
+
|
|
95
142
|
## Where things live
|
|
96
143
|
|
|
97
144
|
`~/.tollkit-wallet/` (or `TOLLKIT_WALLET_HOME`) holds:
|
|
@@ -120,7 +167,7 @@ tollkit-wallet rule pause <id> # or: rule on <id>, rule cancel <id>
|
|
|
120
167
|
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.
|
|
121
168
|
|
|
122
169
|
- Every fill goes through the same limits, approvals and receipts as any swap, and pays the same 0.5% fee.
|
|
123
|
-
- 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
|
|
170
|
+
- 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 Settings (or `budget agent_rules=auto`).
|
|
124
171
|
- 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.
|
|
125
172
|
- 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.
|
|
126
173
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -15,3 +15,7 @@ The coin and network names and logos are trademarks of their owners and are used
|
|
|
15
15
|
## Simple Icons
|
|
16
16
|
|
|
17
17
|
The Claude, Cursor, GitHub Copilot and Gemini logos in the dashboard's "Connect your AI" picker (`src/ai-icons.ts`) come from Simple Icons (https://simpleicons.org), whose data is released under CC0 1.0. The logos are trademarks of their owners and are shown only to say which apps work with the wallet.
|
|
18
|
+
|
|
19
|
+
## Wallet Standard (extension/inpage.js)
|
|
20
|
+
|
|
21
|
+
The Solana wallet registration in `extension/inpage.js` follows `registerWallet` from `@wallet-standard/wallet` (https://github.com/wallet-standard/wallet-standard), Apache License 2.0. The feature names and shapes come from `@wallet-standard/features` and `@solana/wallet-standard-features` (Apache License 2.0).
|
package/dist/actions.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* addresses.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
export { isLocalUrl } from "./netguard.js";
|
|
8
9
|
import type { TollkitWallet } from "./wallet.js";
|
|
9
10
|
export declare const SwapArgs: z.ZodObject<{
|
|
10
11
|
chain: z.ZodEnum<["base", "ethereum", "solana"]>;
|
|
@@ -32,12 +33,12 @@ export declare const PayArgs: z.ZodObject<{
|
|
|
32
33
|
body: z.ZodOptional<z.ZodString>;
|
|
33
34
|
}, "strip", z.ZodTypeAny, {
|
|
34
35
|
url: string;
|
|
35
|
-
method?: "
|
|
36
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
36
37
|
headers?: Record<string, string> | undefined;
|
|
37
38
|
body?: string | undefined;
|
|
38
39
|
}, {
|
|
39
40
|
url: string;
|
|
40
|
-
method?: "
|
|
41
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
41
42
|
headers?: Record<string, string> | undefined;
|
|
42
43
|
body?: string | undefined;
|
|
43
44
|
}>;
|
|
@@ -83,12 +84,12 @@ export declare const ProposeArgs: z.ZodObject<{
|
|
|
83
84
|
reason: z.ZodOptional<z.ZodString>;
|
|
84
85
|
replaces: z.ZodOptional<z.ZodString>;
|
|
85
86
|
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
chain: "base" | "ethereum" | "solana";
|
|
87
87
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
88
|
+
chain: "base" | "ethereum" | "solana";
|
|
88
89
|
token: string;
|
|
89
90
|
every?: "hour" | "day" | "week" | undefined;
|
|
90
|
-
reason?: string | undefined;
|
|
91
91
|
name?: string | undefined;
|
|
92
|
+
reason?: string | undefined;
|
|
92
93
|
sell_amount?: string | undefined;
|
|
93
94
|
amount_usd?: number | undefined;
|
|
94
95
|
sell_percent?: number | undefined;
|
|
@@ -101,12 +102,12 @@ export declare const ProposeArgs: z.ZodObject<{
|
|
|
101
102
|
expires_at?: string | undefined;
|
|
102
103
|
replaces?: string | undefined;
|
|
103
104
|
}, {
|
|
104
|
-
chain: "base" | "ethereum" | "solana";
|
|
105
105
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
106
|
+
chain: "base" | "ethereum" | "solana";
|
|
106
107
|
token: string;
|
|
107
108
|
every?: "hour" | "day" | "week" | undefined;
|
|
108
|
-
reason?: string | undefined;
|
|
109
109
|
name?: string | undefined;
|
|
110
|
+
reason?: string | undefined;
|
|
110
111
|
sell_amount?: string | undefined;
|
|
111
112
|
amount_usd?: number | undefined;
|
|
112
113
|
sell_percent?: number | undefined;
|
|
@@ -121,12 +122,12 @@ export declare const ProposeArgs: z.ZodObject<{
|
|
|
121
122
|
}>, "many">>;
|
|
122
123
|
}, "strip", z.ZodTypeAny, {
|
|
123
124
|
rules?: {
|
|
124
|
-
chain: "base" | "ethereum" | "solana";
|
|
125
125
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
126
|
+
chain: "base" | "ethereum" | "solana";
|
|
126
127
|
token: string;
|
|
127
128
|
every?: "hour" | "day" | "week" | undefined;
|
|
128
|
-
reason?: string | undefined;
|
|
129
129
|
name?: string | undefined;
|
|
130
|
+
reason?: string | undefined;
|
|
130
131
|
sell_amount?: string | undefined;
|
|
131
132
|
amount_usd?: number | undefined;
|
|
132
133
|
sell_percent?: number | undefined;
|
|
@@ -142,12 +143,12 @@ export declare const ProposeArgs: z.ZodObject<{
|
|
|
142
143
|
text?: string | undefined;
|
|
143
144
|
}, {
|
|
144
145
|
rules?: {
|
|
145
|
-
chain: "base" | "ethereum" | "solana";
|
|
146
146
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
147
|
+
chain: "base" | "ethereum" | "solana";
|
|
147
148
|
token: string;
|
|
148
149
|
every?: "hour" | "day" | "week" | undefined;
|
|
149
|
-
reason?: string | undefined;
|
|
150
150
|
name?: string | undefined;
|
|
151
|
+
reason?: string | undefined;
|
|
151
152
|
sell_amount?: string | undefined;
|
|
152
153
|
amount_usd?: number | undefined;
|
|
153
154
|
sell_percent?: number | undefined;
|
|
@@ -165,9 +166,9 @@ export declare const ProposeArgs: z.ZodObject<{
|
|
|
165
166
|
export declare const RulesListArgs: z.ZodObject<{
|
|
166
167
|
status: z.ZodOptional<z.ZodEnum<["proposed", "active", "paused", "done", "cancelled", "expired", "error"]>>;
|
|
167
168
|
}, "strip", z.ZodTypeAny, {
|
|
168
|
-
status?: "
|
|
169
|
+
status?: "error" | "done" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
169
170
|
}, {
|
|
170
|
-
status?: "
|
|
171
|
+
status?: "error" | "done" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
171
172
|
}>;
|
|
172
173
|
export declare const RuleIdArgs: z.ZodObject<{
|
|
173
174
|
id: z.ZodString;
|
|
@@ -182,12 +183,12 @@ export declare const HistoryArgs: z.ZodObject<{
|
|
|
182
183
|
points: z.ZodOptional<z.ZodNumber>;
|
|
183
184
|
}, "strip", z.ZodTypeAny, {
|
|
184
185
|
token: "ETH" | "WETH" | "SOL";
|
|
185
|
-
interval?: "15m" | "1h" | "6h" | "1d" | undefined;
|
|
186
186
|
points?: number | undefined;
|
|
187
|
+
interval?: "1h" | "1d" | "15m" | "6h" | undefined;
|
|
187
188
|
}, {
|
|
188
189
|
token: "ETH" | "WETH" | "SOL";
|
|
189
|
-
interval?: "15m" | "1h" | "6h" | "1d" | undefined;
|
|
190
190
|
points?: number | undefined;
|
|
191
|
+
interval?: "1h" | "1d" | "15m" | "6h" | undefined;
|
|
191
192
|
}>;
|
|
192
193
|
/** Coinbase Exchange public candles: [time, low, high, open, close, volume], newest first, at most 300, no key. */
|
|
193
194
|
export declare function priceHistory(a: z.infer<typeof HistoryArgs>, f?: typeof fetch): Promise<{
|
|
@@ -210,7 +211,7 @@ export declare function priceHistory(a: z.infer<typeof HistoryArgs>, f?: typeof
|
|
|
210
211
|
} | {
|
|
211
212
|
ok: boolean;
|
|
212
213
|
token: "ETH" | "WETH" | "SOL";
|
|
213
|
-
interval: "
|
|
214
|
+
interval: "1h" | "1d" | "15m" | "6h";
|
|
214
215
|
source: string;
|
|
215
216
|
from: string;
|
|
216
217
|
to: string;
|
|
@@ -278,12 +279,12 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
278
279
|
body: z.ZodOptional<z.ZodString>;
|
|
279
280
|
}, "strip", z.ZodTypeAny, {
|
|
280
281
|
url: string;
|
|
281
|
-
method?: "
|
|
282
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
282
283
|
headers?: Record<string, string> | undefined;
|
|
283
284
|
body?: string | undefined;
|
|
284
285
|
}, {
|
|
285
286
|
url: string;
|
|
286
|
-
method?: "
|
|
287
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
|
|
287
288
|
headers?: Record<string, string> | undefined;
|
|
288
289
|
body?: string | undefined;
|
|
289
290
|
}>>, WalletAction<z.ZodObject<{
|
|
@@ -310,12 +311,12 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
310
311
|
points: z.ZodOptional<z.ZodNumber>;
|
|
311
312
|
}, "strip", z.ZodTypeAny, {
|
|
312
313
|
token: "ETH" | "WETH" | "SOL";
|
|
313
|
-
interval?: "15m" | "1h" | "6h" | "1d" | undefined;
|
|
314
314
|
points?: number | undefined;
|
|
315
|
+
interval?: "1h" | "1d" | "15m" | "6h" | undefined;
|
|
315
316
|
}, {
|
|
316
317
|
token: "ETH" | "WETH" | "SOL";
|
|
317
|
-
interval?: "15m" | "1h" | "6h" | "1d" | undefined;
|
|
318
318
|
points?: number | undefined;
|
|
319
|
+
interval?: "1h" | "1d" | "15m" | "6h" | undefined;
|
|
319
320
|
}>>, WalletAction<z.ZodObject<{
|
|
320
321
|
text: z.ZodOptional<z.ZodString>;
|
|
321
322
|
rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -337,12 +338,12 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
337
338
|
reason: z.ZodOptional<z.ZodString>;
|
|
338
339
|
replaces: z.ZodOptional<z.ZodString>;
|
|
339
340
|
}, "strip", z.ZodTypeAny, {
|
|
340
|
-
chain: "base" | "ethereum" | "solana";
|
|
341
341
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
342
|
+
chain: "base" | "ethereum" | "solana";
|
|
342
343
|
token: string;
|
|
343
344
|
every?: "hour" | "day" | "week" | undefined;
|
|
344
|
-
reason?: string | undefined;
|
|
345
345
|
name?: string | undefined;
|
|
346
|
+
reason?: string | undefined;
|
|
346
347
|
sell_amount?: string | undefined;
|
|
347
348
|
amount_usd?: number | undefined;
|
|
348
349
|
sell_percent?: number | undefined;
|
|
@@ -355,12 +356,12 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
355
356
|
expires_at?: string | undefined;
|
|
356
357
|
replaces?: string | undefined;
|
|
357
358
|
}, {
|
|
358
|
-
chain: "base" | "ethereum" | "solana";
|
|
359
359
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
360
|
+
chain: "base" | "ethereum" | "solana";
|
|
360
361
|
token: string;
|
|
361
362
|
every?: "hour" | "day" | "week" | undefined;
|
|
362
|
-
reason?: string | undefined;
|
|
363
363
|
name?: string | undefined;
|
|
364
|
+
reason?: string | undefined;
|
|
364
365
|
sell_amount?: string | undefined;
|
|
365
366
|
amount_usd?: number | undefined;
|
|
366
367
|
sell_percent?: number | undefined;
|
|
@@ -375,12 +376,12 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
375
376
|
}>, "many">>;
|
|
376
377
|
}, "strip", z.ZodTypeAny, {
|
|
377
378
|
rules?: {
|
|
378
|
-
chain: "base" | "ethereum" | "solana";
|
|
379
379
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
380
|
+
chain: "base" | "ethereum" | "solana";
|
|
380
381
|
token: string;
|
|
381
382
|
every?: "hour" | "day" | "week" | undefined;
|
|
382
|
-
reason?: string | undefined;
|
|
383
383
|
name?: string | undefined;
|
|
384
|
+
reason?: string | undefined;
|
|
384
385
|
sell_amount?: string | undefined;
|
|
385
386
|
amount_usd?: number | undefined;
|
|
386
387
|
sell_percent?: number | undefined;
|
|
@@ -396,12 +397,12 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
396
397
|
text?: string | undefined;
|
|
397
398
|
}, {
|
|
398
399
|
rules?: {
|
|
399
|
-
chain: "base" | "ethereum" | "solana";
|
|
400
400
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
401
|
+
chain: "base" | "ethereum" | "solana";
|
|
401
402
|
token: string;
|
|
402
403
|
every?: "hour" | "day" | "week" | undefined;
|
|
403
|
-
reason?: string | undefined;
|
|
404
404
|
name?: string | undefined;
|
|
405
|
+
reason?: string | undefined;
|
|
405
406
|
sell_amount?: string | undefined;
|
|
406
407
|
amount_usd?: number | undefined;
|
|
407
408
|
sell_percent?: number | undefined;
|
|
@@ -418,9 +419,9 @@ export declare const ACTIONS: readonly [WalletAction<z.ZodObject<{}, "strip", z.
|
|
|
418
419
|
}>>, WalletAction<z.ZodObject<{
|
|
419
420
|
status: z.ZodOptional<z.ZodEnum<["proposed", "active", "paused", "done", "cancelled", "expired", "error"]>>;
|
|
420
421
|
}, "strip", z.ZodTypeAny, {
|
|
421
|
-
status?: "
|
|
422
|
+
status?: "error" | "done" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
422
423
|
}, {
|
|
423
|
-
status?: "
|
|
424
|
+
status?: "error" | "done" | "proposed" | "active" | "paused" | "cancelled" | "expired" | undefined;
|
|
424
425
|
}>>, WalletAction<z.ZodObject<{
|
|
425
426
|
id: z.ZodString;
|
|
426
427
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -479,12 +480,12 @@ export declare function proposeRules(w: TollkitWallet, a: z.infer<typeof Propose
|
|
|
479
480
|
created_by: "owner" | "agent";
|
|
480
481
|
created_at: string;
|
|
481
482
|
activated_at?: string;
|
|
482
|
-
chain: "base" | "ethereum" | "solana";
|
|
483
483
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
484
|
+
chain: "base" | "ethereum" | "solana";
|
|
484
485
|
token: string;
|
|
485
486
|
every?: "hour" | "day" | "week" | undefined;
|
|
486
|
-
reason?: string | undefined;
|
|
487
487
|
name?: string | undefined;
|
|
488
|
+
reason?: string | undefined;
|
|
488
489
|
sell_amount?: string | undefined;
|
|
489
490
|
amount_usd?: number | undefined;
|
|
490
491
|
sell_percent?: number | undefined;
|
|
@@ -518,12 +519,12 @@ export declare function proposeRules(w: TollkitWallet, a: z.infer<typeof Propose
|
|
|
518
519
|
created_by: "owner" | "agent";
|
|
519
520
|
created_at: string;
|
|
520
521
|
activated_at?: string;
|
|
521
|
-
chain: "base" | "ethereum" | "solana";
|
|
522
522
|
kind: "limit_buy" | "limit_sell" | "stop_loss" | "take_profit" | "trailing_stop" | "dca";
|
|
523
|
+
chain: "base" | "ethereum" | "solana";
|
|
523
524
|
token: string;
|
|
524
525
|
every?: "hour" | "day" | "week" | undefined;
|
|
525
|
-
reason?: string | undefined;
|
|
526
526
|
name?: string | undefined;
|
|
527
|
+
reason?: string | undefined;
|
|
527
528
|
sell_amount?: string | undefined;
|
|
528
529
|
amount_usd?: number | undefined;
|
|
529
530
|
sell_percent?: number | undefined;
|
package/dist/actions.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* addresses.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
import { isLocalUrl } from "./netguard.js";
|
|
9
|
+
export { isLocalUrl } from "./netguard.js";
|
|
8
10
|
import { resolveToken, toAtomic } from "./tokens.js";
|
|
9
11
|
import { checkSeller } from "./seller.js";
|
|
10
12
|
import { RuleInput, describeRule, ruleProblem } from "./rules.js";
|
|
@@ -95,7 +97,9 @@ export const ACTIONS = [
|
|
|
95
97
|
def({ name: "pay_fetch", spends: true, schema: PayArgs,
|
|
96
98
|
description: "Fetch a URL and pay for it if it asks (x402 or MPP, USDC/USDT on Base, Ethereum or Solana). Checks the seller, screens the recipient against OFAC, stays within the owner's limits. Returns the response body.",
|
|
97
99
|
run: async (w, a) => {
|
|
98
|
-
|
|
100
|
+
if (isLocalUrl(a.url))
|
|
101
|
+
return { paid: false, status: 0, refused: { code: "local_address", reason: "pay_fetch only calls public internet addresses." } };
|
|
102
|
+
const r = await w.pay(a.url, { method: a.method ?? (a.body ? "POST" : "GET"), headers: a.headers, body: a.body }, { publicOnly: true });
|
|
99
103
|
let body;
|
|
100
104
|
if (r.response) {
|
|
101
105
|
const t = await r.response.text();
|
package/dist/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,CAAC,CA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,CAAC;IAAC,CAAC;IACrK,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,KAAK,MAAM,EAAE,IAAI,GAAG,EAAmC,CAAC;IAC5H,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QAAC,IAAI,CAAC;YAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,KAAM,CAAW,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAAC,CAAC;IAAC,CAAC;IAC5O,OAAO;QACL,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ;QAC/B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,+GAA+G,CAAC,CAAC,CAAC,+HAA+H;KAC/P,CAAC;AACJ,CAAC"}
|
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Connection, Keypair, PublicKey, Transaction, TransactionInstruction } from "@solana/web3.js";
|
|
2
|
+
import { type HDNodeWallet, type Wallet } from "ethers";
|
|
3
|
+
import { type Chain } from "./chains.js";
|
|
4
|
+
type Fetch = typeof fetch;
|
|
5
|
+
type Keys = {
|
|
6
|
+
evm: Wallet | HDNodeWallet;
|
|
7
|
+
solana: Keypair;
|
|
8
|
+
};
|
|
9
|
+
export type MoveAsset = "USDC" | "ETH";
|
|
10
|
+
export declare const BRIDGE_FEE_BPS = 25;
|
|
11
|
+
export declare const IRIS = "https://iris-api.circle.com";
|
|
12
|
+
export declare const CCTP_DOMAIN: Record<Chain, number>;
|
|
13
|
+
export declare const TOKEN_MESSENGER_V2 = "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d";
|
|
14
|
+
export declare const SOL_TMM: PublicKey;
|
|
15
|
+
export declare const SOL_MT: PublicKey;
|
|
16
|
+
export declare const ACROSS_PERIPHERY = "0x97CCDBea4632140639aD5eA9b944aa034eb15fD4";
|
|
17
|
+
export declare const USDC: Record<Chain, string>;
|
|
18
|
+
/** The Forwarding Service hook: "cctp-forward" padded to 24 bytes, version 0, length 0 (32 bytes). */
|
|
19
|
+
export declare function forwardHook(solanaRecipientSetup?: PublicKey): Uint8Array;
|
|
20
|
+
export declare const canMove: (asset: MoveAsset, from: Chain, to: Chain) => boolean;
|
|
21
|
+
export interface MoveQuote {
|
|
22
|
+
asset: MoveAsset;
|
|
23
|
+
from: Chain;
|
|
24
|
+
to: Chain;
|
|
25
|
+
via: "cctp" | "across";
|
|
26
|
+
/** Everything in atomic units of the asset (USDC 6 decimals, ETH 18). */
|
|
27
|
+
amount: string;
|
|
28
|
+
tollkit_fee: string;
|
|
29
|
+
bridge_fee_max: string;
|
|
30
|
+
receive_min: string;
|
|
31
|
+
eta_seconds: number;
|
|
32
|
+
/** CCTP details. */
|
|
33
|
+
burn?: string;
|
|
34
|
+
max_fee?: string;
|
|
35
|
+
hook?: string;
|
|
36
|
+
mint_recipient?: string;
|
|
37
|
+
recipient_setup?: boolean;
|
|
38
|
+
/** Across transaction to sign (checked). */
|
|
39
|
+
tx?: {
|
|
40
|
+
to: string;
|
|
41
|
+
data: string;
|
|
42
|
+
value: string;
|
|
43
|
+
chainId: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface MoveRecord {
|
|
47
|
+
id: string;
|
|
48
|
+
ts: string;
|
|
49
|
+
asset: MoveAsset;
|
|
50
|
+
from: Chain;
|
|
51
|
+
to: Chain;
|
|
52
|
+
amount: string;
|
|
53
|
+
receive_min: string;
|
|
54
|
+
via: "cctp" | "across";
|
|
55
|
+
tx: string;
|
|
56
|
+
fee_tx?: string;
|
|
57
|
+
state: "sent" | "arrived" | "failed";
|
|
58
|
+
dest_tx?: string;
|
|
59
|
+
eta_seconds: number;
|
|
60
|
+
checked?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare const fmtAmount: (a: MoveAsset, atomic: string | bigint) => string;
|
|
63
|
+
interface Cfg {
|
|
64
|
+
fee_bps: number;
|
|
65
|
+
fee_recipient: {
|
|
66
|
+
evm: string | null;
|
|
67
|
+
solana: string | null;
|
|
68
|
+
};
|
|
69
|
+
across: boolean;
|
|
70
|
+
}
|
|
71
|
+
export type MoverOptions = ConstructorParameters<typeof Mover>[0];
|
|
72
|
+
export declare class Mover {
|
|
73
|
+
private o;
|
|
74
|
+
private cfg;
|
|
75
|
+
private file;
|
|
76
|
+
constructor(o: {
|
|
77
|
+
evm: string;
|
|
78
|
+
solana: string;
|
|
79
|
+
dir?: string;
|
|
80
|
+
proxy: string;
|
|
81
|
+
fetch?: Fetch;
|
|
82
|
+
rpc?: Partial<Record<Chain, string>>;
|
|
83
|
+
/** Tests: replace chain calls. */ sendEvm?: (from: Chain, tx: {
|
|
84
|
+
to: string;
|
|
85
|
+
data: string;
|
|
86
|
+
value?: bigint;
|
|
87
|
+
}, keys: Keys) => Promise<string>;
|
|
88
|
+
sendSolana?: (tx: Transaction, signers: Keypair[]) => Promise<string>;
|
|
89
|
+
solConn?: Pick<Connection, "getAccountInfo" | "getParsedTokenAccountsByOwner" | "getBalance">;
|
|
90
|
+
evmRead?: (from: Chain, what: "usdc" | "eth" | "allowance") => Promise<bigint>;
|
|
91
|
+
});
|
|
92
|
+
private get f();
|
|
93
|
+
private rpc;
|
|
94
|
+
private sol;
|
|
95
|
+
config(): Promise<Cfg>;
|
|
96
|
+
/** The owner's USDC token account on Solana, and whether it exists yet. */
|
|
97
|
+
private solUsdcAccount;
|
|
98
|
+
quote(asset: MoveAsset, from: Chain, to: Chain, amountAtomic: string): Promise<MoveQuote>;
|
|
99
|
+
private quoteCctp;
|
|
100
|
+
private quoteAcross;
|
|
101
|
+
/** Sign and send. Returns the record that the dashboard tracks until it arrives. */
|
|
102
|
+
execute(q: MoveQuote, keys: Keys): Promise<MoveRecord>;
|
|
103
|
+
private evmSend;
|
|
104
|
+
private evmRead;
|
|
105
|
+
private burnFromEvm;
|
|
106
|
+
/** One Solana transaction: Tollkit's fee transfer + CCTP deposit_for_burn_with_hook (all or nothing). */
|
|
107
|
+
solanaBurnTx(q: MoveQuote, owner: PublicKey, cfg: Cfg, event: Keypair, feeAtaExists?: boolean): Promise<Transaction>;
|
|
108
|
+
private burnFromSolana;
|
|
109
|
+
list(): MoveRecord[];
|
|
110
|
+
private save;
|
|
111
|
+
/** Check Circle's attestation service for USDC moves still on their way (at most every 10 s each). */
|
|
112
|
+
refresh(): Promise<MoveRecord[]>;
|
|
113
|
+
}
|
|
114
|
+
/** deposit_for_burn_with_hook, encoded by hand from Circle's IDL (Anchor: 8-byte discriminator + Borsh params). */
|
|
115
|
+
export declare function depositForBurnWithHookIx(a: {
|
|
116
|
+
owner: PublicKey;
|
|
117
|
+
burnTokenAccount: PublicKey;
|
|
118
|
+
mint: PublicKey;
|
|
119
|
+
event: PublicKey;
|
|
120
|
+
amount: bigint;
|
|
121
|
+
destinationDomain: number;
|
|
122
|
+
mintRecipient: Uint8Array;
|
|
123
|
+
maxFee: bigint;
|
|
124
|
+
minFinality: number;
|
|
125
|
+
hook: Uint8Array;
|
|
126
|
+
}): TransactionInstruction;
|
|
127
|
+
/** Across (docs.across.to/chains-and-contracts): SpokePool per network, MulticallHandler on both; WETH from tokens.ts. */
|
|
128
|
+
export declare const ACROSS_SPOKE: Record<"base" | "ethereum", string>;
|
|
129
|
+
export declare const ACROSS_MULTICALL = "0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E";
|
|
130
|
+
/**
|
|
131
|
+
* Decode and check an Across ETH deposit before signing: Across's SpokePool on this network, from this wallet,
|
|
132
|
+
* ETH in for exactly the amount, ETH out on the other network to this wallet (directly, or through Across's
|
|
133
|
+
* MulticallHandler whose only steps unwrap WETH, pay Tollkit's fee, and send everything left to this wallet).
|
|
134
|
+
* Returns what's actually delivered, Tollkit's fee, and what this wallet receives at least.
|
|
135
|
+
*/
|
|
136
|
+
export declare function checkAcrossDeposit(data: string, o: {
|
|
137
|
+
from: "base" | "ethereum";
|
|
138
|
+
to: "base" | "ethereum";
|
|
139
|
+
amount: bigint;
|
|
140
|
+
me: string;
|
|
141
|
+
feeRecipient: string;
|
|
142
|
+
feeBps: number;
|
|
143
|
+
}): {
|
|
144
|
+
output: bigint;
|
|
145
|
+
fee: bigint;
|
|
146
|
+
receive: bigint;
|
|
147
|
+
};
|
|
148
|
+
export {};
|