@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,54 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.UnauthorizedError = exports.UnprocessableEntityError = exports.SimulationFailedError = exports.ServiceUnavailableError = exports.SchemaValidationError = exports.RateLimitedError = exports.ResourceNotFoundError = exports.InternalServerError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientLiquidityError = exports.InsufficientBalanceError = exports.ForbiddenError = exports.ConflictError = exports.BodyParserError = exports.BadRequestError = exports.AuthenticationRequiredError = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.SignerNotSupportedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = exports.WalletClientNoConnectedAccountError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.EoaAccountMustHaveAccountError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
4
- const accounts_1 = require("../accounts");
5
- Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return accounts_1.AccountConfigurationNotSupportedError; } });
6
- Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
7
- Object.defineProperty(exports, "Eip712DomainNotAvailableError", { enumerable: true, get: function () { return accounts_1.Eip712DomainNotAvailableError; } });
8
- Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return accounts_1.Eip7702AccountMustHaveEoaError; } });
9
- Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return accounts_1.Eip7702NotSupportedForAccountError; } });
10
- Object.defineProperty(exports, "EoaAccountMustHaveAccountError", { enumerable: true, get: function () { return accounts_1.EoaAccountMustHaveAccountError; } });
11
- Object.defineProperty(exports, "ExistingEip7702AccountsNotSupportedError", { enumerable: true, get: function () { return accounts_1.ExistingEip7702AccountsNotSupportedError; } });
12
- Object.defineProperty(exports, "FactoryArgsNotAvailableError", { enumerable: true, get: function () { return accounts_1.FactoryArgsNotAvailableError; } });
13
- Object.defineProperty(exports, "isAccountError", { enumerable: true, get: function () { return accounts_1.isAccountError; } });
14
- Object.defineProperty(exports, "SigningNotSupportedForAccountError", { enumerable: true, get: function () { return accounts_1.SigningNotSupportedForAccountError; } });
15
- Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: true, get: function () { return accounts_1.SmartSessionsNotEnabledError; } });
16
- Object.defineProperty(exports, "WalletClientNoConnectedAccountError", { enumerable: true, get: function () { return accounts_1.WalletClientNoConnectedAccountError; } });
17
- const execution_1 = require("../execution");
18
- Object.defineProperty(exports, "ExecutionError", { enumerable: true, get: function () { return execution_1.ExecutionError; } });
19
- Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: function () { return execution_1.IntentFailedError; } });
20
- Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return execution_1.isExecutionError; } });
21
- Object.defineProperty(exports, "OrderPathRequiredForIntentsError", { enumerable: true, get: function () { return execution_1.OrderPathRequiredForIntentsError; } });
22
- Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true, get: function () { return execution_1.SessionChainRequiredError; } });
23
- Object.defineProperty(exports, "SignerNotSupportedError", { enumerable: true, get: function () { return execution_1.SignerNotSupportedError; } });
24
- const orchestrator_1 = require("../orchestrator");
25
- Object.defineProperty(exports, "AuthenticationRequiredError", { enumerable: true, get: function () { return orchestrator_1.AuthenticationRequiredError; } });
26
- Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return orchestrator_1.BadRequestError; } });
27
- Object.defineProperty(exports, "BodyParserError", { enumerable: true, get: function () { return orchestrator_1.BodyParserError; } });
28
- Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return orchestrator_1.ConflictError; } });
29
- Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return orchestrator_1.ForbiddenError; } });
30
- Object.defineProperty(exports, "InsufficientBalanceError", { enumerable: true, get: function () { return orchestrator_1.InsufficientBalanceError; } });
31
- Object.defineProperty(exports, "InsufficientLiquidityError", { enumerable: true, get: function () { return orchestrator_1.InsufficientLiquidityError; } });
32
- Object.defineProperty(exports, "IntentNotFoundError", { enumerable: true, get: function () { return orchestrator_1.IntentNotFoundError; } });
33
- Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return orchestrator_1.InternalServerError; } });
34
- Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return orchestrator_1.InvalidApiKeyError; } });
35
- Object.defineProperty(exports, "InvalidIntentSignatureError", { enumerable: true, get: function () { return orchestrator_1.InvalidIntentSignatureError; } });
36
- Object.defineProperty(exports, "isAuthError", { enumerable: true, get: function () { return orchestrator_1.isAuthError; } });
37
- Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return orchestrator_1.isOrchestratorError; } });
38
- Object.defineProperty(exports, "isRateLimited", { enumerable: true, get: function () { return orchestrator_1.isRateLimited; } });
39
- Object.defineProperty(exports, "isRetryable", { enumerable: true, get: function () { return orchestrator_1.isRetryable; } });
40
- Object.defineProperty(exports, "isValidationError", { enumerable: true, get: function () { return orchestrator_1.isValidationError; } });
41
- Object.defineProperty(exports, "NoPathFoundError", { enumerable: true, get: function () { return orchestrator_1.NoPathFoundError; } });
42
- Object.defineProperty(exports, "OnlyOneTargetTokenAmountCanBeUnsetError", { enumerable: true, get: function () { return orchestrator_1.OnlyOneTargetTokenAmountCanBeUnsetError; } });
43
- Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return orchestrator_1.OrchestratorError; } });
44
- Object.defineProperty(exports, "RateLimitedError", { enumerable: true, get: function () { return orchestrator_1.RateLimitedError; } });
45
- Object.defineProperty(exports, "ResourceNotFoundError", { enumerable: true, get: function () { return orchestrator_1.ResourceNotFoundError; } });
46
- Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return orchestrator_1.SchemaValidationError; } });
47
- Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return orchestrator_1.ServiceUnavailableError; } });
48
- Object.defineProperty(exports, "SimulationFailedError", { enumerable: true, get: function () { return orchestrator_1.SimulationFailedError; } });
49
- Object.defineProperty(exports, "TokenNotSupportedError", { enumerable: true, get: function () { return orchestrator_1.TokenNotSupportedError; } });
50
- Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return orchestrator_1.UnauthorizedError; } });
51
- Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return orchestrator_1.UnprocessableEntityError; } });
52
- Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get: function () { return orchestrator_1.UnsupportedChainError; } });
53
- Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return orchestrator_1.UnsupportedChainIdError; } });
54
- Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return orchestrator_1.UnsupportedTokenError; } });
1
+ import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, } from '../accounts/index.js';
2
+ import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, } from '../execution/index.js';
3
+ import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, } from '../orchestrator/index.js';
4
+ export {
5
+ // Account
6
+ isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, EoaAccountMustHaveAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, WalletClientNoConnectedAccountError,
7
+ // Execution
8
+ isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError,
9
+ // Orchestrator
10
+ isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
@@ -1,5 +1,5 @@
1
1
  import { type Hex } from 'viem';
2
- import type { IntentOp, IntentOpElement } from '../orchestrator/types';
2
+ import type { IntentOp, IntentOpElement } from '../orchestrator/types.js';
3
3
  declare const SCOPE_MULTICHAIN = 0;
4
4
  declare const RESET_PERIOD_ONE_WEEK = 6;
5
5
  declare const COMPACT_ADDRESS = "0x00000000000000171ede64904551eeDF3C6C9788";
@@ -125,8 +125,8 @@ declare function getCompactTypedData(intentOp: IntentOp): {
125
125
  fillExpiry: bigint;
126
126
  };
127
127
  minGas: bigint;
128
- originOps: import("../orchestrator/types").Op;
129
- destOps: import("../orchestrator/types").Op;
128
+ originOps: import("../orchestrator/types.js").Op;
129
+ destOps: import("../orchestrator/types.js").Op;
130
130
  q: `0x${string}`;
131
131
  };
