@rhinestone/sdk 1.5.0 → 2.0.0-beta.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.
Files changed (114) hide show
  1. package/dist/src/accounts/error.d.ts +1 -1
  2. package/dist/src/accounts/error.js +1 -19
  3. package/dist/src/accounts/index.d.ts +5 -5
  4. package/dist/src/accounts/index.js +121 -157
  5. package/dist/src/accounts/json-rpc/index.d.ts +1 -1
  6. package/dist/src/accounts/json-rpc/index.js +8 -10
  7. package/dist/src/accounts/json-rpc/providers.d.ts +1 -1
  8. package/dist/src/accounts/json-rpc/providers.js +4 -7
  9. package/dist/src/accounts/kernel.d.ts +3 -3
  10. package/dist/src/accounts/kernel.js +66 -75
  11. package/dist/src/accounts/nexus.d.ts +3 -3
  12. package/dist/src/accounts/nexus.js +62 -73
  13. package/dist/src/accounts/passport.d.ts +3 -3
  14. package/dist/src/accounts/passport.js +9 -13
  15. package/dist/src/accounts/safe.d.ts +3 -3
  16. package/dist/src/accounts/safe.js +54 -63
  17. package/dist/src/accounts/signing/common.d.ts +2 -2
  18. package/dist/src/accounts/signing/common.js +30 -36
  19. package/dist/src/accounts/signing/message.d.ts +2 -2
  20. package/dist/src/accounts/signing/message.js +10 -12
  21. package/dist/src/accounts/signing/passkeys.js +11 -17
  22. package/dist/src/accounts/signing/typedData.d.ts +1 -1
  23. package/dist/src/accounts/signing/typedData.js +6 -8
  24. package/dist/src/accounts/startale.d.ts +3 -3
  25. package/dist/src/accounts/startale.js +37 -47
  26. package/dist/src/accounts/utils.d.ts +2 -2
  27. package/dist/src/accounts/utils.js +22 -28
  28. package/dist/src/accounts/walletClient.js +4 -8
  29. package/dist/src/actions/compact.d.ts +1 -1
  30. package/dist/src/actions/compact.js +22 -35
  31. package/dist/src/actions/deployment.d.ts +1 -1
  32. package/dist/src/actions/deployment.js +11 -13
  33. package/dist/src/actions/ecdsa.d.ts +1 -1
  34. package/dist/src/actions/ecdsa.js +14 -20
  35. package/dist/src/actions/index.d.ts +2 -2
  36. package/dist/src/actions/index.js +6 -10
  37. package/dist/src/actions/mfa.d.ts +1 -1
  38. package/dist/src/actions/mfa.js +18 -24
  39. package/dist/src/actions/passkeys.d.ts +2 -2
  40. package/dist/src/actions/passkeys.js +14 -20
  41. package/dist/src/actions/recovery.d.ts +1 -1
  42. package/dist/src/actions/recovery.js +25 -29
  43. package/dist/src/actions/smart-sessions.d.ts +1 -1
  44. package/dist/src/actions/smart-sessions.js +8 -12
  45. package/dist/src/auth/provider.d.ts +1 -1
  46. package/dist/src/auth/provider.js +1 -4
  47. package/dist/src/errors/index.d.ts +3 -3
  48. package/dist/src/errors/index.js +10 -54
  49. package/dist/src/execution/compact.d.ts +3 -3
  50. package/dist/src/execution/compact.js +10 -18
  51. package/dist/src/execution/error.js +1 -11
  52. package/dist/src/execution/index.d.ts +8 -8
  53. package/dist/src/execution/index.js +50 -65
  54. package/dist/src/execution/permit2.d.ts +5 -5
  55. package/dist/src/execution/permit2.js +8 -13
  56. package/dist/src/execution/singleChainOps.d.ts +2 -2
  57. package/dist/src/execution/singleChainOps.js +1 -3
  58. package/dist/src/execution/types.d.ts +1 -1
  59. package/dist/src/execution/types.js +1 -2
  60. package/dist/src/execution/utils.d.ts +4 -4
  61. package/dist/src/execution/utils.js +133 -156
  62. package/dist/src/index.d.ts +9 -9
  63. package/dist/src/index.js +55 -66
  64. package/dist/src/jwt-server/digest.js +3 -6
  65. package/dist/src/jwt-server/express.d.ts +1 -1
  66. package/dist/src/jwt-server/express.d.ts.map +1 -1
  67. package/dist/src/jwt-server/express.js +6 -7
  68. package/dist/src/jwt-server/handlers.d.ts +1 -1
  69. package/dist/src/jwt-server/handlers.js +7 -11
  70. package/dist/src/jwt-server/index.d.ts +7 -7
  71. package/dist/src/jwt-server/index.js +6 -17
  72. package/dist/src/jwt-server/jcs.js +1 -4
  73. package/dist/src/jwt-server/signer.d.ts +1 -1
  74. package/dist/src/jwt-server/signer.js +10 -13
  75. package/dist/src/jwt-server/sponsorship.js +2 -7
  76. package/dist/src/jwt-server/web.d.ts +1 -1
  77. package/dist/src/jwt-server/web.js +5 -9
  78. package/dist/src/modules/abi/smart-session-emissary.js +1 -3
  79. package/dist/src/modules/abi/smart-sessions.js +1 -4
  80. package/dist/src/modules/chain-abstraction.js +1 -5
  81. package/dist/src/modules/common.d.ts +1 -1
  82. package/dist/src/modules/common.js +1 -13
  83. package/dist/src/modules/index.d.ts +5 -5
  84. package/dist/src/modules/index.js +35 -50
  85. package/dist/src/modules/legacy.d.ts +2 -2
  86. package/dist/src/modules/legacy.js +11 -14
  87. package/dist/src/modules/read.d.ts +1 -1
  88. package/dist/src/modules/read.js +11 -15
  89. package/dist/src/modules/validators/core.d.ts +2 -2
  90. package/dist/src/modules/validators/core.js +26 -44
  91. package/dist/src/modules/validators/index.d.ts +2 -2
  92. package/dist/src/modules/validators/index.js +3 -19
  93. package/dist/src/modules/validators/policies/claim/permit2.d.ts +1 -1
  94. package/dist/src/modules/validators/policies/claim/permit2.js +39 -44
  95. package/dist/src/modules/validators/policies/claim/types.js +11 -14
  96. package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
  97. package/dist/src/modules/validators/smart-sessions.js +65 -94
  98. package/dist/src/orchestrator/client.d.ts +2 -2
  99. package/dist/src/orchestrator/client.js +46 -50
  100. package/dist/src/orchestrator/consts.d.ts +1 -1
  101. package/dist/src/orchestrator/consts.d.ts.map +1 -1
  102. package/dist/src/orchestrator/consts.js +2 -8
  103. package/dist/src/orchestrator/error.js +1 -33
  104. package/dist/src/orchestrator/index.d.ts +7 -7
  105. package/dist/src/orchestrator/index.js +7 -56
  106. package/dist/src/orchestrator/registry.d.ts +2 -2
  107. package/dist/src/orchestrator/registry.js +19 -33
  108. package/dist/src/orchestrator/types.js +1 -17
  109. package/dist/src/orchestrator/utils.js +1 -3
  110. package/dist/src/types.d.ts +3 -3
  111. package/dist/src/types.js +1 -2
  112. package/dist/src/utils/index.d.ts +2 -2
  113. package/dist/src/utils/index.js +9 -15
  114. package/package.json +15 -98
