@glacislabs/stablegenie-zerodelta 4.21.0 → 4.22.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/CHANGELOG.md +424 -0
- package/dist/{chunk-KOFREX5L.js → chunk-6TCVZRNB.js} +385 -31
- package/dist/{chunk-3E554IZO.js → chunk-WVDRVGBA.js} +474 -51
- package/dist/core/index.cjs +400 -30
- package/dist/core/index.d.cts +196 -3
- package/dist/core/index.d.ts +196 -3
- package/dist/core/index.js +1 -1
- package/dist/index.cjs +886 -109
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{mount-C2GLFqgK.d.cts → mount-DC_JT0cE.d.cts} +1 -1
- package/dist/{mount-867H-JSe.d.ts → mount-GOYY_jNr.d.ts} +1 -1
- package/dist/mount.cjs +886 -109
- 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 +15 -8
- package/dist/{verify-CeHRSKl2.d.cts → verify-mpglrU7n.d.cts} +11 -1
- package/dist/{verify-CeHRSKl2.d.ts → verify-mpglrU7n.d.ts} +11 -1
- package/package.json +3 -2
|
@@ -1780,13 +1780,22 @@ var MAX_STEPS = 8;
|
|
|
1780
1780
|
function isZdHeavy(r, steps) {
|
|
1781
1781
|
return r.protocol === "zdheavy" || steps.some((s) => Number(s.stepNumber ?? 0) >= ZDH_FIRST_STEP);
|
|
1782
1782
|
}
|
|
1783
|
+
var FILL_EVIDENCE = /* @__PURE__ */ new Set(["filled", "consumed", "step_executed", "paid_out", "delivered"]);
|
|
1784
|
+
function ownerCancelServedAsDeliveryFailure(steps) {
|
|
1785
|
+
const txHash = (s) => typeof s.txHash === "string" && /^0x[0-9a-fA-F]{64}$/.test(s.txHash);
|
|
1786
|
+
const anyTx = (s) => typeof s.txHash === "string" && s.txHash.length > 0;
|
|
1787
|
+
const cancelTx = steps.some((s) => s.stepName === "cancelled" && txHash(s));
|
|
1788
|
+
const refunded = steps.some((s) => s.stepName === "refunded" && word(s.stepStatus) === "recovered" && txHash(s));
|
|
1789
|
+
const filled = steps.some((s) => FILL_EVIDENCE.has(String(s.stepName)) && word(s.stepStatus) === "completed" && anyTx(s));
|
|
1790
|
+
return cancelTx && refunded && !filled;
|
|
1791
|
+
}
|
|
1783
1792
|
function zdHeavyDelivery(own, rawSteps) {
|
|
1784
1793
|
const named = rawSteps.filter((s) => s && typeof s === "object" && typeof s.stepName === "string");
|
|
1785
1794
|
const lite = (name) => named.some((s) => Number(s.stepNumber ?? 0) < ZDH_FIRST_STEP && s.stepName === name && s.stepStatus === "completed");
|
|
1786
1795
|
const events = named.map((s, i) => ({ s, i })).filter(({ s }) => Number(s.stepNumber ?? 0) >= ZDH_FIRST_STEP).sort((a, b) => (Date.parse(String(a.s.blockTimestamp ?? "")) || 0) - (Date.parse(String(b.s.blockTimestamp ?? "")) || 0) || a.i - b.i).map(({ s }) => s);
|
|
1787
1796
|
const has = (name) => events.some((e) => e.stepName === name);
|
|
1788
1797
|
const cancelled = has("cancelled");
|
|
1789
|
-
const status = PROGRESS.has(own) && has("paid_out") && !cancelled ? "delivered" : own;
|
|
1798
|
+
const status = own === "delivery_failed" && ownerCancelServedAsDeliveryFailure(named) ? "cancelled" : PROGRESS.has(own) && has("paid_out") && !cancelled ? "delivered" : own;
|
|
1790
1799
|
const steps = [];
|
|
1791
1800
|
const push = (name, done) => {
|
|
1792
1801
|
const last = steps[steps.length - 1];
|
|
@@ -1888,7 +1897,10 @@ function historyEntryFromOrder(raw2, tokens) {
|
|
|
1888
1897
|
const toAsset = (to?.symbol ?? (str(r.finalToTokenSymbol) || str(r.toTokenSymbol))).slice(0, 10);
|
|
1889
1898
|
const payAmount = amountOf(str(r.fromTokenRawAmount), from, r.fromTokenDecimals, str(r.fromTokenAmount));
|
|
1890
1899
|
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));
|
|
1891
|
-
const
|
|
1900
|
+
const tracked = normalizeDelivery(r);
|
|
1901
|
+
const delivery = tracked.phase;
|
|
1902
|
+
const protocol = str(r.protocol);
|
|
1903
|
+
const orderId = str(r.orderId);
|
|
1892
1904
|
const wallet = str(r.wallet);
|
|
1893
1905
|
const receiver = str(r.destinationReceiver);
|
|
1894
1906
|
const at = str(r.createdAt) || str(r.submittedAt);
|
|
@@ -1910,6 +1922,11 @@ function historyEntryFromOrder(raw2, tokens) {
|
|
|
1910
1922
|
status: "submitted",
|
|
1911
1923
|
at: Number.isNaN(Date.parse(at)) ? (/* @__PURE__ */ new Date(0)).toISOString() : new Date(at).toISOString(),
|
|
1912
1924
|
delivery: delivery === "tracking" || delivery === "unavailable" ? void 0 : delivery,
|
|
1925
|
+
...tracked.status && delivery !== "tracking" && delivery !== "unavailable" ? { deliveryStatus: tracked.status.slice(0, 32) } : {},
|
|
1926
|
+
.../^[a-z]{1,16}$/.test(protocol) ? { protocol } : {},
|
|
1927
|
+
// Only a router order id (bytes32) is carried: it is the one thing a recovery call puts in a URL.
|
|
1928
|
+
.../^0x[0-9a-fA-F]{64}$/.test(orderId) ? { orderId } : {},
|
|
1929
|
+
...r.claimable === true ? { claimable: true } : {},
|
|
1913
1930
|
legs: [
|
|
1914
1931
|
{
|
|
1915
1932
|
index: 1,
|
|
@@ -1957,7 +1974,17 @@ function mergeHistory(local, remote, limit = WALLET_HISTORY_LIMIT) {
|
|
|
1957
1974
|
if (seen.has(key2)) continue;
|
|
1958
1975
|
seen.add(key2);
|
|
1959
1976
|
const known = byHash.get(key2);
|
|
1960
|
-
out.push(
|
|
1977
|
+
out.push(
|
|
1978
|
+
known ? {
|
|
1979
|
+
...entry,
|
|
1980
|
+
delivery: known.delivery,
|
|
1981
|
+
legs: entry.legs ?? known.legs,
|
|
1982
|
+
deliveryStatus: known.deliveryStatus,
|
|
1983
|
+
protocol: known.protocol,
|
|
1984
|
+
orderId: known.orderId,
|
|
1985
|
+
claimable: known.claimable
|
|
1986
|
+
} : entry
|
|
1987
|
+
);
|
|
1961
1988
|
}
|
|
1962
1989
|
for (const [key2, entry] of byHash) if (!seen.has(key2)) out.push(entry);
|
|
1963
1990
|
return out.sort((a, b) => Date.parse(b.at) - Date.parse(a.at)).slice(0, limit);
|
|
@@ -2815,16 +2842,16 @@ function normalizeOrderRequests(requests, payer, destination, fallbackExecutionC
|
|
|
2815
2842
|
);
|
|
2816
2843
|
}
|
|
2817
2844
|
function assertQuoteMatchesSelection({ quote, order, orders, option, destinationToken, destination, payer, result, tokens = [] }) {
|
|
2818
|
-
const
|
|
2819
|
-
const sourceOrder =
|
|
2820
|
-
const finalOrder =
|
|
2845
|
+
const list2 = orders?.length ? orders : [order];
|
|
2846
|
+
const sourceOrder = list2[0];
|
|
2847
|
+
const finalOrder = list2[list2.length - 1];
|
|
2821
2848
|
const now = Math.floor(Date.now() / 1e3);
|
|
2822
2849
|
const deadline = Number(sourceOrder.deadline || 0);
|
|
2823
2850
|
const solana = isSolanaChainId(destination.chainId);
|
|
2824
2851
|
if (solana && solanaDestinationAsset(destinationToken.address)?.symbol !== symbolKey(destinationToken.symbol)) {
|
|
2825
2852
|
throw new Error("This Solana token is not supported for delivery; refusing to sign.");
|
|
2826
2853
|
}
|
|
2827
|
-
for (const current of
|
|
2854
|
+
for (const current of list2) {
|
|
2828
2855
|
if (normalizeAddress(current.owner) !== normalizeAddress(payer)) {
|
|
2829
2856
|
throw new Error("ZeroDelta quote returned an owner that does not match the connected wallet.");
|
|
2830
2857
|
}
|
|
@@ -2875,9 +2902,9 @@ function assertQuoteMatchesSelection({ quote, order, orders, option, destination
|
|
|
2875
2902
|
if (!Number.isFinite(deadline) || deadline <= now || deadline > now + maxDeadline + DEADLINE_CLOCK_SKEW_SECONDS) {
|
|
2876
2903
|
throw new Error("ZeroDelta quote deadline is invalid or too far in the future.");
|
|
2877
2904
|
}
|
|
2878
|
-
for (let index = 1; index <
|
|
2879
|
-
const previous =
|
|
2880
|
-
const current =
|
|
2905
|
+
for (let index = 1; index < list2.length; index += 1) {
|
|
2906
|
+
const previous = list2[index - 1];
|
|
2907
|
+
const current = list2[index];
|
|
2881
2908
|
if (normalizeAddress(previous.askToken) !== normalizeAddress(current.bidToken)) {
|
|
2882
2909
|
throw new Error("ZeroDelta chained quote returned disconnected order tokens.");
|
|
2883
2910
|
}
|
|
@@ -2954,10 +2981,10 @@ function keccak256Hex(bytes) {
|
|
|
2954
2981
|
return out;
|
|
2955
2982
|
}
|
|
2956
2983
|
function toChecksumAddress(address) {
|
|
2957
|
-
const
|
|
2958
|
-
const hash = keccak256Hex(new TextEncoder().encode(
|
|
2984
|
+
const lower4 = address.slice(2).toLowerCase();
|
|
2985
|
+
const hash = keccak256Hex(new TextEncoder().encode(lower4));
|
|
2959
2986
|
let out = "0x";
|
|
2960
|
-
for (let i = 0; i < 40; i++) out += Number.parseInt(hash[i], 16) >= 8 ?
|
|
2987
|
+
for (let i = 0; i < 40; i++) out += Number.parseInt(hash[i], 16) >= 8 ? lower4[i].toUpperCase() : lower4[i];
|
|
2961
2988
|
return out;
|
|
2962
2989
|
}
|
|
2963
2990
|
function hasValidChecksum(address) {
|
|
@@ -2975,6 +3002,7 @@ var toHex = (v, opts) => "0x" + (typeof v === "bigint" ? v.toString(16).padStart
|
|
|
2975
3002
|
var keccak256 = (h) => "0x" + keccak256Hex(hexToBytes(h));
|
|
2976
3003
|
var STEP_VERSION = 5;
|
|
2977
3004
|
var MAX_STEPS2 = 8;
|
|
3005
|
+
var ORDER_HEADER_LEN = 76;
|
|
2978
3006
|
var StepKind = {
|
|
2979
3007
|
LOCAL_PAYOUT: 1,
|
|
2980
3008
|
REMOTE_PAYOUT: 2,
|
|
@@ -3115,11 +3143,11 @@ function decodeStep(step) {
|
|
|
3115
3143
|
r.end();
|
|
3116
3144
|
return result;
|
|
3117
3145
|
}
|
|
3118
|
-
function routerWord(
|
|
3119
|
-
return concat([toHex(new Uint8Array(12)), checkedHex(
|
|
3146
|
+
function routerWord(addr2) {
|
|
3147
|
+
return concat([toHex(new Uint8Array(12)), checkedHex(addr2, 20)]);
|
|
3120
3148
|
}
|
|
3121
|
-
function ownerWord(
|
|
3122
|
-
return routerWord(
|
|
3149
|
+
function ownerWord(addr2) {
|
|
3150
|
+
return routerWord(addr2);
|
|
3123
3151
|
}
|
|
3124
3152
|
function encodeOrderHeader(serial, router, ownerType, owner) {
|
|
3125
3153
|
if (!Number.isInteger(ownerType) || ownerType < 0 || ownerType > 255) throw new ZdHeavyCodecError("Invalid ownerType");
|
|
@@ -4397,7 +4425,7 @@ var CHANNEL_HEADER = "x-zd-channel";
|
|
|
4397
4425
|
var CHANNEL_VERSION_HEADER = "x-zd-channel-version";
|
|
4398
4426
|
var CHANNEL_ORIGIN_HEADER = "x-zd-channel-origin";
|
|
4399
4427
|
var WIDGET_CHANNEL = "widget";
|
|
4400
|
-
var WIDGET_VERSION = "4.
|
|
4428
|
+
var WIDGET_VERSION = "4.22.1" ;
|
|
4401
4429
|
var MAX_CHANNEL_VERSION_LEN = 32;
|
|
4402
4430
|
function sanitizeVersion(raw2) {
|
|
4403
4431
|
const v = String(raw2).trim();
|
|
@@ -4754,24 +4782,24 @@ function createApiClient(cfg) {
|
|
|
4754
4782
|
throw lastError;
|
|
4755
4783
|
}
|
|
4756
4784
|
async function screenWallet(address, chainId) {
|
|
4757
|
-
const
|
|
4758
|
-
if (!
|
|
4759
|
-
const solana = isSolanaChainId(chainId) || isSolanaAddress(
|
|
4760
|
-
if (solana && !isSolanaAddress(
|
|
4761
|
-
const key2 = solana ? "solana|" +
|
|
4785
|
+
const addr2 = String(address || "").trim();
|
|
4786
|
+
if (!addr2) throw apiError("An address is required to screen a wallet.", { code: "bad_request" });
|
|
4787
|
+
const solana = isSolanaChainId(chainId) || isSolanaAddress(addr2);
|
|
4788
|
+
if (solana && !isSolanaAddress(addr2)) throw apiError("Not a valid Solana address.", { code: "bad_request" });
|
|
4789
|
+
const key2 = solana ? "solana|" + addr2 : (/^0x[0-9a-fA-F]+$/.test(addr2) ? addr2.toLowerCase() : addr2) + "|" + (chainId ?? "");
|
|
4762
4790
|
const hit = screenCache.get(key2);
|
|
4763
4791
|
if (hit && Date.now() - hit.at < SCREEN_CACHE_TTL_MS) return hit.value;
|
|
4764
4792
|
const inflight = screenInflight.get(key2);
|
|
4765
4793
|
if (inflight) return inflight;
|
|
4766
4794
|
const request = apiRequest("/screen/wallet", {
|
|
4767
4795
|
method: "POST",
|
|
4768
|
-
body: JSON.stringify(solana ? { address:
|
|
4796
|
+
body: JSON.stringify(solana ? { address: addr2, network: "solana" } : chainId == null ? { address: addr2 } : { address: addr2, chainId }),
|
|
4769
4797
|
timeoutMs: 12e3
|
|
4770
4798
|
}).then((screen) => {
|
|
4771
4799
|
if (!screen || typeof screen !== "object" || typeof screen.blocked !== "boolean") {
|
|
4772
4800
|
throw apiError("Compliance screening returned an unusable result.", { code: "bad_response" });
|
|
4773
4801
|
}
|
|
4774
|
-
const value = { ...screen, address: screen.address ||
|
|
4802
|
+
const value = { ...screen, address: screen.address || addr2 };
|
|
4775
4803
|
screenCache.set(key2, { at: Date.now(), value });
|
|
4776
4804
|
return value;
|
|
4777
4805
|
}).finally(() => {
|
|
@@ -4875,12 +4903,12 @@ async function fetchPaymentPlan(api, request, payer, wallet = {}, readBalances)
|
|
|
4875
4903
|
const parties = [];
|
|
4876
4904
|
const seenParty = /* @__PURE__ */ new Set();
|
|
4877
4905
|
for (const raw2 of [payer, destination.address]) {
|
|
4878
|
-
const
|
|
4879
|
-
if (!
|
|
4880
|
-
const key2 = /^0x[0-9a-fA-F]+$/.test(
|
|
4906
|
+
const addr2 = String(raw2 || "").trim();
|
|
4907
|
+
if (!addr2) continue;
|
|
4908
|
+
const key2 = /^0x[0-9a-fA-F]+$/.test(addr2) ? addr2.toLowerCase() : addr2;
|
|
4881
4909
|
if (seenParty.has(key2)) continue;
|
|
4882
4910
|
seenParty.add(key2);
|
|
4883
|
-
parties.push(
|
|
4911
|
+
parties.push(addr2);
|
|
4884
4912
|
}
|
|
4885
4913
|
try {
|
|
4886
4914
|
const screens = await Promise.all(parties.map((address) => api.screenWallet(address, destination.chainId)));
|
|
@@ -5095,6 +5123,322 @@ async function buildSwapPlan(api, swap, payer, wallet = {}) {
|
|
|
5095
5123
|
};
|
|
5096
5124
|
}
|
|
5097
5125
|
|
|
5126
|
+
// src/core/zdheavy-cancel.ts
|
|
5127
|
+
var lower3 = (s) => (typeof s === "string" ? s : "").toLowerCase();
|
|
5128
|
+
var ORDER_ID = /^0x[0-9a-fA-F]{64}$/;
|
|
5129
|
+
var EVM_ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
5130
|
+
function isZdHeavyOrderId(v) {
|
|
5131
|
+
return typeof v === "string" && ORDER_ID.test(v);
|
|
5132
|
+
}
|
|
5133
|
+
function zdHeavyRecovery(plan, wallet) {
|
|
5134
|
+
const claims = wallet ? plan.places.flatMap(
|
|
5135
|
+
(p) => p.kind === "router" && p.chainId !== void 0 && p.contract ? p.claimable.filter((c) => lower3(c.payee) === lower3(wallet)).map((c) => ({ chainId: p.chainId, token: c.token, amount: c.amount })) : []
|
|
5136
|
+
) : [];
|
|
5137
|
+
if (claims.length) return { kind: "claim", claims };
|
|
5138
|
+
if (plan.finished) return { kind: "delivered" };
|
|
5139
|
+
if (plan.state === "refund_complete" && plan.complete) {
|
|
5140
|
+
return { kind: "refunded", refunds: plan.places.flatMap((p) => p.refunds.map((r) => ({ ...r, chainId: p.chainId }))) };
|
|
5141
|
+
}
|
|
5142
|
+
if (plan.ownerType !== "evm") return { kind: "not-owner" };
|
|
5143
|
+
const holding = plan.places.filter(
|
|
5144
|
+
(p) => p.kind === "router" && p.chainId !== void 0 && !!p.contract && p.canCancelInPerson && !p.complete && p.lots.length > 0
|
|
5145
|
+
);
|
|
5146
|
+
if (holding.length) return { kind: "cancel", chains: holding.map((p) => p.chainId), requested: plan.state === "cancel_requested" };
|
|
5147
|
+
if (plan.state === "open" && !plan.complete) return { kind: "cancel", chains: [plan.originChainId], requested: false };
|
|
5148
|
+
return { kind: "waiting" };
|
|
5149
|
+
}
|
|
5150
|
+
var MAX_PLACES = 32;
|
|
5151
|
+
var MAX_ROWS = 64;
|
|
5152
|
+
var DIGITS = /^\d{1,78}$/;
|
|
5153
|
+
var LOT_KEY = /^(?:\d{1,78}|0x[0-9a-fA-F]{1,64})$/;
|
|
5154
|
+
var TX_HASH = /^0x[0-9a-fA-F]{64}$/;
|
|
5155
|
+
var posInt = (v) => typeof v === "number" && Number.isSafeInteger(v) && v > 0 ? v : void 0;
|
|
5156
|
+
var nonNegInt = (v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 0;
|
|
5157
|
+
var addr = (v) => typeof v === "string" && EVM_ADDRESS.test(v);
|
|
5158
|
+
var list = (v) => v === void 0 || v === null ? [] : Array.isArray(v) && v.length <= MAX_ROWS ? v : null;
|
|
5159
|
+
var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
5160
|
+
function normalizeCancellationPlan(raw2, orderId) {
|
|
5161
|
+
const r = obj(raw2);
|
|
5162
|
+
if (!r || !isZdHeavyOrderId(orderId) || lower3(r.orderId) !== lower3(orderId)) return null;
|
|
5163
|
+
const ownerType = r.ownerType === "evm" || r.ownerType === "solana" ? r.ownerType : null;
|
|
5164
|
+
const state = r.state === "open" || r.state === "cancel_requested" || r.state === "refund_complete" ? r.state : null;
|
|
5165
|
+
const originChainId = posInt(r.originChainId);
|
|
5166
|
+
if (!ownerType || !state || originChainId === void 0 || typeof r.complete !== "boolean" || typeof r.owner !== "string" || r.owner.length > 64) return null;
|
|
5167
|
+
if (r.finished !== void 0 && typeof r.finished !== "boolean") return null;
|
|
5168
|
+
if (!Array.isArray(r.places) || r.places.length > MAX_PLACES) return null;
|
|
5169
|
+
const places = [];
|
|
5170
|
+
for (const rawPlace of r.places) {
|
|
5171
|
+
const p = obj(rawPlace);
|
|
5172
|
+
if (!p || p.kind !== "router" && p.kind !== "hub" || typeof p.canCancelInPerson !== "boolean" || typeof p.complete !== "boolean") return null;
|
|
5173
|
+
const chainId = p.chainId === void 0 ? void 0 : posInt(p.chainId);
|
|
5174
|
+
if (p.chainId !== void 0 && chainId === void 0) return null;
|
|
5175
|
+
const contract = typeof p.contract === "string" ? p.contract : "";
|
|
5176
|
+
if (contract && !addr(contract)) return null;
|
|
5177
|
+
const lots = list(p.lots);
|
|
5178
|
+
const refunds = list(p.refunds);
|
|
5179
|
+
const claimable = list(p.claimable);
|
|
5180
|
+
if (!lots || !refunds || !claimable) return null;
|
|
5181
|
+
const place = {
|
|
5182
|
+
kind: p.kind,
|
|
5183
|
+
chainId,
|
|
5184
|
+
contract,
|
|
5185
|
+
canCancelInPerson: p.canCancelInPerson,
|
|
5186
|
+
complete: p.complete,
|
|
5187
|
+
lots: [],
|
|
5188
|
+
refunds: [],
|
|
5189
|
+
claimable: []
|
|
5190
|
+
};
|
|
5191
|
+
for (const rawLot of lots) {
|
|
5192
|
+
const l = obj(rawLot);
|
|
5193
|
+
if (!l || !nonNegInt(l.step) || !addr(l.token) || typeof l.amount !== "string" || !DIGITS.test(l.amount) || typeof l.key !== "string" || !LOT_KEY.test(l.key))
|
|
5194
|
+
return null;
|
|
5195
|
+
place.lots.push({ step: l.step, token: l.token, amount: l.amount, key: l.key });
|
|
5196
|
+
}
|
|
5197
|
+
for (const rawRefund of refunds) {
|
|
5198
|
+
const f = obj(rawRefund);
|
|
5199
|
+
if (!f || typeof f.txHash !== "string" || !TX_HASH.test(f.txHash) || !nonNegInt(f.step) || !addr(f.token) || typeof f.amount !== "string" || !DIGITS.test(f.amount) || !addr(f.to))
|
|
5200
|
+
return null;
|
|
5201
|
+
place.refunds.push({ txHash: f.txHash, step: f.step, token: f.token, amount: f.amount, to: f.to });
|
|
5202
|
+
}
|
|
5203
|
+
for (const rawClaim of claimable) {
|
|
5204
|
+
const c = obj(rawClaim);
|
|
5205
|
+
if (!c || !addr(c.payee) || !addr(c.token) || typeof c.amount !== "string" || !DIGITS.test(c.amount)) return null;
|
|
5206
|
+
place.claimable.push({ payee: c.payee, token: c.token, amount: c.amount });
|
|
5207
|
+
}
|
|
5208
|
+
places.push(place);
|
|
5209
|
+
}
|
|
5210
|
+
return {
|
|
5211
|
+
orderId: r.orderId,
|
|
5212
|
+
ownerType,
|
|
5213
|
+
owner: r.owner,
|
|
5214
|
+
originChainId,
|
|
5215
|
+
state,
|
|
5216
|
+
complete: r.complete,
|
|
5217
|
+
...r.finished !== void 0 ? { finished: r.finished } : {},
|
|
5218
|
+
places
|
|
5219
|
+
};
|
|
5220
|
+
}
|
|
5221
|
+
function zdHeavyOrderPath(orderId, tail) {
|
|
5222
|
+
if (!isZdHeavyOrderId(orderId)) throw new ZdHeavyCodecError("Not a ZD Heavy order id.");
|
|
5223
|
+
return `/orders/${orderId.toLowerCase()}/${tail}`;
|
|
5224
|
+
}
|
|
5225
|
+
async function fetchZdHeavyCancellation(api, orderId) {
|
|
5226
|
+
if (!isZdHeavyOrderId(orderId)) return null;
|
|
5227
|
+
try {
|
|
5228
|
+
return normalizeCancellationPlan(await api.apiRequest(zdHeavyOrderPath(orderId, "cancellation"), { timeoutMs: 1e4 }), orderId);
|
|
5229
|
+
} catch {
|
|
5230
|
+
return null;
|
|
5231
|
+
}
|
|
5232
|
+
}
|
|
5233
|
+
function unsigned(raw2) {
|
|
5234
|
+
const r = obj(raw2);
|
|
5235
|
+
const s = (v) => typeof v === "string" ? v : typeof v === "number" ? String(v) : "";
|
|
5236
|
+
if (!r) return { purpose: "", chainId: "", from: "", to: "", data: "" };
|
|
5237
|
+
return {
|
|
5238
|
+
purpose: s(r.purpose),
|
|
5239
|
+
chainId: s(r.chainId),
|
|
5240
|
+
from: s(r.from),
|
|
5241
|
+
to: s(r.to),
|
|
5242
|
+
data: s(r.data),
|
|
5243
|
+
...r.value !== void 0 ? { value: s(r.value) } : {}
|
|
5244
|
+
};
|
|
5245
|
+
}
|
|
5246
|
+
async function buildZdHeavyCancelTx(api, orderId, chainId) {
|
|
5247
|
+
return unsigned(
|
|
5248
|
+
await api.apiRequest(zdHeavyOrderPath(orderId, "cancel-tx"), {
|
|
5249
|
+
method: "POST",
|
|
5250
|
+
body: JSON.stringify(chainId === void 0 ? {} : { chainId }),
|
|
5251
|
+
timeoutMs: 15e3
|
|
5252
|
+
})
|
|
5253
|
+
);
|
|
5254
|
+
}
|
|
5255
|
+
async function buildZdHeavyClaimTx(api, orderId, chainId, token) {
|
|
5256
|
+
return unsigned(
|
|
5257
|
+
await api.apiRequest(zdHeavyOrderPath(orderId, "claim-tx"), {
|
|
5258
|
+
method: "POST",
|
|
5259
|
+
body: JSON.stringify({ chainId, token }),
|
|
5260
|
+
timeoutMs: 15e3
|
|
5261
|
+
})
|
|
5262
|
+
);
|
|
5263
|
+
}
|
|
5264
|
+
var ZDHEAVY_CANCEL_SELECTOR = "0xf26bce2c";
|
|
5265
|
+
var ZDHEAVY_CLAIM_SELECTOR = "0x1e83409a";
|
|
5266
|
+
var ZDHEAVY_CLAIM_TO_SELECTOR = "0x21c0b342";
|
|
5267
|
+
var MAX_CANCEL_KEYS = 32;
|
|
5268
|
+
function reader(data, selector) {
|
|
5269
|
+
if (typeof data !== "string" || !/^0x(?:[0-9a-fA-F]{2})*$/.test(data) || data.slice(0, 10).toLowerCase() !== selector) {
|
|
5270
|
+
throw new ZdHeavyCodecError("Unexpected call");
|
|
5271
|
+
}
|
|
5272
|
+
const body = data.slice(10).toLowerCase();
|
|
5273
|
+
const size = body.length / 2;
|
|
5274
|
+
const fail = () => {
|
|
5275
|
+
throw new ZdHeavyCodecError("Invalid calldata");
|
|
5276
|
+
};
|
|
5277
|
+
const word2 = (at, bits = 256) => {
|
|
5278
|
+
if (!Number.isSafeInteger(at) || at < 0 || at + 32 > size) return fail();
|
|
5279
|
+
const n = BigInt(`0x${body.slice(at * 2, (at + 32) * 2)}`);
|
|
5280
|
+
if (bits < 256 && n >= 1n << BigInt(bits)) return fail();
|
|
5281
|
+
return n;
|
|
5282
|
+
};
|
|
5283
|
+
const fixed = (at) => {
|
|
5284
|
+
word2(at);
|
|
5285
|
+
return `0x${body.slice(at * 2, (at + 32) * 2)}`;
|
|
5286
|
+
};
|
|
5287
|
+
const address = (at) => `0x${word2(at, 160).toString(16).padStart(40, "0")}`;
|
|
5288
|
+
const offset = (at, expected) => {
|
|
5289
|
+
if (word2(at) !== BigInt(expected)) fail();
|
|
5290
|
+
};
|
|
5291
|
+
const count = (at, each) => {
|
|
5292
|
+
const n = word2(at);
|
|
5293
|
+
if (n > BigInt(Math.floor((size - at - 32) / each))) return fail();
|
|
5294
|
+
return Number(n);
|
|
5295
|
+
};
|
|
5296
|
+
const bytes = (at) => {
|
|
5297
|
+
const n = word2(at);
|
|
5298
|
+
if (n > BigInt(size - at - 32)) return fail();
|
|
5299
|
+
const length = Number(n);
|
|
5300
|
+
const end = at + 32 + Math.ceil(length / 32) * 32;
|
|
5301
|
+
if (end > size || /[^0]/.test(body.slice((at + 32 + length) * 2, end * 2))) return fail();
|
|
5302
|
+
return { value: `0x${body.slice((at + 32) * 2, (at + 32 + length) * 2)}`, end };
|
|
5303
|
+
};
|
|
5304
|
+
return { size, fail, word: word2, fixed, address, offset, count, bytes };
|
|
5305
|
+
}
|
|
5306
|
+
function decodeZdHeavyCancel(data) {
|
|
5307
|
+
const r = reader(data, ZDHEAVY_CANCEL_SELECTOR);
|
|
5308
|
+
const orderId = r.fixed(0);
|
|
5309
|
+
const P2 = 96;
|
|
5310
|
+
r.offset(32, P2);
|
|
5311
|
+
const expiryDate = r.word(P2, 64);
|
|
5312
|
+
r.offset(P2 + 32, 96);
|
|
5313
|
+
const header = r.bytes(P2 + 96);
|
|
5314
|
+
r.offset(P2 + 64, header.end - P2);
|
|
5315
|
+
const hashesAt = header.end;
|
|
5316
|
+
const n = r.count(hashesAt, 32);
|
|
5317
|
+
const stepHashes = [];
|
|
5318
|
+
for (let i = 0; i < n; i++) stepHashes.push(r.fixed(hashesAt + 32 + i * 32));
|
|
5319
|
+
const keysAt = hashesAt + 32 + n * 32;
|
|
5320
|
+
r.offset(64, keysAt);
|
|
5321
|
+
const k = r.count(keysAt, 32);
|
|
5322
|
+
const keys = [];
|
|
5323
|
+
for (let i = 0; i < k; i++) keys.push(r.word(keysAt + 32 + i * 32));
|
|
5324
|
+
if (keysAt + 32 + k * 32 !== r.size) r.fail();
|
|
5325
|
+
return { orderId, proof: { expiryDate, orderHeader: header.value, stepHashes }, keys };
|
|
5326
|
+
}
|
|
5327
|
+
function decodeZdHeavyClaim(data) {
|
|
5328
|
+
const selector = typeof data === "string" ? data.slice(0, 10).toLowerCase() : "";
|
|
5329
|
+
if (selector === ZDHEAVY_CLAIM_SELECTOR) {
|
|
5330
|
+
const r2 = reader(data, ZDHEAVY_CLAIM_SELECTOR);
|
|
5331
|
+
if (r2.size !== 32) r2.fail();
|
|
5332
|
+
return { token: r2.address(0) };
|
|
5333
|
+
}
|
|
5334
|
+
const r = reader(data, ZDHEAVY_CLAIM_TO_SELECTOR);
|
|
5335
|
+
if (r.size !== 64) r.fail();
|
|
5336
|
+
return { token: r.address(0), to: r.address(32) };
|
|
5337
|
+
}
|
|
5338
|
+
var hexBytes2 = (h) => Uint8Array.from(h.slice(2).match(/../g) ?? [], (b) => Number.parseInt(b, 16));
|
|
5339
|
+
var keccak = (h) => `0x${keccak256Hex(hexBytes2(h))}`;
|
|
5340
|
+
function orderIdFromProof(expiryDate, header, stepHashes) {
|
|
5341
|
+
const tag = Array.from(new TextEncoder().encode("ZD/ORDER"), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
5342
|
+
return keccak(`0x${tag}${expiryDate.toString(16).padStart(16, "0")}${keccak(header).slice(2)}${stepHashes.map((h) => h.slice(2)).join("")}`);
|
|
5343
|
+
}
|
|
5344
|
+
var TX = /^0x[0-9a-fA-F]{64}$/;
|
|
5345
|
+
var succeeded = (receipt) => {
|
|
5346
|
+
const status = obj(receipt)?.status;
|
|
5347
|
+
return typeof status === "string" && /^0x0*1$/.test(status);
|
|
5348
|
+
};
|
|
5349
|
+
async function verifyZdHeavySourceOrder(rpc, chainId, hash, orderId) {
|
|
5350
|
+
const no = (reason) => ({ ok: false, reason });
|
|
5351
|
+
if (!SUPPORTED_CHAIN_IDS.has(chainId) || typeof hash !== "string" || !TX.test(hash) || !isZdHeavyOrderId(orderId)) return no("not checkable");
|
|
5352
|
+
try {
|
|
5353
|
+
const [tx, receipt] = await Promise.all([rpc(chainId, "eth_getTransactionByHash", [hash]), rpc(chainId, "eth_getTransactionReceipt", [hash])]);
|
|
5354
|
+
const t = obj(tx);
|
|
5355
|
+
if (!t || lower3(t.hash) !== lower3(hash)) return no("source transaction not found");
|
|
5356
|
+
if (!succeeded(receipt) || lower3(obj(receipt)?.transactionHash) !== lower3(hash)) return no("source transaction not confirmed");
|
|
5357
|
+
const router = checkZdHeavyRouter(chainId, typeof t.to === "string" ? t.to : "");
|
|
5358
|
+
if (!router.ok) return no("source transaction is not to a pinned router");
|
|
5359
|
+
const input = typeof t.input === "string" ? t.input : typeof t.data === "string" ? t.data : "";
|
|
5360
|
+
const { submission } = decodeZdHeavySubmit(input);
|
|
5361
|
+
const id = orderIdOf(submission.expiryDate, encodeOrderHeader(submission.serial, router.address, submission.ownerType, submission.owner), submission.steps);
|
|
5362
|
+
return lower3(id) === lower3(orderId) ? { ok: true } : no("source transaction submitted another order");
|
|
5363
|
+
} catch {
|
|
5364
|
+
return no("source transaction could not be read");
|
|
5365
|
+
}
|
|
5366
|
+
}
|
|
5367
|
+
var refuse2 = (what) => ({ ok: false, reason: `The ${what} does not match this order. Refusing to sign.` });
|
|
5368
|
+
function commonChecks(tx, owner, purpose, chainId) {
|
|
5369
|
+
if (!tx || tx.purpose !== purpose) return refuse2("transaction kind");
|
|
5370
|
+
const chain2 = typeof tx.chainId === "string" && /^\d{1,12}$/.test(tx.chainId) ? Number(tx.chainId) : NaN;
|
|
5371
|
+
if (!Number.isSafeInteger(chain2) || chain2 <= 0) return refuse2("chain");
|
|
5372
|
+
if (chainId !== void 0 && chain2 !== chainId) return refuse2("chain");
|
|
5373
|
+
const router = checkZdHeavyRouter(chain2, tx.to);
|
|
5374
|
+
if (!router.ok) return { ok: false, reason: router.reason };
|
|
5375
|
+
if (!addr(owner) || !addr(tx.from) || lower3(tx.from) !== lower3(owner)) return refuse2("sender");
|
|
5376
|
+
try {
|
|
5377
|
+
if (tx.value !== void 0 && tx.value !== "" && BigInt(tx.value) !== 0n) return refuse2("value");
|
|
5378
|
+
} catch {
|
|
5379
|
+
return refuse2("value");
|
|
5380
|
+
}
|
|
5381
|
+
return { ok: true, chainId: chain2, router: router.address };
|
|
5382
|
+
}
|
|
5383
|
+
var accepted = (chainId, owner, router, data) => ({
|
|
5384
|
+
ok: true,
|
|
5385
|
+
chainId,
|
|
5386
|
+
tx: { from: owner, to: router, data: data.toLowerCase(), value: "0x0" }
|
|
5387
|
+
});
|
|
5388
|
+
function checkZdHeavyCancelTx(tx, e) {
|
|
5389
|
+
const base = commonChecks(tx, e.owner, "cancel", e.chainId);
|
|
5390
|
+
if (!base.ok) return base;
|
|
5391
|
+
let decoded;
|
|
5392
|
+
try {
|
|
5393
|
+
decoded = decodeZdHeavyCancel(tx.data);
|
|
5394
|
+
} catch {
|
|
5395
|
+
return refuse2("call");
|
|
5396
|
+
}
|
|
5397
|
+
const { orderId, proof, keys } = decoded;
|
|
5398
|
+
if (!isZdHeavyOrderId(e.orderId) || lower3(orderId) !== lower3(e.orderId)) return refuse2("order id");
|
|
5399
|
+
if (keys.length > MAX_CANCEL_KEYS) return refuse2("lot keys");
|
|
5400
|
+
const listed = e.lotKeys ? new Set(
|
|
5401
|
+
e.lotKeys.map((k) => {
|
|
5402
|
+
try {
|
|
5403
|
+
return BigInt(k).toString();
|
|
5404
|
+
} catch {
|
|
5405
|
+
return "";
|
|
5406
|
+
}
|
|
5407
|
+
})
|
|
5408
|
+
) : void 0;
|
|
5409
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5410
|
+
for (const k of keys) {
|
|
5411
|
+
if (listed && !listed.has(k.toString())) return refuse2("lot keys");
|
|
5412
|
+
const step = k >> 160n;
|
|
5413
|
+
const tokenBits = k & (1n << 160n) - 1n;
|
|
5414
|
+
if (step >= BigInt(proof.stepHashes.length) || tokenBits === 0n || seen.has(k.toString())) return refuse2("lot keys");
|
|
5415
|
+
seen.add(k.toString());
|
|
5416
|
+
}
|
|
5417
|
+
if (proof.stepHashes.length < 1 || proof.stepHashes.length > 8) return refuse2("order proof");
|
|
5418
|
+
if (lower3(orderIdFromProof(proof.expiryDate, proof.orderHeader, proof.stepHashes)) !== lower3(orderId)) return refuse2("order proof");
|
|
5419
|
+
const h = proof.orderHeader;
|
|
5420
|
+
if (h.length !== 2 + ORDER_HEADER_LEN * 2) return refuse2("order proof");
|
|
5421
|
+
const routerWordHex = `0x${h.slice(2 + 11 * 2, 2 + 43 * 2)}`;
|
|
5422
|
+
const ownerType = Number.parseInt(h.slice(2 + 43 * 2, 2 + 44 * 2), 16);
|
|
5423
|
+
const ownerWordHex = `0x${h.slice(2 + 44 * 2)}`;
|
|
5424
|
+
if (lower3(routerWordHex) !== lower3(ownerWord(base.router))) return refuse2("router");
|
|
5425
|
+
if (ownerType !== 1 || lower3(ownerWordHex) !== lower3(ownerWord(e.owner))) return refuse2("owner");
|
|
5426
|
+
return accepted(base.chainId, e.owner, base.router, tx.data);
|
|
5427
|
+
}
|
|
5428
|
+
function checkZdHeavyClaimTx(tx, e) {
|
|
5429
|
+
const base = commonChecks(tx, e.owner, "claim", e.chainId);
|
|
5430
|
+
if (!base.ok) return base;
|
|
5431
|
+
let decoded;
|
|
5432
|
+
try {
|
|
5433
|
+
decoded = decodeZdHeavyClaim(tx.data);
|
|
5434
|
+
} catch {
|
|
5435
|
+
return refuse2("call");
|
|
5436
|
+
}
|
|
5437
|
+
if (!addr(e.token) || lower3(decoded.token) !== lower3(e.token)) return refuse2("token");
|
|
5438
|
+
if (decoded.to !== void 0 && lower3(decoded.to) !== lower3(e.owner)) return refuse2("recipient");
|
|
5439
|
+
return accepted(base.chainId, e.owner, base.router, tx.data);
|
|
5440
|
+
}
|
|
5441
|
+
|
|
5098
5442
|
// src/core/intent-schema.ts
|
|
5099
5443
|
var STABLEGENIE_INTENT_VERSION = 1;
|
|
5100
5444
|
var STABLEGENIE_INTENT_TTL_MS = 5 * 60 * 1e3;
|
|
@@ -5368,7 +5712,13 @@ function createVerifier(api, fetchImpl, rpcOverrides = {}) {
|
|
|
5368
5712
|
return void 0;
|
|
5369
5713
|
}
|
|
5370
5714
|
}
|
|
5371
|
-
|
|
5715
|
+
async function bundledRpc(chainId, method, params) {
|
|
5716
|
+
const override = rpcOverrides[Number(chainId)];
|
|
5717
|
+
const rpc = override && /^https?:\/\//i.test(override) ? override : BUNDLED_RPC[Number(chainId)];
|
|
5718
|
+
if (!rpc) throw new Error("No bundled RPC for this chain");
|
|
5719
|
+
return rpcCall(rpc, method, params);
|
|
5720
|
+
}
|
|
5721
|
+
return { payerNonceBaseline, verifySubmittedTx, readBalances, readNativeBalance, readZdHeavySubmitFee, bundledRpc };
|
|
5372
5722
|
}
|
|
5373
5723
|
|
|
5374
5724
|
// src/core/config.ts
|
|
@@ -5528,6 +5878,10 @@ function createEngine(config = {}) {
|
|
|
5528
5878
|
executeSolanaPlanStaged: (input) => executeSolanaPlanStaged({ ...input, rpc: input.rpc ?? solanaRpc }),
|
|
5529
5879
|
previewSolanaSource: (input) => previewSolanaSource(api, input),
|
|
5530
5880
|
trackDelivery: (hash) => fetchDelivery(api, hash),
|
|
5881
|
+
fetchZdHeavyCancellation: (orderId) => fetchZdHeavyCancellation(api, orderId),
|
|
5882
|
+
buildZdHeavyCancelTx: (orderId, chainId) => buildZdHeavyCancelTx(api, orderId, chainId),
|
|
5883
|
+
buildZdHeavyClaimTx: (orderId, chainId, tokenAddress) => buildZdHeavyClaimTx(api, orderId, chainId, tokenAddress),
|
|
5884
|
+
verifyZdHeavySourceOrder: (chainId, hash, orderId) => verifyZdHeavySourceOrder(verifier.bundledRpc, chainId, hash, orderId),
|
|
5531
5885
|
fetchWalletHistory: (wallets) => fetchWalletHistory(api, wallets),
|
|
5532
5886
|
readSolanaBalance: (owner, mint) => readSolanaBalance(solanaRpc, owner, mint),
|
|
5533
5887
|
simulateSolanaCost: (plan) => simulateSolanaCost(solanaRpc, plan),
|
|
@@ -5547,4 +5901,4 @@ function createEngine(config = {}) {
|
|
|
5547
5901
|
};
|
|
5548
5902
|
}
|
|
5549
5903
|
|
|
5550
|
-
export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BUNDLED_SOLANA_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CANONICAL_SOLANA_PROGRAM, CENTIBIPS_PER_UNIT, CHAIN_DISPLAY_NAMES, COMPLIANCE_CHECK_ORDER, COMPLIANCE_DENY_LABEL, DEFAULT_WIDGET_API_BASE, DIRECT_CHECK_IDS, DIRECT_SCOPE_NOTE, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, FLOOR_CATEGORIES, LZ_FEE_BUFFER_BPS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_QUOTE_CARDS, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, PREVIEW_OWNER, QUOTE_BUFFER_BPS, SAME_CLASS_STABLE, SCREENING_BUCKETS, 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, SolanaSendError, TOKEN_2022_PROGRAM, TOKEN_PROGRAM, TRACKING, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, WAIT_MAX_SEC, WAIT_MIN_SEC, WAIT_POSITIONS, WAIT_STEP_SEC, WALLET_HISTORY_LIMIT, ZD_HEAVY_KEY_PREFIX, ZERO_ADDRESS, ZdHeavyQuoteExpiredError, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, askCovers, askTokenDecimals, assertAddress, assertChainAddress, assertQuoteMatchesSelection, assertWalletMessage, assertZdHeavyQuoteFresh, assetClassOf, assetDecimals, associatedTokenAddress, base58Decode, base58Encode, base64Decode, base64Encode, bestOutputOption, blockLabelFor, bonusFigure, bonusPercentLabel, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSolanaSourcePlan, buildSwapPlan, bytes32Word, bytesEqual, bytesPayload, canAttachApiKey, categoryLabel, chainAddressKey, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, checkSolanaPlan, checkSolanaProgram, checkSolanaReceiver, checkSolanaRouteBuffer, clampWait, classifyQuoteError, compareAmount, compareDuration, compareFeeUsd, compareHops, compareOptionOf, compareOptionsOf, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, cornerTags, cosignSolanaEvent, counterpartTokens, createApiClient, createEngine, createSolanaRpc, createVerifier, decodeSolanaSubmitOrder, decodeSubmitOrderCalldata, deriveSolanaEvent, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeNextSolanaOrders, encodeSubmitOrder, encodeTransfer, estimateBonus, exceedsLaneLimit, executableRoutes, executeSolanaPlan, executeSolanaPlanStaged, executionChainIds, expectedSolanaDelivery, extraVsFastest, fastestOption, fetchDelivery, fetchPaymentPlan, fetchWalletHistory, finalOf, findProgramAddress, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, fundedByLabel, hasReachableDestination, hasValidChecksum, hexBytes, hexToSolanaKey, historyEntryFromOrder, historyKey, hubDeliverableSymbols, humanizeComplianceReason, insteadFigures, isAddress, isChainAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isOnEd25519Curve, isPreparationInstruction, isSellableRwa, isSolanaAddress, isSolanaChainId, isSourceToken, isSubmitOrder, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, mergeHistory, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeDecimalText, normalizeDelivery, normalizeOrderRequest, normalizeOrderRequests, overwriteBlockhash, pairPromotionsInto, parity, parseAddressLookupTable, parseAllowedApiBase, parsePromotion, parsePromotions, parseSolanaTransaction, parseUnitsDecimal, pickForWait, placeSignature, planErrorSummary, planMsgValueHex, pollSolanaConfirmation, preflightZdHeavyPlan, previewSolanaSource, priceCompareOptions, productAssets, promotedAssets, promotionFor, proposedWait, quotePartnerId, quotePayOption, quoteSolanaSource, quoteSwapPreview, readSolanaBalance, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSolanaKeys, resolveSwapReceiver, resolveVaultIcon, resultForOption, routeBadges, routeNativeValue, routeShapeLabel, safeTicker, sameAddress, scaleDecimals, screeningOutcomeOf, selectableOptions, serializeSolanaTransaction, sha256, simulateSolanaCost, snapWait, solanaBridgeOf, solanaDestinationAsset, solanaKeyBytes, solanaKeyHex, solanaLamportShortfall, solanaPlanNeedsPreparation, solanaQuoteCompliance, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, usdStablePair, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, verifySolanaSubmit, verifySolanaTransaction, visibleOptions, waitFraction, waitFromFraction, waitLabel, waitScaleFor, withVaultArtwork, zdHeavyExpected, zdHeavyOptionKey, zdHeavyUnavailableStatus };
|
|
5904
|
+
export { API_CACHE_TTL_MS, BLOCK_LABEL_DEFAULT, BUNDLED_NATIVE_SYMBOL, BUNDLED_RPC, BUNDLED_SOLANA_RPC, CANONICAL_DECIMALS, CANONICAL_ESCROW, CANONICAL_INBOUND_BRIDGE, CANONICAL_SOLANA_PROGRAM, CENTIBIPS_PER_UNIT, CHAIN_DISPLAY_NAMES, COMPLIANCE_CHECK_ORDER, COMPLIANCE_DENY_LABEL, DEFAULT_WIDGET_API_BASE, DIRECT_CHECK_IDS, DIRECT_SCOPE_NOTE, ERC20_ALLOWANCE_SELECTOR, ERC20_APPROVE_SELECTOR, ERC20_BALANCEOF_SELECTOR, ERC20_TRANSFER_SELECTOR, EXECUTABLE_STABLE_ASSETS, FLOOR_CATEGORIES, LZ_FEE_BUFFER_BPS, MAX_CANCEL_KEYS, MAX_LZ_MSG_VALUE_WEI, MAX_LZ_MSG_VALUE_WEI_BY_CHAIN, MAX_QUOTE_CANDIDATES, MAX_QUOTE_CARDS, MAX_SAME_CLASS_PAY_BPS, MAX_UINT64, NO_PARTNER_ID, PREVIEW_OWNER, QUOTE_BUFFER_BPS, SAME_CLASS_STABLE, SCREENING_BUCKETS, 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, SolanaSendError, TOKEN_2022_PROGRAM, TOKEN_PROGRAM, TRACKING, TRADEABLE_RWA_ASSETS, TUNABLE_CATEGORIES, WAIT_MAX_SEC, WAIT_MIN_SEC, WAIT_POSITIONS, WAIT_STEP_SEC, WALLET_HISTORY_LIMIT, ZDHEAVY_CANCEL_SELECTOR, ZDHEAVY_CLAIM_SELECTOR, ZDHEAVY_CLAIM_TO_SELECTOR, ZD_HEAVY_KEY_PREFIX, ZERO_ADDRESS, ZdHeavyQuoteExpiredError, addressWord, allowanceCovers, amountFieldError, apiError, applyLayerZeroBuffer, askCovers, askTokenDecimals, assertAddress, assertChainAddress, assertQuoteMatchesSelection, assertWalletMessage, assertZdHeavyQuoteFresh, assetClassOf, assetDecimals, associatedTokenAddress, base58Decode, base58Encode, base64Decode, base64Encode, bestOutputOption, blockLabelFor, bonusFigure, bonusPercentLabel, brokenLaneFor, brokenLaneReason, buildCatalogue, buildPayOptions, buildRoute, buildSolanaSourcePlan, buildSwapPlan, buildZdHeavyCancelTx, buildZdHeavyClaimTx, bytes32Word, bytesEqual, bytesPayload, canAttachApiKey, categoryLabel, chainAddressKey, chainById, chainNameOf, chainSelectable, checkEscrow, checkNativeFee, checkSolanaPlan, checkSolanaProgram, checkSolanaReceiver, checkSolanaRouteBuffer, checkZdHeavyCancelTx, checkZdHeavyClaimTx, clampWait, classifyQuoteError, compareAmount, compareDuration, compareFeeUsd, compareHops, compareOptionOf, compareOptionsOf, complianceChecks, complianceControlsEvaluated, complianceControlsLine, complianceReasonHead, complianceReasonTag, complianceTagOf, complianceView, cornerTags, cosignSolanaEvent, counterpartTokens, createApiClient, createEngine, createSolanaRpc, createVerifier, decodeSolanaSubmitOrder, decodeSubmitOrderCalldata, decodeZdHeavyCancel, decodeZdHeavyClaim, deriveSolanaEvent, destinationAvailability, destinationKeys, directComplianceFromScreens, distinctScreenedWallets, encodeAllowance, encodeApprove, encodeBalanceOf, encodeNextSolanaOrders, encodeSubmitOrder, encodeTransfer, estimateBonus, exceedsLaneLimit, executableRoutes, executeSolanaPlan, executeSolanaPlanStaged, executionChainIds, expectedSolanaDelivery, extraVsFastest, fastestOption, fetchDelivery, fetchPaymentPlan, fetchWalletHistory, fetchZdHeavyCancellation, finalOf, findProgramAddress, findToken, foldTicker, formatJurisdiction, formatNative, formatUnits, fundedByLabel, hasReachableDestination, hasValidChecksum, hexBytes, hexToSolanaKey, historyEntryFromOrder, historyKey, hubDeliverableSymbols, humanizeComplianceReason, insteadFigures, isAddress, isChainAddress, isDeliverable, isExecutableBridge, isHexAddress, isHexData, isHexQuantity, isKnownUnbridgeable, isLayerZeroRoute, isOnEd25519Curve, isPreparationInstruction, isSellableRwa, isSolanaAddress, isSolanaChainId, isSourceToken, isSubmitOrder, isZdHeavyOrderId, laneAvailabilityState, laneKey, laneKeys, laneLimitAmount, laneLimitError, laneLimitFor, laneLimitHint, laneLimitSymbol, limitedLanes, maxDeadlineSeconds, maxNativeFeeWei, mergeHistory, nativeFeeShortLabel, nativeFeeShortMessage, nativeSymbol, normalizeAddress, normalizeCancellationPlan, normalizeDecimalText, normalizeDelivery, normalizeOrderRequest, normalizeOrderRequests, orderIdFromProof, overwriteBlockhash, pairPromotionsInto, parity, parseAddressLookupTable, parseAllowedApiBase, parsePromotion, parsePromotions, parseSolanaTransaction, parseUnitsDecimal, pickForWait, placeSignature, planErrorSummary, planMsgValueHex, pollSolanaConfirmation, preflightZdHeavyPlan, previewSolanaSource, priceCompareOptions, productAssets, promotedAssets, promotionFor, proposedWait, quotePartnerId, quotePayOption, quoteSolanaSource, quoteSwapPreview, readSolanaBalance, recommendedDeadlineSeconds, registryRpc, requiresNativeBridgeFee, resolveApiBase, resolveConfig, resolveSolanaKeys, resolveSwapReceiver, resolveVaultIcon, resultForOption, routeBadges, routeNativeValue, routeShapeLabel, safeTicker, sameAddress, scaleDecimals, screeningOutcomeOf, selectableOptions, serializeSolanaTransaction, sha256, simulateSolanaCost, snapWait, solanaBridgeOf, solanaDestinationAsset, solanaKeyBytes, solanaKeyHex, solanaLamportShortfall, solanaPlanNeedsPreparation, solanaQuoteCompliance, solveExactIn, solveExactOut, sourceKeys, stableGenieIntentSchema, strip0x, suppressedLanes, symbolKey, tickerOn, toHexQuantity, tokenEnabled, tokenKey, tokenTicker, txMatchesPlan, uint64Word, uintWord, unattributedComplianceReasons, usdStablePair, validateDestination, validatePlannedTransaction, validateSwap, vaultIconsBySymbol, verifySolanaSubmit, verifySolanaTransaction, verifyZdHeavySourceOrder, visibleOptions, waitFraction, waitFromFraction, waitLabel, waitScaleFor, withVaultArtwork, zdHeavyExpected, zdHeavyOptionKey, zdHeavyRecovery, zdHeavyUnavailableStatus };
|