@charterlabs/rhinestone-sdk 0.2.7-dev.3 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +46 -8
  2. package/dist/src/accounts/error.d.ts +38 -3
  3. package/dist/src/accounts/error.d.ts.map +1 -1
  4. package/dist/src/accounts/error.js +55 -7
  5. package/dist/src/accounts/index.d.ts +31 -20
  6. package/dist/src/accounts/index.d.ts.map +1 -1
  7. package/dist/src/accounts/index.js +231 -25
  8. package/dist/src/accounts/index.test.js +2 -4
  9. package/dist/src/accounts/json-rpc/index.d.ts +5 -0
  10. package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
  11. package/dist/src/accounts/json-rpc/index.js +16 -0
  12. package/dist/src/accounts/json-rpc/providers.d.ts +4 -0
  13. package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
  14. package/dist/src/accounts/json-rpc/providers.js +52 -0
  15. package/dist/src/accounts/kernel.d.ts +1 -1
  16. package/dist/src/accounts/kernel.d.ts.map +1 -1
  17. package/dist/src/accounts/kernel.js +29 -1
  18. package/dist/src/accounts/kernel.test.js +35 -8
  19. package/dist/src/accounts/nexus.d.ts +4 -3
  20. package/dist/src/accounts/nexus.d.ts.map +1 -1
  21. package/dist/src/accounts/nexus.js +82 -14
  22. package/dist/src/accounts/nexus.test.js +33 -6
  23. package/dist/src/accounts/passport.d.ts +12 -0
  24. package/dist/src/accounts/passport.d.ts.map +1 -0
  25. package/dist/src/accounts/passport.js +173 -0
  26. package/dist/src/accounts/safe.d.ts.map +1 -1
  27. package/dist/src/accounts/safe.js +85 -53
  28. package/dist/src/accounts/safe.test.js +33 -6
  29. package/dist/src/accounts/signing/common.d.ts +4 -4
  30. package/dist/src/accounts/signing/common.d.ts.map +1 -1
  31. package/dist/src/accounts/signing/common.js +21 -9
  32. package/dist/src/accounts/signing/message.d.ts +1 -1
  33. package/dist/src/accounts/signing/message.d.ts.map +1 -1
  34. package/dist/src/accounts/signing/message.js +6 -6
  35. package/dist/src/accounts/signing/passkeys.d.ts +8 -1
  36. package/dist/src/accounts/signing/passkeys.d.ts.map +1 -1
  37. package/dist/src/accounts/signing/passkeys.js +35 -0
  38. package/dist/src/accounts/signing/passkeys.test.js +15 -0
  39. package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
  40. package/dist/src/accounts/signing/typedData.js +2 -2
  41. package/dist/src/accounts/startale.test.js +0 -4
  42. package/dist/src/accounts/utils.d.ts +4 -4
  43. package/dist/src/accounts/utils.d.ts.map +1 -1
  44. package/dist/src/accounts/utils.js +3 -40
  45. package/dist/src/accounts/walletClient.d.ts +7 -0
  46. package/dist/src/accounts/walletClient.d.ts.map +1 -0
  47. package/dist/src/accounts/walletClient.js +38 -0
  48. package/dist/src/actions/compact.d.ts +13 -0
  49. package/dist/src/actions/compact.d.ts.map +1 -0
  50. package/dist/src/actions/compact.js +210 -0
  51. package/dist/src/actions/ecdsa.d.ts +35 -0
  52. package/dist/src/actions/ecdsa.d.ts.map +1 -0
  53. package/dist/src/actions/ecdsa.js +114 -0
  54. package/dist/src/actions/ecdsa.test.d.ts +2 -0
  55. package/dist/src/actions/ecdsa.test.d.ts.map +1 -0
  56. package/dist/src/actions/ecdsa.test.js +99 -0
  57. package/dist/src/actions/index.d.ts +23 -166
  58. package/dist/src/actions/index.d.ts.map +1 -1
  59. package/dist/src/actions/index.js +25 -544
  60. package/dist/src/actions/mfa.d.ts +37 -0
  61. package/dist/src/actions/mfa.d.ts.map +1 -0
  62. package/dist/src/actions/mfa.js +133 -0
  63. package/dist/src/actions/passkeys.d.ts +37 -0
  64. package/dist/src/actions/passkeys.d.ts.map +1 -0
  65. package/dist/src/actions/passkeys.js +129 -0
  66. package/dist/src/actions/passkeys.test.d.ts +2 -0
  67. package/dist/src/actions/passkeys.test.d.ts.map +1 -0
  68. package/dist/src/actions/passkeys.test.js +54 -0
  69. package/dist/src/actions/recovery.d.ts +33 -0
  70. package/dist/src/actions/recovery.d.ts.map +1 -0
  71. package/dist/src/actions/recovery.js +193 -0
  72. package/dist/src/actions/recovery.test.d.ts +2 -0
  73. package/dist/src/actions/recovery.test.d.ts.map +1 -0
  74. package/dist/src/actions/recovery.test.js +168 -0
  75. package/dist/src/actions/smart-sessions.d.ts +23 -0
  76. package/dist/src/actions/smart-sessions.d.ts.map +1 -0
  77. package/dist/src/actions/{smart-session.js → smart-sessions.js} +13 -0
  78. package/dist/src/errors/index.d.ts +5 -0
  79. package/dist/src/errors/index.d.ts.map +1 -0
  80. package/dist/src/errors/index.js +50 -0
  81. package/dist/src/execution/compact.d.ts +25 -9
  82. package/dist/src/execution/compact.d.ts.map +1 -1
  83. package/dist/src/execution/compact.js +29 -103
  84. package/dist/src/execution/error.d.ts +6 -6
  85. package/dist/src/execution/error.d.ts.map +1 -1
  86. package/dist/src/execution/error.js +13 -13
  87. package/dist/src/execution/index.d.ts +34 -22
  88. package/dist/src/execution/index.d.ts.map +1 -1
  89. package/dist/src/execution/index.js +115 -46
  90. package/dist/src/execution/multiChainOps.d.ts +40 -0
  91. package/dist/src/execution/multiChainOps.d.ts.map +1 -0
  92. package/dist/src/execution/multiChainOps.js +39 -0
  93. package/dist/src/execution/permit2.d.ts +148 -0
  94. package/dist/src/execution/permit2.d.ts.map +1 -0
  95. package/dist/src/execution/permit2.js +291 -0
  96. package/dist/src/execution/smart-session.d.ts +3 -3
  97. package/dist/src/execution/smart-session.d.ts.map +1 -1
  98. package/dist/src/execution/smart-session.js +3 -3
  99. package/dist/src/execution/types.d.ts +36 -0
  100. package/dist/src/execution/types.d.ts.map +1 -0
  101. package/dist/src/execution/types.js +2 -0
  102. package/dist/src/execution/utils.d.ts +43 -28
  103. package/dist/src/execution/utils.d.ts.map +1 -1
  104. package/dist/src/execution/utils.js +269 -99
  105. package/dist/src/index.d.ts +38 -19
  106. package/dist/src/index.d.ts.map +1 -1
  107. package/dist/src/index.js +121 -69
  108. package/dist/src/modules/common.d.ts +10 -4
  109. package/dist/src/modules/common.d.ts.map +1 -1
  110. package/dist/src/modules/common.js +22 -1
  111. package/dist/src/modules/index.d.ts +3 -2
  112. package/dist/src/modules/index.d.ts.map +1 -1
  113. package/dist/src/modules/index.js +16 -13
  114. package/dist/src/modules/index.test.js +9 -12
  115. package/dist/src/modules/read.d.ts.map +1 -1
  116. package/dist/src/modules/read.js +5 -1
  117. package/dist/src/modules/validators/core.d.ts +5 -3
  118. package/dist/src/modules/validators/core.d.ts.map +1 -1
  119. package/dist/src/modules/validators/core.js +29 -10
  120. package/dist/src/modules/validators/core.test.js +4 -4
  121. package/dist/src/modules/validators/smart-sessions.d.ts +4 -4
  122. package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
  123. package/dist/src/modules/validators/smart-sessions.js +10 -72
  124. package/dist/src/modules/validators/smart-sessions.test.js +4 -8
  125. package/dist/src/modules/validators/webauthn-contract.d.ts.map +1 -1
  126. package/dist/src/orchestrator/client.d.ts +4 -2
  127. package/dist/src/orchestrator/client.d.ts.map +1 -1
  128. package/dist/src/orchestrator/client.js +230 -162
  129. package/dist/src/orchestrator/consts.d.ts +1 -2
  130. package/dist/src/orchestrator/consts.d.ts.map +1 -1
  131. package/dist/src/orchestrator/consts.js +1 -3
  132. package/dist/src/orchestrator/error.d.ts +111 -1
  133. package/dist/src/orchestrator/error.d.ts.map +1 -1
  134. package/dist/src/orchestrator/error.js +128 -1
  135. package/dist/src/orchestrator/index.d.ts +4 -4
  136. package/dist/src/orchestrator/index.d.ts.map +1 -1
  137. package/dist/src/orchestrator/index.js +16 -1
  138. package/dist/src/orchestrator/registry.d.ts +3 -25
  139. package/dist/src/orchestrator/registry.d.ts.map +1 -1
  140. package/dist/src/orchestrator/registry.js +82 -46
  141. package/dist/src/orchestrator/registry.test.js +7 -7
  142. package/dist/src/orchestrator/types.d.ts +53 -43
  143. package/dist/src/orchestrator/types.d.ts.map +1 -1
  144. package/dist/src/types.d.ts +74 -9
  145. package/dist/src/types.d.ts.map +1 -1
  146. package/dist/src/utils/index.d.ts +3 -0
  147. package/dist/src/utils/index.d.ts.map +1 -0
  148. package/dist/src/utils/index.js +5 -0
  149. package/package.json +73 -2
  150. package/dist/src/actions/index.test.d.ts +0 -2
  151. package/dist/src/actions/index.test.d.ts.map +0 -1
  152. package/dist/src/actions/index.test.js +0 -302
  153. package/dist/src/actions/smart-session.d.ts +0 -11
  154. package/dist/src/actions/smart-session.d.ts.map +0 -1
  155. package/dist/src/orchestrator/registry.json +0 -365
