abstractionkit 0.3.5 → 0.3.7
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/index.cjs +30 -9
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.iife.js +30 -9
- package/dist/index.mjs +30 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
- package/CHANGELOG.md +0 -358
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "Candidelabs",
|
|
5
5
|
"url": "https://candide.dev"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.7",
|
|
8
8
|
"description": "Account Abstraction 4337 SDK by Candidelabs",
|
|
9
9
|
"main": "dist/index.cjs",
|
|
10
10
|
"module": "dist/index.mjs",
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"prepare": "tsdown",
|
|
28
28
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
29
29
|
"test": "jest --verbose",
|
|
30
|
+
"test:signer": "jest --runTestsByPath test/signer/signer.test.js --runInBand",
|
|
31
|
+
"test:types": "tsc -p test/types/tsconfig.json --noEmit",
|
|
30
32
|
"lint": "biome lint src",
|
|
31
33
|
"format": "biome format --write src",
|
|
32
34
|
"check": "biome check --write src"
|
package/CHANGELOG.md
DELETED
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.3.5
|
|
4
|
-
|
|
5
|
-
### New Features
|
|
6
|
-
|
|
7
|
-
- **EIP-712 typed-data signing for `Simple7702Account` / `Simple7702AccountV09`**: `signUserOperationWithSigner` now accepts `signTypedData`-only signers (JSON-RPC wallets, viem `WalletClient`) in addition to existing `signHash` signers. The v0.8/v0.9 `userOpHash` IS the EIP-712 digest of `PackedUserOperation` under the EntryPoint's domain, so both schemes produce signatures that validate against the same hash. Throws on EntryPoint v0.7 (different signing scheme). Adds `getUserOperationEip712TypedData(userOp, chainId)` on `BaseSimple7702Account` as the lower-level escape hatch for integrators driving `signTypedData` with their own primitive (HSM, MPC, custom wallet abstraction).
|
|
8
|
-
```ts
|
|
9
|
-
// Path A: signTypedData-only signer
|
|
10
|
-
const signer = {
|
|
11
|
-
address: eoaAddress,
|
|
12
|
-
signTypedData: async (td) => walletClient.signTypedData(td),
|
|
13
|
-
};
|
|
14
|
-
userOp.signature = await account.signUserOperationWithSigner(userOp, signer, chainId);
|
|
15
|
-
|
|
16
|
-
// Path B: drive signTypedData yourself
|
|
17
|
-
const td = account.getUserOperationEip712TypedData(userOp, chainId);
|
|
18
|
-
userOp.signature = await wallet.signTypedData(td.domain, td.types, td.message);
|
|
19
|
-
```
|
|
20
|
-
- **WebAuthn pubkey JSON helpers + assertion normalizer** (3 new exports from package root):
|
|
21
|
-
- `pubkeyCoordinatesToJson(pubkey)` / `pubkeyCoordinatesFromJson(input)`: bigint-safe JSON round-trip for `{ x, y }` coordinates. Hex on the wire, canonical `{ x: bigint, y: bigint }` after parse. `fromJson` accepts a JSON string or a pre-parsed object, and either hex or decimal string coords.
|
|
22
|
-
- `webauthnSignatureFromAssertion(response)`: turns a structural assertion shape (browser `AuthenticatorAssertionResponse`, `ox/WebAuthnP256` sign output, or `@simplewebauthn/browser`) into the `WebauthnSignatureData` that `fromSafeWebauthn` and `createWebAuthnSignature` already accept. Replaces the ~13-line parser pipeline every Safe-passkeys consumer was writing in their `getAssertion` callback.
|
|
23
|
-
- **`fromSafeWebauthn` adapter**: package-root factory that produces an `ExternalSigner` from a WebAuthn credential, ready to pass into `safe.signUserOperationWithSigners(op, [signer], chainId)`. Hides three Safe-specific concerns: address routing (the WebAuthn shared signer for the deployment UserOp, the deterministic verifier-proxy address derived from `(x, y)` afterward), the `type: "contract"` tag, and the Safe-specific signature encoding. Required `accountClass` parameter (the same Safe subclass used at `initializeNewAccount`) sources the Passkey module defaults — `SafeAccountV0_2_0` / `SafeAccountV0_3_0` for v0.2.0 (FCL P256), `SafeMultiChainSigAccountV1` for v0.2.1 (Daimo P256 + RIP-7951). Picking the wrong class would derive an address that isn't an on-chain owner and the bundler would reject with a generic "Invalid UserOp signature" (`GS026` on-chain), so the param is required to surface this choice at compile time. Caller supplies a `getAssertion(challenge: Uint8Array) => Promise<WebauthnSignatureData>` callback that runs `navigator.credentials.get(...)` (browser) or an equivalent native bridge — the SDK doesn't import `navigator` itself, so the adapter stays environment-agnostic. Pass `expectedSigners: [{ x, y }]` to `createUserOperation` so the bundler estimates verification gas against the WebAuthn dummy signature (~400 bytes) instead of the EOA dummy (~65 bytes); without it, the real signed UserOp is rejected at submit. The `FromSafeWebauthnParams` and `WebauthnAssertionFetcher` types are also exported from the package root.
|
|
24
|
-
```ts
|
|
25
|
-
import { fromSafeWebauthn, SafeAccountV0_3_0 } from "abstractionkit";
|
|
26
|
-
|
|
27
|
-
let userOperation = await safe.createUserOperation(
|
|
28
|
-
transactions, nodeUrl, bundlerUrl,
|
|
29
|
-
{ expectedSigners: [{ x, y }] },
|
|
30
|
-
);
|
|
31
|
-
const signer = fromSafeWebauthn({
|
|
32
|
-
publicKey: { x, y },
|
|
33
|
-
isInit: userOperation.nonce === 0n,
|
|
34
|
-
accountClass: SafeAccountV0_3_0, // SafeMultiChainSigAccountV1 for multi-chain
|
|
35
|
-
getAssertion: async (challenge) => {
|
|
36
|
-
const assertion = await navigator.credentials.get({
|
|
37
|
-
publicKey: { challenge, rpId, allowCredentials, userVerification },
|
|
38
|
-
});
|
|
39
|
-
return {
|
|
40
|
-
authenticatorData: assertion.response.authenticatorData,
|
|
41
|
-
clientDataFields: extractClientDataFields(assertion.response),
|
|
42
|
-
rs: extractSignature(assertion.response),
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
userOperation.signature = await safe.signUserOperationWithSigners(
|
|
47
|
-
userOperation, [signer], chainId,
|
|
48
|
-
);
|
|
49
|
-
```
|
|
50
|
-
- **`ExternalSigner.type` field** (`"ecdsa" | "contract"`, optional, defaults to `"ecdsa"`). When `"contract"`, the signer's signature is encoded as a dynamic-length EIP-1271 contract-signature segment instead of a raw 65-byte ECDSA blob. Lets a single `signUserOperationWithSigners([...])` call mix ECDSA owners and contract-signature owners (WebAuthn, smart-contract owners) in the same Safe multisig batch. Account-agnostic: ignored by non-Safe accounts that don't model contract signatures. `fromSafeWebauthn` sets this internally.
|
|
51
|
-
|
|
52
|
-
### Breaking Changes
|
|
53
|
-
|
|
54
|
-
- **`UserOperationToSignWithOverrides.overrides` is split into `options` and `webAuthnSignatureOverrides`.** The previous kitchen-sink `overrides` field carried both per-call signing options (timing, multi-chain, module address) and WebAuthn-specific encoding overrides (verifier addresses, init flag); these now live on dedicated fields. Affects callers of `SafeMultiChainSigAccountV1.signUserOperations` and `signUserOperationsWithSigners`. Migration:
|
|
55
|
-
```ts
|
|
56
|
-
// Before
|
|
57
|
-
await safe.signUserOperations(
|
|
58
|
-
[{
|
|
59
|
-
userOperation, chainId, validAfter, validUntil,
|
|
60
|
-
overrides: { isInit: true, webAuthnSharedSigner, safe4337ModuleAddress },
|
|
61
|
-
}],
|
|
62
|
-
[pk],
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
// After
|
|
66
|
-
await safe.signUserOperations(
|
|
67
|
-
[{
|
|
68
|
-
userOperation, chainId, validAfter, validUntil,
|
|
69
|
-
options: { safe4337ModuleAddress },
|
|
70
|
-
webAuthnSignatureOverrides: { isInit: true, webAuthnSharedSigner },
|
|
71
|
-
}],
|
|
72
|
-
[pk],
|
|
73
|
-
);
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## 0.3.4
|
|
77
|
-
|
|
78
|
-
### New Features
|
|
79
|
-
|
|
80
|
-
- **`SafeAccount.isDeployed(accountAddress, nodeRpcUrl)`**: static method that checks whether a Safe account is already deployed on-chain. Returns `true` when `accountAddress` has non-empty bytecode, `false` otherwise. Useful for branching between `new SafeAccountV0_3_0(address)` (existing account) and `SafeAccountV0_3_0.initializeNewAccount([owners])` (counterfactual) without inspecting `eth_getCode` manually.
|
|
81
|
-
|
|
82
|
-
## 0.3.3
|
|
83
|
-
|
|
84
|
-
### New Features
|
|
85
|
-
|
|
86
|
-
- **`TokenQuote` type** exported from the package root: `{ token: string; exchangeRate: bigint; tokenCost: bigint }`. Surfaces the exchange rate and maximum token cost the paymaster applied when paying gas with an ERC-20 token, so consumers can display the cost to users or log/meter it without a second RPC round-trip.
|
|
87
|
-
- **`CandidePaymaster.createTokenPaymasterUserOperation` and `Erc7677Paymaster.createPaymasterUserOperation` now return `tokenQuote`** alongside the UserOperation. Populated on the token-payment flow; absent on sponsored flows and on Candide's `signingPhase: "finalize"` path (no gas estimation → no cost computation).
|
|
88
|
-
- **`skipGasEstimation` flag on `createUserOperation` overrides** for `SafeAccount`, `Calibur7702Account`, and `Simple7702Account`. When set, the UserOperation is returned with a dummy signature and zero (or override-provided) gas limits, skipping the bundler's `eth_estimateUserOperationGas` roundtrip. Useful when gas estimation is run separately, for example by a paymaster sponsorship call that returns its own gas limits.
|
|
89
|
-
- **`SponsorInfo` type** exported from the package root. Represents the raw `{ name, icon? }` shape returned by paymasters per ERC-7677; `CandidePaymaster` normalizes it into the public `SponsorMetadata` shape.
|
|
90
|
-
|
|
91
|
-
### Breaking Changes
|
|
92
|
-
|
|
93
|
-
- **Three paymaster methods changed return shape** from a raw UserOperation / tuple to a named-field object. All now return `{ userOperation, tokenQuote? | sponsorMetadata? }`:
|
|
94
|
-
- `CandidePaymaster.createTokenPaymasterUserOperation` — returns `{ userOperation, tokenQuote? }` (was `SameUserOp<T>`).
|
|
95
|
-
- `CandidePaymaster.createSponsorPaymasterUserOperation` — returns `{ userOperation, sponsorMetadata? }` (was `[SameUserOp<T>, SponsorMetadata | undefined]`).
|
|
96
|
-
- `Erc7677Paymaster.createPaymasterUserOperation` — returns `{ userOperation, tokenQuote? }` (was `SameUserOp<T>`).
|
|
97
|
-
|
|
98
|
-
Migration:
|
|
99
|
-
```ts
|
|
100
|
-
// Before
|
|
101
|
-
const [sponsoredOp, sponsorMetadata] = await paymaster.createSponsorPaymasterUserOperation(...);
|
|
102
|
-
const tokenOp = await paymaster.createTokenPaymasterUserOperation(...);
|
|
103
|
-
const userOp = await erc7677.createPaymasterUserOperation(...);
|
|
104
|
-
|
|
105
|
-
// After
|
|
106
|
-
const { userOperation: sponsoredOp, sponsorMetadata } = await paymaster.createSponsorPaymasterUserOperation(...);
|
|
107
|
-
const { userOperation: tokenOp, tokenQuote } = await paymaster.createTokenPaymasterUserOperation(...);
|
|
108
|
-
const { userOperation, tokenQuote } = await erc7677.createPaymasterUserOperation(...);
|
|
109
|
-
```
|
|
110
|
-
- **`CandidePaymasterContext` moved back to a dedicated parameter** on `CandidePaymaster.createSponsorPaymasterUserOperation` and `createTokenPaymasterUserOperation`. The `context` field was removed from `GasPaymasterUserOperationOverrides`, and `context` is now the second-to-last argument (optional) on both methods, with `overrides` as the last argument. Migration:
|
|
111
|
-
```ts
|
|
112
|
-
// Before (0.3.2): context nested inside overrides
|
|
113
|
-
await paymaster.createSponsorPaymasterUserOperation(
|
|
114
|
-
smartAccount, userOp, bundlerRpc, sponsorshipPolicyId,
|
|
115
|
-
{ context: { signingPhase: "commit" }, maxFeePerGasMultiplier: 110n },
|
|
116
|
-
);
|
|
117
|
-
await paymaster.createTokenPaymasterUserOperation(
|
|
118
|
-
smartAccount, userOp, tokenAddress, bundlerRpc,
|
|
119
|
-
{ context: { signingPhase: "commit" }, maxFeePerGasMultiplier: 110n },
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
// After (0.3.3): context is a dedicated argument
|
|
123
|
-
await paymaster.createSponsorPaymasterUserOperation(
|
|
124
|
-
smartAccount, userOp, bundlerRpc, sponsorshipPolicyId,
|
|
125
|
-
{ signingPhase: "commit" },
|
|
126
|
-
{ maxFeePerGasMultiplier: 110n },
|
|
127
|
-
);
|
|
128
|
-
// For createTokenPaymasterUserOperation, `context` is optional: the method
|
|
129
|
-
// always derives `context.token` from the `tokenAddress` argument, so pass
|
|
130
|
-
// `undefined` unless you need other context fields (e.g. `signingPhase`).
|
|
131
|
-
await paymaster.createTokenPaymasterUserOperation(
|
|
132
|
-
smartAccount, userOp, tokenAddress, bundlerRpc,
|
|
133
|
-
undefined,
|
|
134
|
-
{ maxFeePerGasMultiplier: 110n },
|
|
135
|
-
);
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Bug Fixes
|
|
139
|
-
|
|
140
|
-
- **`CandidePaymaster` now parses sponsor info per ERC-7677.** Paymasters return sponsor info under `sponsor: { name, icon? }` (singular `icon`); the previous code read a non-standard `sponsorMetadata` key and therefore always returned `undefined`. The raw response is now normalized into the public `SponsorMetadata` shape (`{ name, description, url, icons[] }`).
|
|
141
|
-
|
|
142
|
-
## 0.3.2
|
|
143
|
-
|
|
144
|
-
### New Features
|
|
145
|
-
|
|
146
|
-
- **`signUserOperationWithSigner(s)` + `ExternalSigner` (capability-oriented signing API)**: new async method on every account class for integrating viem, ethers Signers, hardware wallets, HSMs, MPC, WebAuthn, or Uint8Array-only signers without passing raw private keys. Each account declares its accepted schemes via a static `ACCEPTED_SIGNING_SCHEMES: ReadonlyArray<"hash" | "typedData">`, and incompatible signers fail offline with an actionable error. The method naming mirrors the parameter arity:
|
|
147
|
-
- Safe accounts (multi-signer): `signUserOperationWithSigners(op, signers[], chainId)` — plural.
|
|
148
|
-
- Simple7702 / Calibur (single signer): `signUserOperationWithSigner(op, signer, chainId)` — singular.
|
|
149
|
-
|
|
150
|
-
Call-site is one line:
|
|
151
|
-
```ts
|
|
152
|
-
import { fromViem } from "abstractionkit"
|
|
153
|
-
userOp.signature = await safe.signUserOperationWithSigners(
|
|
154
|
-
userOp, [fromViem(account)], chainId,
|
|
155
|
-
)
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
- **`ExternalSigner` interface**: `{ address, signHash?, signTypedData? }` discriminated union that enforces at least one of the two methods at compile time. Accepts any signer that matches the shape (viem local account, viem WalletClient, ethers Wallet, hardware wallet, MPC, WebAuthn, Uint8Array-held keys). The library has zero runtime dependency on viem or ethers for this surface.
|
|
159
|
-
- **`fromPrivateKey(pk)` / `fromViem(account)` / `fromEthersWallet(wallet)` / `fromViemWalletClient(client)` adapters**: one-line factories returning an `ExternalSigner`. Structural types only. `fromViem` / `fromViemWalletClient` require viem ≥ 2.0; `fromEthersWallet` requires ethers ≥ 6.0.
|
|
160
|
-
- **`SignHashFn` / `SignTypedDataFn` / `TypedData` / `SigningScheme` / `SignContext` / `MultiOpSignContext` types** exported from the package root for implementers of custom signers.
|
|
161
|
-
- **`SignContext` forwarded to signers, narrowly typed per signing path**: signers receive a context as the second arg of `signHash` / `signTypedData` so custom validator implementations can inspect the userOp. `Signer<C>` is generic over context (default `C = SignContext` for single-op `{userOperation, chainId, entryPoint}`; opt into `ExternalSigner<MultiOpSignContext>` for `signUserOperationsWithSigners`'s `{userOperations[], entryPoint}`). Built-in adapters return `Signer<unknown>` and work everywhere. See `src/signer/types.ts`.
|
|
162
|
-
- **`SafeMultiChainSigAccountV1.signUserOperationsWithSigners`**: new async multi-op variant that signs a Merkle-rooted bundle of UserOperations with a single signature across chains, using `ExternalSigner[]`.
|
|
163
|
-
|
|
164
|
-
### Breaking Changes
|
|
165
|
-
|
|
166
|
-
> **Note on versioning.** The callback-API removal below is a breaking change for callers of `signUserOperationWithSigner`'s prior callback shape on `Calibur7702Account`. Calibur is not yet in use in any production environment; we're communicating directly with the developers currently building against it to coordinate the migration.
|
|
167
|
-
|
|
168
|
-
- **`SafeAccount.baseSignSingleUserOperation` is now `protected static`.** Previously `public static`, which leaked an internal helper into the package surface. All callers should use the version-specific subclass methods that wrap it (`SafeAccountV0_2_0#signUserOperation`, `SafeAccountV0_3_0#signUserOperation`, etc.) — they auto-inject the correct entrypoint and 4337 module addresses. Migration:
|
|
169
|
-
```ts
|
|
170
|
-
// Before:
|
|
171
|
-
const sig = SafeAccount.baseSignSingleUserOperation(
|
|
172
|
-
op, [pk], chainId,
|
|
173
|
-
SafeAccountV0_3_0.DEFAULT_ENTRYPOINT_ADDRESS,
|
|
174
|
-
SafeAccountV0_3_0.DEFAULT_SAFE_4337_MODULE_ADDRESS,
|
|
175
|
-
);
|
|
176
|
-
// After:
|
|
177
|
-
const sig = safeV3.signUserOperation(op, [pk], chainId);
|
|
178
|
-
```
|
|
179
|
-
`baseSignUserOperationWithSigners` (introduced earlier in this Unreleased window) is also `protected static` for the same reason; no migration needed since it was never on a released `latest` tag.
|
|
180
|
-
- **`ViemLocalAccountLike` / `ViemWalletClientLike` / `EthersWalletLike` are no longer exported.** They're internal structural shapes the adapters match against; pass concrete viem / ethers instances directly to `fromViem` / `fromViemWalletClient` / `fromEthersWallet`. If you need to type a wrapper, use `Parameters<typeof fromViem>[0]` (etc.).
|
|
181
|
-
- **Callback signing API removed.** `signUserOperationWithSigner(op, callback, chainId)` as introduced in the original signer PR is gone, along with the `SignerFunction`, `AddressedSignerFunction`, `SignerInput`, `SignerResult`, and `SignerTypedData` types. The callback method name is now reused for the new capability-oriented API on single-signer accounts (Simple7702, Calibur) with a different parameter shape. Migration:
|
|
182
|
-
```ts
|
|
183
|
-
// Before:
|
|
184
|
-
const signer = async ({ userOpHash }) => ({
|
|
185
|
-
signature: wallet.signingKey.sign(userOpHash).serialized,
|
|
186
|
-
});
|
|
187
|
-
userOp.signature = await account.signUserOperationWithSigner(userOp, signer, chainId);
|
|
188
|
-
|
|
189
|
-
// After — Simple7702 / Calibur (single signer):
|
|
190
|
-
import { fromEthersWallet } from "abstractionkit";
|
|
191
|
-
userOp.signature = await account.signUserOperationWithSigner(
|
|
192
|
-
userOp, fromEthersWallet(wallet), chainId,
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
// After — Safe accounts (multi-signer, plural method name):
|
|
196
|
-
userOp.signature = await safe.signUserOperationWithSigners(
|
|
197
|
-
userOp, [fromEthersWallet(wallet)], chainId,
|
|
198
|
-
);
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Migration: Signing with a raw private key
|
|
202
|
-
|
|
203
|
-
The existing sync `signUserOperation(op, pk[] | pk, chainId): string` method on every account **is untouched**. If your code passes a hex private-key string directly, no change needed. The new `signUserOperationWithSigner(s)` methods are Signers-only — they do NOT accept bare pk strings. To sign with a pk string via the new API, wrap explicitly:
|
|
204
|
-
|
|
205
|
-
```ts
|
|
206
|
-
import { fromPrivateKey } from "abstractionkit";
|
|
207
|
-
userOp.signature = await safe.signUserOperationWithSigners(
|
|
208
|
-
userOp, [fromPrivateKey(pk)], chainId,
|
|
209
|
-
);
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## 0.3.1
|
|
213
|
-
|
|
214
|
-
### New Features
|
|
215
|
-
|
|
216
|
-
- **`Erc7677Paymaster`**: provider-agnostic [ERC-7677](https://eips.ethereum.org/EIPS/eip-7677) paymaster client. Works with any compliant provider (Candide, Pimlico, Alchemy, ...). Auto-detects Candide/Pimlico from the URL and runs the full stub, estimate, and final pipeline in one call. Passing `{ token }` in context triggers the ERC-20 gas flow automatically.
|
|
217
|
-
- `Bundler.estimateUserOperationGas` now forwards `paymasterVerificationGasLimit` and `paymasterPostOpGasLimit` when returned by the bundler.
|
|
218
|
-
|
|
219
|
-
### Breaking Changes
|
|
220
|
-
|
|
221
|
-
- **`SafeMultiChainSigAccountV1.formatSignaturesToUseroperationsSignatures`**: the third `overrides` argument has been removed. Overrides are now per-operation via a new optional `overrides` field on each `UserOperationToSignWithOverrides` element of the first argument. Migration: `ops.map(op => ({ ...op, overrides: {...} }))` and drop the third argument.
|
|
222
|
-
|
|
223
|
-
### Other
|
|
224
|
-
|
|
225
|
-
- Minor type tightening across Calibur, Simple7702, and Tenderly helpers.
|
|
226
|
-
|
|
227
|
-
## 0.3.0
|
|
228
|
-
|
|
229
|
-
**This is a major release. The canonical upgrade path is from 0.2.30 (previous stable) to 0.3.0 (current stable).** Versions 0.2.31 through 0.2.41 were experimental pre-releases and are not on the `latest` dist-tag.
|
|
230
|
-
|
|
231
|
-
### Breaking Changes
|
|
232
|
-
|
|
233
|
-
#### Build & Runtime
|
|
234
|
-
|
|
235
|
-
- **Node.js >= 18 required.** Native `fetch` is now used; `isomorphic-unfetch` has been removed as a dependency.
|
|
236
|
-
- **Build system switched from microbundle to tsdown.** Dist output paths have changed. If you import from a subpath, update your references:
|
|
237
|
-
- `dist/index.js` -> `dist/index.cjs`
|
|
238
|
-
- `dist/index.m.js` -> `dist/index.mjs`
|
|
239
|
-
- `dist/index.umd.js` -> `dist/index.iife.js`
|
|
240
|
-
- `dist/index.d.ts` -> `dist/index.d.cts`
|
|
241
|
-
- A proper `exports` map has been added to `package.json` for ESM/CJS resolution, so normal `import { X } from "abstractionkit"` consumers are unaffected.
|
|
242
|
-
|
|
243
|
-
#### Paymaster API
|
|
244
|
-
|
|
245
|
-
- **`CandidePaymaster.createSponsorPaymasterUserOperation(...)` signature changed.** The method now takes `smartAccount` as the **first** argument. Migration:
|
|
246
|
-
```ts
|
|
247
|
-
// Before (0.2.30):
|
|
248
|
-
await paymaster.createSponsorPaymasterUserOperation(userOp, bundlerRpc, sponsorshipPolicyId, overrides);
|
|
249
|
-
|
|
250
|
-
// After (0.3.0):
|
|
251
|
-
await paymaster.createSponsorPaymasterUserOperation(smartAccount, userOp, bundlerRpc, sponsorshipPolicyId, overrides);
|
|
252
|
-
```
|
|
253
|
-
The `overrides` parameter type is also richer: it now accepts a `context?: CandidePaymasterContext` field for passing `sponsorshipPolicyId` and the new parallel-signing `signingPhase` option through overrides.
|
|
254
|
-
- **`createPaymasterUserOperation` has been removed.** Use `createSponsorPaymasterUserOperation` or `createTokenPaymasterUserOperation` directly.
|
|
255
|
-
- **CandidePaymaster now uses the `pm_getPaymasterData` JSON-RPC method** internally. Paymaster types have been unified and restructured.
|
|
256
|
-
- **`PaymasterInitValues` renamed to `ParallelPaymasterInitValues`.**
|
|
257
|
-
|
|
258
|
-
#### TypeScript Export Changes (`isolatedModules` compatibility)
|
|
259
|
-
|
|
260
|
-
Many interfaces and types are now exported with `export type` instead of `export`. This is only breaking if you re-export them yourself with `export { X } from "abstractionkit"`, in which case change to `export type { X }`. Affected identifiers include:
|
|
261
|
-
|
|
262
|
-
- `RecoveryRequest`, `RecoverySignaturePair`, `RecoveryRequestTypedDataDomain`, `RecoveryRequestTypedMessageValue`
|
|
263
|
-
- `Allowance`
|
|
264
|
-
- `DepositInfo`
|
|
265
|
-
- `Authorization7702Hex`, `Authorization7702`
|
|
266
|
-
- `CandidePaymasterContext`, `PrependTokenPaymasterApproveAccount`
|
|
267
|
-
- `UserOperationV6`, `UserOperationV7`, `UserOperationV8`, `UserOperationV9`, `AbiInputValue`, `JsonRpcParam`, `JsonRpcResponse`, `MetaTransaction`, `StateOverrideSet`, and other non-runtime types from `./types`
|
|
268
|
-
- `CreateUserOperationV6Overrides`, `CreateUserOperationV7Overrides`, `CreateUserOperationV9Overrides`, `ECDSAPublicAddress`, `InitCodeOverrides`, `SafeUserOperationTypedDataDomain`, `WebauthnPublicKey`, `WebauthnSignatureData`, `SignerSignaturePair`, `Signer`
|
|
269
|
-
- `SafeMessageTypedDataDomain`, `SafeMessageTypedMessageValue`
|
|
270
|
-
|
|
271
|
-
The wildcard re-export `export * from "./account/Safe/safeMessage"` has been replaced with explicit named exports (`SAFE_MESSAGE_PRIMARY_TYPE`, `SAFE_MESSAGE_MODULE_TYPE`, `getSafeMessageEip712Data`).
|
|
272
|
-
|
|
273
|
-
### New Features
|
|
274
|
-
|
|
275
|
-
#### New Account Classes
|
|
276
|
-
|
|
277
|
-
- **`Calibur7702Account`**: full-featured EIP-7702 smart account for EntryPoint v0.8, ported from Uniswap's Calibur. Supports secp256k1, P256, and WebAuthn P256 keys with per-key permissions and expirations. Includes key management (register, revoke, update settings via self-calls), automatic EIP-7702 delegation authoring and checking, and delegation revocation. Also exports `CaliburKeyType` and the `CaliburKey`, `CaliburKeySettings`, `CaliburKeySettingsResult`, `WebAuthnSignatureData`, `CaliburCreateUserOperationOverrides`, `CaliburSignatureOverrides`, and `SignerFunction` types.
|
|
278
|
-
- **`Simple7702AccountV09`**: minimal EIP-7702 account targeting EntryPoint v0.9, with parallel paymaster signing support.
|
|
279
|
-
- **`SafeMultiChainSigAccountV1`**: audited multi-chain signature account. Sign once, replay across chains via a merkle-proof structure. Promoted from experimental.
|
|
280
|
-
- **`SafeAccountV1_5_0_M_0_3_0`**: Safe contract v1.5.0 support with EIP-7951 and the Daimo P256 verifier for WebAuthn.
|
|
281
|
-
|
|
282
|
-
#### EntryPoint v0.8 and v0.9 Support
|
|
283
|
-
|
|
284
|
-
- `UserOperationV9` type and `CreateUserOperationV9Overrides` added.
|
|
285
|
-
- `ENTRYPOINT_V6`, `ENTRYPOINT_V7`, `ENTRYPOINT_V8`, `ENTRYPOINT_V9` address constants exported.
|
|
286
|
-
- Bundler, CandidePaymaster, and Tenderly simulation helpers updated to handle all four EntryPoint versions.
|
|
287
|
-
- Entrypoint version resolution has been centralized in `CandidePaymaster`: a new private `resolveEntrypoint` helper reads the target entrypoint from the smart account instance at the top of each public method, replacing the per-method `UserOperation vX.YZ is not supported` checks from 0.2.30. The guard itself is not new, but unsupported-version errors are now surfaced earlier and more consistently.
|
|
288
|
-
|
|
289
|
-
#### Parallel Paymaster Signing (EntryPoint v0.9)
|
|
290
|
-
|
|
291
|
-
- **`ExperimentalAllowAllParallelPaymaster`**: an experimental paymaster for the parallel-signing flow.
|
|
292
|
-
- **`signingPhase`** added to `CandidePaymasterContext`, with values `"commit"` and `"finalize"`. Enables parallel-signing flows where owner signing and the paymaster's final signature can happen independently, via the `PAYMASTER_SIG_MAGIC` convention on `paymasterData`. Works with EntryPoint v0.9 only.
|
|
293
|
-
- `CandidePaymaster` supports both v0.9 parallel flows and the existing sequential flow.
|
|
294
|
-
|
|
295
|
-
#### Safe Accounts
|
|
296
|
-
|
|
297
|
-
- **`createChangeThresholdMetaTransaction`**, **`createApproveHashMetaTransaction`**, and **`getThreshold`** added to `SafeAccount`. Makes multi-sig threshold management and offchain approval flows first-class.
|
|
298
|
-
- **Auto-prepend `approve(0)`** before setting a new ERC-20 allowance for tokens like USDT that disallow changing a non-zero allowance directly. Opt in via `{ resetApproval: true }` on the token paymaster overrides.
|
|
299
|
-
- **`MerkleTree`** helper utilities added for multi-chain operations.
|
|
300
|
-
|
|
301
|
-
#### AllowanceModule v1.0.0
|
|
302
|
-
|
|
303
|
-
- Allowance module updated to v1.0.0. The legacy address is exported as **`ALLOWANCE_MODULE_V0_1_0_ADDRESS`** for migration purposes.
|
|
304
|
-
|
|
305
|
-
#### Calibur Singleton Addresses
|
|
306
|
-
|
|
307
|
-
- **`CALIBUR_UNISWAP_V1_0_0_SINGLETON_ADDRESS`** and **`CALIBUR_CANDIDE_V0_1_0_SINGLETON_ADDRESS`** exported as constants.
|
|
308
|
-
|
|
309
|
-
#### EIP-7702 Delegation Helpers
|
|
310
|
-
|
|
311
|
-
- **`getDelegatedAddress(eoaAddress, nodeRpc)`** utility for checking the current EIP-7702 delegation target of an EOA.
|
|
312
|
-
- **Calibur delegation and key revocation**: `Calibur7702Account.createRevokeKeyMetaTransaction` and `createRevokeAllKeysMetaTransactions` for revoking individual or all registered keys, plus `createRevokeDelegationRawTransaction` for revoking the EIP-7702 delegation itself. Complements automatic delegation checking during UserOperation creation.
|
|
313
|
-
|
|
314
|
-
#### Utilities and Constants
|
|
315
|
-
|
|
316
|
-
- **EIP-2098** compact signature support in `parseRawSignature`.
|
|
317
|
-
- **`EIP712_SAFE_OPERATION_PRIMARY_TYPE`** and **`EIP712_MULTI_CHAIN_OPERATIONS_PRIMARY_TYPE`** constants added alongside the existing EIP-712 type constants.
|
|
318
|
-
- **`EIP712_MULTI_CHAIN_OPERATIONS_TYPE`** (previously `EIP712_MULTI_SAFE_OPERATIONS_TYPE`, renamed).
|
|
319
|
-
- New paymaster-type exports: **`AnyUserOperation`**, **`SameUserOp`**.
|
|
320
|
-
|
|
321
|
-
#### Tenderly
|
|
322
|
-
|
|
323
|
-
- Tenderly simulation helpers updated to support EntryPoint v0.9 and `IAccountExecute.executeUserOp` callData rewriting.
|
|
324
|
-
|
|
325
|
-
### Renames
|
|
326
|
-
|
|
327
|
-
| Before | After |
|
|
328
|
-
|--------|-------|
|
|
329
|
-
| `ExperimentalSafeMultiChainSigAccount` | `SafeMultiChainSigAccountV1` |
|
|
330
|
-
| `ExperimentalAllowAllPaymaster` | `ExperimentalAllowAllParallelPaymaster` |
|
|
331
|
-
| `EIP712_MULTI_SAFE_OPERATIONS_TYPE` | `EIP712_MULTI_CHAIN_OPERATIONS_TYPE` |
|
|
332
|
-
| `PaymasterInitValues` | `ParallelPaymasterInitValues` |
|
|
333
|
-
| `listKeys` (Calibur) | `getKeys` |
|
|
334
|
-
|
|
335
|
-
These renames only apply to code built on intermediate experimental versions (0.2.31 through 0.2.41). Code on 0.2.30 does not reference these identifiers.
|
|
336
|
-
|
|
337
|
-
### Bug Fixes
|
|
338
|
-
|
|
339
|
-
Fixes listed here apply to APIs that already existed at 0.2.30. Bugs that were fixed within new-in-0.3.0 features during their pre-release development are not listed separately; those features are shipped in their final form as part of the "New Features" section.
|
|
340
|
-
|
|
341
|
-
- **Gas estimation**: fixed gas overrides calculations, BigInt gas scaling, and handling of fractional percentage multipliers in `applyMultiplier`.
|
|
342
|
-
- **SafeAccount multisend**: fixed a bug where token paymaster approvals were prepended after existing calls instead of before them.
|
|
343
|
-
- **WebAuthn passkeys**: fixed compatibility with the v0.2.1 shared-signer contracts when using custom contract addresses.
|
|
344
|
-
- **EIP-7702 utilities**: fixed `CHAIN_ID` BigInt crash in signing helpers and exposed `DEFAULT_DELEGATEE_ADDRESS` as a static property.
|
|
345
|
-
- **Safe v0.3.0 account**: fixed `safeAccountSingleton` forwarding and added missing `webAuthnSignerProxyCreationCode` handling.
|
|
346
|
-
- **CandidePaymaster**: fixed `paymasterMetadata` hex-field normalization in `fetchSupportedERC20TokensAndPaymasterMetadata`; fixed several instances of in-place mutation via aliasing on the user-passed UserOperation.
|
|
347
|
-
- **Constructor forwarding and lifecycle**: fixed unhandled promises, timeout tracking, and constructor argument forwarding across pre-existing classes.
|
|
348
|
-
- **Miscellaneous**: typo fixes in error messages, removal of unused imports and dead guards, unused `safeV06PrevModuleAddress` removed, chainId validation tightened in pre-existing helpers.
|
|
349
|
-
|
|
350
|
-
### Internal
|
|
351
|
-
|
|
352
|
-
- Build system migrated from microbundle to tsdown. Output paths updated (see Breaking Changes).
|
|
353
|
-
- `Simple7702Account` refactored into a `BaseSimple7702Account` pattern to enable the new `Simple7702AccountV09` subclass. No user-facing API changes on `Simple7702Account` itself.
|
|
354
|
-
- Removed `isomorphic-unfetch` and `rimraf` dependencies; `rimraf` replaced with a cross-platform inline Node script.
|
|
355
|
-
- Added CI workflow (`.github/workflows/ci.yml`) using yarn.
|
|
356
|
-
- Added `SECURITY.md` with vulnerability reporting policy.
|
|
357
|
-
- Added `prepare` script for GitHub-based installs.
|
|
358
|
-
- Extensive JSDoc coverage added across public methods and types.
|