oneie 5.7.6 → 5.8.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.
Files changed (245) hide show
  1. package/README.md +19 -1
  2. package/dist/package.json +7 -8
  3. package/dist/src/age-yefbe8pe.js +1 -0
  4. package/dist/src/evm-tx-ee2q0e3w.js +1 -0
  5. package/dist/src/hl-run-tgrkrk69.js +1 -0
  6. package/dist/src/index-0rj9wdk9.js +4 -0
  7. package/dist/src/index-91y484c2.js +2052 -0
  8. package/dist/src/index-940y3rnv.js +12 -0
  9. package/dist/src/index.js +1047 -121
  10. package/dist/src/message-key-db1xjdkw.js +1 -0
  11. package/dist/src/message-lock-5vr8079x.js +5 -0
  12. package/dist/src/sweep-order-c2p6rk8c.js +1 -0
  13. package/dist/src/sweep-runner-t68xe7vx.js +1 -0
  14. package/package.json +7 -8
  15. package/dist/src/agent.d.ts +0 -75
  16. package/dist/src/agent.js +0 -1334
  17. package/dist/src/agentverse.d.ts +0 -26
  18. package/dist/src/agentverse.js +0 -171
  19. package/dist/src/args.d.ts +0 -9
  20. package/dist/src/args.js +0 -61
  21. package/dist/src/auth.d.ts +0 -6
  22. package/dist/src/auth.js +0 -121
  23. package/dist/src/balances.d.ts +0 -89
  24. package/dist/src/balances.js +0 -202
  25. package/dist/src/banner.d.ts +0 -1
  26. package/dist/src/banner.js +0 -17
  27. package/dist/src/broadcast.d.ts +0 -8
  28. package/dist/src/broadcast.js +0 -175
  29. package/dist/src/catalog.d.ts +0 -12
  30. package/dist/src/catalog.js +0 -76
  31. package/dist/src/chat.d.ts +0 -2
  32. package/dist/src/chat.js +0 -92
  33. package/dist/src/client.d.ts +0 -5
  34. package/dist/src/client.js +0 -157
  35. package/dist/src/compiler.d.ts +0 -36
  36. package/dist/src/compiler.js +0 -366
  37. package/dist/src/config.d.ts +0 -24
  38. package/dist/src/config.js +0 -70
  39. package/dist/src/connect.d.ts +0 -2
  40. package/dist/src/connect.js +0 -64
  41. package/dist/src/coordinate.d.ts +0 -3
  42. package/dist/src/coordinate.js +0 -58
  43. package/dist/src/create.d.ts +0 -2
  44. package/dist/src/create.js +0 -113
  45. package/dist/src/deploy.d.ts +0 -2
  46. package/dist/src/deploy.js +0 -19
  47. package/dist/src/dev.d.ts +0 -2
  48. package/dist/src/dev.js +0 -75
  49. package/dist/src/device-flow.d.ts +0 -57
  50. package/dist/src/device-flow.js +0 -173
  51. package/dist/src/doctor.d.ts +0 -26
  52. package/dist/src/doctor.js +0 -146
  53. package/dist/src/draw.d.ts +0 -18
  54. package/dist/src/draw.js +0 -156
  55. package/dist/src/endpoint.d.ts +0 -2
  56. package/dist/src/endpoint.js +0 -250
  57. package/dist/src/env.d.ts +0 -3
  58. package/dist/src/env.js +0 -37
  59. package/dist/src/eval.d.ts +0 -2
  60. package/dist/src/eval.js +0 -43
  61. package/dist/src/fn.d.ts +0 -2
  62. package/dist/src/fn.js +0 -70
  63. package/dist/src/group.d.ts +0 -2
  64. package/dist/src/group.js +0 -117
  65. package/dist/src/hl-run.d.ts +0 -119
  66. package/dist/src/hl-run.js +0 -480
  67. package/dist/src/hl.d.ts +0 -17
  68. package/dist/src/hl.js +0 -148
  69. package/dist/src/index.d.ts +0 -2
  70. package/dist/src/init.d.ts +0 -76
  71. package/dist/src/init.js +0 -278
  72. package/dist/src/join.d.ts +0 -11
  73. package/dist/src/join.js +0 -293
  74. package/dist/src/key-publish.d.ts +0 -40
  75. package/dist/src/key-publish.js +0 -232
  76. package/dist/src/key-seal.d.ts +0 -21
  77. package/dist/src/key-seal.js +0 -142
  78. package/dist/src/key-sweep.d.ts +0 -93
  79. package/dist/src/key-sweep.js +0 -263
  80. package/dist/src/key.d.ts +0 -26
  81. package/dist/src/key.js +0 -338
  82. package/dist/src/lib/age-plugin.d.ts +0 -51
  83. package/dist/src/lib/age-plugin.js +0 -130
  84. package/dist/src/lib/agent-env.d.ts +0 -12
  85. package/dist/src/lib/agent-env.js +0 -48
  86. package/dist/src/lib/api-path.d.ts +0 -2
  87. package/dist/src/lib/api-path.js +0 -40
  88. package/dist/src/lib/asker.d.ts +0 -34
  89. package/dist/src/lib/asker.js +0 -126
  90. package/dist/src/lib/client.d.ts +0 -20
  91. package/dist/src/lib/client.js +0 -71
  92. package/dist/src/lib/env-sealed.d.ts +0 -53
  93. package/dist/src/lib/env-sealed.js +0 -184
  94. package/dist/src/lib/flow-tag.d.ts +0 -86
  95. package/dist/src/lib/flow-tag.js +0 -230
  96. package/dist/src/lib/hl-core/actions.d.ts +0 -99
  97. package/dist/src/lib/hl-core/actions.js +0 -69
  98. package/dist/src/lib/hl-core/eip712.d.ts +0 -33
  99. package/dist/src/lib/hl-core/eip712.js +0 -107
  100. package/dist/src/lib/hl-core/errors.d.ts +0 -10
  101. package/dist/src/lib/hl-core/errors.js +0 -15
  102. package/dist/src/lib/hl-core/exchange.d.ts +0 -24
  103. package/dist/src/lib/hl-core/exchange.js +0 -47
  104. package/dist/src/lib/hl-core/index.d.ts +0 -13
  105. package/dist/src/lib/hl-core/index.js +0 -14
  106. package/dist/src/lib/hl-core/meta.d.ts +0 -57
  107. package/dist/src/lib/hl-core/meta.js +0 -110
  108. package/dist/src/lib/hl-core/msgpack.d.ts +0 -18
  109. package/dist/src/lib/hl-core/msgpack.js +0 -136
  110. package/dist/src/lib/hl-core/net.d.ts +0 -2
  111. package/dist/src/lib/hl-core/net.js +0 -7
  112. package/dist/src/lib/hl-core/signing.d.ts +0 -103
  113. package/dist/src/lib/hl-core/signing.js +0 -295
  114. package/dist/src/lib/hl-core/wire.d.ts +0 -34
  115. package/dist/src/lib/hl-core/wire.js +0 -81
  116. package/dist/src/lib/invoked-as.d.ts +0 -2
  117. package/dist/src/lib/invoked-as.js +0 -24
  118. package/dist/src/lib/journey-words.d.ts +0 -84
  119. package/dist/src/lib/journey-words.js +0 -360
  120. package/dist/src/lib/journey.d.ts +0 -148
  121. package/dist/src/lib/journey.js +0 -245
  122. package/dist/src/lib/key-receipt.d.ts +0 -48
  123. package/dist/src/lib/key-receipt.js +0 -116
  124. package/dist/src/lib/key-source.d.ts +0 -9
  125. package/dist/src/lib/key-source.js +0 -33
  126. package/dist/src/lib/keyfile.d.ts +0 -136
  127. package/dist/src/lib/keyfile.js +0 -397
  128. package/dist/src/lib/launch-claude.d.ts +0 -5
  129. package/dist/src/lib/launch-claude.js +0 -45
  130. package/dist/src/lib/lock-lookup.d.ts +0 -40
  131. package/dist/src/lib/lock-lookup.js +0 -92
  132. package/dist/src/lib/message-seal.d.ts +0 -63
  133. package/dist/src/lib/message-seal.js +0 -150
  134. package/dist/src/lib/network.d.ts +0 -15
  135. package/dist/src/lib/network.js +0 -41
  136. package/dist/src/lib/paths.d.ts +0 -41
  137. package/dist/src/lib/paths.js +0 -91
  138. package/dist/src/lib/plan-draw.d.ts +0 -56
  139. package/dist/src/lib/plan-draw.js +0 -219
  140. package/dist/src/lib/plan-live.d.ts +0 -20
  141. package/dist/src/lib/plan-live.js +0 -192
  142. package/dist/src/lib/qr.d.ts +0 -21
  143. package/dist/src/lib/qr.js +0 -402
  144. package/dist/src/lib/roster.d.ts +0 -20
  145. package/dist/src/lib/roster.js +0 -79
  146. package/dist/src/lib/sale-card.d.ts +0 -117
  147. package/dist/src/lib/sale-card.js +0 -261
  148. package/dist/src/lib/shop-init.d.ts +0 -62
  149. package/dist/src/lib/shop-init.js +0 -63
  150. package/dist/src/lib/sui-grpc-send.d.ts +0 -50
  151. package/dist/src/lib/sui-grpc-send.js +0 -89
  152. package/dist/src/lib/swap-core.d.ts +0 -163
  153. package/dist/src/lib/swap-core.js +0 -405
  154. package/dist/src/lib/tasks-digest.d.ts +0 -66
  155. package/dist/src/lib/tasks-digest.js +0 -200
  156. package/dist/src/lib/tasks-graph.d.ts +0 -79
  157. package/dist/src/lib/tasks-graph.js +0 -463
  158. package/dist/src/lib/tasks-lens.d.ts +0 -31
  159. package/dist/src/lib/tasks-lens.js +0 -47
  160. package/dist/src/lib/tasks-next.d.ts +0 -25
  161. package/dist/src/lib/tasks-next.js +0 -103
  162. package/dist/src/lib/tasks-prove.d.ts +0 -15
  163. package/dist/src/lib/tasks-prove.js +0 -68
  164. package/dist/src/lib/tasks-route.d.ts +0 -29
  165. package/dist/src/lib/tasks-route.js +0 -151
  166. package/dist/src/lib/tasks-score.d.ts +0 -36
  167. package/dist/src/lib/tasks-score.js +0 -152
  168. package/dist/src/lib/tasks-workspace.d.ts +0 -18
  169. package/dist/src/lib/tasks-workspace.js +0 -73
  170. package/dist/src/lib/vault-read.d.ts +0 -24
  171. package/dist/src/lib/vault-read.js +0 -77
  172. package/dist/src/lib/vaultfile.d.ts +0 -88
  173. package/dist/src/lib/vaultfile.js +0 -222
  174. package/dist/src/lib/wallet-money.d.ts +0 -222
  175. package/dist/src/lib/wallet-money.js +0 -578
  176. package/dist/src/lib/wallet-request.d.ts +0 -50
  177. package/dist/src/lib/wallet-request.js +0 -86
  178. package/dist/src/links.d.ts +0 -5
  179. package/dist/src/links.js +0 -45
  180. package/dist/src/media.d.ts +0 -29
  181. package/dist/src/media.js +0 -487
  182. package/dist/src/message-receipt.d.ts +0 -25
  183. package/dist/src/message-receipt.js +0 -71
  184. package/dist/src/message.d.ts +0 -13
  185. package/dist/src/message.js +0 -92
  186. package/dist/src/onboard.d.ts +0 -16
  187. package/dist/src/onboard.js +0 -149
  188. package/dist/src/plugin.d.ts +0 -2
  189. package/dist/src/plugin.js +0 -193
  190. package/dist/src/push.d.ts +0 -2
  191. package/dist/src/push.js +0 -115
  192. package/dist/src/render.d.ts +0 -21
  193. package/dist/src/render.js +0 -32
  194. package/dist/src/secrets-device.d.ts +0 -32
  195. package/dist/src/secrets-device.js +0 -127
  196. package/dist/src/secrets-give.d.ts +0 -125
  197. package/dist/src/secrets-give.js +0 -236
  198. package/dist/src/secrets-list.d.ts +0 -27
  199. package/dist/src/secrets-list.js +0 -84
  200. package/dist/src/secrets-run.d.ts +0 -31
  201. package/dist/src/secrets-run.js +0 -182
  202. package/dist/src/secrets.d.ts +0 -33
  203. package/dist/src/secrets.js +0 -200
  204. package/dist/src/setup.d.ts +0 -6
  205. package/dist/src/setup.js +0 -127
  206. package/dist/src/ship.d.ts +0 -2
  207. package/dist/src/ship.js +0 -18
  208. package/dist/src/shop.d.ts +0 -10
  209. package/dist/src/shop.js +0 -110
  210. package/dist/src/skill-parser.d.ts +0 -14
  211. package/dist/src/skill-parser.js +0 -113
  212. package/dist/src/skill.d.ts +0 -2
  213. package/dist/src/skill.js +0 -493
  214. package/dist/src/slug.d.ts +0 -2
  215. package/dist/src/slug.js +0 -6
  216. package/dist/src/social.d.ts +0 -2
  217. package/dist/src/social.js +0 -106
  218. package/dist/src/staff.d.ts +0 -2
  219. package/dist/src/staff.js +0 -104
  220. package/dist/src/start.d.ts +0 -15
  221. package/dist/src/start.js +0 -203
  222. package/dist/src/status.d.ts +0 -2
  223. package/dist/src/status.js +0 -52
  224. package/dist/src/substrate.d.ts +0 -2
  225. package/dist/src/substrate.js +0 -258
  226. package/dist/src/swap.d.ts +0 -93
  227. package/dist/src/swap.js +0 -622
  228. package/dist/src/tasks.d.ts +0 -2
  229. package/dist/src/tasks.js +0 -743
  230. package/dist/src/templates.d.ts +0 -1
  231. package/dist/src/templates.js +0 -213
  232. package/dist/src/trade.d.ts +0 -2
  233. package/dist/src/trade.js +0 -91
  234. package/dist/src/trail.d.ts +0 -2
  235. package/dist/src/trail.js +0 -41
  236. package/dist/src/validate.d.ts +0 -13
  237. package/dist/src/validate.js +0 -35
  238. package/dist/src/wallet-money.d.ts +0 -152
  239. package/dist/src/wallet-money.js +0 -564
  240. package/dist/src/wallet.d.ts +0 -167
  241. package/dist/src/wallet.js +0 -855
  242. package/dist/src/workflow.d.ts +0 -2
  243. package/dist/src/workflow.js +0 -166
  244. package/dist/src/write.d.ts +0 -43
  245. package/dist/src/write.js +0 -180