@@ -3,22 +3,26 @@ declare class OrchestratorError extends Error {
3
3
  private readonly _context;
4
4
  private readonly _errorType;
5
5
  private readonly _traceId;
6
+ private readonly _statusCode?;
6
7
  constructor(params?: {
7
8
  message?: string;
8
9
  context?: any;
9
10
  errorType?: string;
10
11
  traceId?: string;
12
+ statusCode?: number;
11
13
  });
12
14
  get message(): string;
13
15
  get context(): any;
14
16
  get errorType(): string;
15
17
  get traceId(): string;
18
+ get statusCode(): number | undefined;
16
19
  }
17
20
  declare class InsufficientBalanceError extends OrchestratorError {
18
21
  constructor(params?: {
19
22
  context?: any;
20
23
  errorType?: string;
21
24
  traceId?: string;
25
+ statusCode?: number;
22
26
  });
23
27
  }
24
28
  declare class UnsupportedChainIdError extends OrchestratorError {
@@ -26,6 +30,7 @@ declare class UnsupportedChainIdError extends OrchestratorError {
26
30
  context?: any;
27
31
  errorType?: string;
28
32
  traceId?: string;
33
+ statusCode?: number;
29
34
  });
30
35
  }
31
36
  declare class UnsupportedChainError extends OrchestratorError {
@@ -33,6 +38,7 @@ declare class UnsupportedChainError extends OrchestratorError {
33
38
  context?: any;
34
39
  errorType?: string;
35
40
  traceId?: string;
41
+ statusCode?: number;
36
42
  });
