@anywalletkit/protocol-swap2-across 0.0.0-stage → 0.1.1

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 (100) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +177 -2
  3. package/dist/activity.cjs +142 -0
  4. package/dist/activity.cjs.map +1 -0
  5. package/dist/activity.d.cts +16 -0
  6. package/dist/activity.d.ts +16 -0
  7. package/dist/activity.js +10 -0
  8. package/dist/activity.js.map +1 -0
  9. package/dist/api.cjs +441 -0
  10. package/dist/api.cjs.map +1 -0
  11. package/dist/api.d.cts +207 -0
  12. package/dist/api.d.ts +207 -0
  13. package/dist/api.js +35 -0
  14. package/dist/api.js.map +1 -0
  15. package/dist/build.cjs +776 -0
  16. package/dist/build.cjs.map +1 -0
  17. package/dist/build.d.cts +93 -0
  18. package/dist/build.d.ts +93 -0
  19. package/dist/build.js +14 -0
  20. package/dist/build.js.map +1 -0
  21. package/dist/chunk-32YJEBZX.js +125 -0
  22. package/dist/chunk-32YJEBZX.js.map +1 -0
  23. package/dist/chunk-3UBRQ3ZE.js +255 -0
  24. package/dist/chunk-3UBRQ3ZE.js.map +1 -0
  25. package/dist/chunk-5BDZXOOP.js +21 -0
  26. package/dist/chunk-5BDZXOOP.js.map +1 -0
  27. package/dist/chunk-6Z4GXNLE.js +102 -0
  28. package/dist/chunk-6Z4GXNLE.js.map +1 -0
  29. package/dist/chunk-AWQT5S4V.js +101 -0
  30. package/dist/chunk-AWQT5S4V.js.map +1 -0
  31. package/dist/chunk-E5WFOPN2.js +16 -0
  32. package/dist/chunk-E5WFOPN2.js.map +1 -0
  33. package/dist/chunk-GX67FRPG.js +194 -0
  34. package/dist/chunk-GX67FRPG.js.map +1 -0
  35. package/dist/chunk-KATEONJQ.js +396 -0
  36. package/dist/chunk-KATEONJQ.js.map +1 -0
  37. package/dist/chunk-P32AW6XS.js +27 -0
  38. package/dist/chunk-P32AW6XS.js.map +1 -0
  39. package/dist/chunk-PPPZIG7S.js +265 -0
  40. package/dist/chunk-PPPZIG7S.js.map +1 -0
  41. package/dist/chunk-SJOFLM27.js +138 -0
  42. package/dist/chunk-SJOFLM27.js.map +1 -0
  43. package/dist/chunk-YGNP7KPL.js +311 -0
  44. package/dist/chunk-YGNP7KPL.js.map +1 -0
  45. package/dist/config.cjs +214 -0
  46. package/dist/config.cjs.map +1 -0
  47. package/dist/config.d.cts +119 -0
  48. package/dist/config.d.ts +119 -0
  49. package/dist/config.js +47 -0
  50. package/dist/config.js.map +1 -0
  51. package/dist/deposit.cjs +252 -0
  52. package/dist/deposit.cjs.map +1 -0
  53. package/dist/deposit.d.cts +95 -0
  54. package/dist/deposit.d.ts +95 -0
  55. package/dist/deposit.js +19 -0
  56. package/dist/deposit.js.map +1 -0
  57. package/dist/index.cjs +1789 -0
  58. package/dist/index.cjs.map +1 -0
  59. package/dist/index.d.cts +34 -0
  60. package/dist/index.d.ts +34 -0
  61. package/dist/index.js +242 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/pricing.cjs +132 -0
  64. package/dist/pricing.cjs.map +1 -0
  65. package/dist/pricing.d.cts +123 -0
  66. package/dist/pricing.d.ts +123 -0
  67. package/dist/pricing.js +42 -0
  68. package/dist/pricing.js.map +1 -0
  69. package/dist/protocol.cjs +1596 -0
  70. package/dist/protocol.cjs.map +1 -0
  71. package/dist/protocol.d.cts +20 -0
  72. package/dist/protocol.d.ts +20 -0
  73. package/dist/protocol.js +17 -0
  74. package/dist/protocol.js.map +1 -0
  75. package/dist/provider.cjs +1581 -0
  76. package/dist/provider.cjs.map +1 -0
  77. package/dist/provider.d.cts +45 -0
  78. package/dist/provider.d.ts +45 -0
  79. package/dist/provider.js +18 -0
  80. package/dist/provider.js.map +1 -0
  81. package/dist/remote.cjs +1659 -0
  82. package/dist/remote.cjs.map +1 -0
  83. package/dist/remote.d.cts +55 -0
  84. package/dist/remote.d.ts +55 -0
  85. package/dist/remote.js +17 -0
  86. package/dist/remote.js.map +1 -0
  87. package/dist/status.cjs +443 -0
  88. package/dist/status.cjs.map +1 -0
  89. package/dist/status.d.cts +109 -0
  90. package/dist/status.d.ts +109 -0
  91. package/dist/status.js +26 -0
  92. package/dist/status.js.map +1 -0
  93. package/dist/verify.cjs +690 -0
  94. package/dist/verify.cjs.map +1 -0
  95. package/dist/verify.d.cts +245 -0
  96. package/dist/verify.d.ts +245 -0
  97. package/dist/verify.js +69 -0
  98. package/dist/verify.js.map +1 -0
  99. package/module.json +32 -0
  100. package/package.json +124 -3
