@coinlist-co/react 0.12.2-rc.bc20f5b → 0.12.2-rc.e1f6c82
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/{chunk-3WW5FLT7.js → chunk-EKLUJZ7T.js} +10 -10
- package/dist/chunk-EKLUJZ7T.js.map +1 -0
- package/dist/{chunk-C6GF7MDF.js → chunk-GIE4UWB3.js} +680 -619
- package/dist/chunk-GIE4UWB3.js.map +1 -0
- package/dist/chunk-MJ6YXZWH.js +22 -0
- package/dist/chunk-MJ6YXZWH.js.map +1 -0
- package/dist/{chunk-IZJ4JSSC.js → chunk-PIOQA6HW.js} +173 -234
- package/dist/chunk-PIOQA6HW.js.map +1 -0
- package/dist/client/index.d.ts +2414 -5239
- package/dist/client/index.js +683 -788
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +2 -32
- package/dist/server/index.js +6 -4
- package/dist/server/index.js.map +1 -1
- package/dist/{time-CVZpAkGY.d.cts → time-Bbqlt2x7.d.ts} +1907 -3183
- package/dist/{token-registry-snapshot-BkwA8KmD.d.ts → token-registry-snapshot-DttZXGvY.d.ts} +7 -41
- package/dist/universal/index.d.ts +57 -1044
- package/dist/universal/index.js +16 -42
- package/package.json +18 -14
- package/dist/chunk-3WW5FLT7.js.map +0 -1
- package/dist/chunk-C6GF7MDF.js.map +0 -1
- package/dist/chunk-IZJ4JSSC.js.map +0 -1
- package/dist/client/index.cjs +0 -20460
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.d.cts +0 -8195
- package/dist/server/index.cjs +0 -4525
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.cts +0 -382
- package/dist/time-CVZpAkGY.d.ts +0 -3987
- package/dist/token-registry-snapshot-bR14QehS.d.cts +0 -245
- package/dist/universal/index.cjs +0 -4562
- package/dist/universal/index.cjs.map +0 -1
- package/dist/universal/index.d.cts +0 -1362
package/dist/client/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import {
|
|
2
3
|
AuthenticatedApiClient,
|
|
3
4
|
NABU_BASE_URL,
|
|
@@ -6,11 +7,11 @@ import {
|
|
|
6
7
|
loggerOverPino,
|
|
7
8
|
notifySessionExpired,
|
|
8
9
|
publicClients,
|
|
9
|
-
systemDelay
|
|
10
|
-
|
|
10
|
+
systemDelay,
|
|
11
|
+
systemTime
|
|
12
|
+
} from "../chunk-EKLUJZ7T.js";
|
|
11
13
|
import {
|
|
12
14
|
AuthorizationCode,
|
|
13
|
-
CENTRIFUGE_POLL_INTERVAL_MS,
|
|
14
15
|
CodeVerifier,
|
|
15
16
|
DEFAULT_AMOUNT_TO_COMPUTE_PRICE,
|
|
16
17
|
DEFAULT_ONDO_AMOUNT_TO_COMPUTE_PRICE,
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
SUPERSTATE_ISSUER_NAME,
|
|
26
27
|
SUPERSTATE_SUPPORTED_INPUT_ASSETS,
|
|
27
28
|
SWAP_POLL_INTERVAL_MS,
|
|
28
|
-
SwapQuote,
|
|
29
29
|
TOKEN_REGISTRY,
|
|
30
30
|
TokenRegistrySnapshot,
|
|
31
31
|
USDC,
|
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
computeOndoSellPrice,
|
|
36
36
|
computePrice,
|
|
37
37
|
computeSlip,
|
|
38
|
-
decodeSwappedOutputAmount,
|
|
39
38
|
formattedPricePerShare,
|
|
40
39
|
generatePKCEParams,
|
|
41
40
|
isOndoNotTradableError,
|
|
@@ -45,7 +44,7 @@ import {
|
|
|
45
44
|
resolveCentrifugeVaults,
|
|
46
45
|
superstateSwapContractAddress,
|
|
47
46
|
swapSpender
|
|
48
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-PIOQA6HW.js";
|
|
49
48
|
import {
|
|
50
49
|
API_VERSION,
|
|
51
50
|
AssetDecimals,
|
|
@@ -61,14 +60,14 @@ import {
|
|
|
61
60
|
CoinListTokenSaleNamespaceImpl,
|
|
62
61
|
DecimalString,
|
|
63
62
|
ERC20_ABI,
|
|
63
|
+
EpochMillis,
|
|
64
64
|
Erc20NamespaceImpl,
|
|
65
65
|
EvmContractAddress,
|
|
66
66
|
EvmWalletAddress,
|
|
67
67
|
FormattedAmountAssetUi,
|
|
68
68
|
FormattedPercentUi,
|
|
69
69
|
HEADER_USER_AGENT,
|
|
70
|
-
|
|
71
|
-
KycToken,
|
|
70
|
+
MAX_UINT_256,
|
|
72
71
|
Millis,
|
|
73
72
|
NA_AMOUNT_ASSET_UI,
|
|
74
73
|
NotAuthenticatedError,
|
|
@@ -91,6 +90,7 @@ import {
|
|
|
91
90
|
WalletsNamespaceImpl,
|
|
92
91
|
apiErrorCode,
|
|
93
92
|
assetAmount,
|
|
93
|
+
classifyLogCause,
|
|
94
94
|
describeErrorUnredacted,
|
|
95
95
|
formatAmount,
|
|
96
96
|
formatBpsAsPercent,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
shortenAddress,
|
|
106
106
|
txExplorerUrl,
|
|
107
107
|
usdAmount
|
|
108
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-GIE4UWB3.js";
|
|
109
109
|
|
|
110
110
|
// src/client/CoinListProvider.tsx
|
|
111
111
|
import {
|
|
@@ -592,9 +592,9 @@ async function prepareCentrifugeBuy(params) {
|
|
|
592
592
|
}
|
|
593
593
|
var INSUFFICIENT_ALLOWANCE_CODE = "insufficient_allowance";
|
|
594
594
|
async function placeCentrifugeRequest(params) {
|
|
595
|
-
const { wallet, transaction, chain,
|
|
595
|
+
const { wallet, transaction, chain, time, onProgress } = params;
|
|
596
596
|
const emit = (phase) => onProgress?.(phase);
|
|
597
|
-
if (transaction.expiresAt !== null && now
|
|
597
|
+
if (transaction.expiresAt !== null && time.now() >= EpochMillis.fromDate(transaction.expiresAt)) {
|
|
598
598
|
return { type: "error", error: { step: "request-expired" } };
|
|
599
599
|
}
|
|
600
600
|
emit("broadcasting-request");
|
|
@@ -637,7 +637,7 @@ async function buyCentrifuge(params) {
|
|
|
637
637
|
wallet: params.wallet,
|
|
638
638
|
transaction: prepared.transaction,
|
|
639
639
|
chain: params.chain,
|
|
640
|
-
|
|
640
|
+
time: params.time,
|
|
641
641
|
onProgress: params.onProgress
|
|
642
642
|
});
|
|
643
643
|
}
|
|
@@ -698,7 +698,7 @@ async function prepareClaim(params) {
|
|
|
698
698
|
const { centrifuge, wallet, chain, symbol, direction } = params;
|
|
699
699
|
const walletParams = { symbol, chain, walletAddress: wallet.address };
|
|
700
700
|
switch (direction) {
|
|
701
|
-
case "
|
|
701
|
+
case "deposit": {
|
|
702
702
|
const transaction = await centrifuge.createClaim(walletParams);
|
|
703
703
|
return { transaction, claimed: transaction.claimableShares };
|
|
704
704
|
}
|
|
@@ -809,6 +809,7 @@ var ClientCentrifugeNamespaceImpl = class extends CentrifugeNamespaceImpl {
|
|
|
809
809
|
params.onProgress,
|
|
810
810
|
(onProgress) => buyCentrifuge({
|
|
811
811
|
...params,
|
|
812
|
+
...systemTime,
|
|
812
813
|
onProgress,
|
|
813
814
|
centrifuge: this,
|
|
814
815
|
erc20: this.erc20
|
|
@@ -835,7 +836,7 @@ var ClientCentrifugeNamespaceImpl = class extends CentrifugeNamespaceImpl {
|
|
|
835
836
|
"placeRequest",
|
|
836
837
|
void 0,
|
|
837
838
|
params.onProgress,
|
|
838
|
-
(onProgress) => placeCentrifugeRequest({ ...params, onProgress })
|
|
839
|
+
(onProgress) => placeCentrifugeRequest({ ...params, ...systemTime, onProgress })
|
|
839
840
|
);
|
|
840
841
|
}
|
|
841
842
|
claim(params) {
|
|
@@ -1011,9 +1012,9 @@ async function prepare(params, build) {
|
|
|
1011
1012
|
}
|
|
1012
1013
|
var INSUFFICIENT_ALLOWANCE_CODE2 = "insufficient_allowance";
|
|
1013
1014
|
async function executeOndoSwap(params) {
|
|
1014
|
-
const { wallet, transaction, chain,
|
|
1015
|
+
const { wallet, transaction, chain, time, onProgress } = params;
|
|
1015
1016
|
const emit = (phase) => onProgress?.(phase);
|
|
1016
|
-
if (now
|
|
1017
|
+
if (time.now() >= EpochMillis.fromDate(transaction.expiresAt)) {
|
|
1017
1018
|
return { type: "error", error: { step: "quote-expired" } };
|
|
1018
1019
|
}
|
|
1019
1020
|
emit("broadcasting-swap");
|
|
@@ -1089,11 +1090,29 @@ var ClientOndoNamespaceImpl = class extends OndoNamespaceImpl {
|
|
|
1089
1090
|
"executeSwap",
|
|
1090
1091
|
{ side: params.transaction.side },
|
|
1091
1092
|
params.onProgress,
|
|
1092
|
-
(onProgress) => executeOndoSwap({ ...params, onProgress })
|
|
1093
|
+
(onProgress) => executeOndoSwap({ ...params, ...systemTime, onProgress })
|
|
1093
1094
|
);
|
|
1094
1095
|
}
|
|
1095
1096
|
};
|
|
1096
1097
|
|
|
1098
|
+
// src/universal/core/checkout/superstate/blockchain/swapped-event.ts
|
|
1099
|
+
import { parseEventLogs } from "viem";
|
|
1100
|
+
function decodeSwappedOutputAmount(receipt, outputDecimals) {
|
|
1101
|
+
try {
|
|
1102
|
+
const [swapped] = parseEventLogs({
|
|
1103
|
+
abi: SUPERSTATE_SWAP_ABI,
|
|
1104
|
+
eventName: "Swapped",
|
|
1105
|
+
logs: receipt.logs
|
|
1106
|
+
});
|
|
1107
|
+
if (!swapped) return null;
|
|
1108
|
+
const raw = swapped.args.outputAmount;
|
|
1109
|
+
if (raw < 0n || raw > MAX_UINT_256) return null;
|
|
1110
|
+
return BlockchainAmount({ raw, decimals: outputDecimals });
|
|
1111
|
+
} catch {
|
|
1112
|
+
return null;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1097
1116
|
// src/client/core/checkout/superstate/swap-flows.ts
|
|
1098
1117
|
async function executeSwap(params) {
|
|
1099
1118
|
const {
|
|
@@ -1370,6 +1389,121 @@ var ClientSupportNamespaceImpl = class {
|
|
|
1370
1389
|
}
|
|
1371
1390
|
};
|
|
1372
1391
|
|
|
1392
|
+
// src/client/core/wallets/connect-external-wallet.ts
|
|
1393
|
+
var DEFAULT_STATEMENT = "Sign this message to prove you own this wallet. This does not cost gas or move funds.";
|
|
1394
|
+
var TERMINAL_CODES = /* @__PURE__ */ new Set([
|
|
1395
|
+
"not_authenticated",
|
|
1396
|
+
"wallet_not_whitelisted",
|
|
1397
|
+
"max_wallets_reached"
|
|
1398
|
+
]);
|
|
1399
|
+
var API_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
1400
|
+
"wallet_not_whitelisted",
|
|
1401
|
+
"max_wallets_reached"
|
|
1402
|
+
]);
|
|
1403
|
+
function flowError(code) {
|
|
1404
|
+
return { code, retryable: !TERMINAL_CODES.has(code) };
|
|
1405
|
+
}
|
|
1406
|
+
function siweContext() {
|
|
1407
|
+
if (typeof window === "undefined") return { domain: "", uri: "" };
|
|
1408
|
+
return { domain: window.location.host, uri: window.location.origin };
|
|
1409
|
+
}
|
|
1410
|
+
function apiErrorCode2(error) {
|
|
1411
|
+
if (typeof error !== "object" || error === null) return void 0;
|
|
1412
|
+
const body = error.response?.body;
|
|
1413
|
+
return typeof body?.code === "string" ? body.code : void 0;
|
|
1414
|
+
}
|
|
1415
|
+
function classifyApiError(error) {
|
|
1416
|
+
if (error instanceof NotAuthenticatedError) {
|
|
1417
|
+
return flowError("not_authenticated");
|
|
1418
|
+
}
|
|
1419
|
+
const code = apiErrorCode2(error);
|
|
1420
|
+
if (code !== void 0 && API_ERROR_CODES.has(code)) {
|
|
1421
|
+
return flowError(code);
|
|
1422
|
+
}
|
|
1423
|
+
return flowError("unknown");
|
|
1424
|
+
}
|
|
1425
|
+
function challengeParams(wallet, challengeType, statement) {
|
|
1426
|
+
switch (challengeType) {
|
|
1427
|
+
case "siwe":
|
|
1428
|
+
return {
|
|
1429
|
+
walletAddress: wallet.address,
|
|
1430
|
+
chain: wallet.chain,
|
|
1431
|
+
challengeType: "siwe",
|
|
1432
|
+
...siweContext(),
|
|
1433
|
+
statement: statement ?? DEFAULT_STATEMENT
|
|
1434
|
+
};
|
|
1435
|
+
case "plain":
|
|
1436
|
+
return {
|
|
1437
|
+
walletAddress: wallet.address,
|
|
1438
|
+
chain: wallet.chain,
|
|
1439
|
+
challengeType: "plain"
|
|
1440
|
+
};
|
|
1441
|
+
default: {
|
|
1442
|
+
const _exhaustive = challengeType;
|
|
1443
|
+
return _exhaustive;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
async function connectExternalWalletFlow(params) {
|
|
1448
|
+
const {
|
|
1449
|
+
wallets,
|
|
1450
|
+
wallet,
|
|
1451
|
+
offerId,
|
|
1452
|
+
offerOptionId,
|
|
1453
|
+
challengeType,
|
|
1454
|
+
statement,
|
|
1455
|
+
isCancelled,
|
|
1456
|
+
onProgress
|
|
1457
|
+
} = params;
|
|
1458
|
+
const emit = (phase) => onProgress?.(phase);
|
|
1459
|
+
const cancelled = () => isCancelled?.() ?? false;
|
|
1460
|
+
emit("requesting-challenge");
|
|
1461
|
+
let challenge;
|
|
1462
|
+
try {
|
|
1463
|
+
challenge = await wallets.createOwnershipChallenge(
|
|
1464
|
+
challengeParams(wallet, challengeType ?? "siwe", statement)
|
|
1465
|
+
);
|
|
1466
|
+
} catch (error) {
|
|
1467
|
+
return { type: "error", error: classifyApiError(error) };
|
|
1468
|
+
}
|
|
1469
|
+
if (cancelled()) return { type: "cancelled" };
|
|
1470
|
+
emit("signing-message");
|
|
1471
|
+
let signature;
|
|
1472
|
+
try {
|
|
1473
|
+
signature = await wallet.signMessage(challenge.message);
|
|
1474
|
+
} catch (error) {
|
|
1475
|
+
if (classifyWalletError(error).type === "user_rejected") {
|
|
1476
|
+
return { type: "error", error: flowError("user_rejected") };
|
|
1477
|
+
}
|
|
1478
|
+
return { type: "error", error: flowError("unknown") };
|
|
1479
|
+
}
|
|
1480
|
+
if (cancelled()) return { type: "cancelled" };
|
|
1481
|
+
emit("submitting-signature");
|
|
1482
|
+
try {
|
|
1483
|
+
const binding = await wallets.connectExternal({
|
|
1484
|
+
offerId,
|
|
1485
|
+
offerOptionId,
|
|
1486
|
+
walletAddress: wallet.address,
|
|
1487
|
+
chain: wallet.chain,
|
|
1488
|
+
signature
|
|
1489
|
+
});
|
|
1490
|
+
return { type: "success", binding };
|
|
1491
|
+
} catch (error) {
|
|
1492
|
+
return { type: "error", error: classifyApiError(error) };
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
// src/client/core/wallets/client-wallets-namespace.ts
|
|
1497
|
+
var ClientWalletsNamespaceImpl = class extends WalletsNamespaceImpl {
|
|
1498
|
+
connect(params) {
|
|
1499
|
+
return this.log.wrap(
|
|
1500
|
+
"connect",
|
|
1501
|
+
params,
|
|
1502
|
+
() => connectExternalWalletFlow({ ...params, wallets: this })
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
};
|
|
1506
|
+
|
|
1373
1507
|
// src/client/core/coinlist-client.ts
|
|
1374
1508
|
var CoinListClientImpl = class {
|
|
1375
1509
|
constructor(config) {
|
|
@@ -1405,7 +1539,7 @@ var CoinListClientImpl = class {
|
|
|
1405
1539
|
ctx,
|
|
1406
1540
|
config.coinlistBaseUrl
|
|
1407
1541
|
);
|
|
1408
|
-
this.wallets = new
|
|
1542
|
+
this.wallets = new ClientWalletsNamespaceImpl(ctx);
|
|
1409
1543
|
this.erc20 = new Erc20NamespaceImpl(ctx);
|
|
1410
1544
|
this.tokenSale = new ClientCoinListTokenSaleNamespaceImpl(ctx, this.erc20);
|
|
1411
1545
|
this.superstate = new ClientSuperstateSwapNamespaceImpl(
|
|
@@ -1456,7 +1590,7 @@ function useLogger(hook) {
|
|
|
1456
1590
|
// src/client/CoinListProvider.tsx
|
|
1457
1591
|
import { jsx } from "react/jsx-runtime";
|
|
1458
1592
|
var CoinListContext = createContext3(null);
|
|
1459
|
-
function
|
|
1593
|
+
function CoinListProvider({
|
|
1460
1594
|
config,
|
|
1461
1595
|
locale,
|
|
1462
1596
|
children
|
|
@@ -1486,7 +1620,6 @@ function CoinListContextProvider({
|
|
|
1486
1620
|
const logger = config.logger ?? null;
|
|
1487
1621
|
return /* @__PURE__ */ jsx(CoinListContext.Provider, { value, children: /* @__PURE__ */ jsx(CoinListLocaleContext.Provider, { value: locale ?? DEFAULT_LOCALE, children: /* @__PURE__ */ jsx(CoinListLoggerContext.Provider, { value: logger, children }) }) });
|
|
1488
1622
|
}
|
|
1489
|
-
var CoinListProvider = CoinListContextProvider;
|
|
1490
1623
|
|
|
1491
1624
|
// src/client/CoinListStyleScope.tsx
|
|
1492
1625
|
import { createContext as createContext4, useContext as useContext3 } from "react";
|
|
@@ -3890,10 +4023,10 @@ var CheckoutAssetUi = {
|
|
|
3890
4023
|
* fallback artwork, the caller supplies the symbol and the chain.
|
|
3891
4024
|
*
|
|
3892
4025
|
* `symbol` is a parameter rather than `offer.asset.code` because the symbol a
|
|
3893
|
-
* provider trades under is the provider's, not the catalogue's
|
|
3894
|
-
*
|
|
3895
|
-
*
|
|
3896
|
-
* provider
|
|
4026
|
+
* provider trades under is the provider's, not the catalogue's, and the two
|
|
4027
|
+
* can part (a rebrand, or a mock asset on a testnet). Keeping it out here is
|
|
4028
|
+
* what lets one companion serve every provider instead of forking per
|
|
4029
|
+
* provider.
|
|
3897
4030
|
*
|
|
3898
4031
|
* The icon is resolved from the public token registry when `tokenMetadata`
|
|
3899
4032
|
* carries a listed token — `useCheckoutOfferTokenMetadata` fetches it,
|
|
@@ -4728,9 +4861,20 @@ import { useEffect as useEffect7, useMemo as useMemo4, useRef as useRef4, useSta
|
|
|
4728
4861
|
|
|
4729
4862
|
// src/client/hooks/shared/centrifuge/centrifuge-load-error.ts
|
|
4730
4863
|
function centrifugeLoadErrorReason(error) {
|
|
4731
|
-
|
|
4864
|
+
const cause = classifyLogCause(error);
|
|
4865
|
+
switch (cause.type) {
|
|
4866
|
+
case "not-authenticated":
|
|
4867
|
+
return "not-authenticated";
|
|
4868
|
+
case "http":
|
|
4869
|
+
return cause.status === 401 ? "not-authenticated" : "generic-error";
|
|
4870
|
+
default:
|
|
4871
|
+
return "generic-error";
|
|
4872
|
+
}
|
|
4732
4873
|
}
|
|
4733
4874
|
|
|
4875
|
+
// src/universal/core/checkout/centrifuge/constants.ts
|
|
4876
|
+
var CENTRIFUGE_POLL_INTERVAL_MS = 15e3;
|
|
4877
|
+
|
|
4734
4878
|
// src/client/hooks/shared/centrifuge/useCentrifugeVaultStatuses.ts
|
|
4735
4879
|
var LOADING = { type: "LOADING" };
|
|
4736
4880
|
function useCentrifugeVaultStatuses(options) {
|
|
@@ -4835,18 +4979,21 @@ function useCentrifugeVaultStatus(options) {
|
|
|
4835
4979
|
return { state: statuses[0].state };
|
|
4836
4980
|
}
|
|
4837
4981
|
|
|
4982
|
+
// src/universal/core/checkout/centrifuge/symbol.ts
|
|
4983
|
+
function centrifugeShareSymbol(offer) {
|
|
4984
|
+
return AssetSymbol(offer.asset.code);
|
|
4985
|
+
}
|
|
4986
|
+
|
|
4838
4987
|
// src/client/hooks/checkout/centrifuge/buy/useCentrifugeBuyCheckoutViewModel.ts
|
|
4839
4988
|
function useCentrifugeBuyCheckoutViewModel({
|
|
4840
4989
|
offer,
|
|
4841
|
-
symbol,
|
|
4842
4990
|
chain,
|
|
4843
4991
|
wallets,
|
|
4844
4992
|
enabled = true,
|
|
4845
|
-
onOrderPlaced
|
|
4846
|
-
underlyingFund,
|
|
4847
|
-
apy
|
|
4993
|
+
onOrderPlaced
|
|
4848
4994
|
}) {
|
|
4849
4995
|
const locale = useLocale();
|
|
4996
|
+
const symbol = centrifugeShareSymbol(offer);
|
|
4850
4997
|
const [step, setStep] = useState9({ type: "wallet" });
|
|
4851
4998
|
const [orderPlaced, setOrderPlaced] = useState9(
|
|
4852
4999
|
null
|
|
@@ -4914,8 +5061,10 @@ function useCentrifugeBuyCheckoutViewModel({
|
|
|
4914
5061
|
symbol,
|
|
4915
5062
|
chain,
|
|
4916
5063
|
tokenMetadata: outputTokenMetadata,
|
|
4917
|
-
|
|
4918
|
-
|
|
5064
|
+
// TODO: frontline does not publish the underlying fund or the APY yet.
|
|
5065
|
+
// Read both off the offer once it does; until then their rows stay hidden.
|
|
5066
|
+
underlyingFund: null,
|
|
5067
|
+
apy: null
|
|
4919
5068
|
});
|
|
4920
5069
|
const uiState = () => {
|
|
4921
5070
|
if (errorReason !== null) return { type: "error", reason: errorReason };
|
|
@@ -5028,24 +5177,18 @@ function orderPlacedUi(order, offer, symbol, chain, locale) {
|
|
|
5028
5177
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5029
5178
|
function CentrifugeBuyCheckoutContainer({
|
|
5030
5179
|
offer,
|
|
5031
|
-
symbol,
|
|
5032
5180
|
chain,
|
|
5033
5181
|
wallets,
|
|
5034
5182
|
enabled,
|
|
5035
5183
|
onOrderPlaced,
|
|
5036
|
-
underlyingFund,
|
|
5037
|
-
apy,
|
|
5038
5184
|
className
|
|
5039
5185
|
}) {
|
|
5040
5186
|
const { state, onEvent } = useCentrifugeBuyCheckoutViewModel({
|
|
5041
5187
|
offer,
|
|
5042
|
-
symbol,
|
|
5043
5188
|
chain,
|
|
5044
5189
|
wallets,
|
|
5045
5190
|
enabled,
|
|
5046
|
-
onOrderPlaced
|
|
5047
|
-
underlyingFund,
|
|
5048
|
-
apy
|
|
5191
|
+
onOrderPlaced
|
|
5049
5192
|
});
|
|
5050
5193
|
return /* @__PURE__ */ jsx41(
|
|
5051
5194
|
CentrifugeBuyCheckoutView,
|
|
@@ -6293,7 +6436,7 @@ function useOndoBuyTransaction(options) {
|
|
|
6293
6436
|
);
|
|
6294
6437
|
const fetchIdRef = useRef6(0);
|
|
6295
6438
|
const isFetchingRef = useRef6(false);
|
|
6296
|
-
const
|
|
6439
|
+
const requestKey2 = request === null ? null : stableKey(request);
|
|
6297
6440
|
const requestRef = useRef6(request);
|
|
6298
6441
|
requestRef.current = request;
|
|
6299
6442
|
const build = useCallback3(async () => {
|
|
@@ -6344,12 +6487,12 @@ function useOndoBuyTransaction(options) {
|
|
|
6344
6487
|
}, [data]);
|
|
6345
6488
|
const hasSeed = data !== void 0;
|
|
6346
6489
|
useEffect9(() => {
|
|
6347
|
-
if (hasSeed ||
|
|
6490
|
+
if (hasSeed || requestKey2 === null) return;
|
|
6348
6491
|
build();
|
|
6349
6492
|
return () => {
|
|
6350
6493
|
++fetchIdRef.current;
|
|
6351
6494
|
};
|
|
6352
|
-
}, [build,
|
|
6495
|
+
}, [build, requestKey2, hasSeed]);
|
|
6353
6496
|
const refetch = useCallback3(() => {
|
|
6354
6497
|
build();
|
|
6355
6498
|
}, [build]);
|
|
@@ -7015,16 +7158,21 @@ function toConfirmedWalletUi2(wallets, wallet) {
|
|
|
7015
7158
|
};
|
|
7016
7159
|
}
|
|
7017
7160
|
|
|
7161
|
+
// src/universal/core/checkout/ondo/symbol.ts
|
|
7162
|
+
function ondoSymbolOf(offer) {
|
|
7163
|
+
return AssetSymbol(offer.asset.code);
|
|
7164
|
+
}
|
|
7165
|
+
|
|
7018
7166
|
// src/client/hooks/checkout/ondo/buy/useOndoBuyCheckoutViewModel.ts
|
|
7019
7167
|
function useOndoBuyCheckoutViewModel({
|
|
7020
7168
|
offer,
|
|
7021
|
-
ondoSymbol,
|
|
7022
7169
|
chain,
|
|
7023
7170
|
wallets,
|
|
7024
7171
|
enabled = true,
|
|
7025
7172
|
onOrderConfirmed
|
|
7026
7173
|
}) {
|
|
7027
7174
|
const locale = useLocale();
|
|
7175
|
+
const ondoSymbol = ondoSymbolOf(offer);
|
|
7028
7176
|
const [step, setStep] = useState16({ type: "wallet" });
|
|
7029
7177
|
const [orderConfirmed, setOrderConfirmed] = useState16(null);
|
|
7030
7178
|
const swappableHere = swapSpender(offer.swapContracts, chain) !== null;
|
|
@@ -7240,7 +7388,6 @@ function toOrderConfirmedUi({
|
|
|
7240
7388
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
7241
7389
|
function OndoBuyCheckoutContainer({
|
|
7242
7390
|
offer,
|
|
7243
|
-
ondoSymbol,
|
|
7244
7391
|
chain,
|
|
7245
7392
|
wallets,
|
|
7246
7393
|
enabled,
|
|
@@ -7249,7 +7396,6 @@ function OndoBuyCheckoutContainer({
|
|
|
7249
7396
|
}) {
|
|
7250
7397
|
const { state, onEvent } = useOndoBuyCheckoutViewModel({
|
|
7251
7398
|
offer,
|
|
7252
|
-
ondoSymbol,
|
|
7253
7399
|
chain,
|
|
7254
7400
|
wallets,
|
|
7255
7401
|
enabled,
|
|
@@ -8132,7 +8278,7 @@ function useOndoSellTransaction(options) {
|
|
|
8132
8278
|
);
|
|
8133
8279
|
const fetchIdRef = useRef12(0);
|
|
8134
8280
|
const isFetchingRef = useRef12(false);
|
|
8135
|
-
const
|
|
8281
|
+
const requestKey2 = request === null ? null : stableKey2(request);
|
|
8136
8282
|
const requestRef = useRef12(request);
|
|
8137
8283
|
requestRef.current = request;
|
|
8138
8284
|
const build = useCallback4(async () => {
|
|
@@ -8183,12 +8329,12 @@ function useOndoSellTransaction(options) {
|
|
|
8183
8329
|
}, [data]);
|
|
8184
8330
|
const hasSeed = data !== void 0;
|
|
8185
8331
|
useEffect16(() => {
|
|
8186
|
-
if (hasSeed ||
|
|
8332
|
+
if (hasSeed || requestKey2 === null) return;
|
|
8187
8333
|
build();
|
|
8188
8334
|
return () => {
|
|
8189
8335
|
++fetchIdRef.current;
|
|
8190
8336
|
};
|
|
8191
|
-
}, [build,
|
|
8337
|
+
}, [build, requestKey2, hasSeed]);
|
|
8192
8338
|
const refetch = useCallback4(() => {
|
|
8193
8339
|
build();
|
|
8194
8340
|
}, [build]);
|
|
@@ -8434,13 +8580,13 @@ function executionErrorMessage2(error) {
|
|
|
8434
8580
|
// src/client/hooks/checkout/ondo/sell/useOndoSellCheckoutViewModel.ts
|
|
8435
8581
|
function useOndoSellCheckoutViewModel({
|
|
8436
8582
|
offer,
|
|
8437
|
-
ondoSymbol,
|
|
8438
8583
|
chain,
|
|
8439
8584
|
wallets,
|
|
8440
8585
|
enabled = true,
|
|
8441
8586
|
onOrderConfirmed
|
|
8442
8587
|
}) {
|
|
8443
8588
|
const locale = useLocale();
|
|
8589
|
+
const ondoSymbol = ondoSymbolOf(offer);
|
|
8444
8590
|
const [initialStep] = useState21(
|
|
8445
8591
|
() => wallets.preselected === null ? { type: "wallet" } : { type: "amount", wallet: wallets.preselected }
|
|
8446
8592
|
);
|
|
@@ -8680,7 +8826,6 @@ function toOrderConfirmedUi2({
|
|
|
8680
8826
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
8681
8827
|
function OndoSellCheckoutContainer({
|
|
8682
8828
|
offer,
|
|
8683
|
-
ondoSymbol,
|
|
8684
8829
|
chain,
|
|
8685
8830
|
wallets,
|
|
8686
8831
|
enabled,
|
|
@@ -8689,7 +8834,6 @@ function OndoSellCheckoutContainer({
|
|
|
8689
8834
|
}) {
|
|
8690
8835
|
const { state, onEvent } = useOndoSellCheckoutViewModel({
|
|
8691
8836
|
offer,
|
|
8692
|
-
ondoSymbol,
|
|
8693
8837
|
chain,
|
|
8694
8838
|
wallets,
|
|
8695
8839
|
enabled,
|
|
@@ -9885,6 +10029,7 @@ function useSwapQuote(options) {
|
|
|
9885
10029
|
pollIntervalMs = SWAP_POLL_INTERVAL_MS,
|
|
9886
10030
|
enabled
|
|
9887
10031
|
} = options;
|
|
10032
|
+
const { raw: inputRaw, decimals: inputDecimals } = inputAmount;
|
|
9888
10033
|
const { coinlist, isReady } = useCoinList();
|
|
9889
10034
|
const log = useLogger("useSwapQuote");
|
|
9890
10035
|
const [quote, setQuote] = useState24(null);
|
|
@@ -9909,20 +10054,15 @@ function useSwapQuote(options) {
|
|
|
9909
10054
|
setIsRefreshing(true);
|
|
9910
10055
|
}
|
|
9911
10056
|
try {
|
|
9912
|
-
const
|
|
10057
|
+
const next = await coinlist.superstate.getQuote({
|
|
9913
10058
|
contractAddress,
|
|
9914
10059
|
chain,
|
|
9915
10060
|
inputToken: inputTokenAddress,
|
|
9916
|
-
amount:
|
|
10061
|
+
amount: BlockchainAmount({ raw: inputRaw, decimals: inputDecimals }),
|
|
10062
|
+
outputTokenDecimals
|
|
9917
10063
|
});
|
|
9918
10064
|
if (currentFetchId !== fetchIdRef.current) return;
|
|
9919
|
-
setQuote(
|
|
9920
|
-
SwapQuote.fromPreview(
|
|
9921
|
-
preview,
|
|
9922
|
-
inputAmount.decimals,
|
|
9923
|
-
outputTokenDecimals
|
|
9924
|
-
)
|
|
9925
|
-
);
|
|
10065
|
+
setQuote(next);
|
|
9926
10066
|
if (!hasQuoteRef.current) {
|
|
9927
10067
|
hasQuoteRef.current = true;
|
|
9928
10068
|
setIsLoading(false);
|
|
@@ -9951,8 +10091,8 @@ function useSwapQuote(options) {
|
|
|
9951
10091
|
isReady,
|
|
9952
10092
|
contractAddress,
|
|
9953
10093
|
chain,
|
|
9954
|
-
|
|
9955
|
-
|
|
10094
|
+
inputRaw,
|
|
10095
|
+
inputDecimals,
|
|
9956
10096
|
inputTokenAddress,
|
|
9957
10097
|
outputTokenDecimals,
|
|
9958
10098
|
pollIntervalMs,
|
|
@@ -10804,14 +10944,12 @@ function SuperstateSwapCheckoutContainer({
|
|
|
10804
10944
|
|
|
10805
10945
|
// src/client/components/checkout/CheckoutContainer.tsx
|
|
10806
10946
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
10807
|
-
function defaultCheckoutConfig(config) {
|
|
10808
|
-
return { "superstate::swap": {}, ...config };
|
|
10809
|
-
}
|
|
10810
10947
|
function CheckoutContainer({
|
|
10811
10948
|
offer,
|
|
10812
10949
|
chain,
|
|
10950
|
+
side = "buy",
|
|
10813
10951
|
wallets,
|
|
10814
|
-
config,
|
|
10952
|
+
config = {},
|
|
10815
10953
|
enabled = true,
|
|
10816
10954
|
className
|
|
10817
10955
|
}) {
|
|
@@ -10821,8 +10959,9 @@ function CheckoutContainer({
|
|
|
10821
10959
|
{
|
|
10822
10960
|
offer: ondoOffer,
|
|
10823
10961
|
chain,
|
|
10962
|
+
side,
|
|
10824
10963
|
wallets,
|
|
10825
|
-
config: config["ondo::swap"],
|
|
10964
|
+
config: config["ondo::swap"] ?? {},
|
|
10826
10965
|
enabled,
|
|
10827
10966
|
className
|
|
10828
10967
|
}
|
|
@@ -10834,46 +10973,42 @@ function CheckoutContainer({
|
|
|
10834
10973
|
chain,
|
|
10835
10974
|
wallets,
|
|
10836
10975
|
enabled,
|
|
10837
|
-
onOrderConfirmed: config["superstate::swap"]
|
|
10976
|
+
onOrderConfirmed: config["superstate::swap"]?.onOrderConfirmed,
|
|
10838
10977
|
className
|
|
10839
10978
|
}
|
|
10840
10979
|
),
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
}
|
|
10857
|
-
);
|
|
10858
|
-
}
|
|
10980
|
+
// The SDK ships no token-sale UI, so with no host render there is nothing
|
|
10981
|
+
// to show.
|
|
10982
|
+
tokenSale: (tokenSaleOffer) => config["coinlist::token_sale"]?.render(tokenSaleOffer) ?? null,
|
|
10983
|
+
centrifugeVault: (vaultOffer) => /* @__PURE__ */ jsx66(
|
|
10984
|
+
CentrifugeCheckoutContainer,
|
|
10985
|
+
{
|
|
10986
|
+
offer: vaultOffer,
|
|
10987
|
+
chain,
|
|
10988
|
+
side,
|
|
10989
|
+
wallets,
|
|
10990
|
+
config: config["centrifuge::vault"] ?? {},
|
|
10991
|
+
enabled,
|
|
10992
|
+
className
|
|
10993
|
+
}
|
|
10994
|
+
)
|
|
10859
10995
|
});
|
|
10860
10996
|
}
|
|
10861
10997
|
function OndoCheckoutContainer({
|
|
10862
10998
|
offer,
|
|
10863
10999
|
chain,
|
|
11000
|
+
side: initialSide,
|
|
10864
11001
|
wallets,
|
|
10865
11002
|
config,
|
|
10866
11003
|
enabled,
|
|
10867
11004
|
className
|
|
10868
11005
|
}) {
|
|
10869
|
-
const [side] = useState28(
|
|
10870
|
-
|
|
10871
|
-
return renderOndoSide(side, {
|
|
11006
|
+
const [side] = useState28(initialSide);
|
|
11007
|
+
return renderSide(side, {
|
|
10872
11008
|
buy: () => /* @__PURE__ */ jsx66(
|
|
10873
11009
|
OndoBuyCheckoutContainer,
|
|
10874
11010
|
{
|
|
10875
11011
|
offer,
|
|
10876
|
-
ondoSymbol,
|
|
10877
11012
|
chain,
|
|
10878
11013
|
wallets,
|
|
10879
11014
|
enabled,
|
|
@@ -10885,7 +11020,6 @@ function OndoCheckoutContainer({
|
|
|
10885
11020
|
OndoSellCheckoutContainer,
|
|
10886
11021
|
{
|
|
10887
11022
|
offer,
|
|
10888
|
-
ondoSymbol,
|
|
10889
11023
|
chain,
|
|
10890
11024
|
wallets,
|
|
10891
11025
|
enabled,
|
|
@@ -10895,6 +11029,33 @@ function OndoCheckoutContainer({
|
|
|
10895
11029
|
)
|
|
10896
11030
|
});
|
|
10897
11031
|
}
|
|
11032
|
+
function CentrifugeCheckoutContainer({
|
|
11033
|
+
offer,
|
|
11034
|
+
chain,
|
|
11035
|
+
side: initialSide,
|
|
11036
|
+
wallets,
|
|
11037
|
+
config,
|
|
11038
|
+
enabled,
|
|
11039
|
+
className
|
|
11040
|
+
}) {
|
|
11041
|
+
const [side] = useState28(initialSide);
|
|
11042
|
+
return renderSide(side, {
|
|
11043
|
+
buy: () => /* @__PURE__ */ jsx66(
|
|
11044
|
+
CentrifugeBuyCheckoutContainer,
|
|
11045
|
+
{
|
|
11046
|
+
offer,
|
|
11047
|
+
chain,
|
|
11048
|
+
wallets,
|
|
11049
|
+
enabled,
|
|
11050
|
+
onOrderPlaced: config.onOrderPlaced,
|
|
11051
|
+
className
|
|
11052
|
+
}
|
|
11053
|
+
),
|
|
11054
|
+
// TODO: the Centrifuge sell (redeem) checkout is coming soon. Until it
|
|
11055
|
+
// lands, a sell mount renders an empty container.
|
|
11056
|
+
sell: () => /* @__PURE__ */ jsx66("div", { className })
|
|
11057
|
+
});
|
|
11058
|
+
}
|
|
10898
11059
|
function renderOffer(offer, branches) {
|
|
10899
11060
|
switch (offer.type) {
|
|
10900
11061
|
case "ondo::swap":
|
|
@@ -10911,7 +11072,7 @@ function renderOffer(offer, branches) {
|
|
|
10911
11072
|
}
|
|
10912
11073
|
}
|
|
10913
11074
|
}
|
|
10914
|
-
function
|
|
11075
|
+
function renderSide(side, branches) {
|
|
10915
11076
|
switch (side) {
|
|
10916
11077
|
case "buy":
|
|
10917
11078
|
return branches.buy();
|
|
@@ -11182,8 +11343,7 @@ import { jsx as jsx69, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
|
11182
11343
|
var PENDING_LABEL = "Pending";
|
|
11183
11344
|
var CLAIM_LABEL = "Claim";
|
|
11184
11345
|
var BLOCKED_COPY = {
|
|
11185
|
-
"vault-paused": "Claims are paused for this vault."
|
|
11186
|
-
"wallet-frozen": "This wallet is frozen by the issuer."
|
|
11346
|
+
"vault-paused": "Claims are paused for this vault."
|
|
11187
11347
|
};
|
|
11188
11348
|
function CentrifugeVaultClaimRow({
|
|
11189
11349
|
row,
|
|
@@ -11540,7 +11700,7 @@ function rowsUi(input, legs) {
|
|
|
11540
11700
|
function rowsOfLeg(input, leg, vault, iconUrl) {
|
|
11541
11701
|
const legId = CentrifugeVaultLegId.of(leg);
|
|
11542
11702
|
const wallet = walletDisplay(leg.position.walletAddress, input.walletLabel);
|
|
11543
|
-
const claimable =
|
|
11703
|
+
const claimable = leg.position.claimable.raw > 0n ? [
|
|
11544
11704
|
{
|
|
11545
11705
|
kind: "claimable",
|
|
11546
11706
|
key: `claimable:${legId}`,
|
|
@@ -11548,7 +11708,7 @@ function rowsOfLeg(input, leg, vault, iconUrl) {
|
|
|
11548
11708
|
iconUrl,
|
|
11549
11709
|
amount: claimableAmount(leg, vault, input.locale),
|
|
11550
11710
|
wallet,
|
|
11551
|
-
action: input.claimsInFlight.has(legId) ? { type: "claiming" } : claimAction(
|
|
11711
|
+
action: input.claimsInFlight.has(legId) ? { type: "claiming" } : claimAction(statusOf(input, leg.position.chain))
|
|
11552
11712
|
}
|
|
11553
11713
|
] : [];
|
|
11554
11714
|
const pending = leg.position.pending.raw > 0n ? [
|
|
@@ -11572,21 +11732,15 @@ function legOrder(input) {
|
|
|
11572
11732
|
(wallet) => wallet.address.toLowerCase()
|
|
11573
11733
|
);
|
|
11574
11734
|
const chains = input.vaults.map((vault) => vault.chain);
|
|
11575
|
-
const directions = ["
|
|
11735
|
+
const directions = ["deposit", "redeem"];
|
|
11576
11736
|
return (a, b) => rank(wallets, a.position.walletAddress.toLowerCase()) - rank(wallets, b.position.walletAddress.toLowerCase()) || rank(chains, a.position.chain) - rank(chains, b.position.chain) || rank(directions, a.direction) - rank(directions, b.direction);
|
|
11577
11737
|
}
|
|
11578
11738
|
function statusOf(input, chain) {
|
|
11579
11739
|
const entry = input.statuses.find((s) => s.vault.chain === chain);
|
|
11580
11740
|
return entry?.state.type === "CONTENT" ? entry.state.status : null;
|
|
11581
11741
|
}
|
|
11582
|
-
function claimAction(
|
|
11583
|
-
|
|
11584
|
-
return { type: "blocked", reason: "vault-paused" };
|
|
11585
|
-
}
|
|
11586
|
-
if (leg.position.frozen) {
|
|
11587
|
-
return { type: "blocked", reason: "wallet-frozen" };
|
|
11588
|
-
}
|
|
11589
|
-
return { type: "enabled" };
|
|
11742
|
+
function claimAction(status) {
|
|
11743
|
+
return status !== null && (!status.linked || status.halted || !status.permissioned) ? { type: "blocked", reason: "vault-paused" } : { type: "enabled" };
|
|
11590
11744
|
}
|
|
11591
11745
|
function externalWalletUi({
|
|
11592
11746
|
wallets,
|
|
@@ -11717,7 +11871,7 @@ function walletFailureUi(cause) {
|
|
|
11717
11871
|
}
|
|
11718
11872
|
function pendingAmount(leg, vault, locale) {
|
|
11719
11873
|
switch (leg.direction) {
|
|
11720
|
-
case "
|
|
11874
|
+
case "deposit":
|
|
11721
11875
|
return fundingAmount(leg.position.pending, vault, locale);
|
|
11722
11876
|
case "redeem":
|
|
11723
11877
|
return shareAmount(leg.position.pending, vault, locale);
|
|
@@ -11729,12 +11883,10 @@ function pendingAmount(leg, vault, locale) {
|
|
|
11729
11883
|
}
|
|
11730
11884
|
function claimableAmount(leg, vault, locale) {
|
|
11731
11885
|
switch (leg.direction) {
|
|
11732
|
-
case "
|
|
11733
|
-
return
|
|
11886
|
+
case "deposit":
|
|
11887
|
+
return fundingAmount(leg.position.claimable, vault, locale);
|
|
11734
11888
|
case "redeem":
|
|
11735
|
-
return
|
|
11736
|
-
`~${fundingAmount(leg.position.claimableAssets, vault, locale)}`
|
|
11737
|
-
);
|
|
11889
|
+
return shareAmount(leg.position.claimable, vault, locale);
|
|
11738
11890
|
default: {
|
|
11739
11891
|
const exhaustive = leg;
|
|
11740
11892
|
return exhaustive;
|
|
@@ -11743,7 +11895,7 @@ function claimableAmount(leg, vault, locale) {
|
|
|
11743
11895
|
}
|
|
11744
11896
|
function claimedAmount(direction, claimed, vault, locale) {
|
|
11745
11897
|
switch (direction) {
|
|
11746
|
-
case "
|
|
11898
|
+
case "deposit":
|
|
11747
11899
|
return FormattedAmountAssetUi(`~${shareAmount(claimed, vault, locale)}`);
|
|
11748
11900
|
case "redeem":
|
|
11749
11901
|
return FormattedAmountAssetUi(
|
|
@@ -11802,7 +11954,7 @@ function useCentrifugeClaim() {
|
|
|
11802
11954
|
return { state, claim, reset };
|
|
11803
11955
|
}
|
|
11804
11956
|
|
|
11805
|
-
// src/client/hooks/claim/centrifuge/vault/data/
|
|
11957
|
+
// src/client/hooks/claim/centrifuge/vault/data/useCentrifugeClaimPositions.ts
|
|
11806
11958
|
import { useCallback as useCallback7, useEffect as useEffect23, useMemo as useMemo7, useRef as useRef17, useState as useState30 } from "react";
|
|
11807
11959
|
|
|
11808
11960
|
// src/client/ui/hooks/usePageVisible.ts
|
|
@@ -11818,14 +11970,14 @@ function isPageVisible() {
|
|
|
11818
11970
|
return document.visibilityState === "visible";
|
|
11819
11971
|
}
|
|
11820
11972
|
|
|
11821
|
-
// src/client/hooks/claim/centrifuge/vault/data/
|
|
11973
|
+
// src/client/hooks/claim/centrifuge/vault/data/useCentrifugeClaimPositions.ts
|
|
11822
11974
|
var LOADING4 = { type: "LOADING" };
|
|
11823
11975
|
var DISABLED = {
|
|
11824
11976
|
type: "CONTENT",
|
|
11825
11977
|
legs: []
|
|
11826
11978
|
};
|
|
11827
|
-
var DIRECTIONS = ["
|
|
11828
|
-
function
|
|
11979
|
+
var DIRECTIONS = ["deposit", "redeem"];
|
|
11980
|
+
function useCentrifugeClaimPositions(options) {
|
|
11829
11981
|
const {
|
|
11830
11982
|
vaults,
|
|
11831
11983
|
walletAddresses,
|
|
@@ -11834,12 +11986,12 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11834
11986
|
enabled = true
|
|
11835
11987
|
} = options;
|
|
11836
11988
|
const { coinlist, isReady } = useCoinList();
|
|
11837
|
-
const log = useLogger("
|
|
11989
|
+
const log = useLogger("useCentrifugeClaimPositions");
|
|
11838
11990
|
const visible = usePageVisible();
|
|
11839
11991
|
const key = requestsKey(vaults, walletAddresses);
|
|
11840
11992
|
const requests = useMemo7(() => readRequests(vaults, walletAddresses), [key]);
|
|
11841
11993
|
const readsRef = useRef17(
|
|
11842
|
-
new Map((data ?? []).map((read) => [
|
|
11994
|
+
new Map((data ?? []).map((read) => [legKey(read), read]))
|
|
11843
11995
|
);
|
|
11844
11996
|
const [state, setState] = useState30(
|
|
11845
11997
|
() => !enabled ? DISABLED : data === void 0 ? LOADING4 : contentOf(readsRef)
|
|
@@ -11853,20 +12005,19 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11853
12005
|
const fetchRead = useCallback7(
|
|
11854
12006
|
async (request) => {
|
|
11855
12007
|
const params = {
|
|
11856
|
-
|
|
11857
|
-
chain: request.chain,
|
|
12008
|
+
vault: request.vault,
|
|
11858
12009
|
walletAddress: request.walletAddress
|
|
11859
12010
|
};
|
|
11860
12011
|
switch (request.direction) {
|
|
11861
|
-
case "
|
|
12012
|
+
case "deposit":
|
|
11862
12013
|
return {
|
|
11863
|
-
direction: "
|
|
11864
|
-
position: await coinlist.centrifuge.
|
|
12014
|
+
direction: "deposit",
|
|
12015
|
+
position: await coinlist.centrifuge.readDepositPosition(params)
|
|
11865
12016
|
};
|
|
11866
12017
|
case "redeem":
|
|
11867
12018
|
return {
|
|
11868
12019
|
direction: "redeem",
|
|
11869
|
-
position: await coinlist.centrifuge.
|
|
12020
|
+
position: await coinlist.centrifuge.readRedeemPosition(params)
|
|
11870
12021
|
};
|
|
11871
12022
|
default: {
|
|
11872
12023
|
const exhaustive = request.direction;
|
|
@@ -11880,7 +12031,7 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11880
12031
|
async (batch, generation) => {
|
|
11881
12032
|
const issued = batch.map((request) => {
|
|
11882
12033
|
const seq = ++readSeqRef.current;
|
|
11883
|
-
latestReadRef.current.set(
|
|
12034
|
+
latestReadRef.current.set(requestKey(request), seq);
|
|
11884
12035
|
return seq;
|
|
11885
12036
|
});
|
|
11886
12037
|
const results = await Promise.allSettled(batch.map(fetchRead));
|
|
@@ -11888,11 +12039,11 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11888
12039
|
let firstFailure = null;
|
|
11889
12040
|
results.forEach((result, index) => {
|
|
11890
12041
|
const request = batch[index];
|
|
11891
|
-
if (latestReadRef.current.get(
|
|
12042
|
+
if (latestReadRef.current.get(requestKey(request)) !== issued[index]) {
|
|
11892
12043
|
return;
|
|
11893
12044
|
}
|
|
11894
12045
|
if (result.status === "fulfilled") {
|
|
11895
|
-
readsRef.current.set(
|
|
12046
|
+
readsRef.current.set(requestKey(request), result.value);
|
|
11896
12047
|
return;
|
|
11897
12048
|
}
|
|
11898
12049
|
firstFailure ?? (firstFailure = result.reason);
|
|
@@ -11901,7 +12052,7 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11901
12052
|
msg: "position read failed",
|
|
11902
12053
|
fields: {
|
|
11903
12054
|
direction: request.direction,
|
|
11904
|
-
chain: request.chain,
|
|
12055
|
+
chain: request.vault.chain,
|
|
11905
12056
|
reason: centrifugeLoadErrorReason(result.reason)
|
|
11906
12057
|
}
|
|
11907
12058
|
}),
|
|
@@ -11924,7 +12075,7 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11924
12075
|
useEffect23(() => {
|
|
11925
12076
|
if (!isReady || !enabled || !visible) return;
|
|
11926
12077
|
const generation = ++generationRef.current;
|
|
11927
|
-
const wanted = new Set(requests.map(
|
|
12078
|
+
const wanted = new Set(requests.map(requestKey));
|
|
11928
12079
|
for (const key2 of readsRef.current.keys()) {
|
|
11929
12080
|
if (!wanted.has(key2)) readsRef.current.delete(key2);
|
|
11930
12081
|
}
|
|
@@ -11940,7 +12091,7 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11940
12091
|
if (!isReady || !enabled || !visible) return;
|
|
11941
12092
|
const interval = setInterval(() => {
|
|
11942
12093
|
const pending = requests.filter((request) => {
|
|
11943
|
-
const read = readsRef.current.get(
|
|
12094
|
+
const read = readsRef.current.get(requestKey(request));
|
|
11944
12095
|
return read !== void 0 && read.position.pending.raw > 0n;
|
|
11945
12096
|
});
|
|
11946
12097
|
if (pending.length > 0) void load(pending, generationRef.current);
|
|
@@ -11958,28 +12109,36 @@ function useCentrifugeVaultPositions(options) {
|
|
|
11958
12109
|
function readRequests(vaults, walletAddresses) {
|
|
11959
12110
|
return walletAddresses.flatMap(
|
|
11960
12111
|
(walletAddress) => vaults.flatMap(
|
|
11961
|
-
(vault) => DIRECTIONS.map((direction) => ({
|
|
12112
|
+
(vault) => DIRECTIONS.map((direction) => ({ vault, walletAddress, direction }))
|
|
11962
12113
|
)
|
|
11963
12114
|
);
|
|
11964
12115
|
}
|
|
11965
12116
|
function requestsKey(vaults, walletAddresses) {
|
|
11966
|
-
return readRequests(vaults, walletAddresses).map(
|
|
12117
|
+
return readRequests(vaults, walletAddresses).map(requestKey).join("|");
|
|
11967
12118
|
}
|
|
11968
|
-
function readKey(
|
|
12119
|
+
function readKey(key) {
|
|
11969
12120
|
return [
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
12121
|
+
key.direction,
|
|
12122
|
+
key.chain,
|
|
12123
|
+
key.proxy.toLowerCase(),
|
|
12124
|
+
key.walletAddress.toLowerCase()
|
|
11974
12125
|
].join(":");
|
|
11975
12126
|
}
|
|
11976
|
-
function
|
|
11977
|
-
return {
|
|
11978
|
-
direction:
|
|
11979
|
-
chain:
|
|
11980
|
-
|
|
11981
|
-
walletAddress:
|
|
11982
|
-
};
|
|
12127
|
+
function requestKey(request) {
|
|
12128
|
+
return readKey({
|
|
12129
|
+
direction: request.direction,
|
|
12130
|
+
chain: request.vault.chain,
|
|
12131
|
+
proxy: request.vault.proxy,
|
|
12132
|
+
walletAddress: request.walletAddress
|
|
12133
|
+
});
|
|
12134
|
+
}
|
|
12135
|
+
function legKey(leg) {
|
|
12136
|
+
return readKey({
|
|
12137
|
+
direction: leg.direction,
|
|
12138
|
+
chain: leg.position.chain,
|
|
12139
|
+
proxy: leg.position.proxy,
|
|
12140
|
+
walletAddress: leg.position.walletAddress
|
|
12141
|
+
});
|
|
11983
12142
|
}
|
|
11984
12143
|
function contentOf(readsRef) {
|
|
11985
12144
|
return { type: "CONTENT", legs: [...readsRef.current.values()] };
|
|
@@ -12088,13 +12247,11 @@ function useCentrifugeVaultClaimViewModel({
|
|
|
12088
12247
|
const walletList = WalletSelection.all(wallets);
|
|
12089
12248
|
const registry = useTokenRegistry({ enabled });
|
|
12090
12249
|
const vaults = useCentrifugeVaults(offer, registry.state);
|
|
12091
|
-
const
|
|
12092
|
-
|
|
12093
|
-
symbol: vault.share.symbol
|
|
12094
|
-
}));
|
|
12250
|
+
const symbol = centrifugeShareSymbol(offer);
|
|
12251
|
+
const keyedVaults = vaults.map((vault) => ({ chain: vault.chain, symbol }));
|
|
12095
12252
|
const vaultsReady = enabled && registry.state.type === "CONTENT";
|
|
12096
|
-
const positions =
|
|
12097
|
-
vaults
|
|
12253
|
+
const positions = useCentrifugeClaimPositions({
|
|
12254
|
+
vaults,
|
|
12098
12255
|
walletAddresses: walletList.map((wallet) => wallet.address),
|
|
12099
12256
|
pollIntervalMs,
|
|
12100
12257
|
enabled: vaultsReady
|
|
@@ -12158,7 +12315,7 @@ function useCentrifugeVaultClaimViewModel({
|
|
|
12158
12315
|
const wallet = walletList.find(
|
|
12159
12316
|
(w) => w.address.toLowerCase() === leg?.position.walletAddress.toLowerCase()
|
|
12160
12317
|
);
|
|
12161
|
-
if (leg === void 0 || vault === void 0 || wallet === void 0 ||
|
|
12318
|
+
if (leg === void 0 || vault === void 0 || wallet === void 0 || leg.position.claimable.raw === 0n || claimsInFlight.has(legId)) {
|
|
12162
12319
|
return;
|
|
12163
12320
|
}
|
|
12164
12321
|
void executeClaim({ leg, vault, wallet });
|
|
@@ -12170,7 +12327,7 @@ function useCentrifugeVaultClaimViewModel({
|
|
|
12170
12327
|
const result = await claimHook.claim({
|
|
12171
12328
|
wallet: active.wallet,
|
|
12172
12329
|
chain: active.vault.chain,
|
|
12173
|
-
symbol
|
|
12330
|
+
symbol,
|
|
12174
12331
|
direction: active.leg.direction
|
|
12175
12332
|
}).finally(
|
|
12176
12333
|
() => setClaimsInFlight((ids) => removeClaimInFlight(ids, legId))
|
|
@@ -12254,7 +12411,7 @@ function ClaimContainer({
|
|
|
12254
12411
|
offer,
|
|
12255
12412
|
wallets,
|
|
12256
12413
|
walletLabel: walletLabel2,
|
|
12257
|
-
config,
|
|
12414
|
+
config = {},
|
|
12258
12415
|
enabled = true,
|
|
12259
12416
|
className
|
|
12260
12417
|
}) {
|
|
@@ -12265,7 +12422,7 @@ function ClaimContainer({
|
|
|
12265
12422
|
offer: vaultOffer,
|
|
12266
12423
|
wallets,
|
|
12267
12424
|
walletLabel: walletLabel2,
|
|
12268
|
-
onClaimed: config["centrifuge::vault"]
|
|
12425
|
+
onClaimed: config["centrifuge::vault"]?.onClaimed,
|
|
12269
12426
|
enabled,
|
|
12270
12427
|
className
|
|
12271
12428
|
}
|
|
@@ -12283,6 +12440,9 @@ function renderOffer2(offer, branches) {
|
|
|
12283
12440
|
}
|
|
12284
12441
|
}
|
|
12285
12442
|
|
|
12443
|
+
// src/client/components/offers/shared/OfferSaleCard.tsx
|
|
12444
|
+
import { ArrowRight } from "lucide-react";
|
|
12445
|
+
|
|
12286
12446
|
// src/client/components/design-system/ThemedImage.tsx
|
|
12287
12447
|
import { Fragment as Fragment11, jsx as jsx73, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
12288
12448
|
function ThemedImage({
|
|
@@ -12342,182 +12502,71 @@ function onOfferCardKeyDown(event, onClick) {
|
|
|
12342
12502
|
onClick();
|
|
12343
12503
|
}
|
|
12344
12504
|
|
|
12345
|
-
// src/client/components/offers/shared/
|
|
12505
|
+
// src/client/components/offers/shared/sale-card-status.ts
|
|
12506
|
+
function saleCardStatus({
|
|
12507
|
+
endsAt,
|
|
12508
|
+
secondsUntilStart,
|
|
12509
|
+
secondsLeft
|
|
12510
|
+
}) {
|
|
12511
|
+
if (secondsUntilStart !== null && secondsUntilStart > 0) {
|
|
12512
|
+
return {
|
|
12513
|
+
phase: "upcoming",
|
|
12514
|
+
label: formatSaleCardCountdown(secondsUntilStart)
|
|
12515
|
+
};
|
|
12516
|
+
}
|
|
12517
|
+
if (endsAt === null) {
|
|
12518
|
+
return { phase: "live", label: "Live" };
|
|
12519
|
+
}
|
|
12520
|
+
if (secondsLeft === null || secondsLeft <= 0) {
|
|
12521
|
+
return { phase: "ended", label: "Ended" };
|
|
12522
|
+
}
|
|
12523
|
+
return {
|
|
12524
|
+
phase: "live",
|
|
12525
|
+
label: formatSaleCardCountdown(secondsLeft)
|
|
12526
|
+
};
|
|
12527
|
+
}
|
|
12528
|
+
|
|
12529
|
+
// src/client/components/offers/shared/OfferSaleCard.tsx
|
|
12346
12530
|
import { jsx as jsx74, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
12347
|
-
var
|
|
12348
|
-
|
|
12531
|
+
var HEADER_LOGO_SIZES = "(min-width: 768px) 36px, 32px";
|
|
12532
|
+
var WATERMARK_SIZES = "(min-width: 768px) 20rem, 15rem";
|
|
12533
|
+
function OfferSaleCard({
|
|
12349
12534
|
offer,
|
|
12350
12535
|
onClick,
|
|
12351
12536
|
className,
|
|
12352
12537
|
containerClassName
|
|
12353
12538
|
}) {
|
|
12539
|
+
const secondsUntilStart = useCountdown({ until: offer.startsAt });
|
|
12540
|
+
const secondsLeft = useCountdown({ until: offer.endsAt });
|
|
12541
|
+
const status = saleCardStatus({
|
|
12542
|
+
endsAt: offer.endsAt,
|
|
12543
|
+
secondsUntilStart,
|
|
12544
|
+
secondsLeft
|
|
12545
|
+
});
|
|
12354
12546
|
const interactive = onClick !== void 0;
|
|
12355
|
-
const
|
|
12547
|
+
const logo = offer.logo ? offer.logo.dark ?? offer.logo.light : null;
|
|
12548
|
+
const card = /* @__PURE__ */ jsxs50(
|
|
12356
12549
|
"article",
|
|
12357
12550
|
{
|
|
12358
12551
|
className: cn(
|
|
12359
|
-
"clcosdk:relative clcosdk:flex clcosdk:w-full clcosdk:
|
|
12360
|
-
"clcosdk:md:rounded-
|
|
12361
|
-
interactive && "clcosdk:cursor-pointer clcosdk:transition-transform clcosdk:duration-300 clcosdk:ease-out clcosdk:hover:scale-[1.02] clcosdk:focus-visible:ring-2 clcosdk:focus-visible:ring-
|
|
12552
|
+
"clcosdk:relative clcosdk:flex clcosdk:h-full clcosdk:w-full clcosdk:flex-col clcosdk:gap-4 clcosdk:overflow-hidden clcosdk:rounded-[28px] clcosdk:border-2 clcosdk:border-sale-card-border clcosdk:bg-[image:var(--sale-card-surface)] clcosdk:p-5 clcosdk:shadow-[0px_4px_12px_0px_rgba(0,0,0,0.08),0px_12px_28px_0px_rgba(0,0,0,0.13)]",
|
|
12553
|
+
"clcosdk:md:gap-6 clcosdk:md:rounded-[40px] clcosdk:md:p-8",
|
|
12554
|
+
interactive && "clcosdk:group clcosdk:cursor-pointer clcosdk:transition-transform clcosdk:duration-300 clcosdk:ease-out clcosdk:hover:scale-[1.02] clcosdk:focus-visible:ring-2 clcosdk:focus-visible:ring-sale-card-focus-ring clcosdk:focus-visible:ring-offset-2 clcosdk:focus-visible:outline-none clcosdk:max-md:hover:scale-100",
|
|
12362
12555
|
className
|
|
12363
12556
|
),
|
|
12364
|
-
"aria-label": interactive ? cardActionLabel(offer) : void 0,
|
|
12557
|
+
"aria-label": interactive ? cardActionLabel(offer, status.phase) : void 0,
|
|
12365
12558
|
role: interactive ? "button" : void 0,
|
|
12366
12559
|
tabIndex: interactive ? 0 : void 0,
|
|
12367
12560
|
onClick,
|
|
12368
12561
|
onKeyDown: interactive ? (event) => onOfferCardKeyDown(event, onClick) : void 0,
|
|
12369
|
-
children:
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
{
|
|
12373
|
-
light: offer.logo.light,
|
|
12374
|
-
dark: offer.logo.dark ?? void 0,
|
|
12375
|
-
sizes: LOGO_SIZES,
|
|
12376
|
-
alt: "",
|
|
12377
|
-
width: 48,
|
|
12378
|
-
height: 48,
|
|
12379
|
-
className: "clcosdk:size-full clcosdk:object-cover",
|
|
12380
|
-
style: { maxWidth: "none", width: "100%", height: "100%" }
|
|
12381
|
-
}
|
|
12382
|
-
) }) : null,
|
|
12383
|
-
/* @__PURE__ */ jsxs50("div", { className: "clcosdk:flex clcosdk:min-w-0 clcosdk:flex-1 clcosdk:flex-col clcosdk:items-start clcosdk:justify-center", children: [
|
|
12384
|
-
offer.name ? /* @__PURE__ */ jsx74(
|
|
12385
|
-
"h2",
|
|
12386
|
-
{
|
|
12387
|
-
className: cn(
|
|
12388
|
-
"clcosdk:w-full clcosdk:truncate clcosdk:text-[16px] clcosdk:leading-[140%] clcosdk:font-medium clcosdk:text-text-primary clcosdk:md:text-[18px]"
|
|
12389
|
-
),
|
|
12390
|
-
children: offer.name
|
|
12391
|
-
}
|
|
12392
|
-
) : null,
|
|
12393
|
-
offer.symbol ? /* @__PURE__ */ jsx74("p", { className: "clcosdk:w-full clcosdk:truncate clcosdk:text-[13px] clcosdk:leading-[150%] clcosdk:font-normal clcosdk:text-text-secondary clcosdk:md:text-[14px]", children: offer.symbol }) : null
|
|
12394
|
-
] })
|
|
12395
|
-
] })
|
|
12396
|
-
}
|
|
12397
|
-
);
|
|
12398
|
-
const wrapped = containerClassName ? /* @__PURE__ */ jsx74("div", { className: containerClassName, children: card }) : card;
|
|
12399
|
-
return /* @__PURE__ */ jsx74(CoinListStyleScope, { children: wrapped });
|
|
12400
|
-
}
|
|
12401
|
-
function cardActionLabel(offer) {
|
|
12402
|
-
const parts = [offer.name, offer.symbol].filter(Boolean);
|
|
12403
|
-
return parts.length > 0 ? parts.join(", ") : "View offer";
|
|
12404
|
-
}
|
|
12405
|
-
|
|
12406
|
-
// src/client/components/offers/grid/OffersAssetGrid.tsx
|
|
12407
|
-
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
12408
|
-
var DEFAULT_MAX_COLUMNS = 3;
|
|
12409
|
-
function OffersAssetGrid({
|
|
12410
|
-
offers,
|
|
12411
|
-
onOfferClick,
|
|
12412
|
-
maxColumns,
|
|
12413
|
-
className,
|
|
12414
|
-
containerClassName
|
|
12415
|
-
}) {
|
|
12416
|
-
const cols = Math.min(
|
|
12417
|
-
DEFAULT_MAX_COLUMNS,
|
|
12418
|
-
Math.max(1, maxColumns ?? DEFAULT_MAX_COLUMNS)
|
|
12419
|
-
);
|
|
12420
|
-
const maxGridWidth = `calc(${cols} * 20rem + ${Math.max(cols - 1, 0)} * 1.5rem)`;
|
|
12421
|
-
const interactive = onOfferClick !== void 0;
|
|
12422
|
-
return /* @__PURE__ */ jsx75(CoinListStyleScope, { children: /* @__PURE__ */ jsx75(
|
|
12423
|
-
"div",
|
|
12424
|
-
{
|
|
12425
|
-
className: cn(
|
|
12426
|
-
"clcosdk:flex clcosdk:w-full clcosdk:justify-center",
|
|
12427
|
-
containerClassName
|
|
12428
|
-
),
|
|
12429
|
-
children: /* @__PURE__ */ jsx75(
|
|
12430
|
-
"div",
|
|
12431
|
-
{
|
|
12432
|
-
className: cn(
|
|
12433
|
-
"clcosdk:grid clcosdk:w-full clcosdk:grid-cols-1 clcosdk:gap-4 clcosdk:md:gap-6",
|
|
12434
|
-
cols >= 2 && "clcosdk:sm:grid-cols-2",
|
|
12435
|
-
cols >= 3 && "clcosdk:md:grid-cols-3",
|
|
12436
|
-
className
|
|
12437
|
-
),
|
|
12438
|
-
style: { maxWidth: maxGridWidth },
|
|
12439
|
-
children: offers.map((offer) => /* @__PURE__ */ jsx75(
|
|
12440
|
-
OfferAssetCard,
|
|
12441
|
-
{
|
|
12442
|
-
offer,
|
|
12443
|
-
onClick: interactive ? () => onOfferClick(offer.id) : void 0
|
|
12444
|
-
},
|
|
12445
|
-
offer.id
|
|
12446
|
-
))
|
|
12447
|
-
}
|
|
12448
|
-
)
|
|
12449
|
-
}
|
|
12450
|
-
) });
|
|
12451
|
-
}
|
|
12452
|
-
|
|
12453
|
-
// src/client/components/offers/shared/OfferSaleCard.tsx
|
|
12454
|
-
import { ArrowRight } from "lucide-react";
|
|
12455
|
-
|
|
12456
|
-
// src/client/components/offers/shared/sale-card-status.ts
|
|
12457
|
-
function saleCardStatus({
|
|
12458
|
-
endsAt,
|
|
12459
|
-
secondsUntilStart,
|
|
12460
|
-
secondsLeft
|
|
12461
|
-
}) {
|
|
12462
|
-
if (secondsUntilStart !== null && secondsUntilStart > 0) {
|
|
12463
|
-
return {
|
|
12464
|
-
phase: "upcoming",
|
|
12465
|
-
label: formatSaleCardCountdown(secondsUntilStart)
|
|
12466
|
-
};
|
|
12467
|
-
}
|
|
12468
|
-
if (endsAt === null) {
|
|
12469
|
-
return { phase: "live", label: "Live" };
|
|
12470
|
-
}
|
|
12471
|
-
if (secondsLeft === null || secondsLeft <= 0) {
|
|
12472
|
-
return { phase: "ended", label: "Ended" };
|
|
12473
|
-
}
|
|
12474
|
-
return {
|
|
12475
|
-
phase: "live",
|
|
12476
|
-
label: formatSaleCardCountdown(secondsLeft)
|
|
12477
|
-
};
|
|
12478
|
-
}
|
|
12479
|
-
|
|
12480
|
-
// src/client/components/offers/shared/OfferSaleCard.tsx
|
|
12481
|
-
import { jsx as jsx76, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
12482
|
-
var HEADER_LOGO_SIZES = "(min-width: 768px) 36px, 32px";
|
|
12483
|
-
var WATERMARK_SIZES = "(min-width: 768px) 20rem, 15rem";
|
|
12484
|
-
function OfferSaleCard({
|
|
12485
|
-
offer,
|
|
12486
|
-
onClick,
|
|
12487
|
-
className,
|
|
12488
|
-
containerClassName
|
|
12489
|
-
}) {
|
|
12490
|
-
const secondsUntilStart = useCountdown({ until: offer.startsAt });
|
|
12491
|
-
const secondsLeft = useCountdown({ until: offer.endsAt });
|
|
12492
|
-
const status = saleCardStatus({
|
|
12493
|
-
endsAt: offer.endsAt,
|
|
12494
|
-
secondsUntilStart,
|
|
12495
|
-
secondsLeft
|
|
12496
|
-
});
|
|
12497
|
-
const interactive = onClick !== void 0;
|
|
12498
|
-
const logo = offer.logo ? offer.logo.dark ?? offer.logo.light : null;
|
|
12499
|
-
const card = /* @__PURE__ */ jsxs51(
|
|
12500
|
-
"article",
|
|
12501
|
-
{
|
|
12502
|
-
className: cn(
|
|
12503
|
-
"clcosdk:relative clcosdk:flex clcosdk:h-full clcosdk:w-full clcosdk:flex-col clcosdk:gap-4 clcosdk:overflow-hidden clcosdk:rounded-[28px] clcosdk:border-2 clcosdk:border-sale-card-border clcosdk:bg-[image:var(--sale-card-surface)] clcosdk:p-5 clcosdk:shadow-[0px_4px_12px_0px_rgba(0,0,0,0.08),0px_12px_28px_0px_rgba(0,0,0,0.13)]",
|
|
12504
|
-
"clcosdk:md:gap-6 clcosdk:md:rounded-[40px] clcosdk:md:p-8",
|
|
12505
|
-
interactive && "clcosdk:group clcosdk:cursor-pointer clcosdk:transition-transform clcosdk:duration-300 clcosdk:ease-out clcosdk:hover:scale-[1.02] clcosdk:focus-visible:ring-2 clcosdk:focus-visible:ring-sale-card-focus-ring clcosdk:focus-visible:ring-offset-2 clcosdk:focus-visible:outline-none clcosdk:max-md:hover:scale-100",
|
|
12506
|
-
className
|
|
12507
|
-
),
|
|
12508
|
-
"aria-label": interactive ? cardActionLabel2(offer, status.phase) : void 0,
|
|
12509
|
-
role: interactive ? "button" : void 0,
|
|
12510
|
-
tabIndex: interactive ? 0 : void 0,
|
|
12511
|
-
onClick,
|
|
12512
|
-
onKeyDown: interactive ? (event) => onOfferCardKeyDown(event, onClick) : void 0,
|
|
12513
|
-
children: [
|
|
12514
|
-
logo ? /* @__PURE__ */ jsx76(
|
|
12515
|
-
"div",
|
|
12562
|
+
children: [
|
|
12563
|
+
logo ? /* @__PURE__ */ jsx74(
|
|
12564
|
+
"div",
|
|
12516
12565
|
{
|
|
12517
12566
|
"aria-hidden": "true",
|
|
12518
12567
|
className: "clcosdk:pointer-events-none clcosdk:absolute clcosdk:top-1/2 clcosdk:right-[-14%] clcosdk:z-0 clcosdk:size-[15rem] clcosdk:-translate-y-1/2 clcosdk:md:right-[-10%] clcosdk:md:size-[20rem]",
|
|
12519
12568
|
style: { mixBlendMode: "overlay" },
|
|
12520
|
-
children: /* @__PURE__ */
|
|
12569
|
+
children: /* @__PURE__ */ jsx74(
|
|
12521
12570
|
ThemedImage,
|
|
12522
12571
|
{
|
|
12523
12572
|
light: logo,
|
|
@@ -12529,9 +12578,9 @@ function OfferSaleCard({
|
|
|
12529
12578
|
)
|
|
12530
12579
|
}
|
|
12531
12580
|
) : null,
|
|
12532
|
-
/* @__PURE__ */
|
|
12533
|
-
/* @__PURE__ */
|
|
12534
|
-
logo ? /* @__PURE__ */
|
|
12581
|
+
/* @__PURE__ */ jsxs50("div", { className: "clcosdk:relative clcosdk:z-10 clcosdk:flex clcosdk:flex-col clcosdk:gap-2 clcosdk:md:gap-3", children: [
|
|
12582
|
+
/* @__PURE__ */ jsxs50("div", { className: "clcosdk:flex clcosdk:min-w-0 clcosdk:items-center clcosdk:gap-2.5 clcosdk:md:gap-3", children: [
|
|
12583
|
+
logo ? /* @__PURE__ */ jsx74("div", { className: "clcosdk:h-8 clcosdk:w-8 clcosdk:shrink-0 clcosdk:overflow-hidden clcosdk:rounded-full clcosdk:md:h-9 clcosdk:md:w-9", children: /* @__PURE__ */ jsx74(
|
|
12535
12584
|
ThemedImage,
|
|
12536
12585
|
{
|
|
12537
12586
|
light: logo,
|
|
@@ -12543,7 +12592,7 @@ function OfferSaleCard({
|
|
|
12543
12592
|
style: { maxWidth: "none", width: "100%", height: "100%" }
|
|
12544
12593
|
}
|
|
12545
12594
|
) }) : null,
|
|
12546
|
-
offer.name ? /* @__PURE__ */
|
|
12595
|
+
offer.name ? /* @__PURE__ */ jsx74(
|
|
12547
12596
|
"h2",
|
|
12548
12597
|
{
|
|
12549
12598
|
className: cn(
|
|
@@ -12553,7 +12602,7 @@ function OfferSaleCard({
|
|
|
12553
12602
|
}
|
|
12554
12603
|
) : null
|
|
12555
12604
|
] }),
|
|
12556
|
-
offer.tagline ? /* @__PURE__ */
|
|
12605
|
+
offer.tagline ? /* @__PURE__ */ jsx74(
|
|
12557
12606
|
"p",
|
|
12558
12607
|
{
|
|
12559
12608
|
className: cn(
|
|
@@ -12564,20 +12613,20 @@ function OfferSaleCard({
|
|
|
12564
12613
|
}
|
|
12565
12614
|
) : null
|
|
12566
12615
|
] }),
|
|
12567
|
-
/* @__PURE__ */
|
|
12568
|
-
/* @__PURE__ */
|
|
12569
|
-
status.phase === "live" ? /* @__PURE__ */
|
|
12616
|
+
/* @__PURE__ */ jsxs50("div", { className: "clcosdk:relative clcosdk:z-10 clcosdk:mt-auto clcosdk:flex clcosdk:h-11 clcosdk:w-full clcosdk:min-w-0 clcosdk:items-center clcosdk:justify-between clcosdk:gap-2 clcosdk:rounded-full clcosdk:border clcosdk:border-sale-card-chrome-border clcosdk:bg-sale-card-chrome-bg clcosdk:py-1.5 clcosdk:pr-1.5 clcosdk:pl-3 clcosdk:md:h-[54px] clcosdk:md:gap-3 clcosdk:md:py-2 clcosdk:md:pr-2 clcosdk:md:pl-4", children: [
|
|
12617
|
+
/* @__PURE__ */ jsxs50("div", { className: "clcosdk:flex clcosdk:min-w-0 clcosdk:items-center clcosdk:gap-2 clcosdk:md:gap-3", children: [
|
|
12618
|
+
status.phase === "live" ? /* @__PURE__ */ jsxs50(
|
|
12570
12619
|
"span",
|
|
12571
12620
|
{
|
|
12572
12621
|
className: "clcosdk:relative clcosdk:inline-flex clcosdk:size-2 clcosdk:shrink-0",
|
|
12573
12622
|
"aria-hidden": "true",
|
|
12574
12623
|
children: [
|
|
12575
|
-
/* @__PURE__ */
|
|
12576
|
-
/* @__PURE__ */
|
|
12624
|
+
/* @__PURE__ */ jsx74("span", { className: "clcosdk-status-dot-ping clcosdk:absolute clcosdk:inset-0 clcosdk:rounded-full clcosdk:bg-positive" }),
|
|
12625
|
+
/* @__PURE__ */ jsx74("span", { className: "clcosdk:relative clcosdk:inline-flex clcosdk:size-full clcosdk:rounded-full clcosdk:bg-positive" })
|
|
12577
12626
|
]
|
|
12578
12627
|
}
|
|
12579
12628
|
) : null,
|
|
12580
|
-
/* @__PURE__ */
|
|
12629
|
+
/* @__PURE__ */ jsx74(
|
|
12581
12630
|
"p",
|
|
12582
12631
|
{
|
|
12583
12632
|
className: cn(
|
|
@@ -12588,7 +12637,7 @@ function OfferSaleCard({
|
|
|
12588
12637
|
}
|
|
12589
12638
|
)
|
|
12590
12639
|
] }),
|
|
12591
|
-
/* @__PURE__ */
|
|
12640
|
+
/* @__PURE__ */ jsxs50(
|
|
12592
12641
|
"span",
|
|
12593
12642
|
{
|
|
12594
12643
|
className: cn(
|
|
@@ -12598,8 +12647,8 @@ function OfferSaleCard({
|
|
|
12598
12647
|
"aria-hidden": "true",
|
|
12599
12648
|
children: [
|
|
12600
12649
|
"View",
|
|
12601
|
-
/* @__PURE__ */
|
|
12602
|
-
/* @__PURE__ */
|
|
12650
|
+
/* @__PURE__ */ jsx74("span", { className: "clcosdk:max-md:hidden", children: " offer" }),
|
|
12651
|
+
/* @__PURE__ */ jsx74(ArrowRight, { className: "clcosdk:size-4", "aria-hidden": true })
|
|
12603
12652
|
]
|
|
12604
12653
|
}
|
|
12605
12654
|
)
|
|
@@ -12607,24 +12656,24 @@ function OfferSaleCard({
|
|
|
12607
12656
|
]
|
|
12608
12657
|
}
|
|
12609
12658
|
);
|
|
12610
|
-
const wrapped = containerClassName ? /* @__PURE__ */
|
|
12611
|
-
return /* @__PURE__ */
|
|
12659
|
+
const wrapped = containerClassName ? /* @__PURE__ */ jsx74("div", { className: containerClassName, children: card }) : card;
|
|
12660
|
+
return /* @__PURE__ */ jsx74(CoinListStyleScope, { children: wrapped });
|
|
12612
12661
|
}
|
|
12613
12662
|
var SALE_PHASE_LABEL = {
|
|
12614
12663
|
upcoming: "Upcoming",
|
|
12615
12664
|
live: "Live",
|
|
12616
12665
|
ended: "Ended"
|
|
12617
12666
|
};
|
|
12618
|
-
function
|
|
12667
|
+
function cardActionLabel(offer, phase) {
|
|
12619
12668
|
const title2 = offer.name || offer.tagline;
|
|
12620
12669
|
return [title2, SALE_PHASE_LABEL[phase], "View offer"].filter(Boolean).join(". ");
|
|
12621
12670
|
}
|
|
12622
12671
|
|
|
12623
12672
|
// src/client/components/offers/grid/OffersGridView.tsx
|
|
12624
|
-
import { jsx as
|
|
12625
|
-
var
|
|
12673
|
+
import { jsx as jsx75, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
12674
|
+
var DEFAULT_MAX_COLUMNS = 2;
|
|
12626
12675
|
function OffersGridView(props) {
|
|
12627
|
-
return /* @__PURE__ */
|
|
12676
|
+
return /* @__PURE__ */ jsx75(CoinListStyleScope, { children: /* @__PURE__ */ jsx75(OffersGridViewBody, { ...props }) });
|
|
12628
12677
|
}
|
|
12629
12678
|
function OffersGridViewBody({
|
|
12630
12679
|
state,
|
|
@@ -12638,13 +12687,13 @@ function OffersGridViewBody({
|
|
|
12638
12687
|
}) {
|
|
12639
12688
|
switch (state.type) {
|
|
12640
12689
|
case "loading":
|
|
12641
|
-
return loading ?? /* @__PURE__ */
|
|
12690
|
+
return loading ?? /* @__PURE__ */ jsx75(LoadingState, {});
|
|
12642
12691
|
case "error":
|
|
12643
|
-
return error ?? /* @__PURE__ */
|
|
12692
|
+
return error ?? /* @__PURE__ */ jsx75(ErrorState, { message: state.message });
|
|
12644
12693
|
case "empty":
|
|
12645
|
-
return emptyState ?? /* @__PURE__ */
|
|
12694
|
+
return emptyState ?? /* @__PURE__ */ jsx75(EmptyState, {});
|
|
12646
12695
|
case "content":
|
|
12647
|
-
return /* @__PURE__ */
|
|
12696
|
+
return /* @__PURE__ */ jsx75(
|
|
12648
12697
|
OffersGridContent,
|
|
12649
12698
|
{
|
|
12650
12699
|
offers: state.offers,
|
|
@@ -12670,18 +12719,18 @@ function OffersGridContent({
|
|
|
12670
12719
|
containerClassName
|
|
12671
12720
|
}) {
|
|
12672
12721
|
const cols = Math.min(
|
|
12673
|
-
|
|
12674
|
-
Math.max(1, maxColumns ??
|
|
12722
|
+
DEFAULT_MAX_COLUMNS,
|
|
12723
|
+
Math.max(1, maxColumns ?? DEFAULT_MAX_COLUMNS)
|
|
12675
12724
|
);
|
|
12676
12725
|
const maxGridWidth = `calc(${cols} * 28rem + ${Math.max(cols - 1, 0)} * 1.5rem)`;
|
|
12677
|
-
return /* @__PURE__ */
|
|
12726
|
+
return /* @__PURE__ */ jsx75(
|
|
12678
12727
|
"div",
|
|
12679
12728
|
{
|
|
12680
12729
|
className: cn(
|
|
12681
12730
|
"clcosdk:flex clcosdk:w-full clcosdk:justify-center",
|
|
12682
12731
|
containerClassName
|
|
12683
12732
|
),
|
|
12684
|
-
children: /* @__PURE__ */
|
|
12733
|
+
children: /* @__PURE__ */ jsx75(
|
|
12685
12734
|
"div",
|
|
12686
12735
|
{
|
|
12687
12736
|
className: cn(
|
|
@@ -12690,7 +12739,7 @@ function OffersGridContent({
|
|
|
12690
12739
|
className
|
|
12691
12740
|
),
|
|
12692
12741
|
style: { maxWidth: maxGridWidth },
|
|
12693
|
-
children: offers.map((offer) => /* @__PURE__ */
|
|
12742
|
+
children: offers.map((offer) => /* @__PURE__ */ jsx75(
|
|
12694
12743
|
OfferSaleCard,
|
|
12695
12744
|
{
|
|
12696
12745
|
offer,
|
|
@@ -12704,17 +12753,17 @@ function OffersGridContent({
|
|
|
12704
12753
|
);
|
|
12705
12754
|
}
|
|
12706
12755
|
function LoadingState() {
|
|
12707
|
-
return /* @__PURE__ */
|
|
12756
|
+
return /* @__PURE__ */ jsx75(
|
|
12708
12757
|
"output",
|
|
12709
12758
|
{
|
|
12710
12759
|
"aria-live": "polite",
|
|
12711
12760
|
className: "clcosdk:flex clcosdk:min-h-40 clcosdk:items-center clcosdk:justify-center clcosdk:rounded-2xl clcosdk:border clcosdk:border-border clcosdk:bg-background clcosdk:p-6",
|
|
12712
|
-
children: /* @__PURE__ */
|
|
12761
|
+
children: /* @__PURE__ */ jsx75("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: "Loading offers..." })
|
|
12713
12762
|
}
|
|
12714
12763
|
);
|
|
12715
12764
|
}
|
|
12716
12765
|
function ErrorState({ message }) {
|
|
12717
|
-
return /* @__PURE__ */
|
|
12766
|
+
return /* @__PURE__ */ jsx75(
|
|
12718
12767
|
AlertBanner,
|
|
12719
12768
|
{
|
|
12720
12769
|
variant: "error",
|
|
@@ -12725,13 +12774,13 @@ function ErrorState({ message }) {
|
|
|
12725
12774
|
);
|
|
12726
12775
|
}
|
|
12727
12776
|
function EmptyState() {
|
|
12728
|
-
return /* @__PURE__ */
|
|
12777
|
+
return /* @__PURE__ */ jsxs51(
|
|
12729
12778
|
"output",
|
|
12730
12779
|
{
|
|
12731
12780
|
"aria-live": "polite",
|
|
12732
12781
|
className: "clcosdk:flex clcosdk:min-h-40 clcosdk:flex-col clcosdk:items-center clcosdk:justify-center clcosdk:gap-2 clcosdk:rounded-2xl clcosdk:border clcosdk:border-border clcosdk:bg-background clcosdk:p-6 clcosdk:text-center",
|
|
12733
12782
|
children: [
|
|
12734
|
-
/* @__PURE__ */
|
|
12783
|
+
/* @__PURE__ */ jsx75(
|
|
12735
12784
|
"p",
|
|
12736
12785
|
{
|
|
12737
12786
|
className: cn(
|
|
@@ -12741,7 +12790,7 @@ function EmptyState() {
|
|
|
12741
12790
|
children: "No offers available"
|
|
12742
12791
|
}
|
|
12743
12792
|
),
|
|
12744
|
-
/* @__PURE__ */
|
|
12793
|
+
/* @__PURE__ */ jsx75("p", { className: cn(typeClasses.subhead, "clcosdk:text-text-secondary"), children: "Check back soon for upcoming opportunities." })
|
|
12745
12794
|
]
|
|
12746
12795
|
}
|
|
12747
12796
|
);
|
|
@@ -12947,7 +12996,7 @@ function toUiState(offersState, registryState, interactive) {
|
|
|
12947
12996
|
}
|
|
12948
12997
|
|
|
12949
12998
|
// src/client/components/offers/grid/OffersGridContainer.tsx
|
|
12950
|
-
import { jsx as
|
|
12999
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
12951
13000
|
function OffersGridContainer({
|
|
12952
13001
|
data,
|
|
12953
13002
|
onOfferClick,
|
|
@@ -12959,130 +13008,75 @@ function OffersGridContainer({
|
|
|
12959
13008
|
onOfferClick,
|
|
12960
13009
|
enabled
|
|
12961
13010
|
});
|
|
12962
|
-
return /* @__PURE__ */
|
|
13011
|
+
return /* @__PURE__ */ jsx76(OffersGridView, { state, onEvent, ...viewProps });
|
|
12963
13012
|
}
|
|
12964
13013
|
|
|
12965
|
-
// src/client/components/
|
|
12966
|
-
import {
|
|
12967
|
-
|
|
12968
|
-
function
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
const remove = async () => {
|
|
12974
|
-
if (!onRemove) return;
|
|
12975
|
-
setState("removing");
|
|
12976
|
-
try {
|
|
12977
|
-
await onRemove(wallet.id);
|
|
12978
|
-
setState("idle");
|
|
12979
|
-
} catch {
|
|
12980
|
-
setState("error");
|
|
12981
|
-
}
|
|
12982
|
-
};
|
|
12983
|
-
return /* @__PURE__ */ jsxs53("div", { className: "clcosdk:flex clcosdk:min-h-9 clcosdk:flex-wrap clcosdk:items-center clcosdk:justify-between clcosdk:gap-2", children: [
|
|
12984
|
-
/* @__PURE__ */ jsx79(
|
|
12985
|
-
"span",
|
|
12986
|
-
{
|
|
12987
|
-
title: wallet.address,
|
|
12988
|
-
className: cn(
|
|
12989
|
-
typeClasses.body,
|
|
12990
|
-
"clcosdk:font-mono clcosdk:text-text-primary"
|
|
12991
|
-
),
|
|
12992
|
-
children: wallet.shortAddress
|
|
12993
|
-
}
|
|
12994
|
-
),
|
|
12995
|
-
onRemove != null && (state === "confirming" ? /* @__PURE__ */ jsxs53("div", { className: "clcosdk:flex clcosdk:items-center clcosdk:gap-2", children: [
|
|
12996
|
-
/* @__PURE__ */ jsx79(
|
|
12997
|
-
"span",
|
|
12998
|
-
{
|
|
12999
|
-
className: cn(typeClasses.subhead, "clcosdk:text-text-secondary"),
|
|
13000
|
-
children: "Remove?"
|
|
13001
|
-
}
|
|
13002
|
-
),
|
|
13003
|
-
/* @__PURE__ */ jsx79(ClButton, { size: "sm", variant: "destructive", onClick: remove, children: "Remove" }),
|
|
13004
|
-
/* @__PURE__ */ jsx79(
|
|
13005
|
-
ClButton,
|
|
13006
|
-
{
|
|
13007
|
-
size: "sm",
|
|
13008
|
-
variant: "ghost",
|
|
13009
|
-
onClick: () => setState("idle"),
|
|
13010
|
-
children: "Cancel"
|
|
13011
|
-
}
|
|
13012
|
-
)
|
|
13013
|
-
] }) : state === "error" ? /* @__PURE__ */ jsxs53("div", { className: "clcosdk:flex clcosdk:items-center clcosdk:gap-2", children: [
|
|
13014
|
-
/* @__PURE__ */ jsx79("span", { className: cn(typeClasses.subhead, "clcosdk:text-error"), children: "Couldn't remove." }),
|
|
13015
|
-
/* @__PURE__ */ jsx79(
|
|
13016
|
-
ClButton,
|
|
13017
|
-
{
|
|
13018
|
-
size: "sm",
|
|
13019
|
-
variant: "destructiveLink",
|
|
13020
|
-
onClick: () => setState("confirming"),
|
|
13021
|
-
children: "Try again"
|
|
13022
|
-
}
|
|
13023
|
-
)
|
|
13024
|
-
] }) : /* @__PURE__ */ jsx79(
|
|
13025
|
-
ClButton,
|
|
13026
|
-
{
|
|
13027
|
-
size: "sm",
|
|
13028
|
-
variant: "destructiveLink",
|
|
13029
|
-
disabled: state === "removing",
|
|
13030
|
-
onClick: () => setState("confirming"),
|
|
13031
|
-
children: state === "removing" ? "Removing\u2026" : "Remove"
|
|
13032
|
-
}
|
|
13033
|
-
))
|
|
13034
|
-
] });
|
|
13035
|
-
}
|
|
13036
|
-
function ConnectedWalletList(props) {
|
|
13037
|
-
return /* @__PURE__ */ jsx79(CoinListStyleScope, { children: /* @__PURE__ */ jsx79(ConnectedWalletListBody, { ...props }) });
|
|
13038
|
-
}
|
|
13039
|
-
function ConnectedWalletListBody({
|
|
13040
|
-
wallets,
|
|
13041
|
-
onRemove,
|
|
13042
|
-
onAdd,
|
|
13043
|
-
addLabel = "Add wallet",
|
|
13044
|
-
status = "ready",
|
|
13045
|
-
className
|
|
13014
|
+
// src/client/components/offers/shared/OfferAssetCard.tsx
|
|
13015
|
+
import { jsx as jsx77, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
13016
|
+
var LOGO_SIZES = "(min-width: 768px) 48px, 40px";
|
|
13017
|
+
function OfferAssetCard({
|
|
13018
|
+
offer,
|
|
13019
|
+
onClick,
|
|
13020
|
+
className,
|
|
13021
|
+
containerClassName
|
|
13046
13022
|
}) {
|
|
13047
|
-
|
|
13048
|
-
|
|
13023
|
+
const interactive = onClick !== void 0;
|
|
13024
|
+
const card = /* @__PURE__ */ jsx77(
|
|
13025
|
+
"article",
|
|
13049
13026
|
{
|
|
13050
|
-
className: cn(
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
wallet.id
|
|
13065
|
-
)) }),
|
|
13066
|
-
onAdd != null && status !== "loading" && /* @__PURE__ */ jsx79(
|
|
13067
|
-
ClButton,
|
|
13027
|
+
className: cn(
|
|
13028
|
+
"clcosdk:relative clcosdk:flex clcosdk:w-full clcosdk:items-center clcosdk:rounded-[20px] clcosdk:border clcosdk:border-border clcosdk:bg-background clcosdk:p-3 clcosdk:shadow-[0px_1px_1px_0px_rgba(10,10,10,0.04),0px_8px_12px_0px_rgba(10,10,10,0.08)]",
|
|
13029
|
+
"clcosdk:md:rounded-card clcosdk:md:p-4",
|
|
13030
|
+
interactive && "clcosdk:cursor-pointer clcosdk:transition-transform clcosdk:duration-300 clcosdk:ease-out clcosdk:hover:scale-[1.02] clcosdk:focus-visible:ring-2 clcosdk:focus-visible:ring-gray-400 clcosdk:focus-visible:ring-offset-2 clcosdk:focus-visible:outline-none clcosdk:max-md:hover:scale-100",
|
|
13031
|
+
className
|
|
13032
|
+
),
|
|
13033
|
+
"aria-label": interactive ? cardActionLabel2(offer) : void 0,
|
|
13034
|
+
role: interactive ? "button" : void 0,
|
|
13035
|
+
tabIndex: interactive ? 0 : void 0,
|
|
13036
|
+
onClick,
|
|
13037
|
+
onKeyDown: interactive ? (event) => onOfferCardKeyDown(event, onClick) : void 0,
|
|
13038
|
+
children: /* @__PURE__ */ jsxs52("div", { className: "clcosdk:flex clcosdk:min-w-0 clcosdk:flex-1 clcosdk:items-center clcosdk:gap-2.5 clcosdk:pr-3 clcosdk:md:gap-3 clcosdk:md:pr-4", children: [
|
|
13039
|
+
offer.logo ? /* @__PURE__ */ jsx77("div", { className: "clcosdk:h-10 clcosdk:w-10 clcosdk:shrink-0 clcosdk:overflow-hidden clcosdk:rounded-full clcosdk:md:h-12 clcosdk:md:w-12", children: /* @__PURE__ */ jsx77(
|
|
13040
|
+
ThemedImage,
|
|
13068
13041
|
{
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13042
|
+
light: offer.logo.light,
|
|
13043
|
+
dark: offer.logo.dark ?? void 0,
|
|
13044
|
+
sizes: LOGO_SIZES,
|
|
13045
|
+
alt: "",
|
|
13046
|
+
width: 48,
|
|
13047
|
+
height: 48,
|
|
13048
|
+
className: "clcosdk:size-full clcosdk:object-cover",
|
|
13049
|
+
style: { maxWidth: "none", width: "100%", height: "100%" }
|
|
13074
13050
|
}
|
|
13075
|
-
)
|
|
13076
|
-
|
|
13051
|
+
) }) : null,
|
|
13052
|
+
/* @__PURE__ */ jsxs52("div", { className: "clcosdk:flex clcosdk:min-w-0 clcosdk:flex-1 clcosdk:flex-col clcosdk:items-start clcosdk:justify-center", children: [
|
|
13053
|
+
offer.name ? /* @__PURE__ */ jsx77(
|
|
13054
|
+
"h2",
|
|
13055
|
+
{
|
|
13056
|
+
className: cn(
|
|
13057
|
+
"clcosdk:w-full clcosdk:truncate clcosdk:text-[16px] clcosdk:leading-[140%] clcosdk:font-medium clcosdk:text-text-primary clcosdk:md:text-[18px]"
|
|
13058
|
+
),
|
|
13059
|
+
children: offer.name
|
|
13060
|
+
}
|
|
13061
|
+
) : null,
|
|
13062
|
+
offer.symbol ? /* @__PURE__ */ jsx77("p", { className: "clcosdk:w-full clcosdk:truncate clcosdk:text-[13px] clcosdk:leading-[150%] clcosdk:font-normal clcosdk:text-text-secondary clcosdk:md:text-[14px]", children: offer.symbol }) : null
|
|
13063
|
+
] })
|
|
13064
|
+
] })
|
|
13077
13065
|
}
|
|
13078
13066
|
);
|
|
13067
|
+
const wrapped = containerClassName ? /* @__PURE__ */ jsx77("div", { className: containerClassName, children: card }) : card;
|
|
13068
|
+
return /* @__PURE__ */ jsx77(CoinListStyleScope, { children: wrapped });
|
|
13069
|
+
}
|
|
13070
|
+
function cardActionLabel2(offer) {
|
|
13071
|
+
const parts = [offer.name, offer.symbol].filter(Boolean);
|
|
13072
|
+
return parts.length > 0 ? parts.join(", ") : "View offer";
|
|
13079
13073
|
}
|
|
13080
13074
|
|
|
13081
13075
|
// src/client/components/requirements/identity-verification/IdentityVerificationView.tsx
|
|
13082
13076
|
import SumsubWebSdk from "@sumsub/websdk-react";
|
|
13083
|
-
import { jsx as
|
|
13077
|
+
import { jsx as jsx78, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
13084
13078
|
function IdentityVerificationView(props) {
|
|
13085
|
-
return /* @__PURE__ */
|
|
13079
|
+
return /* @__PURE__ */ jsx78(CoinListStyleScope, { children: /* @__PURE__ */ jsx78(IdentityVerificationViewBody, { ...props }) });
|
|
13086
13080
|
}
|
|
13087
13081
|
function IdentityVerificationViewBody({
|
|
13088
13082
|
state,
|
|
@@ -13091,7 +13085,7 @@ function IdentityVerificationViewBody({
|
|
|
13091
13085
|
}) {
|
|
13092
13086
|
switch (state.type) {
|
|
13093
13087
|
case "loading":
|
|
13094
|
-
return /* @__PURE__ */
|
|
13088
|
+
return /* @__PURE__ */ jsx78(
|
|
13095
13089
|
"output",
|
|
13096
13090
|
{
|
|
13097
13091
|
"aria-live": "polite",
|
|
@@ -13099,11 +13093,11 @@ function IdentityVerificationViewBody({
|
|
|
13099
13093
|
"clcosdk:flex clcosdk:min-h-40 clcosdk:items-center clcosdk:justify-center",
|
|
13100
13094
|
className
|
|
13101
13095
|
),
|
|
13102
|
-
children: /* @__PURE__ */
|
|
13096
|
+
children: /* @__PURE__ */ jsx78("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: "Loading identity verification..." })
|
|
13103
13097
|
}
|
|
13104
13098
|
);
|
|
13105
13099
|
case "error":
|
|
13106
|
-
return /* @__PURE__ */
|
|
13100
|
+
return /* @__PURE__ */ jsxs53(
|
|
13107
13101
|
"div",
|
|
13108
13102
|
{
|
|
13109
13103
|
className: cn(
|
|
@@ -13111,13 +13105,13 @@ function IdentityVerificationViewBody({
|
|
|
13111
13105
|
className
|
|
13112
13106
|
),
|
|
13113
13107
|
children: [
|
|
13114
|
-
/* @__PURE__ */
|
|
13115
|
-
state.retryable && /* @__PURE__ */
|
|
13108
|
+
/* @__PURE__ */ jsx78(AlertBanner, { variant: "error", icon: true, content: state.message }),
|
|
13109
|
+
state.retryable && /* @__PURE__ */ jsx78(ClButton, { size: "sm", onClick: () => onEvent({ type: "ON_RETRY" }), children: "Try again" })
|
|
13116
13110
|
]
|
|
13117
13111
|
}
|
|
13118
13112
|
);
|
|
13119
13113
|
case "ready":
|
|
13120
|
-
return /* @__PURE__ */
|
|
13114
|
+
return /* @__PURE__ */ jsx78("div", { className: cn("clcosdk:w-full", className), children: /* @__PURE__ */ jsx78(
|
|
13121
13115
|
SumsubWebSdk,
|
|
13122
13116
|
{
|
|
13123
13117
|
accessToken: state.accessToken,
|
|
@@ -13160,13 +13154,13 @@ function toError(error) {
|
|
|
13160
13154
|
import { useCallback as useCallback11, useEffect as useEffect28, useMemo as useMemo10, useRef as useRef19 } from "react";
|
|
13161
13155
|
|
|
13162
13156
|
// src/client/hooks/requirements/data/useKycToken.ts
|
|
13163
|
-
import { useCallback as useCallback10, useEffect as useEffect27, useRef as useRef18, useState as
|
|
13157
|
+
import { useCallback as useCallback10, useEffect as useEffect27, useRef as useRef18, useState as useState35 } from "react";
|
|
13164
13158
|
var IDLE_STATE = { type: "IDLE" };
|
|
13165
13159
|
var LOADING_STATE5 = { type: "LOADING" };
|
|
13166
13160
|
function useKycToken(levelName, reset) {
|
|
13167
13161
|
const { coinlist } = useCoinList();
|
|
13168
13162
|
const log = useLogger("useKycToken");
|
|
13169
|
-
const [kycTokenState, setKycTokenState] =
|
|
13163
|
+
const [kycTokenState, setKycTokenState] = useState35(IDLE_STATE);
|
|
13170
13164
|
const resetPendingRef = useRef18(reset === true);
|
|
13171
13165
|
const tokenIssuedRef = useRef18(false);
|
|
13172
13166
|
useEffect27(() => {
|
|
@@ -13268,7 +13262,7 @@ function useIdentityVerificationViewModel(options = {}) {
|
|
|
13268
13262
|
}
|
|
13269
13263
|
|
|
13270
13264
|
// src/client/components/requirements/identity-verification/IdentityVerificationContainer.tsx
|
|
13271
|
-
import { jsx as
|
|
13265
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
13272
13266
|
function IdentityVerificationContainer({
|
|
13273
13267
|
levelName,
|
|
13274
13268
|
reset,
|
|
@@ -13284,7 +13278,7 @@ function IdentityVerificationContainer({
|
|
|
13284
13278
|
onSubmitted,
|
|
13285
13279
|
onError
|
|
13286
13280
|
});
|
|
13287
|
-
return /* @__PURE__ */
|
|
13281
|
+
return /* @__PURE__ */ jsx79(
|
|
13288
13282
|
IdentityVerificationView,
|
|
13289
13283
|
{
|
|
13290
13284
|
state,
|
|
@@ -13296,7 +13290,125 @@ function IdentityVerificationContainer({
|
|
|
13296
13290
|
|
|
13297
13291
|
// src/client/components/requirements/RequirementItem.tsx
|
|
13298
13292
|
import { ChevronRight } from "lucide-react";
|
|
13299
|
-
|
|
13293
|
+
|
|
13294
|
+
// src/client/components/requirements/ConnectedWalletList.tsx
|
|
13295
|
+
import { useState as useState36 } from "react";
|
|
13296
|
+
import { jsx as jsx80, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
13297
|
+
function ConnectedWalletRow({
|
|
13298
|
+
wallet,
|
|
13299
|
+
onRemove
|
|
13300
|
+
}) {
|
|
13301
|
+
const [state, setState] = useState36("idle");
|
|
13302
|
+
const remove = async () => {
|
|
13303
|
+
if (!onRemove) return;
|
|
13304
|
+
setState("removing");
|
|
13305
|
+
try {
|
|
13306
|
+
await onRemove(wallet.id);
|
|
13307
|
+
setState("idle");
|
|
13308
|
+
} catch {
|
|
13309
|
+
setState("error");
|
|
13310
|
+
}
|
|
13311
|
+
};
|
|
13312
|
+
return /* @__PURE__ */ jsxs54("div", { className: "clcosdk:flex clcosdk:min-h-9 clcosdk:flex-wrap clcosdk:items-center clcosdk:justify-between clcosdk:gap-2", children: [
|
|
13313
|
+
/* @__PURE__ */ jsx80(
|
|
13314
|
+
"span",
|
|
13315
|
+
{
|
|
13316
|
+
title: wallet.address,
|
|
13317
|
+
className: cn(
|
|
13318
|
+
typeClasses.body,
|
|
13319
|
+
"clcosdk:font-mono clcosdk:text-text-primary"
|
|
13320
|
+
),
|
|
13321
|
+
children: wallet.shortAddress
|
|
13322
|
+
}
|
|
13323
|
+
),
|
|
13324
|
+
onRemove != null && (state === "confirming" ? /* @__PURE__ */ jsxs54("div", { className: "clcosdk:flex clcosdk:items-center clcosdk:gap-2", children: [
|
|
13325
|
+
/* @__PURE__ */ jsx80(
|
|
13326
|
+
"span",
|
|
13327
|
+
{
|
|
13328
|
+
className: cn(typeClasses.subhead, "clcosdk:text-text-secondary"),
|
|
13329
|
+
children: "Remove?"
|
|
13330
|
+
}
|
|
13331
|
+
),
|
|
13332
|
+
/* @__PURE__ */ jsx80(ClButton, { size: "sm", variant: "destructive", onClick: remove, children: "Remove" }),
|
|
13333
|
+
/* @__PURE__ */ jsx80(
|
|
13334
|
+
ClButton,
|
|
13335
|
+
{
|
|
13336
|
+
size: "sm",
|
|
13337
|
+
variant: "ghost",
|
|
13338
|
+
onClick: () => setState("idle"),
|
|
13339
|
+
children: "Cancel"
|
|
13340
|
+
}
|
|
13341
|
+
)
|
|
13342
|
+
] }) : state === "error" ? /* @__PURE__ */ jsxs54("div", { className: "clcosdk:flex clcosdk:items-center clcosdk:gap-2", children: [
|
|
13343
|
+
/* @__PURE__ */ jsx80("span", { className: cn(typeClasses.subhead, "clcosdk:text-error"), children: "Couldn't remove." }),
|
|
13344
|
+
/* @__PURE__ */ jsx80(
|
|
13345
|
+
ClButton,
|
|
13346
|
+
{
|
|
13347
|
+
size: "sm",
|
|
13348
|
+
variant: "destructiveLink",
|
|
13349
|
+
onClick: () => setState("confirming"),
|
|
13350
|
+
children: "Try again"
|
|
13351
|
+
}
|
|
13352
|
+
)
|
|
13353
|
+
] }) : /* @__PURE__ */ jsx80(
|
|
13354
|
+
ClButton,
|
|
13355
|
+
{
|
|
13356
|
+
size: "sm",
|
|
13357
|
+
variant: "destructiveLink",
|
|
13358
|
+
disabled: state === "removing",
|
|
13359
|
+
onClick: () => setState("confirming"),
|
|
13360
|
+
children: state === "removing" ? "Removing\u2026" : "Remove"
|
|
13361
|
+
}
|
|
13362
|
+
))
|
|
13363
|
+
] });
|
|
13364
|
+
}
|
|
13365
|
+
function ConnectedWalletList(props) {
|
|
13366
|
+
return /* @__PURE__ */ jsx80(CoinListStyleScope, { children: /* @__PURE__ */ jsx80(ConnectedWalletListBody, { ...props }) });
|
|
13367
|
+
}
|
|
13368
|
+
function ConnectedWalletListBody({
|
|
13369
|
+
wallets,
|
|
13370
|
+
onRemove,
|
|
13371
|
+
onAdd,
|
|
13372
|
+
addLabel = "Add wallet",
|
|
13373
|
+
status = "ready",
|
|
13374
|
+
className
|
|
13375
|
+
}) {
|
|
13376
|
+
return /* @__PURE__ */ jsxs54(
|
|
13377
|
+
"div",
|
|
13378
|
+
{
|
|
13379
|
+
className: cn("clcosdk:flex clcosdk:flex-col clcosdk:gap-2", className),
|
|
13380
|
+
children: [
|
|
13381
|
+
status === "loading" ? /* @__PURE__ */ jsx80(AlertBanner, { variant: "info", content: "Loading your connected wallets\u2026" }) : status === "error" ? /* @__PURE__ */ jsx80(
|
|
13382
|
+
AlertBanner,
|
|
13383
|
+
{
|
|
13384
|
+
variant: "error",
|
|
13385
|
+
content: "Couldn't load your connected wallets."
|
|
13386
|
+
}
|
|
13387
|
+
) : wallets.length === 0 ? /* @__PURE__ */ jsx80(AlertBanner, { variant: "info", content: "No wallets connected yet." }) : /* @__PURE__ */ jsx80("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:divide-y clcosdk:divide-divider", children: wallets.map((wallet) => /* @__PURE__ */ jsx80(
|
|
13388
|
+
ConnectedWalletRow,
|
|
13389
|
+
{
|
|
13390
|
+
wallet,
|
|
13391
|
+
onRemove
|
|
13392
|
+
},
|
|
13393
|
+
wallet.id
|
|
13394
|
+
)) }),
|
|
13395
|
+
onAdd != null && status !== "loading" && /* @__PURE__ */ jsx80(
|
|
13396
|
+
ClButton,
|
|
13397
|
+
{
|
|
13398
|
+
size: "sm",
|
|
13399
|
+
variant: "secondary",
|
|
13400
|
+
onClick: onAdd,
|
|
13401
|
+
className: "clcosdk:self-start",
|
|
13402
|
+
children: addLabel
|
|
13403
|
+
}
|
|
13404
|
+
)
|
|
13405
|
+
]
|
|
13406
|
+
}
|
|
13407
|
+
);
|
|
13408
|
+
}
|
|
13409
|
+
|
|
13410
|
+
// src/client/components/requirements/RequirementItem.tsx
|
|
13411
|
+
import { Fragment as Fragment12, jsx as jsx81, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
13300
13412
|
var DEFAULT_PENDING = "Under review. We'll notify you when complete.";
|
|
13301
13413
|
var DEFAULT_REJECTED = "Verification rejected.";
|
|
13302
13414
|
var SUPPORT_LINK = "Contact support";
|
|
@@ -13309,9 +13421,9 @@ function VerificationActionZone({
|
|
|
13309
13421
|
switch (status) {
|
|
13310
13422
|
case "required":
|
|
13311
13423
|
if (onAction === null) return null;
|
|
13312
|
-
return /* @__PURE__ */
|
|
13424
|
+
return /* @__PURE__ */ jsx81(ClButton, { size: "sm", className: "clcosdk:self-start", onClick: onAction, children: "Continue" });
|
|
13313
13425
|
case "pending":
|
|
13314
|
-
return /* @__PURE__ */
|
|
13426
|
+
return /* @__PURE__ */ jsx81(
|
|
13315
13427
|
AlertBanner,
|
|
13316
13428
|
{
|
|
13317
13429
|
variant: "warning",
|
|
@@ -13319,7 +13431,7 @@ function VerificationActionZone({
|
|
|
13319
13431
|
}
|
|
13320
13432
|
);
|
|
13321
13433
|
case "completed":
|
|
13322
|
-
return /* @__PURE__ */
|
|
13434
|
+
return /* @__PURE__ */ jsx81(
|
|
13323
13435
|
AlertBanner,
|
|
13324
13436
|
{
|
|
13325
13437
|
variant: "success",
|
|
@@ -13327,11 +13439,11 @@ function VerificationActionZone({
|
|
|
13327
13439
|
}
|
|
13328
13440
|
);
|
|
13329
13441
|
case "rejected":
|
|
13330
|
-
return /* @__PURE__ */
|
|
13442
|
+
return /* @__PURE__ */ jsx81(
|
|
13331
13443
|
AlertBanner,
|
|
13332
13444
|
{
|
|
13333
13445
|
variant: "error",
|
|
13334
|
-
content: /* @__PURE__ */
|
|
13446
|
+
content: /* @__PURE__ */ jsx81(
|
|
13335
13447
|
RejectedMessage,
|
|
13336
13448
|
{
|
|
13337
13449
|
message: statusMessages?.rejected ?? DEFAULT_REJECTED,
|
|
@@ -13354,7 +13466,7 @@ function RejectedMessage({
|
|
|
13354
13466
|
return /* @__PURE__ */ jsxs55(Fragment12, { children: [
|
|
13355
13467
|
message,
|
|
13356
13468
|
" ",
|
|
13357
|
-
/* @__PURE__ */
|
|
13469
|
+
/* @__PURE__ */ jsx81(
|
|
13358
13470
|
"button",
|
|
13359
13471
|
{
|
|
13360
13472
|
type: "button",
|
|
@@ -13368,7 +13480,7 @@ function RejectedMessage({
|
|
|
13368
13480
|
}
|
|
13369
13481
|
return /* @__PURE__ */ jsxs55(Fragment12, { children: [
|
|
13370
13482
|
message.slice(0, linkAt),
|
|
13371
|
-
/* @__PURE__ */
|
|
13483
|
+
/* @__PURE__ */ jsx81(
|
|
13372
13484
|
"button",
|
|
13373
13485
|
{
|
|
13374
13486
|
type: "button",
|
|
@@ -13390,7 +13502,7 @@ function WalletActionZone({
|
|
|
13390
13502
|
}) {
|
|
13391
13503
|
if (multiWallet) {
|
|
13392
13504
|
return /* @__PURE__ */ jsxs55(Fragment12, { children: [
|
|
13393
|
-
/* @__PURE__ */
|
|
13505
|
+
/* @__PURE__ */ jsx81(
|
|
13394
13506
|
ConnectedWalletList,
|
|
13395
13507
|
{
|
|
13396
13508
|
wallets: connectedWallets,
|
|
@@ -13399,7 +13511,7 @@ function WalletActionZone({
|
|
|
13399
13511
|
status: walletsStatus
|
|
13400
13512
|
}
|
|
13401
13513
|
),
|
|
13402
|
-
status === "rejected" && /* @__PURE__ */
|
|
13514
|
+
status === "rejected" && /* @__PURE__ */ jsx81(
|
|
13403
13515
|
AlertBanner,
|
|
13404
13516
|
{
|
|
13405
13517
|
variant: "error",
|
|
@@ -13411,7 +13523,7 @@ function WalletActionZone({
|
|
|
13411
13523
|
if (status === "completed") {
|
|
13412
13524
|
const connected = connectedWallets[0];
|
|
13413
13525
|
return /* @__PURE__ */ jsxs55(Fragment12, { children: [
|
|
13414
|
-
onAction !== null && /* @__PURE__ */
|
|
13526
|
+
onAction !== null && /* @__PURE__ */ jsx81(
|
|
13415
13527
|
ClButton,
|
|
13416
13528
|
{
|
|
13417
13529
|
size: "sm",
|
|
@@ -13421,19 +13533,19 @@ function WalletActionZone({
|
|
|
13421
13533
|
children: "Change wallet"
|
|
13422
13534
|
}
|
|
13423
13535
|
),
|
|
13424
|
-
walletsStatus === "loading" ? /* @__PURE__ */
|
|
13536
|
+
walletsStatus === "loading" ? /* @__PURE__ */ jsx81(
|
|
13425
13537
|
AlertBanner,
|
|
13426
13538
|
{
|
|
13427
13539
|
variant: "info",
|
|
13428
13540
|
content: "Loading your connected wallet\u2026"
|
|
13429
13541
|
}
|
|
13430
|
-
) : walletsStatus === "error" ? /* @__PURE__ */
|
|
13542
|
+
) : walletsStatus === "error" ? /* @__PURE__ */ jsx81(
|
|
13431
13543
|
AlertBanner,
|
|
13432
13544
|
{
|
|
13433
13545
|
variant: "error",
|
|
13434
13546
|
content: "Couldn't load your connected wallet."
|
|
13435
13547
|
}
|
|
13436
|
-
) : /* @__PURE__ */
|
|
13548
|
+
) : /* @__PURE__ */ jsx81(
|
|
13437
13549
|
AlertBanner,
|
|
13438
13550
|
{
|
|
13439
13551
|
variant: "success",
|
|
@@ -13444,8 +13556,8 @@ function WalletActionZone({
|
|
|
13444
13556
|
}
|
|
13445
13557
|
if (status === "rejected") {
|
|
13446
13558
|
return /* @__PURE__ */ jsxs55(Fragment12, { children: [
|
|
13447
|
-
onAction !== null && /* @__PURE__ */
|
|
13448
|
-
/* @__PURE__ */
|
|
13559
|
+
onAction !== null && /* @__PURE__ */ jsx81(ClButton, { size: "sm", className: "clcosdk:self-start", onClick: onAction, children: "Connect wallet" }),
|
|
13560
|
+
/* @__PURE__ */ jsx81(
|
|
13449
13561
|
AlertBanner,
|
|
13450
13562
|
{
|
|
13451
13563
|
variant: "error",
|
|
@@ -13455,7 +13567,7 @@ function WalletActionZone({
|
|
|
13455
13567
|
] });
|
|
13456
13568
|
}
|
|
13457
13569
|
if (onAction === null) return null;
|
|
13458
|
-
return /* @__PURE__ */
|
|
13570
|
+
return /* @__PURE__ */ jsx81(ClButton, { size: "sm", className: "clcosdk:self-start", onClick: onAction, children: "Connect wallet" });
|
|
13459
13571
|
}
|
|
13460
13572
|
function RequirementItem({
|
|
13461
13573
|
ui,
|
|
@@ -13468,7 +13580,7 @@ function RequirementItem({
|
|
|
13468
13580
|
onContactSupport,
|
|
13469
13581
|
spaceBeforeNextRow = true
|
|
13470
13582
|
}) {
|
|
13471
|
-
return /* @__PURE__ */
|
|
13583
|
+
return /* @__PURE__ */ jsx81(CoinListStyleScope, { children: /* @__PURE__ */ jsxs55(
|
|
13472
13584
|
"div",
|
|
13473
13585
|
{
|
|
13474
13586
|
className: cn(
|
|
@@ -13485,8 +13597,8 @@ function RequirementItem({
|
|
|
13485
13597
|
className: "clcosdk:-mx-2 clcosdk:flex clcosdk:h-14 clcosdk:w-[calc(100%+16px)] clcosdk:cursor-pointer clcosdk:items-center clcosdk:justify-between clcosdk:rounded-2xl clcosdk:px-2 clcosdk:transition-colors clcosdk:hover:bg-surface",
|
|
13486
13598
|
children: [
|
|
13487
13599
|
/* @__PURE__ */ jsxs55("div", { className: "clcosdk:flex clcosdk:items-center clcosdk:gap-3", children: [
|
|
13488
|
-
/* @__PURE__ */
|
|
13489
|
-
/* @__PURE__ */
|
|
13600
|
+
/* @__PURE__ */ jsx81(StepStatusIcon, { status: ui.status }),
|
|
13601
|
+
/* @__PURE__ */ jsx81(
|
|
13490
13602
|
"span",
|
|
13491
13603
|
{
|
|
13492
13604
|
className: cn(
|
|
@@ -13497,7 +13609,7 @@ function RequirementItem({
|
|
|
13497
13609
|
}
|
|
13498
13610
|
)
|
|
13499
13611
|
] }),
|
|
13500
|
-
/* @__PURE__ */
|
|
13612
|
+
/* @__PURE__ */ jsx81(
|
|
13501
13613
|
ChevronRight,
|
|
13502
13614
|
{
|
|
13503
13615
|
className: cn(
|
|
@@ -13510,14 +13622,14 @@ function RequirementItem({
|
|
|
13510
13622
|
]
|
|
13511
13623
|
}
|
|
13512
13624
|
),
|
|
13513
|
-
/* @__PURE__ */
|
|
13625
|
+
/* @__PURE__ */ jsx81(
|
|
13514
13626
|
"div",
|
|
13515
13627
|
{
|
|
13516
13628
|
className: cn(
|
|
13517
13629
|
"clcosdk:grid clcosdk:transition-[grid-template-rows] clcosdk:duration-300 clcosdk:ease-in-out",
|
|
13518
13630
|
expanded ? "clcosdk:grid-rows-[1fr]" : "clcosdk:grid-rows-[0fr]"
|
|
13519
13631
|
),
|
|
13520
|
-
children: /* @__PURE__ */
|
|
13632
|
+
children: /* @__PURE__ */ jsx81("div", { className: "clcosdk:min-h-0 clcosdk:overflow-hidden", children: /* @__PURE__ */ jsxs55(
|
|
13521
13633
|
"div",
|
|
13522
13634
|
{
|
|
13523
13635
|
className: cn(
|
|
@@ -13525,7 +13637,7 @@ function RequirementItem({
|
|
|
13525
13637
|
spaceBeforeNextRow && "clcosdk:pb-4"
|
|
13526
13638
|
),
|
|
13527
13639
|
children: [
|
|
13528
|
-
/* @__PURE__ */
|
|
13640
|
+
/* @__PURE__ */ jsx81(
|
|
13529
13641
|
"p",
|
|
13530
13642
|
{
|
|
13531
13643
|
className: cn(
|
|
@@ -13535,7 +13647,7 @@ function RequirementItem({
|
|
|
13535
13647
|
children: ui.description
|
|
13536
13648
|
}
|
|
13537
13649
|
),
|
|
13538
|
-
ui.variant === "verification" ? /* @__PURE__ */
|
|
13650
|
+
ui.variant === "verification" ? /* @__PURE__ */ jsx81(
|
|
13539
13651
|
VerificationActionZone,
|
|
13540
13652
|
{
|
|
13541
13653
|
status: ui.status,
|
|
@@ -13543,7 +13655,7 @@ function RequirementItem({
|
|
|
13543
13655
|
onAction,
|
|
13544
13656
|
onContactSupport
|
|
13545
13657
|
}
|
|
13546
|
-
) : /* @__PURE__ */
|
|
13658
|
+
) : /* @__PURE__ */ jsx81(
|
|
13547
13659
|
WalletActionZone,
|
|
13548
13660
|
{
|
|
13549
13661
|
status: ui.status,
|
|
@@ -13565,9 +13677,9 @@ function RequirementItem({
|
|
|
13565
13677
|
}
|
|
13566
13678
|
|
|
13567
13679
|
// src/client/components/requirements/RequirementsChecklistView.tsx
|
|
13568
|
-
import { Fragment as Fragment13, jsx as
|
|
13680
|
+
import { Fragment as Fragment13, jsx as jsx82, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
13569
13681
|
function RequirementsChecklistView(props) {
|
|
13570
|
-
return /* @__PURE__ */
|
|
13682
|
+
return /* @__PURE__ */ jsx82(CoinListStyleScope, { children: /* @__PURE__ */ jsx82(RequirementsChecklistViewBody, { ...props }) });
|
|
13571
13683
|
}
|
|
13572
13684
|
function RequirementsChecklistViewBody({
|
|
13573
13685
|
state,
|
|
@@ -13578,7 +13690,7 @@ function RequirementsChecklistViewBody({
|
|
|
13578
13690
|
}) {
|
|
13579
13691
|
switch (state.type) {
|
|
13580
13692
|
case "loading":
|
|
13581
|
-
return loading ?? /* @__PURE__ */
|
|
13693
|
+
return loading ?? /* @__PURE__ */ jsx82(
|
|
13582
13694
|
LoadingState2,
|
|
13583
13695
|
{
|
|
13584
13696
|
title: state.title,
|
|
@@ -13595,8 +13707,8 @@ function RequirementsChecklistViewBody({
|
|
|
13595
13707
|
className
|
|
13596
13708
|
),
|
|
13597
13709
|
children: [
|
|
13598
|
-
/* @__PURE__ */
|
|
13599
|
-
error ?? /* @__PURE__ */
|
|
13710
|
+
/* @__PURE__ */ jsx82("h3", { className: cn(typeClasses.h3, "clcosdk:text-text-primary"), children: state.title }),
|
|
13711
|
+
error ?? /* @__PURE__ */ jsx82(
|
|
13600
13712
|
AlertBanner,
|
|
13601
13713
|
{
|
|
13602
13714
|
variant: "error",
|
|
@@ -13617,8 +13729,8 @@ function RequirementsChecklistViewBody({
|
|
|
13617
13729
|
),
|
|
13618
13730
|
children: [
|
|
13619
13731
|
/* @__PURE__ */ jsxs56("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-2", children: [
|
|
13620
|
-
/* @__PURE__ */
|
|
13621
|
-
state.blockedMessage == null && /* @__PURE__ */
|
|
13732
|
+
/* @__PURE__ */ jsx82("h3", { className: cn(typeClasses.h3, "clcosdk:text-text-primary"), children: state.title }),
|
|
13733
|
+
state.blockedMessage == null && /* @__PURE__ */ jsx82(
|
|
13622
13734
|
"p",
|
|
13623
13735
|
{
|
|
13624
13736
|
className: cn(typeClasses.body, "clcosdk:text-text-secondary"),
|
|
@@ -13626,7 +13738,7 @@ function RequirementsChecklistViewBody({
|
|
|
13626
13738
|
}
|
|
13627
13739
|
)
|
|
13628
13740
|
] }),
|
|
13629
|
-
state.blockedMessage != null ? /* @__PURE__ */
|
|
13741
|
+
state.blockedMessage != null ? /* @__PURE__ */ jsx82(AlertBanner, { variant: "info", icon: true, content: state.blockedMessage }) : state.items.length === 0 ? state.continueAction && /* @__PURE__ */ jsx82(
|
|
13630
13742
|
ClButton,
|
|
13631
13743
|
{
|
|
13632
13744
|
variant: "primary",
|
|
@@ -13636,7 +13748,7 @@ function RequirementsChecklistViewBody({
|
|
|
13636
13748
|
children: "Continue"
|
|
13637
13749
|
}
|
|
13638
13750
|
) : /* @__PURE__ */ jsxs56(Fragment13, { children: [
|
|
13639
|
-
/* @__PURE__ */
|
|
13751
|
+
/* @__PURE__ */ jsx82("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:divide-y clcosdk:divide-divider", children: state.items.map((row, index) => /* @__PURE__ */ jsx82(
|
|
13640
13752
|
RequirementItem,
|
|
13641
13753
|
{
|
|
13642
13754
|
ui: row.item,
|
|
@@ -13657,7 +13769,7 @@ function RequirementsChecklistViewBody({
|
|
|
13657
13769
|
row.id
|
|
13658
13770
|
)) }),
|
|
13659
13771
|
/* @__PURE__ */ jsxs56("div", { className: "clcosdk:flex clcosdk:flex-row clcosdk:items-center clcosdk:justify-between clcosdk:gap-6", children: [
|
|
13660
|
-
/* @__PURE__ */
|
|
13772
|
+
/* @__PURE__ */ jsx82(
|
|
13661
13773
|
"span",
|
|
13662
13774
|
{
|
|
13663
13775
|
className: cn(
|
|
@@ -13668,7 +13780,7 @@ function RequirementsChecklistViewBody({
|
|
|
13668
13780
|
children: state.ineligible ? "You are not eligible to invest." : completedLabel(state.items)
|
|
13669
13781
|
}
|
|
13670
13782
|
),
|
|
13671
|
-
state.continueAction && /* @__PURE__ */
|
|
13783
|
+
state.continueAction && /* @__PURE__ */ jsx82(
|
|
13672
13784
|
ClButton,
|
|
13673
13785
|
{
|
|
13674
13786
|
variant: "primary",
|
|
@@ -13713,19 +13825,19 @@ function LoadingState2({
|
|
|
13713
13825
|
className
|
|
13714
13826
|
),
|
|
13715
13827
|
children: [
|
|
13716
|
-
/* @__PURE__ */
|
|
13828
|
+
/* @__PURE__ */ jsx82("output", { className: "clcosdk:sr-only", children: "Loading requirements..." }),
|
|
13717
13829
|
/* @__PURE__ */ jsxs56("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-2", children: [
|
|
13718
|
-
/* @__PURE__ */
|
|
13719
|
-
/* @__PURE__ */
|
|
13830
|
+
/* @__PURE__ */ jsx82("h3", { className: cn(typeClasses.h3, "clcosdk:text-text-primary"), children: title2 }),
|
|
13831
|
+
/* @__PURE__ */ jsx82("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: description2 })
|
|
13720
13832
|
] }),
|
|
13721
|
-
/* @__PURE__ */
|
|
13833
|
+
/* @__PURE__ */ jsx82("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-3", children: LOADING_ROW_WIDTHS.map((width) => /* @__PURE__ */ jsx82(Skeleton, { className: cn("clcosdk:h-8", width) }, width)) })
|
|
13722
13834
|
]
|
|
13723
13835
|
}
|
|
13724
13836
|
);
|
|
13725
13837
|
}
|
|
13726
13838
|
|
|
13727
13839
|
// src/client/components/requirements/tax-document/TaxDocumentModalView.tsx
|
|
13728
|
-
import { jsx as
|
|
13840
|
+
import { jsx as jsx83, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
13729
13841
|
function TaxDocumentModalView({
|
|
13730
13842
|
state,
|
|
13731
13843
|
onEvent,
|
|
@@ -13734,7 +13846,7 @@ function TaxDocumentModalView({
|
|
|
13734
13846
|
if (state.type === "hidden") {
|
|
13735
13847
|
return null;
|
|
13736
13848
|
}
|
|
13737
|
-
return /* @__PURE__ */
|
|
13849
|
+
return /* @__PURE__ */ jsx83(CoinListStyleScope, { children: /* @__PURE__ */ jsx83("div", { className: "clcosdk:fixed clcosdk:inset-0 clcosdk:z-50 clcosdk:flex clcosdk:items-center clcosdk:justify-center clcosdk:bg-black/50 clcosdk:p-4", children: /* @__PURE__ */ jsxs57(
|
|
13738
13850
|
"div",
|
|
13739
13851
|
{
|
|
13740
13852
|
className: cn(
|
|
@@ -13743,10 +13855,10 @@ function TaxDocumentModalView({
|
|
|
13743
13855
|
),
|
|
13744
13856
|
children: [
|
|
13745
13857
|
/* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:items-start clcosdk:justify-between clcosdk:gap-4", children: [
|
|
13746
|
-
/* @__PURE__ */
|
|
13747
|
-
/* @__PURE__ */
|
|
13858
|
+
/* @__PURE__ */ jsx83("h3", { className: cn(typeClasses.h3, "clcosdk:text-text-primary"), children: state.title }),
|
|
13859
|
+
/* @__PURE__ */ jsx83(CloseButton, { onClick: () => onEvent({ type: "ON_CLOSE" }) })
|
|
13748
13860
|
] }),
|
|
13749
|
-
/* @__PURE__ */
|
|
13861
|
+
/* @__PURE__ */ jsx83(Screen, { screen: state.screen, onEvent })
|
|
13750
13862
|
]
|
|
13751
13863
|
}
|
|
13752
13864
|
) }) });
|
|
@@ -13757,11 +13869,11 @@ function Screen({
|
|
|
13757
13869
|
}) {
|
|
13758
13870
|
switch (screen.type) {
|
|
13759
13871
|
case "loading":
|
|
13760
|
-
return /* @__PURE__ */
|
|
13872
|
+
return /* @__PURE__ */ jsx83(LoadingScreen, {});
|
|
13761
13873
|
case "error":
|
|
13762
|
-
return /* @__PURE__ */
|
|
13874
|
+
return /* @__PURE__ */ jsx83(AlertBanner, { variant: "error", icon: true, content: screen.message });
|
|
13763
13875
|
case "review":
|
|
13764
|
-
return /* @__PURE__ */
|
|
13876
|
+
return /* @__PURE__ */ jsx83(
|
|
13765
13877
|
ReviewScreen,
|
|
13766
13878
|
{
|
|
13767
13879
|
fields: screen.fields,
|
|
@@ -13772,9 +13884,9 @@ function Screen({
|
|
|
13772
13884
|
}
|
|
13773
13885
|
);
|
|
13774
13886
|
case "editing":
|
|
13775
|
-
return /* @__PURE__ */
|
|
13887
|
+
return /* @__PURE__ */ jsx83(EditScreen, { fields: screen.fields, onEvent });
|
|
13776
13888
|
case "sign-only":
|
|
13777
|
-
return /* @__PURE__ */
|
|
13889
|
+
return /* @__PURE__ */ jsx83(
|
|
13778
13890
|
SignOnlyScreen,
|
|
13779
13891
|
{
|
|
13780
13892
|
signing: screen.signing,
|
|
@@ -13789,14 +13901,14 @@ function Screen({
|
|
|
13789
13901
|
}
|
|
13790
13902
|
}
|
|
13791
13903
|
function LoadingScreen() {
|
|
13792
|
-
return /* @__PURE__ */
|
|
13904
|
+
return /* @__PURE__ */ jsx83(
|
|
13793
13905
|
"output",
|
|
13794
13906
|
{
|
|
13795
13907
|
"aria-live": "polite",
|
|
13796
13908
|
className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-4",
|
|
13797
13909
|
children: [0, 1, 2, 3, 4].map((row) => /* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-1", children: [
|
|
13798
|
-
/* @__PURE__ */
|
|
13799
|
-
/* @__PURE__ */
|
|
13910
|
+
/* @__PURE__ */ jsx83("div", { className: "clcosdk:h-3 clcosdk:w-28 clcosdk:animate-pulse clcosdk:rounded clcosdk:bg-surface" }),
|
|
13911
|
+
/* @__PURE__ */ jsx83("div", { className: "clcosdk:h-5 clcosdk:w-48 clcosdk:animate-pulse clcosdk:rounded clcosdk:bg-surface" })
|
|
13800
13912
|
] }, row))
|
|
13801
13913
|
}
|
|
13802
13914
|
);
|
|
@@ -13809,8 +13921,8 @@ function ReviewScreen({
|
|
|
13809
13921
|
onEvent
|
|
13810
13922
|
}) {
|
|
13811
13923
|
return /* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-6", children: [
|
|
13812
|
-
/* @__PURE__ */
|
|
13813
|
-
piiUnavailable && /* @__PURE__ */
|
|
13924
|
+
/* @__PURE__ */ jsx83("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: "Review your information below. If anything looks incorrect, edit before signing." }),
|
|
13925
|
+
piiUnavailable && /* @__PURE__ */ jsx83(
|
|
13814
13926
|
AlertBanner,
|
|
13815
13927
|
{
|
|
13816
13928
|
variant: "info",
|
|
@@ -13818,27 +13930,27 @@ function ReviewScreen({
|
|
|
13818
13930
|
content: "We don't have this information on file yet \u2014 please fill it in below."
|
|
13819
13931
|
}
|
|
13820
13932
|
),
|
|
13821
|
-
/* @__PURE__ */
|
|
13933
|
+
/* @__PURE__ */ jsx83("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-4 clcosdk:border-t clcosdk:border-divider clcosdk:pt-4", children: fields.map(({ field, label, displayValue }) => /* @__PURE__ */ jsxs57(
|
|
13822
13934
|
"div",
|
|
13823
13935
|
{
|
|
13824
13936
|
className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-1",
|
|
13825
13937
|
children: [
|
|
13826
|
-
/* @__PURE__ */
|
|
13938
|
+
/* @__PURE__ */ jsx83(
|
|
13827
13939
|
"span",
|
|
13828
13940
|
{
|
|
13829
13941
|
className: cn(typeClasses.label, "clcosdk:text-text-secondary"),
|
|
13830
13942
|
children: label
|
|
13831
13943
|
}
|
|
13832
13944
|
),
|
|
13833
|
-
/* @__PURE__ */
|
|
13945
|
+
/* @__PURE__ */ jsx83("span", { className: cn(typeClasses.body, "clcosdk:text-text-primary"), children: displayValue })
|
|
13834
13946
|
]
|
|
13835
13947
|
},
|
|
13836
13948
|
field
|
|
13837
13949
|
)) }),
|
|
13838
|
-
/* @__PURE__ */
|
|
13839
|
-
signError && /* @__PURE__ */
|
|
13950
|
+
/* @__PURE__ */ jsx83("p", { className: cn(typeClasses.caption, "clcosdk:text-text-secondary"), children: "By signing, you certify that the information above is accurate and that you are the beneficial owner of the income this form relates to. This document cannot be edited once signed." }),
|
|
13951
|
+
signError && /* @__PURE__ */ jsx83(AlertBanner, { variant: "error", icon: true, content: signError }),
|
|
13840
13952
|
/* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-2", children: [
|
|
13841
|
-
/* @__PURE__ */
|
|
13953
|
+
/* @__PURE__ */ jsx83(
|
|
13842
13954
|
ClButton,
|
|
13843
13955
|
{
|
|
13844
13956
|
fullWidth: true,
|
|
@@ -13848,7 +13960,7 @@ function ReviewScreen({
|
|
|
13848
13960
|
children: "Sign W-8BEN"
|
|
13849
13961
|
}
|
|
13850
13962
|
),
|
|
13851
|
-
/* @__PURE__ */
|
|
13963
|
+
/* @__PURE__ */ jsx83(
|
|
13852
13964
|
ClButton,
|
|
13853
13965
|
{
|
|
13854
13966
|
fullWidth: true,
|
|
@@ -13866,19 +13978,19 @@ function EditScreen({
|
|
|
13866
13978
|
onEvent
|
|
13867
13979
|
}) {
|
|
13868
13980
|
return /* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-6", children: [
|
|
13869
|
-
/* @__PURE__ */
|
|
13981
|
+
/* @__PURE__ */ jsx83("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-4 clcosdk:border-t clcosdk:border-divider clcosdk:pt-4", children: fields.map(({ field, label, placeholder, value }) => /* @__PURE__ */ jsxs57(
|
|
13870
13982
|
"label",
|
|
13871
13983
|
{
|
|
13872
13984
|
className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-1",
|
|
13873
13985
|
children: [
|
|
13874
|
-
/* @__PURE__ */
|
|
13986
|
+
/* @__PURE__ */ jsx83(
|
|
13875
13987
|
"span",
|
|
13876
13988
|
{
|
|
13877
13989
|
className: cn(typeClasses.label, "clcosdk:text-text-secondary"),
|
|
13878
13990
|
children: label
|
|
13879
13991
|
}
|
|
13880
13992
|
),
|
|
13881
|
-
/* @__PURE__ */
|
|
13993
|
+
/* @__PURE__ */ jsx83(
|
|
13882
13994
|
"input",
|
|
13883
13995
|
{
|
|
13884
13996
|
type: "text",
|
|
@@ -13900,8 +14012,8 @@ function EditScreen({
|
|
|
13900
14012
|
field
|
|
13901
14013
|
)) }),
|
|
13902
14014
|
/* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-2", children: [
|
|
13903
|
-
/* @__PURE__ */
|
|
13904
|
-
/* @__PURE__ */
|
|
14015
|
+
/* @__PURE__ */ jsx83(ClButton, { fullWidth: true, onClick: () => onEvent({ type: "ON_SAVE_EDIT" }), children: "Save & review" }),
|
|
14016
|
+
/* @__PURE__ */ jsx83(
|
|
13905
14017
|
ClButton,
|
|
13906
14018
|
{
|
|
13907
14019
|
fullWidth: true,
|
|
@@ -13919,9 +14031,9 @@ function SignOnlyScreen({
|
|
|
13919
14031
|
onEvent
|
|
13920
14032
|
}) {
|
|
13921
14033
|
return /* @__PURE__ */ jsxs57("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-6", children: [
|
|
13922
|
-
/* @__PURE__ */
|
|
13923
|
-
signError && /* @__PURE__ */
|
|
13924
|
-
/* @__PURE__ */
|
|
14034
|
+
/* @__PURE__ */ jsx83("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: "As an entity investor, you must complete a W-8BEN-E to confirm your foreign tax status and claim applicable treaty benefits. You'll receive an email to complete the signing." }),
|
|
14035
|
+
signError && /* @__PURE__ */ jsx83(AlertBanner, { variant: "error", icon: true, content: signError }),
|
|
14036
|
+
/* @__PURE__ */ jsx83(
|
|
13925
14037
|
ClButton,
|
|
13926
14038
|
{
|
|
13927
14039
|
fullWidth: true,
|
|
@@ -14233,7 +14345,7 @@ function toFieldsUi(fields) {
|
|
|
14233
14345
|
}
|
|
14234
14346
|
|
|
14235
14347
|
// src/client/components/requirements/tax-document/TaxDocumentModalContainer.tsx
|
|
14236
|
-
import { jsx as
|
|
14348
|
+
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
14237
14349
|
function TaxDocumentModalContainer({
|
|
14238
14350
|
isOpen,
|
|
14239
14351
|
onClose,
|
|
@@ -14245,7 +14357,7 @@ function TaxDocumentModalContainer({
|
|
|
14245
14357
|
onClose,
|
|
14246
14358
|
onSubmitted
|
|
14247
14359
|
});
|
|
14248
|
-
return /* @__PURE__ */
|
|
14360
|
+
return /* @__PURE__ */ jsx84(
|
|
14249
14361
|
TaxDocumentModalView,
|
|
14250
14362
|
{
|
|
14251
14363
|
state,
|
|
@@ -14256,18 +14368,18 @@ function TaxDocumentModalContainer({
|
|
|
14256
14368
|
}
|
|
14257
14369
|
|
|
14258
14370
|
// src/client/components/requirements/VerificationOverlay.tsx
|
|
14259
|
-
import { jsx as
|
|
14371
|
+
import { jsx as jsx85, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
14260
14372
|
function VerificationOverlay({
|
|
14261
14373
|
onClose,
|
|
14262
14374
|
children
|
|
14263
14375
|
}) {
|
|
14264
|
-
return /* @__PURE__ */
|
|
14376
|
+
return /* @__PURE__ */ jsx85(CoinListStyleScope, { children: /* @__PURE__ */ jsx85(VerificationOverlayBody, { onClose, children }) });
|
|
14265
14377
|
}
|
|
14266
14378
|
function VerificationOverlayBody({
|
|
14267
14379
|
onClose,
|
|
14268
14380
|
children
|
|
14269
14381
|
}) {
|
|
14270
|
-
return /* @__PURE__ */
|
|
14382
|
+
return /* @__PURE__ */ jsx85(
|
|
14271
14383
|
"div",
|
|
14272
14384
|
{
|
|
14273
14385
|
role: "dialog",
|
|
@@ -14275,7 +14387,7 @@ function VerificationOverlayBody({
|
|
|
14275
14387
|
"aria-label": "Identity verification",
|
|
14276
14388
|
className: "clcosdk:fixed clcosdk:inset-0 clcosdk:z-50 clcosdk:flex clcosdk:items-center clcosdk:justify-center clcosdk:bg-overlay clcosdk:p-4",
|
|
14277
14389
|
children: /* @__PURE__ */ jsxs58("div", { className: "clcosdk:relative clcosdk:flex clcosdk:max-h-[92vh] clcosdk:w-full clcosdk:max-w-[760px] clcosdk:flex-col clcosdk:overflow-y-auto clcosdk:rounded-2xl clcosdk:bg-background clcosdk:p-6 clcosdk:pt-14", children: [
|
|
14278
|
-
/* @__PURE__ */
|
|
14390
|
+
/* @__PURE__ */ jsx85(
|
|
14279
14391
|
CloseButton,
|
|
14280
14392
|
{
|
|
14281
14393
|
onClick: onClose,
|
|
@@ -14290,7 +14402,7 @@ function VerificationOverlayBody({
|
|
|
14290
14402
|
|
|
14291
14403
|
// src/client/components/requirements/wallet/ConnectWalletModalView.tsx
|
|
14292
14404
|
import { useId as useId5 } from "react";
|
|
14293
|
-
import { jsx as
|
|
14405
|
+
import { jsx as jsx86, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
14294
14406
|
function ConnectWalletModalView({
|
|
14295
14407
|
state,
|
|
14296
14408
|
onEvent,
|
|
@@ -14300,7 +14412,7 @@ function ConnectWalletModalView({
|
|
|
14300
14412
|
if (state.type === "hidden") {
|
|
14301
14413
|
return null;
|
|
14302
14414
|
}
|
|
14303
|
-
return /* @__PURE__ */
|
|
14415
|
+
return /* @__PURE__ */ jsx86(CoinListStyleScope, { children: /* @__PURE__ */ jsx86("div", { className: "clcosdk:fixed clcosdk:inset-0 clcosdk:z-50 clcosdk:flex clcosdk:items-center clcosdk:justify-center clcosdk:bg-black/50 clcosdk:p-4", children: /* @__PURE__ */ jsxs59(
|
|
14304
14416
|
"div",
|
|
14305
14417
|
{
|
|
14306
14418
|
role: "dialog",
|
|
@@ -14312,7 +14424,7 @@ function ConnectWalletModalView({
|
|
|
14312
14424
|
),
|
|
14313
14425
|
children: [
|
|
14314
14426
|
/* @__PURE__ */ jsxs59("div", { className: "clcosdk:flex clcosdk:items-start clcosdk:justify-between clcosdk:gap-4", children: [
|
|
14315
|
-
/* @__PURE__ */
|
|
14427
|
+
/* @__PURE__ */ jsx86(
|
|
14316
14428
|
"h3",
|
|
14317
14429
|
{
|
|
14318
14430
|
id: titleId,
|
|
@@ -14320,9 +14432,9 @@ function ConnectWalletModalView({
|
|
|
14320
14432
|
children: "Connect your wallet"
|
|
14321
14433
|
}
|
|
14322
14434
|
),
|
|
14323
|
-
/* @__PURE__ */
|
|
14435
|
+
/* @__PURE__ */ jsx86(CloseButton, { onClick: () => onEvent({ type: "ON_CLOSE" }) })
|
|
14324
14436
|
] }),
|
|
14325
|
-
/* @__PURE__ */
|
|
14437
|
+
/* @__PURE__ */ jsx86(
|
|
14326
14438
|
Screen2,
|
|
14327
14439
|
{
|
|
14328
14440
|
screen: state.screen,
|
|
@@ -14342,8 +14454,8 @@ function Screen2({
|
|
|
14342
14454
|
switch (screen.type) {
|
|
14343
14455
|
case "needs-wallet":
|
|
14344
14456
|
return /* @__PURE__ */ jsxs59("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-6", children: [
|
|
14345
|
-
/* @__PURE__ */
|
|
14346
|
-
canRequestConnect && /* @__PURE__ */
|
|
14457
|
+
/* @__PURE__ */ jsx86("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: "Connect an external wallet to prove ownership and bind it to this offer." }),
|
|
14458
|
+
canRequestConnect && /* @__PURE__ */ jsx86(
|
|
14347
14459
|
ClButton,
|
|
14348
14460
|
{
|
|
14349
14461
|
fullWidth: true,
|
|
@@ -14354,22 +14466,22 @@ function Screen2({
|
|
|
14354
14466
|
] });
|
|
14355
14467
|
case "ready":
|
|
14356
14468
|
return /* @__PURE__ */ jsxs59("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-6", children: [
|
|
14357
|
-
/* @__PURE__ */
|
|
14469
|
+
/* @__PURE__ */ jsx86("p", { className: cn(typeClasses.body, "clcosdk:text-text-secondary"), children: "Sign a message with your connected wallet to prove you own it. This does not cost gas or move any funds." }),
|
|
14358
14470
|
/* @__PURE__ */ jsxs59("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-1 clcosdk:border-t clcosdk:border-divider clcosdk:pt-4", children: [
|
|
14359
|
-
/* @__PURE__ */
|
|
14471
|
+
/* @__PURE__ */ jsx86(
|
|
14360
14472
|
"span",
|
|
14361
14473
|
{
|
|
14362
14474
|
className: cn(typeClasses.label, "clcosdk:text-text-secondary"),
|
|
14363
14475
|
children: "Wallet address"
|
|
14364
14476
|
}
|
|
14365
14477
|
),
|
|
14366
|
-
/* @__PURE__ */
|
|
14478
|
+
/* @__PURE__ */ jsx86("span", { className: cn(typeClasses.body, "clcosdk:text-text-primary"), children: screen.shortAddress })
|
|
14367
14479
|
] }),
|
|
14368
14480
|
screen.signError && // Live region: the error is inserted async after a failed attempt,
|
|
14369
14481
|
// so screen readers need it announced rather than silently
|
|
14370
14482
|
// rendered.
|
|
14371
|
-
/* @__PURE__ */
|
|
14372
|
-
/* @__PURE__ */
|
|
14483
|
+
/* @__PURE__ */ jsx86("div", { role: "alert", children: /* @__PURE__ */ jsx86(AlertBanner, { variant: "error", icon: true, content: screen.signError }) }),
|
|
14484
|
+
/* @__PURE__ */ jsx86(
|
|
14373
14485
|
ClButton,
|
|
14374
14486
|
{
|
|
14375
14487
|
fullWidth: true,
|
|
@@ -14380,7 +14492,7 @@ function Screen2({
|
|
|
14380
14492
|
children: "Sign & connect"
|
|
14381
14493
|
}
|
|
14382
14494
|
),
|
|
14383
|
-
canRequestConnect && /* @__PURE__ */
|
|
14495
|
+
canRequestConnect && /* @__PURE__ */ jsx86(
|
|
14384
14496
|
ClButton,
|
|
14385
14497
|
{
|
|
14386
14498
|
fullWidth: true,
|
|
@@ -14403,112 +14515,6 @@ import { useCallback as useCallback15, useEffect as useEffect32, useMemo as useM
|
|
|
14403
14515
|
|
|
14404
14516
|
// src/client/hooks/requirements/data/useConnectWallet.ts
|
|
14405
14517
|
import { useCallback as useCallback14, useEffect as useEffect31, useRef as useRef20, useState as useState38 } from "react";
|
|
14406
|
-
|
|
14407
|
-
// src/client/core/wallets/connect-external-wallet.ts
|
|
14408
|
-
var DEFAULT_STATEMENT = "Sign this message to prove you own this wallet. This does not cost gas or move funds.";
|
|
14409
|
-
var TERMINAL_CODES = /* @__PURE__ */ new Set([
|
|
14410
|
-
"not_authenticated",
|
|
14411
|
-
"wallet_not_whitelisted",
|
|
14412
|
-
"max_wallets_reached"
|
|
14413
|
-
]);
|
|
14414
|
-
var API_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
14415
|
-
"wallet_not_whitelisted",
|
|
14416
|
-
"max_wallets_reached"
|
|
14417
|
-
]);
|
|
14418
|
-
function flowError(code) {
|
|
14419
|
-
return { code, retryable: !TERMINAL_CODES.has(code) };
|
|
14420
|
-
}
|
|
14421
|
-
function siweContext() {
|
|
14422
|
-
if (typeof window === "undefined") return { domain: "", uri: "" };
|
|
14423
|
-
return { domain: window.location.host, uri: window.location.origin };
|
|
14424
|
-
}
|
|
14425
|
-
function apiErrorCode2(error) {
|
|
14426
|
-
if (typeof error !== "object" || error === null) return void 0;
|
|
14427
|
-
const body = error.response?.body;
|
|
14428
|
-
return typeof body?.code === "string" ? body.code : void 0;
|
|
14429
|
-
}
|
|
14430
|
-
function classifyApiError(error) {
|
|
14431
|
-
if (error instanceof NotAuthenticatedError) {
|
|
14432
|
-
return flowError("not_authenticated");
|
|
14433
|
-
}
|
|
14434
|
-
const code = apiErrorCode2(error);
|
|
14435
|
-
if (code !== void 0 && API_ERROR_CODES.has(code)) {
|
|
14436
|
-
return flowError(code);
|
|
14437
|
-
}
|
|
14438
|
-
return flowError("unknown");
|
|
14439
|
-
}
|
|
14440
|
-
function challengeParams(wallet, challengeType, statement) {
|
|
14441
|
-
switch (challengeType) {
|
|
14442
|
-
case "siwe":
|
|
14443
|
-
return {
|
|
14444
|
-
walletAddress: wallet.address,
|
|
14445
|
-
chain: wallet.chain,
|
|
14446
|
-
challengeType: "siwe",
|
|
14447
|
-
...siweContext(),
|
|
14448
|
-
statement: statement ?? DEFAULT_STATEMENT
|
|
14449
|
-
};
|
|
14450
|
-
case "plain":
|
|
14451
|
-
return {
|
|
14452
|
-
walletAddress: wallet.address,
|
|
14453
|
-
chain: wallet.chain,
|
|
14454
|
-
challengeType: "plain"
|
|
14455
|
-
};
|
|
14456
|
-
default: {
|
|
14457
|
-
const _exhaustive = challengeType;
|
|
14458
|
-
return _exhaustive;
|
|
14459
|
-
}
|
|
14460
|
-
}
|
|
14461
|
-
}
|
|
14462
|
-
async function connectExternalWalletFlow(params) {
|
|
14463
|
-
const {
|
|
14464
|
-
coinlist,
|
|
14465
|
-
wallet,
|
|
14466
|
-
offerId,
|
|
14467
|
-
offerOptionId,
|
|
14468
|
-
challengeType,
|
|
14469
|
-
statement,
|
|
14470
|
-
isCancelled,
|
|
14471
|
-
onProgress
|
|
14472
|
-
} = params;
|
|
14473
|
-
const emit = (phase) => onProgress?.(phase);
|
|
14474
|
-
const cancelled = () => isCancelled?.() ?? false;
|
|
14475
|
-
emit("requesting-challenge");
|
|
14476
|
-
let challenge;
|
|
14477
|
-
try {
|
|
14478
|
-
challenge = await coinlist.wallets.createOwnershipChallenge(
|
|
14479
|
-
challengeParams(wallet, challengeType ?? "siwe", statement)
|
|
14480
|
-
);
|
|
14481
|
-
} catch (error) {
|
|
14482
|
-
return { type: "error", error: classifyApiError(error) };
|
|
14483
|
-
}
|
|
14484
|
-
if (cancelled()) return { type: "cancelled" };
|
|
14485
|
-
emit("signing-message");
|
|
14486
|
-
let signature;
|
|
14487
|
-
try {
|
|
14488
|
-
signature = await wallet.signMessage(challenge.message);
|
|
14489
|
-
} catch (error) {
|
|
14490
|
-
if (classifyWalletError(error).type === "user_rejected") {
|
|
14491
|
-
return { type: "error", error: flowError("user_rejected") };
|
|
14492
|
-
}
|
|
14493
|
-
return { type: "error", error: flowError("unknown") };
|
|
14494
|
-
}
|
|
14495
|
-
if (cancelled()) return { type: "cancelled" };
|
|
14496
|
-
emit("submitting-signature");
|
|
14497
|
-
try {
|
|
14498
|
-
const binding = await coinlist.wallets.connectExternal({
|
|
14499
|
-
offerId,
|
|
14500
|
-
offerOptionId,
|
|
14501
|
-
walletAddress: wallet.address,
|
|
14502
|
-
chain: wallet.chain,
|
|
14503
|
-
signature
|
|
14504
|
-
});
|
|
14505
|
-
return { type: "success", binding };
|
|
14506
|
-
} catch (error) {
|
|
14507
|
-
return { type: "error", error: classifyApiError(error) };
|
|
14508
|
-
}
|
|
14509
|
-
}
|
|
14510
|
-
|
|
14511
|
-
// src/client/hooks/requirements/data/useConnectWallet.ts
|
|
14512
14518
|
var IDLE_SIGN2 = { type: "idle", error: null };
|
|
14513
14519
|
var ERROR_COPY = {
|
|
14514
14520
|
not_authenticated: "Sign in to connect your wallet.",
|
|
@@ -14559,8 +14565,7 @@ function useConnectWallet({
|
|
|
14559
14565
|
address: wallet.address,
|
|
14560
14566
|
sign: { type: "signing" }
|
|
14561
14567
|
});
|
|
14562
|
-
|
|
14563
|
-
coinlist,
|
|
14568
|
+
coinlist.wallets.connect({
|
|
14564
14569
|
wallet,
|
|
14565
14570
|
offerId,
|
|
14566
14571
|
offerOptionId,
|
|
@@ -14667,13 +14672,13 @@ function useConnectWalletModalViewModel({
|
|
|
14667
14672
|
}
|
|
14668
14673
|
|
|
14669
14674
|
// src/client/components/requirements/wallet/ConnectWalletModalContainer.tsx
|
|
14670
|
-
import { jsx as
|
|
14675
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
14671
14676
|
function ConnectWalletModalContainer({
|
|
14672
14677
|
className,
|
|
14673
14678
|
...options
|
|
14674
14679
|
}) {
|
|
14675
14680
|
const { state, onEvent } = useConnectWalletModalViewModel(options);
|
|
14676
|
-
return /* @__PURE__ */
|
|
14681
|
+
return /* @__PURE__ */ jsx87(
|
|
14677
14682
|
ConnectWalletModalView,
|
|
14678
14683
|
{
|
|
14679
14684
|
state,
|
|
@@ -15244,7 +15249,7 @@ function toVerificationUi(verifyingRequirementId, statusById, identityVerificati
|
|
|
15244
15249
|
}
|
|
15245
15250
|
|
|
15246
15251
|
// src/client/components/requirements/RequirementsChecklistContainer.tsx
|
|
15247
|
-
import { Fragment as Fragment14, jsx as
|
|
15252
|
+
import { Fragment as Fragment14, jsx as jsx88, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
15248
15253
|
function RequirementsChecklistContainer({
|
|
15249
15254
|
loading,
|
|
15250
15255
|
error,
|
|
@@ -15257,7 +15262,7 @@ function RequirementsChecklistContainer({
|
|
|
15257
15262
|
enabled
|
|
15258
15263
|
});
|
|
15259
15264
|
return /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
15260
|
-
/* @__PURE__ */
|
|
15265
|
+
/* @__PURE__ */ jsx88(
|
|
15261
15266
|
RequirementsChecklistView,
|
|
15262
15267
|
{
|
|
15263
15268
|
state,
|
|
@@ -15268,7 +15273,7 @@ function RequirementsChecklistContainer({
|
|
|
15268
15273
|
}
|
|
15269
15274
|
),
|
|
15270
15275
|
state.type === "content" && /* @__PURE__ */ jsxs60(Fragment14, { children: [
|
|
15271
|
-
/* @__PURE__ */
|
|
15276
|
+
/* @__PURE__ */ jsx88(
|
|
15272
15277
|
TaxDocumentModalContainer,
|
|
15273
15278
|
{
|
|
15274
15279
|
isOpen: state.taxDocumentOpen,
|
|
@@ -15276,11 +15281,11 @@ function RequirementsChecklistContainer({
|
|
|
15276
15281
|
onSubmitted: () => onEvent({ type: "ON_TAX_DOCUMENT_SUBMITTED" })
|
|
15277
15282
|
}
|
|
15278
15283
|
),
|
|
15279
|
-
state.verification && /* @__PURE__ */
|
|
15284
|
+
state.verification && /* @__PURE__ */ jsx88(
|
|
15280
15285
|
VerificationOverlay,
|
|
15281
15286
|
{
|
|
15282
15287
|
onClose: () => onEvent({ type: "ON_CLOSE_VERIFICATION" }),
|
|
15283
|
-
children: /* @__PURE__ */
|
|
15288
|
+
children: /* @__PURE__ */ jsx88(
|
|
15284
15289
|
IdentityVerificationContainer,
|
|
15285
15290
|
{
|
|
15286
15291
|
levelName: state.verification.levelName,
|
|
@@ -15291,7 +15296,7 @@ function RequirementsChecklistContainer({
|
|
|
15291
15296
|
)
|
|
15292
15297
|
}
|
|
15293
15298
|
),
|
|
15294
|
-
/* @__PURE__ */
|
|
15299
|
+
/* @__PURE__ */ jsx88(
|
|
15295
15300
|
ConnectWalletModalContainer,
|
|
15296
15301
|
{
|
|
15297
15302
|
isOpen: state.connectWalletOpen,
|
|
@@ -15414,7 +15419,7 @@ function useCentrifugeBuyTransaction(options) {
|
|
|
15414
15419
|
);
|
|
15415
15420
|
const fetchIdRef = useRef23(0);
|
|
15416
15421
|
const isFetchingRef = useRef23(false);
|
|
15417
|
-
const
|
|
15422
|
+
const requestKey2 = request === null ? null : stableKey3(request);
|
|
15418
15423
|
const requestRef = useRef23(request);
|
|
15419
15424
|
requestRef.current = request;
|
|
15420
15425
|
const build = useCallback19(async () => {
|
|
@@ -15464,13 +15469,13 @@ function useCentrifugeBuyTransaction(options) {
|
|
|
15464
15469
|
}, [data]);
|
|
15465
15470
|
const hasSeed = data !== void 0;
|
|
15466
15471
|
useEffect37(() => {
|
|
15467
|
-
if (hasSeed ||
|
|
15472
|
+
if (hasSeed || requestKey2 === null) return;
|
|
15468
15473
|
isFetchingRef.current = false;
|
|
15469
15474
|
build();
|
|
15470
15475
|
return () => {
|
|
15471
15476
|
++fetchIdRef.current;
|
|
15472
15477
|
};
|
|
15473
|
-
}, [build,
|
|
15478
|
+
}, [build, requestKey2, hasSeed]);
|
|
15474
15479
|
const refetch = useCallback19(() => {
|
|
15475
15480
|
build();
|
|
15476
15481
|
}, [build]);
|
|
@@ -15619,30 +15624,8 @@ var OfferAssetCardUi = {
|
|
|
15619
15624
|
logo: OfferLogoUi.fromOffer(detail, tokenMetadata)
|
|
15620
15625
|
})
|
|
15621
15626
|
};
|
|
15622
|
-
|
|
15623
|
-
// src/client/ui/format/date.ts
|
|
15624
|
-
function formatMonthYear(date, locale) {
|
|
15625
|
-
return new Intl.DateTimeFormat(locale, {
|
|
15626
|
-
month: "short",
|
|
15627
|
-
year: "numeric",
|
|
15628
|
-
timeZone: "UTC"
|
|
15629
|
-
}).format(date);
|
|
15630
|
-
}
|
|
15631
15627
|
export {
|
|
15632
|
-
CENTRIFUGE_VAULT_ORDER_REASON_MESSAGES,
|
|
15633
|
-
CentrifugeBuyAmountView,
|
|
15634
|
-
CentrifugeBuyCheckoutContainer,
|
|
15635
|
-
CentrifugeBuyCheckoutView,
|
|
15636
|
-
CentrifugeBuyOrderPlaced,
|
|
15637
|
-
CentrifugeBuyReviewView,
|
|
15638
|
-
CentrifugeCheckoutError,
|
|
15639
15628
|
CentrifugeCheckoutErrorReason,
|
|
15640
|
-
CentrifugeSidebarView,
|
|
15641
|
-
CentrifugeVaultClaimContainer,
|
|
15642
|
-
CentrifugeVaultClaimDialog,
|
|
15643
|
-
CentrifugeVaultClaimRow,
|
|
15644
|
-
CentrifugeVaultClaimView,
|
|
15645
|
-
CentrifugeWalletSelectView,
|
|
15646
15629
|
ChecklistStatus,
|
|
15647
15630
|
CheckoutAssetUi,
|
|
15648
15631
|
CheckoutContainer,
|
|
@@ -15654,22 +15637,14 @@ export {
|
|
|
15654
15637
|
ClientRequirementsNamespaceImpl,
|
|
15655
15638
|
ClientSuperstateSwapNamespaceImpl,
|
|
15656
15639
|
ClientSupportNamespaceImpl,
|
|
15640
|
+
ClientWalletsNamespaceImpl,
|
|
15657
15641
|
CoinListClientInitializationError,
|
|
15658
15642
|
CoinListContext,
|
|
15659
|
-
CoinListContextProvider,
|
|
15660
15643
|
CoinListProvider,
|
|
15661
15644
|
CoinListSignInButton,
|
|
15662
15645
|
CoinListSignInCardContainer,
|
|
15663
|
-
CoinListSignInCardView,
|
|
15664
15646
|
CoinListStyleScope,
|
|
15665
|
-
ConnectWalletModalContainer,
|
|
15666
|
-
ConnectWalletModalView,
|
|
15667
|
-
ConnectedWalletList,
|
|
15668
15647
|
ERC20_BALANCE_POLL_INTERVAL_MS,
|
|
15669
|
-
HttpError,
|
|
15670
|
-
IdentityVerificationContainer,
|
|
15671
|
-
IdentityVerificationView,
|
|
15672
|
-
KycToken,
|
|
15673
15648
|
OAUTH_CODE_VERIFIER_KEY,
|
|
15674
15649
|
OAUTH_STATE_KEY,
|
|
15675
15650
|
OfferAssetCard,
|
|
@@ -15677,136 +15652,56 @@ export {
|
|
|
15677
15652
|
OfferLogoUi,
|
|
15678
15653
|
OfferSaleCard,
|
|
15679
15654
|
OfferSaleCardUi,
|
|
15680
|
-
OffersAssetGrid,
|
|
15681
15655
|
OffersGridContainer,
|
|
15682
|
-
OffersGridView,
|
|
15683
|
-
OndoBuyAmountView,
|
|
15684
|
-
OndoBuyCheckoutContainer,
|
|
15685
|
-
OndoBuyCheckoutView,
|
|
15686
|
-
OndoBuyOrderConfirmed,
|
|
15687
|
-
OndoBuyReviewView,
|
|
15688
|
-
OndoCheckoutError,
|
|
15689
15656
|
OndoCheckoutErrorReason,
|
|
15690
|
-
OndoSellAmountView,
|
|
15691
|
-
OndoSellCheckoutContainer,
|
|
15692
|
-
OndoSellCheckoutView,
|
|
15693
|
-
OndoSellOrderConfirmed,
|
|
15694
|
-
OndoSellReviewView,
|
|
15695
|
-
OndoSidebarView,
|
|
15696
|
-
OndoWalletSelectView,
|
|
15697
|
-
RedactedWalletError,
|
|
15698
|
-
RequirementItem,
|
|
15699
15657
|
RequirementItemUi,
|
|
15700
15658
|
RequirementStatus,
|
|
15701
15659
|
RequirementVariant,
|
|
15702
15660
|
RequirementsChecklistContainer,
|
|
15703
15661
|
RequirementsChecklistView,
|
|
15704
|
-
SlippagePicker,
|
|
15705
|
-
SuperstateAmountView,
|
|
15706
|
-
SuperstateOrderConfirmed,
|
|
15707
|
-
SuperstateReviewView,
|
|
15708
|
-
SuperstateSidebarView,
|
|
15709
|
-
SuperstateSwapCheckoutContainer,
|
|
15710
|
-
SuperstateSwapCheckoutView,
|
|
15711
|
-
SuperstateWalletView,
|
|
15712
|
-
TaxDocumentModalContainer,
|
|
15713
|
-
TaxDocumentModalView,
|
|
15714
|
-
USDC_ICON_URL,
|
|
15715
|
-
USDT_ICON_URL,
|
|
15716
|
-
VerificationOverlay,
|
|
15717
|
-
WalletSelection,
|
|
15718
|
-
authorizeWallet,
|
|
15719
|
-
buyCentrifuge,
|
|
15720
15662
|
centrifugeLoadErrorReason,
|
|
15721
|
-
centrifugeVaultOrderReasonMessage,
|
|
15722
|
-
centrifugeVaultOrderingMessage,
|
|
15723
|
-
claimCentrifugeVault,
|
|
15724
|
-
classifyWalletError,
|
|
15725
|
-
connectExternalWalletFlow,
|
|
15726
15663
|
createCoinListClient,
|
|
15727
|
-
defaultCheckoutConfig,
|
|
15728
15664
|
ensureErc20Allowance,
|
|
15729
|
-
executeOndoSwap,
|
|
15730
|
-
executeSwap,
|
|
15731
|
-
executeTokenSale,
|
|
15732
|
-
formatCountdown,
|
|
15733
|
-
formatMonthYear,
|
|
15734
|
-
formatSaleCardCountdown,
|
|
15735
15665
|
isNotTradable,
|
|
15736
|
-
offerAssetIconUrl,
|
|
15737
|
-
offerIconUrl,
|
|
15738
|
-
offerTokenIdentifier,
|
|
15739
15666
|
ondoLoadErrorReason,
|
|
15740
15667
|
pinoClientLogger,
|
|
15741
|
-
placeCentrifugeRequest,
|
|
15742
|
-
prepareCentrifugeBuy,
|
|
15743
|
-
prepareOndoBuy,
|
|
15744
|
-
prepareOndoSell,
|
|
15745
|
-
primaryCentrifugeVaultOrderReason,
|
|
15746
15668
|
quoteIsStale,
|
|
15747
15669
|
quoteOverAsks,
|
|
15748
|
-
stablecoinIconUrl,
|
|
15749
15670
|
submitErc20Approval,
|
|
15750
15671
|
toInputAssetUi,
|
|
15751
|
-
tokenLogoSrcSet,
|
|
15752
|
-
tokenLogoUrl,
|
|
15753
|
-
tokenMetadataOf,
|
|
15754
|
-
useCentrifugeBuyAmountViewModel,
|
|
15755
15672
|
useCentrifugeBuyCheckoutViewModel,
|
|
15756
|
-
useCentrifugeBuyReviewViewModel,
|
|
15757
15673
|
useCentrifugeBuyTransaction,
|
|
15758
15674
|
useCentrifugeClaim,
|
|
15759
|
-
|
|
15675
|
+
useCentrifugeClaimPositions,
|
|
15760
15676
|
useCentrifugeVaultClaimViewModel,
|
|
15761
|
-
useCentrifugeVaultPositions,
|
|
15762
15677
|
useCentrifugeVaultStatus,
|
|
15763
15678
|
useCentrifugeVaultStatuses,
|
|
15764
|
-
useCentrifugeWalletSelectViewModel,
|
|
15765
|
-
useCheckoutOfferTokenMetadata,
|
|
15766
15679
|
useCoinList,
|
|
15767
15680
|
useCoinListSignInCardViewModel,
|
|
15768
15681
|
useCompleteOAuth,
|
|
15769
15682
|
useConnectWallet,
|
|
15770
|
-
useConnectWalletModalViewModel,
|
|
15771
|
-
useCountdown,
|
|
15772
15683
|
useErc20Balance,
|
|
15773
15684
|
useErc20TokenBalances,
|
|
15774
|
-
useIdentityVerificationViewModel,
|
|
15775
15685
|
useKycToken,
|
|
15776
15686
|
useOfferDetails,
|
|
15777
15687
|
useOffers,
|
|
15778
15688
|
useOffersGridViewModel,
|
|
15779
|
-
useOndoBuyAmountViewModel,
|
|
15780
15689
|
useOndoBuyCheckoutViewModel,
|
|
15781
|
-
useOndoBuyReviewViewModel,
|
|
15782
15690
|
useOndoBuyTransaction,
|
|
15783
15691
|
useOndoPrice,
|
|
15784
|
-
useOndoSellAmountViewModel,
|
|
15785
15692
|
useOndoSellCheckoutViewModel,
|
|
15786
|
-
useOndoSellReviewViewModel,
|
|
15787
15693
|
useOndoSellTransaction,
|
|
15788
|
-
useOndoSidebarViewModel,
|
|
15789
15694
|
useOndoTradingStatus,
|
|
15790
|
-
useOndoWalletSelectViewModel,
|
|
15791
15695
|
useOptionAddresses,
|
|
15792
|
-
usePageVisible,
|
|
15793
15696
|
useParticipations,
|
|
15794
15697
|
useRequirements,
|
|
15795
15698
|
useRequirementsChecklistViewModel,
|
|
15796
|
-
useSuperstateAmountViewModel,
|
|
15797
15699
|
useSuperstateReviewViewModel,
|
|
15798
|
-
useSuperstateSidebarViewModel,
|
|
15799
15700
|
useSuperstateSwapCheckoutViewModel,
|
|
15800
|
-
useSuperstateWalletViewModel,
|
|
15801
15701
|
useSwapOutputToken,
|
|
15802
15702
|
useSwapQuote,
|
|
15803
15703
|
useTaxDocument,
|
|
15804
|
-
useTaxDocumentModalViewModel,
|
|
15805
15704
|
useTokenMetadata,
|
|
15806
|
-
useTokenRegistry
|
|
15807
|
-
validateAmount,
|
|
15808
|
-
validateCentrifugeBuyAmount,
|
|
15809
|
-
validateSellAmount,
|
|
15810
|
-
validateSuperstateAmount
|
|
15705
|
+
useTokenRegistry
|
|
15811
15706
|
};
|
|
15812
15707
|
//# sourceMappingURL=index.js.map
|