37
43
  }
38
44
  declare class UnsupportedTokenError extends OrchestratorError {
@@ -40,6 +46,7 @@ declare class UnsupportedTokenError extends OrchestratorError {
40
46
  context?: any;
41
47
  errorType?: string;
42
48
  traceId?: string;
49
+ statusCode?: number;
43
50
  });
44
51
  }
45
52
  declare class TokenNotSupportedError extends OrchestratorError {
@@ -47,6 +54,7 @@ declare class TokenNotSupportedError extends OrchestratorError {
47
54
  context?: any;
48
55
  errorType?: string;
49
56
  traceId?: string;
57
+ statusCode?: number;
50
58
  });
51
59
  }
52
60
  declare class AuthenticationRequiredError extends OrchestratorError {
@@ -54,6 +62,7 @@ declare class AuthenticationRequiredError extends OrchestratorError {
54
62
  context?: any;
55
63
  errorType?: string;
56
64
  traceId?: string;
65
+ statusCode?: number;
57
66
  });
58
67
  }
59
68
  declare class InvalidApiKeyError extends OrchestratorError {
@@ -61,6 +70,7 @@ declare class InvalidApiKeyError extends OrchestratorError {
61
70
  context?: any;
62
71
  errorType?: string;
63
72
  traceId?: string;
73
+ statusCode?: number;
64
74
  });
