@coinlist-co/react 0.12.2-rc.726778a → 0.12.2-rc.9fb6364

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 (32) hide show
  1. package/dist/{chunk-IRV5YU42.js → chunk-BNMF2HMW.js} +98 -2
  2. package/dist/chunk-BNMF2HMW.js.map +1 -0
  3. package/dist/{chunk-3UQPCAU4.js → chunk-KRA6EM2L.js} +2 -2
  4. package/dist/{chunk-C6F5FOFP.js → chunk-STAHYDLY.js} +52 -19
  5. package/dist/chunk-STAHYDLY.js.map +1 -0
  6. package/dist/client/index.cjs +287 -53
  7. package/dist/client/index.cjs.map +1 -1
  8. package/dist/client/index.d.cts +26 -8
  9. package/dist/client/index.d.ts +26 -8
  10. package/dist/client/index.js +182 -39
  11. package/dist/client/index.js.map +1 -1
  12. package/dist/server/index.cjs +435 -76
  13. package/dist/server/index.cjs.map +1 -1
  14. package/dist/server/index.d.cts +47 -38
  15. package/dist/server/index.d.ts +47 -38
  16. package/dist/server/index.js +316 -61
  17. package/dist/server/index.js.map +1 -1
  18. package/dist/time-B5YOQxuh.d.ts +50 -0
  19. package/dist/time-BY3apBpc.d.cts +50 -0
  20. package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-C1NxdBmF.d.ts} +1 -1
  21. package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-DyjrA32p.d.cts} +1 -1
  22. package/dist/{tokens-namespace-CIWBtgt2.d.cts → tokens-namespace-BJfFeowE.d.cts} +53 -1
  23. package/dist/{tokens-namespace-CIWBtgt2.d.ts → tokens-namespace-BJfFeowE.d.ts} +53 -1
  24. package/dist/universal/index.cjs +83 -1
  25. package/dist/universal/index.cjs.map +1 -1
  26. package/dist/universal/index.d.cts +5 -4
  27. package/dist/universal/index.d.ts +5 -4
  28. package/dist/universal/index.js +10 -2
  29. package/package.json +1 -1
  30. package/dist/chunk-C6F5FOFP.js.map +0 -1
  31. package/dist/chunk-IRV5YU42.js.map +0 -1
  32. /package/dist/{chunk-3UQPCAU4.js.map → chunk-KRA6EM2L.js.map} +0 -0