package/dist/src/fn.js DELETED
@@ -1,70 +0,0 @@
1
- import { Command } from 'commander';
2
- import { FN_MAP, FN_MAP_VERSION } from '@oneie/sdk/generated/fn-map';
3
- // The allowlist is ONE source (`@oneie/sdk/fn-allowlist`) shared by web, MCP, CLI
4
- // and channels — never a literal copied per surface.
5
- import { FN_ALLOWLIST, isAllowedFn } from '@oneie/sdk/fn-allowlist';
6
- const DEFAULT_API = process.env.ONEIE_BASE_URL ?? process.env.ONE_API_URL ?? 'https://api.one.ie';
7
- function apiKey() {
8
- return process.env.ONEIE_API_KEY ?? process.env.ONE_API_KEY ?? '';
9
- }
10
- function base(opts) {
11
- return (opts.api ?? DEFAULT_API).replace(/\/$/, '');
12
- }
13
- async function api(url, body) {
14
- const h = { 'Content-Type': 'application/json' };
15
- const k = apiKey();
16
- if (k)
17
- h['Authorization'] = `Bearer ${k}`;
18
- const res = await fetch(url, { method: 'POST', headers: h, body: JSON.stringify(body) });
19
- if (!res.ok) {
20
- const text = await res.text().catch(() => '');
21
- process.stderr.write(`fn:run → ${res.status}\n${text}\n`);
22
- process.exit(1);
23
- }
24
- return res.json();
25
- }
26
- export function fnCmd() {
27
- const cmd = new Command('fn').description(`Execute an allowlisted TypeDB function (FN_MAP v${FN_MAP_VERSION})`);
28
- cmd
29
- .command('list')
30
- .description('List all allowlisted functions')
31
- .action(() => {
32
- const rows = FN_ALLOWLIST.map((name) => {
33
- const entry = FN_MAP[name];
34
- const params = entry?.params.map((p) => p.name).join(', ') ?? '';
35
- return ` ${name.padEnd(28)}${params ? `(${params})` : '()'} → ${entry?.returnKind ?? '?'}`;
36
- });
37
- process.stdout.write(`Allowlisted functions (FN_MAP v${FN_MAP_VERSION}):\n${rows.join('\n')}\n`);
38
- });
39
- cmd
40
- .command('run <name>')
41
- .description('Execute a function by name')
42
- .option('--args <json>', 'Function arguments as JSON object (keys without $ prefix)')
43
- .option('--workspace <slug>', 'Workspace slug')
44
- .option('--api <url>', 'API base URL', DEFAULT_API)
45
- .action(async (name, opts) => {
46
- if (!isAllowedFn(name)) {
47
- process.stderr.write(`error: '${name}' is not in the allowlist. Run 'one fn list' to see available functions.\n`);
48
- process.exit(1);
49
- }
50
- let args = {};
51
- if (opts.args) {
52
- try {
53
- args = JSON.parse(opts.args);
54
- }
55
- catch {
56
- process.stderr.write('error: --args must be valid JSON\n');
57
- process.exit(1);
58
- }
59
- }
60
- const prefixed = {};
61
- for (const [k, v] of Object.entries(args)) {
62
- prefixed[k.startsWith('$') ? k : `$${k}`] = v;
63
- }
64
- const result = await api(`${base(opts)}/api/ask/fn%3Arun`, {
65
- data: { fn: name, args: prefixed, workspace: opts.workspace },
66
- });
67
- process.stdout.write(JSON.stringify(result, null, 2) + '\n');
68
- });
69
- return cmd;
70
- }
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function groupCmd(): Command;
package/dist/src/group.js DELETED
@@ -1,117 +0,0 @@
1
- import { Command } from 'commander';
2
- import { createReadStream, existsSync } from 'node:fs';
3
- import { createInterface } from 'node:readline';
4
- import { out, resolveBase, resolveKey } from './lib/client.js';
5
- import { watchCommands } from './join.js';
6
- const DEFAULT_API = resolveBase({}, 'https://one.ie');
7
- function readApiKey() {
8
- const key = resolveKey();
9
- return key || null;
10
- }
11
- async function parseCsv(file) {
12
- const rows = [];
13
- const rl = createInterface({ input: createReadStream(file), crlfDelay: Infinity });
14
- let headers = [];
15
- let first = true;
16
- for await (const line of rl) {
17
- const cells = line.split(',').map((c) => c.trim());
18
- if (first) {
19
- headers = cells.map((h) => h.toLowerCase());
20
- first = false;
21
- continue;
22
- }
23
- if (!cells.length || cells.every((c) => !c))
24
- continue;
25
- const row = {};
26
- headers.forEach((h, i) => { row[h] = cells[i] ?? ''; });
27
- if (!row.slug && !row.name)
28
- continue;
29
- rows.push({ slug: row.slug, name: row.name, contacts: row.contacts || undefined });
30
- }
31
- return rows;
32
- }
33
- export function groupCmd() {
34
- const cmd = new Command('group').description('Group management');
35
- cmd
36
- .command('bulk-create')
37
- .description('Bulk-provision Groups from a CSV file (idempotent — skips existing slugs)')
38
- .requiredOption('--csv <path>', 'CSV file with slug,name[,contacts] columns')
39
- .option('--segment <segment>', 'ICP segment tag written to each workspace_settings row', 'ICP-1')
40
- .option('--plan <plan>', 'Billing plan for each group', 'free')
41
- .option('--parent <slug>', 'Parent group slug (defaults to authenticated workspace)')
42
- .option('--batch-size <n>', 'Rows per HTTP batch', '50')
43
- .option('--api <url>', 'API base URL', DEFAULT_API)
44
- .option('--dry-run', 'Print plan without writing to D1')
45
- .action(async (opts) => {
46
- if (!existsSync(opts.csv)) {
47
- out(cmd, { ok: false, error: `CSV file not found: ${opts.csv}` });
48
- return;
49
- }
50
- const key = readApiKey();
51
- if (!key && !opts.dryRun) {
52
- out(cmd, { ok: false, error: 'no API key — set ONEIE_API_KEY or run: oneie auth login' });
53
- return;
54
- }
55
- const rows = await parseCsv(opts.csv);
56
- if (rows.length === 0) {
57
- out(cmd, { ok: false, error: 'CSV contains no valid rows (need slug,name columns)' });
58
- return;
59
- }
60
- const batchSize = parseInt(opts.batchSize, 10);
61
- const base = opts.api.replace(/\/$/, '');
62
- const endpoint = `${base}/api/provision/bulk`;
63
- let totalOwners = 0;
64
- let totalDuplicates = 0;
65
- let batchN = 0;
66
- const batches = [];
67
- for (let i = 0; i < rows.length; i += batchSize)
68
- batches.push(rows.slice(i, i + batchSize));
69
- for (const batch of batches) {
70
- batchN++;
71
- if (opts.dryRun) {
72
- process.stdout.write(`[dry-run] batch ${batchN}/${batches.length} rows=${batch.length}\n`);
73
- totalOwners += batch.length;
74
- continue;
75
- }
76
- const body = {
77
- rows: batch.map((r) => ({ slug: r.slug, name: r.name })),
78
- opts: {
79
- parentSlug: opts.parent,
80
- plan: opts.plan,
81
- segment: opts.segment,
82
- },
83
- };
84
- const res = await fetch(endpoint, {
85
- method: 'POST',
86
- headers: {
87
- 'Content-Type': 'application/json',
88
- ...(key ? { Authorization: `Bearer ${key}` } : {}),
89
- },
90
- body: JSON.stringify(body),
91
- });
92
- if (!res.ok) {
93
- const text = await res.text();
94
- out(cmd, { ok: false, error: `batch ${batchN} failed (${res.status}): ${text}` });
95
- return;
96
- }
97
- const json = (await res.json());
98
- const created = json.counts?.owners ?? batch.length;
99
- const dupes = json.duplicates ?? 0;
100
- totalOwners += created;
101
- totalDuplicates += dupes;
102
- process.stdout.write(`batch ${batchN}/${batches.length} created=${created} skipped=${dupes}\n`);
103
- }
104
- out(cmd, {
105
- ok: true,
106
- total_rows: rows.length,
107
- created: totalOwners,
108
- duplicates: totalDuplicates,
109
- batches: batchN,
110
- plan: opts.plan,
111
- segment: opts.segment,
112
- dry_run: opts.dryRun ?? false,
113
- });
114
- });
115
- watchCommands(cmd);
116
- return cmd;
117
- }
@@ -1,119 +0,0 @@
1
- import * as hl from './lib/hl-core/index.js';
2
- import type { HlNet } from './lib/hl-core/net.js';
3
- type Obj = Record<string, unknown>;
4
- export interface VaultKey {
5
- chain: string;
6
- address: string;
7
- privateKeyHex: string;
8
- }
9
- export interface HlDeps {
10
- /** Every Hyperliquid read and the one /exchange post go through this. */
11
- fetchImpl: typeof fetch;
12
- /** The signing machine's ms clock — the nonce (H13). */
13
- now(): number;
14
- env: NodeJS.ProcessEnv;
15
- /** A person at a terminal: stdin and stdout are TTYs and --json is off. */
16
- interactive: boolean;
17
- home: string;
18
- realpath(p: string): string | null;
19
- unlock(dir: string): Promise<{
20
- keys: VaultKey[];
21
- } | {
22
- error: string;
23
- }>;
24
- confirm(question: string): Promise<boolean>;
25
- say(lines: string[]): void;
26
- /** A ONE receiver (wallet:get only — to find the workspace's EVM address when none is named). */
27
- ask(receiver: string, data: Obj): Promise<Obj>;
28
- }
29
- export interface Result {
30
- data: Obj;
31
- exitCode?: number;
32
- }
33
- export interface LiveArgs {
34
- testnet?: boolean;
35
- live?: boolean;
36
- dir?: string;
37
- yes?: boolean;
38
- }
39
- /**
40
- * A Signer over one secp256k1 key from the vault. It rebuilds the digest from (domain, types,
41
- * message) itself — the seam hands it no digest — and answers r ‖ s ‖ v, v = 27 + recovery.
42
- */
43
- export declare function vaultSigner(key: {
44
- address: string;
45
- privateKeyHex: string;
46
- }): hl.Signer;
47
- export interface HlBalance {
48
- perps: {
49
- accountValue: string | null;
50
- withdrawable: string | null;
51
- };
52
- spot: Array<{
53
- coin: string;
54
- total: string;
55
- hold: string;
56
- }>;
57
- }
58
- /** perps + spot, or null when either read failed — a failed read is never a zero balance. */
59
- export declare function readBalance(address: string, net: HlNet, deps: HlDeps): Promise<HlBalance | null>;
60
- /** The account a keyless read is about: the address named, else the workspace's one EVM address. */
61
- export declare function resolveAccount(address: string | undefined, actor: string | undefined, deps: HlDeps): Promise<{
62
- ok: true;
63
- address: string;
64
- } | Result>;
65
- export declare function runPositions(args: {
66
- address?: string;
67
- actor?: string;
68
- testnet?: boolean;
69
- }, deps: HlDeps): Promise<Result>;
70
- export declare function runOrders(args: {
71
- address?: string;
72
- actor?: string;
73
- testnet?: boolean;
74
- }, deps: HlDeps): Promise<Result>;
75
- /** What a verb hands the runner: its action for a nonce + signer, and the words for a person. */
76
- interface Built {
77
- action: hl.HlAction;
78
- opts: hl.DryRunOpts;
79
- words: string[];
80
- facts: Obj;
81
- }
82
- interface Prepared {
83
- cmdline: string;
84
- build(nonce: number, signer: string | null): Built;
85
- }
86
- export interface OrderArgs extends LiveArgs {
87
- side: string;
88
- size: string;
89
- coin: string;
90
- limit?: string;
91
- tif?: string;
92
- reduceOnly?: boolean;
93
- slippage?: string;
94
- }
95
- export declare function prepareOrder(a: OrderArgs, deps: HlDeps): Promise<Prepared | Result>;
96
- export declare function prepareCancel(a: LiveArgs & {
97
- coin: string;
98
- oid: string;
99
- }, deps: HlDeps): Promise<Prepared | Result>;
100
- export declare function prepareTransfer(a: LiveArgs & {
101
- amount: string;
102
- to?: string;
103
- address?: string;
104
- actor?: string;
105
- }, deps: HlDeps): Promise<Prepared | Result>;
106
- export declare function prepareWithdraw(a: LiveArgs & {
107
- amount: string;
108
- to?: string;
109
- address?: string;
110
- actor?: string;
111
- }, deps: HlDeps, agentShell: boolean): Promise<Prepared | Result>;
112
- /** Refuse BEFORE any vault opens — no Touch ID prompt for a run that cannot go on. */
113
- export declare function liveGate(a: LiveArgs, deps: HlDeps): Result | null;
114
- /** The plain-words line for userAbstraction: unified / portfolio accounts margin perps from spot. */
115
- export declare function abstractionWords(ab: unknown): string;
116
- export declare function runAction(verb: string, a: LiveArgs, prepare: () => Promise<Prepared | Result>, deps: HlDeps, o?: {
117
- abstractionFor?: string | null;
118
- }): Promise<Result>;
119
- export {};