65
75
  }
66
76
  declare class InvalidIntentSignatureError extends OrchestratorError {
@@ -68,6 +78,7 @@ declare class InvalidIntentSignatureError extends OrchestratorError {
68
78
  context?: any;
69
79
  errorType?: string;
70
80
  traceId?: string;
81
+ statusCode?: number;
71
82
  });
72
83
  }
73
84
  declare class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError {
@@ -75,6 +86,7 @@ declare class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError
75
86
  context?: any;
76
87
  errorType?: string;
77
88
  traceId?: string;
89
+ statusCode?: number;
78
90
  });
79
91
  }
80
92
  declare class NoPathFoundError extends OrchestratorError {
@@ -82,6 +94,7 @@ declare class NoPathFoundError extends OrchestratorError {
82
94
  context?: any;
83
95
  errorType?: string;
84
96
  traceId?: string;
97
+ statusCode?: number;
85
98
  });
86
99
  }
87
100
  declare class IntentNotFoundError extends OrchestratorError {
@@ -89,8 +102,105 @@ declare class IntentNotFoundError extends OrchestratorError {
89
102
  context?: any;
90
103
  errorType?: string;
91
104
  traceId?: string;
105
+ statusCode?: number;
106
+ });
107
+ }
108
+ declare class SchemaValidationError extends OrchestratorError {
109
+ constructor(params?: {
110
+ message?: string;
111
+ context?: any;
112
+ errorType?: string;
113
+ traceId?: string;
114
+ statusCode?: number;
115
+ });
116
+ }
117
+ declare class RateLimitedError extends OrchestratorError {
118
+ constructor(params?: {
119
+ context?: any;
120
+ errorType?: string;
121
+ traceId?: string;
122
+ statusCode?: number;
123
+ });
124
+ }
125
+ declare class ServiceUnavailableError extends OrchestratorError {
126
+ constructor(params?: {
127
+ context?: any;
128
+ errorType?: string;
129
+ traceId?: string;
130
+ statusCode?: number;
131
+ });
132
+ }
133
+ declare class UnauthorizedError extends OrchestratorError {
134
+ constructor(params?: {
135
+ context?: any;
136
+ errorType?: string;
137
+ traceId?: string;
138
+ statusCode?: number;
139
+ });
140
+ }
141
+ declare class ForbiddenError extends OrchestratorError {
142
+ constructor(params?: {
143
+ context?: any;
144
+ errorType?: string;
145
+ traceId?: string;
146
+ statusCode?: number;
147
+ });
148
+ }
149
+ declare class ResourceNotFoundError extends OrchestratorError {
150
+ constructor(params?: {
151
+ context?: any;
152
+ errorType?: string;
153
+ traceId?: string;
154
+ statusCode?: number;
155
+ });
156
+ }
157
+ declare class ConflictError extends OrchestratorError {
158
+ constructor(params?: {
159
+ context?: any;
160
+ errorType?: string;
161
+ traceId?: string;
162
+ statusCode?: number;
163
+ });
164
+ }
165
+ declare class BadRequestError extends OrchestratorError {
166
+ constructor(params?: {
167
+ message?: string;
168
+ context?: any;
169
+ errorType?: string;
170
+ traceId?: string;
171
+ statusCode?: number;
172
+ });
173
+ }
174
+ declare class UnprocessableEntityError extends OrchestratorError {
175
+ constructor(params?: {
176
+ message?: string;
177
+ context?: any;
178
+ errorType?: string;
179
+ traceId?: string;
180
+ statusCode?: number;
181
+ });
182
+ }
183
+ declare class InternalServerError extends OrchestratorError {
184
+ constructor(params?: {
185
+ context?: any;
186
+ errorType?: string;
187
+ traceId?: string;
188
+ statusCode?: number;
189
+ });
190
+ }
191
+ declare class BodyParserError extends OrchestratorError {
192
+ constructor(params?: {
193
+ message?: string;
194
+ context?: any;
195
+ errorType?: string;
196
+ traceId?: string;
197
+ statusCode?: number;
92
198
  });
93
199
  }
