@anywalletkit/protocol-swap2-across 0.0.0-stage → 0.1.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.
- package/LICENSE +202 -0
- package/README.md +177 -2
- package/dist/activity.cjs +142 -0
- package/dist/activity.cjs.map +1 -0
- package/dist/activity.d.cts +16 -0
- package/dist/activity.d.ts +16 -0
- package/dist/activity.js +10 -0
- package/dist/activity.js.map +1 -0
- package/dist/api.cjs +441 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.cts +207 -0
- package/dist/api.d.ts +207 -0
- package/dist/api.js +35 -0
- package/dist/api.js.map +1 -0
- package/dist/build.cjs +776 -0
- package/dist/build.cjs.map +1 -0
- package/dist/build.d.cts +93 -0
- package/dist/build.d.ts +93 -0
- package/dist/build.js +14 -0
- package/dist/build.js.map +1 -0
- package/dist/chunk-32YJEBZX.js +125 -0
- package/dist/chunk-32YJEBZX.js.map +1 -0
- package/dist/chunk-3UBRQ3ZE.js +255 -0
- package/dist/chunk-3UBRQ3ZE.js.map +1 -0
- package/dist/chunk-5BDZXOOP.js +21 -0
- package/dist/chunk-5BDZXOOP.js.map +1 -0
- package/dist/chunk-6Z4GXNLE.js +102 -0
- package/dist/chunk-6Z4GXNLE.js.map +1 -0
- package/dist/chunk-AWQT5S4V.js +101 -0
- package/dist/chunk-AWQT5S4V.js.map +1 -0
- package/dist/chunk-E5WFOPN2.js +16 -0
- package/dist/chunk-E5WFOPN2.js.map +1 -0
- package/dist/chunk-GX67FRPG.js +194 -0
- package/dist/chunk-GX67FRPG.js.map +1 -0
- package/dist/chunk-KATEONJQ.js +396 -0
- package/dist/chunk-KATEONJQ.js.map +1 -0
- package/dist/chunk-P32AW6XS.js +27 -0
- package/dist/chunk-P32AW6XS.js.map +1 -0
- package/dist/chunk-PPPZIG7S.js +265 -0
- package/dist/chunk-PPPZIG7S.js.map +1 -0
- package/dist/chunk-SJOFLM27.js +138 -0
- package/dist/chunk-SJOFLM27.js.map +1 -0
- package/dist/chunk-YGNP7KPL.js +311 -0
- package/dist/chunk-YGNP7KPL.js.map +1 -0
- package/dist/config.cjs +214 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +119 -0
- package/dist/config.d.ts +119 -0
- package/dist/config.js +47 -0
- package/dist/config.js.map +1 -0
- package/dist/deposit.cjs +252 -0
- package/dist/deposit.cjs.map +1 -0
- package/dist/deposit.d.cts +95 -0
- package/dist/deposit.d.ts +95 -0
- package/dist/deposit.js +19 -0
- package/dist/deposit.js.map +1 -0
- package/dist/index.cjs +1789 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +34 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +242 -0
- package/dist/index.js.map +1 -0
- package/dist/pricing.cjs +132 -0
- package/dist/pricing.cjs.map +1 -0
- package/dist/pricing.d.cts +123 -0
- package/dist/pricing.d.ts +123 -0
- package/dist/pricing.js +42 -0
- package/dist/pricing.js.map +1 -0
- package/dist/protocol.cjs +1596 -0
- package/dist/protocol.cjs.map +1 -0
- package/dist/protocol.d.cts +20 -0
- package/dist/protocol.d.ts +20 -0
- package/dist/protocol.js +17 -0
- package/dist/protocol.js.map +1 -0
- package/dist/provider.cjs +1581 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.cts +45 -0
- package/dist/provider.d.ts +45 -0
- package/dist/provider.js +18 -0
- package/dist/provider.js.map +1 -0
- package/dist/remote.cjs +1659 -0
- package/dist/remote.cjs.map +1 -0
- package/dist/remote.d.cts +55 -0
- package/dist/remote.d.ts +55 -0
- package/dist/remote.js +17 -0
- package/dist/remote.js.map +1 -0
- package/dist/status.cjs +443 -0
- package/dist/status.cjs.map +1 -0
- package/dist/status.d.cts +109 -0
- package/dist/status.d.ts +109 -0
- package/dist/status.js +26 -0
- package/dist/status.js.map +1 -0
- package/dist/verify.cjs +690 -0
- package/dist/verify.cjs.map +1 -0
- package/dist/verify.d.cts +245 -0
- package/dist/verify.d.ts +245 -0
- package/dist/verify.js +69 -0
- package/dist/verify.js.map +1 -0
- package/module.json +32 -0
- 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 };
|
package/dist/provider.js
ADDED
|
@@ -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":[]}
|