@bananapus/nana-sdk-core 2.41.3 → 3.0.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/dist/cjs/review/decode.js +1 -1
- package/dist/cjs/review/decode.js.map +1 -1
- package/dist/cjs/v6/index.d.ts +0 -1
- package/dist/cjs/v6/index.d.ts.map +1 -1
- package/dist/cjs/v6/index.js +0 -1
- package/dist/cjs/v6/index.js.map +1 -1
- package/dist/cjs/v6/pay.d.ts +89 -35
- package/dist/cjs/v6/pay.d.ts.map +1 -1
- package/dist/cjs/v6/pay.js +285 -41
- package/dist/cjs/v6/pay.js.map +1 -1
- package/dist/esm/review/decode.js +1 -1
- package/dist/esm/review/decode.js.map +1 -1
- package/dist/esm/v6/index.d.ts +0 -1
- package/dist/esm/v6/index.d.ts.map +1 -1
- package/dist/esm/v6/index.js +0 -1
- package/dist/esm/v6/index.js.map +1 -1
- package/dist/esm/v6/pay.d.ts +89 -35
- package/dist/esm/v6/pay.d.ts.map +1 -1
- package/dist/esm/v6/pay.js +285 -43
- package/dist/esm/v6/pay.js.map +1 -1
- package/package.json +1 -6
- package/dist/cjs/v6/directPay.d.ts +0 -69
- package/dist/cjs/v6/directPay.d.ts.map +0 -1
- package/dist/cjs/v6/directPay.js +0 -391
- package/dist/cjs/v6/directPay.js.map +0 -1
- package/dist/esm/v6/directPay.d.ts +0 -69
- package/dist/esm/v6/directPay.d.ts.map +0 -1
- package/dist/esm/v6/directPay.js +0 -385
- package/dist/esm/v6/directPay.js.map +0 -1
package/dist/cjs/v6/directPay.js
DELETED
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NATIVE_SWAP_BY_CHAIN = void 0;
|
|
4
|
-
exports.quoteDirectPaySwap = quoteDirectPaySwap;
|
|
5
|
-
exports.buildDirectPaySwapTx = buildDirectPaySwapTx;
|
|
6
|
-
exports.addPermit2SignatureToDirectPaySwap = addPermit2SignatureToDirectPaySwap;
|
|
7
|
-
const viem_1 = require("viem");
|
|
8
|
-
const constants_js_1 = require("../constants.js");
|
|
9
|
-
const pay_js_1 = require("./pay.js");
|
|
10
|
-
const uniswapV4_js_1 = require("./uniswapV4.js");
|
|
11
|
-
/** Canonical WETH/USDC V3 bridge used by direct-pay swaps on all v6 mainnets. */
|
|
12
|
-
exports.NATIVE_SWAP_BY_CHAIN = {
|
|
13
|
-
1: {
|
|
14
|
-
wrappedNative: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
15
|
-
bridgeToken: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
16
|
-
v3Quoter: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
17
|
-
},
|
|
18
|
-
10: {
|
|
19
|
-
wrappedNative: "0x4200000000000000000000000000000000000006",
|
|
20
|
-
bridgeToken: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
21
|
-
v3Quoter: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
22
|
-
},
|
|
23
|
-
8453: {
|
|
24
|
-
wrappedNative: "0x4200000000000000000000000000000000000006",
|
|
25
|
-
bridgeToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
26
|
-
v3Quoter: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
|
|
27
|
-
},
|
|
28
|
-
42161: {
|
|
29
|
-
wrappedNative: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
30
|
-
bridgeToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
31
|
-
v3Quoter: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
const V3_FEES = [100, 500, 3_000, 10_000];
|
|
35
|
-
const ADDRESS_THIS = "0x0000000000000000000000000000000000000002";
|
|
36
|
-
const CONTRACT_BALANCE = 1n << 255n;
|
|
37
|
-
const UINT128_MAX = (1n << 128n) - 1n;
|
|
38
|
-
const v3QuoterAbi = [
|
|
39
|
-
{
|
|
40
|
-
type: "function",
|
|
41
|
-
name: "quoteExactInputSingle",
|
|
42
|
-
stateMutability: "nonpayable",
|
|
43
|
-
inputs: [
|
|
44
|
-
{
|
|
45
|
-
name: "params",
|
|
46
|
-
type: "tuple",
|
|
47
|
-
components: [
|
|
48
|
-
{ name: "tokenIn", type: "address" },
|
|
49
|
-
{ name: "tokenOut", type: "address" },
|
|
50
|
-
{ name: "amountIn", type: "uint256" },
|
|
51
|
-
{ name: "fee", type: "uint24" },
|
|
52
|
-
{ name: "sqrtPriceLimitX96", type: "uint160" },
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
outputs: [
|
|
57
|
-
{ name: "amountOut", type: "uint256" },
|
|
58
|
-
{ name: "sqrtPriceX96After", type: "uint160" },
|
|
59
|
-
{ name: "initializedTicksCrossed", type: "uint32" },
|
|
60
|
-
{ name: "gasEstimate", type: "uint256" },
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
];
|
|
64
|
-
const universalRouterAbi = [
|
|
65
|
-
{
|
|
66
|
-
type: "function",
|
|
67
|
-
name: "execute",
|
|
68
|
-
stateMutability: "payable",
|
|
69
|
-
inputs: [
|
|
70
|
-
{ name: "commands", type: "bytes" },
|
|
71
|
-
{ name: "inputs", type: "bytes[]" },
|
|
72
|
-
{ name: "deadline", type: "uint256" },
|
|
73
|
-
],
|
|
74
|
-
outputs: [],
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
function isNative(token) {
|
|
78
|
-
return token.toLowerCase() === constants_js_1.NATIVE_TOKEN.toLowerCase();
|
|
79
|
-
}
|
|
80
|
-
async function quoteV3ExactInput({ client, config, tokenIn, tokenOut, amountIn, }) {
|
|
81
|
-
const quotes = await Promise.all(V3_FEES.map(async (fee) => {
|
|
82
|
-
try {
|
|
83
|
-
const call = await client.call({
|
|
84
|
-
to: config.v3Quoter,
|
|
85
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
86
|
-
abi: v3QuoterAbi,
|
|
87
|
-
functionName: "quoteExactInputSingle",
|
|
88
|
-
args: [
|
|
89
|
-
{
|
|
90
|
-
tokenIn,
|
|
91
|
-
tokenOut,
|
|
92
|
-
amountIn,
|
|
93
|
-
fee,
|
|
94
|
-
sqrtPriceLimitX96: 0n,
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
if (!call.data)
|
|
100
|
-
return null;
|
|
101
|
-
const [amountOut] = (0, viem_1.decodeFunctionResult)({
|
|
102
|
-
abi: v3QuoterAbi,
|
|
103
|
-
functionName: "quoteExactInputSingle",
|
|
104
|
-
data: call.data,
|
|
105
|
-
});
|
|
106
|
-
return amountOut > 0n ? { fee, amountOut } : null;
|
|
107
|
-
}
|
|
108
|
-
catch {
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
}));
|
|
112
|
-
return quotes.reduce((best, quote) => !quote || (best && best.amountOut >= quote.amountOut) ? best : quote, null);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Quote the best direct pool purchase, including the atomic ETH/USDC V3 bridge
|
|
116
|
-
* when the user's payment currency differs from the hooked V4 pool currency.
|
|
117
|
-
* Returns null unless its slippage-protected minimum beats terminal payment.
|
|
118
|
-
*/
|
|
119
|
-
async function quoteDirectPaySwap({ client, chainId, poolKey, pairIsCurrency0, paymentToken, amount, payPreview, paySettlement = "issuance", slippageBps = 100n, }) {
|
|
120
|
-
if (!(0, uniswapV4_js_1.uniswapV4Deployment)(chainId)?.universalRouter || amount <= 0n) {
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
const currencyIn = pairIsCurrency0 ? poolKey.currency0 : poolKey.currency1;
|
|
124
|
-
const normalizedPayment = isNative(paymentToken)
|
|
125
|
-
? viem_1.zeroAddress
|
|
126
|
-
: paymentToken.toLowerCase();
|
|
127
|
-
let v4AmountIn = amount;
|
|
128
|
-
let inputRoute = { kind: "single-v4" };
|
|
129
|
-
if (currencyIn.toLowerCase() !== normalizedPayment) {
|
|
130
|
-
const config = exports.NATIVE_SWAP_BY_CHAIN[chainId];
|
|
131
|
-
const canBridgeNative = !!config &&
|
|
132
|
-
isNative(paymentToken) &&
|
|
133
|
-
currencyIn.toLowerCase() === config.bridgeToken.toLowerCase();
|
|
134
|
-
const canBridgeUsdcToNative = !!config &&
|
|
135
|
-
paymentToken.toLowerCase() === config.bridgeToken.toLowerCase() &&
|
|
136
|
-
currencyIn.toLowerCase() === viem_1.zeroAddress;
|
|
137
|
-
if (!config || (!canBridgeNative && !canBridgeUsdcToNative))
|
|
138
|
-
return null;
|
|
139
|
-
const bridgeQuote = await quoteV3ExactInput({
|
|
140
|
-
client,
|
|
141
|
-
config,
|
|
142
|
-
tokenIn: canBridgeNative ? config.wrappedNative : config.bridgeToken,
|
|
143
|
-
tokenOut: canBridgeNative ? config.bridgeToken : config.wrappedNative,
|
|
144
|
-
amountIn: amount,
|
|
145
|
-
});
|
|
146
|
-
if (!bridgeQuote)
|
|
147
|
-
return null;
|
|
148
|
-
v4AmountIn = bridgeQuote.amountOut;
|
|
149
|
-
inputRoute = canBridgeNative
|
|
150
|
-
? {
|
|
151
|
-
kind: "native-v3-v4",
|
|
152
|
-
wrappedNative: config.wrappedNative,
|
|
153
|
-
bridgeToken: config.bridgeToken,
|
|
154
|
-
bridgeTokenSymbol: "USDC",
|
|
155
|
-
bridgeTokenDecimals: 6,
|
|
156
|
-
v3Fee: bridgeQuote.fee,
|
|
157
|
-
quotedBridgeAmount: bridgeQuote.amountOut,
|
|
158
|
-
}
|
|
159
|
-
: {
|
|
160
|
-
kind: "erc20-v3-native-v4",
|
|
161
|
-
inputToken: config.bridgeToken,
|
|
162
|
-
wrappedNative: config.wrappedNative,
|
|
163
|
-
bridgeTokenSymbol: "ETH",
|
|
164
|
-
bridgeTokenDecimals: 18,
|
|
165
|
-
v3Fee: bridgeQuote.fee,
|
|
166
|
-
quotedBridgeAmount: bridgeQuote.amountOut,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
const quotedTokenCount = await (0, uniswapV4_js_1.quoteUniswapV4ExactInputSingle)(client, {
|
|
170
|
-
chainId,
|
|
171
|
-
poolKey,
|
|
172
|
-
zeroForOne: pairIsCurrency0,
|
|
173
|
-
amountIn: v4AmountIn,
|
|
174
|
-
});
|
|
175
|
-
const best = (0, pay_js_1.chooseBestPayRoute)({
|
|
176
|
-
pay: payPreview,
|
|
177
|
-
paySettlement,
|
|
178
|
-
directSwapQuote: quotedTokenCount,
|
|
179
|
-
slippageBps,
|
|
180
|
-
});
|
|
181
|
-
if (best.kind !== "direct-swap")
|
|
182
|
-
return null;
|
|
183
|
-
return {
|
|
184
|
-
kind: "direct-swap",
|
|
185
|
-
poolKey,
|
|
186
|
-
zeroForOne: pairIsCurrency0,
|
|
187
|
-
quotedTokenCount,
|
|
188
|
-
minimumTokenCount: best.beneficiaryTokenCount,
|
|
189
|
-
beneficiaryTokenCount: best.beneficiaryTokenCount,
|
|
190
|
-
reservedTokenCount: 0n,
|
|
191
|
-
inputRoute,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function encodeV4SwapFromRouterBalance({ quote, recipient, currencyIn, }) {
|
|
195
|
-
const swap = (0, viem_1.encodeAbiParameters)([
|
|
196
|
-
{
|
|
197
|
-
type: "tuple",
|
|
198
|
-
components: [
|
|
199
|
-
{
|
|
200
|
-
type: "tuple",
|
|
201
|
-
components: [
|
|
202
|
-
{ type: "address" },
|
|
203
|
-
{ type: "address" },
|
|
204
|
-
{ type: "uint24" },
|
|
205
|
-
{ type: "int24" },
|
|
206
|
-
{ type: "address" },
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
|
-
{ type: "bool" },
|
|
210
|
-
{ type: "uint128" },
|
|
211
|
-
{ type: "uint128" },
|
|
212
|
-
{ type: "bytes" },
|
|
213
|
-
],
|
|
214
|
-
},
|
|
215
|
-
], [
|
|
216
|
-
[
|
|
217
|
-
[
|
|
218
|
-
quote.poolKey.currency0,
|
|
219
|
-
quote.poolKey.currency1,
|
|
220
|
-
quote.poolKey.fee,
|
|
221
|
-
quote.poolKey.tickSpacing,
|
|
222
|
-
quote.poolKey.hooks,
|
|
223
|
-
],
|
|
224
|
-
quote.zeroForOne,
|
|
225
|
-
0n,
|
|
226
|
-
quote.minimumTokenCount,
|
|
227
|
-
"0x",
|
|
228
|
-
],
|
|
229
|
-
]);
|
|
230
|
-
const settle = (0, viem_1.encodeAbiParameters)([{ type: "address" }, { type: "uint256" }, { type: "bool" }], [currencyIn, CONTRACT_BALANCE, false]);
|
|
231
|
-
const currencyOut = quote.zeroForOne
|
|
232
|
-
? quote.poolKey.currency1
|
|
233
|
-
: quote.poolKey.currency0;
|
|
234
|
-
const take = (0, viem_1.encodeAbiParameters)([{ type: "address" }, { type: "address" }, { type: "uint256" }], [currencyOut, recipient, 0n]);
|
|
235
|
-
return (0, viem_1.encodeAbiParameters)([{ type: "bytes" }, { type: "bytes[]" }], ["0x0b060e", [settle, swap, take]]);
|
|
236
|
-
}
|
|
237
|
-
/** Build the atomic Universal Router transaction for a direct-pay quote. */
|
|
238
|
-
function buildDirectPaySwapTx({ chainId, quote, amount, recipient, deadline, }) {
|
|
239
|
-
if (quote.inputRoute.kind === "single-v4") {
|
|
240
|
-
return (0, uniswapV4_js_1.buildUniswapV4ExactInputSwapTx)({
|
|
241
|
-
chainId,
|
|
242
|
-
poolKey: quote.poolKey,
|
|
243
|
-
zeroForOne: quote.zeroForOne,
|
|
244
|
-
amountIn: amount,
|
|
245
|
-
minimumAmountOut: quote.minimumTokenCount,
|
|
246
|
-
recipient,
|
|
247
|
-
deadline,
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
if (amount <= 0n || amount > UINT128_MAX || quote.minimumTokenCount <= 0n) {
|
|
251
|
-
throw new Error("Swap amounts are outside the supported range.");
|
|
252
|
-
}
|
|
253
|
-
const config = exports.NATIVE_SWAP_BY_CHAIN[chainId];
|
|
254
|
-
const router = (0, uniswapV4_js_1.uniswapV4Deployment)(chainId)?.universalRouter;
|
|
255
|
-
if (!config || !router) {
|
|
256
|
-
throw new Error("No supported native bridge route on this chain.");
|
|
257
|
-
}
|
|
258
|
-
if (quote.inputRoute.kind === "erc20-v3-native-v4") {
|
|
259
|
-
if (quote.inputRoute.inputToken.toLowerCase() !==
|
|
260
|
-
config.bridgeToken.toLowerCase() ||
|
|
261
|
-
quote.inputRoute.wrappedNative.toLowerCase() !==
|
|
262
|
-
config.wrappedNative.toLowerCase()) {
|
|
263
|
-
throw new Error("This ERC-20 bridge route is not supported on this chain.");
|
|
264
|
-
}
|
|
265
|
-
const v3Input = (0, viem_1.encodeAbiParameters)([
|
|
266
|
-
{ type: "address" },
|
|
267
|
-
{ type: "uint256" },
|
|
268
|
-
{ type: "uint256" },
|
|
269
|
-
{ type: "bytes" },
|
|
270
|
-
{ type: "bool" },
|
|
271
|
-
], [
|
|
272
|
-
ADDRESS_THIS,
|
|
273
|
-
amount,
|
|
274
|
-
0n,
|
|
275
|
-
(0, viem_1.encodePacked)(["address", "uint24", "address"], [
|
|
276
|
-
quote.inputRoute.inputToken,
|
|
277
|
-
quote.inputRoute.v3Fee,
|
|
278
|
-
quote.inputRoute.wrappedNative,
|
|
279
|
-
]),
|
|
280
|
-
true,
|
|
281
|
-
]);
|
|
282
|
-
const unwrapInput = (0, viem_1.encodeAbiParameters)([{ type: "address" }, { type: "uint256" }], [ADDRESS_THIS, 0n]);
|
|
283
|
-
const v4Input = encodeV4SwapFromRouterBalance({
|
|
284
|
-
quote,
|
|
285
|
-
recipient,
|
|
286
|
-
currencyIn: viem_1.zeroAddress,
|
|
287
|
-
});
|
|
288
|
-
return {
|
|
289
|
-
chainId,
|
|
290
|
-
address: router,
|
|
291
|
-
abi: universalRouterAbi,
|
|
292
|
-
functionName: "execute",
|
|
293
|
-
args: [
|
|
294
|
-
"0x000c10",
|
|
295
|
-
[v3Input, unwrapInput, v4Input],
|
|
296
|
-
deadline,
|
|
297
|
-
],
|
|
298
|
-
value: 0n,
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
if (quote.inputRoute.bridgeToken.toLowerCase() !==
|
|
302
|
-
config.bridgeToken.toLowerCase() ||
|
|
303
|
-
quote.inputRoute.wrappedNative.toLowerCase() !==
|
|
304
|
-
config.wrappedNative.toLowerCase()) {
|
|
305
|
-
throw new Error("This native bridge route is not supported on this chain.");
|
|
306
|
-
}
|
|
307
|
-
const wrapInput = (0, viem_1.encodeAbiParameters)([{ type: "address" }, { type: "uint256" }], [ADDRESS_THIS, amount]);
|
|
308
|
-
const v3Input = (0, viem_1.encodeAbiParameters)([
|
|
309
|
-
{ type: "address" },
|
|
310
|
-
{ type: "uint256" },
|
|
311
|
-
{ type: "uint256" },
|
|
312
|
-
{ type: "bytes" },
|
|
313
|
-
{ type: "bool" },
|
|
314
|
-
], [
|
|
315
|
-
ADDRESS_THIS,
|
|
316
|
-
amount,
|
|
317
|
-
0n,
|
|
318
|
-
(0, viem_1.encodePacked)(["address", "uint24", "address"], [
|
|
319
|
-
quote.inputRoute.wrappedNative,
|
|
320
|
-
quote.inputRoute.v3Fee,
|
|
321
|
-
quote.inputRoute.bridgeToken,
|
|
322
|
-
]),
|
|
323
|
-
false,
|
|
324
|
-
]);
|
|
325
|
-
const v4Input = encodeV4SwapFromRouterBalance({
|
|
326
|
-
quote,
|
|
327
|
-
recipient,
|
|
328
|
-
currencyIn: quote.inputRoute.bridgeToken,
|
|
329
|
-
});
|
|
330
|
-
return {
|
|
331
|
-
chainId,
|
|
332
|
-
address: router,
|
|
333
|
-
abi: universalRouterAbi,
|
|
334
|
-
functionName: "execute",
|
|
335
|
-
args: ["0x0b0010", [wrapInput, v3Input, v4Input], deadline],
|
|
336
|
-
value: amount,
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
/** Prepend Universal Router's PERMIT2_PERMIT command to a reviewed swap. */
|
|
340
|
-
function addPermit2SignatureToDirectPaySwap(request, authorization, signature) {
|
|
341
|
-
if (request.address.toLowerCase() !== authorization.spender.toLowerCase()) {
|
|
342
|
-
throw new Error("The reviewed Permit2 authorization does not match the swap.");
|
|
343
|
-
}
|
|
344
|
-
const [commands, inputs, deadline] = request.args;
|
|
345
|
-
const commandShape = commands.toLowerCase();
|
|
346
|
-
const supportedShape = (commandShape === "0x10" && inputs.length === 1) ||
|
|
347
|
-
(commandShape === "0x000c10" && inputs.length === 3);
|
|
348
|
-
if (!supportedShape) {
|
|
349
|
-
throw new Error("The reviewed swap has an unsupported Universal Router shape.");
|
|
350
|
-
}
|
|
351
|
-
const permitInput = (0, viem_1.encodeAbiParameters)([
|
|
352
|
-
{
|
|
353
|
-
type: "tuple",
|
|
354
|
-
components: [
|
|
355
|
-
{
|
|
356
|
-
type: "tuple",
|
|
357
|
-
components: [
|
|
358
|
-
{ type: "address" },
|
|
359
|
-
{ type: "uint160" },
|
|
360
|
-
{ type: "uint48" },
|
|
361
|
-
{ type: "uint48" },
|
|
362
|
-
],
|
|
363
|
-
},
|
|
364
|
-
{ type: "address" },
|
|
365
|
-
{ type: "uint256" },
|
|
366
|
-
],
|
|
367
|
-
},
|
|
368
|
-
{ type: "bytes" },
|
|
369
|
-
], [
|
|
370
|
-
[
|
|
371
|
-
[
|
|
372
|
-
authorization.token,
|
|
373
|
-
authorization.amount,
|
|
374
|
-
authorization.expiration,
|
|
375
|
-
authorization.nonce,
|
|
376
|
-
],
|
|
377
|
-
authorization.spender,
|
|
378
|
-
authorization.sigDeadline,
|
|
379
|
-
],
|
|
380
|
-
signature,
|
|
381
|
-
]);
|
|
382
|
-
return {
|
|
383
|
-
...request,
|
|
384
|
-
args: [
|
|
385
|
-
`0x0a${commands.slice(2)}`,
|
|
386
|
-
[permitInput, ...inputs],
|
|
387
|
-
deadline,
|
|
388
|
-
],
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
//# sourceMappingURL=directPay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directPay.js","sourceRoot":"","sources":["../../../src/v6/directPay.ts"],"names":[],"mappings":";;;AAkMA,gDA+FC;AAmED,oDA0IC;AAGD,gFA8DC;AA/iBD,+BAMc;AAEd,kDAA+C;AAE/C,qCAIkB;AAElB,iDAKwB;AAQxB,iFAAiF;AACpE,QAAA,oBAAoB,GAE7B;IACF,CAAC,EAAE;QACD,aAAa,EAAE,4CAA4C;QAC3D,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,4CAA4C;KACvD;IACD,EAAE,EAAE;QACF,aAAa,EAAE,4CAA4C;QAC3D,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,4CAA4C;KACvD;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,4CAA4C;QAC3D,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,4CAA4C;KACvD;IACD,KAAK,EAAE;QACL,aAAa,EAAE,4CAA4C;QAC3D,WAAW,EAAE,4CAA4C;QACzD,QAAQ,EAAE,4CAA4C;KACvD;CACF,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AACnD,MAAM,YAAY,GAAG,4CAAuD,CAAC;AAC7E,MAAM,gBAAgB,GAAG,EAAE,IAAI,IAAI,CAAC;AACpC,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AAEtC,MAAM,WAAW,GAAG;IAClB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,uBAAuB;QAC7B,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE;oBACV,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;oBACpC,EAAE,IAAI,EAAE,UA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;SACF;QACD,EAAE,IAAI,EAAE,OAAO,EAAE;KAClB,EACD;QACE;YACE;gBACE,aAAa,CAAC,KAAK;gBACnB,aAAa,CAAC,MAAM;gBACpB,aAAa,CAAC,UAAU;gBACxB,aAAa,CAAC,KAAK;aACpB;YACD,aAAa,CAAC,OAAO;YACrB,aAAa,CAAC,WAAW;SAC1B;QACD,SAAS;KACV,CACF,CAAC;IACF,OAAO;QACL,GAAG,OAAO;QACV,IAAI,EAAE;YACJ,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAS;YACjC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC;YACxB,QAAQ;SACT;KACyC,CAAC;AAC/C,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex, PublicClient } from "viem";
|
|
2
|
-
import type { JBChainId } from "../types.js";
|
|
3
|
-
import { type PayPreview, type PaySettlement } from "./pay.js";
|
|
4
|
-
import type { Permit2SignatureAuthorization } from "./permit2.js";
|
|
5
|
-
import { type UniswapV4PoolKey } from "./uniswapV4.js";
|
|
6
|
-
export interface NativeSwapConfig {
|
|
7
|
-
wrappedNative: Address;
|
|
8
|
-
bridgeToken: Address;
|
|
9
|
-
v3Quoter: Address;
|
|
10
|
-
}
|
|
11
|
-
/** Canonical WETH/USDC V3 bridge used by direct-pay swaps on all v6 mainnets. */
|
|
12
|
-
export declare const NATIVE_SWAP_BY_CHAIN: Readonly<Partial<Record<JBChainId, NativeSwapConfig>>>;
|
|
13
|
-
export type DirectPayInputRoute = {
|
|
14
|
-
kind: "single-v4";
|
|
15
|
-
} | {
|
|
16
|
-
kind: "native-v3-v4";
|
|
17
|
-
wrappedNative: Address;
|
|
18
|
-
bridgeToken: Address;
|
|
19
|
-
bridgeTokenSymbol: "USDC";
|
|
20
|
-
bridgeTokenDecimals: 6;
|
|
21
|
-
v3Fee: number;
|
|
22
|
-
quotedBridgeAmount: bigint;
|
|
23
|
-
} | {
|
|
24
|
-
kind: "erc20-v3-native-v4";
|
|
25
|
-
inputToken: Address;
|
|
26
|
-
wrappedNative: Address;
|
|
27
|
-
bridgeTokenSymbol: "ETH";
|
|
28
|
-
bridgeTokenDecimals: 18;
|
|
29
|
-
v3Fee: number;
|
|
30
|
-
quotedBridgeAmount: bigint;
|
|
31
|
-
};
|
|
32
|
-
export interface DirectPaySwapQuote {
|
|
33
|
-
kind: "direct-swap";
|
|
34
|
-
poolKey: UniswapV4PoolKey;
|
|
35
|
-
zeroForOne: boolean;
|
|
36
|
-
quotedTokenCount: bigint;
|
|
37
|
-
/** Protected minimum and the beneficiary's direct-swap token count. */
|
|
38
|
-
minimumTokenCount: bigint;
|
|
39
|
-
beneficiaryTokenCount: bigint;
|
|
40
|
-
reservedTokenCount: 0n;
|
|
41
|
-
inputRoute: DirectPayInputRoute;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Quote the best direct pool purchase, including the atomic ETH/USDC V3 bridge
|
|
45
|
-
* when the user's payment currency differs from the hooked V4 pool currency.
|
|
46
|
-
* Returns null unless its slippage-protected minimum beats terminal payment.
|
|
47
|
-
*/
|
|
48
|
-
export declare function quoteDirectPaySwap({ client, chainId, poolKey, pairIsCurrency0, paymentToken, amount, payPreview, paySettlement, slippageBps, }: {
|
|
49
|
-
client: PublicClient;
|
|
50
|
-
chainId: JBChainId;
|
|
51
|
-
poolKey: UniswapV4PoolKey;
|
|
52
|
-
pairIsCurrency0: boolean;
|
|
53
|
-
paymentToken: Address;
|
|
54
|
-
amount: bigint;
|
|
55
|
-
payPreview: PayPreview;
|
|
56
|
-
paySettlement?: PaySettlement;
|
|
57
|
-
slippageBps?: bigint;
|
|
58
|
-
}): Promise<DirectPaySwapQuote | null>;
|
|
59
|
-
/** Build the atomic Universal Router transaction for a direct-pay quote. */
|
|
60
|
-
export declare function buildDirectPaySwapTx({ chainId, quote, amount, recipient, deadline, }: {
|
|
61
|
-
chainId: JBChainId;
|
|
62
|
-
quote: DirectPaySwapQuote;
|
|
63
|
-
amount: bigint;
|
|
64
|
-
recipient: Address;
|
|
65
|
-
deadline: bigint;
|
|
66
|
-
}): import("./uniswapV4.js").UniswapV4SwapTxRequest;
|
|
67
|
-
/** Prepend Universal Router's PERMIT2_PERMIT command to a reviewed swap. */
|
|
68
|
-
export declare function addPermit2SignatureToDirectPaySwap(request: ReturnType<typeof buildDirectPaySwapTx>, authorization: Permit2SignatureAuthorization, signature: Hex): ReturnType<typeof buildDirectPaySwapTx>;
|
|
69
|
-
//# sourceMappingURL=directPay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directPay.d.ts","sourceRoot":"","sources":["../../../src/v6/directPay.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CACzC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAsB7C,CAAC;AAgDF,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE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