94
200
  declare function isOrchestratorError(error: Error): error is OrchestratorError;
95
- export { isOrchestratorError, OrchestratorError, InsufficientBalanceError, UnsupportedChainIdError, UnsupportedChainError, UnsupportedTokenError, TokenNotSupportedError, AuthenticationRequiredError, InvalidApiKeyError, InvalidIntentSignatureError, OnlyOneTargetTokenAmountCanBeUnsetError, NoPathFoundError, IntentNotFoundError, };
201
+ declare function isRateLimited(error: unknown): error is RateLimitedError;
202
+ declare function isValidationError(error: unknown): boolean;
203
+ declare function isAuthError(error: unknown): boolean;
204
+ declare function isRetryable(error: unknown): boolean;
205
+ export { isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, OrchestratorError, InsufficientBalanceError, UnsupportedChainIdError, UnsupportedChainError, UnsupportedTokenError, TokenNotSupportedError, AuthenticationRequiredError, InvalidApiKeyError, InvalidIntentSignatureError, OnlyOneTargetTokenAmountCanBeUnsetError, NoPathFoundError, IntentNotFoundError, SchemaValidationError, RateLimitedError, ServiceUnavailableError, UnauthorizedError, ForbiddenError, ResourceNotFoundError, ConflictError, BadRequestError, UnprocessableEntityError, InternalServerError, BodyParserError, };
96
206
  //# sourceMappingURL=error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,cAAM,iBAAkB,SAAQ,KAAK;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,I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AAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,2BAA2B,EAC3B,uCAAuC,EACvC,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,CAAA"}
@@ -1,18 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntentNotFoundError = exports.NoPathFoundError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.AuthenticationRequiredError = exports.TokenNotSupportedError = exports.UnsupportedTokenError = exports.UnsupportedChainError = exports.UnsupportedChainIdError = exports.InsufficientBalanceError = exports.OrchestratorError = void 0;
3
+ exports.BodyParserError = exports.InternalServerError = exports.UnprocessableEntityError = exports.BadRequestError = exports.ConflictError = exports.ResourceNotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.ServiceUnavailableError = exports.RateLimitedError = exports.SchemaValidationError = exports.IntentNotFoundError = exports.NoPathFoundError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.AuthenticationRequiredError = exports.TokenNotSupportedError = exports.UnsupportedTokenError = exports.UnsupportedChainError = exports.UnsupportedChainIdError = exports.InsufficientBalanceError = exports.OrchestratorError = void 0;
4
4
  exports.isOrchestratorError = isOrchestratorError;
