@edgex-web/components 0.1.0-beta.4 → 0.1.0-beta.40
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/ccip-D_dNilAU.mjs +150 -0
- package/dist/ccip-D_dNilAU.mjs.map +1 -0
- package/dist/components/Deposit/index.d.ts +1 -10
- package/dist/components/Deposit/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/DepositManager.d.ts +2 -0
- package/dist/components/Deposit/src/DepositManager.d.ts.map +1 -1
- package/dist/components/Deposit/src/components/evm/hooks/index.d.ts +3 -0
- package/dist/components/Deposit/src/components/evm/hooks/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/hooks/useApprove.d.ts +4 -0
- package/dist/components/Deposit/src/components/evm/hooks/useApprove.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/hooks/useDepositButtonState.d.ts +14 -0
- package/dist/components/Deposit/src/components/evm/hooks/useDepositButtonState.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/index.d.ts +6 -0
- package/dist/components/Deposit/src/components/evm/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/types/approve.d.ts +15 -0
- package/dist/components/Deposit/src/components/evm/types/approve.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/types/index.d.ts +15 -0
- package/dist/components/Deposit/src/components/evm/types/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/utils/format.d.ts +12 -0
- package/dist/components/Deposit/src/components/evm/utils/format.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/evm/utils/index.d.ts +8 -0
- package/dist/components/Deposit/src/components/evm/utils/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/mpc/index.d.ts +6 -0
- package/dist/components/Deposit/src/components/mpc/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/components/mpc/types/index.d.ts +16 -0
- package/dist/components/Deposit/src/components/mpc/types/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/constants/index.d.ts +4 -0
- package/dist/components/Deposit/src/constants/index.d.ts.map +1 -0
- package/dist/components/Deposit/src/hooks/useErc20BalanceOfWatcher.d.ts +14 -0
- package/dist/components/Deposit/src/hooks/useErc20BalanceOfWatcher.d.ts.map +1 -0
- package/dist/components/Deposit/src/hooks/useMulticallBalance.d.ts +68 -0
- package/dist/components/Deposit/src/hooks/useMulticallBalance.d.ts.map +1 -0
- package/dist/components/Deposit/src/index.d.ts +2 -2
- package/dist/components/Deposit/src/index.d.ts.map +1 -1
- package/dist/components/Deposit/src/utils.d.ts +57 -36
- package/dist/components/Deposit/src/utils.d.ts.map +1 -1
- package/dist/components/Deposit/types/index.d.ts +32 -34
- package/dist/components/Deposit/types/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +19 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/LoadingSpinner/index.d.ts +4 -0
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -0
- package/dist/components/Provider/index.d.ts +6 -1
- package/dist/components/Provider/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.d.ts +6 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/src/Tab.d.ts +5 -0
- package/dist/components/Tabs/src/Tab.d.ts.map +1 -0
- package/dist/components/Tabs/src/Tabs.d.ts +5 -0
- package/dist/components/Tabs/src/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/src/TabsList.d.ts +5 -0
- package/dist/components/Tabs/src/TabsList.d.ts.map +1 -0
- package/dist/components/Tabs/src/TabsPanel.d.ts +5 -0
- package/dist/components/Tabs/src/TabsPanel.d.ts.map +1 -0
- package/dist/components/Tabs/src/context.d.ts +16 -0
- package/dist/components/Tabs/src/context.d.ts.map +1 -0
- package/dist/components/Tabs/src/index.d.ts +6 -0
- package/dist/components/Tabs/src/index.d.ts.map +1 -0
- package/dist/components/Tabs/types/index.d.ts +28 -0
- package/dist/components/Tabs/types/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/src/Tooltip.d.ts +5 -0
- package/dist/components/Tooltip/src/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/src/TooltipArrow.d.ts +5 -0
- package/dist/components/Tooltip/src/TooltipArrow.d.ts.map +1 -0
- package/dist/components/Tooltip/src/index.d.ts +3 -0
- package/dist/components/Tooltip/src/index.d.ts.map +1 -0
- package/dist/components/Tooltip/types/index.d.ts +52 -0
- package/dist/components/Tooltip/types/index.d.ts.map +1 -0
- package/dist/components/Withdraw/constants/index.d.ts +7 -0
- package/dist/components/Withdraw/constants/index.d.ts.map +1 -0
- package/dist/components/Withdraw/index.d.ts +6 -10
- package/dist/components/Withdraw/index.d.ts.map +1 -1
- package/dist/components/Withdraw/src/Speed.d.ts +10 -0
- package/dist/components/Withdraw/src/Speed.d.ts.map +1 -0
- package/dist/components/Withdraw/src/WithdrawManager.d.ts +12 -0
- package/dist/components/Withdraw/src/WithdrawManager.d.ts.map +1 -0
- package/dist/components/Withdraw/src/constants.d.ts +24 -0
- package/dist/components/Withdraw/src/constants.d.ts.map +1 -0
- package/dist/components/Withdraw/src/evm/WalletView.d.ts +22 -0
- package/dist/components/Withdraw/src/evm/WalletView.d.ts.map +1 -0
- package/dist/components/Withdraw/src/evm/index.d.ts +35 -0
- package/dist/components/Withdraw/src/evm/index.d.ts.map +1 -0
- package/dist/components/Withdraw/src/index.d.ts +5 -0
- package/dist/components/Withdraw/src/index.d.ts.map +1 -0
- package/dist/components/Withdraw/types/index.d.ts +74 -0
- package/dist/components/Withdraw/types/index.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/ActiveSpeed.d.ts +5 -0
- package/dist/components/shared/components/SpeedLevel/ActiveSpeed.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/InactiveSpeed.d.ts +5 -0
- package/dist/components/shared/components/SpeedLevel/InactiveSpeed.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/index.d.ts +6 -0
- package/dist/components/shared/components/SpeedLevel/index.d.ts.map +1 -0
- package/dist/components/shared/components/SpeedLevel/types/index.d.ts +6 -0
- package/dist/components/shared/components/SpeedLevel/types/index.d.ts.map +1 -0
- package/dist/components/shared/components/selector/AssetTabs.d.ts +5 -0
- package/dist/components/shared/components/selector/AssetTabs.d.ts.map +1 -0
- package/dist/components/shared/components/selector/Chain.d.ts +5 -0
- package/dist/components/shared/components/selector/Chain.d.ts.map +1 -0
- package/dist/components/shared/components/selector/index.d.ts +5 -0
- package/dist/components/shared/components/selector/index.d.ts.map +1 -0
- package/dist/components/shared/components/selector/types/index.d.ts +36 -0
- package/dist/components/shared/components/selector/types/index.d.ts.map +1 -0
- package/dist/components/shared/constants/index.d.ts +3 -0
- package/dist/components/shared/constants/index.d.ts.map +1 -0
- package/dist/components/shared/hooks/index.d.ts +1 -0
- package/dist/components/shared/hooks/index.d.ts.map +1 -0
- package/dist/components/shared/types/index.d.ts +10 -0
- package/dist/components/shared/types/index.d.ts.map +1 -0
- package/dist/components/shared/utils/index.d.ts +23 -0
- package/dist/components/shared/utils/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useTranslation.d.ts +137 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/index-L-UDN_SB.mjs +19973 -0
- package/dist/index-L-UDN_SB.mjs.map +1 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +30 -7001
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +86 -57
- package/dist/index.umd.js.map +1 -1
- package/dist/locales/en-US.d.ts +51 -0
- package/dist/locales/en-US.d.ts.map +1 -0
- package/dist/locales/index.d.ts +16 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/ja-JP.d.ts +51 -0
- package/dist/locales/ja-JP.d.ts.map +1 -0
- package/dist/locales/ru-RU.d.ts +51 -0
- package/dist/locales/ru-RU.d.ts.map +1 -0
- package/dist/locales/zh-CN.d.ts +52 -0
- package/dist/locales/zh-CN.d.ts.map +1 -0
- package/dist/locales/zh-TW.d.ts +51 -0
- package/dist/locales/zh-TW.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +10 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +14 -5
- package/dist/components/Deposit/src/Deposit.d.ts +0 -15
- package/dist/components/Deposit/src/Deposit.d.ts.map +0 -1
- package/dist/components/Deposit/src/WalletProvider.d.ts +0 -23
- package/dist/components/Deposit/src/WalletProvider.d.ts.map +0 -1
- package/dist/components/Deposit/src/components.d.ts +0 -89
- package/dist/components/Deposit/src/components.d.ts.map +0 -1
- package/dist/components/Deposit/src/evm/WalletView.d.ts +0 -17
- package/dist/components/Deposit/src/evm/WalletView.d.ts.map +0 -1
- package/dist/components/Deposit/src/evm/index.d.ts +0 -18
- package/dist/components/Deposit/src/evm/index.d.ts.map +0 -1
- package/dist/components/Deposit/src/mpc/WalletView.d.ts +0 -12
- package/dist/components/Deposit/src/mpc/WalletView.d.ts.map +0 -1
- package/dist/components/Deposit/src/mpc/index.d.ts +0 -18
- package/dist/components/Deposit/src/mpc/index.d.ts.map +0 -1
- package/dist/components/Deposit/src/selector/Asset.d.ts +0 -19
- package/dist/components/Deposit/src/selector/Asset.d.ts.map +0 -1
- package/dist/components/Deposit/src/selector/Chain.d.ts +0 -20
- package/dist/components/Deposit/src/selector/Chain.d.ts.map +0 -1
- package/dist/components/Deposit/src/selector/index.d.ts +0 -13
- package/dist/components/Deposit/src/selector/index.d.ts.map +0 -1
- package/dist/components/Deposit/src/walletAdapters.d.ts +0 -67
- package/dist/components/Deposit/src/walletAdapters.d.ts.map +0 -1
- package/dist/components/Deposit/types/wallet-hooks.d.ts +0 -78
- package/dist/components/Deposit/types/wallet-hooks.d.ts.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-L-UDN_SB.mjs";
|
|
2
|
+
class S extends p {
|
|
3
|
+
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
4
|
+
var o;
|
|
5
|
+
super(a.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
6
|
+
cause: a,
|
|
7
|
+
metaMessages: [
|
|
8
|
+
...a.metaMessages || [],
|
|
9
|
+
(o = a.metaMessages) != null && o.length ? "" : [],
|
|
10
|
+
"Offchain Gateway Call:",
|
|
11
|
+
t && [
|
|
12
|
+
" Gateway URL(s):",
|
|
13
|
+
...t.map((d) => ` ${m(d)}`)
|
|
14
|
+
],
|
|
15
|
+
` Sender: ${f}`,
|
|
16
|
+
` Data: ${n}`,
|
|
17
|
+
` Callback selector: ${r}`,
|
|
18
|
+
` Extra data: ${i}`
|
|
19
|
+
].flat(),
|
|
20
|
+
name: "OffchainLookupError"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class $ extends p {
|
|
25
|
+
constructor({ result: r, url: a }) {
|
|
26
|
+
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
27
|
+
metaMessages: [
|
|
28
|
+
`Gateway URL: ${m(a)}`,
|
|
29
|
+
`Response: ${w(r)}`
|
|
30
|
+
],
|
|
31
|
+
name: "OffchainLookupResponseMalformedError"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class q extends p {
|
|
36
|
+
constructor({ sender: r, to: a }) {
|
|
37
|
+
super("Reverted sender address does not match target contract address (`to`).", {
|
|
38
|
+
metaMessages: [
|
|
39
|
+
`Contract address: ${a}`,
|
|
40
|
+
`OffchainLookup sender address: ${r}`
|
|
41
|
+
],
|
|
42
|
+
name: "OffchainLookupSenderMismatchError"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const A = "0x556f1830", T = {
|
|
47
|
+
name: "OffchainLookup",
|
|
48
|
+
type: "error",
|
|
49
|
+
inputs: [
|
|
50
|
+
{
|
|
51
|
+
name: "sender",
|
|
52
|
+
type: "address"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "urls",
|
|
56
|
+
type: "string[]"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "callData",
|
|
60
|
+
type: "bytes"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "callbackFunction",
|
|
64
|
+
type: "bytes4"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "extraData",
|
|
68
|
+
type: "bytes"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
async function D(c, { blockNumber: r, blockTag: a, data: n, to: i }) {
|
|
73
|
+
const { args: f } = k({
|
|
74
|
+
data: n,
|
|
75
|
+
abi: [T]
|
|
76
|
+
}), [t, o, d, l, s] = f, { ccipRead: e } = c, h = e && typeof (e == null ? void 0 : e.request) == "function" ? e.request : C;
|
|
77
|
+
try {
|
|
78
|
+
if (!b(i, t))
|
|
79
|
+
throw new q({ sender: t, to: i });
|
|
80
|
+
const u = o.includes(L) ? await O({
|
|
81
|
+
data: d,
|
|
82
|
+
ccipRequest: h
|
|
83
|
+
}) : await h({ data: d, sender: t, urls: o }), { data: g } = await E(c, {
|
|
84
|
+
blockNumber: r,
|
|
85
|
+
blockTag: a,
|
|
86
|
+
data: x([
|
|
87
|
+
l,
|
|
88
|
+
R([{ type: "bytes" }, { type: "bytes" }], [u, s])
|
|
89
|
+
]),
|
|
90
|
+
to: i
|
|
91
|
+
});
|
|
92
|
+
return g;
|
|
93
|
+
} catch (u) {
|
|
94
|
+
throw new S({
|
|
95
|
+
callbackSelector: l,
|
|
96
|
+
cause: u,
|
|
97
|
+
data: n,
|
|
98
|
+
extraData: s,
|
|
99
|
+
sender: t,
|
|
100
|
+
urls: o
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function C({ data: c, sender: r, urls: a }) {
|
|
105
|
+
var i;
|
|
106
|
+
let n = new Error("An unknown error occurred.");
|
|
107
|
+
for (let f = 0; f < a.length; f++) {
|
|
108
|
+
const t = a[f], o = t.includes("{data}") ? "GET" : "POST", d = o === "POST" ? { data: c, sender: r } : void 0, l = o === "POST" ? { "Content-Type": "application/json" } : {};
|
|
109
|
+
try {
|
|
110
|
+
const s = await fetch(t.replace("{sender}", r.toLowerCase()).replace("{data}", c), {
|
|
111
|
+
body: JSON.stringify(d),
|
|
112
|
+
headers: l,
|
|
113
|
+
method: o
|
|
114
|
+
});
|
|
115
|
+
let e;
|
|
116
|
+
if ((i = s.headers.get("Content-Type")) != null && i.startsWith("application/json") ? e = (await s.json()).data : e = await s.text(), !s.ok) {
|
|
117
|
+
n = new y({
|
|
118
|
+
body: d,
|
|
119
|
+
details: e != null && e.error ? w(e.error) : s.statusText,
|
|
120
|
+
headers: s.headers,
|
|
121
|
+
status: s.status,
|
|
122
|
+
url: t
|
|
123
|
+
});
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (!M(e)) {
|
|
127
|
+
n = new $({
|
|
128
|
+
result: e,
|
|
129
|
+
url: t
|
|
130
|
+
});
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
return e;
|
|
134
|
+
} catch (s) {
|
|
135
|
+
n = new y({
|
|
136
|
+
body: d,
|
|
137
|
+
details: s.message,
|
|
138
|
+
url: t
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
throw n;
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
C as ccipRequest,
|
|
146
|
+
D as offchainLookup,
|
|
147
|
+
T as offchainLookupAbiItem,
|
|
148
|
+
A as offchainLookupSignature
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=ccip-D_dNilAU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ccip-D_dNilAU.mjs","sources":["../node_modules/viem/_esm/errors/ccip.js","../node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n name: 'OffchainLookupError',\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n name: 'OffchainLookupResponseMalformedError',\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n name: 'OffchainLookupSenderMismatchError',\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { localBatchGatewayRequest, localBatchGatewayUrl, } from './ens/localBatchGatewayRequest.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({\n data: callData,\n ccipRequest: ccipRequest_,\n })\n : await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n const headers = method === 'POST' ? { 'Content-Type': 'application/json' } : {};\n try {\n const response = await fetch(url.replace('{sender}', sender.toLowerCase()).replace('{data}', data), {\n body: JSON.stringify(body),\n headers,\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","localBatchGatewayUrl","localBatchGatewayRequest","data_","call","concat","encodeAbiParameters","err","error","i","method","body","headers","response","HttpRequestError","isHex"],"mappings":"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","x_google_ignoreList":[0,1]}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
export { Deposit } from './src/index';
|
|
2
|
-
export {
|
|
3
|
-
export { DepositManager, openDeposit, closeDeposit, useDeposit, } from './src/DepositManager';
|
|
4
|
-
export { WalletProvider, useWalletHooks, useWalletAccount, useWalletBalance, useWalletConnect, useWalletWriteContract, useWalletSwitchChain, useWalletWaitForTransaction, useWalletReadContract, } from './src/WalletProvider';
|
|
5
|
-
export { Selector as ChainTokenSelector } from './src/selector';
|
|
6
|
-
export { MPCWalletView } from './src/mpc/WalletView';
|
|
7
|
-
export { EVMWalletView } from './src/evm/WalletView';
|
|
8
|
-
export { createWalletAdapter } from './src/walletAdapters';
|
|
9
|
-
export { QRCodeSVG, CopyToClipboard, Icon, Tooltip, twMerge, } from './src/components';
|
|
2
|
+
export { DepositManager, openDeposit, closeDeposit, useDeposit, updateDepositOptions, setDepositLoading, isDepositLoading, } from './src/DepositManager';
|
|
10
3
|
export type { DepositProps, OpenDepositOptions, DepositAPI } from './types';
|
|
11
|
-
export type { WalletHooks, AccountInfo, BalanceInfo, WriteContractConfig, WriteContractResult, TransactionWaitResult, ConnectWalletResult, SwitchChainResult, } from './types/wallet-hooks';
|
|
12
|
-
export { createMockWalletHooks, createWagmiAdapter } from './types/wallet-hooks';
|
|
13
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Deposit/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Deposit/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGrC,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAA;AAG7B,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -5,6 +5,8 @@ export declare const DepositManager: React.ForwardRefExoticComponent<React.RefAt
|
|
|
5
5
|
export declare const openDeposit: (options?: OpenDepositOptions) => void;
|
|
6
6
|
export declare const closeDeposit: () => void;
|
|
7
7
|
export declare const updateDepositOptions: (options: Partial<OpenDepositOptions>) => void;
|
|
8
|
+
export declare const setDepositLoading: (loading: boolean) => void;
|
|
8
9
|
export declare const isDepositOpen: () => boolean;
|
|
10
|
+
export declare const isDepositLoading: () => boolean;
|
|
9
11
|
export declare const useDeposit: () => DepositAPI;
|
|
10
12
|
//# sourceMappingURL=DepositManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepositManager.d.ts","sourceRoot":"","sources":["../../../../src/components/Deposit/src/DepositManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAA;AAEzE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"DepositManager.d.ts","sourceRoot":"","sources":["../../../../src/components/Deposit/src/DepositManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAA;AAEzE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAOzD,eAAO,MAAM,cAAc,kEAmGzB,CAAA;AAKF,eAAO,MAAM,WAAW,GAAI,UAAU,kBAAkB,SAQvD,CAAA;AAED,eAAO,MAAM,YAAY,YAQxB,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,CAAC,kBAAkB,CAAC,SAKxE,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,SAQjD,CAAA;AAED,eAAO,MAAM,aAAa,eAKzB,CAAA;AAED,eAAO,MAAM,gBAAgB,eAK5B,CAAA;AAGD,eAAO,MAAM,UAAU,QAAO,UAS7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/hooks/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApprove.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/hooks/useApprove.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE7D,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAiHrE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const useDepositButtonState: (params: {
|
|
2
|
+
isNetworkMismatch: boolean;
|
|
3
|
+
depositAmount: string;
|
|
4
|
+
approved: boolean;
|
|
5
|
+
currentTokenBalance: string;
|
|
6
|
+
selectedToken: string;
|
|
7
|
+
showLayerZeroTip: boolean;
|
|
8
|
+
minDeposit?: number;
|
|
9
|
+
}) => {
|
|
10
|
+
text: string;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
isNetworkSwitch: boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useDepositButtonState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDepositButtonState.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/hooks/useDepositButtonState.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,GAAI,QAAQ;IAC5C,iBAAiB,EAAE,OAAO,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,KAAG;IACF,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,eAAe,EAAE,OAAO,CAAA;CAmEzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Deposit/src/components/evm/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAA6C,EAAE,EAAE,MAAM,OAAO,CAAA;AAUrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAwB7C,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,mBAAmB,CA2bhC,CAAA;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TokenInfo } from '../../../../../../types';
|
|
2
|
+
|
|
3
|
+
export interface UseApproveParams {
|
|
4
|
+
account?: string;
|
|
5
|
+
accountChainId?: number;
|
|
6
|
+
targetChainId?: number;
|
|
7
|
+
tokenInfo?: Pick<TokenInfo, 'tokenAddress' | 'decimals' | 'contractAddress'>;
|
|
8
|
+
amount?: string;
|
|
9
|
+
wagmiHooks: any;
|
|
10
|
+
}
|
|
11
|
+
export interface UseApproveResult {
|
|
12
|
+
approve: boolean;
|
|
13
|
+
onApprove: () => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=approve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approve.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/types/approve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,UAAU,GAAG,iBAAiB,CAAC,CAAA;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,GAAG,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChainInfo } from '../../../../../../types';
|
|
2
|
+
|
|
3
|
+
export interface EVMDepositViewProps {
|
|
4
|
+
address: string;
|
|
5
|
+
currentActiveChain: ChainInfo;
|
|
6
|
+
selectedToken: string;
|
|
7
|
+
platformBalance: string;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
wagmiHooks: any;
|
|
10
|
+
onChainChange: any;
|
|
11
|
+
onDeposit: any;
|
|
12
|
+
onClose?: any;
|
|
13
|
+
}
|
|
14
|
+
export * from './approve';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB,EAAE,SAAS,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,GAAG,CAAA;IACf,aAAa,EAAE,GAAG,CAAA;IAClB,SAAS,EAAE,GAAG,CAAA;IACd,OAAO,CAAC,EAAE,GAAG,CAAA;CACd;AAED,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a user-friendly balance preview string/element.
|
|
3
|
+
* When user has input an amount (> 0), show a "balance → remaining" indicator.
|
|
4
|
+
* Otherwise show the full balance with token symbol.
|
|
5
|
+
*
|
|
6
|
+
* @param currentTokenBalance Current wallet balance for the token (string|number)
|
|
7
|
+
* @param depositAmount The user-entered deposit amount (string|number)
|
|
8
|
+
* @param selectedToken Token symbol to display (e.g., 'USDT')
|
|
9
|
+
* @returns JSX element or string representing formatted balance preview
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatBalanceDisplay: (currentTokenBalance: string | number, depositAmount: string | number, selectedToken: string) => string | import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/utils/format.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAC/B,qBAAqB,MAAM,GAAG,MAAM,EACpC,eAAe,MAAM,GAAG,MAAM,EAC9B,eAAe,MAAM,qDAuBtB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 检查是否可以提交(确认按钮是否可点击)
|
|
3
|
+
*/
|
|
4
|
+
export declare const canSubmitAmount: (amount: string, maxBalance: string, approved: boolean) => boolean;
|
|
5
|
+
export declare const shouldShowLargeDepositWarning: (chainId: number, depositAmount: string, selectedToken: string) => boolean;
|
|
6
|
+
export declare const getEffectiveMaxAmountPure: (chainId: number, currentTokenBalance: string, selectedToken: string) => string;
|
|
7
|
+
export * from './format';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/evm/utils/index.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,UAAU,OAAO,KAChB,OAmBF,CAAA;AAED,eAAO,MAAM,6BAA6B,GACxC,SAAS,MAAM,EACf,eAAe,MAAM,EACrB,eAAe,MAAM,YAqBtB,CAAA;AAED,eAAO,MAAM,yBAAyB,GACpC,SAAS,MAAM,EACf,qBAAqB,MAAM,EAC3B,eAAe,MAAM,WAqBtB,CAAA;AAED,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Deposit/src/components/mpc/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAA;AAYnC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,eAAe,CAwK5B,CAAA;AAED,eAAe,GAAG,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChainInfo } from '../../../../../../types';
|
|
2
|
+
|
|
3
|
+
export interface MPCDepositProps {
|
|
4
|
+
currentActiveChain: ChainInfo;
|
|
5
|
+
selectedToken: string;
|
|
6
|
+
address: string;
|
|
7
|
+
onDeposit?: (depositInfo: {
|
|
8
|
+
amount: string;
|
|
9
|
+
chainId: number;
|
|
10
|
+
tokenAddress: string;
|
|
11
|
+
tokenSymbol: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
onCopy?: (address: string) => void;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Deposit/src/components/mpc/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,SAAS,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IAGf,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE;QACxB,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,MAAM,CAAA;QACpB,WAAW,EAAE,MAAM,CAAA;KACpB,KAAK,IAAI,CAAA;IACV,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Deposit/src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,eAAO,MAAM,kBAAkB,EAAE,kBAUhC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Params {
|
|
2
|
+
client: any;
|
|
3
|
+
tokenAddress: `0x${string}`;
|
|
4
|
+
holder: `0x${string}`;
|
|
5
|
+
decimals: number;
|
|
6
|
+
fallbackFormatted?: string;
|
|
7
|
+
pollingInterval?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function useErc20BalanceOfWatcher({ client, tokenAddress, holder, decimals, fallbackFormatted, pollingInterval, }: Params): {
|
|
10
|
+
value: bigint | null;
|
|
11
|
+
formatted: string;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=useErc20BalanceOfWatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useErc20BalanceOfWatcher.d.ts","sourceRoot":"","sources":["../../../../../src/components/Deposit/src/hooks/useErc20BalanceOfWatcher.ts"],"names":[],"mappings":"AAGA,UAAU,MAAM;IACd,MAAM,EAAE,GAAG,CAAA;IACX,YAAY,EAAE,KAAK,MAAM,EAAE,CAAA;IAC3B,MAAM,EAAE,KAAK,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,iBAAuB,EACvB,eAAwB,GACzB,EAAE,MAAM;;;EAwER"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface TokenQueryComponentProps {
|
|
4
|
+
token: {
|
|
5
|
+
tokenAddress: string;
|
|
6
|
+
decimals: number;
|
|
7
|
+
symbol: string;
|
|
8
|
+
contractAddress?: string;
|
|
9
|
+
};
|
|
10
|
+
account?: string;
|
|
11
|
+
chainId?: number;
|
|
12
|
+
contractAddress?: string;
|
|
13
|
+
wagmiHooks?: {
|
|
14
|
+
useBalance: any;
|
|
15
|
+
useReadContract: any;
|
|
16
|
+
useAccount: any;
|
|
17
|
+
};
|
|
18
|
+
onResult: (tokenAddress: string, result: {
|
|
19
|
+
balance: any;
|
|
20
|
+
}) => void;
|
|
21
|
+
}
|
|
22
|
+
interface BalanceResult {
|
|
23
|
+
address: string;
|
|
24
|
+
value: bigint;
|
|
25
|
+
formatted: string;
|
|
26
|
+
decimals: number;
|
|
27
|
+
}
|
|
28
|
+
interface MulticallBalanceResult {
|
|
29
|
+
balanceList: BalanceResult[];
|
|
30
|
+
baseTokenBalance: {
|
|
31
|
+
value: bigint;
|
|
32
|
+
formatted: string;
|
|
33
|
+
decimals: number;
|
|
34
|
+
symbol: string;
|
|
35
|
+
};
|
|
36
|
+
combinedData: Record<string, {
|
|
37
|
+
balance: BalanceResult;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
interface UseMulticallBalanceParams {
|
|
41
|
+
account?: string;
|
|
42
|
+
chainId?: number;
|
|
43
|
+
contractAddress?: string;
|
|
44
|
+
tokens?: Array<{
|
|
45
|
+
tokenAddress: string;
|
|
46
|
+
decimals: number;
|
|
47
|
+
symbol: string;
|
|
48
|
+
}>;
|
|
49
|
+
wagmiHooks?: {
|
|
50
|
+
useBalance: any;
|
|
51
|
+
useReadContract: any;
|
|
52
|
+
useAccount: any;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export declare const useMulticallBalance: ({ account, chainId, contractAddress, tokens, wagmiHooks, }: UseMulticallBalanceParams) => {
|
|
56
|
+
multicallRun: () => Promise<MulticallBalanceResult>;
|
|
57
|
+
multicallRefresh: () => void;
|
|
58
|
+
multicallResult: MulticallBalanceResult;
|
|
59
|
+
validErcTokens: {
|
|
60
|
+
tokenAddress: string;
|
|
61
|
+
decimals: number;
|
|
62
|
+
symbol: string;
|
|
63
|
+
}[];
|
|
64
|
+
isLoading: any;
|
|
65
|
+
queryComponents: React.FunctionComponentElement<TokenQueryComponentProps>[];
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=useMulticallBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMulticallBalance.d.ts","sourceRoot":"","sources":["../../../../../src/components/Deposit/src/hooks/useMulticallBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAIxE,UAAU,wBAAwB;IAChC,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;QACd,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,CAAA;IACD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE;QACX,UAAU,EAAE,GAAG,CAAA;QACf,eAAe,EAAE,GAAG,CAAA;QACpB,UAAU,EAAE,GAAG,CAAA;KAChB,CAAA;IACD,QAAQ,EAAE,CACR,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE;QACN,OAAO,EAAE,GAAG,CAAA;KACb,KACE,IAAI,CAAA;CACV;AA+BD,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,sBAAsB;IAC9B,WAAW,EAAE,aAAa,EAAE,CAAA;IAC5B,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,YAAY,EAAE,MAAM,CAClB,MAAM,EACN;QACE,OAAO,EAAE,aAAa,CAAA;KACvB,CACF,CAAA;CACF;AAED,UAAU,yBAAyB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,YAAY,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;KACf,CAAC,CAAA;IAEF,UAAU,CAAC,EAAE;QACX,UAAU,EAAE,GAAG,CAAA;QACf,eAAe,EAAE,GAAG,CAAA;QACpB,UAAU,EAAE,GAAG,CAAA;KAChB,CAAA;CACF;AAED,eAAO,MAAM,mBAAmB,GAAI,4DAMjC,yBAAyB;wBAgIF,OAAO,CAAC,sBAAsB,CAAC;;;;sBAlJvC,MAAM;kBACV,MAAM;gBACR,MAAM;;;;CAwKjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Deposit/src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Deposit/src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAyB,MAAM,OAAO,CAAA;AAcjD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAsIpC,CAAA"}
|
|
@@ -2,44 +2,65 @@ export declare const calculateBalance: (balance: string, amount: string, decimal
|
|
|
2
2
|
export declare const calculateEquity: (equity: number, depositAmount: string, rate: string) => string;
|
|
3
3
|
export declare const isGreaterThan: (a: string | number, b: string | number) => boolean;
|
|
4
4
|
export declare const isLessThan: (a: string | number, b: string | number) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 格式化金额显示
|
|
7
|
+
* 规则:
|
|
8
|
+
* - 最长显示6位小数
|
|
9
|
+
* - 如果末尾为0,则最多显示2位小数
|
|
10
|
+
* - 保持至少2位小数(当整数部分为0时)
|
|
11
|
+
*
|
|
12
|
+
* @param value - 要格式化的数值(字符串或数字)
|
|
13
|
+
* @returns 格式化后的字符串
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* formatAmount('0.000287645') // '0.000287'
|
|
17
|
+
* formatAmount('0.00') // '0.00'
|
|
18
|
+
* formatAmount('0.002800') // '0.0028'
|
|
19
|
+
* formatAmount('15.21532') // '15.21532'
|
|
20
|
+
* formatAmount('0.1520') // '0.152'
|
|
21
|
+
* formatAmount('0.1') // '0.10'
|
|
22
|
+
* formatAmount('0.11') // '0.11'
|
|
23
|
+
* formatAmount('0.111') // '0.111'
|
|
24
|
+
*/
|
|
25
|
+
export declare const formatAmount: (value: string | number) => string;
|
|
26
|
+
/**
|
|
27
|
+
* 验证和格式化输入金额
|
|
28
|
+
* @param input - 用户输入的字符串
|
|
29
|
+
* @param maxBalance - 最大可用余额
|
|
30
|
+
* @returns { isValid: boolean, formattedValue: string, errorType?: string }
|
|
31
|
+
*/
|
|
32
|
+
export declare const validateAndFormatInput: (input: string, maxBalance?: string) => {
|
|
33
|
+
isValid: boolean;
|
|
34
|
+
formattedValue: string;
|
|
35
|
+
errorType?: "invalid_char" | "exceed_decimals" | "exceed_balance" | "auto_adjusted_to_max";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 格式化输入显示(用于实时显示)
|
|
39
|
+
* 与 formatAmount 不同,这个函数用于输入过程中的实时格式化
|
|
40
|
+
* 不强制添加小数位,保持用户输入的原始意图
|
|
41
|
+
*/
|
|
42
|
+
export declare const formatInputDisplay: (value: string) => string;
|
|
5
43
|
export declare const mockUseTranslation: () => (key: string, params?: any) => string;
|
|
6
44
|
export declare const mockUseToast: () => {
|
|
7
|
-
show: (
|
|
8
|
-
};
|
|
9
|
-
export declare const defaultTokens: {
|
|
10
|
-
token: string;
|
|
11
|
-
iconUrl: string;
|
|
12
|
-
decimals: number;
|
|
13
|
-
tokenAddress: string;
|
|
14
|
-
}[];
|
|
15
|
-
export declare const defaultChains: {
|
|
16
|
-
chainId: number;
|
|
17
|
-
chain: string;
|
|
18
|
-
chainIconUrl: string;
|
|
19
|
-
allowDeposit: boolean;
|
|
20
|
-
blockTime: number;
|
|
21
|
-
txConfirm: number;
|
|
22
|
-
}[];
|
|
23
|
-
export declare const defaultCurrentActiveAccount: {
|
|
24
|
-
wallet: "mpc";
|
|
25
|
-
ethAddress: string;
|
|
26
|
-
accountId: string;
|
|
27
|
-
l2Key: string;
|
|
28
|
-
};
|
|
29
|
-
export declare const defaultSmartWallet: {
|
|
30
|
-
address: string;
|
|
31
|
-
};
|
|
32
|
-
export declare const defaultCurSelectTokenData: {
|
|
33
|
-
balance: {
|
|
34
|
-
formatted: string;
|
|
35
|
-
};
|
|
36
|
-
allowance: {
|
|
37
|
-
formatted: string;
|
|
38
|
-
};
|
|
45
|
+
show: (_message: string, _options?: any) => void;
|
|
39
46
|
};
|
|
40
|
-
export declare const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
export declare const CHAIN_IDS: {
|
|
48
|
+
readonly ETHEREUM: 1;
|
|
49
|
+
readonly BSC: 56;
|
|
50
|
+
readonly POLYGON: 137;
|
|
51
|
+
readonly ARBITRUM: 42161;
|
|
52
|
+
readonly ARBITRUM_SEPOLIA: 421614;
|
|
53
|
+
readonly OPTIMISM: 10;
|
|
54
|
+
readonly AVALANCHE: 43114;
|
|
55
|
+
readonly SEPOLIA: 11155111;
|
|
44
56
|
};
|
|
57
|
+
export declare const CHAINS_WITHOUT_LARGE_DEPOSIT_WARNING: readonly [1, 11155111, 42161, 421614];
|
|
58
|
+
export declare const shouldShowLargeDepositWarning: (chain: {
|
|
59
|
+
chainId?: string | number;
|
|
60
|
+
}) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 检查是否应该显示 LayerZero 提示
|
|
63
|
+
* 条件:Arbitrum 链 + USDT + 金额 >= 200,000
|
|
64
|
+
*/
|
|
65
|
+
export declare const shouldShowLayerZeroTip: (chainId: number | string | undefined, tokenSymbol: string | undefined, depositAmount: string | undefined) => boolean;
|
|
45
66
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/Deposit/src/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/Deposit/src/utils.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,UAAU,MAAM,KACf,MAGF,CAAA;AAED,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,eAAe,MAAM,EACrB,MAAM,MAAM,KACX,MAGF,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,KACjB,OAEF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,KAAG,OAEnE,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,GAAG,MAAM,KAAG,MA4CrD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO,MAAM,EACb,aAAY,MAAY,KACvB;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EACN,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,sBAAsB,CAAA;CAsE3B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,MA2BlD,CAAA;AAGD,eAAO,MAAM,kBAAkB,SAAU,KAAK,MAAM,EAAE,SAAS,GAAG,WAkCjE,CAAA;AAED,eAAO,MAAM,YAAY;qBACN,MAAM,aAAa,GAAG;CAGvC,CAAA;AAGF,eAAO,MAAM,SAAS;;;;;;;;;CASZ,CAAA;AAGV,eAAO,MAAM,oCAAoC,uCAKvC,CAAA;AAGV,eAAO,MAAM,6BAA6B,GAAI,OAAO;IACnD,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,YAcA,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,GAAG,MAAM,GAAG,SAAS,EACpC,aAAa,MAAM,GAAG,SAAS,EAC/B,eAAe,MAAM,GAAG,SAAS,KAChC,OA0BF,CAAA"}
|