@rhinestone/sdk 1.4.2 → 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 (202) hide show
  1. package/README.md +89 -1
  2. package/dist/src/accounts/error.d.ts +1 -1
  3. package/dist/src/accounts/error.js +1 -19
  4. package/dist/src/accounts/index.d.ts +5 -5
  5. package/dist/src/accounts/index.js +121 -157
  6. package/dist/src/accounts/json-rpc/index.d.ts +1 -1
  7. package/dist/src/accounts/json-rpc/index.js +8 -10
  8. package/dist/src/accounts/json-rpc/providers.d.ts +1 -1
  9. package/dist/src/accounts/json-rpc/providers.js +4 -7
  10. package/dist/src/accounts/kernel.d.ts +3 -3
  11. package/dist/src/accounts/kernel.js +66 -75
  12. package/dist/src/accounts/nexus.d.ts +3 -3
  13. package/dist/src/accounts/nexus.js +62 -73
  14. package/dist/src/accounts/passport.d.ts +3 -3
  15. package/dist/src/accounts/passport.js +9 -13
  16. package/dist/src/accounts/safe.d.ts +3 -3
  17. package/dist/src/accounts/safe.js +54 -63
  18. package/dist/src/accounts/signing/common.d.ts +10 -4
  19. package/dist/src/accounts/signing/common.d.ts.map +1 -1
  20. package/dist/src/accounts/signing/common.js +30 -36
  21. package/dist/src/accounts/signing/message.d.ts +2 -2
  22. package/dist/src/accounts/signing/message.js +10 -12
  23. package/dist/src/accounts/signing/passkeys.js +11 -17
  24. package/dist/src/accounts/signing/typedData.d.ts +1 -1
  25. package/dist/src/accounts/signing/typedData.js +6 -8
  26. package/dist/src/accounts/startale.d.ts +3 -3
  27. package/dist/src/accounts/startale.js +37 -47
  28. package/dist/src/accounts/utils.d.ts +2 -2
  29. package/dist/src/accounts/utils.js +22 -28
  30. package/dist/src/accounts/walletClient.js +4 -8
  31. package/dist/src/actions/compact.d.ts +1 -1
  32. package/dist/src/actions/compact.js +22 -35
  33. package/dist/src/actions/deployment.d.ts +1 -1
  34. package/dist/src/actions/deployment.js +11 -13
  35. package/dist/src/actions/ecdsa.d.ts +1 -1
  36. package/dist/src/actions/ecdsa.js +14 -20
  37. package/dist/src/actions/index.d.ts +2 -2
  38. package/dist/src/actions/index.js +6 -10
  39. package/dist/src/actions/mfa.d.ts +1 -1
  40. package/dist/src/actions/mfa.js +18 -24
  41. package/dist/src/actions/passkeys.d.ts +2 -2
  42. package/dist/src/actions/passkeys.js +14 -20
  43. package/dist/src/actions/recovery.d.ts +1 -1
  44. package/dist/src/actions/recovery.js +25 -29
  45. package/dist/src/actions/smart-sessions.d.ts +1 -1
  46. package/dist/src/actions/smart-sessions.js +8 -12
  47. package/dist/src/auth/provider.d.ts +7 -0
  48. package/dist/src/auth/provider.d.ts.map +1 -0
  49. package/dist/src/auth/provider.js +38 -0
  50. package/dist/src/errors/index.d.ts +3 -3
  51. package/dist/src/errors/index.js +10 -54
  52. package/dist/src/execution/compact.d.ts +3 -3
  53. package/dist/src/execution/compact.js +10 -18
  54. package/dist/src/execution/error.js +1 -11
  55. package/dist/src/execution/index.d.ts +9 -8
  56. package/dist/src/execution/index.d.ts.map +1 -1
  57. package/dist/src/execution/index.js +54 -67
  58. package/dist/src/execution/permit2.d.ts +5 -5
  59. package/dist/src/execution/permit2.js +8 -13
  60. package/dist/src/execution/singleChainOps.d.ts +2 -2
  61. package/dist/src/execution/singleChainOps.js +1 -3
  62. package/dist/src/execution/types.d.ts +1 -1
  63. package/dist/src/execution/types.js +1 -2
  64. package/dist/src/execution/utils.d.ts +10 -6
  65. package/dist/src/execution/utils.d.ts.map +1 -1
  66. package/dist/src/execution/utils.js +159 -162
  67. package/dist/src/index.d.ts +10 -10
  68. package/dist/src/index.d.ts.map +1 -1
  69. package/dist/src/index.js +57 -67
  70. package/dist/src/jwt-server/digest.d.ts +11 -0
  71. package/dist/src/jwt-server/digest.d.ts.map +1 -0
  72. package/dist/src/jwt-server/digest.js +19 -0
  73. package/dist/src/jwt-server/express.d.ts +16 -0
  74. package/dist/src/jwt-server/express.d.ts.map +1 -0
  75. package/dist/src/jwt-server/express.js +23 -0
  76. package/dist/src/jwt-server/handlers.d.ts +10 -0
  77. package/dist/src/jwt-server/handlers.d.ts.map +1 -0
  78. package/dist/src/jwt-server/handlers.js +37 -0
  79. package/dist/src/jwt-server/index.d.ts +8 -0
  80. package/dist/src/jwt-server/index.d.ts.map +1 -0
  81. package/dist/src/jwt-server/index.js +7 -0
  82. package/dist/src/jwt-server/jcs.d.ts +12 -0
  83. package/dist/src/jwt-server/jcs.d.ts.map +1 -0
  84. package/dist/src/jwt-server/jcs.js +57 -0
  85. package/dist/src/jwt-server/signer.d.ts +18 -0
  86. package/dist/src/jwt-server/signer.d.ts.map +1 -0
  87. package/dist/src/jwt-server/signer.js +68 -0
  88. package/dist/src/jwt-server/sponsorship.d.ts +19 -0
  89. package/dist/src/jwt-server/sponsorship.d.ts.map +1 -0
  90. package/dist/src/jwt-server/sponsorship.js +51 -0
  91. package/dist/src/jwt-server/web.d.ts +4 -0
  92. package/dist/src/jwt-server/web.d.ts.map +1 -0
  93. package/dist/src/jwt-server/web.js +23 -0
  94. package/dist/src/modules/abi/smart-session-emissary.js +1 -3
  95. package/dist/src/modules/abi/smart-sessions.js +1 -4
  96. package/dist/src/modules/chain-abstraction.js +1 -5
  97. package/dist/src/modules/common.d.ts +1 -1
  98. package/dist/src/modules/common.js +1 -13
  99. package/dist/src/modules/index.d.ts +5 -5
  100. package/dist/src/modules/index.js +35 -50
  101. package/dist/src/modules/legacy.d.ts +2 -2
  102. package/dist/src/modules/legacy.js +11 -14
  103. package/dist/src/modules/read.d.ts +1 -1
  104. package/dist/src/modules/read.js +11 -15
  105. package/dist/src/modules/validators/core.d.ts +2 -2
  106. package/dist/src/modules/validators/core.js +26 -44
  107. package/dist/src/modules/validators/index.d.ts +2 -2
  108. package/dist/src/modules/validators/index.js +3 -19
  109. package/dist/src/modules/validators/policies/claim/permit2.d.ts +1 -1
  110. package/dist/src/modules/validators/policies/claim/permit2.js +39 -44
  111. package/dist/src/modules/validators/policies/claim/types.js +11 -14
  112. package/dist/src/modules/validators/smart-sessions.d.ts +4 -4
  113. package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
  114. package/dist/src/modules/validators/smart-sessions.js +77 -97
  115. package/dist/src/orchestrator/client.d.ts +10 -5
  116. package/dist/src/orchestrator/client.d.ts.map +1 -1
  117. package/dist/src/orchestrator/client.js +73 -66
  118. package/dist/src/orchestrator/consts.d.ts +1 -1
  119. package/dist/src/orchestrator/consts.d.ts.map +1 -1
  120. package/dist/src/orchestrator/consts.js +2 -8
  121. package/dist/src/orchestrator/error.js +1 -33
  122. package/dist/src/orchestrator/index.d.ts +8 -7
  123. package/dist/src/orchestrator/index.d.ts.map +1 -1
  124. package/dist/src/orchestrator/index.js +8 -57
  125. package/dist/src/orchestrator/registry.d.ts +2 -2
  126. package/dist/src/orchestrator/registry.js +19 -33
  127. package/dist/src/orchestrator/types.d.ts +5 -1
  128. package/dist/src/orchestrator/types.d.ts.map +1 -1
  129. package/dist/src/orchestrator/types.js +1 -17
  130. package/dist/src/orchestrator/utils.js +1 -3
  131. package/dist/src/types.d.ts +29 -5
  132. package/dist/src/types.d.ts.map +1 -1
  133. package/dist/src/types.js +1 -2
  134. package/dist/src/utils/index.d.ts +2 -2
  135. package/dist/src/utils/index.js +9 -15
  136. package/package.json +29 -98
  137. package/dist/src/accounts/index.test.d.ts +0 -2
  138. package/dist/src/accounts/index.test.d.ts.map +0 -1
  139. package/dist/src/accounts/index.test.js +0 -33
  140. package/dist/src/accounts/json-rpc/index.test.d.ts +0 -2
  141. package/dist/src/accounts/json-rpc/index.test.d.ts.map +0 -1
  142. package/dist/src/accounts/json-rpc/index.test.js +0 -35
  143. package/dist/src/accounts/json-rpc/providers.test.d.ts +0 -2
  144. package/dist/src/accounts/json-rpc/providers.test.d.ts.map +0 -1
  145. package/dist/src/accounts/json-rpc/providers.test.js +0 -43
  146. package/dist/src/accounts/kernel.test.d.ts +0 -2
  147. package/dist/src/accounts/kernel.test.d.ts.map +0 -1
  148. package/dist/src/accounts/kernel.test.js +0 -132
  149. package/dist/src/accounts/nexus.test.d.ts +0 -2
  150. package/dist/src/accounts/nexus.test.d.ts.map +0 -1
  151. package/dist/src/accounts/nexus.test.js +0 -118
  152. package/dist/src/accounts/safe.test.d.ts +0 -2
  153. package/dist/src/accounts/safe.test.d.ts.map +0 -1
  154. package/dist/src/accounts/safe.test.js +0 -168
  155. package/dist/src/accounts/signing/passkeys.test.d.ts +0 -2
  156. package/dist/src/accounts/signing/passkeys.test.d.ts.map +0 -1
  157. package/dist/src/accounts/signing/passkeys.test.js +0 -88
  158. package/dist/src/accounts/startale.test.d.ts +0 -2
  159. package/dist/src/accounts/startale.test.d.ts.map +0 -1
  160. package/dist/src/accounts/startale.test.js +0 -189
  161. package/dist/src/accounts/utils.test.d.ts +0 -2
  162. package/dist/src/accounts/utils.test.d.ts.map +0 -1
  163. package/dist/src/accounts/utils.test.js +0 -49
  164. package/dist/src/actions/ecdsa.test.d.ts +0 -2
  165. package/dist/src/actions/ecdsa.test.d.ts.map +0 -1
  166. package/dist/src/actions/ecdsa.test.js +0 -99
  167. package/dist/src/actions/passkeys.test.d.ts +0 -2
  168. package/dist/src/actions/passkeys.test.d.ts.map +0 -1
  169. package/dist/src/actions/passkeys.test.js +0 -54
  170. package/dist/src/actions/recovery.test.d.ts +0 -2
  171. package/dist/src/actions/recovery.test.d.ts.map +0 -1
  172. package/dist/src/actions/recovery.test.js +0 -168
  173. package/dist/src/execution/signing.test.d.ts +0 -2
  174. package/dist/src/execution/signing.test.d.ts.map +0 -1
  175. package/dist/src/execution/signing.test.js +0 -465
  176. package/dist/src/execution/utils.test.d.ts +0 -2
  177. package/dist/src/execution/utils.test.d.ts.map +0 -1
  178. package/dist/src/execution/utils.test.js +0 -388
  179. package/dist/src/modules/index.test.d.ts +0 -2
  180. package/dist/src/modules/index.test.d.ts.map +0 -1
  181. package/dist/src/modules/index.test.js +0 -81
  182. package/dist/src/modules/validators/core.test.d.ts +0 -2
  183. package/dist/src/modules/validators/core.test.d.ts.map +0 -1
  184. package/dist/src/modules/validators/core.test.js +0 -101
  185. package/dist/src/modules/validators/policies/claim/permit2.test.d.ts +0 -2
  186. package/dist/src/modules/validators/policies/claim/permit2.test.d.ts.map +0 -1
  187. package/dist/src/modules/validators/policies/claim/permit2.test.js +0 -519
  188. package/dist/src/modules/validators/smart-sessions.test.d.ts +0 -2
  189. package/dist/src/modules/validators/smart-sessions.test.d.ts.map +0 -1
  190. package/dist/src/modules/validators/smart-sessions.test.js +0 -311
  191. package/dist/src/orchestrator/registry.test.d.ts +0 -2
  192. package/dist/src/orchestrator/registry.test.d.ts.map +0 -1
  193. package/dist/src/orchestrator/registry.test.js +0 -154
  194. package/dist/src/utils/index.test.d.ts +0 -2
  195. package/dist/src/utils/index.test.d.ts.map +0 -1
  196. package/dist/src/utils/index.test.js +0 -42
  197. package/dist/test/consts.d.ts +0 -10
  198. package/dist/test/consts.d.ts.map +0 -1
  199. package/dist/test/consts.js +0 -22
  200. package/dist/test/utils/utils.d.ts +0 -5
  201. package/dist/test/utils/utils.d.ts.map +0 -1
  202. package/dist/test/utils/utils.js +0 -20