@@ -1,47 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prepareTransaction = prepareTransaction;
4
- exports.getTransactionMessages = getTransactionMessages;
5
- exports.signTransaction = signTransaction;
6
- exports.signAuthorizations = signAuthorizations;
7
- exports.signAuthorizationsInternal = signAuthorizationsInternal;
8
- exports.signMessage = signMessage;
9
- exports.signTypedData = signTypedData;
10
- exports.submitTransaction = submitTransaction;
11
- exports.prepareUserOperation = prepareUserOperation;
12
- exports.signUserOperation = signUserOperation;
13
- exports.submitUserOperation = submitUserOperation;
14
- exports.signIntent = signIntent;
15
- exports.prepareTransactionAsIntent = prepareTransactionAsIntent;
16
- exports.submitIntentInternal = submitIntentInternal;
17
- exports.getValidatorAccount = getValidatorAccount;
18
- exports.parseCalls = parseCalls;
19
- exports.getTokenRequests = getTokenRequests;
20
- exports.resolveCallInputs = resolveCallInputs;
21
- exports.getIntentAccount = getIntentAccount;
22
- exports.getTargetExecutionSignature = getTargetExecutionSignature;
23
- exports.hashErc7739TypedDataForSolady = hashErc7739TypedDataForSolady;
24
- exports.resolveSessionForChain = resolveSessionForChain;
25
- const viem_1 = require("viem");
26
- const account_abstraction_1 = require("viem/account-abstraction");
27
- const erc7739_1 = require("viem/experimental/erc7739");
28
- const accounts_1 = require("../accounts");
29
- const common_1 = require("../accounts/signing/common");
30
- const startale_1 = require("../accounts/startale");
31
- const utils_1 = require("../accounts/utils");
32
- const provider_1 = require("../auth/provider");
33
- const modules_1 = require("../modules");
34
- const validators_1 = require("../modules/validators");
35
- const core_1 = require("../modules/validators/core");
36
- const permit2_1 = require("../modules/validators/policies/claim/permit2");
37
- const orchestrator_1 = require("../orchestrator");
38
- const registry_1 = require("../orchestrator/registry");
39
- const types_1 = require("../orchestrator/types");
40
- const utils_2 = require("../orchestrator/utils");
41
- const compact_1 = require("./compact");
42
- const error_1 = require("./error");
43
- const permit2_2 = require("./permit2");
44
- const singleChainOps_1 = require("./singleChainOps");
1
+ import { concat, createPublicClient, createWalletClient, encodeAbiParameters, encodePacked, hashDomain, hashMessage, hashStruct, hashTypedData, isAddress, keccak256, publicActions, toHex, } from 'viem';
2
+ import { entryPoint07Address, getUserOperationHash, } from 'viem/account-abstraction';
3
+ import { wrapTypedDataSignature } from 'viem/experimental/erc7739';
4
+ import { EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, FactoryArgsNotAvailableError, getAccountProvider, getAddress, getEip712Domain, getEip1271Signature, getEip7702InitCall, getEmissarySignature, getGuardianSmartAccount, getInitCode, getSmartAccount, getTypedDataPackedSignature, is7702, toErc6492Signature, } from '../accounts/index.js';
5
+ import { convertOwnerSetToSignerSet } from '../accounts/signing/common.js';
6
+ import { K1_DEFAULT_VALIDATOR_ADDRESS } from '../accounts/startale.js';
7
+ import { createTransport, getBundlerClient, } from '../accounts/utils.js';
8
+ import { createAuthProvider } from '../auth/provider.js';
9
+ import { getIntentExecutor } from '../modules/index.js';
10
+ import { buildMockSignature, DUMMY_PRECLAIMOP_SELECTOR, DUMMY_PRECLAIMOP_TARGET, getOwnerValidator, getPermissionId, getSmartSessionValidator, isSessionEnabled, } from '../modules/validators/index.js';
11
+ import { getMultiFactorValidator, getSocialRecoveryValidator, getWebAuthnValidator, supportsEip712, } from '../modules/validators/core.js';
12
+ import { buildPermit2ClaimPolicyCalldata } from '../modules/validators/policies/claim/permit2.js';
13
+ import { getOrchestrator, } from '../orchestrator/index.js';
14
+ import { getChainById, getTokenAddress, resolveTokenAddress, } from '../orchestrator/registry.js';
15
+ import { SIG_MODE_EMISSARY_EXECUTION_ERC1271, SIG_MODE_ERC1271_EMISSARY, } from '../orchestrator/types.js';
16
+ import { convertBigIntFields } from '../orchestrator/utils.js';
17
+ import { getCompactTypedData } from './compact.js';
18
+ import { Eip7702InitSignatureRequiredError, SignerNotSupportedError, } from './error.js';
19
+ import { getTypedData as getPermit2TypedData } from './permit2.js';
20
+ import { getTypedData as getSingleChainOpsTypedData } from './singleChainOps.js';
45
21
  function isResolvedSessionSignerSet(signers) {
46
22
  return (signers?.type === 'experimental_session' && 'verifyExecutions' in signers);
47
23
  }
@@ -50,7 +26,7 @@ async function resolveSignersForChain(config, signers, chainId) {
50
26
  return signers;
51
27
  }
52
28
  const resolved = resolveSessionForChain(signers, chainId);
53
- const enabled = await (0, validators_1.isSessionEnabled)((0, accounts_1.getAddress)(config), config.provider, resolved.session, config.useDevContracts);
29
+ const enabled = await isSessionEnabled(getAddress(config), config.provider, resolved.session, config.useDevContracts);
54
30
  const enableData = enabled ? undefined : resolved.enableData;
55
31
  const hasExplicitActions = !!resolved.session.actions?.length;
56
32
  const verifyExecutions = resolved.verifyExecutions ?? signers.verifyExecutions ?? hasExplicitActions;