@@ -0,0 +1,45 @@
1
+ import { CrossChainProvider, Asset } from '@anywalletkit/protocol-swap2-core/types';
2
+
3
+ interface AcrossProviderConfig {
4
+ /** Dark flag (the app convention is `ACROSS_ENABLED`). Default true; without an `apiKey` the provider is disabled anyway. */
5
+ enabled?: boolean | undefined;
6
+ /**
7
+ * The Across API V5 key (dashboard.across.to) — server only; the app convention is `ACROSS_API_KEY`. Best as a
8
+ * getter read on every request, so the key lives where you keep secrets; a string is accepted too. It is sent only
9
+ * as the `Authorization: Bearer` header to `baseUrl`, never put in a URL, a refusal or a quote, and an answer that
10
+ * came through a redirect is refused. Without one (or one that is not printable ASCII) the provider quotes nothing
11
+ * and reports itself disabled — it still builds, verifies and tracks. Under React Native a key is refused outright
12
+ * (the constructor throws): use `acrossRemoteProvider` in the app. Across's older integrator id and V4 key are not
13
+ * used by this module.
14
+ */
15
+ apiKey?: string | (() => string | undefined) | undefined;
16
+ /** V5 origin. Default `https://api.across.to`. Must be https (http only for localhost): the key rides on it. */
17
+ baseUrl?: string | undefined;
18
+ /**
19
+ * Across's keyless relayer-fee quote (default {@link ACROSS_SUGGESTED_FEES_URL}); `null` turns it off and prices
20
+ * every quote with the pinned floor (which needs `rpcUrls` for Ethereum and the source chain, for the quote time).
21
+ */
22
+ suggestedFeesUrl?: string | null | undefined;
23
+ /**
24
+ * JSON-RPC URLs per CAIP-2 chain: status (the source chain's to read the deposit, the destination's to read its
25
+ * fill), and the quote time when `/suggested-fees` does not answer (Ethereum's and the source chain's latest block).
26
+ */
27
+ rpcUrls?: Readonly<Record<string, string>> | undefined;
28
+ /** Fee cap in bps of the input that a deposit may leave to relayers (default 1000 = 10 %, at most 5000). */
29
+ maxFeeBps?: number | undefined;
30
+ /** Local lifetime of a quote (default 60 s, at most 5 min). */
31
+ quoteTtlMs?: number | undefined;
32
+ /** Per API request, ms (default 10 000). */
33
+ timeoutMs?: number | undefined;
34
+ /** Injectable for tests and for runtimes that bring their own. */
35
+ fetchImpl?: typeof fetch | undefined;
36
+ }
37
+ /**
38
+ * Whether this module serves a route — the source a catalog symbol (or a contract), the destination an address (zero
39
+ * for the native coin): pinned chains and tokens, the same asset, and a route the pricing covers (not Ethereum as the
40
+ * destination). The local and the remote provider answer alike.
41
+ */
42
+ declare function acrossServesRoute(from: Asset, to: Asset): boolean;
43
+ declare function acrossProvider(config?: AcrossProviderConfig): CrossChainProvider;
44
+
45
+ export { type AcrossProviderConfig, acrossProvider, acrossServesRoute };
@@ -0,0 +1,18 @@
1
+ import {
2
+ acrossProvider,
3
+ acrossServesRoute
4
+ } from "./chunk-PPPZIG7S.js";
5
+ import "./chunk-5BDZXOOP.js";
6
+ import "./chunk-SJOFLM27.js";
7
+ import "./chunk-KATEONJQ.js";
8
+ import "./chunk-3UBRQ3ZE.js";
9
+ import "./chunk-32YJEBZX.js";
10
+ import "./chunk-YGNP7KPL.js";
11
+ import "./chunk-GX67FRPG.js";
12
+ import "./chunk-6Z4GXNLE.js";
13
+ import "./chunk-E5WFOPN2.js";
14
+ export {
15
+ acrossProvider,
16
+ acrossServesRoute
17
+ };
18
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}