@@ -1,79 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletClientNoConnectedAccountError = exports.SmartSessionsNotEnabledError = exports.SigningNotSupportedForAccountError = exports.OwnersFieldRequiredError = exports.ModuleInstallationNotSupportedError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.EoaSigningNotSupportedError = exports.EoaSigningMethodNotConfiguredError = exports.EoaAccountMustHaveAccountError = exports.Eip7702NotSupportedForAccountError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
4
- exports.getEip712Domain = getEip712Domain;
5
- exports.getModuleInstallationCalls = getModuleInstallationCalls;
6
- exports.getModuleUninstallationCalls = getModuleUninstallationCalls;
7
- exports.getAddress = getAddress;
8
- exports.checkAddress = checkAddress;
9
- exports.getAccountProvider = getAccountProvider;
10
- exports.getInitCode = getInitCode;
11
- exports.getV0InitCode = getV0InitCode;
12
- exports.signEip7702InitData = signEip7702InitData;
13
- exports.getEip7702InitCall = getEip7702InitCall;
14
- exports.is7702 = is7702;
15
- exports.isDeployed = isDeployed;
16
- exports.deploy = deploy;
17
- exports.setup = setup;
18
- exports.toErc6492Signature = toErc6492Signature;
19
- exports.getSmartAccount = getSmartAccount;
20
- exports.getGuardianSmartAccount = getGuardianSmartAccount;
21
- exports.getEip1271Signature = getEip1271Signature;
22
- exports.getEmissarySignature = getEmissarySignature;
23
- exports.getTypedDataPackedSignature = getTypedDataPackedSignature;
24
- const viem_1 = require("viem");
25
- const execution_1 = require("../execution");
26
- const modules_1 = require("../modules");
27
- const validators_1 = require("../modules/validators");
28
- const core_1 = require("../modules/validators/core");
29
- const error_1 = require("./error");
30
- Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return error_1.AccountConfigurationNotSupportedError; } });
31
- Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return error_1.AccountError; } });
32
- Object.defineProperty(exports, "Eip712DomainNotAvailableError", { enumerable: true, get: function () { return error_1.Eip712DomainNotAvailableError; } });
33
- Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return error_1.Eip7702AccountMustHaveEoaError; } });
34
- Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return error_1.Eip7702NotSupportedForAccountError; } });
35
- Object.defineProperty(exports, "EoaAccountMustHaveAccountError", { enumerable: true, get: function () { return error_1.EoaAccountMustHaveAccountError; } });
36
- Object.defineProperty(exports, "EoaSigningMethodNotConfiguredError", { enumerable: true, get: function () { return error_1.EoaSigningMethodNotConfiguredError; } });
37
- Object.defineProperty(exports, "EoaSigningNotSupportedError", { enumerable: true, get: function () { return error_1.EoaSigningNotSupportedError; } });
38
- Object.defineProperty(exports, "ExistingEip7702AccountsNotSupportedError", { enumerable: true, get: function () { return error_1.ExistingEip7702AccountsNotSupportedError; } });
39
- Object.defineProperty(exports, "FactoryArgsNotAvailableError", { enumerable: true, get: function () { return error_1.FactoryArgsNotAvailableError; } });
40
- Object.defineProperty(exports, "isAccountError", { enumerable: true, get: function () { return error_1.isAccountError; } });
41
- Object.defineProperty(exports, "ModuleInstallationNotSupportedError", { enumerable: true, get: function () { return error_1.ModuleInstallationNotSupportedError; } });
42
- Object.defineProperty(exports, "OwnersFieldRequiredError", { enumerable: true, get: function () { return error_1.OwnersFieldRequiredError; } });
43
- Object.defineProperty(exports, "SigningNotSupportedForAccountError", { enumerable: true, get: function () { return error_1.SigningNotSupportedForAccountError; } });
44
- Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: true, get: function () { return error_1.SmartSessionsNotEnabledError; } });
45
- Object.defineProperty(exports, "WalletClientNoConnectedAccountError", { enumerable: true, get: function () { return error_1.WalletClientNoConnectedAccountError; } });
46
- const kernel_1 = require("./kernel");
47
- const nexus_1 = require("./nexus");
48
- const passport_1 = require("./passport");
49
- const safe_1 = require("./safe");
50
- const common_1 = require("./signing/common");
51
- const message_1 = require("./signing/message");
52
- const typedData_1 = require("./signing/typedData");
53
- const startale_1 = require("./startale");
54
- const utils_1 = require("./utils");
1
+ import { concat, createPublicClient, encodeAbiParameters, encodeFunctionData, hashTypedData, size, zeroAddress, zeroHash, } from 'viem';
2
+ import { sendTransaction, sendTransactionInternal, sendUserOperationInternal, waitForExecution, } from '../execution/index.js';
3
+ import { getIntentExecutor, getSetup } from '../modules/index.js';
4
+ import { getOwnerValidator } from '../modules/validators/index.js';
5
+ import { getSocialRecoveryValidator } from '../modules/validators/core.js';
6
+ import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, } from './error.js';
7
+ import { getAddress as getKernelAddress, getDeployArgs as getKernelDeployArgs, getEip712Domain as getKernelEip712Domain, getGuardianSmartAccount as getKernelGuardianSmartAccount, getInstallData as getKernelInstallData, getSmartAccount as getKernelSmartAccount, packSignature as packKernelSignature, wrapMessageHash as wrapKernelMessageHash, } from './kernel.js';
8
+ import { getAddress as getNexusAddress, getDefaultValidatorAddress as getNexusDefaultValidatorAddress, getDeployArgs as getNexusDeployArgs, getEip712Domain as getNexusEip712Domain, getEip7702InitCall as getNexusEip7702InitCall, getGuardianSmartAccount as getNexusGuardianSmartAccount, getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, packSignature as packNexusSignature, signEip7702InitData as signNexusEip7702InitData, } from './nexus.js';
9
+ import { getAddress as getPassportAddress, getInstallData as getPassportInstallData, packSignature as packPassportSignature, } from './passport.js';
10
+ import { getAddress as getSafeAddress, getDeployArgs as getSafeDeployArgs, getEip712Domain as getSafeEip712Domain, getGuardianSmartAccount as getSafeGuardianSmartAccount, getInstallData as getSafeInstallData, getSmartAccount as getSafeSmartAccount, getV0DeployArgs as getSafeV0DeployArgs, packSignature as packSafeSignature, } from './safe.js';
11
+ import { convertOwnerSetToSignerSet } from './signing/common.js';
12
+ import { sign as signMessage } from './signing/message.js';
13
+ import { sign as signTypedData } from './signing/typedData.js';
14
+ import { getAddress as getStartaleAddress, getDeployArgs as getStartaleDeployArgs, getEip712Domain as getStartaleEip712Domain, getGuardianSmartAccount as getStartaleGuardianSmartAccount, getInstallData as getStartaleInstallData, getSmartAccount as getStartaleSmartAccount, packSignature as packStartaleSignature, } from './startale.js';
15
+ import { createTransport, getBundlerClient, } from './utils.js';
55
16
  function getDeployArgs(config) {
56
17
  const account = getAccountProvider(config);
57
18
  switch (account.type) {
58
19
  case 'safe': {
59
- return (0, safe_1.getDeployArgs)(config);
20
+ return getSafeDeployArgs(config);
60
21
  }
61
22
  case 'nexus': {
62
- return (0, nexus_1.getDeployArgs)(config);
23
+ return getNexusDeployArgs(config);
63
24
  }
64
25
  case 'kernel': {
65
- return (0, kernel_1.getDeployArgs)(config);
26
+ return getKernelDeployArgs(config);
66
27
  }
67
28
  case 'startale': {
68
- return (0, startale_1.getDeployArgs)(config);
29
+ return getStartaleDeployArgs(config);
69
30
  }
70
31
  case 'passport': {
71
32
  // Mocked data; will be overridden by the actual deploy args
72
33
  return {
73
- factory: viem_1.zeroAddress,
74
- factoryData: viem_1.zeroHash,
75
- salt: viem_1.zeroHash,
76
- implementation: viem_1.zeroAddress,
34
+ factory: zeroAddress,
35
+ factoryData: zeroHash,
36
+ salt: zeroHash,
37
+ implementation: zeroAddress,
77
38
  initializationCallData: '0x',
78
39
  initData: '0x',
79
40
  };
@@ -87,7 +48,7 @@ function getV0DeployArgs(config) {
87
48
  const account = getAccountProvider(config);
88
49
  switch (account.type) {
89
50
  case 'safe': {
90
- return (0, safe_1.getV0DeployArgs)(config);
51
+ return getSafeV0DeployArgs(config);
91
52
  }
92
53
  default: {
93
54
  throw new Error(`Unsupported account type: ${account.type}`);
@@ -107,7 +68,7 @@ function getInitCode(config) {
107
68
  else {
108
69
  const deployArgs = getDeployArgs(config);
109
70
  if (!deployArgs) {
110
- throw new error_1.FactoryArgsNotAvailableError();
71
+ throw new FactoryArgsNotAvailableError();
111
72
  }
112
73
  const { factory, factoryData } = deployArgs;
113
74
  return {
@@ -129,7 +90,7 @@ function getV0InitCode(config) {
129
90
  else {
130
91
  const deployArgs = getV0DeployArgs(config);
131
92
  if (!deployArgs) {
132
- throw new error_1.FactoryArgsNotAvailableError();
93
+ throw new FactoryArgsNotAvailableError();
133
94
  }
134
95
  const { factory, factoryData } = deployArgs;
135
96
  return {
@@ -141,23 +102,23 @@ function getV0InitCode(config) {
141
102
  async function signEip7702InitData(config) {
142
103
  const eoa = config.eoa;
143
104
  if (!eoa) {
144
- throw new error_1.Eip7702AccountMustHaveEoaError();
105
+ throw new Eip7702AccountMustHaveEoaError();
145
106
  }
146
107
  const account = getAccountProvider(config);
147
108
  switch (account.type) {
148
109
  case 'nexus': {
149
- return await (0, nexus_1.signEip7702InitData)(config, eoa);
110
+ return await signNexusEip7702InitData(config, eoa);
150
111
  }
151
112
  case 'eoa': {
152
- throw new error_1.Eip7702NotSupportedForAccountError(account.type);
113
+ throw new Eip7702NotSupportedForAccountError(account.type);
153
114
  }
154
115
  case 'safe':
155
116
  case 'kernel':
156
117
  case 'startale': {
157
- throw new error_1.Eip7702NotSupportedForAccountError(account.type);
118
+ throw new Eip7702NotSupportedForAccountError(account.type);
158
119
  }
159
120
  default: {
160
- throw new error_1.Eip7702NotSupportedForAccountError(account.type);
121
+ throw new Eip7702NotSupportedForAccountError(account.type);
161
122
  }
162
123
  }
163
124
  }
@@ -165,15 +126,15 @@ function getEip7702InitCall(config, signature) {
165
126
  const account = getAccountProvider(config);
166
127
  switch (account.type) {
167
128
  case 'nexus': {
168
- return (0, nexus_1.getEip7702InitCall)(config, signature);
129
+ return getNexusEip7702InitCall(config, signature);
169
130
  }
170
131
  case 'safe':
171
132
  case 'kernel':
172
133
  case 'startale': {
173
- throw new error_1.Eip7702NotSupportedForAccountError(account.type);
134
+ throw new Eip7702NotSupportedForAccountError(account.type);
174
135
  }
175
136
  default: {
176
- throw new error_1.Eip7702NotSupportedForAccountError(account.type);
137
+ throw new Eip7702NotSupportedForAccountError(account.type);
177
138
  }
178
139
  }
179
140
  }
@@ -181,22 +142,22 @@ function getEip712Domain(config, chain) {
181
142
  const account = getAccountProvider(config);
182
143
  switch (account.type) {
183
144
  case 'nexus': {
184
- return (0, nexus_1.getEip712Domain)(config, chain);
145
+ return getNexusEip712Domain(config, chain);
185
146
  }
186
147
  case 'safe': {
187
- return (0, safe_1.getEip712Domain)(config, chain);
148
+ return getSafeEip712Domain(config, chain);
188
149
  }
189
150
  case 'kernel': {
190
- return (0, kernel_1.getEip712Domain)(config, chain);
151
+ return getKernelEip712Domain(config, chain);
191
152
  }
192
153
  case 'startale': {
193
- return (0, startale_1.getEip712Domain)(config, chain);
154
+ return getStartaleEip712Domain(config, chain);
194
155
  }
195
156
  case 'eoa': {
196
- throw new error_1.Eip712DomainNotAvailableError('EOA accounts do not have an EIP-712 domain');
157
+ throw new Eip712DomainNotAvailableError('EOA accounts do not have an EIP-712 domain');
197
158
  }
198
159
  default: {
199
- throw new error_1.Eip712DomainNotAvailableError(`Account type ${account.type} not yet supported`);
160
+ throw new Eip712DomainNotAvailableError(`Account type ${account.type} not yet supported`);
200
161
  }
201
162
  }
202
163
  }
@@ -206,22 +167,22 @@ function getModuleInstallationCalls(config, module) {
206
167
  const account = getAccountProvider(config);
207
168
  switch (account.type) {
208
169
  case 'safe': {
209
- return [(0, safe_1.getInstallData)(module)];
170
+ return [getSafeInstallData(module)];
210
171
  }
211
172
  case 'nexus': {
212
- return [(0, nexus_1.getInstallData)(module)];
173
+ return [getNexusInstallData(module)];
213
174
  }
214
175
  case 'kernel': {
215
- return (0, kernel_1.getInstallData)(module);
176
+ return getKernelInstallData(module);
216
177
  }
217
178
  case 'startale': {
218
- return [(0, startale_1.getInstallData)(module)];
179
+ return [getStartaleInstallData(module)];
219
180
  }
220
181
  case 'passport': {
221
- return [(0, passport_1.getInstallData)(module)];
182
+ return [getPassportInstallData(module)];
222
183
  }
223
184
  case 'eoa': {
224
- throw new error_1.ModuleInstallationNotSupportedError(account.type);
185
+ throw new ModuleInstallationNotSupportedError(account.type);
225
186
  }
226
187
  }
227
188
  }
@@ -234,7 +195,7 @@ function getModuleInstallationCalls(config, module) {
234
195
  }
235
196
  function getModuleUninstallationCalls(config, module) {
236
197
  const address = getAddress(config);
237
- const data = (0, viem_1.encodeFunctionData)({
198
+ const data = encodeFunctionData({
238
199
  abi: [
239
200
  {
240
201
  type: 'function',
@@ -265,30 +226,30 @@ function getModuleUninstallationCalls(config, module) {
265
226
  function getAddress(config) {
266
227
  if (is7702(config)) {
267
228
  if (!config.eoa) {
268
- throw new error_1.Eip7702AccountMustHaveEoaError();
229
+ throw new Eip7702AccountMustHaveEoaError();
269
230
  }
270
231
  return config.eoa.address;
271
232
  }
272
233
  const account = getAccountProvider(config);
273
234
  switch (account.type) {
274
235
  case 'safe': {
275
- return (0, safe_1.getAddress)(config);
236
+ return getSafeAddress(config);
276
237
  }
277
238
  case 'nexus': {
278
- return (0, nexus_1.getAddress)(config);
239
+ return getNexusAddress(config);
279
240
  }
280
241
  case 'kernel': {
281
- return (0, kernel_1.getAddress)(config);
242
+ return getKernelAddress(config);
282
243
  }
283
244
  case 'startale': {
284
- return (0, startale_1.getAddress)(config);
245
+ return getStartaleAddress(config);
285
246
  }
286
247
  case 'passport': {
287
- return (0, passport_1.getAddress)(config);
248
+ return getPassportAddress(config);
288
249
  }
289
250
  case 'eoa': {
290
251
  if (!config.eoa) {
291
- throw new error_1.AccountError({
252
+ throw new AccountError({
292
253
  message: 'EOA account must have an EOA configured',
293
254
  });
294
255
  }
@@ -309,33 +270,33 @@ function checkAddress(config) {
309
270
  // Signs and packs a signature to be EIP-1271 compatible
310
271
  async function getEip1271Signature(config, signers, chain, validator, hash, transformSignature = (signature) => signature) {
311
272
  if (config.account?.type === 'eoa') {
312
- throw new error_1.EoaSigningNotSupportedError('packed signatures');
273
+ throw new EoaSigningNotSupportedError('packed signatures');
313
274
  }
314
- signers = signers ?? (0, common_1.convertOwnerSetToSignerSet)(config.owners);
315
- const signFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, false);
275
+ signers = signers ?? convertOwnerSetToSignerSet(config.owners);
276
+ const signFn = (hash) => signMessage(signers, chain, address, hash, false);
316
277
  const account = getAccountProvider(config);
317
278
  const address = getAddress(config);
318
279
  switch (account.type) {
319
280
  case 'safe': {
320
281
  const signature = await signFn(hash);
321
- return (0, safe_1.packSignature)(signature, validator, transformSignature);
282
+ return packSafeSignature(signature, validator, transformSignature);
322
283
  }
323
284
  case 'nexus': {
324
285
  const signature = await signFn(hash);
325
- const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
326
- return (0, nexus_1.packSignature)(signature, validator, transformSignature, defaultValidatorAddress);
286
+ const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
287
+ return packNexusSignature(signature, validator, transformSignature, defaultValidatorAddress);
327
288
  }
328
289
  case 'passport': {
329
290
  const signature = await signFn(hash);
330
- return (0, passport_1.packSignature)(signature, validator, transformSignature);
291
+ return packPassportSignature(signature, validator, transformSignature);
331
292
  }
332
293
  case 'kernel': {
333
- const signature = await signFn((0, kernel_1.wrapMessageHash)(hash, address));
334
- return (0, kernel_1.packSignature)(signature, validator, transformSignature);
294
+ const signature = await signFn(wrapKernelMessageHash(hash, address));
295
+ return packKernelSignature(signature, validator, transformSignature);
335
296
  }
336
297
  case 'startale': {
337
298
  const signature = await signFn(hash);
338
- return (0, startale_1.packSignature)(signature, validator, transformSignature);
299
+ return packStartaleSignature(signature, validator, transformSignature);
339
300
  }
340
301
  default: {
341
302
  throw new Error(`Unsupported account type: ${account.type}`);
@@ -345,46 +306,46 @@ async function getEip1271Signature(config, signers, chain, validator, hash, tran
345
306
  // Signs and packs a signature to be used by the emissary validator
346
307
  async function getEmissarySignature(config, signers, chain, hash, transformSignature = (signature) => signature) {
347
308
  if (config.account?.type === 'eoa') {
348
- throw new error_1.EoaSigningNotSupportedError('packed signatures');
309
+ throw new EoaSigningNotSupportedError('packed signatures');
349
310
  }
350
- signers = signers ?? (0, common_1.convertOwnerSetToSignerSet)(config.owners);
311
+ signers = signers ?? convertOwnerSetToSignerSet(config.owners);
351
312
  const address = getAddress(config);
352
- const signFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, false);
313
+ const signFn = (hash) => signMessage(signers, chain, address, hash, false);
353
314
  const signature = await signFn(hash);
354
315
  return transformSignature(signature);
355
316
  }
356
317
  // Signs and packs a signature to be EIP-1271 compatible
357
318
  async function getTypedDataPackedSignature(config, signers, chain, validator, parameters, transformSignature = (signature) => signature) {
358
319
  if (config.account?.type === 'eoa') {
359
- throw new error_1.EoaSigningNotSupportedError('packed signatures');
320
+ throw new EoaSigningNotSupportedError('packed signatures');
360
321
  }
361
322
  const address = getAddress(config);
362
- signers = signers ?? (0, common_1.convertOwnerSetToSignerSet)(config.owners);
363
- const signFn = (parameters) => (0, typedData_1.sign)(signers, chain, address, parameters);
323
+ signers = signers ?? convertOwnerSetToSignerSet(config.owners);
324
+ const signFn = (parameters) => signTypedData(signers, chain, address, parameters);
364
325
  const account = getAccountProvider(config);
365
326
  switch (account.type) {
366
327
  case 'safe': {
367
328
  const signature = await signFn(parameters);
368
- return (0, safe_1.packSignature)(signature, validator, transformSignature);
329
+ return packSafeSignature(signature, validator, transformSignature);
369
330
  }
370
331
  case 'nexus': {
371
332
  const signature = await signFn(parameters);
372
- const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
373
- return (0, nexus_1.packSignature)(signature, validator, transformSignature, defaultValidatorAddress);
333
+ const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
334
+ return packNexusSignature(signature, validator, transformSignature, defaultValidatorAddress);
374
335
  }
375
336
  case 'passport': {
376
337
  const signature = await signFn(parameters);
377
- return (0, passport_1.packSignature)(signature, validator, transformSignature);
338
+ return packPassportSignature(signature, validator, transformSignature);
378
339
  }
379
340
  case 'kernel': {
380
341
  const address = getAddress(config);
381
- const signMessageFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, false);
382
- const signature = await signMessageFn((0, kernel_1.wrapMessageHash)((0, viem_1.hashTypedData)(parameters), address));
383
- return (0, kernel_1.packSignature)(signature, validator, transformSignature);
342
+ const signMessageFn = (hash) => signMessage(signers, chain, address, hash, false);
343
+ const signature = await signMessageFn(wrapKernelMessageHash(hashTypedData(parameters), address));
344
+ return packKernelSignature(signature, validator, transformSignature);
384
345
  }
385
346
  case 'startale': {
386
347
  const signature = await signFn(parameters);
387
- return (0, startale_1.packSignature)(signature, validator, transformSignature);
348
+ return packStartaleSignature(signature, validator, transformSignature);
388
349
  }
389
350
  default: {
390
351
  throw new Error(`Unsupported account type: ${account.type}`);
@@ -396,9 +357,9 @@ async function isDeployed(config, chain) {
396
357
  if (account.type === 'eoa') {
397
358
  return true;
398
359
  }
399
- const publicClient = (0, viem_1.createPublicClient)({
360
+ const publicClient = createPublicClient({
400
361
  chain: chain,
401
- transport: (0, utils_1.createTransport)(chain, config.provider),
362
+ transport: createTransport(chain, config.provider),
402
363
  });
403
364
  const address = getAddress(config);
404
365
  const code = await publicClient.getCode({
@@ -407,7 +368,7 @@ async function isDeployed(config, chain) {
407
368
  if (!code) {
408
369
  return false;
409
370
  }
410
- return (0, viem_1.size)(code) > 0;
371
+ return size(code) > 0;
411
372
  }
412
373
  async function deploy(config, chain, params) {
413
374
  const deployed = await isDeployed(config, chain);
@@ -420,7 +381,7 @@ async function deploy(config, chain, params) {
420
381
  }
421
382
  const deployArgs = getDeployArgs(config);
422
383
  if (!deployArgs) {
423
- throw new error_1.FactoryArgsNotAvailableError();
384
+ throw new FactoryArgsNotAvailableError();
424
385
  }
425
386
  const intentExecutorInstalled = 'intentExecutorInstalled' in deployArgs
426
387
  ? deployArgs.intentExecutorInstalled
@@ -445,10 +406,10 @@ async function setup(config, chain) {
445
406
  if (account.type === 'eoa') {
446
407
  return false;
447
408
  }
448
- const modules = (0, modules_1.getSetup)(config);
449
- const publicClient = (0, viem_1.createPublicClient)({
409
+ const modules = getSetup(config);
410
+ const publicClient = createPublicClient({
450
411
  chain,
451
- transport: (0, utils_1.createTransport)(chain, config.provider),
412
+ transport: createTransport(chain, config.provider),
452
413
  });
453
414
  const address = getAddress(config);
454
415
  const allModules = [
@@ -489,24 +450,24 @@ async function setup(config, chain) {
489
450
  calls.push(...getModuleInstallationCalls(config, module));
490
451
  }
491
452
  // Select the transaction infra layer based on the intent executor status
492
- const intentExecutor = (0, modules_1.getIntentExecutor)(config);
453
+ const intentExecutor = getIntentExecutor(config);
493
454
  const hasIntentExecutor = modulesToInstall.every((module) => module.address !== intentExecutor.address);
494
455
  let result;
495
456
  if (hasIntentExecutor) {
496
- result = await (0, execution_1.sendTransactionInternal)(config, [chain], chain, {
457
+ result = await sendTransactionInternal(config, [chain], chain, {
497
458
  callInputs: calls,
498
459
  });
499
460
  }
500
461
  else {
501
- result = await (0, execution_1.sendUserOperationInternal)(config, chain, calls);
462
+ result = await sendUserOperationInternal(config, chain, calls);
502
463
  }
503
- await (0, execution_1.waitForExecution)(config, result, true);
464
+ await waitForExecution(config, result, true);
504
465
  return true;
505
466
  }
506
467
  async function deployWithIntent(chain, config, sponsored, eip7702InitSignature) {
507
- const publicClient = (0, viem_1.createPublicClient)({
468
+ const publicClient = createPublicClient({
508
469
  chain,
509
- transport: (0, utils_1.createTransport)(chain, config.provider),
470
+ transport: createTransport(chain, config.provider),
510
471
  });
511
472
  const address = getAddress(config);
512
473
  const code = await publicClient.getCode({ address });
@@ -519,25 +480,25 @@ async function deployWithIntent(chain, config, sponsored, eip7702InitSignature)
519
480
  if (!initSignature && is7702(config)) {
520
481
  initSignature = await signEip7702InitData(config);
521
482
  }
522
- const result = await (0, execution_1.sendTransaction)(config, {
483
+ const result = await sendTransaction(config, {
523
484
  sourceChains: [chain],
524
485
  targetChain: chain,
525
486
  calls: [],
526
487
  sponsored,
527
488
  eip7702InitSignature: initSignature,
528
489
  });
529
- await (0, execution_1.waitForExecution)(config, result, true);
490
+ await waitForExecution(config, result, true);
530
491
  }
531
492
  async function deployWithBundler(chain, config) {
532
- const publicClient = (0, viem_1.createPublicClient)({
493
+ const publicClient = createPublicClient({
533
494
  chain,
534
- transport: (0, utils_1.createTransport)(chain, config.provider),
495
+ transport: createTransport(chain, config.provider),
535
496
  });
536
- const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
497
+ const bundlerClient = getBundlerClient(config, publicClient);
537
498
  const smartAccount = await getSmartAccount(config, publicClient, chain);
538
499
  const deployArgs = getDeployArgs(config);
539
500
  if (!deployArgs) {
540
- throw new error_1.FactoryArgsNotAvailableError();
501
+ throw new FactoryArgsNotAvailableError();
541
502
  }
542
503
  const { factory, factoryData } = deployArgs;
543
504
  const opHash = await bundlerClient.sendUserOperation({
@@ -546,7 +507,7 @@ async function deployWithBundler(chain, config) {
546
507
  factoryData,
547
508
  calls: [
548
509
  {
549
- to: viem_1.zeroAddress,
510
+ to: zeroAddress,
550
511
  value: 0n,
551
512
  data: '0x',
552
513
  },
@@ -564,16 +525,16 @@ async function toErc6492Signature(config, signature, chain) {
564
525
  // Account is not deployed, use ERC-6492
565
526
  const initCode = getInitCode(config);
566
527
  if (!initCode) {
567
- throw new error_1.FactoryArgsNotAvailableError();
528
+ throw new FactoryArgsNotAvailableError();
568
529
  }
569
530
  const deployArgs = getDeployArgs(config);
570
531
  if (!deployArgs) {
571
- throw new error_1.FactoryArgsNotAvailableError();
532
+ throw new FactoryArgsNotAvailableError();
572
533
  }
573
534
  const { factory, factoryData } = deployArgs;
574
535
  const magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';
575
- return (0, viem_1.concat)([
576
- (0, viem_1.encodeAbiParameters)([
536
+ return concat([
537
+ encodeAbiParameters([
577
538
  { name: 'create2Factory', type: 'address' },
578
539
  { name: 'factoryCalldata', type: 'bytes' },
579
540
  { name: 'originalERC1271Signature', type: 'bytes' },
@@ -587,33 +548,33 @@ async function getSmartAccount(config, client, chain) {
587
548
  throw new Error('getSmartAccount is not supported for EOA accounts');
588
549
  }
589
550
  if (!config.owners) {
590
- throw new error_1.OwnersFieldRequiredError();
551
+ throw new OwnersFieldRequiredError();
591
552
  }
592
553
  const account = getAccountProvider(config);
593
554
  const address = getAddress(config);
594
- const ownerValidator = (0, validators_1.getOwnerValidator)(config);
595
- const signers = (0, common_1.convertOwnerSetToSignerSet)(config.owners);
596
- const signFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, true);
555
+ const ownerValidator = getOwnerValidator(config);
556
+ const signers = convertOwnerSetToSignerSet(config.owners);
557
+ const signFn = (hash) => signMessage(signers, chain, address, hash, true);
597
558
  switch (account.type) {
598
559
  case 'safe': {
599
- return (0, safe_1.getSmartAccount)(client, address, config.owners, ownerValidator.address, signFn);
560
+ return getSafeSmartAccount(client, address, config.owners, ownerValidator.address, signFn);
600
561
  }
601
562
  case 'nexus': {
602
- const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
603
- return (0, nexus_1.getSmartAccount)(client, address, config.owners, ownerValidator.address, signFn, defaultValidatorAddress);
563
+ const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
564
+ return getNexusSmartAccount(client, address, config.owners, ownerValidator.address, signFn, defaultValidatorAddress);
604
565
  }
605
566
  case 'kernel': {
606
- return (0, kernel_1.getSmartAccount)(client, address, config.owners, ownerValidator.address, signFn);
567
+ return getKernelSmartAccount(client, address, config.owners, ownerValidator.address, signFn);
607
568
  }
608
569
  case 'startale': {
609
- return (0, startale_1.getSmartAccount)(client, address, config.owners, ownerValidator.address, signFn);
570
+ return getStartaleSmartAccount(client, address, config.owners, ownerValidator.address, signFn);
610
571
  }
611
572
  }
612
573
  }
613
574
  async function getGuardianSmartAccount(config, client, chain, guardians) {
614
575
  const address = getAddress(config);
615
576
  const accounts = guardians.type === 'ecdsa' ? guardians.accounts : [];
616
- const socialRecoveryValidator = (0, core_1.getSocialRecoveryValidator)(accounts);
577
+ const socialRecoveryValidator = getSocialRecoveryValidator(accounts);
617
578
  if (!socialRecoveryValidator) {
618
579
  throw new Error('Social recovery is not available');
619
580
  }
@@ -621,21 +582,21 @@ async function getGuardianSmartAccount(config, client, chain, guardians) {
621
582
  type: 'guardians',
622
583
  guardians: accounts,
623
584
  };
624
- const signFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, true);
585
+ const signFn = (hash) => signMessage(signers, chain, address, hash, true);
625
586
  const account = getAccountProvider(config);
626
587
  switch (account.type) {
627
588
  case 'safe': {
628
- return (0, safe_1.getGuardianSmartAccount)(client, address, guardians, socialRecoveryValidator.address, signFn);
589
+ return getSafeGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
629
590
  }
630
591
  case 'nexus': {
631
- const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
632
- return (0, nexus_1.getGuardianSmartAccount)(client, address, guardians, socialRecoveryValidator.address, signFn, defaultValidatorAddress);
592
+ const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
593
+ return getNexusGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn, defaultValidatorAddress);
633
594
  }
634
595
  case 'kernel': {
635
- return (0, kernel_1.getGuardianSmartAccount)(client, address, guardians, socialRecoveryValidator.address, signFn);
596
+ return getKernelGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
636
597
  }
637
598
  case 'startale': {
638
- return (0, startale_1.getGuardianSmartAccount)(client, address, guardians, socialRecoveryValidator.address, signFn);
599
+ return getStartaleGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
639
600
  }
640
601
  }
641
602
  }
@@ -651,3 +612,6 @@ function getAccountProvider(config) {
651
612
  type: 'nexus',
652
613
  };
653
614
  }
615
+ export { getEip712Domain, getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getGuardianSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature,
616
+ // Errors
617
+ isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
@@ -1,5 +1,5 @@
1
1
  import { type Chain, type Transport } from 'viem';
2
- import type { ProviderConfig } from '../../types';
2
+ import type { ProviderConfig } from '../../types.js';
3
3
  declare function createTransport(chain: Chain, provider?: ProviderConfig): Transport;
4
4
  export { createTransport };
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1,21 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTransport = createTransport;
4
- const viem_1 = require("viem");
5
- const providers_1 = require("./providers");
1
+ import { http } from 'viem';
2
+ import { getAlchemyUrl, getCustomUrl } from './providers.js';
6
3
  function createTransport(chain, provider) {
7
4
  if (!provider) {
8
- return (0, viem_1.http)();
5
+ return http();
9
6
  }
10
7
  switch (provider.type) {
11
8
  case 'alchemy': {
12
- const alchemyUrl = (0, providers_1.getAlchemyUrl)(chain.id, provider.apiKey);
13
- return (0, viem_1.http)(alchemyUrl);
9
+ const alchemyUrl = getAlchemyUrl(chain.id, provider.apiKey);
10
+ return http(alchemyUrl);
14
11
  }
15
12
  case 'custom': {
16
- const customUrl = (0, providers_1.getCustomUrl)(chain.id, provider.urls);
13
+ const customUrl = getCustomUrl(chain.id, provider.urls);
17
14
  // Fall back to default provider if no custom URL configured for this chain
18
- return (0, viem_1.http)(customUrl);
15
+ return http(customUrl);
19
16
  }
20
17
  }
21
18
  }
19
+ export { createTransport };
@@ -1,4 +1,4 @@
1
- import type { SupportedChain } from '../../orchestrator';
1
+ import type { SupportedChain } from '../../orchestrator/index.js';
2
2
  declare function getAlchemyUrl(chainId: SupportedChain, apiKey: string): string;
3
3
  declare function getCustomUrl(chainId: number, urls: Record<number, string>): string | undefined;
4
4
  export { getAlchemyUrl, getCustomUrl };