@trustware/sdk-staging 1.1.17-staging.6 → 1.1.17-staging.7

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.
@@ -12265,7 +12265,7 @@ var init_constants = __esm({
12265
12265
  "src/constants.ts"() {
12266
12266
  "use strict";
12267
12267
  SDK_NAME = "@trustware/sdk";
12268
- SDK_VERSION = "1.1.17-staging.6";
12268
+ SDK_VERSION = "1.1.17-staging.7";
12269
12269
  API_ROOT = "https://bv-staging-api.trustware.io";
12270
12270
  API_PREFIX = "/api";
12271
12271
  }
@@ -12241,7 +12241,7 @@ var init_constants = __esm({
12241
12241
  "src/constants.ts"() {
12242
12242
  "use strict";
12243
12243
  SDK_NAME = "@trustware/sdk";
12244
- SDK_VERSION = "1.1.17-staging.6";
12244
+ SDK_VERSION = "1.1.17-staging.7";
12245
12245
  API_ROOT = "https://bv-staging-api.trustware.io";
12246
12246
  API_PREFIX = "/api";
12247
12247
  }
package/dist/wallet.cjs CHANGED
@@ -305,7 +305,7 @@ var init_constants = __esm({
305
305
  "src/constants.ts"() {
306
306
  "use strict";
307
307
  SDK_NAME = "@trustware/sdk";
308
- SDK_VERSION = "1.1.17-staging.6";
308
+ SDK_VERSION = "1.1.17-staging.7";
309
309
  API_ROOT = "https://bv-staging-api.trustware.io";
310
310
  API_PREFIX = "/api";
311
311
  WALLETCONNECT_PROJECT_ID = "72ea74c400f5111d43aea638d7d83a24";
package/dist/wallet.mjs CHANGED
@@ -279,7 +279,7 @@ var init_constants = __esm({
279
279
  "src/constants.ts"() {
280
280
  "use strict";
281
281
  SDK_NAME = "@trustware/sdk";
282
- SDK_VERSION = "1.1.17-staging.6";
282
+ SDK_VERSION = "1.1.17-staging.7";
283
283
  API_ROOT = "https://bv-staging-api.trustware.io";
284
284
  API_PREFIX = "/api";
285
285
  WALLETCONNECT_PROJECT_ID = "72ea74c400f5111d43aea638d7d83a24";
package/dist/widget.cjs CHANGED
@@ -642,7 +642,7 @@ var init_constants = __esm({
642
642
  "src/constants.ts"() {
643
643
  "use strict";
644
644
  SDK_NAME = "@trustware/sdk";
645
- SDK_VERSION = "1.1.17-staging.6";
645
+ SDK_VERSION = "1.1.17-staging.7";
646
646
  API_ROOT = "https://bv-staging-api.trustware.io";
647
647
  GTM_ID = "GTM-TZDGNCXB";
648
648
  API_PREFIX = "/api";
@@ -37785,6 +37785,26 @@ var init_currency = __esm({
37785
37785
  }
37786
37786
  });
37787
37787
 
37788
+ // src/modes/swap/amountFormat.ts
37789
+ function fmtAmount(n, maxFractionDigits = 6) {
37790
+ if (!isFinite(n) || n === 0) return "0";
37791
+ if (Math.abs(n) < 10 ** -maxFractionDigits) {
37792
+ return n.toLocaleString(void 0, {
37793
+ maximumSignificantDigits: SMALL_AMOUNT_SIGNIFICANT_DIGITS
37794
+ });
37795
+ }
37796
+ return n.toLocaleString(void 0, {
37797
+ maximumFractionDigits: maxFractionDigits
37798
+ });
37799
+ }
37800
+ var SMALL_AMOUNT_SIGNIFICANT_DIGITS;
37801
+ var init_amountFormat = __esm({
37802
+ "src/modes/swap/amountFormat.ts"() {
37803
+ "use strict";
37804
+ SMALL_AMOUNT_SIGNIFICANT_DIGITS = 2;
37805
+ }
37806
+ });
37807
+
37788
37808
  // src/widget/lib/quoteCountdown.ts
37789
37809
  function quoteCountdown(elapsedMs, intervalMs) {
37790
37810
  if (!Number.isFinite(intervalMs) || intervalMs <= 0) {
@@ -39103,10 +39123,6 @@ var init_components2 = __esm({
39103
39123
  });
39104
39124
 
39105
39125
  // src/modes/swap/SwapMode.tsx
39106
- function fmtAmount(n, max = 6) {
39107
- if (!isFinite(n) || n === 0) return "0";
39108
- return n.toLocaleString(void 0, { maximumFractionDigits: max });
39109
- }
39110
39126
  function buildExplorerUrl(hash, chain, backendUrl) {
39111
39127
  if (backendUrl) return backendUrl;
39112
39128
  const base2 = chain?.blockExplorerUrls?.[0];
@@ -40843,249 +40859,34 @@ function SwapMode({
40843
40859
  }
40844
40860
  ),
40845
40861
  completedStr && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SuccessReceiptRow, { label: "Completed", value: completedStr }),
40846
- txHash && (() => {
40847
- const srcUrl = buildExplorerUrl(
40848
- txHash,
40849
- fromChain,
40850
- fromChainTxUrl
40851
- );
40852
- const isCopied = copiedHash === txHash;
40853
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40854
- "div",
40855
- {
40856
- style: {
40857
- display: "flex",
40858
- alignItems: "center",
40859
- justifyContent: "space-between"
40860
- },
40861
- children: [
40862
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { color: colors.mutedForeground }, children: destTxHash ? "Source tx" : "Transaction" }),
40863
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40864
- "div",
40865
- {
40866
- style: {
40867
- display: "inline-flex",
40868
- alignItems: "center",
40869
- gap: spacing[2]
40870
- },
40871
- children: [
40872
- srcUrl && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40873
- "a",
40874
- {
40875
- href: srcUrl,
40876
- target: "_blank",
40877
- rel: "noopener noreferrer",
40878
- style: {
40879
- display: "inline-flex",
40880
- alignItems: "center",
40881
- gap: "0.25rem",
40882
- color: colors.foreground,
40883
- fontWeight: fontWeight.medium,
40884
- textDecorationLine: "underline",
40885
- textDecorationStyle: "dotted",
40886
- textUnderlineOffset: "4px"
40887
- },
40888
- children: [
40889
- txHash.slice(0, 6),
40890
- "\u2026",
40891
- txHash.slice(-4),
40892
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40893
- "svg",
40894
- {
40895
- style: { width: "0.75rem", height: "0.75rem" },
40896
- viewBox: "0 0 24 24",
40897
- fill: "none",
40898
- stroke: "currentColor",
40899
- strokeWidth: 2,
40900
- strokeLinecap: "round",
40901
- strokeLinejoin: "round",
40902
- children: [
40903
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
40904
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("polyline", { points: "15 3 21 3 21 9" }),
40905
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
40906
- ]
40907
- }
40908
- )
40909
- ]
40910
- }
40911
- ),
40912
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
40913
- "button",
40914
- {
40915
- onClick: () => handleCopyHash(txHash),
40916
- title: "Copy full hash",
40917
- style: {
40918
- display: "inline-flex",
40919
- alignItems: "center",
40920
- gap: "0.2rem",
40921
- fontSize: fontSize.xs,
40922
- color: isCopied ? colors.green[500] : colors.mutedForeground,
40923
- backgroundColor: "transparent",
40924
- border: 0,
40925
- cursor: "pointer",
40926
- fontFamily: "inherit",
40927
- padding: 0,
40928
- transition: "color 0.15s"
40929
- },
40930
- children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40931
- "svg",
40932
- {
40933
- style: {
40934
- width: "0.875rem",
40935
- height: "0.875rem"
40936
- },
40937
- viewBox: "0 0 24 24",
40938
- fill: "none",
40939
- stroke: "currentColor",
40940
- strokeWidth: 2,
40941
- strokeLinecap: "round",
40942
- strokeLinejoin: "round",
40943
- children: [
40944
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
40945
- "rect",
40946
- {
40947
- x: "9",
40948
- y: "9",
40949
- width: "13",
40950
- height: "13",
40951
- rx: "2",
40952
- ry: "2"
40953
- }
40954
- ),
40955
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
40956
- ]
40957
- }
40958
- )
40959
- }
40960
- )
40961
- ]
40962
- }
40963
- )
40964
- ]
40965
- }
40966
- );
40967
- })(),
40968
- destTxHash && (() => {
40969
- const destUrl = buildExplorerUrl(
40970
- destTxHash,
40971
- toChain,
40972
- toChainTxUrl
40973
- );
40974
- const isCopied = copiedHash === destTxHash;
40975
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40976
- "div",
40977
- {
40978
- style: {
40979
- display: "flex",
40980
- alignItems: "center",
40981
- justifyContent: "space-between"
40982
- },
40983
- children: [
40984
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { color: colors.mutedForeground }, children: "Destination tx" }),
40985
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40986
- "div",
40987
- {
40988
- style: {
40989
- display: "inline-flex",
40990
- alignItems: "center",
40991
- gap: spacing[2]
40992
- },
40993
- children: [
40994
- destUrl && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
40995
- "a",
40996
- {
40997
- href: destUrl,
40998
- target: "_blank",
40999
- rel: "noopener noreferrer",
41000
- style: {
41001
- display: "inline-flex",
41002
- alignItems: "center",
41003
- gap: "0.25rem",
41004
- color: colors.foreground,
41005
- fontWeight: fontWeight.medium,
41006
- textDecorationLine: "underline",
41007
- textDecorationStyle: "dotted",
41008
- textUnderlineOffset: "4px"
41009
- },
41010
- children: [
41011
- destTxHash.slice(0, 6),
41012
- "\u2026",
41013
- destTxHash.slice(-4),
41014
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
41015
- "svg",
41016
- {
41017
- style: { width: "0.75rem", height: "0.75rem" },
41018
- viewBox: "0 0 24 24",
41019
- fill: "none",
41020
- stroke: "currentColor",
41021
- strokeWidth: 2,
41022
- strokeLinecap: "round",
41023
- strokeLinejoin: "round",
41024
- children: [
41025
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
41026
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("polyline", { points: "15 3 21 3 21 9" }),
41027
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
41028
- ]
41029
- }
41030
- )
41031
- ]
41032
- }
41033
- ),
41034
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
41035
- "button",
41036
- {
41037
- onClick: () => handleCopyHash(destTxHash),
41038
- title: "Copy full hash",
41039
- style: {
41040
- display: "inline-flex",
41041
- alignItems: "center",
41042
- fontSize: fontSize.xs,
41043
- color: isCopied ? colors.green[500] : colors.mutedForeground,
41044
- backgroundColor: "transparent",
41045
- border: 0,
41046
- cursor: "pointer",
41047
- fontFamily: "inherit",
41048
- padding: 0,
41049
- transition: "color 0.15s"
41050
- },
41051
- children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
41052
- "svg",
41053
- {
41054
- style: {
41055
- width: "0.875rem",
41056
- height: "0.875rem"
41057
- },
41058
- viewBox: "0 0 24 24",
41059
- fill: "none",
41060
- stroke: "currentColor",
41061
- strokeWidth: 2,
41062
- strokeLinecap: "round",
41063
- strokeLinejoin: "round",
41064
- children: [
41065
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
41066
- "rect",
41067
- {
41068
- x: "9",
41069
- y: "9",
41070
- width: "13",
41071
- height: "13",
41072
- rx: "2",
41073
- ry: "2"
41074
- }
41075
- ),
41076
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
41077
- ]
41078
- }
41079
- )
41080
- }
41081
- )
41082
- ]
41083
- }
41084
- )
41085
- ]
41086
- }
41087
- );
41088
- })()
40862
+ txHash && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
40863
+ SuccessTxHashRow,
40864
+ {
40865
+ label: destTxHash ? "Source tx" : "Transaction",
40866
+ hash: txHash,
40867
+ explorerUrl: buildExplorerUrl(
40868
+ txHash,
40869
+ fromChain,
40870
+ fromChainTxUrl
40871
+ ),
40872
+ isCopied: copiedHash === txHash,
40873
+ onCopy: handleCopyHash
40874
+ }
40875
+ ),
40876
+ destTxHash && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
40877
+ SuccessTxHashRow,
40878
+ {
40879
+ label: "Destination tx",
40880
+ hash: destTxHash,
40881
+ explorerUrl: buildExplorerUrl(
40882
+ destTxHash,
40883
+ toChain,
40884
+ toChainTxUrl
40885
+ ),
40886
+ isCopied: copiedHash === destTxHash,
40887
+ onCopy: handleCopyHash
40888
+ }
40889
+ )
41089
40890
  ]
