abstractionkit 0.3.5 → 0.3.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,101 @@
1
1
  # Changelog
2
2
 
3
+ ## [UNRELEASED]
4
+
5
+ ## 0.3.8
6
+
7
+ ### New Features
8
+
9
+ - **EIP-712 UserOperation helpers aligned across account families.** `Simple7702Account`, `Simple7702AccountV09`, and `Calibur7702Account` now expose public static `getUserOperationEip712Data(userOp, chainId, overrides?)` and `getUserOperationEip712Hash(userOp, chainId, overrides?)` helpers. This matches the Safe helper naming and supports EntryPoint override via `overrides.entrypointAddress`.
10
+ - **EIP-712 typed-data signing support expanded.** `Calibur7702Account.signUserOperationWithSigner` now accepts `signTypedData` signers, and `Calibur7702Account.formatEip712SingleSignatureToUseroperationSignature(signature, overrides?)` wraps raw typed-data signatures into Calibur's `(keyHash, sig, hookData)` layout. `SafeMultiChainSigAccountV1.signUserOperationsWithSigners` now accepts typed-data-only signers for multi-operation Merkle bundles.
11
+ - **Pluggable `Transport` abstraction.** Node, bundler, and paymaster traffic now accepts EIP-1193-shaped transports:
12
+ ```ts
13
+ interface Transport {
14
+ request<T = unknown>(
15
+ args: { method: string; params?: readonly unknown[] | object },
16
+ options?: { signal?: AbortSignal },
17
+ ): Promise<T>;
18
+ }
19
+ ```
20
+ New exports: `Transport`, `EventfulTransport`, `isEventfulTransport`, `BaseRpcTransport`, `HttpTransport`, `isHttpTransport`, `JsonRpcNode`, `TransportRpcError`, `RequestArgs`, `RequestOptions`, `ProviderRpcError`, `HttpTransportOptions`, `JsonRpcEnvelope`, and `EthCallTransaction`.
21
+ - **`JsonRpcNode` service class added.** Methods: `chainId()`, `blockNumber()`, `getCode()`, `call()`, `getTransactionCount()`, `getFeeData()`, `getDelegatedAddress()`, `getEntryPointNonce()`, `getEntryPointDeposit()`, `getEntryPointDepositInfo()`, and `request()`. `getFeeData()` no longer depends on `ethers.JsonRpcProvider`.
22
+ - **RPC inputs widened.** `Bundler`, `CandidePaymaster`, and `Erc7677Paymaster` constructors now accept `string | Transport`; each class implements `Transport` and exposes `.from(input)`. Public `providerRpc?`, `bundlerRpc?`, and `nodeRpcUrl` parameters now accept `string | Transport | JsonRpcNode` for node calls and `string | Transport | Bundler` for bundler calls across Safe, Simple7702, Calibur, `AllowanceModule`, `SocialRecoveryModule`, and paymaster methods.
23
+ - **Request cancellation and service error mapping added.** `Transport.request` accepts `options?: { signal?: AbortSignal }`; `HttpTransport` forwards it to `fetch`. `NODE_ERROR` was added to `BasicErrorCode` for `JsonRpcNode`, and `sendJsonRpcRequest` now throws `TransportRpcError` while service classes translate into their own domain errors.
24
+ - **Tenderly helpers no longer depend on `sendJsonRpcRequest`.** `callTenderlySimulateBundle` now uses an inline `fetch` call; public Tenderly helper signatures are unchanged.
25
+
26
+ ### Breaking Changes
27
+
28
+ - **`BaseSimple7702Account#getUserOperationEip712TypedData` moved from an instance method to a static helper and was renamed to `getUserOperationEip712Data`.** The returned typed-data payload shape is unchanged, but callers must switch from `account.getUserOperationEip712TypedData(...)` to the account class' static helper. This aligns Simple7702 with the Safe and Calibur EIP-712 helper API and lets callers override the EntryPoint explicitly when needed. Migration:
29
+ ```ts
30
+ // Before
31
+ const typedData = account.getUserOperationEip712TypedData(userOp, chainId);
32
+
33
+ // After
34
+ const typedData = Simple7702Account.getUserOperationEip712Data(userOp, chainId);
35
+
36
+ // For EntryPoint v0.9
37
+ const typedDataV9 = Simple7702AccountV09.getUserOperationEip712Data(userOp, chainId);
38
+ ```
39
+ - **`bundler.rpcUrl` / `paymaster.rpcUrl` field removed.** The `readonly rpcUrl: string` field on `Bundler`, `CandidePaymaster`, and `Erc7677Paymaster` is replaced by `readonly transport: Transport`. Migration:
40
+ ```ts
41
+ // Before
42
+ const url = bundler.rpcUrl;
43
+
44
+ // After
45
+ import { isHttpTransport } from "abstractionkit";
46
+ const url = isHttpTransport(bundler.transport) ? bundler.transport.url : null;
47
+ ```
48
+ Keeping `rpcUrl` made no sense once the input could be a non-HTTP `Transport` — the field would have been `undefined` for `Transport` inputs and silently misleading.
49
+ - **Top-level helpers removed from the public API**: `fetchGasPrice`, `getBalanceOf`, `getDepositInfo`, `getDelegatedAddress`. Each was a thin URL-string wrapper around what is now a `JsonRpcNode` method (in some cases renamed for clarity). Migration:
50
+ ```ts
51
+ // Before
52
+ import { fetchGasPrice, getBalanceOf, getDepositInfo, getDelegatedAddress } from "abstractionkit";
53
+ const [maxFee, priority] = await fetchGasPrice(nodeUrl, GasOption.Medium);
54
+ const deposit = await getBalanceOf(nodeUrl, address, entryPoint);
55
+ const info = await getDepositInfo(nodeUrl, address, entryPoint);
56
+ const delegatee = await getDelegatedAddress(eoaAddress, nodeUrl);
57
+
58
+ // After
59
+ import { JsonRpcNode, GasOption } from "abstractionkit";
60
+ const node = new JsonRpcNode(nodeUrl);
61
+ const [maxFee, priority] = await node.getFeeData(GasOption.Medium);
62
+ const deposit = await node.getEntryPointDeposit(address, entryPoint);
63
+ const info = await node.getEntryPointDepositInfo(address, entryPoint);
64
+ const delegatee = await node.getDelegatedAddress(eoaAddress);
65
+ ```
66
+ The `DepositInfo` type continues to be exported from the package root. `fetchAccountNonce` and `sendJsonRpcRequest` are explicitly **kept** as top-level exports (both have their first parameter widened to `string | Transport | JsonRpcNode`); they're the only loose helpers preserved.
67
+
68
+ ### Bug Fixes
69
+
70
+ - **Social recovery multi-confirm transactions now encode and validate signer data correctly.** `createMultiConfirmRecoveryMetaTransaction` now uses the correct ABI tuple shape, sorts signer addresses with a spec-compliant comparator, and rejects duplicate signers before producing calldata. This prevents malformed recovery confirmations and catches invalid guardian input earlier.
71
+ - **`JsonRpcNode.getFeeData` preserves `bigint` precision above `Number.MAX_SAFE_INTEGER`.** Gas-level multipliers are now applied in `bigint` space instead of via `Number(gasPrice)`, avoiding precision loss for large gas prices.
72
+
73
+ ### Documentation
74
+
75
+ - **EIP-7702 delegation authorization signer docs are clearer.** `createAndSignEip7702DelegationAuthorization` now documents that callback signers sign the authorization hash directly, without an EIP-191 / EIP-712 prefix, and that both 65-byte standard signatures and 64-byte EIP-2098 compact signatures are accepted.
76
+ - **Safe multi-chain signing docs clarify `chainId` placement.** The single-operation signing JSDoc points out that `chainId` is passed positionally, while multi-operation signing carries `chainId` inside each `UserOperationToSign` item.
77
+
78
+ ### Testing and CI
79
+
80
+ - **Docker-backed integration test suite added.** The repo now includes an integration Jest config, global setup / teardown, chain matrix helpers, and e2e coverage for passkeys, social recovery, batch transactions, multisig, spend permissions, signer adapters, on-chain identifiers, bundler behavior, and EIP-712 signing.
81
+ - **EIP-7702 accounts added to the e2e matrix.** Calibur, `Simple7702Account` on EntryPoint v0.8, and `Simple7702AccountV09` on EntryPoint v0.9 now run through the account-agnostic integration suites. The local bundler matrix was expanded to run v0.8 with `--eip7702`.
82
+ - **Integration CI expanded.** The integration workflow now supports manual dispatch, fork RPC overrides, per-entrypoint bundlers, cached anvil images, fail-fast chain startup, and cleanup on `SIGINT` / `SIGTERM`.
83
+
84
+ ## 0.3.7
85
+
86
+ ### Fixes
87
+
88
+ - **Safe multi-chain single-operation signing now hashes the correct payload.** Single-op `SafeMultiChainSigAccountV1` flows previously hashed through the Merkle wrapper and were rejected on-chain with `AA24`, since `Safe4337MultiChainSignatureModule` verifies against `keccak256(SafeOp)` directly when `merkleTreeDepth == 0`. The per-op SafeOp digest is now reachable via `SafeMultiChainSigAccountV1.getUserOperationEip712Hash` / `getUserOperationEip712Data`, which default `safe4337ModuleAddress` to the multi-chain module so the digest matches the on-chain verifier without manual override.
89
+ - **Safe multi-chain WebAuthn / EIP-1271 signatures keep contract-signer formatting.** `signUserOperationsWithSigners` now preserves the `"contract"` signer type when formatting multi-operation signatures, so dynamic Safe contract-signature segments are emitted correctly.
90
+
91
+ ### API changes
92
+
93
+ - **`getMultiChainSingleSignatureUserOperationsEip712Hash` / `...Eip712Data` are wrapper-only and throw for `length < 2`.** They now do one thing: hash the Merkle-wrapped multi-op payload. Single-op callers must use `SafeMultiChainSigAccountV1.getUserOperationEip712Hash` / `getUserOperationEip712Data` (which default `safe4337ModuleAddress` to the multi-chain module). If you call the parent `SafeAccount` helpers directly, pass `safe4337ModuleAddress` explicitly. Their default points at the standard 4337 module, not the multi-chain one.
94
+
95
+ ### Maintenance
96
+
97
+ - Added signer API documentation, type-level signer tests, signer unit-test coverage, and CI checks for linting, type tests, build, and signer tests.
98
+
3
99
  ## 0.3.5
4
100
 
5
101
  ### New Features