132
132
  }[];
@@ -1,17 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMPACT_ADDRESS = exports.RESET_PERIOD_ONE_WEEK = exports.SCOPE_MULTICHAIN = void 0;
4
- exports.getCompactTypedData = getCompactTypedData;
5
- exports.getCompactDigest = getCompactDigest;
6
- exports.getPermit2Digest = getPermit2Digest;
7
- const viem_1 = require("viem");
8
- const permit2_1 = require("./permit2");
1
+ import { hashTypedData, keccak256, slice, toHex } from 'viem';
2
+ import { getTypedData as getPermit2TypedData } from './permit2.js';
9
3
  const SCOPE_MULTICHAIN = 0;
10
- exports.SCOPE_MULTICHAIN = SCOPE_MULTICHAIN;
11
4
  const RESET_PERIOD_ONE_WEEK = 6;
12
- exports.RESET_PERIOD_ONE_WEEK = RESET_PERIOD_ONE_WEEK;
13
5
  const COMPACT_ADDRESS = '0x00000000000000171ede64904551eeDF3C6C9788';
14
- exports.COMPACT_ADDRESS = COMPACT_ADDRESS;
15
6
  // Define the typed data structure as const to preserve type safety
16
7
  const COMPACT_TYPED_DATA_TYPES = {
17
8
  MultichainCompact: [
@@ -76,15 +67,15 @@ function getCompactTypedData(intentOp) {
76
67
  arbiter: element.arbiter,
77
68
  chainId: BigInt(element.chainId),
78
69
  commitments: element.idsAndAmounts.map((token) => ({
79
- lockTag: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 0, 12),
80
- token: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 12, 32),
70
+ lockTag: slice(toHex(BigInt(token[0])), 0, 12),
71
+ token: slice(toHex(BigInt(token[0])), 12, 32),
81
72
  amount: BigInt(token[1]),
82
73
  })),
83
74
  mandate: {
84
75
  target: {
85
76
  recipient: element.mandate.recipient,
86
77
  tokenOut: element.mandate.tokenOut.map((token) => ({
87
- token: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 12, 32),
78
+ token: slice(toHex(BigInt(token[0])), 12, 32),
88
79
  amount: BigInt(token[1]),
89
80
  })),
90
81
  targetChain: BigInt(element.mandate.destinationChainId),
@@ -93,7 +84,7 @@ function getCompactTypedData(intentOp) {
93
84
  minGas: BigInt(element.mandate.minGas),
94
85
  originOps: element.mandate.preClaimOps,
95
86
  destOps: element.mandate.destinationOps,
96
- q: (0, viem_1.keccak256)(element.mandate.qualifier.encodedVal),
87
+ q: keccak256(element.mandate.qualifier.encodedVal),
97
88
  },
98
89
  })),
