@towns-labs/agent 2.0.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.
- package/README.md +151 -0
- package/dist/agent.d.ts +480 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +1758 -0
- package/dist/agent.js.map +1 -0
- package/dist/agent.test.d.ts +2 -0
- package/dist/agent.test.d.ts.map +1 -0
- package/dist/agent.test.js +1315 -0
- package/dist/agent.test.js.map +1 -0
- package/dist/eventDedup.d.ts +73 -0
- package/dist/eventDedup.d.ts.map +1 -0
- package/dist/eventDedup.js +105 -0
- package/dist/eventDedup.js.map +1 -0
- package/dist/eventDedup.test.d.ts +2 -0
- package/dist/eventDedup.test.d.ts.map +1 -0
- package/dist/eventDedup.test.js +222 -0
- package/dist/eventDedup.test.js.map +1 -0
- package/dist/identity-types.d.ts +43 -0
- package/dist/identity-types.d.ts.map +1 -0
- package/dist/identity-types.js +2 -0
- package/dist/identity-types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction-api.d.ts +61 -0
- package/dist/interaction-api.d.ts.map +1 -0
- package/dist/interaction-api.js +95 -0
- package/dist/interaction-api.js.map +1 -0
- package/dist/payments.d.ts +89 -0
- package/dist/payments.d.ts.map +1 -0
- package/dist/payments.js +144 -0
- package/dist/payments.js.map +1 -0
- package/dist/re-exports.d.ts +2 -0
- package/dist/re-exports.d.ts.map +1 -0
- package/dist/re-exports.js +2 -0
- package/dist/re-exports.js.map +1 -0
- package/dist/smart-account.d.ts +54 -0
- package/dist/smart-account.d.ts.map +1 -0
- package/dist/smart-account.js +132 -0
- package/dist/smart-account.js.map +1 -0
- package/dist/snapshot-getter.d.ts +21 -0
- package/dist/snapshot-getter.d.ts.map +1 -0
- package/dist/snapshot-getter.js +27 -0
- package/dist/snapshot-getter.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { zeroAddress, } from 'viem';
|
|
2
|
+
import { getStorageAt, readContract } from 'viem/actions';
|
|
3
|
+
import walletLinkAbi from '@towns-labs/generated/dev/abis/WalletLink.abi';
|
|
4
|
+
/**
|
|
5
|
+
* The default slot for the implementation address for ERC-1967 Proxies
|
|
6
|
+
* keccak256('eip1967.proxy.implementation')) - 1
|
|
7
|
+
*/
|
|
8
|
+
export const PROXY_STORAGE_SLOT = '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc';
|
|
9
|
+
/**
|
|
10
|
+
* Known modular account implementation addresses
|
|
11
|
+
*/
|
|
12
|
+
export const MODULAR_ACCOUNT_IMPLEMENTATIONS = {
|
|
13
|
+
/**
|
|
14
|
+
* Semi modular smart account bytecode for new accounts
|
|
15
|
+
* New accounts get this address as their implementation
|
|
16
|
+
*/
|
|
17
|
+
NEW: '0x000000000000c5A9089039570Dd36455b5C07383',
|
|
18
|
+
/**
|
|
19
|
+
* Storage only smart account bytecode for existing accounts
|
|
20
|
+
* Upgraded accounts get this address as their implementation
|
|
21
|
+
* https://github.com/alchemyplatform/modular-account/blob/develop/src/account/SemiModularAccountStorageOnly.sol
|
|
22
|
+
*/
|
|
23
|
+
UPGRADED: '0x0000000000006E2f9d80CaEc0Da6500f005EB25A',
|
|
24
|
+
};
|
|
25
|
+
function isModularAccount(implementationAddress) {
|
|
26
|
+
const lowerImpl = implementationAddress.toLowerCase();
|
|
27
|
+
return (lowerImpl === MODULAR_ACCOUNT_IMPLEMENTATIONS.NEW.toLowerCase() ||
|
|
28
|
+
lowerImpl === MODULAR_ACCOUNT_IMPLEMENTATIONS.UPGRADED.toLowerCase());
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if an address has a deployed modular smart account implementation
|
|
32
|
+
* @param client - The public RPC viem client
|
|
33
|
+
* @param address - The address to check
|
|
34
|
+
* @returns True if the address has a deployed modular smart account implementation, false otherwise
|
|
35
|
+
*/
|
|
36
|
+
export async function checkSmartAccountImplementation(viem, address) {
|
|
37
|
+
try {
|
|
38
|
+
const storageValue = await getStorageAt(viem, {
|
|
39
|
+
address,
|
|
40
|
+
slot: PROXY_STORAGE_SLOT,
|
|
41
|
+
});
|
|
42
|
+
if (!storageValue) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
// The storage slot contains a full bytes32, but we want only the last 20 bytes.
|
|
46
|
+
// Slice off the leading `0x` and the first 12 bytes (24 characters), leaving the last 20 bytes, then prefix with `0x`.
|
|
47
|
+
const implementationAddress = `0x${storageValue.slice(26)}`;
|
|
48
|
+
if (implementationAddress === zeroAddress) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
// Only return modular accounts (skip simple accounts)
|
|
52
|
+
if (!isModularAccount(implementationAddress)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async function getLinkedWalletsWithRootKey(viem, wallet, walletLinkAddress) {
|
|
62
|
+
try {
|
|
63
|
+
const linkedWallets = await readContract(viem, {
|
|
64
|
+
address: walletLinkAddress,
|
|
65
|
+
abi: walletLinkAbi,
|
|
66
|
+
functionName: 'getWalletsByRootKey',
|
|
67
|
+
args: [wallet],
|
|
68
|
+
});
|
|
69
|
+
if (!linkedWallets) {
|
|
70
|
+
const possibleRoot = await readContract(viem, {
|
|
71
|
+
address: walletLinkAddress,
|
|
72
|
+
abi: walletLinkAbi,
|
|
73
|
+
functionName: 'getRootKeyForWallet',
|
|
74
|
+
args: [wallet],
|
|
75
|
+
});
|
|
76
|
+
if (possibleRoot !== zeroAddress) {
|
|
77
|
+
const possibleLinkedWallets = await readContract(viem, {
|
|
78
|
+
address: walletLinkAddress,
|
|
79
|
+
abi: walletLinkAbi,
|
|
80
|
+
functionName: 'getWalletsByRootKey',
|
|
81
|
+
args: [possibleRoot],
|
|
82
|
+
});
|
|
83
|
+
return [possibleRoot, ...possibleLinkedWallets];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return linkedWallets;
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get the deployed modular smart account for a userId (rootkey)
|
|
94
|
+
* This function:
|
|
95
|
+
* 1. Gets all linked wallets for the userId using the WalletLink contract
|
|
96
|
+
* 2. Checks each wallet to see if it has a deployed modular smart account
|
|
97
|
+
* 3. Returns the first modular smart account found, or null if none exist
|
|
98
|
+
*
|
|
99
|
+
* @param bot - The bot instance
|
|
100
|
+
* @param params - User id
|
|
101
|
+
* @returns The address of the deployed modular smart account, or null if none exists
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { getDeployedSmartAccount } from '@towns-labs/agent'
|
|
106
|
+
*
|
|
107
|
+
* // Simple usage with bot instance
|
|
108
|
+
* const address = await getDeployedSmartAccount(bot, userId)
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export async function getSmartAccountFromUserId(bot, params) {
|
|
112
|
+
const contractAddress = bot.client.config.base.chainConfig.addresses.spaceFactory;
|
|
113
|
+
return getSmartAccountFromUserIdImpl(contractAddress, bot.viem, params.userId);
|
|
114
|
+
}
|
|
115
|
+
export async function getSmartAccountFromUserIdImpl(contractAddress, viem, userId) {
|
|
116
|
+
try {
|
|
117
|
+
// Get all linked wallets for this user
|
|
118
|
+
const linkedWallets = await getLinkedWalletsWithRootKey(viem, userId, contractAddress);
|
|
119
|
+
// Check each wallet for a deployed modular smart account
|
|
120
|
+
for (const address of linkedWallets) {
|
|
121
|
+
const isModular = await checkSmartAccountImplementation(viem, address);
|
|
122
|
+
if (isModular) {
|
|
123
|
+
return address;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=smart-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-account.js","sourceRoot":"","sources":["../src/smart-account.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PlainMessage, Snapshot } from '@towns-labs/proto';
|
|
2
|
+
import type { ParsedStreamResponse, Prettify } from '@towns-labs/sdk';
|
|
3
|
+
type RemoveContent<T extends string> = T extends `${infer Prefix}Content` ? Prefix : T;
|
|
4
|
+
type SnapshotContent = Exclude<Snapshot['content'], {
|
|
5
|
+
case: undefined;
|
|
6
|
+
}>;
|
|
7
|
+
type SnapshotTypeMap = {
|
|
8
|
+
[K in SnapshotContent['case']]: Extract<SnapshotContent, {
|
|
9
|
+
case: K;
|
|
10
|
+
}>['value'];
|
|
11
|
+
};
|
|
12
|
+
type GenerateGetters<SnapshotCase extends keyof SnapshotTypeMap, SnapshotType = PlainMessage<SnapshotTypeMap[SnapshotCase]>> = {
|
|
13
|
+
[Prop in NonNullable<keyof SnapshotType> as `get${Capitalize<RemoveContent<SnapshotCase>>}${Capitalize<string & Prop>}`]: (streamId: string) => Promise<SnapshotType[Prop]>;
|
|
14
|
+
};
|
|
15
|
+
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
16
|
+
type GetterFunctions = UnionToIntersection<{
|
|
17
|
+
[K in keyof SnapshotTypeMap]: GenerateGetters<K>;
|
|
18
|
+
}[keyof SnapshotTypeMap]>;
|
|
19
|
+
export declare const SnapshotGetter: (getStream: (streamId: string) => Promise<ParsedStreamResponse>) => Prettify<GetterFunctions>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=snapshot-getter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-getter.d.ts","sourceRoot":"","sources":["../src/snapshot-getter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAoB,MAAM,mBAAmB,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAIrE,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,CAAA;AAGtF,KAAK,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAA;AAGxE,KAAK,eAAe,GAAG;KAClB,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,eAAe,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,CAAC,OAAO,CAAC;CACjF,CAAA;AAGD,KAAK,eAAe,CAChB,YAAY,SAAS,MAAM,eAAe,EAC1C,YAAY,GAAG,YAAY,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,IAC1D;KACC,IAAI,IAAI,WAAW,CAChB,MAAM,YAAY,CACrB,IAAI,MAAM,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,CAC/E,QAAQ,EAAE,MAAM,KACf,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;CACnC,CAAA;AAGD,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,IAAI,GAC7F,CAAC,GACD,KAAK,CAAA;AAGX,KAAK,eAAe,GAAG,mBAAmB,CACtC;KACK,CAAC,IAAI,MAAM,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC;CACnD,CAAC,MAAM,eAAe,CAAC,CAC3B,CAAA;AAsBD,eAAO,MAAM,cAAc,GAAI,WAAW,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,KAyBpF,QAAQ,CAAC,eAAe,CAAC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const getFromSnapshot = (getStream) => async (streamId, snapshotCase, propertyKey) => {
|
|
2
|
+
const stream = await getStream(streamId);
|
|
3
|
+
if (stream.snapshot.content.case === snapshotCase) {
|
|
4
|
+
const snapshotValue = stream.snapshot.content.value;
|
|
5
|
+
return snapshotValue[propertyKey];
|
|
6
|
+
}
|
|
7
|
+
return undefined;
|
|
8
|
+
};
|
|
9
|
+
export const SnapshotGetter = (getStream) => new Proxy({}, {
|
|
10
|
+
get(_target, prop) {
|
|
11
|
+
return async (streamId) => {
|
|
12
|
+
// Parse the getter name to extract snapshot type and property
|
|
13
|
+
const propName = String(prop);
|
|
14
|
+
// Match pattern like getSpaceInception, getUserMemberships, etc.
|
|
15
|
+
const match = propName.match(/^get([A-Z][a-z]+)([A-Z][a-zA-Z]+)$/);
|
|
16
|
+
if (!match) {
|
|
17
|
+
throw new Error(`Invalid getter name: ${propName}`);
|
|
18
|
+
}
|
|
19
|
+
const [, snapshotType, propertyName] = match;
|
|
20
|
+
const snapshotCase = `${snapshotType.toLowerCase()}Content`;
|
|
21
|
+
const property = (propertyName.charAt(0).toLowerCase() +
|
|
22
|
+
propertyName.slice(1));
|
|
23
|
+
return getFromSnapshot(getStream)(streamId, snapshotCase, property);
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=snapshot-getter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-getter.js","sourceRoot":"","sources":["../src/snapshot-getter.ts"],"names":[],"mappings":"AA4CA,MAAM,eAAe,GACjB,CAAC,SAA8D,EAAE,EAAE,CACnE,KAAK,EACD,QAAgB,EAChB,YAAmB,EACnB,WAAiB,EACqC,EAAE;IACxD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAA;IACxC,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAChD,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAoC,CAAA;QAClF,OAAO,aAAa,CAAC,WAAW,CAAC,CAAA;IACrC,CAAC;IACD,OAAO,SAAS,CAAA;AACpB,CAAC,CAAA;AAEL,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAA8D,EAAE,EAAE,CAC7F,IAAI,KAAK,CACL,EAAE,EACF;IACI,GAAG,CAAC,OAAO,EAAE,IAAY;QACrB,OAAO,KAAK,EAAE,QAAgB,EAAE,EAAE;YAC9B,8DAA8D;YAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;YAE7B,iEAAiE;YACjE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAA;YAClE,IAAI,CAAC,KAAK,EAAE,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,EAAE,CAAC,CAAA;YACvD,CAAC;YAED,MAAM,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,GAAG,KAAK,CAAA;YAC5C,MAAM,YAAY,GACd,GAAG,YAAY,CAAC,WAAW,EAAE,SAAkC,CAAA;YACnE,MAAM,QAAQ,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;gBAClD,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAoD,CAAA;YAE7E,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;QACvE,CAAC,CAAA;IACL,CAAC;CACJ,CACyB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@towns-labs/agent",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"clean": "rm -rf dist",
|
|
10
|
+
"lint": "eslint --format unix ./src --max-warnings=0",
|
|
11
|
+
"lint:fix": "bun run lint --fix",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:ci": "vitest run --silent=passed-only",
|
|
14
|
+
"test:watch": "vitest --watch",
|
|
15
|
+
"typecheck": "tsc --noEmit",
|
|
16
|
+
"watch": "tsc --watch"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@bufbuild/protobuf": "^2.9.0",
|
|
20
|
+
"@connectrpc/connect-node": "^2.1.0",
|
|
21
|
+
"@standard-schema/spec": "^1.0.0-beta.9",
|
|
22
|
+
"@towns-labs/encryption": "^1.0.1",
|
|
23
|
+
"@towns-labs/generated": "^1.0.1",
|
|
24
|
+
"@towns-labs/proto": "^1.0.1",
|
|
25
|
+
"@towns-labs/sdk": "^1.0.1",
|
|
26
|
+
"@towns-labs/sdk-crypto": "^1.0.1",
|
|
27
|
+
"@towns-labs/utils": "^1.0.1",
|
|
28
|
+
"@towns-labs/web3": "^1.0.1",
|
|
29
|
+
"ethers": "^5.8.0",
|
|
30
|
+
"image-size": "^2.0.2",
|
|
31
|
+
"jsonwebtoken": "^9.0.2",
|
|
32
|
+
"nanoevents": "^9.1.0",
|
|
33
|
+
"superjson": "^2.2.2",
|
|
34
|
+
"x402": "^0.7.3"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@hono/node-server": "^1.14.0",
|
|
38
|
+
"@towns-labs/contracts": "^2.0.0",
|
|
39
|
+
"@towns-labs/relayer-client": "^0.0.1",
|
|
40
|
+
"@types/jsonwebtoken": "^9.0.9",
|
|
41
|
+
"@types/node": "^20.14.8",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
43
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
44
|
+
"eslint": "^8.57.1",
|
|
45
|
+
"eslint-import-resolver-typescript": "^4.3.2",
|
|
46
|
+
"eslint-plugin-import-x": "^4.10.2",
|
|
47
|
+
"eslint-plugin-tsdoc": "^0.3.0",
|
|
48
|
+
"fake-indexeddb": "^6.0.1",
|
|
49
|
+
"hono": "^4.11.7",
|
|
50
|
+
"nanoid": "^4.0.0",
|
|
51
|
+
"typescript": "~5.8.3",
|
|
52
|
+
"viem": "^2.29.3",
|
|
53
|
+
"vitest": "^3.2.3",
|
|
54
|
+
"zod": "^4.3.6"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"/dist",
|
|
58
|
+
"package.json"
|
|
59
|
+
],
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"hono": ">=4",
|
|
62
|
+
"viem": "2.x"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
}
|
|
67
|
+
}
|