5
+ exports.isRetryable = isRetryable;
6
+ exports.isAuthError = isAuthError;
7
+ exports.isValidationError = isValidationError;
8
+ exports.isRateLimited = isRateLimited;
5
9
  class OrchestratorError extends Error {
6
10
  _message;
7
11
  _context;
8
12
  _errorType;
9
13
  _traceId;
14
+ _statusCode;
10
15
  constructor(params) {
11
16
  super();
12
17
  this._message = params?.message || 'OrchestratorError ';
13
18
  this._context = params?.context || {};
14
19
  this._errorType = params?.errorType || 'Unknown';
15
20
  this._traceId = params?.traceId || '';
21
+ this._statusCode = params?.statusCode;
16
22
  }
17
23
  get message() {
18
24
  return this._message;
@@ -26,6 +32,9 @@ class OrchestratorError extends Error {
26
32
  get traceId() {
27
33
  return this._traceId;
28
34
  }
35
+ get statusCode() {
36
+ return this._statusCode;
37
+ }
29
38
  }
30
39
  exports.OrchestratorError = OrchestratorError;
31
40
  class InsufficientBalanceError extends OrchestratorError {
@@ -127,6 +136,124 @@ class IntentNotFoundError extends OrchestratorError {
127
136
  }
128
137
  }
129
138
  exports.IntentNotFoundError = IntentNotFoundError;
139
+ class SchemaValidationError extends OrchestratorError {
140
+ constructor(params) {
141
+ super({
142
+ message: params?.message || 'Schema validation error',
143
+ ...params,
144
+ });
145
+ }
146
+ }
147
+ exports.SchemaValidationError = SchemaValidationError;
148
+ class RateLimitedError extends OrchestratorError {
149
+ constructor(params) {
150
+ super({
151
+ message: 'Too Many Requests',
152
+ ...params,
153
+ });
154
+ }
155
+ }
156
+ exports.RateLimitedError = RateLimitedError;
157
+ class ServiceUnavailableError extends OrchestratorError {
158
+ constructor(params) {
159
+ super({
160
+ message: 'Service Unavailable',
161
+ ...params,
162
+ });
163
+ }
164
+ }
165
+ exports.ServiceUnavailableError = ServiceUnavailableError;
166
+ class UnauthorizedError extends OrchestratorError {
167
+ constructor(params) {
168
+ super({
169
+ message: 'Unauthorized',
170
+ ...params,
171
+ });
172
+ }
173
+ }
174
+ exports.UnauthorizedError = UnauthorizedError;
175
+ class ForbiddenError extends OrchestratorError {
176
+ constructor(params) {
177
+ super({
178
+ message: 'Forbidden',
179
+ ...params,
180
+ });
181
+ }
182
+ }
183
+ exports.ForbiddenError = ForbiddenError;
184
+ class ResourceNotFoundError extends OrchestratorError {
185
+ constructor(params) {
186
+ super({
187
+ message: 'Not Found',
188
+ ...params,
189
+ });
190
+ }
191
+ }
192
+ exports.ResourceNotFoundError = ResourceNotFoundError;
193
+ class ConflictError extends OrchestratorError {
194
+ constructor(params) {
195
+ super({
196
+ message: 'Conflict',
197
+ ...params,
198
+ });
199
+ }
200
+ }
201
+ exports.ConflictError = ConflictError;
202
+ class BadRequestError extends OrchestratorError {
203
+ constructor(params) {
204
+ super({
205
+ message: params?.message || 'Bad Request',
206
+ ...params,
207
+ });
208
+ }
209
+ }
210
+ exports.BadRequestError = BadRequestError;
211
+ class UnprocessableEntityError extends OrchestratorError {
212
+ constructor(params) {
213
+ super({
214
+ message: params?.message || 'Unprocessable Entity',
215
+ ...params,
216
+ });
217
+ }
218
+ }
219
+ exports.UnprocessableEntityError = UnprocessableEntityError;
220
+ class InternalServerError extends OrchestratorError {
221
+ constructor(params) {
222
+ super({
223
+ message: 'Internal Server Error',
224
+ ...params,
225
+ });
226
+ }
227
+ }
228
+ exports.InternalServerError = InternalServerError;
229
+ class BodyParserError extends OrchestratorError {
230
+ constructor(params) {
231
+ super({
232
+ message: params?.message || 'Body parser error',
233
+ ...params,
234
+ });
235
+ }
236
+ }
237
+ exports.BodyParserError = BodyParserError;
130
238
  function isOrchestratorError(error) {
131
239
  return error instanceof OrchestratorError;
132
240
  }
241
+ function isRateLimited(error) {
242
+ return (error instanceof RateLimitedError ||
243
+ (error instanceof OrchestratorError && error.statusCode === 429));
244
+ }
245
+ function isValidationError(error) {
246
+ if (!(error instanceof OrchestratorError))
247
+ return false;
248
+ return error.statusCode === 400 || error.statusCode === 422;
249
+ }
250
+ function isAuthError(error) {
251
+ if (!(error instanceof OrchestratorError))
252
+ return false;
253
+ return (error.statusCode === 401 || error instanceof AuthenticationRequiredError);
254
+ }
255
+ function isRetryable(error) {
256
+ if (!(error instanceof OrchestratorError))
257
+ return false;
258
+ return error.statusCode === 500 || error.statusCode === 503;
259
+ }
@@ -1,10 +1,10 @@
1
1
  import { Orchestrator } from './client';
2
2
  import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
3
- import { AuthenticationRequiredError, InsufficientBalanceError, IntentNotFoundError, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
3
+ import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
4
4
  import { getSupportedTokens, getTokenAddress, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
5
- import type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig } from './types';
5
+ import type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementLayer, SignedIntentOp, SupportedChain, TokenConfig } from './types';
6
6
  import { INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN } from './types';
7
7
  declare function getOrchestrator(apiKey?: string, orchestratorUrl?: string): Orchestrator;
8
- export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig, Portfolio, };
9
- export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, };
8
+ export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementLayer, SignedIntentOp, SupportedChain, TokenConfig, Portfolio, };
9
+ export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getSupportedTokens, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,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,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACT,eAAe,EACf,cAAc,EACd,cAAc,EACd,WAAW,EACZ,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,iBAAS,eAAe,CACtB,MAAM,CAAC,EAAE,MAAM,EACf,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,WAAW,EACX,SAAS,GACV,CAAA;AACD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,uBAAuB,GACxB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
3
+ exports.isTokenAddressSupported = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.UnauthorizedError = exports.UnprocessableEntityError = exports.ServiceUnavailableError = exports.SchemaValidationError = exports.RateLimitedError = exports.ResourceNotFoundError = exports.InternalServerError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.ForbiddenError = exports.ConflictError = exports.BodyParserError = exports.BadRequestError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
4
4
  exports.getOrchestrator = getOrchestrator;
