@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.
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,245 @@
1
+ import { Hex } from 'viem';
2
+ import { Quote, UnsignedTx, QuoteParams, RemotePins } from '@anywalletkit/protocol-swap2-core/types';
3
+ import { AcrossRoute } from './config.js';
4
+ import { AcrossDepositArgs } from './deposit.js';
5
+
6
+ /**
7
+ * The device-side check of an Across deposit.
8
+ *
9
+ * An Across deposit is one call, `deposit(...)` on the source chain's SpokePool, and unlike an order-hash deposit its
10
+ * calldata says everything: who is refunded (`depositor`), who is paid (`recipient`), in which token and how much on
11
+ * which chain (`outputToken`, `outputAmount`, `destinationChainId`), by when (`fillDeadline`), and what runs on arrival
12
+ * (`message`). Relayers pay the recipient `outputAmount` of `outputToken` on the destination out of their own funds and
13
+ * are repaid from the deposit; an unfilled deposit is refunded to `depositor` on the source chain after the fill
14
+ * deadline. The SpokePool itself checks almost none of it — no route list, no token pairing, `depositor` not bound
15
+ * to the sender (SpokePool.sol `_depositV3`) — so {@link verifyAcrossDeposit} holds every field to the user's own
16
+ * request and to the pins in `config.ts`, with nothing but the transaction about to be signed:
17
+ *
18
+ * 1. the call is `deposit` on the pinned SpokePool of the source chain, for that chain id, in its canonical encoding;
19
+ * 2. `depositor` is the account that signs and `recipient` the user's recipient; the destination is the requested
20
+ * pinned chain;
21
+ * 3. the input is the pinned token for the request (the wrapped native token, with exactly the amount as value, for
22
+ * the native coin; value 0 and an approval of the SpokePool for an ERC-20), exactly the requested amount;
23
+ * 4. the output is the same asset on the destination (the wrapped native token for the native coin, which the
24
+ * destination SpokePool unwraps for an EOA), at least the caller's floor, and the fee it leaves (input − output)
25
+ * between a floor relayers can be paid with and the cap — a deposit asking relayers for all of its input or more
26
+ * is never filled;
27
+ * 5. the message is empty — the Across V5 witness prefix refused by name — so the tokens land on the recipient and
28
+ * nothing runs;
29
+ * 6. the deadlines are ones the SpokePool accepts and a relayer can still meet, wherever the deposit lands: a quote
30
+ * time not ahead of now (the SpokePool reverts one ahead of its block) and no older than its on-chain buffer
31
+ * allows (with a margin to land); a fill deadline no further from the quote time than an Across quote puts it (so
32
+ * an unfilled deposit holds the funds no longer than that before its refund), and still a fill window away from
33
+ * the last moment the SpokePool takes the deposit (the quote time + 3600 s: nothing on chain refuses a deposit that
34
+ * lands after its own fill deadline); no exclusive relayer (this module never names one).
35
+ *
36
+ * Every refusal is an {@link AcrossRefusal} with its own code. Nothing here is asynchronous and nothing reads the
37
+ * network, so the same function runs when a quote is built, again right before signing, and on the client of a
38
+ * remote provider (`acrossPins.verifyQuote` / `verifyBuild`).
39
+ */
40
+
41
+ /** The fee cap when the caller names none: input − output at most 10 % of the input. */
42
+ declare const ACROSS_DEFAULT_MAX_FEE_BPS = 1000;
43
+ /** The widest fee cap a request may ask for (the Across API's own default `maxFee.bps`). */
44
+ declare const ACROSS_MAX_FEE_BPS_LIMIT = 5000;
45
+ /** Tolerated difference between the device clock and the chains'. */
46
+ declare const ACROSS_CLOCK_SKEW_S = 120;
47
+ /**
48
+ * How far ahead of the device's clock a quote time may sit: the SpokePool reverts a deposit whose quote time is ahead
49
+ * of its block, and an honest one is a HubPool block time minutes in the past (or the latest Ethereum block − 60 s),
50
+ * so this only absorbs a device clock that runs slow.
51
+ */
52
+ declare const ACROSS_QUOTE_TIME_AHEAD_S = 15;
53
+ /**
54
+ * Time a deposit is given to land after this check. The quote time must leave at least this much of its on-chain
55
+ * buffer (`depositQuoteTimeBuffer`, 3600 s), or the deposit reverts on the way.
56
+ */
57
+ declare const ACROSS_LANDING_WINDOW_S = 300;
58
+ /** The fill deadline must leave relayers at least this long, counted from the last moment the deposit can land. */
59
+ declare const ACROSS_MIN_FILL_WINDOW_S = 1800;
60
+ /**
61
+ * The furthest a fill deadline may sit from the quote time: two hours, as Across's API puts it on every quote
62
+ * (`fillDeadline = quoteTimestamp + 7200` on every V4 quote and API deposit read 2026-11-14), and ten minutes of margin.
63
+ * An unfilled deposit holds the funds until then, and its refund comes after (Across's settlement bundles).
64
+ */
65
+ declare const ACROSS_MAX_FILL_WINDOW_S = 7800;
66
+ /**
67
+ * The smallest fee a deposit may leave relayers, in millionths of the input, by what is bridged and from where. A
68
+ * relayer pays the output from its own funds and its gas, so a deposit that leaves less than relayers take is not
69
+ * filled and waits two hours for its deadline and then for a refund — while its output, nearly the whole input, would
70
+ * win any comparison of routes. The floors sit at or under the lowest fees plain deposits were filled at over 24 h
71
+ * (2026-11-14, Ethereum, Optimism, Base and Arbitrum): stablecoins 1.0 bp (Across's capital fee, every fill paid it),
72
+ * ETH from Ethereum 0.7 bp (fills at 0.74–0.84), ETH from Optimism, Base or Arbitrum 4.5 bps (capital 3.0+ and LP
73
+ * 1.77 from those origins: fills at 5.0 and up), WBTC 2.5 bps (fills at 3.1; one at 1.03). ETH from any other L2 is
74
+ * 0.7 bp, the lowest any plain ETH deposit was filled at: Across's own relayer quote prices those origins far lower
75
+ * than the studied ones (Linea → Base 1.27 bps, Ink → Base 2.71 bps, live 2026-11-15) and is what prices them, on the
76
+ * server and on the device, so the floor there only refuses dust. A server that names less — a bug, or a hostile one
77
+ * — is refused here, on the device.
78
+ */
79
+ declare const ACROSS_MIN_FEE_PPM: Readonly<{
80
+ stable: 100;
81
+ ethFromEthereum: 70;
82
+ ethFromL2: 450;
83
+ ethFromOtherL2: 70;
84
+ wbtc: 250;
85
+ }>;
86
+ /** The device's fee floor for a route, millionths of the input ({@link ACROSS_MIN_FEE_PPM}). */
87
+ declare function acrossMinFeePpm(route: AcrossRoute): number;
88
+ /** A direct deposit used ~85k gas in Across's own estimate (2026-11-14); a gas limit under this is a paid revert. */
89
+ declare const ACROSS_GAS_FLOOR = 90000n;
90
+ /** Chains that meter gas differently (zkSync) estimate far higher; a stated limit is taken up to this. */
91
+ declare const ACROSS_GAS_CAP = 60000000n;
92
+ /** The longest a quote may claim to live: five minutes plus the clock difference. */
93
+ declare const ACROSS_MAX_QUOTE_LIFE_MS: number;
94
+ /** The latest a quote with this quote time may be signed (ms): while the SpokePool still takes it, with time to land. */
95
+ declare const acrossQuoteTimeLimitMs: (quoteTimestamp: number) => number;
96
+ /**
97
+ * The address a dry quote (pricing only) is asked for when the caller names none. A quote priced with it is never
98
+ * built or signed; the server and a remote client derive the same request from the same parameters with it.
99
+ */
100
+ declare const ACROSS_PLACEHOLDER = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
101
+ /** What the user asked for — the only thing a deposit is compared against. Addresses in any casing. */
102
+ interface AcrossRequest {
103
+ /** CAIP-2 of the chain the deposit is sent on. */
104
+ sourceChain: string;
105
+ /** CAIP-2 of the chain the output is paid on. */
106
+ destChain: string;
107
+ /** Input token contract; the zero address is the native coin. */
108
+ sourceToken: string;
109
+ /** Output token contract; the zero address is the native coin. */
110
+ destToken: string;
111
+ /** Exact input, base units. */
112
+ amount: bigint;
113
+ /** The account that signs the deposit: its `depositor` (refunds, and the only key that can sign a speed-up). */
114
+ depositor: string;
115
+ /** Who receives the output. */
116
+ recipient: string;
117
+ /** The caller's own floor on the output, base units. */
118
+ minAmountOut?: bigint;
119
+ /** Fee cap in bps of the input (default {@link ACROSS_DEFAULT_MAX_FEE_BPS}). */
120
+ maxFeeBps?: number;
121
+ /** The clock (ms) deadlines are judged against; defaults to `Date.now()`. */
122
+ nowMs?: number;
123
+ }
124
+ /** The deposit transaction under check: what is about to be signed, or what a quote carries. */
125
+ interface AcrossDepositTx {
126
+ to?: unknown;
127
+ data?: unknown;
128
+ value?: unknown;
129
+ chainId?: unknown;
130
+ approvalAddress?: unknown;
131
+ }
132
+ /** A deposit that passed the checks: the only shape of call this module signs. */
133
+ interface AcrossDeposit {
134
+ /** The pinned SpokePool, lowercase. */
135
+ to: string;
136
+ /** The canonical calldata, lowercase. */
137
+ data: Hex;
138
+ /** Wei, decimal: the input amount for the native coin, else "0". */
139
+ value: string;
140
+ chainId: number;
141
+ /** ERC-20 input: the spender to approve for exactly the input amount — the pinned SpokePool. */
142
+ approvalAddress?: string;
143
+ }
144
+ interface VerifiedAcrossDeposit {
145
+ route: AcrossRoute;
146
+ args: AcrossDepositArgs;
147
+ deposit: AcrossDeposit;
148
+ /** input − output, in the input token's base units (both sides have the same decimals). */
149
+ fee: bigint;
150
+ }
151
+ /** A request that passed {@link checkAcrossRequest}: its route, the clock it is judged by, its fee cap. */
152
+ interface CheckedAcrossRequest {
153
+ route: AcrossRoute;
154
+ nowS: number;
155
+ maxFeeBps: number;
156
+ }
157
+ /** The request's own sanity and its route (pinned chains, same asset); throws {@link AcrossRefusal}. */
158
+ declare function checkAcrossRequest(r: AcrossRequest): CheckedAcrossRequest;
159
+ /**
160
+ * Check a deposit transaction against the user's request and the pins. Returns the decoded arguments, the route and
161
+ * the deposit as it will be signed; throws {@link AcrossRefusal} otherwise.
162
+ */
163
+ declare function verifyAcrossDeposit(request: AcrossRequest, tx: AcrossDepositTx): VerifiedAcrossDeposit;
164
+ /** The intent id of a deposit: the route and a digest of the exact calldata (`across:<from>:<to>:<16 bytes hex>`). */
165
+ declare function acrossIntentId(sourceChainId: number, destChainId: number, data: Hex): string;
166
+ /** The route an intent id names (a server's `~<tag>` suffix tolerated), or null. */
167
+ declare function parseAcrossIntentId(intentId: string): {
168
+ sourceChainId: number;
169
+ destChainId: number;
170
+ digest: string;
171
+ } | null;
172
+ /**
173
+ * True for typed data an Across speed-up signature would be made over (`UpdateDepositDetails`, or Across's `ACROSS-V2`
174
+ * domain). A wallet can run this on any signing request; nothing this module builds is ever typed data.
175
+ */
176
+ declare function isAcrossSpeedUpTypedData(typedData: unknown): boolean;
177
+ /** The one shape a transaction to sign may have: an EVM call — never typed data, a memo or a serialized transaction. */
178
+ declare function checkAcrossTxShape(tx: UnsignedTx): void;
179
+ /** A refusal's text for a caller that wants a string (`onRefusal`, remote pins); rethrows anything else. */
180
+ declare function acrossRefusalReason(err: unknown): string;
181
+ /**
182
+ * The request a `QuoteParams` describes, for the verifier. `placeholder` (a dry quote: pricing only) fills a missing
183
+ * address.
184
+ *
185
+ * The depositor is `sender`, the account that signs — set by the engine on every execution quote. Across refunds the
186
+ * depositor, and the depositor alone can sign a speed-up that a relayer fills to another recipient or for less
187
+ * (SpokePool.sol `fillRelayWithUpdatedDeposit`, an EIP-712 or EIP-1271 signature of `relayData.depositor`): a refund
188
+ * address the caller names is never made the depositor, and one other than the signer is refused. A live request
189
+ * without `sender` is refused; a dry one is priced for `refundAddress` (or the placeholder).
190
+ */
191
+ declare function acrossRequestOf(params: QuoteParams, opts?: {
192
+ placeholder?: string;
193
+ nowMs?: number;
194
+ maxFeeBps?: number;
195
+ }): AcrossRequest;
196
+ /**
197
+ * What a quote shows of a deposit's fee: `fees` — exactly one included protocol fee of input − output, in the input
198
+ * token (the zero address for the native coin) — and `feeUsd`, the fee itself for a dollar stablecoin (USDC, USDT, one
199
+ * unit a dollar) and 0 for an asset this module has no price for. The engine's fee caps (`maxProtocolFeeBps`) and the
200
+ * router's scoring read these, so a quote is held to them exactly ({@link checkAcrossQuote}).
201
+ */
202
+ declare function acrossQuoteFeesOf(route: AcrossRoute, fee: bigint): Pick<Quote, "fees" | "feeUsd">;
203
+ /**
204
+ * A quote of this provider against the request it answers: its transaction passes {@link verifyAcrossDeposit}, its id
205
+ * names that very calldata, and the amounts it shows are the deposit's (`outputAmount` is what the recipient gets —
206
+ * a relayer pays exactly that), its fees too ({@link acrossQuoteFeesOf}: the engine's fee caps read them), and it
207
+ * claims to live no longer than the SpokePool takes its quote time. Throws {@link AcrossRefusal}. Used on the client
208
+ * of a remote provider and again before a build and a signature.
209
+ */
210
+ declare function checkAcrossQuote(request: AcrossRequest, quote: Quote, tx?: AcrossDepositTx & {
211
+ gasLimit?: unknown;
212
+ }): VerifiedAcrossDeposit;
213
+ /** What the pins hold a remote quote to beyond the user's request: the app's own fee cap. */
214
+ interface AcrossPinsOptions {
215
+ /** Fee cap in bps of the input (default {@link ACROSS_DEFAULT_MAX_FEE_BPS}, at most {@link ACROSS_MAX_FEE_BPS_LIMIT}) — the app's, never the server's. */
216
+ maxFeeBps?: number;
217
+ }
218
+ /** The request a remote quote is held to: the server's own derivation — a dry quote priced for the placeholder where the caller named no address. */
219
+ declare const acrossPinsRequestOf: (params: QuoteParams, cap?: {
220
+ maxFeeBps?: number;
221
+ }) => AcrossRequest;
222
+ /**
223
+ * A remote build against the request the app sent, by the device's clock now: the quote's own deposit, verified again
224
+ * ({@link checkAcrossQuote}). Throws {@link AcrossRefusal}. `acrossPins.verifyBuild` and `acrossRemoteProvider`'s
225
+ * preflight (right before signing) run it.
226
+ */
227
+ declare function acrossCheckBuild(quote: Quote, tx: UnsignedTx, params: QuoteParams | undefined, cap?: {
228
+ maxFeeBps?: number;
229
+ }): VerifiedAcrossDeposit;
230
+ /** `RemotePins.verifyQuote` with the default fee cap: the reason a remote Across quote fails against the user's own request, or null. */
231
+ declare function acrossVerifyQuote(params: QuoteParams, quote: Quote): string | null;
232
+ /** `RemotePins.verifyBuild` with the default fee cap: a remote build must be the quote's own (verified) transaction, and is verified again. */
233
+ declare function acrossVerifyBuild(quote: Quote, tx: UnsignedTx, params?: QuoteParams): string | null;
234
+ /**
235
+ * The app's pins for a remote Across provider (`remoteProvider({name: "across", ...acrossPinsWith({maxFeeBps})})`): the
236
+ * only contract a build may call or approve is the chain's SpokePool, and every quote and build is verified on the
237
+ * client against the user's own request and the app's fee cap — a server's own cap (`acrossProvider({maxFeeBps})`) is
238
+ * not known on this side, so the app states the one it holds remote quotes to. `reasonOf` classifies a text
239
+ * `verifyQuote` / `verifyBuild` returned. Throws a plain `Error` for a cap out of range.
240
+ */
241
+ declare function acrossPinsWith(opts?: AcrossPinsOptions): RemotePins;
242
+ /** {@link acrossPinsWith} with the default fee cap (10 %): `remoteProvider({name: "across", ...acrossPins})`. */
243
+ declare const acrossPins: RemotePins;
244
+
245
+ export { ACROSS_CLOCK_SKEW_S, ACROSS_DEFAULT_MAX_FEE_BPS, ACROSS_GAS_CAP, ACROSS_GAS_FLOOR, ACROSS_LANDING_WINDOW_S, ACROSS_MAX_FEE_BPS_LIMIT, ACROSS_MAX_FILL_WINDOW_S, ACROSS_MAX_QUOTE_LIFE_MS, ACROSS_MIN_FEE_PPM, ACROSS_MIN_FILL_WINDOW_S, ACROSS_PLACEHOLDER, ACROSS_QUOTE_TIME_AHEAD_S, type AcrossDeposit, type AcrossDepositTx, type AcrossPinsOptions, type AcrossRequest, type CheckedAcrossRequest, type VerifiedAcrossDeposit, acrossCheckBuild, acrossIntentId, acrossMinFeePpm, acrossPins, acrossPinsRequestOf, acrossPinsWith, acrossQuoteFeesOf, acrossQuoteTimeLimitMs, acrossRefusalReason, acrossRequestOf, acrossVerifyBuild, acrossVerifyQuote, checkAcrossQuote, checkAcrossRequest, checkAcrossTxShape, isAcrossSpeedUpTypedData, parseAcrossIntentId, verifyAcrossDeposit };
package/dist/verify.js ADDED
@@ -0,0 +1,69 @@
1
+ import {
2
+ ACROSS_CLOCK_SKEW_S,
3
+ ACROSS_DEFAULT_MAX_FEE_BPS,
4
+ ACROSS_GAS_CAP,
5
+ ACROSS_GAS_FLOOR,
6
+ ACROSS_LANDING_WINDOW_S,
7
+ ACROSS_MAX_FEE_BPS_LIMIT,
8
+ ACROSS_MAX_FILL_WINDOW_S,
9
+ ACROSS_MAX_QUOTE_LIFE_MS,
10
+ ACROSS_MIN_FEE_PPM,
11
+ ACROSS_MIN_FILL_WINDOW_S,
12
+ ACROSS_PLACEHOLDER,
13
+ ACROSS_QUOTE_TIME_AHEAD_S,
14
+ acrossCheckBuild,
15
+ acrossIntentId,
16
+ acrossMinFeePpm,
17
+ acrossPins,
18
+ acrossPinsRequestOf,
19
+ acrossPinsWith,
20
+ acrossQuoteFeesOf,
21
+ acrossQuoteTimeLimitMs,
22
+ acrossRefusalReason,
23
+ acrossRequestOf,
24
+ acrossVerifyBuild,
25
+ acrossVerifyQuote,
26
+ checkAcrossQuote,
27
+ checkAcrossRequest,
28
+ checkAcrossTxShape,
29
+ isAcrossSpeedUpTypedData,
30
+ parseAcrossIntentId,
31
+ verifyAcrossDeposit
32
+ } from "./chunk-KATEONJQ.js";
33
+ import "./chunk-32YJEBZX.js";
34
+ import "./chunk-GX67FRPG.js";
35
+ import "./chunk-6Z4GXNLE.js";
36
+ import "./chunk-E5WFOPN2.js";
37
+ export {
38
+ ACROSS_CLOCK_SKEW_S,
39
+ ACROSS_DEFAULT_MAX_FEE_BPS,
40
+ ACROSS_GAS_CAP,
41
+ ACROSS_GAS_FLOOR,
42
+ ACROSS_LANDING_WINDOW_S,
43
+ ACROSS_MAX_FEE_BPS_LIMIT,
44
+ ACROSS_MAX_FILL_WINDOW_S,
45
+ ACROSS_MAX_QUOTE_LIFE_MS,
46
+ ACROSS_MIN_FEE_PPM,
47
+ ACROSS_MIN_FILL_WINDOW_S,
48
+ ACROSS_PLACEHOLDER,
49
+ ACROSS_QUOTE_TIME_AHEAD_S,
50
+ acrossCheckBuild,
51
+ acrossIntentId,
52
+ acrossMinFeePpm,
53
+ acrossPins,
54
+ acrossPinsRequestOf,
55
+ acrossPinsWith,
56
+ acrossQuoteFeesOf,
57
+ acrossQuoteTimeLimitMs,
58
+ acrossRefusalReason,
59
+ acrossRequestOf,
60
+ acrossVerifyBuild,
61
+ acrossVerifyQuote,
62
+ checkAcrossQuote,
63
+ checkAcrossRequest,
64
+ checkAcrossTxShape,
65
+ isAcrossSpeedUpTypedData,
66
+ parseAcrossIntentId,
67
+ verifyAcrossDeposit
68
+ };
69
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/module.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@anywalletkit/protocol-swap2-across",
3
+ "type": "swap2",
4
+ "chains": [
5
+ "eip155:1",
6
+ "eip155:10",
7
+ "eip155:130",
8
+ "eip155:137",
9
+ "eip155:143",
10
+ "eip155:324",
11
+ "eip155:480",
12
+ "eip155:999",
13
+ "eip155:4326",
14
+ "eip155:4663",
15
+ "eip155:5042",
16
+ "eip155:8453",
17
+ "eip155:9745",
18
+ "eip155:42161",
19
+ "eip155:43114",
20
+ "eip155:57073",
21
+ "eip155:59144"
22
+ ],
23
+ "tier": "core",
24
+ "maintainers": [
25
+ "@ultratestbro"
26
+ ],
27
+ "conformance": "0.x",
28
+ "repo": "https://github.com/ultratestbro/anywalletkit",
29
+ "path": "packages/protocol-swap2-across",
30
+ "description": "Across Protocol with the SpokePool deposit built and verified on the device: EVM-to-EVM bridges of the same asset (USDC, USDT / USDT0, ETH / WETH, WBTC) between 17 chains. A plain deposit is encoded here from pinned SpokePools and the user's request, and every argument — depositor, recipient, tokens, amounts, destination, empty message, deadlines, a per-asset fee floor — is held to that request before signing; priced from Across API V5 against Across's relayer fee, V5's own execution steps never run; the API key stays on a server (acrossRemoteProvider in the app); status is read on chain.",
31
+ "addedAt": "2026-11-15"
32
+ }
package/package.json CHANGED
@@ -1,6 +1,127 @@
1
1
  {
2
2
  "name": "@anywalletkit/protocol-swap2-across",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Across Protocol for the swap2 engine, with the SpokePool deposit built and verified on the device: a plain deposit encoded here from pinned SpokePools and the user's request, every argument held to that request (depositor, recipient, tokens, amounts, destination, empty message, deadlines, a per-asset fee floor) at build time and right before signing; priced from Across API V5 against Across's relayer fee (V5's own execution steps never run), the key kept on a server; status read on chain. EVM to EVM, the same asset on both sides.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://docs.anywallet.tech",
7
+ "bugs": {
8
+ "url": "https://github.com/ultratestbro/anywalletkit/issues"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/ultratestbro/anywalletkit.git",
13
+ "directory": "packages/protocol-swap2-across"
14
+ },
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">=22"
18
+ },
19
+ "sideEffects": false,
20
+ "main": "./dist/index.cjs",
21
+ "module": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js",
27
+ "require": "./dist/index.cjs"
28
+ },
29
+ "./config": {
30
+ "types": "./dist/config.d.ts",
31
+ "import": "./dist/config.js",
32
+ "require": "./dist/config.cjs"
33
+ },
34
+ "./deposit": {
35
+ "types": "./dist/deposit.d.ts",
36
+ "import": "./dist/deposit.js",
37
+ "require": "./dist/deposit.cjs"
38
+ },
39
+ "./verify": {
40
+ "types": "./dist/verify.d.ts",
41
+ "import": "./dist/verify.js",
42
+ "require": "./dist/verify.cjs"
43
+ },
44
+ "./build": {
45
+ "types": "./dist/build.d.ts",
46
+ "import": "./dist/build.js",
47
+ "require": "./dist/build.cjs"
48
+ },
49
+ "./status": {
50
+ "types": "./dist/status.d.ts",
51
+ "import": "./dist/status.js",
52
+ "require": "./dist/status.cjs"
53
+ },
54
+ "./api": {
55
+ "types": "./dist/api.d.ts",
56
+ "import": "./dist/api.js",
57
+ "require": "./dist/api.cjs"
58
+ },
59
+ "./pricing": {
60
+ "types": "./dist/pricing.d.ts",
61
+ "import": "./dist/pricing.js",
62
+ "require": "./dist/pricing.cjs"
63
+ },
64
+ "./provider": {
65
+ "types": "./dist/provider.d.ts",
66
+ "import": "./dist/provider.js",
67
+ "require": "./dist/provider.cjs"
68
+ },
69
+ "./remote": {
70
+ "types": "./dist/remote.d.ts",
71
+ "import": "./dist/remote.js",
72
+ "require": "./dist/remote.cjs"
73
+ },
74
+ "./protocol": {
75
+ "types": "./dist/protocol.d.ts",
76
+ "import": "./dist/protocol.js",
77
+ "require": "./dist/protocol.cjs"
78
+ },
79
+ "./activity": {
80
+ "types": "./dist/activity.d.ts",
81
+ "import": "./dist/activity.js",
82
+ "require": "./dist/activity.cjs"
83
+ },
84
+ "./package.json": "./package.json"
85
+ },
86
+ "files": [
87
+ "dist",
88
+ "README.md",
89
+ "module.json"
90
+ ],
91
+ "dependencies": {
92
+ "viem": "^2.57.2",
93
+ "@anywalletkit/protocol-swap2-core": "0.14.0",
94
+ "@anywalletkit/swap2-assets": "0.3.0"
95
+ },
96
+ "peerDependencies": {
97
+ "@anywalletkit/core": "0.8.0"
98
+ },
99
+ "devDependencies": {
100
+ "@types/node": "^22",
101
+ "vitest": "^5.1.0",
102
+ "@anywalletkit/conformance": "0.6.0",
103
+ "@anywalletkit/history-evm": "0.2.0",
104
+ "@anywalletkit/protocol-swap2-router": "0.6.2",
105
+ "@anywalletkit/core": "0.8.0"
106
+ },
107
+ "keywords": [
108
+ "swap2",
109
+ "bridge",
110
+ "across",
111
+ "across-protocol",
112
+ "spokepool",
113
+ "intents",
114
+ "anywalletkit"
115
+ ],
116
+ "publishConfig": {
117
+ "access": "public",
118
+ "provenance": true
119
+ },
120
+ "scripts": {
121
+ "build": "tsup",
122
+ "typecheck": "tsc --noEmit",
123
+ "test": "vitest run",
124
+ "lint": "eslint src",
125
+ "verify:live": "node scripts/verify-live.mjs"
126
+ }
6
127
  }