@avow-finance/sdk 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 +201 -0
- package/README.md +122 -2
- package/dist/agent-entry.d.ts +15 -0
- package/dist/agent-entry.d.ts.map +1 -0
- package/dist/agent-entry.js +11 -0
- package/dist/agent-entry.js.map +1 -0
- package/dist/agent-key.d.ts +34 -0
- package/dist/agent-key.d.ts.map +1 -0
- package/dist/agent-key.js +33 -0
- package/dist/agent-key.js.map +1 -0
- package/dist/agent.d.ts +261 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +493 -0
- package/dist/agent.js.map +1 -0
- package/dist/avow-api.d.ts +78 -0
- package/dist/avow-api.d.ts.map +1 -0
- package/dist/avow-api.js +2 -0
- package/dist/avow-api.js.map +1 -0
- package/dist/contest.d.ts +135 -0
- package/dist/contest.d.ts.map +1 -0
- package/dist/contest.js +186 -0
- package/dist/contest.js.map +1 -0
- package/dist/http.d.ts +161 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +311 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/job/accept.d.ts +84 -0
- package/dist/job/accept.d.ts.map +1 -0
- package/dist/job/accept.js +136 -0
- package/dist/job/accept.js.map +1 -0
- package/dist/job/customer.d.ts +43 -0
- package/dist/job/customer.d.ts.map +1 -0
- package/dist/job/customer.js +83 -0
- package/dist/job/customer.js.map +1 -0
- package/dist/job/quote.d.ts +34 -0
- package/dist/job/quote.d.ts.map +1 -0
- package/dist/job/quote.js +37 -0
- package/dist/job/quote.js.map +1 -0
- package/dist/lock.d.ts +269 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/lock.js +283 -0
- package/dist/lock.js.map +1 -0
- package/dist/moderato.d.ts +27 -0
- package/dist/moderato.d.ts.map +1 -0
- package/dist/moderato.js +34 -0
- package/dist/moderato.js.map +1 -0
- package/dist/node/cli.d.ts +3 -0
- package/dist/node/cli.d.ts.map +1 -0
- package/dist/node/cli.js +346 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/connect.d.ts +15 -0
- package/dist/node/connect.d.ts.map +1 -0
- package/dist/node/connect.js +91 -0
- package/dist/node/connect.js.map +1 -0
- package/dist/node/eval.d.ts +3 -0
- package/dist/node/eval.d.ts.map +1 -0
- package/dist/node/eval.js +67 -0
- package/dist/node/eval.js.map +1 -0
- package/dist/node/first-run.d.ts +50 -0
- package/dist/node/first-run.d.ts.map +1 -0
- package/dist/node/first-run.js +149 -0
- package/dist/node/first-run.js.map +1 -0
- package/dist/node/job.d.ts +50 -0
- package/dist/node/job.d.ts.map +1 -0
- package/dist/node/job.js +176 -0
- package/dist/node/job.js.map +1 -0
- package/dist/node/mailbox.d.ts +19 -0
- package/dist/node/mailbox.d.ts.map +1 -0
- package/dist/node/mailbox.js +81 -0
- package/dist/node/mailbox.js.map +1 -0
- package/dist/node/mcp.d.ts +74 -0
- package/dist/node/mcp.d.ts.map +1 -0
- package/dist/node/mcp.js +367 -0
- package/dist/node/mcp.js.map +1 -0
- package/dist/node/platform.d.ts +35 -0
- package/dist/node/platform.d.ts.map +1 -0
- package/dist/node/platform.js +102 -0
- package/dist/node/platform.js.map +1 -0
- package/dist/node/runner-session.d.ts +41 -0
- package/dist/node/runner-session.d.ts.map +1 -0
- package/dist/node/runner-session.js +100 -0
- package/dist/node/runner-session.js.map +1 -0
- package/dist/node/runner.d.ts +63 -0
- package/dist/node/runner.d.ts.map +1 -0
- package/dist/node/runner.js +341 -0
- package/dist/node/runner.js.map +1 -0
- package/dist/node/service-child.d.ts +2 -0
- package/dist/node/service-child.d.ts.map +1 -0
- package/dist/node/service-child.js +40 -0
- package/dist/node/service-child.js.map +1 -0
- package/dist/node/service-excerpt.d.ts +21 -0
- package/dist/node/service-excerpt.d.ts.map +1 -0
- package/dist/node/service-excerpt.js +32 -0
- package/dist/node/service-excerpt.js.map +1 -0
- package/dist/node/service-process.d.ts +12 -0
- package/dist/node/service-process.d.ts.map +1 -0
- package/dist/node/service-process.js +132 -0
- package/dist/node/service-process.js.map +1 -0
- package/dist/node/session-input.d.ts +12 -0
- package/dist/node/session-input.d.ts.map +1 -0
- package/dist/node/session-input.js +42 -0
- package/dist/node/session-input.js.map +1 -0
- package/dist/node/session-view.d.ts +20 -0
- package/dist/node/session-view.d.ts.map +1 -0
- package/dist/node/session-view.js +198 -0
- package/dist/node/session-view.js.map +1 -0
- package/dist/node-agent.d.ts +2 -0
- package/dist/node-agent.d.ts.map +1 -0
- package/dist/node-agent.js +6 -0
- package/dist/node-agent.js.map +1 -0
- package/dist/node.d.ts +2 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +9 -0
- package/dist/node.js.map +1 -0
- package/dist/sandbox/agent.d.ts +187 -0
- package/dist/sandbox/agent.d.ts.map +1 -0
- package/dist/sandbox/agent.js +468 -0
- package/dist/sandbox/agent.js.map +1 -0
- package/dist/sandbox/business-store.d.ts +19 -0
- package/dist/sandbox/business-store.d.ts.map +1 -0
- package/dist/sandbox/business-store.js +19 -0
- package/dist/sandbox/business-store.js.map +1 -0
- package/dist/sandbox/business.d.ts +70 -0
- package/dist/sandbox/business.d.ts.map +1 -0
- package/dist/sandbox/business.js +115 -0
- package/dist/sandbox/business.js.map +1 -0
- package/dist/sandbox/connect.d.ts +64 -0
- package/dist/sandbox/connect.d.ts.map +1 -0
- package/dist/sandbox/connect.js +182 -0
- package/dist/sandbox/connect.js.map +1 -0
- package/dist/sandbox/deployment.d.ts +14 -0
- package/dist/sandbox/deployment.d.ts.map +1 -0
- package/dist/sandbox/deployment.js +38 -0
- package/dist/sandbox/deployment.js.map +1 -0
- package/dist/sandbox/keys.d.ts +45 -0
- package/dist/sandbox/keys.d.ts.map +1 -0
- package/dist/sandbox/keys.js +132 -0
- package/dist/sandbox/keys.js.map +1 -0
- package/dist/sandbox/mailbox.d.ts +90 -0
- package/dist/sandbox/mailbox.d.ts.map +1 -0
- package/dist/sandbox/mailbox.js +400 -0
- package/dist/sandbox/mailbox.js.map +1 -0
- package/dist/sandbox/mandate.d.ts +84 -0
- package/dist/sandbox/mandate.d.ts.map +1 -0
- package/dist/sandbox/mandate.js +107 -0
- package/dist/sandbox/mandate.js.map +1 -0
- package/dist/sandbox/namespace.d.ts +16 -0
- package/dist/sandbox/namespace.d.ts.map +1 -0
- package/dist/sandbox/namespace.js +16 -0
- package/dist/sandbox/namespace.js.map +1 -0
- package/dist/sandbox/session.d.ts +60 -0
- package/dist/sandbox/session.d.ts.map +1 -0
- package/dist/sandbox/session.js +94 -0
- package/dist/sandbox/session.js.map +1 -0
- package/dist/sandbox/setup.d.ts +136 -0
- package/dist/sandbox/setup.d.ts.map +1 -0
- package/dist/sandbox/setup.js +490 -0
- package/dist/sandbox/setup.js.map +1 -0
- package/dist/sandbox/store.d.ts +69 -0
- package/dist/sandbox/store.d.ts.map +1 -0
- package/dist/sandbox/store.js +115 -0
- package/dist/sandbox/store.js.map +1 -0
- package/dist/sandbox/supplier-key.d.ts +73 -0
- package/dist/sandbox/supplier-key.d.ts.map +1 -0
- package/dist/sandbox/supplier-key.js +180 -0
- package/dist/sandbox/supplier-key.js.map +1 -0
- package/dist/sandbox/suppliers.d.ts +7 -0
- package/dist/sandbox/suppliers.d.ts.map +1 -0
- package/dist/sandbox/suppliers.js +29 -0
- package/dist/sandbox/suppliers.js.map +1 -0
- package/dist/sandbox/terms.d.ts +32 -0
- package/dist/sandbox/terms.d.ts.map +1 -0
- package/dist/sandbox/terms.js +58 -0
- package/dist/sandbox/terms.js.map +1 -0
- package/dist/sandbox/vault.d.ts +24 -0
- package/dist/sandbox/vault.d.ts.map +1 -0
- package/dist/sandbox/vault.js +54 -0
- package/dist/sandbox/vault.js.map +1 -0
- package/dist/send.d.ts +122 -0
- package/dist/send.d.ts.map +1 -0
- package/dist/send.js +328 -0
- package/dist/send.js.map +1 -0
- package/dist/service-entry.d.ts +6 -0
- package/dist/service-entry.d.ts.map +1 -0
- package/dist/service-entry.js +6 -0
- package/dist/service-entry.js.map +1 -0
- package/dist/session/anthropic.d.ts +17 -0
- package/dist/session/anthropic.d.ts.map +1 -0
- package/dist/session/anthropic.js +215 -0
- package/dist/session/anthropic.js.map +1 -0
- package/dist/session/charge.d.ts +13 -0
- package/dist/session/charge.d.ts.map +1 -0
- package/dist/session/charge.js +33 -0
- package/dist/session/charge.js.map +1 -0
- package/dist/session/data.d.ts +8 -0
- package/dist/session/data.d.ts.map +1 -0
- package/dist/session/data.js +20 -0
- package/dist/session/data.js.map +1 -0
- package/dist/session/eval.d.ts +41 -0
- package/dist/session/eval.d.ts.map +1 -0
- package/dist/session/eval.js +281 -0
- package/dist/session/eval.js.map +1 -0
- package/dist/session/executor.d.ts +80 -0
- package/dist/session/executor.d.ts.map +1 -0
- package/dist/session/executor.js +381 -0
- package/dist/session/executor.js.map +1 -0
- package/dist/session/fixture-world.d.ts +29 -0
- package/dist/session/fixture-world.d.ts.map +1 -0
- package/dist/session/fixture-world.js +708 -0
- package/dist/session/fixture-world.js.map +1 -0
- package/dist/session/live-world.d.ts +22 -0
- package/dist/session/live-world.d.ts.map +1 -0
- package/dist/session/live-world.js +329 -0
- package/dist/session/live-world.js.map +1 -0
- package/dist/session/ollama.d.ts +29 -0
- package/dist/session/ollama.d.ts.map +1 -0
- package/dist/session/ollama.js +177 -0
- package/dist/session/ollama.js.map +1 -0
- package/dist/session/provider.d.ts +79 -0
- package/dist/session/provider.d.ts.map +1 -0
- package/dist/session/provider.js +19 -0
- package/dist/session/provider.js.map +1 -0
- package/dist/session/scripted.d.ts +45 -0
- package/dist/session/scripted.d.ts.map +1 -0
- package/dist/session/scripted.js +236 -0
- package/dist/session/scripted.js.map +1 -0
- package/dist/session/selection.d.ts +37 -0
- package/dist/session/selection.d.ts.map +1 -0
- package/dist/session/selection.js +104 -0
- package/dist/session/selection.js.map +1 -0
- package/dist/session/service-check.d.ts +48 -0
- package/dist/session/service-check.d.ts.map +1 -0
- package/dist/session/service-check.js +86 -0
- package/dist/session/service-check.js.map +1 -0
- package/dist/session/service.d.ts +128 -0
- package/dist/session/service.d.ts.map +1 -0
- package/dist/session/service.js +150 -0
- package/dist/session/service.js.map +1 -0
- package/dist/session/session.d.ts +95 -0
- package/dist/session/session.d.ts.map +1 -0
- package/dist/session/session.js +312 -0
- package/dist/session/session.js.map +1 -0
- package/dist/session/toolbox.d.ts +69 -0
- package/dist/session/toolbox.d.ts.map +1 -0
- package/dist/session/toolbox.js +391 -0
- package/dist/session/toolbox.js.map +1 -0
- package/dist/session/tools.d.ts +45 -0
- package/dist/session/tools.d.ts.map +1 -0
- package/dist/session/tools.js +137 -0
- package/dist/session/tools.js.map +1 -0
- package/dist/session/world.d.ts +188 -0
- package/dist/session/world.d.ts.map +1 -0
- package/dist/session/world.js +2 -0
- package/dist/session/world.js.map +1 -0
- package/dist/sign.d.ts +19 -0
- package/dist/sign.d.ts.map +1 -0
- package/dist/sign.js +33 -0
- package/dist/sign.js.map +1 -0
- package/dist/supplier.d.ts +41 -0
- package/dist/supplier.d.ts.map +1 -0
- package/dist/supplier.js +57 -0
- package/dist/supplier.js.map +1 -0
- package/package.json +56 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import { type Account } from 'viem/tempo';
|
|
3
|
+
import { type Call } from '../lock.js';
|
|
4
|
+
import type { SandboxClient } from './business.js';
|
|
5
|
+
/**
|
|
6
|
+
* The block the factory created the business's lock in, read from the factory's own event. Every
|
|
7
|
+
* key the business authorized came after it, and nothing on this machine can move it. It reads
|
|
8
|
+
* back from the latest block, since a sandbox business is usually days old, and stops at the block
|
|
9
|
+
* the factory itself was created in.
|
|
10
|
+
*/
|
|
11
|
+
export declare function lockCreatedIn(m: {
|
|
12
|
+
client: SandboxClient;
|
|
13
|
+
factory: Address;
|
|
14
|
+
account: Address;
|
|
15
|
+
lock: Address;
|
|
16
|
+
/** The block the factory was created in. */
|
|
17
|
+
factoryCreatedIn?: bigint;
|
|
18
|
+
}): Promise<bigint>;
|
|
19
|
+
/**
|
|
20
|
+
* Every key the account's keychain still lets sign for the account, read from the chain: each
|
|
21
|
+
* access key and each admin key authorized since `fromBlock` that isn't revoked or expired. The
|
|
22
|
+
* account's root key isn't in the keychain, so it's never among them. Nothing the agent can write
|
|
23
|
+
* decides this list.
|
|
24
|
+
*/
|
|
25
|
+
export declare function liveKeys(client: SandboxClient, account: Address, fromBlock: bigint): Promise<Address[]>;
|
|
26
|
+
/** Every supplier the lock approves now, read from the lock's own events and its state. */
|
|
27
|
+
export declare function approvedSuppliers(client: SandboxClient, lock: Address, fromBlock: bigint): Promise<Address[]>;
|
|
28
|
+
/**
|
|
29
|
+
* The calls that revoke each key in the account's keychain, access or admin, which only the root
|
|
30
|
+
* key can send.
|
|
31
|
+
*/
|
|
32
|
+
export declare const revokeKeyCalls: (keys: readonly Address[]) => Call[];
|
|
33
|
+
/**
|
|
34
|
+
* Revokes every key the account's keychain still authorizes, access or admin, apart from `keep`, in
|
|
35
|
+
* a transaction of its own from the root key. It reads the keys from the chain since `since`, which
|
|
36
|
+
* the caller takes from the chain too, so no file the agent changed or deleted can keep one live.
|
|
37
|
+
* It gives the keys it revoked.
|
|
38
|
+
*/
|
|
39
|
+
export declare function revokeOtherKeys(m: {
|
|
40
|
+
client: SandboxClient;
|
|
41
|
+
root: Account.RootAccount;
|
|
42
|
+
since: bigint;
|
|
43
|
+
keep?: readonly Address[];
|
|
44
|
+
}): Promise<Address[]>;
|
|
45
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/sandbox/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAMb,MAAM,MAAM,CAAA;AACb,OAAO,EAAQ,KAAK,OAAO,EAAa,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAGzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AA8BlD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,CAAC,EAAE;IACrC,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,OAAO,CAAA;IACb,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,CAelB;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,EAAE,CAAC,CAqCpB;AAED,2FAA2F;AAC3F,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,EAAE,CAAC,CAkBpB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,SAAU,SAAS,OAAO,EAAE,KAAG,IAAI,EAIzD,CAAA;AAEL;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE;IACvC,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,OAAO,CAAC,WAAW,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;CAC1B,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CASrB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { encodeFunctionData, getAddress, isAddressEqual, parseAbiItem, zeroAddress, } from 'viem';
|
|
2
|
+
import { Abis, Addresses } from 'viem/tempo';
|
|
3
|
+
import { ADMINISTRATOR_ABI } from '../lock.js';
|
|
4
|
+
import { MODERATO_FACTORY_CREATED_IN } from '../moderato.js';
|
|
5
|
+
import { sendOwn } from '../send.js';
|
|
6
|
+
/** The widest block range one log query takes on Moderato's public node, with room to spare. */
|
|
7
|
+
const STEP = 90000n;
|
|
8
|
+
const KEYCHAIN = Addresses.accountKeychain;
|
|
9
|
+
const KEY_AUTHORIZED = parseAbiItem('event KeyAuthorized(address indexed account, address indexed publicKey, uint8 signatureType, uint64 expiry)');
|
|
10
|
+
const ADMIN_KEY_AUTHORIZED = parseAbiItem('event AdminKeyAuthorized(address indexed account, address indexed publicKey)');
|
|
11
|
+
const LOCK_CREATED = parseAbiItem('event LockCreated(address indexed account, address lock)');
|
|
12
|
+
const SUPPLIER_APPROVED = parseAbiItem('event SupplierApproved(address indexed supplier)');
|
|
13
|
+
/** Every log a filter matches from `fromBlock` to the latest block, a range at a time. */
|
|
14
|
+
async function logsSince(client, fromBlock, read) {
|
|
15
|
+
const latest = await client.getBlockNumber();
|
|
16
|
+
const found = [];
|
|
17
|
+
for (let from = fromBlock; from <= latest; from += STEP) {
|
|
18
|
+
const to = from + STEP - 1n < latest ? from + STEP - 1n : latest;
|
|
19
|
+
found.push(...(await read({ fromBlock: from, toBlock: to })));
|
|
20
|
+
}
|
|
21
|
+
return found;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The block the factory created the business's lock in, read from the factory's own event. Every
|
|
25
|
+
* key the business authorized came after it, and nothing on this machine can move it. It reads
|
|
26
|
+
* back from the latest block, since a sandbox business is usually days old, and stops at the block
|
|
27
|
+
* the factory itself was created in.
|
|
28
|
+
*/
|
|
29
|
+
export async function lockCreatedIn(m) {
|
|
30
|
+
const floor = m.factoryCreatedIn ?? MODERATO_FACTORY_CREATED_IN;
|
|
31
|
+
for (let to = await m.client.getBlockNumber(); to >= floor; to -= STEP) {
|
|
32
|
+
const from = to - STEP + 1n > floor ? to - STEP + 1n : floor;
|
|
33
|
+
const logs = await m.client.getLogs({
|
|
34
|
+
address: m.factory,
|
|
35
|
+
event: LOCK_CREATED,
|
|
36
|
+
args: { account: m.account },
|
|
37
|
+
fromBlock: from,
|
|
38
|
+
toBlock: to,
|
|
39
|
+
});
|
|
40
|
+
const created = logs.find((l) => l.args.lock && isAddressEqual(l.args.lock, m.lock));
|
|
41
|
+
if (created && created.blockNumber !== null)
|
|
42
|
+
return created.blockNumber;
|
|
43
|
+
}
|
|
44
|
+
throw new Error(`The factory at ${m.factory} never created the business's lock at ${m.lock}`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every key the account's keychain still lets sign for the account, read from the chain: each
|
|
48
|
+
* access key and each admin key authorized since `fromBlock` that isn't revoked or expired. The
|
|
49
|
+
* account's root key isn't in the keychain, so it's never among them. Nothing the agent can write
|
|
50
|
+
* decides this list.
|
|
51
|
+
*/
|
|
52
|
+
export async function liveKeys(client, account, fromBlock) {
|
|
53
|
+
const logs = await logsSince(client, fromBlock, async (range) => [
|
|
54
|
+
...(await client.getLogs({
|
|
55
|
+
address: KEYCHAIN,
|
|
56
|
+
event: KEY_AUTHORIZED,
|
|
57
|
+
args: { account },
|
|
58
|
+
...range,
|
|
59
|
+
})),
|
|
60
|
+
...(await client.getLogs({
|
|
61
|
+
address: KEYCHAIN,
|
|
62
|
+
event: ADMIN_KEY_AUTHORIZED,
|
|
63
|
+
args: { account },
|
|
64
|
+
...range,
|
|
65
|
+
})),
|
|
66
|
+
]);
|
|
67
|
+
const keys = [
|
|
68
|
+
...new Set(logs.flatMap((l) => (l.args.publicKey ? [getAddress(l.args.publicKey)] : []))),
|
|
69
|
+
].filter((key) => !isAddressEqual(key, account));
|
|
70
|
+
const now = BigInt(Math.floor(Date.now() / 1000));
|
|
71
|
+
const live = [];
|
|
72
|
+
for (const key of keys) {
|
|
73
|
+
const k = await client.readContract({
|
|
74
|
+
address: KEYCHAIN,
|
|
75
|
+
abi: Abis.accountKeychain,
|
|
76
|
+
functionName: 'getKey',
|
|
77
|
+
args: [account, key],
|
|
78
|
+
});
|
|
79
|
+
const access = !k.isRevoked && k.keyId !== zeroAddress && (k.expiry === 0n || k.expiry > now);
|
|
80
|
+
const admin = await client.readContract({
|
|
81
|
+
address: KEYCHAIN,
|
|
82
|
+
abi: Abis.accountKeychain,
|
|
83
|
+
functionName: 'isAdminKey',
|
|
84
|
+
args: [account, key],
|
|
85
|
+
});
|
|
86
|
+
if (access || admin)
|
|
87
|
+
live.push(key);
|
|
88
|
+
}
|
|
89
|
+
return live;
|
|
90
|
+
}
|
|
91
|
+
/** Every supplier the lock approves now, read from the lock's own events and its state. */
|
|
92
|
+
export async function approvedSuppliers(client, lock, fromBlock) {
|
|
93
|
+
const logs = await logsSince(client, fromBlock, (range) => client.getLogs({ address: lock, event: SUPPLIER_APPROVED, ...range }));
|
|
94
|
+
const candidates = [
|
|
95
|
+
...new Set(logs.flatMap((l) => (l.args.supplier ? [getAddress(l.args.supplier)] : []))),
|
|
96
|
+
];
|
|
97
|
+
const approved = [];
|
|
98
|
+
for (const supplier of candidates) {
|
|
99
|
+
const still = await client.readContract({
|
|
100
|
+
address: lock,
|
|
101
|
+
abi: ADMINISTRATOR_ABI,
|
|
102
|
+
functionName: 'approvedSupplier',
|
|
103
|
+
args: [supplier],
|
|
104
|
+
});
|
|
105
|
+
if (still)
|
|
106
|
+
approved.push(supplier);
|
|
107
|
+
}
|
|
108
|
+
return approved;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The calls that revoke each key in the account's keychain, access or admin, which only the root
|
|
112
|
+
* key can send.
|
|
113
|
+
*/
|
|
114
|
+
export const revokeKeyCalls = (keys) => keys.map((key) => ({
|
|
115
|
+
to: KEYCHAIN,
|
|
116
|
+
data: encodeFunctionData({ abi: Abis.accountKeychain, functionName: 'revokeKey', args: [key] }),
|
|
117
|
+
}));
|
|
118
|
+
/**
|
|
119
|
+
* Revokes every key the account's keychain still authorizes, access or admin, apart from `keep`, in
|
|
120
|
+
* a transaction of its own from the root key. It reads the keys from the chain since `since`, which
|
|
121
|
+
* the caller takes from the chain too, so no file the agent changed or deleted can keep one live.
|
|
122
|
+
* It gives the keys it revoked.
|
|
123
|
+
*/
|
|
124
|
+
export async function revokeOtherKeys(m) {
|
|
125
|
+
const keep = m.keep ?? [];
|
|
126
|
+
const live = (await liveKeys(m.client, m.root.address, m.since)).filter((k) => !keep.some((kept) => isAddressEqual(kept, k)));
|
|
127
|
+
if (live.length > 0) {
|
|
128
|
+
await sendOwn({ client: m.client, account: m.root, calls: revokeKeyCalls(live) });
|
|
129
|
+
}
|
|
130
|
+
return live;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/sandbox/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,WAAW,GACZ,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,IAAI,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAa,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAGpC,gGAAgG;AAChG,MAAM,IAAI,GAAG,MAAO,CAAA;AAEpB,MAAM,QAAQ,GAAG,SAAS,CAAC,eAA0B,CAAA;AACrD,MAAM,cAAc,GAAG,YAAY,CACjC,6GAA6G,CAC9G,CAAA;AACD,MAAM,oBAAoB,GAAG,YAAY,CACvC,8EAA8E,CAC/E,CAAA;AACD,MAAM,YAAY,GAAG,YAAY,CAAC,0DAA0D,CAAC,CAAA;AAC7F,MAAM,iBAAiB,GAAG,YAAY,CAAC,kDAAkD,CAAC,CAAA;AAE1F,0FAA0F;AAC1F,KAAK,UAAU,SAAS,CACtB,MAAqB,EACrB,SAAiB,EACjB,IAAqE;IAErE,MAAM,MAAM,GAAG,MAAM,MAA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AAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CACrE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CACrD,CAAA;IACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACnF,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type MailboxOrder, type MailboxOrderRequest, type ReasonCode } from '@avow-finance/spec';
|
|
2
|
+
import { type Hex } from 'viem';
|
|
3
|
+
import { type SandboxStore } from './store.js';
|
|
4
|
+
/** How long an order waits to be funded unless the buyer says otherwise, in seconds. */
|
|
5
|
+
export declare const MAILBOX_ORDER_SECONDS = 600n;
|
|
6
|
+
/** Where a buy got to, in order. */
|
|
7
|
+
export type BuyStep = {
|
|
8
|
+
step: 'ordered';
|
|
9
|
+
order: MailboxOrder;
|
|
10
|
+
} | {
|
|
11
|
+
step: 'quoted';
|
|
12
|
+
order: MailboxOrder;
|
|
13
|
+
} | {
|
|
14
|
+
step: 'reserved';
|
|
15
|
+
fundedIn: Hex | null;
|
|
16
|
+
} | {
|
|
17
|
+
step: 'accepted';
|
|
18
|
+
acceptedIn: Hex | null;
|
|
19
|
+
};
|
|
20
|
+
/** How a buy ended. */
|
|
21
|
+
export type BuyOutcome = {
|
|
22
|
+
ok: true;
|
|
23
|
+
order: MailboxOrder;
|
|
24
|
+
} | {
|
|
25
|
+
ok: false;
|
|
26
|
+
reason: ReasonCode | 'order.expired' | 'acceptance.missed';
|
|
27
|
+
order: MailboxOrder;
|
|
28
|
+
};
|
|
29
|
+
/** Where a sale got to, in order. */
|
|
30
|
+
export type SellStep = {
|
|
31
|
+
step: 'compute';
|
|
32
|
+
reservedIn: Hex | null;
|
|
33
|
+
} | {
|
|
34
|
+
step: 'quoted';
|
|
35
|
+
} | {
|
|
36
|
+
step: 'accepted';
|
|
37
|
+
acceptedIn: Hex | null;
|
|
38
|
+
};
|
|
39
|
+
export interface MailboxOptions {
|
|
40
|
+
store?: SandboxStore;
|
|
41
|
+
screenUrl?: string;
|
|
42
|
+
fetch?: typeof fetch;
|
|
43
|
+
}
|
|
44
|
+
export interface SandboxMailbox {
|
|
45
|
+
readonly businessId: string;
|
|
46
|
+
/**
|
|
47
|
+
* Sends an order for the demo job to another business, with nothing reserved. The order is kept
|
|
48
|
+
* in the store before it's sent, so `buy` can pick it up after a restart.
|
|
49
|
+
*/
|
|
50
|
+
order(o: {
|
|
51
|
+
supplier: string;
|
|
52
|
+
expiresIn?: bigint;
|
|
53
|
+
}): Promise<MailboxOrder>;
|
|
54
|
+
/** The orders this agent sent and hasn't seen through, oldest first, for `buy` to resume. */
|
|
55
|
+
unfinished(): Promise<MailboxOrderRequest[]>;
|
|
56
|
+
/** Reads one order, as either side. */
|
|
57
|
+
read(orderId: string): Promise<MailboxOrder>;
|
|
58
|
+
/**
|
|
59
|
+
* Orders a job and sees it through: waits for the quote, checks it, funds the commitment, tells
|
|
60
|
+
* the mailbox, and waits for the supplier to accept. An order nobody quotes lapses unfunded.
|
|
61
|
+
* With `resume`, it picks up an unfinished order from where it stands instead of sending one,
|
|
62
|
+
* and never funds a commitment the lock already holds.
|
|
63
|
+
*/
|
|
64
|
+
buy(o: {
|
|
65
|
+
supplier: string;
|
|
66
|
+
resume?: string;
|
|
67
|
+
expiresIn?: bigint;
|
|
68
|
+
onStep?: (step: BuyStep) => void;
|
|
69
|
+
pollEvery?: number;
|
|
70
|
+
signal?: AbortSignal;
|
|
71
|
+
}): Promise<BuyOutcome>;
|
|
72
|
+
/** The orders waiting on this business as supplier: new ones to quote, funded ones to accept. */
|
|
73
|
+
inbox(): Promise<MailboxOrder[]>;
|
|
74
|
+
/** Takes the next step on one order from the inbox: quotes a new one, or accepts a funded one. */
|
|
75
|
+
sell(order: MailboxOrder, onStep?: (step: SellStep) => void): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Reads the inbox every few seconds and takes each order's next step, until the signal stops it.
|
|
78
|
+
* An order the handler declines is left to lapse. Nothing wakes this when it isn't running.
|
|
79
|
+
*/
|
|
80
|
+
listen(o?: {
|
|
81
|
+
accept?: (order: MailboxOrder) => boolean | Promise<boolean>;
|
|
82
|
+
onStep?: (order: MailboxOrder, step: SellStep) => void;
|
|
83
|
+
onError?: (order: MailboxOrder, error: unknown) => void;
|
|
84
|
+
every?: number;
|
|
85
|
+
signal?: AbortSignal;
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
/** The mailbox for the agent in this folder, as buyer and, when it holds a signing key, supplier. */
|
|
89
|
+
export declare function sandboxMailbox(o?: MailboxOptions): Promise<SandboxMailbox>;
|
|
90
|
+
//# sourceMappingURL=mailbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EASxB,KAAK,UAAU,EAMhB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAgB,KAAK,GAAG,EAAmB,MAAM,MAAM,CAAA;AAqB9D,OAAO,EAKL,KAAK,YAAY,EAElB,MAAM,YAAY,CAAA;AAenB,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,OAAO,CAAA;AAIzC,oCAAoC;AACpC,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK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