5
5
  const client_1 = require("./client");
6
6
  Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
@@ -8,15 +8,30 @@ const consts_1 = require("./consts");
8
8
  Object.defineProperty(exports, "RHINESTONE_SPOKE_POOL_ADDRESS", { enumerable: true, get: function () { return consts_1.RHINESTONE_SPOKE_POOL_ADDRESS; } });
9
9
  const error_1 = require("./error");
10
10
  Object.defineProperty(exports, "AuthenticationRequiredError", { enumerable: true, get: function () { return error_1.AuthenticationRequiredError; } });
11
+ Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
12
+ Object.defineProperty(exports, "BodyParserError", { enumerable: true, get: function () { return error_1.BodyParserError; } });
13
+ Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
14
+ Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return error_1.ForbiddenError; } });
11
15
  Object.defineProperty(exports, "InsufficientBalanceError", { enumerable: true, get: function () { return error_1.InsufficientBalanceError; } });
12
16
  Object.defineProperty(exports, "IntentNotFoundError", { enumerable: true, get: function () { return error_1.IntentNotFoundError; } });
17
+ Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
13
18
  Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return error_1.InvalidApiKeyError; } });
14
19
  Object.defineProperty(exports, "InvalidIntentSignatureError", { enumerable: true, get: function () { return error_1.InvalidIntentSignatureError; } });
