@oneie/sdk 0.17.1 → 0.17.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.
@@ -0,0 +1,38 @@
1
+ export type SweepOrderChain = 'sui' | 'evm' | 'solana' | 'btc';
2
+ export declare const SWEEP_ORDER_CHAINS: readonly SweepOrderChain[];
3
+ export declare const ORDER_NONCE_RE: RegExp;
4
+ /** An order or offer may live at most this long from the moment it is verified. */
5
+ export declare const ORDER_MAX_TTL_MS: number;
6
+ /** The agent's runtime refuses to move money with less than this left on the order. */
7
+ export declare const ORDER_MIN_REMAINING_MS: number;
8
+ export interface SweepOrder {
9
+ workspace: string;
10
+ actor: string;
11
+ chain: SweepOrderChain;
12
+ destination: string;
13
+ /** integer base units (mist, wei, lamports, sats) */
14
+ amount: bigint;
15
+ nonce: string;
16
+ /** unix MILLISECONDS */
17
+ expiresAt: number;
18
+ }
19
+ export declare function sweepOrderMessage(o: SweepOrder): string;
20
+ /** The order body as sent, or null when any field is missing or malformed. */
21
+ export declare function parseSweepOrder(raw: unknown, bind: {
22
+ workspace: string;
23
+ actor: string;
24
+ chain: SweepOrderChain;
25
+ }): SweepOrder | null;
26
+ /** null when the window is acceptable at `now`; otherwise the refusal's name. */
27
+ export declare function orderWindowRefusal(expiresAt: number, now: number): 'order_expired' | 'order_expiry_too_far' | null;
28
+ export interface HandoverOffer {
29
+ agent: string;
30
+ from: string;
31
+ to: string;
32
+ chain: SweepOrderChain;
33
+ nonce: string;
34
+ /** unix MILLISECONDS */
35
+ expiresAt: number;
36
+ }
37
+ export declare function handoverMessage(o: HandoverOffer): string;
38
+ //# sourceMappingURL=sweep-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sweep-order.d.ts","sourceRoot":"","sources":["../src/sweep-order.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAA;AAC9D,eAAO,M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an agent to someone else. Import via the
3
+ // `@oneie/sdk/sweep-order` subpath.
4
+ //
5
+ // WHY IN THE SDK. Tony, 2026-10-06: "the sweep is signed by the human who owns
6
+ // the agent". The owner signs on its own machine (`one key sweep`) and one.ie
7
+ // verifies; the agent's runtime re-verifies before it moves anything. Three
8
+ // parties, one statement — so the statement lives in one file all three import,
9
+ // the way @oneie/sdk/address-proof does for wallet registration.
10
+ //
11
+ // PURE AND IMPORT-FREE. The one.ie worker loads this on the request path, so it
12
+ // pulls in no curve and no hash: signing lives in `@oneie/sdk/sweep-runner`
13
+ // (client-only) and verification in the server through address-proof's
14
+ // verifyAddressProof. Nothing here can sign or verify.
15
+ //
16
+ // DOMAIN SEPARATION. Each statement's first line names what it is, and neither is
17
+ // "ONE wallet registration", so a signature for one is never valid as another.
18
+ // Every field that makes a statement specific is inside it.
19
+ export const SWEEP_ORDER_CHAINS = ['sui', 'evm', 'solana', 'btc'];
20
+ export const ORDER_NONCE_RE = /^[A-Za-z0-9_-]{16,128}$/;
21
+ /** An order or offer may live at most this long from the moment it is verified. */
22
+ export const ORDER_MAX_TTL_MS = 15 * 60 * 1000;
23
+ /** The agent's runtime refuses to move money with less than this left on the order. */
24
+ export const ORDER_MIN_REMAINING_MS = 2 * 60 * 1000;
25
+ export function sweepOrderMessage(o) {
26
+ return [
27
+ 'ONE sweep order',
28
+ `workspace: ${o.workspace}`,
29
+ `agent: ${o.actor}`,
30
+ `chain: ${o.chain}`,
31
+ `destination: ${o.destination}`,
32
+ `amount: ${o.amount.toString()}`,
33
+ `nonce: ${o.nonce}`,
34
+ `expires: ${o.expiresAt}`,
35
+ ].join('\n');
36
+ }
37
+ function baseUnits(v) {
38
+ if (typeof v === 'bigint')
39
+ return v >= 0n ? v : null;
40
+ if (typeof v === 'number')
41
+ return Number.isSafeInteger(v) && v >= 0 ? BigInt(v) : null;
42
+ if (typeof v === 'string' && /^\d+$/.test(v))
43
+ return BigInt(v);
44
+ return null;
45
+ }
46
+ /** The order body as sent, or null when any field is missing or malformed. */
47
+ export function parseSweepOrder(raw, bind) {
48
+ if (!raw || typeof raw !== 'object')
49
+ return null;
50
+ const r = raw;
51
+ const amount = baseUnits(r['amount']);
52
+ const destination = typeof r['destination'] === 'string' ? r['destination'].trim() : '';
53
+ const nonce = typeof r['nonce'] === 'string' ? r['nonce'] : '';
54
+ const expiresAt = r['expiresAt'];
55
+ if (amount === null || !destination || !ORDER_NONCE_RE.test(nonce))
56
+ return null;
57
+ if (typeof expiresAt !== 'number' || !Number.isSafeInteger(expiresAt) || expiresAt <= 0)
58
+ return null;
59
+ return { ...bind, destination, amount, nonce, expiresAt };
60
+ }
61
+ /** null when the window is acceptable at `now`; otherwise the refusal's name. */
62
+ export function orderWindowRefusal(expiresAt, now) {
63
+ if (expiresAt <= now)
64
+ return 'order_expired';
65
+ if (expiresAt - now > ORDER_MAX_TTL_MS)
66
+ return 'order_expiry_too_far';
67
+ return null;
68
+ }
69
+ export function handoverMessage(o) {
70
+ return [
71
+ 'ONE agent handover',
72
+ `agent: ${o.agent}`,
73
+ `from: ${o.from}`,
74
+ `to: ${o.to}`,
75
+ `chain: ${o.chain}`,
76
+ `nonce: ${o.nonce}`,
77
+ `expires: ${o.expiresAt}`,
78
+ ].join('\n');
79
+ }
80
+ //# sourceMappingURL=sweep-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sweep-order.js","sourceRoot":"","sources":["../src/sweep-order.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,uEAAuE;AACvE,oCAAoC;AACpC,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,gFAAgF;AAChF,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,uEAAuE;AACvE,uDAAuD;AACvD,EAAE;AACF,kFAAkF;AAClF,+EAA+E;AAC/E,4DAA4D;AAG5D,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,E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I,EAAE;QACjB,OAAO,CAAC,CAAC,EAAE,EAAE;QACb,UAAU,CAAC,CAAC,KAAK,EAAE;QACnB,UAAU,CAAC,CAAC,KAAK,EAAE;QACnB,YAAY,CAAC,CAAC,SAAS,EAAE;KAC1B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { type AddressProof } from './address-proof.js';
2
+ import { type HandoverOffer, type SweepOrder, type SweepOrderChain } from './sweep-order.js';
3
+ export declare function signSweepOrder(privateKeyHex: string, order: SweepOrder): AddressProof;
4
+ export declare function signHandoverOffer(privateKeyHex: string, offer: HandoverOffer): AddressProof;
5
+ /** A nonce for an order or offer: 24 random bytes, base64url. */
6
+ export declare function newOrderNonce(): string;
7
+ export interface SweepTransferRequest {
8
+ chain: SweepOrderChain;
9
+ from: string;
10
+ to: string;
11
+ amountUnits: bigint;
12
+ privateKeyHex: string;
13
+ }
14
+ /** Signs and broadcasts one transfer; resolves to the tx digest, throws on failure. */
15
+ export type SweepTransfer = (t: SweepTransferRequest) => Promise<string>;
16
+ /** A receiver call that answers the receiver's own result object (the `result` of /api/ask). */
17
+ export type SweepAsk = (receiver: string, data: Record<string, unknown>) => Promise<Record<string, unknown>>;
18
+ export interface RunSweepArgs {
19
+ workspace: string;
20
+ actor: string;
21
+ chain: SweepOrderChain;
22
+ /** The agent's own key on `chain`. Never sent anywhere. */
23
+ agentKey: {
24
+ address: string;
25
+ privateKeyHex: string;
26
+ };
27
+ /** Pin the owner's address; when set, a server naming any other refuses everything. */
28
+ ownerAddress?: string;
29
+ }
30
+ export interface RunSweepDeps {
31
+ ask: SweepAsk;
32
+ /** Per-chain signer. Absent for a chain → refused `no_signer:<chain>`. */
33
+ transfer?: Partial<Record<SweepOrderChain, SweepTransfer>>;
34
+ now?: () => number;
35
+ }
36
+ export interface SweepRunResult {
37
+ nonce: string;
38
+ ok: boolean;
39
+ settled?: boolean;
40
+ paymentTx?: string;
41
+ error?: string;
42
+ }
43
+ export declare function runSweepOrders(args: RunSweepArgs, deps: RunSweepDeps): Promise<{
44
+ ok: boolean;
45
+ error?: string;
46
+ results: SweepRunResult[];
47
+ }>;
48
+ /**
49
+ * A Sui SweepTransfer: split exactly `amountUnits` mist off gas and transfer it.
50
+ * Refuses when @mysten/sui is not installed, and when the key does not derive `from`.
51
+ */
52
+ export declare function suiTransfer(opts: {
53
+ rpcUrl: string;
54
+ network: 'mainnet' | 'testnet';
55
+ load?: (spec: string) => Promise<unknown>;
56
+ }): SweepTransfer;
57
+ //# sourceMappingURL=sweep-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sweep-runner.d.ts","sourceRoot":"","sources":["../src/sweep-runner.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5F,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAA;AAEzB,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,YAAY,CAErF;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,YAAY,CAE3F;AAED,iEAAiE;AACjE,wBAAgB,aAAa,IAAI,MAAM,CAGtC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,eAAe,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;CACtB;AACD,uFAAuF;AACvF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAExE,gGAAgG;AAChG,MAAM,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAA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
+ // sweep-runner.ts — both machine halves of an agent sweep. Import via the
2
+ // `@oneie/sdk/sweep-runner` subpath.
3
+ //
4
+ // *** CLIENT-ONLY. DO NOT IMPORT THIS FROM A WORKER. *** It holds private keys in
5
+ // memory for one act and may load @mysten/sui. The worker-safe half of the
6
+ // format is `@oneie/sdk/sweep-order`.
7
+ //
8
+ // OWNER HALF — signSweepOrder / signHandoverOffer. The owner's key signs the
9
+ // statement; only `{ publicKey, signature }` comes back.
10
+ //
11
+ // AGENT HALF — runSweepOrders. Tony, 2026-10-06: the owner signs an ORDER and
12
+ // the agent's runtime performs the transfer, because shipped agent keys are
13
+ // random and only the agent holds them. Before it moves anything the runner
14
+ // re-checks, locally:
15
+ // · its own key derives the agent address the server names
16
+ // · the order's destination is the owner's proven address (pinnable, so a
17
+ // compromised server cannot name a different one)
18
+ // · the owner's signature over the order verifies against that address
19
+ // · at least ORDER_MIN_REMAINING_MS is left — a transfer whose settle then
20
+ // lands after expiry would move money with no record
21
+ // then transfers EXACTLY the order's base units with its own key and settles
22
+ // through wallet:sweep with the tx digest. Gas is paid on top, out of the float.
23
+ //
24
+ // SIGNING THE TRANSFER. This package and the CLI carry no chain transaction
25
+ // builder (their runtime deps are fixed, and hand-assembled transaction bytes
26
+ // would be new crypto). So the transfer is INJECTED. `suiTransfer` is the one
27
+ // built-in adapter: it drives @mysten/sui — the library one.ie's own browser
28
+ // signer uses — loaded at run time from the agent's own install, and refuses by
29
+ // name when it is not installed. Every other chain is refused `no_signer:<chain>`
30
+ // unless the caller injects a signer for it.
31
+ import { signAddressProof, verifyAddressProof } from './address-proof.js';
32
+ import { ORDER_MIN_REMAINING_MS, handoverMessage, sweepOrderMessage, } from './sweep-order.js';
33
+ export function signSweepOrder(privateKeyHex, order) {
34
+ return signAddressProof(order.chain, privateKeyHex, sweepOrderMessage(order));
35
+ }
36
+ export function signHandoverOffer(privateKeyHex, offer) {
37
+ return signAddressProof(offer.chain, privateKeyHex, handoverMessage(offer));
38
+ }
39
+ /** A nonce for an order or offer: 24 random bytes, base64url. */
40
+ export function newOrderNonce() {
41
+ const b = crypto.getRandomValues(new Uint8Array(24));
42
+ return btoa(String.fromCharCode(...b)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
43
+ }
44
+ const same = (a, b) => typeof a === 'string' && typeof b === 'string' && a.toLowerCase() === b.toLowerCase();
45
+ export async function runSweepOrders(args, deps) {
46
+ const now = deps.now ?? (() => Date.now());
47
+ const pending = await deps.ask('wallet:sweep', { workspace: args.workspace, actor: args.actor, chain: args.chain, pending: true });
48
+ if (pending['ok'] !== true)
49
+ return { ok: false, error: String(pending['error'] ?? 'pending_read_failed'), results: [] };
50
+ if (!same(pending['agentAddress'], args.agentKey.address))
51
+ return { ok: false, error: 'agent_address_mismatch', results: [] };
52
+ const ownerAddress = String(pending['to'] ?? '');
53
+ if (!ownerAddress)
54
+ return { ok: false, error: 'owner_address_unproven', results: [] };
55
+ if (args.ownerAddress !== undefined && !same(args.ownerAddress, ownerAddress)) {
56
+ return { ok: false, error: 'owner_address_mismatch', results: [] };
57
+ }
58
+ const orders = Array.isArray(pending['orders']) ? pending['orders'] : [];
59
+ const results = [];
60
+ for (const row of orders) {
61
+ const nonce = String(row['nonce'] ?? '');
62
+ const refuse = (error) => { results.push({ nonce, ok: false, error }); return results; };
63
+ const amount = typeof row['amountUnits'] === 'string' && /^\d+$/.test(row['amountUnits']) ? BigInt(row['amountUnits']) : null;
64
+ const expiresAt = Number(row['expiresAt']);
65
+ if (amount === null || amount <= 0n || !Number.isSafeInteger(expiresAt)) {
66
+ refuse('order_invalid');
67
+ continue;
68
+ }
69
+ if (expiresAt - now() < ORDER_MIN_REMAINING_MS) {
70
+ refuse('order_too_close_to_expiry');
71
+ continue;
72
+ }
73
+ if (!same(row['destination'], ownerAddress)) {
74
+ refuse('order_destination_mismatch');
75
+ continue;
76
+ }
77
+ const order = {
78
+ workspace: args.workspace, actor: args.actor, chain: args.chain,
79
+ destination: String(row['destination']), amount, nonce, expiresAt,
80
+ };
81
+ if (!verifyAddressProof(args.chain, ownerAddress, row['signature'], sweepOrderMessage(order))) {
82
+ refuse('order_signature_invalid');
83
+ continue;
84
+ }
85
+ const transfer = deps.transfer?.[args.chain];
86
+ if (!transfer) {
87
+ refuse(`no_signer:${args.chain}`);
88
+ continue;
89
+ }
90
+ let paymentTx;
91
+ try {
92
+ paymentTx = await transfer({ chain: args.chain, from: args.agentKey.address, to: order.destination, amountUnits: amount, privateKeyHex: args.agentKey.privateKeyHex });
93
+ }
94
+ catch (e) {
95
+ // Nothing was settled; stop — a later order must not run on an unknown balance.
96
+ refuse(`transfer_failed:${e instanceof Error ? e.message : String(e)}`);
97
+ return { ok: false, error: 'transfer_failed', results };
98
+ }
99
+ const settled = await deps.ask('wallet:sweep', { workspace: args.workspace, actor: args.actor, chain: args.chain, nonce, paymentTx });
100
+ if (settled['settled'] === true)
101
+ results.push({ nonce, ok: true, settled: true, paymentTx });
102
+ else
103
+ results.push({ nonce, ok: false, settled: false, paymentTx, error: String(settled['error'] ?? 'settle_failed') });
104
+ }
105
+ return { ok: results.every((r) => r.ok), results };
106
+ }
107
+ const fromHex = (h) => Uint8Array.from((h.match(/.{2}/g) ?? []).map((x) => parseInt(x, 16)));
108
+ /** The default loader: the agent's own @mysten/sui install. A variable specifier, so no bundler or typechecker pulls it in. */
109
+ async function loadSui(load) {
110
+ const [keypairs, client, transactions] = await Promise.all([
111
+ load('@mysten/sui/keypairs/ed25519'), load('@mysten/sui/jsonRpc'), load('@mysten/sui/transactions'),
112
+ ]);
113
+ return { keypairs, client, transactions };
114
+ }
115
+ /**
116
+ * A Sui SweepTransfer: split exactly `amountUnits` mist off gas and transfer it.
117
+ * Refuses when @mysten/sui is not installed, and when the key does not derive `from`.
118
+ */
119
+ export function suiTransfer(opts) {
120
+ const load = opts.load ?? ((spec) => import(/* @vite-ignore */ spec));
121
+ return async (t) => {
122
+ if (t.chain !== 'sui')
123
+ throw new Error(`no_signer:${t.chain}`);
124
+ let sui;
125
+ try {
126
+ sui = await loadSui(load);
127
+ }
128
+ catch {
129
+ throw new Error('sui_signer_unavailable: install @mysten/sui in the agent runtime');
130
+ }
131
+ const keypair = sui.keypairs.Ed25519Keypair.fromSecretKey(fromHex(t.privateKeyHex));
132
+ if (!same(keypair.toSuiAddress(), t.from))
133
+ throw new Error('agent_key_mismatch');
134
+ const tx = new sui.transactions.Transaction();
135
+ tx.setSender(keypair.toSuiAddress());
136
+ const [coin] = tx.splitCoins(tx.gas, [tx.pure.u64(t.amountUnits)]);
137
+ tx.transferObjects([coin], tx.pure.address(t.to));
138
+ const client = new sui.client.SuiJsonRpcClient({ url: opts.rpcUrl, network: opts.network });
139
+ const res = await client.signAndExecuteTransaction({ transaction: tx, signer: keypair, options: { showEffects: true } });
140
+ await client.waitForTransaction({ digest: res.digest });
141
+ if (res.effects?.status?.status !== 'success')
142
+ throw new Error(res.effects?.status?.error ?? 'sui_transfer_failed');
143
+ return res.digest;
144
+ };
145
+ }
146
+ //# sourceMappingURL=sweep-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sweep-runner.js","sourceRoot":"","sources":["../src/sweep-runner.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,EAAE;AACF,kFAAkF;AAClF,2EAA2E;AAC3E,sCAAsC;AACtC,EAAE;AACF,6EAA6E;AAC7E,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,sBAAsB;AACtB,6DAA6D;AAC7D,4EAA4E;AAC5E,sDAAsD;AACtD,yEAAyE;AACzE,6EAA6E;AAC7E,yDAAyD;AACzD,6EAA6E;AAC7E,iFAAiF;AACjF,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAChF,kFAAkF;AAClF,6CAA6C;AAE7C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAqB,MAAM,oBAAoB,C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AAM,MAAM,CAAC,yBAAyB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QACxH,MAAM,MAAM,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;QACvD,IAAI,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,qBAAqB,CAAC,CAAA;QACnH,OAAO,GAAG,CAAC,MAAM,CAAA;IACnB,CAAC,CAAA;AACH,CAAC"}
@@ -186,8 +186,11 @@
186
186
  "agent:bootstrap",
187
187
  "agent:draft",
188
188
  "agent:enroll",
189
+ "agent:handover-accept",
190
+ "agent:handover-offer",
189
191
  "agent:own-link",
190
192
  "agent:provision",
193
+ "agent:register-ceiling",
191
194
  "agent:run",
192
195
  "agent:schedule",
193
196
  "agents:capabilities",
@@ -283,6 +286,7 @@
283
286
  "credits:balance",
284
287
  "credits:request",
285
288
  "credits:spend",
289
+ "crm:advertise",
286
290
  "crm:context",
287
291
  "crm:starters",
288
292
  "dashboard:usage",
@@ -479,6 +483,9 @@
479
483
  "reply:discord",
480
484
  "reply:telegram",
481
485
  "reply:web",
486
+ "reviews:list",
487
+ "reviews:moderate",
488
+ "reviews:write",
482
489
  "rewards:enroll",
483
490
  "sdk:init",
484
491
  "segment:create",
@@ -598,6 +605,8 @@
598
605
  "wallet:portfolio",
599
606
  "wallet:rehearse",
600
607
  "wallet:send",
608
+ "wallet:sweep",
609
+ "wallet:sweep-set",
601
610
  "wallet:transactions",
602
611
  "wallet:transfer",
603
612
  "web:crawl",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneie/sdk",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "ONE substrate SDK — signals, units, persist, launch handoff.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,6 +47,14 @@
47
47
  "types": "./dist/address-proof.d.ts",
48
48
  "import": "./dist/address-proof.js"
49
49
  },
50
+ "./sweep-order": {
51
+ "types": "./dist/sweep-order.d.ts",
52
+ "import": "./dist/sweep-order.js"
53
+ },
54
+ "./sweep-runner": {
55
+ "types": "./dist/sweep-runner.d.ts",
56
+ "import": "./dist/sweep-runner.js"
57
+ },
50
58
  "./key-identity": {
51
59
  "types": "./dist/key-identity.d.ts",
52
60
  "import": "./dist/key-identity.js"