@@ -73,10 +49,10 @@ function resolveSessionForChain(signers, chainId) {
73
49
  }
74
50
  async function prepareTransaction(config, transaction) {
75
51
  const { sourceChains, targetChain, tokenRequests, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, auxiliaryFunds, account, recipient, } = getTransactionParams(transaction);
76
- const accountAddress = (0, accounts_1.getAddress)(config);
52
+ const accountAddress = getAddress(config);
77
53
  const isUserOpSigner = signers?.type === 'guardians';
78
54
  if (isUserOpSigner) {
79
- throw new error_1.SignerNotSupportedError();
55
+ throw new SignerNotSupportedError();
80
56
  }
81
57
  const prepared = await prepareTransactionAsIntent(config, sourceChains, targetChain, await resolveCallInputs(transaction.calls, config, targetChain, accountAddress), transaction.gasLimit, tokenRequests, recipient, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, auxiliaryFunds, account, signers);
82
58
  return {
@@ -88,7 +64,7 @@ async function prepareTransaction(config, transaction) {
88
64
  async function prepareUserOperation(config, transaction) {
89
65
  const chain = transaction.chain;
90
66
  const signers = transaction.signers;
91
- const accountAddress = (0, accounts_1.getAddress)(config);
67
+ const accountAddress = getAddress(config);
92
68
  const data = await prepareTransactionAsUserOp(config, chain, await resolveCallInputs(transaction.calls, config, chain, accountAddress), signers, transaction.gasLimit);
93
69
  return {
94
70
  userOperation: data.userOp,
@@ -156,7 +132,7 @@ async function getTargetExecutionSignature(config, intentOp, targetChain, signer
156
132
  if (!validator) {
157
133
  throw new Error('Validator not available');
158
134
  }
159
- const ownerValidator = (0, validators_1.getOwnerValidator)(config);
135
+ const ownerValidator = getOwnerValidator(config);
160
136
  const isRoot = validator.address === ownerValidator.address;
161
137
  const signature = await getDestinationSignature(config, resolvedSigners, validator, isRoot, targetChain, destination, [], true);
162
138
  return signature;
@@ -182,21 +158,21 @@ async function signMessage(config, message, chain, signers) {
182
158
  if (!validator) {
183
159
  throw new Error('Validator not available');
184
160
  }
185
- const ownerValidator = (0, validators_1.getOwnerValidator)(config);
161
+ const ownerValidator = getOwnerValidator(config);
186
162
  const isRoot = validator.address === ownerValidator.address;
187
- const hash = (0, viem_1.hashMessage)(message);
188
- const signature = await (0, accounts_1.getEip1271Signature)(config, signers, chain, {
163
+ const hash = hashMessage(message);
164
+ const signature = await getEip1271Signature(config, signers, chain, {
189
165
  address: validator.address,
190
166
  isRoot,
191
167
  }, hash);
192
- return await (0, accounts_1.toErc6492Signature)(config, signature, chain);
168
+ return await toErc6492Signature(config, signature, chain);
193
169
  }
194
170
  async function signTypedData(config, parameters, chain, signers, options) {
195
171
  const validator = getValidator(config, signers);
196
172
  if (!validator) {
197
173
  throw new Error('Validator not available');
198
174
  }
199
- const ownerValidator = (0, validators_1.getOwnerValidator)(config);
175
+ const ownerValidator = getOwnerValidator(config);
200
176
  const isRoot = validator.address === ownerValidator.address;
201
177
  if (signers?.type === 'experimental_session') {
202
178
  const resolved = resolveSessionForChain(signers, chain.id);
@@ -205,31 +181,31 @@ async function signTypedData(config, parameters, chain, signers, options) {
205
181
  isRoot,
206
182
  }, resolved.session, parameters);
207
183
  }
208
- const account = (0, accounts_1.getAccountProvider)(config);
209
- if (account.type === 'startale' && (0, core_1.supportsEip712)(validator)) {
184
+ const account = getAccountProvider(config);
185
+ if (account.type === 'startale' && supportsEip712(validator)) {
210
186
  const isK1 = validator.address.toLowerCase() ===
211
- startale_1.K1_DEFAULT_VALIDATOR_ADDRESS.toLowerCase();
187
+ K1_DEFAULT_VALIDATOR_ADDRESS.toLowerCase();
212
188
  if (isK1) {
213
189
  const sig = await signErc7739TypedData(config, signers, validator, isRoot, parameters, chain);
214
190
  if (!options?.skipErc6492) {
215
- return await (0, accounts_1.toErc6492Signature)(config, sig, chain);
191
+ return await toErc6492Signature(config, sig, chain);
216
192
  }
217
193
  return sig;
218
194
  }
219
195
  }
220
- const signature = await (0, accounts_1.getTypedDataPackedSignature)(config, signers, chain, {
196
+ const signature = await getTypedDataPackedSignature(config, signers, chain, {
221
197
  address: validator.address,
222
198
  isRoot,
223
199
  }, parameters);
224
200
  if (!options?.skipErc6492) {
225
- return await (0, accounts_1.toErc6492Signature)(config, signature, chain);
201
+ return await toErc6492Signature(config, signature, chain);
226
202
  }
227
203
  return signature;
228
204
  }
229
205
  async function signTypedDataWithSession(config, chain, validator, session, parameters) {
230
- const { name, version, chainId, verifyingContract, salt } = (0, accounts_1.getEip712Domain)(config, chain);
231
- const signers = (0, common_1.convertOwnerSetToSignerSet)(session.owners);
232
- const signature = await (0, accounts_1.getTypedDataPackedSignature)(config, signers, chain, validator, {
206
+ const { name, version, chainId, verifyingContract, salt } = getEip712Domain(config, chain);
207
+ const signers = convertOwnerSetToSignerSet(session.owners);
208
+ const signature = await getTypedDataPackedSignature(config, signers, chain, validator, {
233
209
  domain: parameters.domain,
234
210
  primaryType: 'TypedDataSign',
235
211
  types: {
@@ -252,39 +228,39 @@ async function signTypedDataWithSession(config, chain, validator, session, param
252
228
  salt,
253
229
  },
254
230
  }, (signature) => {
255
- const erc7739Signature = (0, erc7739_1.wrapTypedDataSignature)({
231
+ const erc7739Signature = wrapTypedDataSignature({
256
232
  domain: parameters.domain,
257
233
  primaryType: parameters.primaryType,
258
234
  types: parameters.types,
259
235
  message: parameters.message,
260
236
  signature,
261
237
  });
262
- return (0, viem_1.encodePacked)(['bytes32', 'bytes'], [(0, validators_1.getPermissionId)(session), erc7739Signature]);
238
+ return encodePacked(['bytes32', 'bytes'], [getPermissionId(session), erc7739Signature]);
263
239
  });
264
- return await (0, accounts_1.toErc6492Signature)(config, signature, chain);
240
+ return await toErc6492Signature(config, signature, chain);
265
241
  }
266
242
  async function signAuthorizationsInternal(config, data) {
267
243
  const eoa = config.eoa;
268
244
  if (!eoa) {
269
245
  throw new Error('EIP-7702 initialization is required for EOA accounts');
270
246
  }
271
- const accountAddress = (0, accounts_1.getAddress)(config);
247
+ const accountAddress = getAddress(config);
272
248
  const requiredDelegations = 'intentOp' in data
273
249
  ? data.intentOp.signedMetadata.account.requiredDelegations || {}
274
250
  : {};
275
251
  const authorizations = [];
276
252
  for (const chainId in requiredDelegations) {
277
253
  const delegation = requiredDelegations[chainId];
278
- const chain = (0, registry_1.getChainById)(Number(chainId));
279
- const walletClient = (0, viem_1.createWalletClient)({
254
+ const chain = getChainById(Number(chainId));
255
+ const walletClient = createWalletClient({
280
256
  chain,
281
257
  account: eoa,
282
- transport: (0, utils_1.createTransport)(chain, config.provider),
283
- }).extend(viem_1.publicActions);
258
+ transport: createTransport(chain, config.provider),
259
+ }).extend(publicActions);
284
260
  const code = await walletClient.getCode({
285
261
  address: accountAddress,
286
262
  });
287
- const isDelegated = code === (0, viem_1.concat)(['0xef0100', delegation.contract.toLowerCase()]);
263
+ const isDelegated = code === concat(['0xef0100', delegation.contract.toLowerCase()]);
288
264
  if (isDelegated) {
289
265
  continue;
290
266
  }
@@ -349,15 +325,15 @@ function getTokenRequests(targetChain, initialTokenRequests) {
349
325
  return initialTokenRequests ?? [];
350
326
  }
351
327
  async function prepareTransactionAsUserOp(config, chain, callInputs, signers, gasLimit) {
352
- const publicClient = (0, viem_1.createPublicClient)({
328
+ const publicClient = createPublicClient({
353
329
  chain,
354
- transport: (0, utils_1.createTransport)(chain, config.provider),
330
+ transport: createTransport(chain, config.provider),
355
331
  });
356
332
  const validatorAccount = await getValidatorAccount(config, signers, publicClient, chain);
357
333
  if (!validatorAccount) {
358
334
  throw new Error('No validator account found');
359
335
  }
360
- const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
336
+ const bundlerClient = getBundlerClient(config, publicClient);
361
337
  const calls = parseCalls(callInputs, chain.id);
362
338
  const userOp = await bundlerClient.prepareUserOperation({
363
339
  account: validatorAccount,
@@ -366,10 +342,10 @@ async function prepareTransactionAsUserOp(config, chain, callInputs, signers, ga
366
342
  });
367
343
  return {
368
344
  userOp,
369
- hash: (0, account_abstraction_1.getUserOperationHash)({
345
+ hash: getUserOperationHash({
370
346
  userOperation: userOp,
371
347
  chainId: chain.id,
372
- entryPointAddress: account_abstraction_1.entryPoint07Address,
348
+ entryPointAddress: entryPoint07Address,
373
349
  entryPointVersion: '0.7',
374
350
  }),
375
351
  };
@@ -383,7 +359,7 @@ function getAccountType(accountConfig) {
383
359
  }
384
360
  }
385
361
  function getIntentAccount(config, eip7702InitSignature, account) {
386
- const accountAddress = (0, accounts_1.getAddress)(config);
362
+ const accountAddress = getAddress(config);
387
363
  const accountType = getAccountType(config.account);
388
364
  const { setupOps, delegations } = getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSignature);
389
365
  return {
@@ -415,7 +391,7 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
415
391
  ...getIntentAccount(config, eip7702InitSignature, account),
416
392
  ...(signers?.type === 'experimental_session' && {
417
393
  // Global fallback: target-chain sig for backward-compat with older orchestrators
418
- mockSignature: (0, validators_1.buildMockSignature)(resolveSessionForChain(signers, targetChain.id).session, config.useDevContracts, sourceChains?.length ?? 1),
394
+ mockSignature: buildMockSignature(resolveSessionForChain(signers, targetChain.id).session, config.useDevContracts, sourceChains?.length ?? 1),
419
395
  // Per-chain map: enables accurate per-chain session validation gas simulation
420
396
  mockSignatures: Object.fromEntries([
421
397
  ...new Set([
@@ -424,14 +400,14 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
424
400
  ]),
425
401
  ].map((chainId) => [
426
402
  String(chainId),
427
- (0, validators_1.buildMockSignature)(resolveSessionForChain(signers, chainId).session, config.useDevContracts, sourceChains?.length ?? 1, chainId),
403
+ buildMockSignature(resolveSessionForChain(signers, chainId).session, config.useDevContracts, sourceChains?.length ?? 1, chainId),
428
404
  ])),
429
405
  }),
430
406
  };
431
407
  const recipient = getRecipient(recipientInput);
432
408
  const signatureMode = signers?.type === 'experimental_session'
433
- ? types_1.SIG_MODE_EMISSARY_EXECUTION_ERC1271
434
- : types_1.SIG_MODE_ERC1271_EMISSARY;
409
+ ? SIG_MODE_EMISSARY_EXECUTION_ERC1271
410
+ : SIG_MODE_ERC1271_EMISSARY;
435
411
  // For session signers that need enabling, pass a dummy preclaimop per source chain
436
412
  // so the orchestrator bakes it into the bundle before computing its HMAC. The filler
437
413
  // executes the op via verifyExecution in ENABLE mode, enabling the session on-chain
@@ -451,9 +427,9 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
451
427
  continue;
452
428
  preClaimExecutions[chainId] = [
453
429
  {
454
- to: validators_1.DUMMY_PRECLAIMOP_TARGET,
430
+ to: DUMMY_PRECLAIMOP_TARGET,
455
431
  value: 0n,
456
- data: validators_1.DUMMY_PRECLAIMOP_SELECTOR,
432
+ data: DUMMY_PRECLAIMOP_SELECTOR,
457
433
  },
458
434
  ];
459
435
  }
@@ -461,7 +437,7 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
461
437
  const metaIntent = {
462
438
  destinationChainId: targetChain.id,
463
439
  tokenRequests: tokenRequests.map((tokenRequest) => ({
464
- tokenAddress: (0, registry_1.resolveTokenAddress)(tokenRequest.address, targetChain.id),
440
+ tokenAddress: resolveTokenAddress(tokenRequest.address, targetChain.id),
465
441
  amount: tokenRequest.amount,
466
442
  })),
467
443
  recipient,
@@ -491,8 +467,8 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
491
467
  },
492
468
  ...(Object.keys(preClaimExecutions).length > 0 && { preClaimExecutions }),
493
469
  };
494
- const serializedIntent = (0, utils_2.convertBigIntFields)(metaIntent);
495
- const orchestrator = (0, orchestrator_1.getOrchestrator)(config._authProvider ?? (0, provider_1.createAuthProvider)(config), config.endpointUrl, config.headers);
470
+ const serializedIntent = convertBigIntFields(metaIntent);
471
+ const orchestrator = getOrchestrator(config._authProvider ?? createAuthProvider(config), config.endpointUrl, config.headers);
496
472
  const intentRoute = await orchestrator.getIntentRoute(metaIntent);
497
473
  return { intentRoute, intentInput: serializedIntent };
498
474
  }
@@ -501,7 +477,7 @@ async function signIntent(config, intentOp, targetChain, signers, targetExecutio
501
477
  if (config.account?.type === 'eoa') {
502
478
  const eoa = config.eoa;
503
479
  if (!eoa) {
504
- throw new accounts_1.EoaAccountMustHaveAccountError();
480
+ throw new EoaAccountMustHaveAccountError();
505
481
  }
506
482
  const originSignatures = [];
507
483
  for (const typedData of origin) {
@@ -510,7 +486,7 @@ async function signIntent(config, intentOp, targetChain, signers, targetExecutio
510
486
  originSignatures.push(signature);
511
487
  }
512
488
  else {
513
- throw new accounts_1.EoaSigningMethodNotConfiguredError('signTypedData');
489
+ throw new EoaSigningMethodNotConfiguredError('signTypedData');
514
490
  }
515
491
  }
516
492
  const destinationSignature = originSignatures.at(-1);
@@ -523,11 +499,11 @@ async function signIntent(config, intentOp, targetChain, signers, targetExecutio
523
499
  if (!validator) {
524
500
  throw new Error('Validator not available');
525
501
  }
526
- const ownerValidator = (0, validators_1.getOwnerValidator)(config);
502
+ const ownerValidator = getOwnerValidator(config);
527
503
  const isRoot = validator.address === ownerValidator.address;
528
504
  const originSignatures = [];
529
505
  for (const typedData of origin) {
530
- const chain = (0, registry_1.getChainById)(typedData.domain?.chainId);
506
+ const chain = getChainById(typedData.domain?.chainId);
531
507
  const originSigners = await resolveSignersForChain(config, signers, chain.id);
532
508
  const signature = await signIntentTypedData(config, originSigners, validator, isRoot, typedData, chain, targetExecution ?? false);
533
509
  originSignatures.push(signature);
@@ -549,8 +525,8 @@ async function getDestinationSignature(config, signers, validator, isRoot, targe
549
525
  // the account's eip712Domain() returns the target chain's chainId, which differs
550
526
  // from the origin chain used for the last origin signature
551
527
  const isK1Validator = validator.address.toLowerCase() ===
552
- startale_1.K1_DEFAULT_VALIDATOR_ADDRESS.toLowerCase();
553
- if (isK1Validator && (0, core_1.supportsEip712)(validator)) {
528
+ K1_DEFAULT_VALIDATOR_ADDRESS.toLowerCase();
529
+ if (isK1Validator && supportsEip712(validator)) {
554
530
  return await signDestinationSeparately(config, signers, validator, isRoot, targetChain, destination, targetExecution);
555
531
  }
556
532
  const lastOriginSignature = originSignatures.at(-1);
@@ -559,30 +535,30 @@ async function getDestinationSignature(config, signers, validator, isRoot, targe
559
535
  : (lastOriginSignature ?? '0x');
560
536
  }
561
537
  async function signDestinationSeparately(config, signers, validator, isRoot, targetChain, destination, targetExecution) {
562
- const destinationChain = (0, registry_1.getChainById)(targetChain.id);
538
+ const destinationChain = getChainById(targetChain.id);
563
539
  const destinationSignatures = await signIntentTypedData(config, signers, validator, isRoot, destination, destinationChain, targetExecution);
564
540
  return typeof destinationSignatures === 'object'
565
541
  ? destinationSignatures.preClaimSig
566
542
  : (destinationSignatures ?? '0x');
567
543
  }
568
544
  function getIntentMessages(config, intentOp) {
569
- const address = (0, accounts_1.getAddress)(config);
570
- const intentExecutor = (0, modules_1.getIntentExecutor)(config);
545
+ const address = getAddress(config);
546
+ const intentExecutor = getIntentExecutor(config);
571
547
  const withPermit2 = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext.fundingMethod === 'PERMIT2');
572
548
  const withIntentExecutorOps = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext.settlementLayer ===
573
549
  'INTENT_EXECUTOR');
574
550
  const origin = [];
575
551
  for (const element of intentOp.elements) {
576
552
  if (withIntentExecutorOps) {
577
- const typedData = (0, singleChainOps_1.getTypedData)(address, intentExecutor.address, element, BigInt(intentOp.nonce));
553
+ const typedData = getSingleChainOpsTypedData(address, intentExecutor.address, element, BigInt(intentOp.nonce));
578
554
  origin.push(typedData);
579
555
  }
580
556
  else if (withPermit2) {
581
- const typedData = (0, permit2_2.getTypedData)(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
557
+ const typedData = getPermit2TypedData(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
582
558
  origin.push(typedData);
583
559
  }
584
560
  else {
585
- const typedData = (0, compact_1.getCompactTypedData)(intentOp);
561
+ const typedData = getCompactTypedData(intentOp);
586
562
  origin.push(typedData);
587
563
  }
588
564
  }
@@ -593,10 +569,10 @@ function getIntentMessages(config, intentOp) {
593
569
  };
594
570
  }
595
571
  function getTargetExecutionMessage(config, intentOp) {
596
- const address = (0, accounts_1.getAddress)(config);
597
- const intentExecutor = (0, modules_1.getIntentExecutor)(config);
572
+ const address = getAddress(config);
573
+ const intentExecutor = getIntentExecutor(config);
598
574
  const lastElement = intentOp.elements.at(-1);
599
- const typedData = (0, singleChainOps_1.getTypedData)(address, intentExecutor.address, lastElement, BigInt(intentOp.targetExecutionNonce));
575
+ const typedData = getSingleChainOpsTypedData(address, intentExecutor.address, lastElement, BigInt(intentOp.targetExecutionNonce));
600
576
  typedData.message.gasRefund = typedData.message.gasRefund ?? {
601
577
  token: '0x0000000000000000000000000000000000000000',
602
578
  exchangeRate: 0n,
@@ -618,21 +594,21 @@ function resolveClaimPolicyData(signers, parameters) {
618
594
  typeof msg.deadline !== 'bigint') {
619
595
  return undefined;
620
596
  }
621
- return (0, permit2_1.buildPermit2ClaimPolicyCalldata)(signers.session.claimPolicies[0], parameters.message);
597
+ return buildPermit2ClaimPolicyCalldata(signers.session.claimPolicies[0], parameters.message);
622
598
  }
623
599
  async function signIntentTypedData(config, signers, validator, isRoot, parameters, chain, targetExecution) {
624
- if ((0, core_1.supportsEip712)(validator)) {
600
+ if (supportsEip712(validator)) {
625
601
  const isK1Validator = validator.address.toLowerCase() ===
626
- startale_1.K1_DEFAULT_VALIDATOR_ADDRESS.toLowerCase();
602
+ K1_DEFAULT_VALIDATOR_ADDRESS.toLowerCase();
627
603
  if (isK1Validator) {
628
604
  return await signErc7739TypedData(config, signers, validator, isRoot, parameters, chain);
629
605
  }
630
- return await (0, accounts_1.getTypedDataPackedSignature)(config, signers, chain, {
606
+ return await getTypedDataPackedSignature(config, signers, chain, {
631
607
  address: validator.address,
632
608
  isRoot,
633
609
  }, parameters);
634
610
  }
635
- const hash = (0, viem_1.hashTypedData)(parameters);
611
+ const hash = hashTypedData(parameters);
636
612
  if (isResolvedSessionSignerSet(signers) && signers.verifyExecutions) {
637
613
  if (targetExecution) {
638
614
  const targetSigners = {
@@ -643,7 +619,7 @@ async function signIntentTypedData(config, signers, validator, isRoot, parameter
643
619
  };
644
620
  // signWithSession (called inside getEmissarySignature) already calls packSignature
645
621
  // internally, so no transform is needed here
646
- return await (0, accounts_1.getEmissarySignature)(config, targetSigners, chain, hash);
622
+ return await getEmissarySignature(config, targetSigners, chain, hash);
647
623
  }
648
624
  const claimPolicyData = resolveClaimPolicyData(signers, parameters);
649
625
  const sessionSignersForEip1271 = {
@@ -653,11 +629,11 @@ async function signIntentTypedData(config, signers, validator, isRoot, parameter
653
629
  enableData: signers.enableData,
654
630
  claimPolicyData,
655
631
  };
656
- const eip1271Signature = await (0, accounts_1.getEip1271Signature)(config, sessionSignersForEip1271, chain, {
632
+ const eip1271Signature = await getEip1271Signature(config, sessionSignersForEip1271, chain, {
657
633
  address: validator.address,
658
634
  isRoot,
659
635
  }, hash);
660
- const emissarySignature = await (0, accounts_1.getEmissarySignature)(config, {
636
+ const emissarySignature = await getEmissarySignature(config, {
661
637
  type: 'experimental_session',
662
638
  session: signers.session,
663
639
  verifyExecutions: true,
@@ -670,12 +646,12 @@ async function signIntentTypedData(config, signers, validator, isRoot, parameter
670
646
  }
671
647
  if (isResolvedSessionSignerSet(signers)) {
672
648
  const claimPolicyData = resolveClaimPolicyData(signers, parameters);
673
- return await (0, accounts_1.getEip1271Signature)(config, claimPolicyData !== undefined ? { ...signers, claimPolicyData } : signers, chain, {
649
+ return await getEip1271Signature(config, claimPolicyData !== undefined ? { ...signers, claimPolicyData } : signers, chain, {
674
650
  address: validator.address,
675
651
  isRoot,
676
652
  }, hash);
677
653
  }
678
- return await (0, accounts_1.getEip1271Signature)(config, signers, chain, {
654
+ return await getEip1271Signature(config, signers, chain, {
679
655
  address: validator.address,
680
656
  isRoot,
681
657
  }, hash);
@@ -685,9 +661,9 @@ async function signUserOp(config, chain, signers, userOp) {
685
661
  if (!validator) {
686
662
  throw new Error('Validator not available');
687
663
  }
688
- const publicClient = (0, viem_1.createPublicClient)({
664
+ const publicClient = createPublicClient({
689
665
  chain,
690
- transport: (0, utils_1.createTransport)(chain, config.provider),
666
+ transport: createTransport(chain, config.provider),
691
667
  });
692
668
  const account = await getValidatorAccount(config, signers, publicClient, chain);
693
669
  if (!account) {
@@ -696,36 +672,36 @@ async function signUserOp(config, chain, signers, userOp) {
696
672
  return await account.signUserOperation(userOp);
697
673
  }
698
674
  async function submitUserOp(config, chain, userOp, signature) {
699
- const publicClient = (0, viem_1.createPublicClient)({
675
+ const publicClient = createPublicClient({
700
676
  chain,
701
- transport: (0, utils_1.createTransport)(chain, config.provider),
677
+ transport: createTransport(chain, config.provider),
702
678
  });
703
- const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
679
+ const bundlerClient = getBundlerClient(config, publicClient);
704
680
  const hash = await bundlerClient.request({
705
681
  method: 'eth_sendUserOperation',
706
682
  params: [
707
683
  {
708
684
  sender: userOp.sender,
709
- nonce: (0, viem_1.toHex)(userOp.nonce),
685
+ nonce: toHex(userOp.nonce),
710
686
  factory: userOp.factory,
711
687
  factoryData: userOp.factoryData,
712
688
  callData: userOp.callData,
713
- callGasLimit: (0, viem_1.toHex)(userOp.callGasLimit),
714
- verificationGasLimit: (0, viem_1.toHex)(userOp.verificationGasLimit),
715
- preVerificationGas: (0, viem_1.toHex)(userOp.preVerificationGas),
716
- maxPriorityFeePerGas: (0, viem_1.toHex)(userOp.maxPriorityFeePerGas),
717
- maxFeePerGas: (0, viem_1.toHex)(userOp.maxFeePerGas),
689
+ callGasLimit: toHex(userOp.callGasLimit),
690
+ verificationGasLimit: toHex(userOp.verificationGasLimit),
691
+ preVerificationGas: toHex(userOp.preVerificationGas),
692
+ maxPriorityFeePerGas: toHex(userOp.maxPriorityFeePerGas),
693
+ maxFeePerGas: toHex(userOp.maxFeePerGas),
718
694
  paymaster: userOp.paymaster,
719
695
  paymasterVerificationGasLimit: userOp.paymasterVerificationGasLimit
720
- ? (0, viem_1.toHex)(userOp.paymasterVerificationGasLimit)
696
+ ? toHex(userOp.paymasterVerificationGasLimit)
721
697
  : undefined,
722
698
  paymasterPostOpGasLimit: userOp.paymasterPostOpGasLimit
723
- ? (0, viem_1.toHex)(userOp.paymasterPostOpGasLimit)
699
+ ? toHex(userOp.paymasterPostOpGasLimit)
724
700
  : undefined,
725
701
  paymasterData: userOp.paymasterData,
726
702
  signature,
727
703
  },
728
- account_abstraction_1.entryPoint07Address,
704
+ entryPoint07Address,
729
705
  ],
730
706
  });
731
707
  return {
@@ -758,7 +734,7 @@ function createSignedIntentOp(intentOp, originSignatures, destinationSignature,
758
734
  async function submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun, intentInput) {
759
735
  const signedIntentOp = createSignedIntentOp(intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations);
760
736
  const isSponsored = !!intentInput?.options?.sponsorSettings;
761
- const orchestrator = (0, orchestrator_1.getOrchestrator)(config._authProvider ?? (0, provider_1.createAuthProvider)(config), config.endpointUrl, config.headers);
737
+ const orchestrator = getOrchestrator(config._authProvider ?? createAuthProvider(config), config.endpointUrl, config.headers);
762
738
  const intentResults = await orchestrator.submitIntent(signedIntentOp, dryRun, intentInput ? { intentInput, isSponsored } : undefined);
763
739
  // Some settlement paths (e.g. SAME_CHAIN) may not return a result.id — fall
764
740
  // back to the nonce which the orchestrator also accepts as an intent identifier.
@@ -772,16 +748,16 @@ async function submitIntentInternal(config, sourceChains, targetChain, intentOp,
772
748
  }
773
749
  async function getValidatorAccount(config, signers, publicClient, chain) {
774
750
  if (!signers) {
775
- return (0, accounts_1.getSmartAccount)(config, publicClient, chain);
751
+ return getSmartAccount(config, publicClient, chain);
776
752
  }
777
753
  // Owners
778
754
  const withOwner = signers.type === 'owner' ? signers : null;
779
755
  if (withOwner) {
780
- return (0, accounts_1.getSmartAccount)(config, publicClient, chain);
756
+ return getSmartAccount(config, publicClient, chain);
781
757
  }
782
758
  const withGuardians = signers.type === 'guardians' ? signers : null;
783
759
  return withGuardians
784
- ? await (0, accounts_1.getGuardianSmartAccount)(config, publicClient, chain, {
760
+ ? await getGuardianSmartAccount(config, publicClient, chain, {
785
761
  type: 'ecdsa',
786
762
  accounts: withGuardians.guardians,
787
763
  })
@@ -789,7 +765,7 @@ async function getValidatorAccount(config, signers, publicClient, chain) {
789
765
  }
790
766
  function getValidator(config, signers) {
791
767
  if (!signers) {
792
- return (0, validators_1.getOwnerValidator)(config);
768
+ return getOwnerValidator(config);
793
769
  }
794
770
  // Owners
795
771
  const withOwner = signers.type === 'owner' ? signers : null;
@@ -797,29 +773,29 @@ function getValidator(config, signers) {
797
773
  // ECDSA
798
774
  if (withOwner.kind === 'ecdsa') {
799
775
  // Use the configured owner validator (e.g., ENS) rather than forcing Ownable
800
- return (0, validators_1.getOwnerValidator)(config);
776
+ return getOwnerValidator(config);
801
777
  }
802
778
  // Passkeys (WebAuthn)
803
779
  if (withOwner.kind === 'passkey') {
804
- return (0, core_1.getWebAuthnValidator)(1, withOwner.accounts.map((account) => ({
780
+ return getWebAuthnValidator(1, withOwner.accounts.map((account) => ({
805
781
  pubKey: account.publicKey,
806
782
  authenticatorId: account.id,
807
783
  })));
808
784
  }
809
785
  // Multi-factor
810
786
  if (withOwner.kind === 'multi-factor') {
811
- return (0, core_1.getMultiFactorValidator)(1, withOwner.validators);
787
+ return getMultiFactorValidator(1, withOwner.validators);
812
788
  }
813
789
  }
814
790
  // Smart sessions
815
791
  const withSession = signers.type === 'experimental_session';
816
792
  if (withSession) {
817
- return (0, validators_1.getSmartSessionValidator)(config);
793
+ return getSmartSessionValidator(config);
818
794
  }
819
795
  // Guardians (social recovery)
820
796
  const withGuardians = signers.type === 'guardians' ? signers : null;
821
797
  if (withGuardians) {
822
- return (0, core_1.getSocialRecoveryValidator)(withGuardians.guardians);
798
+ return getSocialRecoveryValidator(withGuardians.guardians);
823
799
  }
824
800
  // Fallback
825
801
  return undefined;
@@ -828,7 +804,7 @@ function parseCalls(calls, chainId) {
828
804
  return calls.map((call) => ({
829
805
  data: call.data ?? '0x',
830
806
  value: call.value ?? 0n,
831
- to: (0, registry_1.resolveTokenAddress)(call.to, chainId),
807
+ to: resolveTokenAddress(call.to, chainId),
832
808
  }));
833
809
  }
834
810
  function createAccountAccessList(sourceChains, sourceAssets) {
@@ -842,7 +818,7 @@ function createAccountAccessList(sourceChains, sourceAssets) {
842
818
  if (isExactConfig) {
843
819
  const resolvedConfigs = sourceAssets.map((config) => ({
844
820
  chainId: config.chain.id,
845
- tokenAddress: (0, registry_1.resolveTokenAddress)(config.address, config.chain.id),
821
+ tokenAddress: resolveTokenAddress(config.address, config.chain.id),
846
822
  amount: config.amount,
847
823
  }));
848
824
  return resolvedConfigs;
@@ -854,18 +830,18 @@ function createAccountAccessList(sourceChains, sourceAssets) {
854
830
  return { chainTokens: sourceAssets };
855
831
  }
856
832
  function getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSignature) {
857
- const initCode = (0, accounts_1.getInitCode)(config);
833
+ const initCode = getInitCode(config);
858
834
  if (config.account?.type === 'eoa') {
859
835
  return {
860
836
  setupOps: [],
861
837
  };
862
838
  }
863
- else if ((0, accounts_1.is7702)(config)) {
839
+ else if (is7702(config)) {
864
840
  // EIP-7702 initialization is only needed for EOA accounts
865
841
  if (!eip7702InitSignature || eip7702InitSignature === '0x') {
866
- throw new error_1.Eip7702InitSignatureRequiredError();
842
+ throw new Eip7702InitSignatureRequiredError();
867
843
  }
868
- const { initData: eip7702InitData, contract: eip7702Contract } = (0, accounts_1.getEip7702InitCall)(config, eip7702InitSignature);
844
+ const { initData: eip7702InitData, contract: eip7702Contract } = getEip7702InitCall(config, eip7702InitSignature);
869
845
  return {
870
846
  setupOps: [
871
847
  {
@@ -891,7 +867,7 @@ function getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSig
891
867
  setupOps: [],
892
868
  };
893
869
  }
894
- throw new accounts_1.FactoryArgsNotAvailableError();
870
+ throw new FactoryArgsNotAvailableError();
895
871
  }
896
872
  // Contract account with init code
897
873
  return {
@@ -913,12 +889,12 @@ function getSetupOperationsAndDelegations(config, accountAddress, eip7702InitSig
913
889
  function validateTokenSymbols(chain, tokenAddressOrSymbols) {
914
890
  function validateTokenSymbol(chain, addressOrSymbol) {
915
891
  // Address
916
- if ((0, viem_1.isAddress)(addressOrSymbol, { strict: false })) {
892
+ if (isAddress(addressOrSymbol, { strict: false })) {
917
893
  return true;
918
894
  }
919
895
  // Token symbol
920
- const address = (0, registry_1.getTokenAddress)(addressOrSymbol, chain.id);
921
- return (0, viem_1.isAddress)(address, { strict: false });
896
+ const address = getTokenAddress(addressOrSymbol, chain.id);
897
+ return isAddress(address, { strict: false });
922
898
  }
923
899
  for (const addressOrSymbol of tokenAddressOrSymbols) {
924
900
  if (!validateTokenSymbol(chain, addressOrSymbol)) {
@@ -930,7 +906,7 @@ function validateTokenSymbols(chain, tokenAddressOrSymbols) {
930
906
  // Uses a Solady-compatible TypedDataSign hash and wraps the signature with
931
907
  // the app domain separator and contents hash for on-chain verification.
932
908
  async function signErc7739TypedData(config, signers, validator, isRoot, parameters, chain) {
933
- const verifierDomain = (0, accounts_1.getEip712Domain)(config, chain);
909
+ const verifierDomain = getEip712Domain(config, chain);
934
910
  const hash = hashErc7739TypedDataForSolady({
935
911
  domain: parameters.domain,
936
912
  types: parameters.types,
@@ -938,10 +914,10 @@ async function signErc7739TypedData(config, signers, validator, isRoot, paramete
938
914
  message: parameters.message,
939
915
  verifierDomain,
940
916
  });
941
- return await (0, accounts_1.getEip1271Signature)(config, signers, chain, {
917
+ return await getEip1271Signature(config, signers, chain, {
942
918
  address: validator.address,
943
919
  isRoot,
944
- }, hash, (signature) => (0, erc7739_1.wrapTypedDataSignature)({
920
+ }, hash, (signature) => wrapTypedDataSignature({
945
921
  domain: parameters.domain,
946
922
  primaryType: parameters.primaryType,
947
923
  types: parameters.types,
@@ -979,15 +955,15 @@ function hashErc7739TypedDataForSolady({ domain, types, primaryType, message, ve
979
955
  // Construct TypedDataSign type string matching Solady's on-chain encoding:
980
956
  // TypedDataSign(<contentsName> contents,...salt) + contentsType
981
957
  const typedDataSignTypeString = `TypedDataSign(${contentsName} contents,string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)${contentsType}`;
982
- const typedDataSignTypeHash = (0, viem_1.keccak256)((0, viem_1.toHex)(typedDataSignTypeString));
958
+ const typedDataSignTypeHash = keccak256(toHex(typedDataSignTypeString));
983
959
  // Hash the original content struct
984
- const contentsHash = (0, viem_1.hashStruct)({
960
+ const contentsHash = hashStruct({
985
961
  data: message,
986
962
  primaryType,
987
963
  types: types,
988
964
  });
989
965
  // Compute the TypedDataSign struct hash
990
- const structHash = (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([
966
+ const structHash = keccak256(encodeAbiParameters([
991
967
  { type: 'bytes32' },
992
968
  { type: 'bytes32' },
993
969
  { type: 'bytes32' },
@@ -998,8 +974,8 @@ function hashErc7739TypedDataForSolady({ domain, types, primaryType, message, ve
998
974
  ], [
999
975
  typedDataSignTypeHash,
1000
976
  contentsHash,
1001
- (0, viem_1.keccak256)((0, viem_1.toHex)(verifierDomain.name)),
1002
- (0, viem_1.keccak256)((0, viem_1.toHex)(verifierDomain.version)),
977
+ keccak256(toHex(verifierDomain.name)),
978
+ keccak256(toHex(verifierDomain.version)),
1003
979
  BigInt(verifierDomain.chainId),
1004
980
  verifierDomain.verifyingContract,
1005
981
  verifierDomain.salt,
@@ -1016,10 +992,11 @@ function hashErc7739TypedDataForSolady({ domain, types, primaryType, message, ve
1016
992
  domainTypes.push({ name: 'verifyingContract', type: 'address' });
1017
993
  if (domain.salt)
1018
994
  domainTypes.push({ name: 'salt', type: 'bytes32' });
1019
- const appDomainSeparator = (0, viem_1.hashDomain)({
995
+ const appDomainSeparator = hashDomain({
1020
996
  domain,
1021
997
  types: { EIP712Domain: domainTypes },
1022
998
  });
1023
999
  // Final hash: keccak256("\x19\x01" || appDomainSep || structHash)
1024
- return (0, viem_1.keccak256)((0, viem_1.concat)(['0x1901', appDomainSeparator, structHash]));
1000
+ return keccak256(concat(['0x1901', appDomainSeparator, structHash]));
1025
1001
  }
1002
+ export { prepareTransaction, getTransactionMessages, signTransaction, signAuthorizations, signAuthorizationsInternal, signMessage, signTypedData, submitTransaction, prepareUserOperation, signUserOperation, submitUserOperation, signIntent, prepareTransactionAsIntent, submitIntentInternal, getValidatorAccount, parseCalls, getTokenRequests, resolveCallInputs, getIntentAccount, getTargetExecutionSignature, hashErc7739TypedDataForSolady, resolveSessionForChain, };