20
+ Object.defineProperty(exports, "isAuthError", { enumerable: true, get: function () { return error_1.isAuthError; } });
15
21
  Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return error_1.isOrchestratorError; } });
22
+ Object.defineProperty(exports, "isRateLimited", { enumerable: true, get: function () { return error_1.isRateLimited; } });
23
+ Object.defineProperty(exports, "isRetryable", { enumerable: true, get: function () { return error_1.isRetryable; } });
24
+ Object.defineProperty(exports, "isValidationError", { enumerable: true, get: function () { return error_1.isValidationError; } });
16
25
  Object.defineProperty(exports, "NoPathFoundError", { enumerable: true, get: function () { return error_1.NoPathFoundError; } });
17
26
  Object.defineProperty(exports, "OnlyOneTargetTokenAmountCanBeUnsetError", { enumerable: true, get: function () { return error_1.OnlyOneTargetTokenAmountCanBeUnsetError; } });
18
27
  Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return error_1.OrchestratorError; } });
28
+ Object.defineProperty(exports, "RateLimitedError", { enumerable: true, get: function () { return error_1.RateLimitedError; } });
29
+ Object.defineProperty(exports, "ResourceNotFoundError", { enumerable: true, get: function () { return error_1.ResourceNotFoundError; } });
30
+ Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return error_1.SchemaValidationError; } });
31
+ Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return error_1.ServiceUnavailableError; } });
19
32
  Object.defineProperty(exports, "TokenNotSupportedError", { enumerable: true, get: function () { return error_1.TokenNotSupportedError; } });
33
+ Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return error_1.UnauthorizedError; } });
34
+ Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
20
35
  Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get: function () { return error_1.UnsupportedChainError; } });
21
36
  Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
22
37
  Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
@@ -1,32 +1,11 @@
1
- import { type Address, type Chain } from 'viem';
1
+ import type { Address, Chain } from 'viem';
2
2
  import type { TokenSymbol } from '../types';
3
3
  import type { TokenConfig } from './types';
4
- interface TokenEntry {
5
- symbol: string;
6
- address: Address;
7
- decimals: number;
8
- balanceSlot: number | null;
9
- }
10
- interface ChainContracts {
11
- spokepool: Address;
12
- hook: Address;
13
- originModule: Address;
14
- targetModule: Address;
15
- sameChainModule: Address;
16
- }
17
- interface ChainEntry {
18
- name: string;
19
- contracts: ChainContracts;
20
- tokens: TokenEntry[];
21
- }
22
- interface Registry {
23
- [chainId: string]: ChainEntry;
24
- }
25
4
  declare function getSupportedChainIds(): number[];
26
5
  declare function getWethAddress(chain: Chain): Address;
27
6
  declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
28
- declare function getTokenAddress(tokenSymbol: TokenSymbol, chainId: number): Address;
29
- declare function getChainById(chainId: number): Chain | undefined;
7
+ declare function getTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
8
+ declare function getChainById(chainId: number): Chain;
30
9
  declare function isTestnet(chainId: number): boolean;
31
10
  declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
32
11
  declare function getSupportedTokens(chainId: number): TokenConfig[];
@@ -35,5 +14,4 @@ declare function getDefaultAccountAccessList(onTestnets?: boolean): {
35
14
  };
36
15
  declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
37
16
  export { getTokenSymbol, getTokenAddress, getWethAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, };
38
- export type { TokenEntry, ChainContracts, ChainEntry, Registry };
39
17
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAA0B,MAAM,MAAM,CAAA;AAcvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED,UAAU,cAAc;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,eAAe,EAAE,OAAO,CAAA;CACzB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,UAAU,EAAE,CAAA;CACrB;AAED,UAAU,QAAQ;IAChB,CAAC,OAAO,EAAE,MAAM,GA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