41090
40891
  }
41091
40892
  )
@@ -43434,6 +43235,119 @@ function SuccessReceiptRow({
43434
43235
  }
43435
43236
  );
43436
43237
  }
43238
+ function SuccessTxHashRow({
43239
+ label,
43240
+ hash,
43241
+ explorerUrl,
43242
+ isCopied,
43243
+ onCopy
43244
+ }) {
43245
+ const shortHash = `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
43246
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
43247
+ "div",
43248
+ {
43249
+ style: {
43250
+ display: "flex",
43251
+ alignItems: "center",
43252
+ justifyContent: "space-between"
43253
+ },
43254
+ children: [
43255
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { style: { color: colors.mutedForeground }, children: label }),
43256
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
43257
+ "div",
43258
+ {
43259
+ style: {
43260
+ display: "inline-flex",
43261
+ alignItems: "center",
43262
+ gap: spacing[2]
43263
+ },
43264
+ children: [
43265
+ explorerUrl ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
43266
+ "a",
43267
+ {
43268
+ href: explorerUrl,
43269
+ target: "_blank",
43270
+ rel: "noopener noreferrer",
43271
+ style: {
43272
+ display: "inline-flex",
43273
+ alignItems: "center",
43274
+ gap: "0.25rem",
43275
+ color: colors.foreground,
43276
+ fontWeight: fontWeight.medium,
43277
+ textDecorationLine: "underline",
43278
+ textDecorationStyle: "dotted",
43279
+ textUnderlineOffset: "4px"
43280
+ },
43281
+ children: [
43282
+ shortHash,
43283
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
43284
+ "svg",
43285
+ {
43286
+ style: { width: "0.75rem", height: "0.75rem" },
43287
+ viewBox: "0 0 24 24",
43288
+ fill: "none",
43289
+ stroke: "currentColor",
43290
+ strokeWidth: 2,
43291
+ strokeLinecap: "round",
43292
+ strokeLinejoin: "round",
43293
+ children: [
43294
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
43295
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("polyline", { points: "15 3 21 3 21 9" }),
43296
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
43297
+ ]
43298
+ }
43299
+ )
43300
+ ]
43301
+ }
43302
+ ) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
43303
+ "span",
43304
+ {
43305
+ style: { color: colors.foreground, fontWeight: fontWeight.medium },
43306
+ children: shortHash
43307
+ }
43308
+ ),
43309
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
43310
+ "button",
43311
+ {
43312
+ onClick: () => onCopy(hash),
43313
+ title: "Copy full hash",
43314
+ style: {
43315
+ display: "inline-flex",
43316
+ alignItems: "center",
43317
+ fontSize: fontSize.xs,
43318
+ color: isCopied ? colors.green[500] : colors.mutedForeground,
43319
+ backgroundColor: "transparent",
43320
+ border: 0,
43321
+ cursor: "pointer",
43322
+ fontFamily: "inherit",
43323
+ padding: 0,
43324
+ transition: "color 0.15s"
43325
+ },
43326
+ children: isCopied ? "Copied!" : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
43327
+ "svg",
43328
+ {
43329
+ style: { width: "0.875rem", height: "0.875rem" },
43330
+ viewBox: "0 0 24 24",
43331
+ fill: "none",
43332
+ stroke: "currentColor",
43333
+ strokeWidth: 2,
43334
+ strokeLinecap: "round",
43335
+ strokeLinejoin: "round",
43336
+ children: [
43337
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
43338
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
43339
+ ]
43340
+ }
43341
+ )
43342
+ }
43343
+ )
43344
+ ]
43345
+ }
43346
+ )
43347
+ ]
43348
+ }
43349
+ );
43350
+ }
43437
43351
  function ProcessingStepNode({
43438
43352
  active,
43439
43353
  done,
@@ -43590,6 +43504,7 @@ var init_SwapMode = __esm({
43590
43504
  init_SwapTokenSelect();
43591
43505
  init_VaultDiscovery();
43592
43506
  init_currency();
43507
+ init_amountFormat();
43593
43508
  init_quoteCountdown();
43594
43509
  init_components2();
43595
43510
  import_jsx_runtime57 = require("react/jsx-runtime");