@bananapus/nana-sdk-core 3.3.0 → 3.4.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.
- package/dist/cjs/review/heldWrite.js +1 -1
- package/dist/cjs/review/heldWrite.js.map +1 -1
- package/dist/cjs/review/messages.d.ts +3 -1
- package/dist/cjs/review/messages.d.ts.map +1 -1
- package/dist/cjs/review/messages.js +4 -2
- package/dist/cjs/review/messages.js.map +1 -1
- package/dist/cjs/review/writeHold.d.ts +9 -6
- package/dist/cjs/review/writeHold.d.ts.map +1 -1
- package/dist/cjs/review/writeHold.js +12 -4
- package/dist/cjs/review/writeHold.js.map +1 -1
- package/dist/cjs/review/writeRecovery.d.ts +3 -2
- package/dist/cjs/review/writeRecovery.d.ts.map +1 -1
- package/dist/cjs/review/writeRecovery.js +3 -2
- package/dist/cjs/review/writeRecovery.js.map +1 -1
- package/dist/cjs/v6/defifa.d.ts +4 -2
- package/dist/cjs/v6/defifa.d.ts.map +1 -1
- package/dist/cjs/v6/defifa.js +10 -6
- package/dist/cjs/v6/defifa.js.map +1 -1
- package/dist/cjs/v6/executionErrors.d.ts +69 -11
- package/dist/cjs/v6/executionErrors.d.ts.map +1 -1
- package/dist/cjs/v6/executionErrors.js +160 -75
- package/dist/cjs/v6/executionErrors.js.map +1 -1
- package/dist/cjs/v6/index.d.ts +2 -1
- package/dist/cjs/v6/index.d.ts.map +1 -1
- package/dist/cjs/v6/index.js +4 -1
- package/dist/cjs/v6/index.js.map +1 -1
- package/dist/cjs/v6/pay.d.ts +23 -8
- package/dist/cjs/v6/pay.d.ts.map +1 -1
- package/dist/cjs/v6/pay.js +313 -32
- package/dist/cjs/v6/pay.js.map +1 -1
- package/dist/cjs/v6/uniswapV3.d.ts +21 -0
- package/dist/cjs/v6/uniswapV3.d.ts.map +1 -0
- package/dist/cjs/v6/uniswapV3.js +72 -0
- package/dist/cjs/v6/uniswapV3.js.map +1 -0
- package/dist/esm/review/heldWrite.js +2 -2
- package/dist/esm/review/heldWrite.js.map +1 -1
- package/dist/esm/review/messages.d.ts +3 -1
- package/dist/esm/review/messages.d.ts.map +1 -1
- package/dist/esm/review/messages.js +3 -1
- package/dist/esm/review/messages.js.map +1 -1
- package/dist/esm/review/writeHold.d.ts +9 -6
- package/dist/esm/review/writeHold.d.ts.map +1 -1
- package/dist/esm/review/writeHold.js +12 -4
- package/dist/esm/review/writeHold.js.map +1 -1
- package/dist/esm/review/writeRecovery.d.ts +3 -2
- package/dist/esm/review/writeRecovery.d.ts.map +1 -1
- package/dist/esm/review/writeRecovery.js +3 -2
- package/dist/esm/review/writeRecovery.js.map +1 -1
- package/dist/esm/v6/defifa.d.ts +4 -2
- package/dist/esm/v6/defifa.d.ts.map +1 -1
- package/dist/esm/v6/defifa.js +10 -6
- package/dist/esm/v6/defifa.js.map +1 -1
- package/dist/esm/v6/executionErrors.d.ts +69 -11
- package/dist/esm/v6/executionErrors.d.ts.map +1 -1
- package/dist/esm/v6/executionErrors.js +159 -76
- package/dist/esm/v6/executionErrors.js.map +1 -1
- package/dist/esm/v6/index.d.ts +2 -1
- package/dist/esm/v6/index.d.ts.map +1 -1
- package/dist/esm/v6/index.js +2 -1
- package/dist/esm/v6/index.js.map +1 -1
- package/dist/esm/v6/pay.d.ts +23 -8
- package/dist/esm/v6/pay.d.ts.map +1 -1
- package/dist/esm/v6/pay.js +313 -33
- package/dist/esm/v6/pay.js.map +1 -1
- package/dist/esm/v6/uniswapV3.d.ts +21 -0
- package/dist/esm/v6/uniswapV3.d.ts.map +1 -0
- package/dist/esm/v6/uniswapV3.js +68 -0
- package/dist/esm/v6/uniswapV3.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { decodeAbiParameters } from "viem";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { decodeAbiParameters, encodeAbiParameters, isAddress, keccak256, maxUint256, } from "viem";
|
|
2
|
+
/** Nonempty hex: revert data, well formed or not, even short of a selector. */
|
|
3
|
+
const REVERT_DATA = /^0x[0-9a-f]+$/i;
|
|
4
|
+
/**
|
|
5
|
+
* What a viem or wallet error carries about a revert, however deeply nested:
|
|
6
|
+
* revert data in its own fields, and errors a decoder such as viem typed.
|
|
7
|
+
* Text is never read: an `Error(string)` reason, a request or a call's
|
|
8
|
+
* arguments can spell any error name or revert data.
|
|
9
|
+
*/
|
|
10
|
+
function collectEvidence(value, evidence = { payloads: [], decoded: [] }, seen = new Set(), depth = 0) {
|
|
4
11
|
if (depth > 8 || value === null || value === undefined || seen.has(value)) {
|
|
5
12
|
return evidence;
|
|
6
13
|
}
|
|
7
14
|
if (typeof value === "string") {
|
|
8
|
-
(
|
|
9
|
-
|
|
10
|
-
: evidence.messages).push(value);
|
|
15
|
+
if (REVERT_DATA.test(value))
|
|
16
|
+
evidence.payloads.push(value);
|
|
11
17
|
return evidence;
|
|
12
18
|
}
|
|
13
19
|
if (typeof value !== "object")
|
|
@@ -16,26 +22,22 @@ function collectEvidence(value, evidence, asMessage = false, seen = new Set(), d
|
|
|
16
22
|
const record = value;
|
|
17
23
|
if (typeof record.errorName === "string") {
|
|
18
24
|
evidence.decoded.push({
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
errorName: record.errorName,
|
|
26
|
+
abiItem: record.abiItem,
|
|
27
|
+
args: record.args,
|
|
21
28
|
});
|
|
22
29
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
next(item, false);
|
|
26
|
-
}
|
|
27
|
-
// A viem error's full message repeats the call it made, arguments and all;
|
|
28
|
-
// its short message and details are the error itself.
|
|
29
|
-
const message = typeof record.shortMessage === "string" ? undefined : record.message;
|
|
30
|
-
for (const item of [record.shortMessage, message, record.details]) {
|
|
31
|
-
next(item, true);
|
|
30
|
+
for (const item of [record.raw, record.data, record.cause, record.error]) {
|
|
31
|
+
collectEvidence(item, evidence, seen, depth + 1);
|
|
32
32
|
}
|
|
33
|
-
next(record.cause, false);
|
|
34
|
-
next(record.error, false);
|
|
35
33
|
return evidence;
|
|
36
34
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
35
|
+
const PERMIT_MESSAGE = "The signed token permit covers less than the payment, so sign it again for the full amount.";
|
|
36
|
+
/** A shortfall known only by its selector: no amounts to say a lower minimum helps. */
|
|
37
|
+
const SHORTFALL_MESSAGE = "This payment would get fewer tokens than its minimum, so try again.";
|
|
38
|
+
/** `JBRouterTerminalGateway_RouteFailed(bytes32 errorHash)`: the hash is the inner revert's selector's. */
|
|
39
|
+
const ROUTE_FAILED = "0xa4ceb15e";
|
|
40
|
+
const NO_TOKENS_MESSAGE = "This payment would return no tokens.";
|
|
39
41
|
const UNEXPECTED_ETH_MESSAGE = "A payment in this token cannot also send ETH.";
|
|
40
42
|
const KNOWN_REVERTS = [
|
|
41
43
|
{
|
|
@@ -44,7 +46,10 @@ const KNOWN_REVERTS = [
|
|
|
44
46
|
selector: "0xe2d708a9",
|
|
45
47
|
params: ["uint256", "uint256"],
|
|
46
48
|
shortfall: [0, 1],
|
|
47
|
-
|
|
49
|
+
adjustable: "minimum",
|
|
50
|
+
message: "The price moved and this payment would get fewer tokens than your minimum, so lower your minimum or try again.",
|
|
51
|
+
// The hook checks only the part it buys with; the rest can still mint.
|
|
52
|
+
zeroMessage: "The price moved and the part of this payment that buys tokens would get none, so try again.",
|
|
48
53
|
},
|
|
49
54
|
{
|
|
50
55
|
reason: "TERMINAL_UNDER_MIN",
|
|
@@ -52,7 +57,9 @@ const KNOWN_REVERTS = [
|
|
|
52
57
|
selector: "0x6b2bb382",
|
|
53
58
|
params: ["uint256", "uint256"],
|
|
54
59
|
shortfall: [0, 1],
|
|
55
|
-
|
|
60
|
+
adjustable: "minimum",
|
|
61
|
+
message: "This payment would get fewer tokens than your minimum, so lower your minimum or try again.",
|
|
62
|
+
zeroMessage: NO_TOKENS_MESSAGE,
|
|
56
63
|
},
|
|
57
64
|
{
|
|
58
65
|
reason: "BUYBACK_DERIVED_FLOOR_NOT_MET",
|
|
@@ -68,7 +75,8 @@ const KNOWN_REVERTS = [
|
|
|
68
75
|
selector: "0x1dbd2ab5",
|
|
69
76
|
params: ["uint256", "uint256"],
|
|
70
77
|
shortfall: [0, 1],
|
|
71
|
-
message: "The price moved while converting your payment, so
|
|
78
|
+
message: "The price moved while converting your payment, so try again.",
|
|
79
|
+
zeroMessage: "Converting this payment would return nothing.",
|
|
72
80
|
},
|
|
73
81
|
{
|
|
74
82
|
reason: "BUYBACK_SWAP_AMOUNT_TOO_HIGH",
|
|
@@ -117,14 +125,14 @@ const KNOWN_REVERTS = [
|
|
|
117
125
|
name: "JBMultiTerminal_PermitAllowanceNotEnough",
|
|
118
126
|
selector: "0xc7e994ba",
|
|
119
127
|
params: ["uint256", "uint256"],
|
|
120
|
-
message:
|
|
128
|
+
message: PERMIT_MESSAGE,
|
|
121
129
|
},
|
|
122
130
|
{
|
|
123
131
|
reason: "ALLOWANCE_TOO_LOW",
|
|
124
132
|
name: "ERC20InsufficientAllowance",
|
|
125
133
|
selector: "0xfb8f41b2",
|
|
126
134
|
params: ["address", "uint256", "uint256"],
|
|
127
|
-
message:
|
|
135
|
+
message: "The token approval is less than the payment, so approve the full amount and try again.",
|
|
128
136
|
},
|
|
129
137
|
...[
|
|
130
138
|
["JBRouterTerminal_PermitAllowanceNotEnough", "0x7686b38a"],
|
|
@@ -135,21 +143,21 @@ const KNOWN_REVERTS = [
|
|
|
135
143
|
name,
|
|
136
144
|
selector,
|
|
137
145
|
params: ["uint256", "uint256"],
|
|
138
|
-
message:
|
|
146
|
+
message: PERMIT_MESSAGE,
|
|
139
147
|
})),
|
|
140
148
|
{
|
|
141
149
|
reason: "ALLOWANCE_TOO_LOW",
|
|
142
150
|
name: "InsufficientAllowance",
|
|
143
151
|
selector: "0xf96fb071",
|
|
144
152
|
params: ["uint256"],
|
|
145
|
-
message:
|
|
153
|
+
message: "The Permit2 allowance is less than the payment, so approve the full amount again.",
|
|
146
154
|
},
|
|
147
155
|
{
|
|
148
156
|
reason: "ALLOWANCE_EXPIRED",
|
|
149
157
|
name: "AllowanceExpired",
|
|
150
158
|
selector: "0xd81b2f2e",
|
|
151
159
|
params: ["uint256"],
|
|
152
|
-
message: "The
|
|
160
|
+
message: "The Permit2 approval has expired, so approve it again and retry.",
|
|
153
161
|
},
|
|
154
162
|
{
|
|
155
163
|
reason: "BALANCE_TOO_LOW",
|
|
@@ -209,76 +217,151 @@ const KNOWN_REVERTS = [
|
|
|
209
217
|
name: "JB721TiersHook_Overspending",
|
|
210
218
|
selector: "0x42b9988e",
|
|
211
219
|
params: ["uint256"],
|
|
212
|
-
message: "This
|
|
220
|
+
message: "This payment, with any NFT credits you hold, is more than the NFTs you picked cost, and the extra is not allowed.",
|
|
213
221
|
},
|
|
214
222
|
];
|
|
215
223
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
* Arguments that have exactly the known revert's ABI types, and for a
|
|
225
|
+
* shortfall a settled amount below its minimum, or undefined.
|
|
226
|
+
*/
|
|
227
|
+
function validArgs(known, args) {
|
|
228
|
+
if (!Array.isArray(args) || args.length !== known.params.length)
|
|
229
|
+
return;
|
|
230
|
+
const typed = known.params.every((type, i) => type === "address"
|
|
231
|
+
? typeof args[i] === "string" && isAddress(args[i], { strict: false })
|
|
232
|
+
: typeof args[i] === "bigint" && args[i] >= 0n && args[i] <= maxUint256);
|
|
233
|
+
if (!typed)
|
|
234
|
+
return;
|
|
235
|
+
if (known.shortfall && args[known.shortfall[0]] >= args[known.shortfall[1]]) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
return args;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* The first known revert in an error: revert data that is a known selector
|
|
242
|
+
* and exactly its canonically encoded arguments, or the router gateway's
|
|
243
|
+
* `RouteFailed` naming a known selector (with no arguments), or, when the error carries
|
|
244
|
+
* no revert data, an error viem typed against the known ABI item (same name
|
|
245
|
+
* and input types) with arguments of those types. Either way a shortfall
|
|
246
|
+
* must settle below its minimum. Text never counts.
|
|
222
247
|
*/
|
|
223
248
|
export function matchKnownRevert(error, reasons) {
|
|
224
249
|
const known = reasons
|
|
225
250
|
? KNOWN_REVERTS.filter((k) => reasons.includes(k.reason))
|
|
226
251
|
: KNOWN_REVERTS;
|
|
227
|
-
const { payloads, decoded
|
|
228
|
-
|
|
229
|
-
decoded: [],
|
|
230
|
-
messages: [],
|
|
231
|
-
});
|
|
232
|
-
// A revert is its selector alone, or its selector and exactly its arguments.
|
|
233
|
-
const exact = (hex) => {
|
|
252
|
+
const { payloads, decoded } = collectEvidence(error);
|
|
253
|
+
for (const hex of payloads) {
|
|
234
254
|
const lower = hex.toLowerCase();
|
|
235
|
-
|
|
255
|
+
// The router gateway wraps a failed route, keeping only its selector.
|
|
256
|
+
if (lower.startsWith(ROUTE_FAILED) && lower.length === 10 + 64) {
|
|
257
|
+
const errorHash = `0x${lower.slice(10)}`;
|
|
258
|
+
const wrapped = known.find((k) => keccak256(k.selector) === errorHash);
|
|
259
|
+
if (wrapped)
|
|
260
|
+
return { known: wrapped };
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const match = known.find((k) => lower.startsWith(k.selector) &&
|
|
264
|
+
lower.length === 10 + 64 * k.params.length);
|
|
236
265
|
if (!match)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
266
|
+
continue;
|
|
267
|
+
const params = match.params.map((type) => ({ type }));
|
|
268
|
+
const data = `0x${lower.slice(10)}`;
|
|
269
|
+
const args = validArgs(match, decodeAbiParameters(params, data));
|
|
270
|
+
// Canonical encoding only: an address word with nonzero padding is not one.
|
|
271
|
+
if (args && encodeAbiParameters(params, args) === data) {
|
|
272
|
+
return { known: match, args };
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// Revert data, when the error carries any, is the evidence: viem types an
|
|
276
|
+
// error from data with padding or trailing bytes this table rejects, even
|
|
277
|
+
// bytes short of a word.
|
|
278
|
+
if (payloads.length)
|
|
279
|
+
return null;
|
|
280
|
+
for (const { errorName, abiItem, args } of decoded) {
|
|
281
|
+
const item = abiItem;
|
|
282
|
+
const match = known.find((k) => errorName === k.name &&
|
|
283
|
+
item?.type === "error" &&
|
|
284
|
+
item.name === k.name &&
|
|
285
|
+
Array.isArray(item.inputs) &&
|
|
286
|
+
item.inputs.length === k.params.length &&
|
|
287
|
+
k.params.every((type, i) => item.inputs?.[i]?.type === type));
|
|
288
|
+
const valid = match && validArgs(match, args);
|
|
289
|
+
if (match && valid)
|
|
290
|
+
return { known: match, args: valid };
|
|
258
291
|
}
|
|
259
|
-
|
|
260
|
-
return found[0];
|
|
261
|
-
const match = known.find((k) => new RegExp(`\\b${k.name}\\b`, "i").test(text));
|
|
262
|
-
return match ? { known: match } : null;
|
|
292
|
+
return null;
|
|
263
293
|
}
|
|
264
294
|
/**
|
|
265
295
|
* Decode why a payment reverted, from a simulation or transaction error
|
|
266
296
|
* (viem or wallet, however nested) or raw revert data. Covers the terminal's
|
|
267
297
|
* minimum, the buyback hook's minimum and floor, the router's conversion,
|
|
268
298
|
* paused or unready projects, token approvals and balances, and NFT tiers.
|
|
269
|
-
* A shortfall carries `received` and `minimum`,
|
|
270
|
-
*
|
|
299
|
+
* A shortfall carries `received` and `minimum`, and `adjustable` when the
|
|
300
|
+
* payer can relax a setting and retry; `zeroFill` says the failing check
|
|
301
|
+
* settled nothing, which no setting fixes. Unknown reverts return null.
|
|
271
302
|
*/
|
|
272
303
|
export function decodePayFailure(error) {
|
|
273
304
|
const matched = matchKnownRevert(error);
|
|
274
305
|
if (!matched)
|
|
275
306
|
return null;
|
|
276
307
|
const { known, args } = matched;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
308
|
+
if (!known.shortfall)
|
|
309
|
+
return { reason: known.reason, message: known.message };
|
|
310
|
+
if (!args) {
|
|
311
|
+
return {
|
|
312
|
+
reason: known.reason,
|
|
313
|
+
message: known.adjustable ? SHORTFALL_MESSAGE : known.message,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
const received = args[known.shortfall[0]];
|
|
317
|
+
const minimum = args[known.shortfall[1]];
|
|
318
|
+
const zeroFill = received === 0n;
|
|
319
|
+
return {
|
|
320
|
+
reason: known.reason,
|
|
321
|
+
received,
|
|
322
|
+
minimum,
|
|
323
|
+
zeroFill,
|
|
324
|
+
...(!zeroFill && known.adjustable ? { adjustable: known.adjustable } : {}),
|
|
325
|
+
message: (zeroFill && known.zeroMessage) || known.message,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* The most tolerance {@link payRetrySlippageBps} offers: 49.5%, so a
|
|
330
|
+
* loosened minimum stays at a nominal 50.5% of the quote (less integer
|
|
331
|
+
* rounding on tiny quotes) and never nears zero. Only
|
|
332
|
+
* that helper applies it; `prepareUserPay`
|
|
333
|
+
* takes any tolerance it is given.
|
|
334
|
+
*/
|
|
335
|
+
export const PAY_MAX_SLIPPAGE_BPS = 4950n;
|
|
336
|
+
/**
|
|
337
|
+
* A candidate slippage tolerance, in basis points, for retrying a payment
|
|
338
|
+
* that `prepareUserPay` prepared with `currentBps` and that fell short of its
|
|
339
|
+
* minimum: the current tolerance plus the shortfall, rounded up to a half
|
|
340
|
+
* percent and capped at {@link PAY_MAX_SLIPPAGE_BPS}. Below the cap, a
|
|
341
|
+
* terminal minimum that is one slippage floor of a quote (the fallback
|
|
342
|
+
* minimum) would have been floored at or below what settled. A terminal
|
|
343
|
+
* minimum that adds issuance to a floored quote, and any candidate at the
|
|
344
|
+
* cap, may still fall short. Null unless the failure is `adjustable` by the
|
|
345
|
+
* minimum with a nonzero shortfall, or when the cap leaves nothing looser.
|
|
346
|
+
*
|
|
347
|
+
* It is a candidate, not permission: pass the tolerance of the attempt that
|
|
348
|
+
* failed (never reapply one failure to the last result, which ratchets to the
|
|
349
|
+
* cap), offer it only within what the payer agreed to, show the new minimum,
|
|
350
|
+
* and prepare and simulate the payment again before sending it.
|
|
351
|
+
*/
|
|
352
|
+
export function payRetrySlippageBps(failure, currentBps) {
|
|
353
|
+
if (failure?.adjustable !== "minimum" || currentBps < 0n)
|
|
354
|
+
return null;
|
|
355
|
+
const { received, minimum } = failure;
|
|
356
|
+
if (typeof received !== "bigint" ||
|
|
357
|
+
typeof minimum !== "bigint" ||
|
|
358
|
+
received <= 0n ||
|
|
359
|
+
received >= minimum) {
|
|
360
|
+
return null;
|
|
281
361
|
}
|
|
282
|
-
|
|
362
|
+
const shortfallBps = ((minimum - received) * 10000n + minimum - 1n) / minimum;
|
|
363
|
+
const stepped = ((currentBps + shortfallBps + 49n) / 50n) * 50n;
|
|
364
|
+
const next = stepped < PAY_MAX_SLIPPAGE_BPS ? stepped : PAY_MAX_SLIPPAGE_BPS;
|
|
365
|
+
return next > currentBps ? next : null;
|
|
283
366
|
}
|
|
284
367
|
//# sourceMappingURL=executionErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executionErrors.js","sourceRoot":"","sources":["../../../src/v6/executionErrors.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"executionErrors.js","sourceRoot":"","sources":["../../../src/v6/executionErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,UAAU,GACX,MAAM,MAAM,CAAC;AAEd,+EAA+E;AAC/E,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;GAKG;AACH,SAAS,eAAe,CACtB,KAAc,EACd,WAGI,EAAE,QAAQ,EAAE,EAAE,EA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C,CAAC,oBAAoB,CAAC;IAC7E,OAAO,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACzC,CAAC"}
|
package/dist/esm/v6/index.d.ts
CHANGED
|
@@ -13,12 +13,13 @@ export * from "./priceFeeds.js";
|
|
|
13
13
|
export * from "./permit2.js";
|
|
14
14
|
export * from "./projectPayers.js";
|
|
15
15
|
export * from "./cashOut.js";
|
|
16
|
-
export { decodePayFailure, type PayFailure, type PayFailureReason, } from "./executionErrors.js";
|
|
16
|
+
export { decodePayFailure, PAY_MAX_SLIPPAGE_BPS, payRetrySlippageBps, type PayFailure, type PayFailureAdjustable, type PayFailureReason, } from "./executionErrors.js";
|
|
17
17
|
export * from "./nft.js";
|
|
18
18
|
export * from "./nftInventory.js";
|
|
19
19
|
export * from "./defifa.js";
|
|
20
20
|
export { getDefifaHoldings, type DefifaHoldingsArgs, type DefifaHolding, } from "./defifaHoldings.js";
|
|
21
21
|
export * from "./tokens.js";
|
|
22
|
+
export * from "./uniswapV3.js";
|
|
22
23
|
export * from "./uniswapV4.js";
|
|
23
24
|
export * from "./uniswapV4Fees.js";
|
|
24
25
|
export * from "./permissions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v6/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAA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EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
package/dist/esm/v6/index.js
CHANGED
|
@@ -13,12 +13,13 @@ export * from "./priceFeeds.js";
|
|
|
13
13
|
export * from "./permit2.js";
|
|
14
14
|
export * from "./projectPayers.js";
|
|
15
15
|
export * from "./cashOut.js";
|
|
16
|
-
export { decodePayFailure, } from "./executionErrors.js";
|
|
16
|
+
export { decodePayFailure, PAY_MAX_SLIPPAGE_BPS, payRetrySlippageBps, } from "./executionErrors.js";
|
|
17
17
|
export * from "./nft.js";
|
|
18
18
|
export * from "./nftInventory.js";
|
|
19
19
|
export * from "./defifa.js";
|
|
20
20
|
export { getDefifaHoldings, } from "./defifaHoldings.js";
|
|
21
21
|
export * from "./tokens.js";
|
|
22
|
+
export * from "./uniswapV3.js";
|
|
22
23
|
export * from "./uniswapV4.js";
|
|
23
24
|
export * from "./uniswapV4Fees.js";
|
|
24
25
|
export * from "./permissions.js";
|
package/dist/esm/v6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v6/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v6/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GAIpB,MAAM,sBAAsB,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
package/dist/esm/v6/pay.d.ts
CHANGED
|
@@ -122,13 +122,15 @@ export interface PreparedUserPay {
|
|
|
122
122
|
preview: PayPreview;
|
|
123
123
|
minReturnedTokens: bigint;
|
|
124
124
|
}
|
|
125
|
+
/** `prepareUserPay`'s tolerance on its quote and fallback minimum: 1%. */
|
|
126
|
+
export declare const PAY_DEFAULT_SLIPPAGE_BPS = 100n;
|
|
125
127
|
/**
|
|
126
128
|
* Prepare a person's payment with {@link buildUserPayMetadata}: preview it,
|
|
127
129
|
* and set the minimum the terminal enforces on the beneficiary's balance.
|
|
128
130
|
*
|
|
129
|
-
* When the project's buyback hook
|
|
130
|
-
*
|
|
131
|
-
*
|
|
131
|
+
* When the project's buyback hook would swap, this quotes its pool (fee and
|
|
132
|
+
* price impact included) and sends the slippage-floored quote as an explicit
|
|
133
|
+
* minimum, so the payer gets the pool's rate whenever it
|
|
132
134
|
* beats minting. The hook compares that minimum to the swap output plus the
|
|
133
135
|
* leftover mint: the whole leftover mint when the swapped tokens go through
|
|
134
136
|
* the reserved split (`skipSplits` false, and always on hook 1.1.1, which
|
|
@@ -140,17 +142,30 @@ export interface PreparedUserPay {
|
|
|
140
142
|
* which reaches zero on large buys against a thin pool and sends them to
|
|
141
143
|
* minting even when the pool pays far more.
|
|
142
144
|
*
|
|
143
|
-
*
|
|
144
|
-
* the
|
|
145
|
-
*
|
|
146
|
-
*
|
|
145
|
+
* Behind a router terminal, its registry or its gateway, when the router
|
|
146
|
+
* converts the paid token first with one swap, the pool is the one in the
|
|
147
|
+
* token it converts to, quoted on what that swap is quoted to return. If the
|
|
148
|
+
* conversion returns noticeably less, the hook's minimum reverts the payment.
|
|
149
|
+
* If it returns more, the hook mints once minting reaches the minimum, which
|
|
150
|
+
* happens only when the pool beats minting by less than `slippageBps` plus
|
|
151
|
+
* that gain. The payer still receives at least the minimum, and no fixed
|
|
152
|
+
* minimum avoids this when the pool's edge is inside the conversion's
|
|
153
|
+
* uncertainty. Other routes, such as cashing a project token out first, keep
|
|
154
|
+
* the fallback.
|
|
155
|
+
*
|
|
156
|
+
* Otherwise (no pool, or a failed quote) the minimum is the payer's mint
|
|
157
|
+
* entitlement when the hook would swap, since the hook never settles below it,
|
|
158
|
+
* and the terminal's own issuance when it would not. If the payment then
|
|
159
|
+
* reverts, {@link decodePayFailure} says why. To let the payer accept less,
|
|
160
|
+
* prepare again with a larger `slippageBps`: the hook's minimum is in the
|
|
161
|
+
* metadata, so lowering `minReturnedTokens` alone does not relax it.
|
|
147
162
|
*
|
|
148
163
|
* When the ruleset calls buyback hook 1.4 directly (or through the omnichain
|
|
149
164
|
* deployer) instead of through the registry, the metadata is keyed to the hook,
|
|
150
165
|
* which reads nothing else.
|
|
151
166
|
*
|
|
152
167
|
* @param args.slippageBps Tolerance on the pool quote and on the fallback
|
|
153
|
-
* minimum. Defaults to
|
|
168
|
+
* minimum. Defaults to {@link PAY_DEFAULT_SLIPPAGE_BPS}.
|
|
154
169
|
* @param args.skipSplits Whether the beneficiary keeps the swapped tokens
|
|
155
170
|
* without the reserved split. Defaults to true, as a person's pay card does;
|
|
156
171
|
* pass false for payments that should honor the project's splits, such as
|
package/dist/esm/v6/pay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../../../src/v6/pay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,GAAG,EACH,YAAY,EAIb,MAAM,MAAM,CAAC;AAMd,OAAO,EAEL,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"pay.d.ts","sourceRoot":"","sources":["../../../src/v6/pay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,GAAG,EACH,YAAY,EAIb,MAAM,MAAM,CAAC;AAMd,OAAO,EAEL,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC;;;GAGG;AACH,MAAM,W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