@glacislabs/stablegenie-zerodelta 4.13.0 → 4.13.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/LICENSE +21 -21
- package/README.md +223 -223
- package/dist/{chunk-52MY5D3D.js → chunk-6WFIFKZ4.js} +198 -28
- package/dist/{chunk-BYAKXZ5E.js → chunk-M55J3P64.js} +211 -49
- package/dist/core/index.cjs +208 -27
- package/dist/core/index.d.cts +85 -3
- package/dist/core/index.d.ts +85 -3
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +421 -87
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{mount-bKSKIGmW.d.ts → mount-B6soKC-9.d.ts} +1 -1
- package/dist/{mount-BR3wWmjt.d.cts → mount-CEy4Nqky.d.cts} +1 -1
- package/dist/mount.cjs +421 -87
- package/dist/mount.d.cts +2 -2
- package/dist/mount.d.ts +2 -2
- package/dist/mount.js +2 -2
- package/dist/standalone.global.js +10 -9
- package/dist/{verify-DdSA23GJ.d.cts → verify-Y9jZ83T5.d.cts} +3 -0
- package/dist/{verify-DdSA23GJ.d.ts → verify-Y9jZ83T5.d.ts} +3 -0
- package/package.json +134 -134
package/dist/core/index.cjs
CHANGED
|
@@ -1133,9 +1133,9 @@ function encodeSubmitOrder(orders, partnerId = NO_PARTNER_ID) {
|
|
|
1133
1133
|
const tuples = orders.map(encodeOrderTuple);
|
|
1134
1134
|
let offset = 32n * BigInt(tuples.length);
|
|
1135
1135
|
const offsets = tuples.map((tuple) => {
|
|
1136
|
-
const
|
|
1136
|
+
const word2 = uintWord(offset);
|
|
1137
1137
|
offset += BigInt(tuple.length / 2);
|
|
1138
|
-
return
|
|
1138
|
+
return word2;
|
|
1139
1139
|
}).join("");
|
|
1140
1140
|
return `0x${SUBMIT_ORDER_SELECTOR.slice(2)}${uintWord(64)}${bytes32Word(partnerId)}${uintWord(tuples.length)}${offsets}${tuples.join("")}`;
|
|
1141
1141
|
}
|
|
@@ -1146,21 +1146,21 @@ function decodeSubmitOrderCalldata(data) {
|
|
|
1146
1146
|
if (`0x${hex.slice(0, 8)}` !== SUBMIT_ORDER_SELECTOR) return null;
|
|
1147
1147
|
const body = hex.slice(8);
|
|
1148
1148
|
const totalBytes = body.length / 2;
|
|
1149
|
-
const
|
|
1149
|
+
const word2 = (byteOffset) => {
|
|
1150
1150
|
if (!Number.isSafeInteger(byteOffset) || byteOffset < 0 || byteOffset + 32 > totalBytes) return null;
|
|
1151
1151
|
return BigInt(`0x${body.slice(byteOffset * 2, byteOffset * 2 + 64)}`);
|
|
1152
1152
|
};
|
|
1153
1153
|
const addressAt = (byteOffset) => {
|
|
1154
|
-
const w =
|
|
1154
|
+
const w = word2(byteOffset);
|
|
1155
1155
|
if (w === null || w >= 1n << 160n) return null;
|
|
1156
1156
|
return `0x${w.toString(16).padStart(40, "0")}`;
|
|
1157
1157
|
};
|
|
1158
1158
|
const uint64At = (byteOffset) => {
|
|
1159
|
-
const w =
|
|
1159
|
+
const w = word2(byteOffset);
|
|
1160
1160
|
return w === null || w > MAX_UINT64 ? null : w;
|
|
1161
1161
|
};
|
|
1162
1162
|
const keyBytesAt = (byteOffset) => {
|
|
1163
|
-
const len =
|
|
1163
|
+
const len = word2(byteOffset);
|
|
1164
1164
|
if (len !== 20n && len !== 32n) return null;
|
|
1165
1165
|
const length = Number(len);
|
|
1166
1166
|
const padded = Math.ceil(length / 32) * 32;
|
|
@@ -1168,25 +1168,25 @@ function decodeSubmitOrderCalldata(data) {
|
|
|
1168
1168
|
if (content.length !== padded * 2 || content.slice(length * 2) !== "0".repeat((padded - length) * 2)) return null;
|
|
1169
1169
|
return { value: `0x${content.slice(0, length * 2)}`, size: 32 + padded };
|
|
1170
1170
|
};
|
|
1171
|
-
if (
|
|
1172
|
-
if (
|
|
1171
|
+
if (word2(0) !== 64n) return null;
|
|
1172
|
+
if (word2(32) === null) return null;
|
|
1173
1173
|
const partnerId = `0x${body.slice(64, 128)}`;
|
|
1174
|
-
const count =
|
|
1174
|
+
const count = word2(64);
|
|
1175
1175
|
if (count === null || count < 1n || count > BigInt(MAX_DECODED_ORDERS)) return null;
|
|
1176
1176
|
const n = Number(count);
|
|
1177
1177
|
const arrayBase = 96;
|
|
1178
1178
|
let next = arrayBase + 32 * n;
|
|
1179
1179
|
const orders = [];
|
|
1180
1180
|
for (let i = 0; i < n; i += 1) {
|
|
1181
|
-
const rel =
|
|
1181
|
+
const rel = word2(arrayBase + i * 32);
|
|
1182
1182
|
if (rel === null || rel !== BigInt(next - arrayBase)) return null;
|
|
1183
1183
|
const base = next;
|
|
1184
1184
|
const owner = addressAt(base);
|
|
1185
1185
|
const bidToken = addressAt(base + 32);
|
|
1186
|
-
const bidTokenAmount =
|
|
1187
|
-
const askOffset =
|
|
1188
|
-
const askTokenAmount =
|
|
1189
|
-
const receiverOffset =
|
|
1186
|
+
const bidTokenAmount = word2(base + 64);
|
|
1187
|
+
const askOffset = word2(base + 96);
|
|
1188
|
+
const askTokenAmount = word2(base + 128);
|
|
1189
|
+
const receiverOffset = word2(base + 160);
|
|
1190
1190
|
const destinationChainId = uint64At(base + 192);
|
|
1191
1191
|
const executionChainId = uint64At(base + 224);
|
|
1192
1192
|
const deadline = uint64At(base + 256);
|
|
@@ -1933,6 +1933,12 @@ async function previewSolanaSource(api, input) {
|
|
|
1933
1933
|
nativeFeeRaw: "0"
|
|
1934
1934
|
};
|
|
1935
1935
|
}
|
|
1936
|
+
function solanaQuoteCompliance(quote) {
|
|
1937
|
+
for (const value of [quote?.complianceDecision, quote?.compliance]) {
|
|
1938
|
+
if (value && typeof value === "object" && !Array.isArray(value)) return value;
|
|
1939
|
+
}
|
|
1940
|
+
return void 0;
|
|
1941
|
+
}
|
|
1936
1942
|
function denied(value) {
|
|
1937
1943
|
return typeof value === "string" ? value.toUpperCase() === "DENY" : !!value && typeof value === "object" && denied(value.decision);
|
|
1938
1944
|
}
|
|
@@ -2050,6 +2056,7 @@ function createSolanaRpc(api) {
|
|
|
2050
2056
|
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
|
|
2051
2057
|
timeoutMs: 15e3
|
|
2052
2058
|
});
|
|
2059
|
+
if (body.error && solanaLamportShortfall(body.error.data?.logs) !== null) throw new Error(SOL_SHORTFALL_MESSAGE);
|
|
2053
2060
|
if (body.error || body.result === void 0) throw new Error(body.error?.message || "Invalid Solana RPC response.");
|
|
2054
2061
|
return body.result;
|
|
2055
2062
|
};
|
|
@@ -2214,18 +2221,179 @@ async function readSolanaBalance(rpc, owner, mint) {
|
|
|
2214
2221
|
return void 0;
|
|
2215
2222
|
}
|
|
2216
2223
|
}
|
|
2224
|
+
function solanaLamportShortfall(logs) {
|
|
2225
|
+
if (!Array.isArray(logs)) return null;
|
|
2226
|
+
for (const line of logs) {
|
|
2227
|
+
const m = /insufficient lamports (\d+), need (\d+)/.exec(String(line));
|
|
2228
|
+
if (m) {
|
|
2229
|
+
const need = Number(m[2]);
|
|
2230
|
+
return Number.isSafeInteger(need) && need > 0 ? need : null;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
return null;
|
|
2234
|
+
}
|
|
2235
|
+
var SOL_SHORTFALL_MESSAGE = "Not enough SOL in this wallet for the Solana network fee and account rent. Add a little SOL and try again.";
|
|
2217
2236
|
async function simulateSolanaCost(rpc, plan) {
|
|
2218
2237
|
checkSolanaPlan(plan.txData);
|
|
2219
2238
|
const signer = plan.expected.signer;
|
|
2220
2239
|
const before = await rpc("getAccountInfo", [signer, { encoding: "base64", commitment: "confirmed" }]);
|
|
2221
2240
|
const sim = await rpc("simulateTransaction", [plan.txData[0].transaction, { encoding: "base64", sigVerify: false, replaceRecentBlockhash: true, accounts: { addresses: [signer], encoding: "base64" } }]);
|
|
2222
|
-
if (sim.value?.err) throw new Error(`Simulation failed: ${JSON.stringify(sim.value.err)}`);
|
|
2223
2241
|
const balanceLamports = before.value?.lamports ?? 0, post = sim.value?.accounts?.[0]?.lamports;
|
|
2242
|
+
if (sim.value?.err) {
|
|
2243
|
+
const need = solanaLamportShortfall(sim.value.logs);
|
|
2244
|
+
if (need !== null && Number.isSafeInteger(balanceLamports)) return { lamports: need, balanceLamports, sufficient: false };
|
|
2245
|
+
throw new Error(`Simulation failed: ${JSON.stringify(sim.value.err)}`);
|
|
2246
|
+
}
|
|
2224
2247
|
if (!Number.isSafeInteger(balanceLamports) || balanceLamports < 0 || post !== void 0 && (!Number.isSafeInteger(post) || post < 0)) throw new Error("Invalid simulation lamports.");
|
|
2225
2248
|
const lamports = typeof post === "number" ? Math.max(0, balanceLamports - post) : 0;
|
|
2226
2249
|
return { lamports, balanceLamports, sufficient: balanceLamports >= lamports };
|
|
2227
2250
|
}
|
|
2228
2251
|
|
|
2252
|
+
// src/core/delivery.ts
|
|
2253
|
+
var FAILED = /* @__PURE__ */ new Set(["cancelled", "fill_failed", "delivery_failed", "expired", "failed"]);
|
|
2254
|
+
var ATTENTION = /* @__PURE__ */ new Set(["cancel_pending", "awaiting_claim"]);
|
|
2255
|
+
var TRACKING = Object.freeze({ phase: "tracking", status: "", steps: [] });
|
|
2256
|
+
var word = (v) => typeof v === "string" ? v.trim().toLowerCase() : "";
|
|
2257
|
+
function normalizeDelivery(raw2) {
|
|
2258
|
+
const row = raw2 && typeof raw2 === "object" && !Array.isArray(raw2) ? raw2.data ?? raw2 : null;
|
|
2259
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) return TRACKING;
|
|
2260
|
+
const r = row;
|
|
2261
|
+
const chained = r.isChained === true || Array.isArray(r.legs) && r.legs.length > 1;
|
|
2262
|
+
const journey = word(r.journeyStatus);
|
|
2263
|
+
const own = word(r.status);
|
|
2264
|
+
const status = journey || own;
|
|
2265
|
+
const rawSteps = Array.isArray(r.steps) ? r.steps : [];
|
|
2266
|
+
const steps = rawSteps.filter((s) => s && typeof s === "object" && typeof s.stepName === "string").sort((a, b) => Number(a.stepNumber ?? 0) - Number(b.stepNumber ?? 0)).slice(0, 8).map((s) => ({ name: String(s.stepName).slice(0, 32), done: s.stepStatus === "completed" }));
|
|
2267
|
+
if (!status) return TRACKING;
|
|
2268
|
+
if (FAILED.has(status)) return { phase: "failed", status, steps };
|
|
2269
|
+
if (ATTENTION.has(status)) return { phase: "attention", status, steps };
|
|
2270
|
+
if (status === "delivered" && !(chained && !journey)) return { phase: "delivered", status, steps: steps.map((s) => ({ ...s, done: true })) };
|
|
2271
|
+
return { phase: "in-progress", status: status === "delivered" ? "continuing" : status, steps };
|
|
2272
|
+
}
|
|
2273
|
+
var HASH = /^(?:0x[0-9a-fA-F]{64}|[1-9A-HJ-NP-Za-km-z]{64,88})$/;
|
|
2274
|
+
function sameOrder(raw2, hash2) {
|
|
2275
|
+
const row = raw2 && typeof raw2 === "object" ? raw2.data ?? raw2 : null;
|
|
2276
|
+
const got = row && typeof row === "object" ? row.txHash : void 0;
|
|
2277
|
+
if (typeof got !== "string" || !got) return false;
|
|
2278
|
+
return hash2.startsWith("0x") ? got.toLowerCase() === hash2.toLowerCase() : got === hash2;
|
|
2279
|
+
}
|
|
2280
|
+
async function fetchDelivery(api, hash2) {
|
|
2281
|
+
if (typeof hash2 !== "string" || !HASH.test(hash2)) return TRACKING;
|
|
2282
|
+
try {
|
|
2283
|
+
const raw2 = await api.apiRequest(`/transactions/${hash2}`, { timeoutMs: 8e3 });
|
|
2284
|
+
return sameOrder(raw2, hash2) ? normalizeDelivery(raw2) : TRACKING;
|
|
2285
|
+
} catch {
|
|
2286
|
+
return TRACKING;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
// src/core/history.ts
|
|
2291
|
+
var WALLET_HISTORY_LIMIT = 50;
|
|
2292
|
+
var HASH2 = /^(?:0x[0-9a-fA-F]{64}|[1-9A-HJ-NP-Za-km-z]{64,88})$/;
|
|
2293
|
+
var WALLET = /^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/;
|
|
2294
|
+
function historyKey(value) {
|
|
2295
|
+
return value.startsWith("0x") ? value.toLowerCase() : value;
|
|
2296
|
+
}
|
|
2297
|
+
var str = (v) => typeof v === "string" ? v : typeof v === "number" ? String(v) : "";
|
|
2298
|
+
function tokenAt(tokens, chainId, address) {
|
|
2299
|
+
if (!address) return void 0;
|
|
2300
|
+
const key = historyKey(address);
|
|
2301
|
+
return tokens.find((t) => Number(t.chainId) === chainId && historyKey(String(t.address)) === key);
|
|
2302
|
+
}
|
|
2303
|
+
function amountOf(raw2, token, rowDecimals, rowAmount) {
|
|
2304
|
+
const decimals = token ? Number(token.decimals) : Number(rowDecimals);
|
|
2305
|
+
if (/^\d{1,78}$/.test(raw2) && Number.isInteger(decimals) && decimals > 0 && decimals <= 36) return formatUnits(raw2, decimals);
|
|
2306
|
+
return Number(rowDecimals) > 0 && /^\d+(?:\.\d+)?$/.test(rowAmount) ? rowAmount.slice(0, 40) : "";
|
|
2307
|
+
}
|
|
2308
|
+
function historyEntryFromOrder(raw2, tokens) {
|
|
2309
|
+
if (!raw2 || typeof raw2 !== "object" || Array.isArray(raw2)) return null;
|
|
2310
|
+
const r = raw2;
|
|
2311
|
+
const hash2 = str(r.txHash);
|
|
2312
|
+
if (!HASH2.test(hash2)) return null;
|
|
2313
|
+
const fromChainId = Number(r.sourceChainId) || 0;
|
|
2314
|
+
const toChainId = Number(r.finalDestChainId ?? r.destChainId) || 0;
|
|
2315
|
+
const from = tokenAt(tokens, fromChainId, str(r.fromTokenAddress));
|
|
2316
|
+
const toAddress = str(r.finalToTokenAddress) || str(r.toTokenAddress);
|
|
2317
|
+
const to = tokenAt(tokens, toChainId, toAddress);
|
|
2318
|
+
const fromAsset = (from?.symbol ?? str(r.fromTokenSymbol)).slice(0, 10);
|
|
2319
|
+
const toAsset = (to?.symbol ?? (str(r.finalToTokenSymbol) || str(r.toTokenSymbol))).slice(0, 10);
|
|
2320
|
+
const payAmount = amountOf(str(r.fromTokenRawAmount), from, r.fromTokenDecimals, str(r.fromTokenAmount));
|
|
2321
|
+
const receiveAmount = str(r.finalToTokenRawAmount) ? amountOf(str(r.finalToTokenRawAmount), to, r.finalToTokenDecimals, str(r.finalToTokenAmount)) : amountOf(str(r.toTokenRawAmount), to, r.toTokenDecimals, str(r.toTokenAmount));
|
|
2322
|
+
const delivery = normalizeDelivery(r).phase;
|
|
2323
|
+
const wallet = str(r.wallet);
|
|
2324
|
+
const receiver = str(r.destinationReceiver);
|
|
2325
|
+
const at = str(r.createdAt) || str(r.submittedAt);
|
|
2326
|
+
return {
|
|
2327
|
+
kind: "swap",
|
|
2328
|
+
hash: hash2,
|
|
2329
|
+
txKind: "submitOrder",
|
|
2330
|
+
chainId: fromChainId || null,
|
|
2331
|
+
chainName: "",
|
|
2332
|
+
fromAsset,
|
|
2333
|
+
toAsset,
|
|
2334
|
+
fromTicker: from ? tokenTicker(from).slice(0, 12) : void 0,
|
|
2335
|
+
toTicker: to ? tokenTicker(to).slice(0, 12) : void 0,
|
|
2336
|
+
payAmount,
|
|
2337
|
+
receiveAmount,
|
|
2338
|
+
account: WALLET.test(wallet) ? historyKey(wallet) : "",
|
|
2339
|
+
recipient: WALLET.test(receiver) ? receiver : "",
|
|
2340
|
+
settlement: "escrow",
|
|
2341
|
+
status: "submitted",
|
|
2342
|
+
at: Number.isNaN(Date.parse(at)) ? (/* @__PURE__ */ new Date(0)).toISOString() : new Date(at).toISOString(),
|
|
2343
|
+
delivery: delivery === "tracking" || delivery === "unavailable" ? void 0 : delivery,
|
|
2344
|
+
legs: [
|
|
2345
|
+
{
|
|
2346
|
+
index: 1,
|
|
2347
|
+
fromAsset,
|
|
2348
|
+
fromTicker: from ? tokenTicker(from).slice(0, 12) : void 0,
|
|
2349
|
+
fromChainId,
|
|
2350
|
+
fromChainName: "",
|
|
2351
|
+
fromAmount: payAmount,
|
|
2352
|
+
toAsset,
|
|
2353
|
+
toTicker: to ? tokenTicker(to).slice(0, 12) : void 0,
|
|
2354
|
+
toChainId,
|
|
2355
|
+
toChainName: "",
|
|
2356
|
+
toAmount: receiveAmount,
|
|
2357
|
+
executionChainId: Number(r.executionChainId) || 0,
|
|
2358
|
+
executionChainName: ""
|
|
2359
|
+
}
|
|
2360
|
+
]
|
|
2361
|
+
};
|
|
2362
|
+
}
|
|
2363
|
+
async function fetchWalletHistory(api, wallets) {
|
|
2364
|
+
const asked = [...new Set(wallets.filter((w) => WALLET.test(w)).map(historyKey))];
|
|
2365
|
+
if (!asked.length) return [];
|
|
2366
|
+
const tokens = await api.fetchTokens().catch(() => []);
|
|
2367
|
+
const reads = await Promise.all(
|
|
2368
|
+
asked.map(async (wallet) => {
|
|
2369
|
+
try {
|
|
2370
|
+
const rows = await api.apiRequest(`/transactions?wallet=${encodeURIComponent(wallet)}&limit=${WALLET_HISTORY_LIMIT}`, { timeoutMs: 1e4 });
|
|
2371
|
+
if (!Array.isArray(rows)) return null;
|
|
2372
|
+
return rows.filter((row) => historyKey(str(row?.wallet)) === wallet).map((row) => historyEntryFromOrder(row, tokens));
|
|
2373
|
+
} catch {
|
|
2374
|
+
return null;
|
|
2375
|
+
}
|
|
2376
|
+
})
|
|
2377
|
+
);
|
|
2378
|
+
if (reads.every((read) => read === null)) return null;
|
|
2379
|
+
return reads.flatMap((read) => read ?? []).filter((e) => e !== null);
|
|
2380
|
+
}
|
|
2381
|
+
function mergeHistory(local, remote, limit = WALLET_HISTORY_LIMIT) {
|
|
2382
|
+
const byHash = /* @__PURE__ */ new Map();
|
|
2383
|
+
for (const entry of remote ?? []) if (!byHash.has(historyKey(entry.hash))) byHash.set(historyKey(entry.hash), entry);
|
|
2384
|
+
const out = [];
|
|
2385
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2386
|
+
for (const entry of local) {
|
|
2387
|
+
const key = historyKey(entry.hash);
|
|
2388
|
+
if (seen.has(key)) continue;
|
|
2389
|
+
seen.add(key);
|
|
2390
|
+
const known = byHash.get(key);
|
|
2391
|
+
out.push(known ? { ...entry, delivery: known.delivery, legs: entry.legs ?? known.legs } : entry);
|
|
2392
|
+
}
|
|
2393
|
+
for (const [key, entry] of byHash) if (!seen.has(key)) out.push(entry);
|
|
2394
|
+
return out.sort((a, b) => Date.parse(b.at) - Date.parse(a.at)).slice(0, limit);
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2229
2397
|
// src/core/escrow.ts
|
|
2230
2398
|
function checkEscrow(chainId, quoteEscrow, chainsEscrow) {
|
|
2231
2399
|
const fromQuote = normalizeAddress(quoteEscrow);
|
|
@@ -2480,11 +2648,11 @@ function complianceView(compliance, hasQuote = true) {
|
|
|
2480
2648
|
};
|
|
2481
2649
|
}
|
|
2482
2650
|
if (decision === "REVIEW" || decision === "REMEDIATE") {
|
|
2483
|
-
const
|
|
2651
|
+
const word2 = decision.toLowerCase();
|
|
2484
2652
|
return {
|
|
2485
2653
|
tone: "warn",
|
|
2486
|
-
label: `Compliance: ${
|
|
2487
|
-
headline: `Manual ${
|
|
2654
|
+
label: `Compliance: ${word2} required`,
|
|
2655
|
+
headline: `Manual ${word2} required`,
|
|
2488
2656
|
blocked: false,
|
|
2489
2657
|
needsAction: true,
|
|
2490
2658
|
screened
|
|
@@ -3055,7 +3223,7 @@ function routeLabelFor(option, destinationToken, result) {
|
|
|
3055
3223
|
const bridge = result.quote.bridge ? ` via ${result.quote.bridge}` : "";
|
|
3056
3224
|
return `Swap ${optionTicker(option)} to ${tokenTicker(destinationToken)} and settle on ZeroDelta${bridge}.`;
|
|
3057
3225
|
}
|
|
3058
|
-
function
|
|
3226
|
+
function tokenAt2(tokens, chainId, address) {
|
|
3059
3227
|
const key = isSolanaChainId(chainId) ? hexToSolanaKey(address) || address : address;
|
|
3060
3228
|
const wanted = isChainAddress(chainId, key) ? chainAddressKey(chainId, key) : null;
|
|
3061
3229
|
if (!wanted || !tokens?.length) return void 0;
|
|
@@ -3079,7 +3247,7 @@ function buildLegs(orders, ctx) {
|
|
|
3079
3247
|
const order = orders[index];
|
|
3080
3248
|
const isLast = index === orders.length - 1;
|
|
3081
3249
|
const toChainId = Number(order.destinationChainId);
|
|
3082
|
-
const askToken = isLast ? ctx.destinationToken :
|
|
3250
|
+
const askToken = isLast ? ctx.destinationToken : tokenAt2(ctx.tokens, toChainId, order.askToken);
|
|
3083
3251
|
const toAsset = isLast ? ctx.destinationToken.symbol : askToken?.symbol ?? "";
|
|
3084
3252
|
const toTicker = askToken ? tokenTicker(askToken) : "";
|
|
3085
3253
|
const toDecimals = askToken ? assetDecimals(askToken) : void 0;
|
|
@@ -3297,7 +3465,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
3297
3465
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
3298
3466
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
3299
3467
|
var WIDGET_CHANNEL = "widget";
|
|
3300
|
-
var WIDGET_VERSION = "4.13.
|
|
3468
|
+
var WIDGET_VERSION = "4.13.1" ;
|
|
3301
3469
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
3302
3470
|
function sanitizeVersion(raw2) {
|
|
3303
3471
|
const v = String(raw2).trim();
|
|
@@ -3956,16 +4124,16 @@ function isHexQuantity(value) {
|
|
|
3956
4124
|
return /^0x[0-9a-fA-F]+$/.test(String(value || "0x0"));
|
|
3957
4125
|
}
|
|
3958
4126
|
function dataWord(data, index) {
|
|
3959
|
-
const
|
|
3960
|
-
return /^[a-fA-F0-9]{64}$/.test(
|
|
4127
|
+
const word2 = String(data || "").slice(10 + index * 64, 10 + (index + 1) * 64);
|
|
4128
|
+
return /^[a-fA-F0-9]{64}$/.test(word2) ? word2 : "";
|
|
3961
4129
|
}
|
|
3962
4130
|
function dataAddress(data, index) {
|
|
3963
|
-
const
|
|
3964
|
-
return
|
|
4131
|
+
const word2 = dataWord(data, index);
|
|
4132
|
+
return word2 ? `0x${word2.slice(24)}` : "";
|
|
3965
4133
|
}
|
|
3966
4134
|
function dataUint(data, index) {
|
|
3967
|
-
const
|
|
3968
|
-
return
|
|
4135
|
+
const word2 = dataWord(data, index);
|
|
4136
|
+
return word2 ? BigInt(`0x${word2}`) : null;
|
|
3969
4137
|
}
|
|
3970
4138
|
function rawEquals(value, expected) {
|
|
3971
4139
|
try {
|
|
@@ -4443,6 +4611,8 @@ function createEngine(config = {}) {
|
|
|
4443
4611
|
executeSolanaPlan: (input) => executeSolanaPlan({ ...input, rpc: input.rpc ?? solanaRpc }),
|
|
4444
4612
|
executeSolanaPlanStaged: (input) => executeSolanaPlanStaged({ ...input, rpc: input.rpc ?? solanaRpc }),
|
|
4445
4613
|
previewSolanaSource: (input) => previewSolanaSource(api, input),
|
|
4614
|
+
trackDelivery: (hash2) => fetchDelivery(api, hash2),
|
|
4615
|
+
fetchWalletHistory: (wallets) => fetchWalletHistory(api, wallets),
|
|
4446
4616
|
readSolanaBalance: (owner, mint) => readSolanaBalance(solanaRpc, owner, mint),
|
|
4447
4617
|
simulateSolanaCost: (plan) => simulateSolanaCost(solanaRpc, plan),
|
|
4448
4618
|
payerNonceBaseline: verifier.payerNonceBaseline,
|
|
@@ -4500,6 +4670,7 @@ exports.SCREENING_BUCKETS = SCREENING_BUCKETS;
|
|
|
4500
4670
|
exports.SCREEN_CACHE_TTL_MS = SCREEN_CACHE_TTL_MS;
|
|
4501
4671
|
exports.SOLANA_CHAIN_ID = SOLANA_CHAIN_ID;
|
|
4502
4672
|
exports.SOLANA_DESTINATION_ASSETS = SOLANA_DESTINATION_ASSETS;
|
|
4673
|
+
exports.SOL_SHORTFALL_MESSAGE = SOL_SHORTFALL_MESSAGE;
|
|
4503
4674
|
exports.STABLEGENIE_INTENT_TTL_MS = STABLEGENIE_INTENT_TTL_MS;
|
|
4504
4675
|
exports.STABLEGENIE_INTENT_VERSION = STABLEGENIE_INTENT_VERSION;
|
|
4505
4676
|
exports.STABLEGENIE_SUPPORTED_ASSETS = STABLEGENIE_SUPPORTED_ASSETS;
|
|
@@ -4510,8 +4681,10 @@ exports.SUBMIT_ORDER_SELECTOR = SUBMIT_ORDER_SELECTOR;
|
|
|
4510
4681
|
exports.SUPPORTED_ASSETS = SUPPORTED_ASSETS;
|
|
4511
4682
|
exports.SUPPORTED_CHAIN_IDS = SUPPORTED_CHAIN_IDS;
|
|
4512
4683
|
exports.SolanaSendError = SolanaSendError;
|
|
4684
|
+
exports.TRACKING = TRACKING;
|
|
4513
4685
|
exports.TRADEABLE_RWA_ASSETS = TRADEABLE_RWA_ASSETS;
|
|
4514
4686
|
exports.TUNABLE_CATEGORIES = TUNABLE_CATEGORIES;
|
|
4687
|
+
exports.WALLET_HISTORY_LIMIT = WALLET_HISTORY_LIMIT;
|
|
4515
4688
|
exports.ZERO_ADDRESS = ZERO_ADDRESS;
|
|
4516
4689
|
exports.addressWord = addressWord;
|
|
4517
4690
|
exports.allowanceCovers = allowanceCovers;
|
|
@@ -4589,7 +4762,9 @@ exports.executeSolanaPlan = executeSolanaPlan;
|
|
|
4589
4762
|
exports.executeSolanaPlanStaged = executeSolanaPlanStaged;
|
|
4590
4763
|
exports.executionChainIds = executionChainIds;
|
|
4591
4764
|
exports.expectedSolanaDelivery = expectedSolanaDelivery;
|
|
4765
|
+
exports.fetchDelivery = fetchDelivery;
|
|
4592
4766
|
exports.fetchPaymentPlan = fetchPaymentPlan;
|
|
4767
|
+
exports.fetchWalletHistory = fetchWalletHistory;
|
|
4593
4768
|
exports.finalOf = finalOf;
|
|
4594
4769
|
exports.findProgramAddress = findProgramAddress;
|
|
4595
4770
|
exports.findToken = findToken;
|
|
@@ -4600,6 +4775,8 @@ exports.formatUnits = formatUnits;
|
|
|
4600
4775
|
exports.hasReachableDestination = hasReachableDestination;
|
|
4601
4776
|
exports.hexBytes = hexBytes;
|
|
4602
4777
|
exports.hexToSolanaKey = hexToSolanaKey;
|
|
4778
|
+
exports.historyEntryFromOrder = historyEntryFromOrder;
|
|
4779
|
+
exports.historyKey = historyKey;
|
|
4603
4780
|
exports.hubDeliverableSymbols = hubDeliverableSymbols;
|
|
4604
4781
|
exports.humanizeComplianceReason = humanizeComplianceReason;
|
|
4605
4782
|
exports.isAddress = isAddress;
|
|
@@ -4628,11 +4805,13 @@ exports.laneLimitSymbol = laneLimitSymbol;
|
|
|
4628
4805
|
exports.limitedLanes = limitedLanes;
|
|
4629
4806
|
exports.maxDeadlineSeconds = maxDeadlineSeconds;
|
|
4630
4807
|
exports.maxNativeFeeWei = maxNativeFeeWei;
|
|
4808
|
+
exports.mergeHistory = mergeHistory;
|
|
4631
4809
|
exports.nativeFeeShortLabel = nativeFeeShortLabel;
|
|
4632
4810
|
exports.nativeFeeShortMessage = nativeFeeShortMessage;
|
|
4633
4811
|
exports.nativeSymbol = nativeSymbol;
|
|
4634
4812
|
exports.normalizeAddress = normalizeAddress;
|
|
4635
4813
|
exports.normalizeDecimalText = normalizeDecimalText;
|
|
4814
|
+
exports.normalizeDelivery = normalizeDelivery;
|
|
4636
4815
|
exports.normalizeOrderRequest = normalizeOrderRequest;
|
|
4637
4816
|
exports.normalizeOrderRequests = normalizeOrderRequests;
|
|
4638
4817
|
exports.overwriteBlockhash = overwriteBlockhash;
|
|
@@ -4670,7 +4849,9 @@ exports.solanaBridgeOf = solanaBridgeOf;
|
|
|
4670
4849
|
exports.solanaDestinationAsset = solanaDestinationAsset;
|
|
4671
4850
|
exports.solanaKeyBytes = solanaKeyBytes;
|
|
4672
4851
|
exports.solanaKeyHex = solanaKeyHex;
|
|
4852
|
+
exports.solanaLamportShortfall = solanaLamportShortfall;
|
|
4673
4853
|
exports.solanaPlanNeedsPreparation = solanaPlanNeedsPreparation;
|
|
4854
|
+
exports.solanaQuoteCompliance = solanaQuoteCompliance;
|
|
4674
4855
|
exports.solveExactIn = solveExactIn;
|
|
4675
4856
|
exports.solveExactOut = solveExactOut;
|
|
4676
4857
|
exports.sourceKeys = sourceKeys;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NormalizedOrder, s as ApiClient, t as SwapInput, P as Plan,
|
|
2
|
-
export { G as Address, H as ApiError, A as Availability, I as BLOCK_LABEL_DEFAULT, B as BrokenLane, J as COMPLIANCE_CHECK_ORDER, K as COMPLIANCE_DENY_LABEL, M as CatalogueContext, U as CatalogueInput, c as ComplianceCheck, X as ComplianceCheckId, Y as ComplianceDecision, d as ComplianceTone, e as ComplianceView, Z as DIRECT_CHECK_IDS, _ as DIRECT_SCOPE_NOTE, $ as Destination, a0 as FLOOR_CATEGORIES, a1 as Hex, a2 as LaneAvailabilityState, L as LaneLimit, a3 as PlannedTxKind, a4 as QuoteBlock, a5 as ResolvedConfig, a6 as RouteHealth, a7 as RouteHealthAvailability, a8 as RouteHealthLane, g as RouteLeg, a9 as SCREENING_BUCKETS, aa as ScreenProvider, ab as ScreeningBucket, ac as ScreeningOutcome, ad as TUNABLE_CATEGORIES, ae as TxPlan, V as VerifyResult, W as WalletScreen, af as amountFieldError, ag as apiError, j as assetClassOf, ah as blockLabelFor, ai as brokenLaneFor, k as brokenLaneReason, aj as buildCatalogue, ak as canAttachApiKey, al as categoryLabel, am as classifyQuoteError, l as complianceChecks, an as complianceControlsEvaluated, m as complianceControlsLine, ao as complianceReasonHead, ap as complianceReasonTag, aq as complianceTagOf, n as complianceView, o as counterpartTokens, ar as createApiClient, as as createVerifier, p as destinationAvailability, at as destinationKeys, au as directComplianceFromScreens, av as distinctScreenedWallets, aw as exceedsLaneLimit, ax as executableRoutes, ay as executionChainIds, q as formatJurisdiction, az as hasReachableDestination, aA as hubDeliverableSymbols, r as humanizeComplianceReason, aB as isExecutableBridge, aC as isKnownUnbridgeable, aD as isSourceToken, aE as laneAvailabilityState, aF as laneKey, aG as laneKeys, aH as laneLimitAmount, aI as laneLimitError, aJ as laneLimitFor, aK as laneLimitHint, aL as laneLimitSymbol, aM as limitedLanes, aN as parseAllowedApiBase, aO as productAssets, aP as registryRpc, aQ as resolveApiBase, aR as resolveConfig, aS as screeningOutcomeOf, aT as sourceKeys, aU as suppressedLanes, aV as tokenKey, aW as txMatchesPlan, aX as unattributedComplianceReasons } from '../verify-
|
|
1
|
+
import { N as NormalizedOrder, s as ApiClient, t as SwapInput, P as Plan, C as Compliance, S as SanitizedTxEntry, T as Token, Q as Quote, u as PayOption, h as RouteResult, b as Chain, R as Route, a as Catalogue, v as RwaVault, F as FetchQuoteFn, w as SolveResult, O as OrderRequest, x as BalanceTarget, y as BalanceEntry, z as PlannedTx, D as Verifier, f as ExchangeProduct, i as TxHistoryEntry, E as EngineConfig } from '../verify-Y9jZ83T5.cjs';
|
|
2
|
+
export { G as Address, H as ApiError, A as Availability, I as BLOCK_LABEL_DEFAULT, B as BrokenLane, J as COMPLIANCE_CHECK_ORDER, K as COMPLIANCE_DENY_LABEL, M as CatalogueContext, U as CatalogueInput, c as ComplianceCheck, X as ComplianceCheckId, Y as ComplianceDecision, d as ComplianceTone, e as ComplianceView, Z as DIRECT_CHECK_IDS, _ as DIRECT_SCOPE_NOTE, $ as Destination, a0 as FLOOR_CATEGORIES, a1 as Hex, a2 as LaneAvailabilityState, L as LaneLimit, a3 as PlannedTxKind, a4 as QuoteBlock, a5 as ResolvedConfig, a6 as RouteHealth, a7 as RouteHealthAvailability, a8 as RouteHealthLane, g as RouteLeg, a9 as SCREENING_BUCKETS, aa as ScreenProvider, ab as ScreeningBucket, ac as ScreeningOutcome, ad as TUNABLE_CATEGORIES, ae as TxPlan, V as VerifyResult, W as WalletScreen, af as amountFieldError, ag as apiError, j as assetClassOf, ah as blockLabelFor, ai as brokenLaneFor, k as brokenLaneReason, aj as buildCatalogue, ak as canAttachApiKey, al as categoryLabel, am as classifyQuoteError, l as complianceChecks, an as complianceControlsEvaluated, m as complianceControlsLine, ao as complianceReasonHead, ap as complianceReasonTag, aq as complianceTagOf, n as complianceView, o as counterpartTokens, ar as createApiClient, as as createVerifier, p as destinationAvailability, at as destinationKeys, au as directComplianceFromScreens, av as distinctScreenedWallets, aw as exceedsLaneLimit, ax as executableRoutes, ay as executionChainIds, q as formatJurisdiction, az as hasReachableDestination, aA as hubDeliverableSymbols, r as humanizeComplianceReason, aB as isExecutableBridge, aC as isKnownUnbridgeable, aD as isSourceToken, aE as laneAvailabilityState, aF as laneKey, aG as laneKeys, aH as laneLimitAmount, aI as laneLimitError, aJ as laneLimitFor, aK as laneLimitHint, aL as laneLimitSymbol, aM as limitedLanes, aN as parseAllowedApiBase, aO as productAssets, aP as registryRpc, aQ as resolveApiBase, aR as resolveConfig, aS as screeningOutcomeOf, aT as sourceKeys, aU as suppressedLanes, aV as tokenKey, aW as txMatchesPlan, aX as unattributedComplianceReasons } from '../verify-Y9jZ83T5.cjs';
|
|
3
3
|
|
|
4
4
|
/** Default request base for the widget: the same-origin keyless custody proxy (server injects the
|
|
5
5
|
* ZeroDelta key). A host may override to `/api/v1` + an apiKey for the demo-first fallback path. */
|
|
@@ -323,6 +323,13 @@ declare function quoteSolanaSource(api: ApiClient, input: SolanaSourceInput): Pr
|
|
|
323
323
|
* nothing built from it is ever signed; the order is always rebuilt by buildSolanaSourcePlan.
|
|
324
324
|
*/
|
|
325
325
|
declare function previewSolanaSource(api: ApiClient, input: Pick<SolanaSourceInput, "toChainId" | "fromToken" | "toToken" | "amountIn">): Promise<SwapPreview>;
|
|
326
|
+
/**
|
|
327
|
+
* The gateway's compliance decision on a native (Solana-source) quote, in the shape the panel reads.
|
|
328
|
+
* The native answer carries `compliance` as a bare word ("screened") and the decision object in
|
|
329
|
+
* `complianceDecision` (prod, 2026-10-28), where an EVM quote carries the object in `compliance`.
|
|
330
|
+
* Reading only `compliance` showed "returned no compliance decision" for every Solana payment.
|
|
331
|
+
*/
|
|
332
|
+
declare function solanaQuoteCompliance(quote: Pick<NativeSolanaQuote, "compliance" | "complianceDecision"> | null | undefined): Compliance | undefined;
|
|
326
333
|
declare function buildSolanaSourcePlan(api: ApiClient, input: SolanaSourceInput, quoted?: SolanaSourcePreview): Promise<SolanaSourcePlan>;
|
|
327
334
|
declare function createSolanaRpc(api: ApiClient): SolanaRpc;
|
|
328
335
|
declare class SolanaSendError extends Error {
|
|
@@ -361,8 +368,79 @@ interface SolanaOrderCost {
|
|
|
361
368
|
balanceLamports: number;
|
|
362
369
|
sufficient: boolean;
|
|
363
370
|
}
|
|
371
|
+
/** `Transfer: insufficient lamports 5179664, need 5913120` → 5913120, from a simulation's logs. */
|
|
372
|
+
declare function solanaLamportShortfall(logs: unknown): number | null;
|
|
373
|
+
/** The words a payer can act on, for a send the cluster refused because the wallet ran out of SOL. */
|
|
374
|
+
declare const SOL_SHORTFALL_MESSAGE = "Not enough SOL in this wallet for the Solana network fee and account rent. Add a little SOL and try again.";
|
|
364
375
|
declare function simulateSolanaCost(rpc: SolanaRpc, plan: SolanaSourcePlan): Promise<SolanaOrderCost>;
|
|
365
376
|
|
|
377
|
+
/** How many orders one history read asks for — what the panel shows. */
|
|
378
|
+
declare const WALLET_HISTORY_LIMIT = 50;
|
|
379
|
+
/** Hex folds case (EIP-55 is a checksum); base58 is compared exactly — lowercasing it changes the key. */
|
|
380
|
+
declare function historyKey(value: string): string;
|
|
381
|
+
/**
|
|
382
|
+
* One gateway order as a history entry. The row is untrusted input: every field is bounded like a
|
|
383
|
+
* stored entry, symbols and decimals come from the registry by (chain, address) — a Solana-source
|
|
384
|
+
* row carries neither — and a row without a well-formed hash is dropped.
|
|
385
|
+
*/
|
|
386
|
+
declare function historyEntryFromOrder(raw: unknown, tokens: readonly Token[]): SanitizedTxEntry | null;
|
|
387
|
+
/**
|
|
388
|
+
* The orders the gateway holds for each connected wallet, newest first. Never rejects: an unreadable
|
|
389
|
+
* history (old proxy without the list, offline, 401) is `null` and the panel keeps its local entries.
|
|
390
|
+
*
|
|
391
|
+
* ⚠️ Every row must name the wallet it was asked for. A proxy that drops the `wallet` filter gets the
|
|
392
|
+
* gateway's UNFILTERED list — every order the key ever priced, other people's included — and without
|
|
393
|
+
* this check the panel would show them as the visitor's own.
|
|
394
|
+
*
|
|
395
|
+
* The gateway indexes an order by its EVM owner (prod, 2026-10-28): an order paid from Solana is under
|
|
396
|
+
* the EVM wallet that owns it, and a Solana address on its own lists nothing today. It is asked anyway,
|
|
397
|
+
* so the panel follows the gateway the day it indexes the paying wallet too.
|
|
398
|
+
*/
|
|
399
|
+
declare function fetchWalletHistory(api: ApiClient, wallets: readonly string[]): Promise<SanitizedTxEntry[] | null>;
|
|
400
|
+
/**
|
|
401
|
+
* Local entries and the gateway's, one row per order, newest first. A local entry keeps what it
|
|
402
|
+
* recorded (the kind, the amounts the card showed, the legs) and takes the gateway's delivery; an
|
|
403
|
+
* order only the gateway knows is added; one the gateway has not indexed yet stays as recorded.
|
|
404
|
+
*/
|
|
405
|
+
declare function mergeHistory(local: readonly SanitizedTxEntry[], remote: readonly SanitizedTxEntry[] | null, limit?: number): SanitizedTxEntry[];
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Where ONE order is on its journey, as the gateway's tracker reports it (`GET /transactions/{hash}`):
|
|
409
|
+
* `submitted → arrived → filled → delivered` (the dapp's step names). A mined source transaction is
|
|
410
|
+
* only the first step — the destination has received nothing yet — so the card must not say
|
|
411
|
+
* "Confirmed" there and stop (reported 2026-10-27: USDT Arbitrum → USDC Solana read "Confirmed"
|
|
412
|
+
* while LayerZero still had the message in flight).
|
|
413
|
+
*
|
|
414
|
+
* Display only. Nothing here gates a signature, and an unreadable tracker is "not known", never a
|
|
415
|
+
* failure: the order is on-chain either way. "Delivered" is the gateway's word, not a proof the
|
|
416
|
+
* widget checked on the destination chain.
|
|
417
|
+
*/
|
|
418
|
+
/** `unavailable`: the tracker never answered for this order (a 404, or a proxy without the route). */
|
|
419
|
+
type DeliveryPhase = "tracking" | "unavailable" | "in-progress" | "attention" | "delivered" | "failed";
|
|
420
|
+
interface DeliveryStep {
|
|
421
|
+
name: string;
|
|
422
|
+
done: boolean;
|
|
423
|
+
}
|
|
424
|
+
interface DeliveryStatus {
|
|
425
|
+
phase: DeliveryPhase;
|
|
426
|
+
/** The gateway's word for the user's journey (`pending`, `fill_failed`…), or "" before it answers. */
|
|
427
|
+
status: string;
|
|
428
|
+
steps: DeliveryStep[];
|
|
429
|
+
}
|
|
430
|
+
declare const TRACKING: DeliveryStatus;
|
|
431
|
+
/**
|
|
432
|
+
* Read the tracker's answer into a phase. Anything unexpected reads as "tracking", never as done.
|
|
433
|
+
*
|
|
434
|
+
* ⚠️ A CHAINED order (the RWA two-leg buy) reports `status: "delivered"` as soon as leg 1 parks the
|
|
435
|
+
* connector in the destination escrow; the user's own outcome is `journeyStatus` (zd-dapp
|
|
436
|
+
* `lib/types.ts`: "render journeyStatus, act on status"). Prod on 2026-10-28 held chained orders
|
|
437
|
+
* with `status: "delivered"` and `journeyStatus: "cancelled"`, which read "Delivered" here before.
|
|
438
|
+
* A chained order with no `journeyStatus` is never reported delivered.
|
|
439
|
+
*/
|
|
440
|
+
declare function normalizeDelivery(raw: unknown): DeliveryStatus;
|
|
441
|
+
/** One read of the tracker. A 404 (not indexed yet), a timeout or a malformed body is "tracking". */
|
|
442
|
+
declare function fetchDelivery(api: ApiClient, hash: string): Promise<DeliveryStatus>;
|
|
443
|
+
|
|
366
444
|
/**
|
|
367
445
|
* The precision of the final order's `askTokenAmount`: the deployment of the destination asset on the
|
|
368
446
|
* chain that EXECUTES that order (USDe asks on Ethereum in 18 decimals while delivering 9 on Solana).
|
|
@@ -912,6 +990,10 @@ interface Engine {
|
|
|
912
990
|
}) => Promise<Catalogue>;
|
|
913
991
|
/** Price a Solana source before any wallet is connected. Display only; nothing built from it is signed. */
|
|
914
992
|
previewSolanaSource: (input: Parameters<typeof previewSolanaSource>[1]) => Promise<SwapPreview>;
|
|
993
|
+
/** Where an order is on its journey, by its source transaction hash. Display only; never rejects. */
|
|
994
|
+
trackDelivery: (hash: string) => Promise<DeliveryStatus>;
|
|
995
|
+
/** The gateway's orders for these wallets (EVM and/or Solana), newest first; null when unreadable. */
|
|
996
|
+
fetchWalletHistory: (wallets: readonly string[]) => Promise<SanitizedTxEntry[] | null>;
|
|
915
997
|
/** The two-click flow: preparation, then the submit on its own click. */
|
|
916
998
|
executeSolanaPlanStaged: (input: Omit<Parameters<typeof executeSolanaPlanStaged>[0], "rpc"> & {
|
|
917
999
|
rpc?: Parameters<typeof executeSolanaPlanStaged>[0]["rpc"];
|
|
@@ -947,4 +1029,4 @@ interface Engine {
|
|
|
947
1029
|
/** Create an engine bound to a config. Its 60s registry cache is shared with every engine of the same base and key (api.ts › registryCacheFor). */
|
|
948
1030
|
declare function createEngine(config?: EngineConfig): Engine;
|
|
949
1031
|
|
|
950
|
-
export { API_CACHE_TTL_MS, ApiClient, type AssertQuoteArgs, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BalanceEntry, type BalanceReader, BalanceTarget, type BuildPayOptionsArgs, type BuildRouteArgs, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CANONICAL_SOLANA_PROGRAM, CHAIN_DISPLAY_NAMES, Catalogue, Chain, Compliance, DEFAULT_WIDGET_API_BASE, type DecodedOrderRequest, type DecodedSubmitOrder, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, type Engine, EngineConfig, ExchangeProduct, type ExpectedOrder, FetchQuoteFn, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, type NativeFeeCheck, type NativeSolanaOption, type NativeSolanaQuote, type NativeSolanaQuoteRequest, NormalizedOrder, OrderRequest, PREVIEW_OWNER, type ParsedSolanaTransaction, PayOption, type PayRequest, type PaymentWalletContext, Plan, PlannedTx, QUOTE_BUFFER_BPS, Quote, Route, RouteResult, RwaVault, SAME_CLASS_STABLE, SCREEN_CACHE_TTL_MS, SOLANA_CHAIN_ID, SOLANA_DESTINATION_ASSETS, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_DISCRIMINATOR, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SanitizedTxEntry, type SolanaBridge, type SolanaOrderCost, type SolanaProgress, type SolanaProgressStage, type SolanaRpc, type SolanaRpcAccount, SolanaSendError, type SolanaSigner, type SolanaSourceInput, type SolanaSourcePlan, type SolanaSourcePreview, type SolanaSubmitOrder, type SolanaTransaction, type SolveArgs, SolveResult, SwapInput, type SwapPreview, TRADEABLE_RWA_ASSETS, Token, TxHistoryEntry, type ValidatedSwap, Verifier, ZERO_ADDRESS, addressWord, allowanceCovers, applyLayerZeroBuffer, askCovers, askTokenDecimals, assertAddress, assertChainAddress, assertQuoteMatchesSelection, assertWalletMessage, assetDecimals, associatedTokenAddress, base58Decode, base58Encode, base64Decode, base64Encode, buildPayOptions, buildRoute, buildSolanaSourcePlan, buildSwapPlan, bytes32Word, bytesEqual, bytesPayload, chainAddressKey, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, checkSolanaPlan as checkPlan, checkSolanaPlan, checkSolanaProgram, checkSolanaReceiver, checkSolanaRouteBuffer, cosignSolanaEvent, createEngine, createSolanaRpc, decodeSolanaSubmitOrder, decodeSolanaSubmitOrder as decodeSubmitOrder, decodeSubmitOrderCalldata, deriveSolanaEvent, encodeAllowance, encodeApprove, encodeBalanceOf, encodeNextSolanaOrders, encodeSubmitOrder, encodeTransfer, executeSolanaPlan, executeSolanaPlanStaged, expectedSolanaDelivery, fetchPaymentPlan, finalOf, findProgramAddress, findToken, foldTicker, formatNative, formatUnits, hexBytes, hexToSolanaKey, isAddress, isChainAddress, isDeliverable, isHexAddress, isHexData, isHexQuantity, isLayerZeroRoute, isOnEd25519Curve, isPreparationInstruction, isSolanaAddress, isSolanaChainId, isSubmitOrder, maxDeadlineSeconds, maxNativeFeeWei, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeOrderRequest, normalizeOrderRequests, overwriteBlockhash, parseAddressLookupTable, parseSolanaTransaction, parseUnitsDecimal, placeSignature, planErrorSummary, planMsgValueHex, pollSolanaConfirmation, previewSolanaSource, quotePartnerId, quotePayOption, quoteSolanaSource, quoteSwapPreview, readSolanaBalance, recommendedDeadlineSeconds, requiresNativeBridgeFee, resolveSolanaKeys, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, serializeSolanaTransaction, sha256, simulateSolanaCost, solanaBridgeOf, solanaDestinationAsset, solanaKeyBytes, solanaKeyHex, solanaPlanNeedsPreparation, solveExactIn, solveExactOut, stableGenieIntentSchema, strip0x, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenTicker, uint64Word, uintWord, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, verifySolanaSubmit, verifySolanaTransaction, verifySolanaSubmit as verifySubmit, verifySolanaTransaction as verifyTransaction, withVaultArtwork };
|
|
1032
|
+
export { API_CACHE_TTL_MS, ApiClient, type AssertQuoteArgs, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BalanceEntry, type BalanceReader, BalanceTarget, type BuildPayOptionsArgs, type BuildRouteArgs, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CANONICAL_SOLANA_PROGRAM, CHAIN_DISPLAY_NAMES, Catalogue, Chain, Compliance, DEFAULT_WIDGET_API_BASE, type DecodedOrderRequest, type DecodedSubmitOrder, type DeliveryPhase, type DeliveryStatus, type DeliveryStep, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, type Engine, EngineConfig, ExchangeProduct, type ExpectedOrder, FetchQuoteFn, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, type NativeFeeCheck, type NativeSolanaOption, type NativeSolanaQuote, type NativeSolanaQuoteRequest, NormalizedOrder, OrderRequest, PREVIEW_OWNER, type ParsedSolanaTransaction, PayOption, type PayRequest, type PaymentWalletContext, Plan, PlannedTx, QUOTE_BUFFER_BPS, Quote, Route, RouteResult, RwaVault, SAME_CLASS_STABLE, SCREEN_CACHE_TTL_MS, SOLANA_CHAIN_ID, SOLANA_DESTINATION_ASSETS, SOL_SHORTFALL_MESSAGE, STABLEGENIE_INTENT_TTL_MS, STABLEGENIE_INTENT_VERSION, STABLEGENIE_SUPPORTED_ASSETS, STABLEGENIE_SUPPORTED_CHAIN_IDS, STABLE_ASSETS, SUBMIT_ORDER_DISCRIMINATOR, SUBMIT_ORDER_SELECTOR, SUPPORTED_ASSETS, SUPPORTED_CHAIN_IDS, SanitizedTxEntry, type SolanaBridge, type SolanaOrderCost, type SolanaProgress, type SolanaProgressStage, type SolanaRpc, type SolanaRpcAccount, SolanaSendError, type SolanaSigner, type SolanaSourceInput, type SolanaSourcePlan, type SolanaSourcePreview, type SolanaSubmitOrder, type SolanaTransaction, type SolveArgs, SolveResult, SwapInput, type SwapPreview, TRACKING, TRADEABLE_RWA_ASSETS, Token, TxHistoryEntry, type ValidatedSwap, Verifier, WALLET_HISTORY_LIMIT, ZERO_ADDRESS, addressWord, allowanceCovers, applyLayerZeroBuffer, askCovers, askTokenDecimals, assertAddress, assertChainAddress, assertQuoteMatchesSelection, assertWalletMessage, assetDecimals, associatedTokenAddress, base58Decode, base58Encode, base64Decode, base64Encode, buildPayOptions, buildRoute, buildSolanaSourcePlan, buildSwapPlan, bytes32Word, bytesEqual, bytesPayload, chainAddressKey, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, checkSolanaPlan as checkPlan, checkSolanaPlan, checkSolanaProgram, checkSolanaReceiver, checkSolanaRouteBuffer, cosignSolanaEvent, createEngine, createSolanaRpc, decodeSolanaSubmitOrder, decodeSolanaSubmitOrder as decodeSubmitOrder, decodeSubmitOrderCalldata, deriveSolanaEvent, encodeAllowance, encodeApprove, encodeBalanceOf, encodeNextSolanaOrders, encodeSubmitOrder, encodeTransfer, executeSolanaPlan, executeSolanaPlanStaged, expectedSolanaDelivery, fetchDelivery, fetchPaymentPlan, fetchWalletHistory, finalOf, findProgramAddress, findToken, foldTicker, formatNative, formatUnits, hexBytes, hexToSolanaKey, historyEntryFromOrder, historyKey, isAddress, isChainAddress, isDeliverable, isHexAddress, isHexData, isHexQuantity, isLayerZeroRoute, isOnEd25519Curve, isPreparationInstruction, isSolanaAddress, isSolanaChainId, isSubmitOrder, maxDeadlineSeconds, maxNativeFeeWei, mergeHistory, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeDelivery, normalizeOrderRequest, normalizeOrderRequests, overwriteBlockhash, parseAddressLookupTable, parseSolanaTransaction, parseUnitsDecimal, placeSignature, planErrorSummary, planMsgValueHex, pollSolanaConfirmation, previewSolanaSource, quotePartnerId, quotePayOption, quoteSolanaSource, quoteSwapPreview, readSolanaBalance, recommendedDeadlineSeconds, requiresNativeBridgeFee, resolveSolanaKeys, resolveSwapReceiver, resolveVaultIcon, routeNativeValue, safeTicker, scaleDecimals, serializeSolanaTransaction, sha256, simulateSolanaCost, solanaBridgeOf, solanaDestinationAsset, solanaKeyBytes, solanaKeyHex, solanaLamportShortfall, solanaPlanNeedsPreparation, solanaQuoteCompliance, solveExactIn, solveExactOut, stableGenieIntentSchema, strip0x, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenTicker, uint64Word, uintWord, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, verifySolanaSubmit, verifySolanaTransaction, verifySolanaSubmit as verifySubmit, verifySolanaTransaction as verifyTransaction, withVaultArtwork };
|