@trustware/sdk-staging 1.1.4-staging.35 → 1.1.4-staging.37
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/constants.cjs +2 -2
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +2 -2
- package/dist/constants.mjs.map +1 -1
- package/dist/{core-Dioy8MFJ.d.ts → core-DdZA_JEU.d.ts} +1 -1
- package/dist/{core-DMGD8t0k.d.cts → core-vKz997pQ.d.cts} +1 -1
- package/dist/core.cjs +13 -42
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.mjs +13 -42
- package/dist/core.mjs.map +1 -1
- package/dist/index.cjs +38 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +38 -54
- package/dist/index.mjs.map +1 -1
- package/dist/wallet.cjs +2 -30
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.mjs +2 -30
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +38 -54
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.mjs +38 -54
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -75,49 +75,7 @@ var init_config = __esm({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
// src/constants.ts
|
|
79
|
-
var SDK_NAME, SDK_VERSION, API_ROOT, GTM_ID, API_PREFIX, ASSETS_BASE_URL, WALLETCONNECT_PROJECT_ID;
|
|
80
|
-
var init_constants = __esm({
|
|
81
|
-
"src/constants.ts"() {
|
|
82
|
-
"use strict";
|
|
83
|
-
SDK_NAME = "@trustware/sdk";
|
|
84
|
-
SDK_VERSION = "1.1.4-staging.35";
|
|
85
|
-
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
86
|
-
GTM_ID = "GTM-TZDGNCXB";
|
|
87
|
-
API_PREFIX = "/api";
|
|
88
|
-
ASSETS_BASE_URL = "https://app.trustware.io";
|
|
89
|
-
WALLETCONNECT_PROJECT_ID = "4ead125c-63be-4b1a-a835-cef2dce67b84";
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
78
|
// src/config/merge.ts
|
|
94
|
-
function resolveWalletConnectConfig(input) {
|
|
95
|
-
if (input?.disabled) return void 0;
|
|
96
|
-
const projectId2 = input?.projectId ?? WALLETCONNECT_PROJECT_ID;
|
|
97
|
-
return {
|
|
98
|
-
projectId: projectId2,
|
|
99
|
-
chains: input?.chains ?? [1],
|
|
100
|
-
// Default to Ethereum mainnet
|
|
101
|
-
optionalChains: input?.optionalChains ?? [
|
|
102
|
-
1,
|
|
103
|
-
10,
|
|
104
|
-
56,
|
|
105
|
-
137,
|
|
106
|
-
8453,
|
|
107
|
-
42161,
|
|
108
|
-
43114
|
|
109
|
-
],
|
|
110
|
-
// ETH, OP, BSC, Polygon, Base, Arbitrum, Avalanche
|
|
111
|
-
metadata: {
|
|
112
|
-
name: input?.metadata?.name ?? "Trustware",
|
|
113
|
-
description: input?.metadata?.description ?? "Cross-chain bridge & top-up",
|
|
114
|
-
url: input?.metadata?.url ?? "https://trustware.io",
|
|
115
|
-
icons: input?.metadata?.icons ?? ["https://app.trustware.io/icon.png"]
|
|
116
|
-
},
|
|
117
|
-
relayUrl: input?.relayUrl,
|
|
118
|
-
showQrModal: input?.showQrModal ?? true
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
79
|
function deepMerge(base, patch) {
|
|
122
80
|
if (!patch) return { ...base };
|
|
123
81
|
const out = Array.isArray(base) ? [...base] : { ...base };
|
|
@@ -172,7 +130,7 @@ function resolveConfig(input) {
|
|
|
172
130
|
onRateLimited: input.retry?.onRateLimited,
|
|
173
131
|
onRateLimitApproaching: input.retry?.onRateLimitApproaching
|
|
174
132
|
};
|
|
175
|
-
const walletConnect =
|
|
133
|
+
const walletConnect = input.walletConnect;
|
|
176
134
|
const features = {
|
|
177
135
|
tokensPagination: input.features?.tokensPagination ?? DEFAULT_FEATURE_FLAGS.tokensPagination,
|
|
178
136
|
balanceStreaming: input.features?.balanceStreaming ?? DEFAULT_FEATURE_FLAGS.balanceStreaming,
|
|
@@ -197,7 +155,6 @@ var init_merge = __esm({
|
|
|
197
155
|
"use strict";
|
|
198
156
|
init_defaults();
|
|
199
157
|
init_config();
|
|
200
|
-
init_constants();
|
|
201
158
|
}
|
|
202
159
|
});
|
|
203
160
|
|
|
@@ -284,6 +241,21 @@ var init_store = __esm({
|
|
|
284
241
|
}
|
|
285
242
|
});
|
|
286
243
|
|
|
244
|
+
// src/constants.ts
|
|
245
|
+
var SDK_NAME, SDK_VERSION, API_ROOT, GTM_ID, API_PREFIX, WALLETCONNECT_PROJECT_ID, ASSETS_BASE_URL;
|
|
246
|
+
var init_constants = __esm({
|
|
247
|
+
"src/constants.ts"() {
|
|
248
|
+
"use strict";
|
|
249
|
+
SDK_NAME = "@trustware/sdk";
|
|
250
|
+
SDK_VERSION = "1.1.4-staging.37";
|
|
251
|
+
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
252
|
+
GTM_ID = "GTM-TZDGNCXB";
|
|
253
|
+
API_PREFIX = "/api";
|
|
254
|
+
WALLETCONNECT_PROJECT_ID = "72ea74c400f5111d43aea638d7d83a24";
|
|
255
|
+
ASSETS_BASE_URL = "https://app.trustware.io";
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
287
259
|
// src/config/index.ts
|
|
288
260
|
var init_config2 = __esm({
|
|
289
261
|
"src/config/index.ts"() {
|
|
@@ -11808,7 +11780,6 @@ function PaymentOptionRow({
|
|
|
11808
11780
|
{
|
|
11809
11781
|
type: "button",
|
|
11810
11782
|
onClick,
|
|
11811
|
-
disabled,
|
|
11812
11783
|
style: {
|
|
11813
11784
|
width: "100%",
|
|
11814
11785
|
display: "flex",
|
|
@@ -12435,10 +12406,7 @@ var import_react32 = require("react");
|
|
|
12435
12406
|
// src/config/walletconnect.ts
|
|
12436
12407
|
var import_appkit_universal_connector = require("@reown/appkit-universal-connector");
|
|
12437
12408
|
init_store();
|
|
12438
|
-
|
|
12439
|
-
if (!projectId) {
|
|
12440
|
-
throw new Error("Project ID is not defined");
|
|
12441
|
-
}
|
|
12409
|
+
init_constants();
|
|
12442
12410
|
var solanaMainnet = {
|
|
12443
12411
|
id: 1,
|
|
12444
12412
|
chainNamespace: "solana",
|
|
@@ -12505,7 +12473,9 @@ var seiMainnet = {
|
|
|
12505
12473
|
};
|
|
12506
12474
|
var universalConnectorPromise = null;
|
|
12507
12475
|
function resolvedMetadata() {
|
|
12508
|
-
const
|
|
12476
|
+
const cfg = TrustwareConfigStore.peek();
|
|
12477
|
+
const walletConnect = cfg ? cfg?.walletConnect : void 0;
|
|
12478
|
+
const configured = walletConnect?.metadata;
|
|
12509
12479
|
const pageUrl = typeof window !== "undefined" && window.location?.origin ? window.location.origin : configured?.url;
|
|
12510
12480
|
return {
|
|
12511
12481
|
name: configured?.name ?? "Trustware",
|
|
@@ -12514,7 +12484,14 @@ function resolvedMetadata() {
|
|
|
12514
12484
|
icons: configured?.icons?.length ? configured.icons : ["https://app.trustware.io/icon.png"]
|
|
12515
12485
|
};
|
|
12516
12486
|
}
|
|
12517
|
-
async function getUniversalConnector() {
|
|
12487
|
+
async function getUniversalConnector(walletCfg) {
|
|
12488
|
+
const projectId = walletCfg?.projectId ?? WALLETCONNECT_PROJECT_ID;
|
|
12489
|
+
if (!projectId) {
|
|
12490
|
+
console.warn(
|
|
12491
|
+
"[Trustware SDK] WalletConnect disabled: no projectId. Set TRUSTWARE_WALLETCONNECT_PROJECT_ID at build time or pass walletConnect.projectId in config."
|
|
12492
|
+
);
|
|
12493
|
+
return void 0;
|
|
12494
|
+
}
|
|
12518
12495
|
if (!universalConnectorPromise) {
|
|
12519
12496
|
universalConnectorPromise = import_appkit_universal_connector.UniversalConnector.init({
|
|
12520
12497
|
projectId,
|
|
@@ -12548,6 +12525,7 @@ async function getUniversalConnector() {
|
|
|
12548
12525
|
}
|
|
12549
12526
|
|
|
12550
12527
|
// src/widget/features/wallet/hooks/useHomeWalletActions.ts
|
|
12528
|
+
init_config2();
|
|
12551
12529
|
function useHomeWalletActions({
|
|
12552
12530
|
connectWallet,
|
|
12553
12531
|
detectedWallets,
|
|
@@ -12559,6 +12537,15 @@ function useHomeWalletActions({
|
|
|
12559
12537
|
const [universalConnector, setUniversalConnector] = (0, import_react32.useState)();
|
|
12560
12538
|
const cryptoDropdownRef = (0, import_react32.useRef)(null);
|
|
12561
12539
|
const fiatDropdownRef = (0, import_react32.useRef)(null);
|
|
12540
|
+
(0, import_react32.useEffect)(() => {
|
|
12541
|
+
if (typeof window === "undefined") {
|
|
12542
|
+
return;
|
|
12543
|
+
}
|
|
12544
|
+
const walletConnect = TrustwareConfigStore.peek()?.walletConnect;
|
|
12545
|
+
getUniversalConnector(walletConnect).then(
|
|
12546
|
+
setUniversalConnector
|
|
12547
|
+
);
|
|
12548
|
+
}, [TrustwareConfigStore.peek()?.walletConnect]);
|
|
12562
12549
|
(0, import_react32.useEffect)(() => {
|
|
12563
12550
|
const handleClickOutside = (event) => {
|
|
12564
12551
|
if (cryptoDropdownRef.current && !cryptoDropdownRef.current.contains(event.target)) {
|
|
@@ -12571,9 +12558,6 @@ function useHomeWalletActions({
|
|
|
12571
12558
|
document.addEventListener("mousedown", handleClickOutside);
|
|
12572
12559
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
12573
12560
|
}, []);
|
|
12574
|
-
(0, import_react32.useEffect)(() => {
|
|
12575
|
-
getUniversalConnector().then(setUniversalConnector);
|
|
12576
|
-
}, []);
|
|
12577
12561
|
const { resetNavigation } = useDepositNavigationState("home");
|
|
12578
12562
|
const handleWalletSelect = async (wallet) => {
|
|
12579
12563
|
setIsCryptoDropdownOpen(false);
|