@agether/sdk 2.9.0 → 2.11.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/dist/cli.js CHANGED
@@ -174,13 +174,13 @@ var init_config = __esm({
174
174
  safeProxyFactory: SAFE_PROXY_FACTORY,
175
175
  safe7579: SAFE7579,
176
176
  entryPoint: ENTRYPOINT_V07,
177
- agether4337Factory: "0xE350660Ab3EA87b50233854eacCC6328e268fb48",
178
- agether7579Bootstrap: "0xD1268B50149e468591Bcba5f6fD3E87b49D43008",
179
- erc8004ValidationModule: "0x87Aa07Be4Ab4A2e8EeBf4a4e2451c775D0e3fbf1",
180
- agetherHookMultiplexer: "0xC0b96e36B20d6689F4E4b8C7A0c19C28e8B45B8B",
177
+ agether4337Factory: "0xb6363c2B5C72C14D3fC4261e3dd836D8966bE072",
178
+ agether7579Bootstrap: "0x055C2e70dd011C4ADEEfB795Ab77D74437be6D33",
179
+ erc8004ValidationModule: "0xE282fB8615abb8bA53F07b8BAB2937C78fE3867D",
180
+ agetherHookMultiplexer: "0xeD62ac874F58CEc9F065aB8e6872752Eb0F6eA14",
181
181
  validationRegistry: ZERO,
182
- agether8004Scorer: "0xd281a8ec667E406Fcf1097A64A65d1C88Fb0F7Fa",
183
- timelockController: "0x2033CD354aAf19191F23211c6A6974fCE038AFBe",
182
+ agether8004Scorer: "0x960853769d52B14aA0daeab7E1E59f5c9299cb65",
183
+ timelockController: "0x78e0227f9DE577e583B8149C73F0bA1E7200AD01",
184
184
  usdc: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
185
185
  identityRegistry: ERC8004_IDENTITY_REGISTRY,
186
186
  morphoBlue: MORPHO_BLUE
@@ -190,13 +190,13 @@ var init_config = __esm({
190
190
  safeProxyFactory: SAFE_PROXY_FACTORY,
191
191
  safe7579: SAFE7579,
192
192
  entryPoint: ENTRYPOINT_V07,
193
- agether4337Factory: "0x8aeE4961EfaA4a1D36e2b24C5b430C8613fB5b8C",
194
- agether7579Bootstrap: "0x5e8e4644c628CB464936981e338635476d012B5F",
195
- erc8004ValidationModule: "0x7B18a7E3D5B3d043FC3525Efcd9a2bB1aE1369Ab",
196
- agetherHookMultiplexer: "0x2D98eff4b959F3dc76f14c5682A8546438406c4A",
193
+ agether4337Factory: "0x73f4153bf1d46dB203Db27fc8FC942f6279D8d38",
194
+ agether7579Bootstrap: "0xbD0BDFE70fDB88fc03F2Ea22B81A2dfc99298E42",
195
+ erc8004ValidationModule: "0x85C8C97cE5AE540a4408D6A77a6D3aFcA9BCdB71",
196
+ agetherHookMultiplexer: "0x688cab46ce5A7450D706e9E3C8e0F31BaEa6c8BE",
197
197
  validationRegistry: ZERO,
198
- agether8004Scorer: "0xA1a0B09147688a09A3027F960623Ae16d1ca7F69",
199
- timelockController: "0x7f104DBe209E2a05FFc1700b27eaE1C397f011c4",
198
+ agether8004Scorer: "0x33eB904fe9975e2D8c577aD7e5B14CefBD4A65E1",
199
+ timelockController: "0xB3FD04f0B7c9DeC7f7B52d5c2CdfdCB3Fc9eE111",
200
200
  usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
201
201
  identityRegistry: ERC8004_IDENTITY_REGISTRY,
202
202
  morphoBlue: MORPHO_BLUE
@@ -1763,6 +1763,28 @@ var init_AgetherClient = __esm({
1763
1763
  const signer = new import_ethers2.ethers.Wallet(privateKey, provider);
1764
1764
  return new _AgetherClient({ config, signer, agentId, _privateKey: privateKey });
1765
1765
  }
1766
+ static async fromSigner(signer, agentIdOrChain, chainIdOrConfig) {
1767
+ if (!signer.provider) {
1768
+ throw new AgetherError("Signer must be connected to a provider", "NO_PROVIDER");
1769
+ }
1770
+ let agentId;
1771
+ let config;
1772
+ if (typeof agentIdOrChain === "bigint") {
1773
+ agentId = agentIdOrChain;
1774
+ config = typeof chainIdOrConfig === "number" ? getDefaultConfig(chainIdOrConfig) : chainIdOrConfig;
1775
+ } else {
1776
+ config = typeof agentIdOrChain === "number" ? getDefaultConfig(agentIdOrChain) : agentIdOrChain;
1777
+ }
1778
+ const network = await signer.provider.getNetwork();
1779
+ const actualChainId = Number(network.chainId);
1780
+ if (actualChainId !== config.chainId) {
1781
+ throw new AgetherError(
1782
+ `Chain mismatch: signer is on chain ${actualChainId} but config expects chain ${config.chainId}`,
1783
+ "CHAIN_MISMATCH"
1784
+ );
1785
+ }
1786
+ return new _AgetherClient({ config, signer, agentId });
1787
+ }
1766
1788
  // ════════════════════════════════════════════════════════
1767
1789
  // Registration
1768
1790
  // ════════════════════════════════════════════════════════
package/dist/index.d.mts CHANGED
@@ -191,6 +191,32 @@ declare class AgetherClient {
191
191
  * Create an AgetherClient for an **existing** agent with a known agentId.
192
192
  */
193
193
  static fromPrivateKey(privateKey: string, agentId: bigint, chainIdOrConfig: ChainId | AgetherConfig): AgetherClient;
194
+ /**
195
+ * Create an AgetherClient from an **external signer** for a **new** agent (no agentId yet).
196
+ *
197
+ * Accepts any `ethers.AbstractSigner` — Privy, Bankr, Turnkey, MetaMask, etc.
198
+ * The signer **must** already be connected to a provider on the correct chain.
199
+ *
200
+ * Validates that the signer's provider chain matches the requested chain.
201
+ *
202
+ * Only `register()` and `getBalances()` are available until registration completes.
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * const client = await AgetherClient.fromSigner(privySigner, ChainId.Base);
207
+ * const result = await client.register();
208
+ * ```
209
+ */
210
+ static fromSigner(signer: ethers.AbstractSigner, chainIdOrConfig: ChainId | AgetherConfig): Promise<AgetherClient>;
211
+ /**
212
+ * Create an AgetherClient from an **external signer** for an **existing** agent.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * const client = await AgetherClient.fromSigner(privySigner, 42n, ChainId.Base);
217
+ * ```
218
+ */
219
+ static fromSigner(signer: ethers.AbstractSigner, agentId: bigint, chainIdOrConfig: ChainId | AgetherConfig): Promise<AgetherClient>;
194
220
  /**
195
221
  * Register: create ERC-8004 identity + Safe account in one flow.
196
222
  * If already registered, returns existing state.
package/dist/index.d.ts CHANGED
@@ -191,6 +191,32 @@ declare class AgetherClient {
191
191
  * Create an AgetherClient for an **existing** agent with a known agentId.
192
192
  */
193
193
  static fromPrivateKey(privateKey: string, agentId: bigint, chainIdOrConfig: ChainId | AgetherConfig): AgetherClient;
194
+ /**
195
+ * Create an AgetherClient from an **external signer** for a **new** agent (no agentId yet).
196
+ *
197
+ * Accepts any `ethers.AbstractSigner` — Privy, Bankr, Turnkey, MetaMask, etc.
198
+ * The signer **must** already be connected to a provider on the correct chain.
199
+ *
200
+ * Validates that the signer's provider chain matches the requested chain.
201
+ *
202
+ * Only `register()` and `getBalances()` are available until registration completes.
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * const client = await AgetherClient.fromSigner(privySigner, ChainId.Base);
207
+ * const result = await client.register();
208
+ * ```
209
+ */
210
+ static fromSigner(signer: ethers.AbstractSigner, chainIdOrConfig: ChainId | AgetherConfig): Promise<AgetherClient>;
211
+ /**
212
+ * Create an AgetherClient from an **external signer** for an **existing** agent.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * const client = await AgetherClient.fromSigner(privySigner, 42n, ChainId.Base);
217
+ * ```
218
+ */
219
+ static fromSigner(signer: ethers.AbstractSigner, agentId: bigint, chainIdOrConfig: ChainId | AgetherConfig): Promise<AgetherClient>;
194
220
  /**
195
221
  * Register: create ERC-8004 identity + Safe account in one flow.
196
222
  * If already registered, returns existing state.
package/dist/index.js CHANGED
@@ -247,13 +247,13 @@ var CONTRACT_ADDRESSES = {
247
247
  safeProxyFactory: SAFE_PROXY_FACTORY,
248
248
  safe7579: SAFE7579,
249
249
  entryPoint: ENTRYPOINT_V07,
250
- agether4337Factory: "0xE350660Ab3EA87b50233854eacCC6328e268fb48",
251
- agether7579Bootstrap: "0xD1268B50149e468591Bcba5f6fD3E87b49D43008",
252
- erc8004ValidationModule: "0x87Aa07Be4Ab4A2e8EeBf4a4e2451c775D0e3fbf1",
253
- agetherHookMultiplexer: "0xC0b96e36B20d6689F4E4b8C7A0c19C28e8B45B8B",
250
+ agether4337Factory: "0xb6363c2B5C72C14D3fC4261e3dd836D8966bE072",
251
+ agether7579Bootstrap: "0x055C2e70dd011C4ADEEfB795Ab77D74437be6D33",
252
+ erc8004ValidationModule: "0xE282fB8615abb8bA53F07b8BAB2937C78fE3867D",
253
+ agetherHookMultiplexer: "0xeD62ac874F58CEc9F065aB8e6872752Eb0F6eA14",
254
254
  validationRegistry: ZERO,
255
- agether8004Scorer: "0xd281a8ec667E406Fcf1097A64A65d1C88Fb0F7Fa",
256
- timelockController: "0x2033CD354aAf19191F23211c6A6974fCE038AFBe",
255
+ agether8004Scorer: "0x960853769d52B14aA0daeab7E1E59f5c9299cb65",
256
+ timelockController: "0x78e0227f9DE577e583B8149C73F0bA1E7200AD01",
257
257
  usdc: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
258
258
  identityRegistry: ERC8004_IDENTITY_REGISTRY,
259
259
  morphoBlue: MORPHO_BLUE
@@ -263,13 +263,13 @@ var CONTRACT_ADDRESSES = {
263
263
  safeProxyFactory: SAFE_PROXY_FACTORY,
264
264
  safe7579: SAFE7579,
265
265
  entryPoint: ENTRYPOINT_V07,
266
- agether4337Factory: "0x8aeE4961EfaA4a1D36e2b24C5b430C8613fB5b8C",
267
- agether7579Bootstrap: "0x5e8e4644c628CB464936981e338635476d012B5F",
268
- erc8004ValidationModule: "0x7B18a7E3D5B3d043FC3525Efcd9a2bB1aE1369Ab",
269
- agetherHookMultiplexer: "0x2D98eff4b959F3dc76f14c5682A8546438406c4A",
266
+ agether4337Factory: "0x73f4153bf1d46dB203Db27fc8FC942f6279D8d38",
267
+ agether7579Bootstrap: "0xbD0BDFE70fDB88fc03F2Ea22B81A2dfc99298E42",
268
+ erc8004ValidationModule: "0x85C8C97cE5AE540a4408D6A77a6D3aFcA9BCdB71",
269
+ agetherHookMultiplexer: "0x688cab46ce5A7450D706e9E3C8e0F31BaEa6c8BE",
270
270
  validationRegistry: ZERO,
271
- agether8004Scorer: "0xA1a0B09147688a09A3027F960623Ae16d1ca7F69",
272
- timelockController: "0x7f104DBe209E2a05FFc1700b27eaE1C397f011c4",
271
+ agether8004Scorer: "0x33eB904fe9975e2D8c577aD7e5B14CefBD4A65E1",
272
+ timelockController: "0xB3FD04f0B7c9DeC7f7B52d5c2CdfdCB3Fc9eE111",
273
273
  usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
274
274
  identityRegistry: ERC8004_IDENTITY_REGISTRY,
275
275
  morphoBlue: MORPHO_BLUE
@@ -418,6 +418,28 @@ var AgetherClient = class _AgetherClient {
418
418
  const signer = new import_ethers.ethers.Wallet(privateKey, provider);
419
419
  return new _AgetherClient({ config, signer, agentId, _privateKey: privateKey });
420
420
  }
421
+ static async fromSigner(signer, agentIdOrChain, chainIdOrConfig) {
422
+ if (!signer.provider) {
423
+ throw new AgetherError("Signer must be connected to a provider", "NO_PROVIDER");
424
+ }
425
+ let agentId;
426
+ let config;
427
+ if (typeof agentIdOrChain === "bigint") {
428
+ agentId = agentIdOrChain;
429
+ config = typeof chainIdOrConfig === "number" ? getDefaultConfig(chainIdOrConfig) : chainIdOrConfig;
430
+ } else {
431
+ config = typeof agentIdOrChain === "number" ? getDefaultConfig(agentIdOrChain) : agentIdOrChain;
432
+ }
433
+ const network = await signer.provider.getNetwork();
434
+ const actualChainId = Number(network.chainId);
435
+ if (actualChainId !== config.chainId) {
436
+ throw new AgetherError(
437
+ `Chain mismatch: signer is on chain ${actualChainId} but config expects chain ${config.chainId}`,
438
+ "CHAIN_MISMATCH"
439
+ );
440
+ }
441
+ return new _AgetherClient({ config, signer, agentId });
442
+ }
421
443
  // ════════════════════════════════════════════════════════
422
444
  // Registration
423
445
  // ════════════════════════════════════════════════════════
package/dist/index.mjs CHANGED
@@ -172,13 +172,13 @@ var CONTRACT_ADDRESSES = {
172
172
  safeProxyFactory: SAFE_PROXY_FACTORY,
173
173
  safe7579: SAFE7579,
174
174
  entryPoint: ENTRYPOINT_V07,
175
- agether4337Factory: "0xE350660Ab3EA87b50233854eacCC6328e268fb48",
176
- agether7579Bootstrap: "0xD1268B50149e468591Bcba5f6fD3E87b49D43008",
177
- erc8004ValidationModule: "0x87Aa07Be4Ab4A2e8EeBf4a4e2451c775D0e3fbf1",
178
- agetherHookMultiplexer: "0xC0b96e36B20d6689F4E4b8C7A0c19C28e8B45B8B",
175
+ agether4337Factory: "0xb6363c2B5C72C14D3fC4261e3dd836D8966bE072",
176
+ agether7579Bootstrap: "0x055C2e70dd011C4ADEEfB795Ab77D74437be6D33",
177
+ erc8004ValidationModule: "0xE282fB8615abb8bA53F07b8BAB2937C78fE3867D",
178
+ agetherHookMultiplexer: "0xeD62ac874F58CEc9F065aB8e6872752Eb0F6eA14",
179
179
  validationRegistry: ZERO,
180
- agether8004Scorer: "0xd281a8ec667E406Fcf1097A64A65d1C88Fb0F7Fa",
181
- timelockController: "0x2033CD354aAf19191F23211c6A6974fCE038AFBe",
180
+ agether8004Scorer: "0x960853769d52B14aA0daeab7E1E59f5c9299cb65",
181
+ timelockController: "0x78e0227f9DE577e583B8149C73F0bA1E7200AD01",
182
182
  usdc: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
183
183
  identityRegistry: ERC8004_IDENTITY_REGISTRY,
184
184
  morphoBlue: MORPHO_BLUE
@@ -188,13 +188,13 @@ var CONTRACT_ADDRESSES = {
188
188
  safeProxyFactory: SAFE_PROXY_FACTORY,
189
189
  safe7579: SAFE7579,
190
190
  entryPoint: ENTRYPOINT_V07,
191
- agether4337Factory: "0x8aeE4961EfaA4a1D36e2b24C5b430C8613fB5b8C",
192
- agether7579Bootstrap: "0x5e8e4644c628CB464936981e338635476d012B5F",
193
- erc8004ValidationModule: "0x7B18a7E3D5B3d043FC3525Efcd9a2bB1aE1369Ab",
194
- agetherHookMultiplexer: "0x2D98eff4b959F3dc76f14c5682A8546438406c4A",
191
+ agether4337Factory: "0x73f4153bf1d46dB203Db27fc8FC942f6279D8d38",
192
+ agether7579Bootstrap: "0xbD0BDFE70fDB88fc03F2Ea22B81A2dfc99298E42",
193
+ erc8004ValidationModule: "0x85C8C97cE5AE540a4408D6A77a6D3aFcA9BCdB71",
194
+ agetherHookMultiplexer: "0x688cab46ce5A7450D706e9E3C8e0F31BaEa6c8BE",
195
195
  validationRegistry: ZERO,
196
- agether8004Scorer: "0xA1a0B09147688a09A3027F960623Ae16d1ca7F69",
197
- timelockController: "0x7f104DBe209E2a05FFc1700b27eaE1C397f011c4",
196
+ agether8004Scorer: "0x33eB904fe9975e2D8c577aD7e5B14CefBD4A65E1",
197
+ timelockController: "0xB3FD04f0B7c9DeC7f7B52d5c2CdfdCB3Fc9eE111",
198
198
  usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
199
199
  identityRegistry: ERC8004_IDENTITY_REGISTRY,
200
200
  morphoBlue: MORPHO_BLUE
@@ -343,6 +343,28 @@ var AgetherClient = class _AgetherClient {
343
343
  const signer = new ethers.Wallet(privateKey, provider);
344
344
  return new _AgetherClient({ config, signer, agentId, _privateKey: privateKey });
345
345
  }
346
+ static async fromSigner(signer, agentIdOrChain, chainIdOrConfig) {
347
+ if (!signer.provider) {
348
+ throw new AgetherError("Signer must be connected to a provider", "NO_PROVIDER");
349
+ }
350
+ let agentId;
351
+ let config;
352
+ if (typeof agentIdOrChain === "bigint") {
353
+ agentId = agentIdOrChain;
354
+ config = typeof chainIdOrConfig === "number" ? getDefaultConfig(chainIdOrConfig) : chainIdOrConfig;
355
+ } else {
356
+ config = typeof agentIdOrChain === "number" ? getDefaultConfig(agentIdOrChain) : agentIdOrChain;
357
+ }
358
+ const network = await signer.provider.getNetwork();
359
+ const actualChainId = Number(network.chainId);
360
+ if (actualChainId !== config.chainId) {
361
+ throw new AgetherError(
362
+ `Chain mismatch: signer is on chain ${actualChainId} but config expects chain ${config.chainId}`,
363
+ "CHAIN_MISMATCH"
364
+ );
365
+ }
366
+ return new _AgetherClient({ config, signer, agentId });
367
+ }
346
368
  // ════════════════════════════════════════════════════════
347
369
  // Registration
348
370
  // ════════════════════════════════════════════════════════
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agether/sdk",
3
- "version": "2.9.0",
3
+ "version": "2.11.1",
4
4
  "description": "TypeScript SDK for Agether - autonomous credit for AI agents on Ethereum & Base",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",