99
90
  },
@@ -107,7 +98,7 @@ function getCompactTypedData(intentOp) {
107
98
  */
108
99
  function getCompactDigest(intentOp) {
109
100
  const typedData = getCompactTypedData(intentOp);
110
- return (0, viem_1.hashTypedData)(typedData);
101
+ return hashTypedData(typedData);
111
102
  }
112
103
  /**
113
104
  * Get the Permit2 digest for signing
@@ -115,6 +106,7 @@ function getCompactDigest(intentOp) {
115
106
  * @returns The digest hash
116
107
  */
117
108
  function getPermit2Digest(element, nonce, expires) {
118
- const typedData = (0, permit2_1.getTypedData)(element, nonce, expires);
119
- return (0, viem_1.hashTypedData)(typedData);
109
+ const typedData = getPermit2TypedData(element, nonce, expires);
110
+ return hashTypedData(typedData);
120
111
  }
112
+ export { SCOPE_MULTICHAIN, RESET_PERIOD_ONE_WEEK, COMPACT_ADDRESS, getCompactTypedData, getCompactDigest, getPermit2Digest, };
@@ -1,7 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SignerNotSupportedError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.Eip7702InitSignatureRequiredError = exports.ExecutionError = void 0;
4
- exports.isExecutionError = isExecutionError;
5
1
  class ExecutionError extends Error {
6
2
  _message;
7
3
  _context;
@@ -27,7 +23,6 @@ class ExecutionError extends Error {
27
23
  return this._traceId;
28
24
  }
29
25
  }
30
- exports.ExecutionError = ExecutionError;
31
26
  class SignerNotSupportedError extends ExecutionError {
32
27
  constructor(params) {
33
28
  super({
@@ -36,7 +31,6 @@ class SignerNotSupportedError extends ExecutionError {
36
31
  });
37
32
  }
38
33
  }
39
- exports.SignerNotSupportedError = SignerNotSupportedError;
40
34
  class OrderPathRequiredForIntentsError extends ExecutionError {
41
35
  constructor(params) {
42
36
  super({
@@ -45,7 +39,6 @@ class OrderPathRequiredForIntentsError extends ExecutionError {
45
39
  });
46
40
  }
47
41
  }
48
- exports.OrderPathRequiredForIntentsError = OrderPathRequiredForIntentsError;
49
42
  class SessionChainRequiredError extends ExecutionError {
50
43
  constructor(params) {
51
44
  super({
@@ -54,7 +47,6 @@ class SessionChainRequiredError extends ExecutionError {
54
47
  });
55
48
  }
56
49
  }
57
- exports.SessionChainRequiredError = SessionChainRequiredError;
58
50
  class IntentFailedError extends ExecutionError {
59
51
  constructor(params) {
60
52
  super({
@@ -63,7 +55,6 @@ class IntentFailedError extends ExecutionError {
63
55
  });
64
56
  }
65
57
  }
66
- exports.IntentFailedError = IntentFailedError;
67
58
  class IntentStatusTimeoutError extends ExecutionError {
68
59
  constructor(params) {
69
60
  super({
@@ -72,7 +63,6 @@ class IntentStatusTimeoutError extends ExecutionError {
72
63
  });
73
64
  }
74
65
  }
75
- exports.IntentStatusTimeoutError = IntentStatusTimeoutError;
76
66
  class Eip7702InitSignatureRequiredError extends ExecutionError {
77
67
  constructor(params) {
78
68
  super({
@@ -81,7 +71,7 @@ class Eip7702InitSignatureRequiredError extends ExecutionError {
81
71
  });
82
72
  }
83
73
  }
84
- exports.Eip7702InitSignatureRequiredError = Eip7702InitSignatureRequiredError;
85
74
  function isExecutionError(error) {
86
75
  return error instanceof ExecutionError;
87
76
  }
77
+ export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, IntentStatusTimeoutError, SignerNotSupportedError, };
@@ -1,10 +1,11 @@
1
1
  import { type Address, type Chain, type Hex } from 'viem';
2
2
  import type { UserOperationReceipt } from 'viem/_types/account-abstraction';
3
- import { type IntentOpStatus, type SplitIntentsInput } from '../orchestrator';
4
- import type { SettlementLayer } from '../orchestrator/types';
5
- import type { CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, Sponsorship, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types';
6
- import { ExecutionError, IntentFailedError, IntentStatusTimeoutError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError } from './error';
7
- import type { TransactionResult, UserOperationResult } from './utils';
3
+ import { type AuthProvider } from '../auth/provider.js';
4
+ import { type IntentOpStatus, type SplitIntentsInput } from '../orchestrator/index.js';
5
+ import type { SettlementLayer } from '../orchestrator/types.js';
6
+ import type { CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, Sponsorship, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types.js';
7
+ import { ExecutionError, IntentFailedError, IntentStatusTimeoutError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError } from './error.js';
8
+ import type { TransactionResult, UserOperationResult } from './utils.js';
8
9
  interface TransactionStatus {
9
10
  fill: {
10
11
  hash: Hex | undefined;
@@ -32,11 +33,11 @@ declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains:
32
33
  }): Promise<TransactionResult>;
33
34
  declare function sendUserOperationInternal(config: RhinestoneConfig, chain: Chain, callInputs: CalldataInput[], signers?: SignerSet): Promise<UserOperationResult>;
34
35
  declare function waitForExecution(config: RhinestoneConfig, result: TransactionResult | UserOperationResult, acceptsPreconfirmations: boolean): Promise<TransactionStatus | UserOperationReceipt>;
35
- declare function getPortfolio(config: RhinestoneConfig, onTestnets: boolean): Promise<import("../orchestrator").Portfolio>;
36
- declare function getIntentStatus(apiKey: string | undefined, endpointUrl: string | undefined, intentId: bigint, headers?: Record<string, string>): Promise<TransactionStatus & {
36
+ declare function getPortfolio(config: RhinestoneConfig, onTestnets: boolean): Promise<import("../orchestrator/index.js").Portfolio>;
37
+ declare function getIntentStatus(authProvider: AuthProvider, endpointUrl: string | undefined, intentId: bigint, headers?: Record<string, string>): Promise<TransactionStatus & {
37
38
  status: IntentOpStatus['status'];
38
39
  }>;
39
- declare function splitIntents(apiKey: string | undefined, endpointUrl: string | undefined, input: SplitIntentsInput, headers?: Record<string, string>): Promise<import("../orchestrator").SplitIntentsResult>;
40
+ declare function splitIntents(authProvider: AuthProvider, endpointUrl: string | undefined, input: SplitIntentsInput, headers?: Record<string, string>): Promise<import("../orchestrator/index.js").SplitIntentsResult>;
40
41
  export { sendTransaction, sendTransactionInternal, sendUserOperation, sendUserOperationInternal, waitForExecution, getPortfolio, getIntentStatus, splitIntents, isExecutionError, ExecutionError, IntentFailedError, IntentStatusTimeoutError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, };
41
42
  export type { TransactionStatus, TransactionResult, UserOperationResult };
42
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAG3E,OAAO,EAML,KAAK,cAAc,EAGnB,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAA;AAMxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,wBAAwB,EACzB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAoBrE,UAAU,iBAAiB;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,GAAG,GAAG,SAAS,CAAA;QACrB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,GAAG,SAAS,CAA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
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SignerNotSupportedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = void 0;
4
- exports.sendTransaction = sendTransaction;
5
- exports.sendTransactionInternal = sendTransactionInternal;
6
- exports.sendUserOperation = sendUserOperation;
7
- exports.sendUserOperationInternal = sendUserOperationInternal;
8
- exports.waitForExecution = waitForExecution;
9
- exports.getPortfolio = getPortfolio;
10
- exports.getIntentStatus = getIntentStatus;
11
- exports.splitIntents = splitIntents;
12
- const viem_1 = require("viem");
13
- const accounts_1 = require("../accounts");
14
- const utils_1 = require("../accounts/utils");
15
- const orchestrator_1 = require("../orchestrator");
16
- const registry_1 = require("../orchestrator/registry");
17
- const error_1 = require("./error");
18
- Object.defineProperty(exports, "ExecutionError", { enumerable: true, get: function () { return error_1.ExecutionError; } });
19
- Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: function () { return error_1.IntentFailedError; } });
20
- Object.defineProperty(exports, "IntentStatusTimeoutError", { enumerable: true, get: function () { return error_1.IntentStatusTimeoutError; } });
21
- Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return error_1.isExecutionError; } });
22
- Object.defineProperty(exports, "OrderPathRequiredForIntentsError", { enumerable: true, get: function () { return error_1.OrderPathRequiredForIntentsError; } });
23
- Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true, get: function () { return error_1.SessionChainRequiredError; } });
24
- Object.defineProperty(exports, "SignerNotSupportedError", { enumerable: true, get: function () { return error_1.SignerNotSupportedError; } });
25
- const utils_2 = require("./utils");
1
+ import { createPublicClient } from 'viem';
2
+ import { deploy, getAddress } from '../accounts/index.js';
3
+ import { createTransport, getBundlerClient } from '../accounts/utils.js';
4
+ import { createAuthProvider } from '../auth/provider.js';
5
+ import { getOrchestrator, INTENT_STATUS_COMPLETED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PRECONFIRMED, isRateLimited, isRetryable, } from '../orchestrator/index.js';
6
+ import { getChainById, getSupportedChainIds, isTestnet, } from '../orchestrator/registry.js';
7
+ import { ExecutionError, IntentFailedError, IntentStatusTimeoutError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, } from './error.js';
8
+ import { getTargetExecutionSignature, getTokenRequests, getValidatorAccount, parseCalls, prepareTransactionAsIntent, resolveCallInputs, signAuthorizationsInternal, signIntent, submitIntentInternal, } from './utils.js';
26
9
  const POLL_INITIAL_MS = 500;
27
10
  const POLL_SLOW_AFTER_MS = 15000;
28
11
  const POLL_SLOW_MS = 2000;
@@ -35,7 +18,7 @@ async function sendTransaction(config, transaction) {
35
18
  const { calls, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, } = transaction;
36
19
  const isUserOpSigner = signers?.type === 'guardians';
37
20
  if (isUserOpSigner) {
38
- throw new error_1.SignerNotSupportedError();
21
+ throw new SignerNotSupportedError();
39
22
  }
40
23
  return await sendTransactionInternal(config, sourceChains, targetChain, {
41
24
  callInputs: calls,
@@ -51,17 +34,17 @@ async function sendTransaction(config, transaction) {
51
34
  });
52
35
  }
53
36
  async function sendUserOperation(config, transaction) {
54
- const accountAddress = (0, accounts_1.getAddress)(config);
55
- const resolvedCalls = await (0, utils_2.resolveCallInputs)(transaction.calls, config, transaction.chain, accountAddress);
37
+ const accountAddress = getAddress(config);
38
+ const resolvedCalls = await resolveCallInputs(transaction.calls, config, transaction.chain, accountAddress);
56
39
  return await sendUserOperationInternal(config, transaction.chain, resolvedCalls, transaction.signers);
57
40
  }
58
41
  async function sendTransactionInternal(config, sourceChains, targetChain, options) {
59
- const accountAddress = (0, accounts_1.getAddress)(config);
60
- const resolvedCalls = await (0, utils_2.resolveCallInputs)(options.callInputs, config, targetChain, accountAddress);
61
- const tokenRequests = (0, utils_2.getTokenRequests)(targetChain, options.initialTokenRequests);
42
+ const accountAddress = getAddress(config);
43
+ const resolvedCalls = await resolveCallInputs(options.callInputs, config, targetChain, accountAddress);
44
+ const tokenRequests = getTokenRequests(targetChain, options.initialTokenRequests);
62
45
  const sendAsUserOp = options.signers?.type === 'guardians';
63
46
  if (sendAsUserOp) {
64
- throw new error_1.SignerNotSupportedError();
47
+ throw new SignerNotSupportedError();
65
48
  }
66
49
  else {
67
50
  return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.eip7702InitSignature, options.settlementLayers, options.sourceAssets, options.feeAsset, options.lockFunds);
@@ -69,17 +52,17 @@ async function sendTransactionInternal(config, sourceChains, targetChain, option
69
52
  }
70
53
  async function sendUserOperationInternal(config, chain, callInputs, signers) {
71
54
  // Make sure the account is deployed
72
- await (0, accounts_1.deploy)(config, chain);
73
- const publicClient = (0, viem_1.createPublicClient)({
55
+ await deploy(config, chain);
56
+ const publicClient = createPublicClient({
74
57
  chain,
75
- transport: (0, utils_1.createTransport)(chain, config.provider),
58
+ transport: createTransport(chain, config.provider),
76
59
  });
77
- const validatorAccount = await (0, utils_2.getValidatorAccount)(config, signers, publicClient, chain);
60
+ const validatorAccount = await getValidatorAccount(config, signers, publicClient, chain);
78
61
  if (!validatorAccount) {
79
62
  throw new Error('No validator account found');
80
63
  }
81
- const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
82
- const calls = (0, utils_2.parseCalls)(callInputs, chain.id);
64
+ const bundlerClient = getBundlerClient(config, publicClient);
65
+ const calls = parseCalls(callInputs, chain.id);
83
66
  const hash = await bundlerClient.sendUserOperation({
84
67
  account: validatorAccount,
85
68
  calls,
@@ -91,25 +74,26 @@ async function sendUserOperationInternal(config, chain, callInputs, signers) {
91
74
  };
92
75
  }
93
76
  async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds) {
94
- const intentRoute = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, undefined, undefined, signers);
95
- if (!intentRoute) {
96
- throw new error_1.OrderPathRequiredForIntentsError();
77
+ const prepared = await prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, undefined, undefined, signers);
78
+ if (!prepared) {
79
+ throw new OrderPathRequiredForIntentsError();
97
80
  }
98
- const { originSignatures, destinationSignature } = await (0, utils_2.signIntent)(config, intentRoute.intentOp, targetChain, signers);
99
- const targetExecutionSignature = await (0, utils_2.getTargetExecutionSignature)(config, intentRoute.intentOp, targetChain, signers);
81
+ const { intentRoute, intentInput } = prepared;
82
+ const { originSignatures, destinationSignature } = await signIntent(config, intentRoute.intentOp, targetChain, signers);
83
+ const targetExecutionSignature = await getTargetExecutionSignature(config, intentRoute.intentOp, targetChain, signers);
100
84
  const authorizations = config.eoa
101
- ? await (0, utils_2.signAuthorizationsInternal)(config, intentRoute)
85
+ ? await signAuthorizationsInternal(config, intentRoute)
102
86
  : [];
103
- return await (0, utils_2.submitIntentInternal)(config, sourceChains, targetChain, intentRoute.intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, false);
87
+ return await submitIntentInternal(config, sourceChains, targetChain, intentRoute.intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, false, intentInput);
104
88
  }
105
89
  async function waitForExecution(config, result, acceptsPreconfirmations) {
106
90
  const validStatuses = new Set([
107
- orchestrator_1.INTENT_STATUS_FAILED,
108
- orchestrator_1.INTENT_STATUS_COMPLETED,
109
- orchestrator_1.INTENT_STATUS_FILLED,
91
+ INTENT_STATUS_FAILED,
92
+ INTENT_STATUS_COMPLETED,
93
+ INTENT_STATUS_FILLED,
110
94
  ]);
111
95
  if (acceptsPreconfirmations) {
112
- validStatuses.add(orchestrator_1.INTENT_STATUS_PRECONFIRMED);
96
+ validStatuses.add(INTENT_STATUS_PRECONFIRMED);
113
97
  }
114
98
  switch (result.type) {
115
99
  case 'intent': {
@@ -120,13 +104,13 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
120
104
  while (intentStatus === null || !validStatuses.has(intentStatus.status)) {
121
105
  const now = Date.now();
122
106
  if (now - startTs >= POLL_MAX_WAIT_MS) {
123
- throw new error_1.IntentStatusTimeoutError({
107
+ throw new IntentStatusTimeoutError({
124
108
  context: {
125
109
  intentId: result.id.toString(),
126
110
  },
127
111
  });
128
112
  }
129
- const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl, config.headers);
113
+ const orchestrator = getOrchestrator(config._authProvider ?? createAuthProvider(config), config.endpointUrl, config.headers);
130
114
  try {
131
115
  intentStatus = await orchestrator.getIntentOpStatus(result.id);
132
116
  // reset error backoff on success
@@ -137,7 +121,7 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
137
121
  await new Promise((resolve) => setTimeout(resolve, nextDelayMs));
138
122
  }
139
123
  catch (err) {
140
- if ((0, orchestrator_1.isRateLimited)(err)) {
124
+ if (isRateLimited(err)) {
141
125
  const retryAfter = err?.context?.retryAfter;
142
126
  let retryMs = nextDelayMs;
143
127
  if (retryAfter) {
@@ -158,7 +142,7 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
158
142
  await new Promise((resolve) => setTimeout(resolve, retryMs));
159
143
  continue;
160
144
  }
161
- if ((0, orchestrator_1.isRetryable)(err)) {
145
+ if (isRetryable(err)) {
162
146
  const backoff = Math.min(errorBackoffMs, POLL_ERROR_BACKOFF_MAX_MS);
163
147
  errorBackoffMs = Math.min(errorBackoffMs * 2, POLL_ERROR_BACKOFF_MAX_MS);
164
148
  await new Promise((resolve) => setTimeout(resolve, backoff));
@@ -167,9 +151,9 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
167
151
  throw err;
168
152
  }
169
153
  }
170
- if (intentStatus.status === orchestrator_1.INTENT_STATUS_FAILED) {
154
+ if (intentStatus.status === INTENT_STATUS_FAILED) {
171
155
  const intentId = result.id.toString();
172
- throw new error_1.IntentFailedError({
156
+ throw new IntentFailedError({
173
157
  context: {
174
158
  intentId,
175
159
  },
@@ -187,12 +171,12 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
187
171
  };
188
172
  }
189
173
  case 'userop': {
190
- const targetChain = (0, registry_1.getChainById)(result.chain);
191
- const publicClient = (0, viem_1.createPublicClient)({
174
+ const targetChain = getChainById(result.chain);
175
+ const publicClient = createPublicClient({
192
176
  chain: targetChain,
193
- transport: (0, utils_1.createTransport)(targetChain, config.provider),
177
+ transport: createTransport(targetChain, config.provider),
194
178
  });
195
- const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
179
+ const bundlerClient = getBundlerClient(config, publicClient);
196
180
  const receipt = await bundlerClient.waitForUserOperationReceipt({
197
181
  hash: result.hash,
198
182
  });
@@ -201,12 +185,12 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
201
185
  }
202
186
  }
203
187
  async function getPortfolio(config, onTestnets) {
204
- const address = (0, accounts_1.getAddress)(config);
205
- const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl, config.headers);
206
- const supportedChainIds = (0, registry_1.getSupportedChainIds)();
188
+ const address = getAddress(config);
189
+ const orchestrator = getOrchestrator(config._authProvider ?? createAuthProvider(config), config.endpointUrl, config.headers);
190
+ const supportedChainIds = getSupportedChainIds();
207
191
  const filteredChainIds = supportedChainIds.filter((id) => {
208
192
  try {
209
- return (0, registry_1.isTestnet)(id) === onTestnets;
193
+ return isTestnet(id) === onTestnets;
210
194
  }
211
195
  catch {
212
196
  return false;
@@ -214,8 +198,8 @@ async function getPortfolio(config, onTestnets) {
214
198
  });
215
199
  return orchestrator.getPortfolio(address, { chainIds: filteredChainIds });
216
200
  }
217
- async function getIntentStatus(apiKey, endpointUrl, intentId, headers) {
218
- const orchestrator = (0, orchestrator_1.getOrchestrator)(apiKey, endpointUrl, headers);
201
+ async function getIntentStatus(authProvider, endpointUrl, intentId, headers) {
202
+ const orchestrator = getOrchestrator(authProvider, endpointUrl, headers);
219
203
  const internalStatus = await orchestrator.getIntentOpStatus(intentId);
220
204
  return {
221
205
  status: internalStatus.status,
@@ -229,7 +213,10 @@ async function getIntentStatus(apiKey, endpointUrl, intentId, headers) {
229
213
  })),
230
214
  };
231
215
  }
232
- async function splitIntents(apiKey, endpointUrl, input, headers) {
233
- const orchestrator = (0, orchestrator_1.getOrchestrator)(apiKey, endpointUrl, headers);
216
+ async function splitIntents(authProvider, endpointUrl, input, headers) {
217
+ const orchestrator = getOrchestrator(authProvider, endpointUrl, headers);
234
218
  return orchestrator.splitIntents(input);
235
219
  }
220
+ export { sendTransaction, sendTransactionInternal, sendUserOperation, sendUserOperationInternal, waitForExecution, getPortfolio, getIntentStatus, splitIntents,
221
+ // Errors
222
+ isExecutionError, ExecutionError, IntentFailedError, IntentStatusTimeoutError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, };
@@ -1,7 +1,7 @@
1
1
  import { type Address, type Chain } from 'viem';
2
- import type { IntentOpElement } from '../orchestrator/types';
3
- import type { RhinestoneConfig } from '../types';
4
- import type { BatchPermit2Result, MultiChainPermit2Config, MultiChainPermit2Result, TokenPermissions } from './types';
2
+ import type { IntentOpElement } from '../orchestrator/types.js';
3
+ import type { RhinestoneConfig } from '../types.js';
4
+ import type { BatchPermit2Result, MultiChainPermit2Config, MultiChainPermit2Result, TokenPermissions } from './types.js';
5
5
  declare function getTypedData(element: IntentOpElement, nonce: bigint, expires: bigint): {
6
6
  readonly domain: {
7
7
  readonly name: "Permit2";
@@ -103,8 +103,8 @@ declare function getTypedData(element: IntentOpElement, nonce: bigint, expires:
103
103
  readonly fillExpiry: bigint;
104
104
  };
105
105
  readonly minGas: bigint;
106
- readonly originOps: import("../orchestrator/types").Op;
107
- readonly destOps: import("../orchestrator/types").Op;
106
+ readonly originOps: import("../orchestrator/types.js").Op;
107
+ readonly destOps: import("../orchestrator/types.js").Op;
108
108
  readonly q: `0x${string}`;
109
109
  };
110
110
  };
@@ -1,13 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTypedData = getTypedData;
4
- exports.checkERC20Allowance = checkERC20Allowance;
5
- exports.checkERC20AllowanceDirect = checkERC20AllowanceDirect;
6
- exports.getPermit2Address = getPermit2Address;
7
- exports.signPermit2Batch = signPermit2Batch;
8
- exports.signPermit2Sequential = signPermit2Sequential;
9
- const viem_1 = require("viem");
10
- const utils_1 = require("../accounts/utils");
1
+ import { createPublicClient, keccak256, } from 'viem';
2
+ import { createTransport } from '../accounts/utils.js';
11
3
  const PERMIT2_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3';
12
4
  function toToken(id) {
13
5
  return `0x${(id & ((1n << 160n) - 1n)).toString(16).padStart(40, '0')}`;
@@ -90,7 +82,7 @@ function getTypedData(element, nonce, expires) {
90
82
  minGas: BigInt(mandate.minGas),
91
83
  originOps: mandate.preClaimOps,
92
84
  destOps: mandate.destinationOps,
93
- q: (0, viem_1.keccak256)(mandate.qualifier.encodedVal),
85
+ q: keccak256(mandate.qualifier.encodedVal),
94
86
  },
95
87
  },
96
88
  };
@@ -124,9 +116,9 @@ async function checkERC20AllowanceDirect(owner, spender, tokenAddress, publicCli
124
116
  }
125
117
  async function checkERC20Allowance(tokenAddress, chain, config) {
126
118
  try {
127
- const publicClient = (0, viem_1.createPublicClient)({
119
+ const publicClient = createPublicClient({
128
120
  chain,
129
- transport: (0, utils_1.createTransport)(chain, config.provider),
121
+ transport: createTransport(chain, config.provider),
130
122
  });
131
123
  // Get the account owner from the config
132
124
  const owner = config.eoa?.address;
@@ -283,3 +275,6 @@ async function signPermit2Sequential(configs, onProgress) {
283
275
  allSuccessful: failedSignatures === 0,
284
276
  };
285
277
  }
278
+ export { getTypedData, checkERC20Allowance, checkERC20AllowanceDirect, getPermit2Address,
279
+ // Multi-chain permit2 signing methods
280
+ signPermit2Batch, signPermit2Sequential, };
@@ -1,5 +1,5 @@
1
1
  import type { Address } from 'viem';
2
- import type { IntentOpElement } from '../orchestrator/types';
2
+ import type { IntentOpElement } from '../orchestrator/types.js';
3
3
  declare function getTypedData(account: Address, intentExecutorAddress: Address, element: IntentOpElement, nonce: bigint): {
4
4
  domain: {
5
5
  name: string;
@@ -29,7 +29,7 @@ declare function getTypedData(account: Address, intentExecutorAddress: Address,
29
29
  message: {
30
30
  account: `0x${string}`;
31
31
  nonce: bigint;
32
- op: import("../orchestrator/types").Op;
32
+ op: import("../orchestrator/types.js").Op;
33
33
  gasRefund: {
34
34
  token: Address;
35
35
  exchangeRate: bigint;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTypedData = getTypedData;
4
1
  function getTypedData(account, intentExecutorAddress, element, nonce) {
5
2
  const { destinationChainId, destinationOps } = element.mandate;
6
3
  const gasRefund = element.mandate.qualifier.settlementContext.gasRefund;
@@ -42,3 +39,4 @@ function getTypedData(account, intentExecutorAddress, element, nonce) {
42
39
  },
43
40
  };
44
41
  }
42
+ export { getTypedData };
@@ -1,5 +1,5 @@
1
1
  import type { Account, Address, Chain, Hex } from 'viem';
2
- import type { IntentOp } from '../orchestrator/types';
2
+ import type { IntentOp } from '../orchestrator/types.js';
3
3
  interface TokenPermissions {
4
4
  token: Address;
5
5
  amount: bigint;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};