@coinlist-co/react 0.12.2-rc.7b430dd → 0.12.2-rc.9fb6364
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-MOE5S6CE.js → chunk-BNMF2HMW.js} +114 -4
- package/dist/chunk-BNMF2HMW.js.map +1 -0
- package/dist/{chunk-VH34YC3Q.js → chunk-KRA6EM2L.js} +2 -2
- package/dist/{chunk-DCW7NQXH.js → chunk-STAHYDLY.js} +52 -19
- package/dist/chunk-STAHYDLY.js.map +1 -0
- package/dist/client/index.cjs +322 -96
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +26 -10
- package/dist/client/index.d.ts +26 -10
- package/dist/client/index.js +225 -102
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.cjs +437 -76
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +47 -38
- package/dist/server/index.d.ts +47 -38
- package/dist/server/index.js +316 -61
- package/dist/server/index.js.map +1 -1
- package/dist/time-B5YOQxuh.d.ts +50 -0
- package/dist/time-BY3apBpc.d.cts +50 -0
- package/dist/{token-registry-snapshot-BNBNuDu1.d.ts → token-registry-snapshot-C1NxdBmF.d.ts} +1 -1
- package/dist/{token-registry-snapshot-CqI6dXM_.d.cts → token-registry-snapshot-DyjrA32p.d.cts} +1 -1
- package/dist/{tokens-namespace-CIWBtgt2.d.cts → tokens-namespace-BJfFeowE.d.cts} +53 -1
- package/dist/{tokens-namespace-CIWBtgt2.d.ts → tokens-namespace-BJfFeowE.d.ts} +53 -1
- package/dist/universal/index.cjs +100 -3
- package/dist/universal/index.cjs.map +1 -1
- package/dist/universal/index.d.cts +23 -5
- package/dist/universal/index.d.ts +23 -5
- package/dist/universal/index.js +12 -2
- package/package.json +1 -1
- package/dist/chunk-DCW7NQXH.js.map +0 -1
- package/dist/chunk-MOE5S6CE.js.map +0 -1
- /package/dist/{chunk-VH34YC3Q.js.map → chunk-KRA6EM2L.js.map} +0 -0
package/dist/client/index.js
CHANGED
|
@@ -4,8 +4,10 @@ import {
|
|
|
4
4
|
PINO_LEVEL,
|
|
5
5
|
SDK_LOGGER_NAME,
|
|
6
6
|
loggerOverPino,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
notifySessionExpired,
|
|
8
|
+
publicClients,
|
|
9
|
+
systemDelay
|
|
10
|
+
} from "../chunk-STAHYDLY.js";
|
|
9
11
|
import {
|
|
10
12
|
AuthorizationCode,
|
|
11
13
|
CodeVerifier,
|
|
@@ -39,7 +41,7 @@ import {
|
|
|
39
41
|
ondoQuoteOfferDeadline,
|
|
40
42
|
superstateSwapContractAddress,
|
|
41
43
|
swapSpender
|
|
42
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-KRA6EM2L.js";
|
|
43
45
|
import {
|
|
44
46
|
API_VERSION,
|
|
45
47
|
AssetDecimals,
|
|
@@ -58,6 +60,7 @@ import {
|
|
|
58
60
|
HEADER_USER_AGENT,
|
|
59
61
|
HttpError,
|
|
60
62
|
KycToken,
|
|
63
|
+
Millis,
|
|
61
64
|
NA_AMOUNT_ASSET_UI,
|
|
62
65
|
NotAuthenticatedError,
|
|
63
66
|
OAUTH_PAGE_PATH,
|
|
@@ -67,6 +70,7 @@ import {
|
|
|
67
70
|
RequirementsNamespaceImpl,
|
|
68
71
|
SUPERSTATE_SWAP_ABI,
|
|
69
72
|
SUPPORT_NEW_TICKET_URL,
|
|
73
|
+
SentWith,
|
|
70
74
|
SuperstateSwapNamespaceImpl,
|
|
71
75
|
TokensNamespaceImpl,
|
|
72
76
|
VERIFY_IDENTITY_ACCREDITATION_PATH,
|
|
@@ -80,15 +84,17 @@ import {
|
|
|
80
84
|
formatAmount,
|
|
81
85
|
formatBpsAsPercent,
|
|
82
86
|
formatRawAmount,
|
|
87
|
+
formatShareAmount,
|
|
83
88
|
formattedUsdPrice,
|
|
84
89
|
getNetworkName,
|
|
85
90
|
getUUIDv4,
|
|
86
91
|
internalLogger,
|
|
92
|
+
isRejectedToken,
|
|
87
93
|
parseBlockchainAmount,
|
|
88
94
|
shortenAddress,
|
|
89
95
|
txExplorerUrl,
|
|
90
96
|
usdAmount
|
|
91
|
-
} from "../chunk-
|
|
97
|
+
} from "../chunk-BNMF2HMW.js";
|
|
92
98
|
|
|
93
99
|
// src/client/CoinListProvider.tsx
|
|
94
100
|
import {
|
|
@@ -148,6 +154,159 @@ var ApiClient = class {
|
|
|
148
154
|
}
|
|
149
155
|
};
|
|
150
156
|
|
|
157
|
+
// src/client/core/auth/client-access-token.ts
|
|
158
|
+
var CONFIRM_DELAY = Millis.of(1e3);
|
|
159
|
+
var Generation = {
|
|
160
|
+
initial: 0,
|
|
161
|
+
next: (generation) => generation + 1
|
|
162
|
+
};
|
|
163
|
+
var ClientAccessToken = class {
|
|
164
|
+
constructor(env) {
|
|
165
|
+
this.env = env;
|
|
166
|
+
this.state = { type: "unknown" };
|
|
167
|
+
this.hostCall = null;
|
|
168
|
+
/**
|
|
169
|
+
* Bumped by {@link clear}. A host call that started before a logout must not
|
|
170
|
+
* log the user back in when it lands, so every write checks it first. A 401
|
|
171
|
+
* that arrives after the logout never starts one: `'logged-out'` refuses it.
|
|
172
|
+
*/
|
|
173
|
+
this.generation = Generation.initial;
|
|
174
|
+
this.log = internalLogger(env.logger, "AUTH").child({
|
|
175
|
+
op: "getAccessToken"
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
authState() {
|
|
179
|
+
return this.state.type;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Asks the host for the current token, whatever is cached.
|
|
183
|
+
*
|
|
184
|
+
* Never answers from a host call already in flight: one started before a
|
|
185
|
+
* login (the mount's `init()`, racing the OAuth callback's) would hand back
|
|
186
|
+
* the answer from before the session cookie existed. It waits for that call
|
|
187
|
+
* to settle instead, so that call's verdict still lands, then asks afresh.
|
|
188
|
+
* A logout while it waits still wins.
|
|
189
|
+
*
|
|
190
|
+
* @throws whatever the host's `getAccessToken` throws.
|
|
191
|
+
*/
|
|
192
|
+
async load() {
|
|
193
|
+
const generation = this.generation;
|
|
194
|
+
if (this.hostCall !== null) {
|
|
195
|
+
await this.hostCall.catch(() => null);
|
|
196
|
+
}
|
|
197
|
+
await this.ask(SentWith.noUserToken, generation);
|
|
198
|
+
return this.authState();
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The HTTP pipeline's token source: see {@link TokenTrigger}.
|
|
202
|
+
*
|
|
203
|
+
* @throws whatever the host's `getAccessToken` throws.
|
|
204
|
+
*/
|
|
205
|
+
async get(trigger) {
|
|
206
|
+
const decision = decideToken(this.state, trigger);
|
|
207
|
+
switch (decision.type) {
|
|
208
|
+
case "serve":
|
|
209
|
+
return decision.token;
|
|
210
|
+
case "ask":
|
|
211
|
+
return this.ask(decision.rejected, this.generation);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/** Forgets the token: `auth.logout()`. Never an expiry, so never notifies. */
|
|
215
|
+
clear() {
|
|
216
|
+
this.generation = Generation.next(this.generation);
|
|
217
|
+
this.hostCall = null;
|
|
218
|
+
this.state = { type: "logged-out" };
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* A request that carried no user token was not refused for a token, so the
|
|
222
|
+
* host's first answer stands. One that was is confirmed before it is
|
|
223
|
+
* believed.
|
|
224
|
+
*/
|
|
225
|
+
async ask(rejected, generation) {
|
|
226
|
+
if (generation !== this.generation) {
|
|
227
|
+
return currentToken(this.state);
|
|
228
|
+
}
|
|
229
|
+
const first = await this.callHost();
|
|
230
|
+
switch (rejected.type) {
|
|
231
|
+
case "no-user-token":
|
|
232
|
+
return this.commit(first, generation);
|
|
233
|
+
case "user-token":
|
|
234
|
+
return isFresh(first, rejected) ? this.commit(first, generation) : this.confirm(rejected, generation);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
async confirm(rejected, generation) {
|
|
238
|
+
this.log.warn(() => ({
|
|
239
|
+
msg: "host returned no fresh token; asking again before signing out"
|
|
240
|
+
}));
|
|
241
|
+
await this.env.delay(CONFIRM_DELAY);
|
|
242
|
+
const second = await this.callHost();
|
|
243
|
+
return isFresh(second, rejected) ? this.commit(second, generation) : this.expire(generation);
|
|
244
|
+
}
|
|
245
|
+
/** The host's `getAccessToken`, joining a call already in flight. */
|
|
246
|
+
callHost() {
|
|
247
|
+
if (this.hostCall !== null) {
|
|
248
|
+
this.log.debug(() => ({ msg: "joined a host call already in flight" }));
|
|
249
|
+
return this.hostCall;
|
|
250
|
+
}
|
|
251
|
+
const call = (async () => this.env.getAccessToken())().finally(() => {
|
|
252
|
+
if (this.hostCall === call) {
|
|
253
|
+
this.hostCall = null;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
this.hostCall = call;
|
|
257
|
+
return call;
|
|
258
|
+
}
|
|
259
|
+
commit(token, generation) {
|
|
260
|
+
if (generation !== this.generation) {
|
|
261
|
+
return currentToken(this.state);
|
|
262
|
+
}
|
|
263
|
+
this.state = token === null ? { type: "logged-out" } : { type: "logged-in", token };
|
|
264
|
+
return token;
|
|
265
|
+
}
|
|
266
|
+
expire(generation) {
|
|
267
|
+
if (generation !== this.generation) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
const wasLoggedIn = this.state.type === "logged-in";
|
|
271
|
+
this.state = { type: "logged-out" };
|
|
272
|
+
if (wasLoggedIn) {
|
|
273
|
+
this.log.info(() => ({ msg: "session expired" }));
|
|
274
|
+
notifySessionExpired(this.env.onSessionExpired, this.log);
|
|
275
|
+
}
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
function decideToken(state, trigger) {
|
|
280
|
+
switch (trigger.type) {
|
|
281
|
+
case "before-request":
|
|
282
|
+
return state.type === "unknown" ? { type: "ask", rejected: SentWith.noUserToken } : { type: "serve", token: currentToken(state) };
|
|
283
|
+
case "after-401":
|
|
284
|
+
switch (state.type) {
|
|
285
|
+
// A logout or an expiry verdict: only `load()` may log back in, so a
|
|
286
|
+
// 401 to a request sent before it must not ask the host again.
|
|
287
|
+
case "logged-out":
|
|
288
|
+
return { type: "serve", token: null };
|
|
289
|
+
// Another request may already have renewed since this one was sent.
|
|
290
|
+
case "logged-in":
|
|
291
|
+
return isRejectedToken(state.token, trigger.rejected) ? { type: "ask", rejected: trigger.rejected } : { type: "serve", token: state.token };
|
|
292
|
+
case "unknown":
|
|
293
|
+
return { type: "ask", rejected: trigger.rejected };
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function currentToken(state) {
|
|
298
|
+
switch (state.type) {
|
|
299
|
+
case "logged-in":
|
|
300
|
+
return state.token;
|
|
301
|
+
case "unknown":
|
|
302
|
+
case "logged-out":
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function isFresh(token, rejected) {
|
|
307
|
+
return token !== null && !isRejectedToken(token, rejected);
|
|
308
|
+
}
|
|
309
|
+
|
|
151
310
|
// src/client/core/auth/client-auth-namespace.ts
|
|
152
311
|
var OAUTH_STATE_KEY = "coinlist.oauth_state";
|
|
153
312
|
var OAUTH_CODE_VERIFIER_KEY = "coinlist.oauth_code_verifier";
|
|
@@ -962,35 +1121,38 @@ var ClientSupportNamespaceImpl = class {
|
|
|
962
1121
|
|
|
963
1122
|
// src/client/core/coinlist-client.ts
|
|
964
1123
|
var CoinListClientImpl = class {
|
|
965
|
-
constructor(
|
|
966
|
-
this.
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1124
|
+
constructor(config) {
|
|
1125
|
+
this.config = config;
|
|
1126
|
+
const logger = config.logger ?? null;
|
|
1127
|
+
const accessToken = new ClientAccessToken({
|
|
1128
|
+
getAccessToken: () => config.getAccessToken(),
|
|
1129
|
+
onSessionExpired: config.onSessionExpired,
|
|
1130
|
+
logger,
|
|
1131
|
+
...systemDelay
|
|
1132
|
+
});
|
|
1133
|
+
this.accessToken = accessToken;
|
|
970
1134
|
this.api = new ApiClient(
|
|
971
1135
|
{
|
|
972
|
-
baseUrl:
|
|
1136
|
+
baseUrl: config.baseUrl || PUBLIC_API_BASE_URL,
|
|
973
1137
|
xApiVersion: API_VERSION
|
|
974
1138
|
},
|
|
975
|
-
|
|
1139
|
+
(trigger) => accessToken.get(trigger),
|
|
976
1140
|
logger
|
|
977
1141
|
);
|
|
978
1142
|
const ctx = {
|
|
979
1143
|
api: this.api,
|
|
980
|
-
rpc: publicClients(this.api,
|
|
1144
|
+
rpc: publicClients(this.api, config.rpc, config.logger ?? null),
|
|
981
1145
|
logger,
|
|
982
1146
|
ensureUserAuthenticated: async () => this.ensureAuthenticated()
|
|
983
1147
|
};
|
|
984
|
-
this.auth = new ClientAuthNamespaceImpl(
|
|
985
|
-
getState: () =>
|
|
986
|
-
clearAccessToken: () =>
|
|
987
|
-
this._accessToken = null;
|
|
988
|
-
}
|
|
1148
|
+
this.auth = new ClientAuthNamespaceImpl(config, {
|
|
1149
|
+
getState: () => accessToken.authState(),
|
|
1150
|
+
clearAccessToken: () => accessToken.clear()
|
|
989
1151
|
});
|
|
990
1152
|
this.offers = new OffersNamespaceImpl(ctx);
|
|
991
1153
|
this.requirements = new ClientRequirementsNamespaceImpl(
|
|
992
1154
|
ctx,
|
|
993
|
-
|
|
1155
|
+
config.coinlistBaseUrl
|
|
994
1156
|
);
|
|
995
1157
|
this.wallets = new WalletsNamespaceImpl(ctx);
|
|
996
1158
|
this.erc20 = new Erc20NamespaceImpl(ctx);
|
|
@@ -1002,34 +1164,16 @@ var CoinListClientImpl = class {
|
|
|
1002
1164
|
);
|
|
1003
1165
|
this.ondo = new ClientOndoNamespaceImpl(ctx, this.erc20);
|
|
1004
1166
|
this.tokens = new TokensNamespaceImpl(
|
|
1005
|
-
|
|
1167
|
+
config.tokensBaseUrl ?? NABU_BASE_URL,
|
|
1006
1168
|
logger
|
|
1007
1169
|
);
|
|
1008
1170
|
this.support = new ClientSupportNamespaceImpl(logger);
|
|
1009
1171
|
}
|
|
1010
1172
|
async init() {
|
|
1011
|
-
|
|
1012
|
-
return this.getAuthState();
|
|
1013
|
-
}
|
|
1014
|
-
async fetchAccessToken(refresh) {
|
|
1015
|
-
if (!refresh && this._accessToken !== void 0) return this._accessToken;
|
|
1016
|
-
try {
|
|
1017
|
-
const accessToken = await this._config.getAccessToken();
|
|
1018
|
-
this._accessToken = accessToken;
|
|
1019
|
-
return accessToken;
|
|
1020
|
-
} catch (_) {
|
|
1021
|
-
this._accessToken = null;
|
|
1022
|
-
return null;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
getAuthState() {
|
|
1026
|
-
if (this._accessToken === void 0) {
|
|
1027
|
-
return "unknown";
|
|
1028
|
-
}
|
|
1029
|
-
return this._accessToken !== null ? "logged-in" : "logged-out";
|
|
1173
|
+
return this.accessToken.load();
|
|
1030
1174
|
}
|
|
1031
1175
|
ensureAuthenticated() {
|
|
1032
|
-
if (this.
|
|
1176
|
+
if (this.accessToken.authState() !== "logged-in") {
|
|
1033
1177
|
throw new NotAuthenticatedError();
|
|
1034
1178
|
}
|
|
1035
1179
|
}
|
|
@@ -2282,7 +2426,7 @@ function Modal({ label, onClose, children, className }) {
|
|
|
2282
2426
|
}
|
|
2283
2427
|
|
|
2284
2428
|
// src/client/components/checkout/shared/confirmation/CheckoutConfirmationDialog.tsx
|
|
2285
|
-
import {
|
|
2429
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2286
2430
|
function CheckoutConfirmationDialog({
|
|
2287
2431
|
icon,
|
|
2288
2432
|
title: title2,
|
|
@@ -2308,10 +2452,7 @@ function CheckoutConfirmationDialog({
|
|
|
2308
2452
|
}
|
|
2309
2453
|
)
|
|
2310
2454
|
] }),
|
|
2311
|
-
header
|
|
2312
|
-
/* @__PURE__ */ jsx20(Divider, {}),
|
|
2313
|
-
header
|
|
2314
|
-
] }),
|
|
2455
|
+
header,
|
|
2315
2456
|
/* @__PURE__ */ jsx20(Divider, {}),
|
|
2316
2457
|
/* @__PURE__ */ jsx20(CheckoutDetailList, { rows }),
|
|
2317
2458
|
/* @__PURE__ */ jsx20("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:gap-3", children: actions })
|
|
@@ -2328,6 +2469,7 @@ function AssetSummaryRow({
|
|
|
2328
2469
|
iconSize = 48,
|
|
2329
2470
|
value,
|
|
2330
2471
|
caption,
|
|
2472
|
+
wrapIdentity = false,
|
|
2331
2473
|
className
|
|
2332
2474
|
}) {
|
|
2333
2475
|
return /* @__PURE__ */ jsx21(CoinListStyleScope, { children: /* @__PURE__ */ jsxs15(
|
|
@@ -2346,7 +2488,8 @@ function AssetSummaryRow({
|
|
|
2346
2488
|
{
|
|
2347
2489
|
className: cn(
|
|
2348
2490
|
typeClasses.h4,
|
|
2349
|
-
"clcosdk:
|
|
2491
|
+
"clcosdk:text-text-primary",
|
|
2492
|
+
wrapIdentity ? "clcosdk:break-words" : "clcosdk:truncate"
|
|
2350
2493
|
),
|
|
2351
2494
|
children: asset.name
|
|
2352
2495
|
}
|
|
@@ -2356,7 +2499,8 @@ function AssetSummaryRow({
|
|
|
2356
2499
|
{
|
|
2357
2500
|
className: cn(
|
|
2358
2501
|
typeClasses.subhead,
|
|
2359
|
-
"clcosdk:
|
|
2502
|
+
"clcosdk:text-text-secondary",
|
|
2503
|
+
wrapIdentity ? "clcosdk:break-words" : "clcosdk:truncate"
|
|
2360
2504
|
),
|
|
2361
2505
|
children: asset.symbol
|
|
2362
2506
|
}
|
|
@@ -2399,9 +2543,9 @@ function AssetSummaryRow({
|
|
|
2399
2543
|
}
|
|
2400
2544
|
|
|
2401
2545
|
// src/client/components/checkout/ondo/buy/confirmation/OndoBuyOrderConfirmed.tsx
|
|
2402
|
-
import { Fragment as
|
|
2546
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2403
2547
|
var TITLE2 = "Order confirmed";
|
|
2404
|
-
var
|
|
2548
|
+
var SHARES_RECEIVED_LABEL = "Shares received";
|
|
2405
2549
|
var TOTAL_COST_LABEL = "Total cost";
|
|
2406
2550
|
var PRICE_PER_SHARE_LABEL = "Price per share";
|
|
2407
2551
|
var DELIVERED_TO_LABEL = "Delivered to";
|
|
@@ -2423,16 +2567,9 @@ function OndoBuyOrderConfirmed({
|
|
|
2423
2567
|
icon: /* @__PURE__ */ jsx22(SuccessGlyph, {}),
|
|
2424
2568
|
title: TITLE2,
|
|
2425
2569
|
subtitle: subtitle(state.outputAsset.symbol),
|
|
2426
|
-
header: /* @__PURE__ */ jsx22(
|
|
2427
|
-
AssetSummaryRow,
|
|
2428
|
-
{
|
|
2429
|
-
asset: state.outputAsset,
|
|
2430
|
-
value: state.outputAmount,
|
|
2431
|
-
caption: SHARES_RECEIVED_CAPTION
|
|
2432
|
-
}
|
|
2433
|
-
),
|
|
2570
|
+
header: /* @__PURE__ */ jsx22(AssetSummaryRow, { asset: state.outputAsset, wrapIdentity: true }),
|
|
2434
2571
|
rows: detailRows(state),
|
|
2435
|
-
actions: /* @__PURE__ */ jsxs16(
|
|
2572
|
+
actions: /* @__PURE__ */ jsxs16(Fragment4, { children: [
|
|
2436
2573
|
/* @__PURE__ */ jsx22(ClButton, { variant: "gradient", fullWidth: true, onClick: onClose, children: DONE_LABEL }),
|
|
2437
2574
|
/* @__PURE__ */ jsx22(ExplorerLink, { url: state.txExplorerUrl })
|
|
2438
2575
|
] }),
|
|
@@ -2443,6 +2580,7 @@ function OndoBuyOrderConfirmed({
|
|
|
2443
2580
|
}
|
|
2444
2581
|
function detailRows(state) {
|
|
2445
2582
|
return [
|
|
2583
|
+
{ label: SHARES_RECEIVED_LABEL, value: state.outputAmount },
|
|
2446
2584
|
{ label: TOTAL_COST_LABEL, value: state.totalCost },
|
|
2447
2585
|
{ label: PRICE_PER_SHARE_LABEL, value: state.pricePerShare },
|
|
2448
2586
|
{ label: DELIVERED_TO_LABEL, value: state.recipientAddress }
|
|
@@ -3139,7 +3277,7 @@ function PriceCaption({ price }) {
|
|
|
3139
3277
|
import { Wallet } from "lucide-react";
|
|
3140
3278
|
|
|
3141
3279
|
// src/client/components/checkout/shared/selection/SelectableOptionRow.tsx
|
|
3142
|
-
import { Children, Fragment as
|
|
3280
|
+
import { Children, Fragment as Fragment5 } from "react";
|
|
3143
3281
|
import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3144
3282
|
function SelectableOptionRow({
|
|
3145
3283
|
selected,
|
|
@@ -3226,7 +3364,7 @@ function OptionMetaRow({ children }) {
|
|
|
3226
3364
|
const items = Children.toArray(children).filter(Boolean);
|
|
3227
3365
|
return /* @__PURE__ */ jsx31("div", { className: "clcosdk:flex clcosdk:min-w-0 clcosdk:items-center clcosdk:gap-1.5", children: items.map((item, index) => (
|
|
3228
3366
|
// biome-ignore lint/suspicious/noArrayIndexKey: positional separators, and the list is caller-authored JSX.
|
|
3229
|
-
/* @__PURE__ */ jsxs21(
|
|
3367
|
+
/* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
3230
3368
|
index > 0 && /* @__PURE__ */ jsx31(MetaDot, {}),
|
|
3231
3369
|
item
|
|
3232
3370
|
] }, index)
|
|
@@ -4247,7 +4385,7 @@ function useOndoBuyReviewViewModel({
|
|
|
4247
4385
|
tokenMetadata: outputTokenMetadata
|
|
4248
4386
|
}),
|
|
4249
4387
|
outputAmount: assetAmount(
|
|
4250
|
-
|
|
4388
|
+
formatShareAmount(built.receiveOutputAmount, locale),
|
|
4251
4389
|
ondoSymbol
|
|
4252
4390
|
),
|
|
4253
4391
|
recipientAddress: shortenAddress(active.wallet.address),
|
|
@@ -5066,7 +5204,7 @@ function toOrderConfirmedUi({
|
|
|
5066
5204
|
tokenMetadata: outputTokenMetadata
|
|
5067
5205
|
}),
|
|
5068
5206
|
outputAmount: assetAmount(
|
|
5069
|
-
|
|
5207
|
+
formatShareAmount(order.transaction.receiveOutputAmount, locale),
|
|
5070
5208
|
ondoSymbol
|
|
5071
5209
|
),
|
|
5072
5210
|
totalCost: assetAmount(
|
|
@@ -5316,9 +5454,9 @@ function MaxButton2({
|
|
|
5316
5454
|
|
|
5317
5455
|
// src/client/components/checkout/ondo/sell/confirmation/OndoSellOrderConfirmed.tsx
|
|
5318
5456
|
import { Check as Check2, ExternalLink as ExternalLink2 } from "lucide-react";
|
|
5319
|
-
import { Fragment as
|
|
5457
|
+
import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5320
5458
|
var TITLE7 = "Order confirmed";
|
|
5321
|
-
var
|
|
5459
|
+
var SHARES_SOLD_LABEL = "Shares sold";
|
|
5322
5460
|
var RECEIVED_LABEL = "Received";
|
|
5323
5461
|
var PRICE_PER_SHARE_LABEL3 = "Price per share";
|
|
5324
5462
|
var DELIVERED_TO_LABEL2 = "Delivered to";
|
|
@@ -5341,21 +5479,12 @@ function OndoSellOrderConfirmed({
|
|
|
5341
5479
|
title: TITLE7,
|
|
5342
5480
|
subtitle: subtitle2(state.soldAsset.symbol, state.proceedsSymbol),
|
|
5343
5481
|
header: (
|
|
5344
|
-
// The
|
|
5345
|
-
//
|
|
5346
|
-
|
|
5347
|
-
// for.
|
|
5348
|
-
/* @__PURE__ */ jsx36(
|
|
5349
|
-
AssetSummaryRow,
|
|
5350
|
-
{
|
|
5351
|
-
asset: state.soldAsset,
|
|
5352
|
-
value: state.soldAmount,
|
|
5353
|
-
caption: SHARES_SOLD_CAPTION
|
|
5354
|
-
}
|
|
5355
|
-
)
|
|
5482
|
+
// The header names what was sold. The quantity is a detail row, so a
|
|
5483
|
+
// long fund name and a long share count each get the full width.
|
|
5484
|
+
/* @__PURE__ */ jsx36(AssetSummaryRow, { asset: state.soldAsset, wrapIdentity: true })
|
|
5356
5485
|
),
|
|
5357
5486
|
rows: detailRows3(state),
|
|
5358
|
-
actions: /* @__PURE__ */ jsxs25(
|
|
5487
|
+
actions: /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
5359
5488
|
/* @__PURE__ */ jsx36(ClButton, { variant: "gradient", fullWidth: true, onClick: onClose, children: DONE_LABEL2 }),
|
|
5360
5489
|
/* @__PURE__ */ jsx36(ExplorerLink2, { url: state.txExplorerUrl })
|
|
5361
5490
|
] }),
|
|
@@ -5366,6 +5495,7 @@ function OndoSellOrderConfirmed({
|
|
|
5366
5495
|
}
|
|
5367
5496
|
function detailRows3(state) {
|
|
5368
5497
|
return [
|
|
5498
|
+
{ label: SHARES_SOLD_LABEL, value: state.soldAmount },
|
|
5369
5499
|
{ label: RECEIVED_LABEL, value: state.proceeds },
|
|
5370
5500
|
{ label: PRICE_PER_SHARE_LABEL3, value: state.pricePerShare },
|
|
5371
5501
|
{ label: DELIVERED_TO_LABEL2, value: state.recipientAddress }
|
|
@@ -6687,7 +6817,7 @@ function toOrderConfirmedUi2({
|
|
|
6687
6817
|
tokenMetadata: inputTokenMetadata
|
|
6688
6818
|
}),
|
|
6689
6819
|
soldAmount: assetAmount(
|
|
6690
|
-
|
|
6820
|
+
formatShareAmount(order.transaction.spendInputAmount, locale),
|
|
6691
6821
|
ondoSymbol
|
|
6692
6822
|
),
|
|
6693
6823
|
// The expected proceeds rather than the floor: this dialog reports a sale
|
|
@@ -6923,10 +7053,10 @@ function MaxButton3({ onClick }) {
|
|
|
6923
7053
|
|
|
6924
7054
|
// src/client/components/checkout/superstate/swap/confirmation/SuperstateOrderConfirmed.tsx
|
|
6925
7055
|
import { Check as Check3, ExternalLink as ExternalLink3 } from "lucide-react";
|
|
6926
|
-
import { Fragment as
|
|
7056
|
+
import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6927
7057
|
var TITLE10 = "Order confirmed";
|
|
6928
7058
|
var TOTAL_COST_LABEL2 = "Total cost";
|
|
6929
|
-
var
|
|
7059
|
+
var SHARES_RECEIVED_LABEL2 = "Shares received";
|
|
6930
7060
|
var SHARES_RECEIVED_ESTIMATED_LABEL = "Shares received (estimated)";
|
|
6931
7061
|
var PRICE_PER_SHARE_LABEL5 = "Price per share";
|
|
6932
7062
|
var PRICE_PER_SHARE_ESTIMATED_LABEL = "Price per share (estimated)";
|
|
@@ -6949,15 +7079,9 @@ function SuperstateOrderConfirmed({
|
|
|
6949
7079
|
icon: /* @__PURE__ */ jsx41(SuccessGlyph3, {}),
|
|
6950
7080
|
title: TITLE10,
|
|
6951
7081
|
subtitle: subtitle3(state.asset.symbol),
|
|
6952
|
-
header: /* @__PURE__ */ jsx41(
|
|
6953
|
-
AssetSummaryRow,
|
|
6954
|
-
{
|
|
6955
|
-
asset: state.asset,
|
|
6956
|
-
caption: `Issued by ${state.issuer}`
|
|
6957
|
-
}
|
|
6958
|
-
),
|
|
7082
|
+
header: /* @__PURE__ */ jsx41(AssetSummaryRow, { asset: state.asset, wrapIdentity: true }),
|
|
6959
7083
|
rows: detailRows4(state),
|
|
6960
|
-
actions: /* @__PURE__ */ jsxs29(
|
|
7084
|
+
actions: /* @__PURE__ */ jsxs29(Fragment7, { children: [
|
|
6961
7085
|
/* @__PURE__ */ jsx41(ClButton, { variant: "gradient", fullWidth: true, onClick: onClose, children: DONE_LABEL3 }),
|
|
6962
7086
|
/* @__PURE__ */ jsx41(ExplorerLink3, { url: state.txExplorerUrl })
|
|
6963
7087
|
] }),
|
|
@@ -6971,7 +7095,7 @@ function detailRows4(state) {
|
|
|
6971
7095
|
return [
|
|
6972
7096
|
{ label: TOTAL_COST_LABEL2, value: state.totalCost },
|
|
6973
7097
|
{
|
|
6974
|
-
label: confirmed ?
|
|
7098
|
+
label: confirmed ? SHARES_RECEIVED_LABEL2 : SHARES_RECEIVED_ESTIMATED_LABEL,
|
|
6975
7099
|
value: state.outputAmount
|
|
6976
7100
|
},
|
|
6977
7101
|
{
|
|
@@ -9043,7 +9167,6 @@ function toOrderConfirmedUi3({
|
|
|
9043
9167
|
networkName: getNetworkName(chain),
|
|
9044
9168
|
iconUrl: assetIconUrl
|
|
9045
9169
|
}),
|
|
9046
|
-
issuer: SUPERSTATE_ISSUER_NAME,
|
|
9047
9170
|
outputAmount: assetAmount(
|
|
9048
9171
|
formatAmount(order.outputAmount, locale),
|
|
9049
9172
|
order.outputAsset.symbol
|
|
@@ -9189,7 +9312,7 @@ function renderOndoSide(side, branches) {
|
|
|
9189
9312
|
}
|
|
9190
9313
|
|
|
9191
9314
|
// src/client/components/design-system/ThemedImage.tsx
|
|
9192
|
-
import { Fragment as
|
|
9315
|
+
import { Fragment as Fragment8, jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9193
9316
|
function ThemedImage({
|
|
9194
9317
|
light,
|
|
9195
9318
|
dark,
|
|
@@ -9214,7 +9337,7 @@ function ThemedImage({
|
|
|
9214
9337
|
}
|
|
9215
9338
|
);
|
|
9216
9339
|
}
|
|
9217
|
-
return /* @__PURE__ */ jsxs35(
|
|
9340
|
+
return /* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
9218
9341
|
/* @__PURE__ */ jsx49(
|
|
9219
9342
|
"img",
|
|
9220
9343
|
{
|
|
@@ -10302,7 +10425,7 @@ function StepStatusIcon({ status, className }) {
|
|
|
10302
10425
|
}
|
|
10303
10426
|
|
|
10304
10427
|
// src/client/components/requirements/RequirementItem.tsx
|
|
10305
|
-
import { Fragment as
|
|
10428
|
+
import { Fragment as Fragment9, jsx as jsx59, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
10306
10429
|
var DEFAULT_PENDING = "Under review. We'll notify you when complete.";
|
|
10307
10430
|
var DEFAULT_REJECTED = "Verification rejected.";
|
|
10308
10431
|
var SUPPORT_LINK = "Contact support";
|
|
@@ -10357,7 +10480,7 @@ function RejectedMessage({
|
|
|
10357
10480
|
return message;
|
|
10358
10481
|
}
|
|
10359
10482
|
if (linkAt === -1) {
|
|
10360
|
-
return /* @__PURE__ */ jsxs41(
|
|
10483
|
+
return /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
10361
10484
|
message,
|
|
10362
10485
|
" ",
|
|
10363
10486
|
/* @__PURE__ */ jsx59(
|
|
@@ -10372,7 +10495,7 @@ function RejectedMessage({
|
|
|
10372
10495
|
"."
|
|
10373
10496
|
] });
|
|
10374
10497
|
}
|
|
10375
|
-
return /* @__PURE__ */ jsxs41(
|
|
10498
|
+
return /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
10376
10499
|
message.slice(0, linkAt),
|
|
10377
10500
|
/* @__PURE__ */ jsx59(
|
|
10378
10501
|
"button",
|
|
@@ -10395,7 +10518,7 @@ function WalletActionZone({
|
|
|
10395
10518
|
onRemoveWallet
|
|
10396
10519
|
}) {
|
|
10397
10520
|
if (multiWallet) {
|
|
10398
|
-
return /* @__PURE__ */ jsxs41(
|
|
10521
|
+
return /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
10399
10522
|
/* @__PURE__ */ jsx59(
|
|
10400
10523
|
ConnectedWalletList,
|
|
10401
10524
|
{
|
|
@@ -10416,7 +10539,7 @@ function WalletActionZone({
|
|
|
10416
10539
|
}
|
|
10417
10540
|
if (status === "completed") {
|
|
10418
10541
|
const connected = connectedWallets[0];
|
|
10419
|
-
return /* @__PURE__ */ jsxs41(
|
|
10542
|
+
return /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
10420
10543
|
onAction !== null && /* @__PURE__ */ jsx59(
|
|
10421
10544
|
ClButton,
|
|
10422
10545
|
{
|
|
@@ -10449,7 +10572,7 @@ function WalletActionZone({
|
|
|
10449
10572
|
] });
|
|
10450
10573
|
}
|
|
10451
10574
|
if (status === "rejected") {
|
|
10452
|
-
return /* @__PURE__ */ jsxs41(
|
|
10575
|
+
return /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
10453
10576
|
onAction !== null && /* @__PURE__ */ jsx59(ClButton, { size: "sm", className: "clcosdk:self-start", onClick: onAction, children: "Connect wallet" }),
|
|
10454
10577
|
/* @__PURE__ */ jsx59(
|
|
10455
10578
|
AlertBanner,
|
|
@@ -10571,7 +10694,7 @@ function RequirementItem({
|
|
|
10571
10694
|
}
|
|
10572
10695
|
|
|
10573
10696
|
// src/client/components/requirements/RequirementsChecklistView.tsx
|
|
10574
|
-
import { Fragment as
|
|
10697
|
+
import { Fragment as Fragment10, jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10575
10698
|
function RequirementsChecklistView(props) {
|
|
10576
10699
|
return /* @__PURE__ */ jsx60(CoinListStyleScope, { children: /* @__PURE__ */ jsx60(RequirementsChecklistViewBody, { ...props }) });
|
|
10577
10700
|
}
|
|
@@ -10641,7 +10764,7 @@ function RequirementsChecklistViewBody({
|
|
|
10641
10764
|
onClick: () => onEvent({ type: "ON_CONTINUE" }),
|
|
10642
10765
|
children: "Continue"
|
|
10643
10766
|
}
|
|
10644
|
-
) : /* @__PURE__ */ jsxs42(
|
|
10767
|
+
) : /* @__PURE__ */ jsxs42(Fragment10, { children: [
|
|
10645
10768
|
/* @__PURE__ */ jsx60("div", { className: "clcosdk:flex clcosdk:flex-col clcosdk:divide-y clcosdk:divide-divider", children: state.items.map((row, index) => /* @__PURE__ */ jsx60(
|
|
10646
10769
|
RequirementItem,
|
|
10647
10770
|
{
|
|
@@ -12250,7 +12373,7 @@ function toVerificationUi(verifyingRequirementId, statusById, identityVerificati
|
|
|
12250
12373
|
}
|
|
12251
12374
|
|
|
12252
12375
|
// src/client/components/requirements/RequirementsChecklistContainer.tsx
|
|
12253
|
-
import { Fragment as
|
|
12376
|
+
import { Fragment as Fragment11, jsx as jsx66, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
12254
12377
|
function RequirementsChecklistContainer({
|
|
12255
12378
|
loading,
|
|
12256
12379
|
error,
|
|
@@ -12262,7 +12385,7 @@ function RequirementsChecklistContainer({
|
|
|
12262
12385
|
...options,
|
|
12263
12386
|
enabled
|
|
12264
12387
|
});
|
|
12265
|
-
return /* @__PURE__ */ jsxs46(
|
|
12388
|
+
return /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
12266
12389
|
/* @__PURE__ */ jsx66(
|
|
12267
12390
|
RequirementsChecklistView,
|
|
12268
12391
|
{
|
|
@@ -12273,7 +12396,7 @@ function RequirementsChecklistContainer({
|
|
|
12273
12396
|
className
|
|
12274
12397
|
}
|
|
12275
12398
|
),
|
|
12276
|
-
state.type === "content" && /* @__PURE__ */ jsxs46(
|
|
12399
|
+
state.type === "content" && /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
12277
12400
|
/* @__PURE__ */ jsx66(
|
|
12278
12401
|
TaxDocumentModalContainer,
|
|
12279
12402
|
{
|