@@ -51,6 +51,7 @@ __export(universal_exports, {
51
51
  DocumentSubmission: () => DocumentSubmission,
52
52
  ERC20_ABI: () => ERC20_ABI,
53
53
  ETHEREUM_CHAINS: () => ETHEREUM_CHAINS,
54
+ EpochMillis: () => EpochMillis,
54
55
  Erc20NamespaceImpl: () => Erc20NamespaceImpl,
55
56
  EthereumChain: () => EthereumChain,
56
57
  EvmContractAddress: () => EvmContractAddress,
@@ -71,6 +72,7 @@ __export(universal_exports, {
71
72
  MAX_UINT_256: () => MAX_UINT_256,
72
73
  MathError: () => MathError,
73
74
  Milestone: () => Milestone,
75
+ Millis: () => Millis,
74
76
  NA_AMOUNT_ASSET_UI: () => NA_AMOUNT_ASSET_UI,
75
77
  NotAuthenticatedError: () => NotAuthenticatedError,
76
78
  NotImplementedError: () => NotImplementedError,
@@ -123,6 +125,7 @@ __export(universal_exports, {
123
125
  SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA: () => SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
124
126
  SWAP_LEVEL: () => SWAP_LEVEL,
125
127
  SWAP_POLL_INTERVAL_MS: () => SWAP_POLL_INTERVAL_MS,
128
+ Seconds: () => Seconds,
126
129
  ShortenedWalletAddress: () => ShortenedWalletAddress,
127
130
  SolanaChain: () => SolanaChain,
128
131
  StablecoinSymbol: () => StablecoinSymbol,
@@ -173,6 +176,7 @@ __export(universal_exports, {
173
176
  getChainId: () => getChainId,
174
177
  getNetworkName: () => getNetworkName,
175
178
  isChain: () => isChain,
179
+ isExpired: () => isExpired,
176
180
  isOfferType: () => isOfferType,
177
181
  isSwapAvailable: () => isSwapAvailable,
178
182
  offerDisplayTokens: () => offerDisplayTokens,
@@ -188,6 +192,15 @@ __export(universal_exports, {
188
192
  });
189
193
  module.exports = __toCommonJS(universal_exports);
190
194
 
195
+ // src/universal/api/internal-access-token-source.ts
196
+ var SentWith = {
197
+ userToken: (token) => ({
198
+ type: "user-token",
199
+ token
200
+ }),
201
+ noUserToken: { type: "no-user-token" }
202
+ };
203
+
191
204
  // src/universal/api/http-attributes.ts
192
205
  var empty = {};
193
206
  var concat = (left, right) => ({
@@ -215,6 +228,10 @@ var retryAttempt = (attempt) => ({
215
228
  var renewAttempted = (value) => ({
216
229
  renewAttempted: value
217
230
  });
231
+ var notRetryable = () => ({ retryable: false });
232
+ var sentWith = (token) => ({
233
+ sentWith: token
234
+ });
218
235
  var requestId = (id) => ({ requestId: id });
219
236
  var getRequestId = (attrs) => attrs?.requestId ?? null;
220
237
  var isProtected = (attrs) => attrs?.protected === true;
@@ -222,6 +239,8 @@ var needUserAgent = (attrs) => attrs?.userAgent === true;
222
239
  var isIdempotent = (attrs) => attrs?.idempotencyKey === true;
223
240
  var getRetryAttempt = (attrs) => attrs?.retryAttempt ?? 0;
224
241
  var wasRenewAttempted = (attrs) => attrs?.renewAttempted === true;
242
+ var isRetryable = (attrs) => attrs?.retryable !== false;
243
+ var getSentWith = (attrs) => attrs?.sentWith === void 0 ? SentWith.noUserToken : SentWith.userToken(attrs.sentWith);
225
244
  var getClientCredentials = (attrs) => attrs?.clientCredentials;
226
245
  var Attributes = {
227
246
  empty,
@@ -237,6 +256,10 @@ var Attributes = {
237
256
  getRetryAttempt,
238
257
  renewAttempted,
239
258
  wasRenewAttempted,
259
+ notRetryable,
260
+ isRetryable,
261
+ sentWith,
262
+ getSentWith,
240
263
  clientCredentials,
241
264
  getClientCredentials,
242
265
  requestId,
@@ -3369,11 +3392,18 @@ var HttpClient = class {
3369
3392
  );
3370
3393
  let response = await this.executeRequest(preparedRequest);
3371
3394
  for (const middleware of this.middleware.afterRequest ?? []) {
3395
+ let retried = false;
3372
3396
  response = await middleware({
3373
3397
  request: preparedRequest,
3374
3398
  response,
3375
- retry: (nextRequest = preparedRequest) => this.runRequestWithAfterMiddleware(nextRequest)
3399
+ retry: (nextRequest = preparedRequest) => {
3400
+ retried = true;
3401
+ return this.runRequestWithAfterMiddleware(nextRequest);
3402
+ }
3376
3403
  });
3404
+ if (retried) {
3405
+ return response;
3406
+ }
3377
3407
  }
3378
3408
  return response;
3379
3409
  }
@@ -3863,6 +3893,54 @@ var OAuthSession = {
3863
3893
  }
3864
3894
  };
3865
3895
 
3896
+ // src/universal/types/time.ts
3897
+ var MAX_EPOCH_MILLIS = 864e13;
3898
+ var EpochMillis = {
3899
+ /**
3900
+ * @throws {@link ValidationError} unless `value` is an integer a `Date` can
3901
+ * represent: at most {@link MAX_EPOCH_MILLIS} either side of the epoch.
3902
+ */
3903
+ of: (value) => {
3904
+ if (!Number.isInteger(value) || Math.abs(value) > MAX_EPOCH_MILLIS) {
3905
+ throw new ValidationError(
3906
+ `EpochMillis must be an integer within \xB1${MAX_EPOCH_MILLIS}, got ${value}`
3907
+ );
3908
+ }
3909
+ return value;
3910
+ },
3911
+ /** The wall clock. Code that needs the time takes a `TimeEff` instead. */
3912
+ now: () => EpochMillis.of(Date.now()),
3913
+ /** @throws {@link ValidationError} for an invalid `Date`. */
3914
+ fromDate: (date) => EpochMillis.of(date.getTime()),
3915
+ /** How long after `from` the instant `to` is; negative if it is before. */
3916
+ elapsed: (from, to) => Millis.of(to - from),
3917
+ plus: (at, duration) => EpochMillis.of(at + duration)
3918
+ };
3919
+ var Millis = {
3920
+ of: (value) => value
3921
+ };
3922
+ var Seconds = {
3923
+ /**
3924
+ * @throws {@link ValidationError} unless `value` is a non-negative integer.
3925
+ */
3926
+ of: (value) => {
3927
+ if (!Number.isInteger(value) || value < 0) {
3928
+ throw new ValidationError(
3929
+ `Seconds must be a non-negative integer, got ${value}`
3930
+ );
3931
+ }
3932
+ return value;
3933
+ },
3934
+ toMillis: (value) => Millis.of(value * 1e3)
3935
+ };
3936
+ function isExpired({
3937
+ expiresAt,
3938
+ now,
3939
+ buffer = Millis.of(0)
3940
+ }) {
3941
+ return now >= expiresAt - buffer;
3942
+ }
3943
+
3866
3944
  // src/universal/types/user.ts
3867
3945
  var UserId = (value) => value;
3868
3946
  var UserEmail = (value) => value;
@@ -3905,6 +3983,7 @@ var User = {
3905
3983
  DocumentSubmission,
3906
3984
  ERC20_ABI,
3907
3985
  ETHEREUM_CHAINS,
3986
+ EpochMillis,
3908
3987
  Erc20NamespaceImpl,
3909
3988
  EthereumChain,
3910
3989
  EvmContractAddress,
@@ -3925,6 +4004,7 @@ var User = {
3925
4004
  MAX_UINT_256,
3926
4005
  MathError,
3927
4006
  Milestone,
4007
+ Millis,
3928
4008
  NA_AMOUNT_ASSET_UI,
3929
4009
  NotAuthenticatedError,
3930
4010
  NotImplementedError,
@@ -3977,6 +4057,7 @@ var User = {
3977
4057
  SUPERSTATE_SWAP_CONTRACT_ADDRESS_SEPOLIA,
3978
4058
  SWAP_LEVEL,
3979
4059
  SWAP_POLL_INTERVAL_MS,
4060
+ Seconds,
3980
4061
  ShortenedWalletAddress,
3981
4062
  SolanaChain,
3982
4063
  StablecoinSymbol,
@@ -4027,6 +4108,7 @@ var User = {
4027
4108
  getChainId,
4028
4109
  getNetworkName,
4029
4110
  isChain,
4111
+ isExpired,
4030
4112
  isOfferType,
4031
4113
  isSwapAvailable,
4032
4114
  offerDisplayTokens,