@trustware/sdk-staging 1.1.8-staging.8 → 1.1.9-staging.3
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/README.md +0 -2
- package/dist/{blockchain-BONedEsU.d.cts → blockchain-BxAFzp0s.d.cts} +5 -1
- package/dist/{blockchain-BONedEsU.d.ts → blockchain-BxAFzp0s.d.ts} +5 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/{core-BQ0mFnLc.d.ts → core-CwT8Wd1x.d.ts} +32 -4
- package/dist/{core-BjQwlpoI.d.cts → core-Dy_rZl5y.d.cts} +32 -4
- package/dist/core.cjs +69 -32
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +4 -4
- package/dist/core.d.ts +4 -4
- package/dist/core.mjs +69 -32
- package/dist/core.mjs.map +1 -1
- package/dist/{detect-DlbgTrkm.d.cts → detect-DVpECOTa.d.cts} +2 -2
- package/dist/{detect-MWKHLhn9.d.ts → detect-d2PUaxE_.d.ts} +2 -2
- package/dist/index.cjs +699 -333
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -10
- package/dist/index.d.ts +9 -10
- package/dist/index.mjs +653 -287
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-aOd3vkF9.d.ts → manager-B5aklGtm.d.cts} +2 -4
- package/dist/{manager-DKVW7zeh.d.cts → manager-xFiq0SHr.d.ts} +2 -4
- package/dist/smart-account.cjs +1 -2
- package/dist/smart-account.cjs.map +1 -1
- package/dist/smart-account.d.cts +31 -3
- package/dist/smart-account.d.ts +31 -3
- package/dist/smart-account.mjs +1 -2
- package/dist/smart-account.mjs.map +1 -1
- package/dist/{types-MtdjJgwT.d.ts → types-BJY9r-mz.d.ts} +1 -1
- package/dist/{types-B3nKHW6H.d.cts → types-DX3HtFcn.d.cts} +1 -1
- package/dist/wallet.cjs +124 -53
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +4 -4
- package/dist/wallet.d.ts +4 -4
- package/dist/wallet.mjs +124 -53
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +672 -306
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.d.cts +2 -2
- package/dist/widget.d.ts +2 -2
- package/dist/widget.mjs +626 -260
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/wallet.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
import './blockchain-
|
|
1
|
+
import { u as SolanaProviderLike, Q as WalletMeta, h as DetectedWallet, M as WalletId, v as SolanaWalletInterface } from './manager-B5aklGtm.cjs';
|
|
2
|
+
export { A as WagmiBridge, C as WagmiConnector, a1 as WalletSnapshot, a2 as useWalletConnectConnect, Z as useWalletExternalDisconnect, _ as useWalletInfo, $ as useWireDetectionIntoManager, a0 as walletManager } from './manager-B5aklGtm.cjs';
|
|
3
|
+
export { d as autoDetectWallet, e as buildDetectedWalletFromProvider, c as connectDetectedWallet, f as createWalletConnectEntry, t as toWalletInterfaceFromDetected, u as useEIP1193, g as useIsMobile, a as useWagmi, b as useWalletDetection } from './detect-DVpECOTa.cjs';
|
|
4
|
+
import './blockchain-BxAFzp0s.cjs';
|
|
5
5
|
|
|
6
6
|
type SolanaEventHandlers = {
|
|
7
7
|
onConnect?: () => void;
|
package/dist/wallet.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
import './blockchain-
|
|
1
|
+
import { u as SolanaProviderLike, Q as WalletMeta, h as DetectedWallet, M as WalletId, v as SolanaWalletInterface } from './manager-xFiq0SHr.js';
|
|
2
|
+
export { A as WagmiBridge, C as WagmiConnector, a1 as WalletSnapshot, a2 as useWalletConnectConnect, Z as useWalletExternalDisconnect, _ as useWalletInfo, $ as useWireDetectionIntoManager, a0 as walletManager } from './manager-xFiq0SHr.js';
|
|
3
|
+
export { d as autoDetectWallet, e as buildDetectedWalletFromProvider, c as connectDetectedWallet, f as createWalletConnectEntry, t as toWalletInterfaceFromDetected, u as useEIP1193, g as useIsMobile, a as useWagmi, b as useWalletDetection } from './detect-d2PUaxE_.js';
|
|
4
|
+
import './blockchain-BxAFzp0s.js';
|
|
5
5
|
|
|
6
6
|
type SolanaEventHandlers = {
|
|
7
7
|
onConnect?: () => void;
|
package/dist/wallet.mjs
CHANGED
|
@@ -224,7 +224,7 @@ var init_constants = __esm({
|
|
|
224
224
|
"src/constants.ts"() {
|
|
225
225
|
"use strict";
|
|
226
226
|
SDK_NAME = "@trustware/sdk";
|
|
227
|
-
SDK_VERSION = "1.1.
|
|
227
|
+
SDK_VERSION = "1.1.9-staging.3";
|
|
228
228
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
229
229
|
API_PREFIX = "/api";
|
|
230
230
|
WALLETCONNECT_PROJECT_ID = "72ea74c400f5111d43aea638d7d83a24";
|
|
@@ -1313,12 +1313,25 @@ var init_address = __esm({
|
|
|
1313
1313
|
function formatDeepLink(id, currentUrl) {
|
|
1314
1314
|
const enc = encodeURIComponent(currentUrl);
|
|
1315
1315
|
switch (id) {
|
|
1316
|
+
// EVM
|
|
1316
1317
|
case "metamask":
|
|
1317
1318
|
return `metamask://dapp/${currentUrl}`;
|
|
1318
1319
|
case "coinbase":
|
|
1319
1320
|
return `coinbase://wallet/dapp?url=${enc}`;
|
|
1320
1321
|
case "rainbow":
|
|
1321
1322
|
return `rainbow://connect?uri=${enc}`;
|
|
1323
|
+
case "trust":
|
|
1324
|
+
return `https://link.trustwallet.com/open_url?coin_id=60&url=${enc}`;
|
|
1325
|
+
case "okx":
|
|
1326
|
+
return `okx://wallet/dapp/url?dappUrl=${enc}`;
|
|
1327
|
+
// Solana
|
|
1328
|
+
case "phantom-solana":
|
|
1329
|
+
return `phantom://browse/${enc}`;
|
|
1330
|
+
case "solflare":
|
|
1331
|
+
return `solflare://ul/v1/browse/${enc}`;
|
|
1332
|
+
case "backpack":
|
|
1333
|
+
return `https://backpack.app/ul/v1/browse/${enc}?ref=${enc}`;
|
|
1334
|
+
// No confirmed deep link scheme
|
|
1322
1335
|
default:
|
|
1323
1336
|
return void 0;
|
|
1324
1337
|
}
|
|
@@ -1385,6 +1398,8 @@ var init_metadata = __esm({
|
|
|
1385
1398
|
emoji: "\u{1F98A}",
|
|
1386
1399
|
homepage: "https://metamask.io/",
|
|
1387
1400
|
chromeWebStore: "https://chromewebstore.google.com/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
|
|
1401
|
+
ios: "https://apps.apple.com/app/metamask/id1438144202",
|
|
1402
|
+
android: "https://play.google.com/store/apps/details?id=io.metamask",
|
|
1388
1403
|
detectFlags: ["isMetaMask"],
|
|
1389
1404
|
deepLink: (url) => formatDeepLink("metamask", url) ?? ""
|
|
1390
1405
|
},
|
|
@@ -1396,6 +1411,8 @@ var init_metadata = __esm({
|
|
|
1396
1411
|
logo: `${ASSETS_BASE_URL}/assets/wallets/coinbase.svg`,
|
|
1397
1412
|
emoji: "\u{1F7E6}",
|
|
1398
1413
|
homepage: "https://www.coinbase.com/wallet",
|
|
1414
|
+
ios: "https://apps.apple.com/app/coinbase-wallet/id1278383455",
|
|
1415
|
+
android: "https://play.google.com/store/apps/details?id=org.toshi",
|
|
1399
1416
|
detectFlags: ["isCoinbaseWallet"],
|
|
1400
1417
|
deepLink: (url) => formatDeepLink("coinbase", url) ?? ""
|
|
1401
1418
|
},
|
|
@@ -1407,6 +1424,7 @@ var init_metadata = __esm({
|
|
|
1407
1424
|
logo: `${ASSETS_BASE_URL}/assets/wallets/walletconnect.svg`,
|
|
1408
1425
|
emoji: "\u{1FA9D}",
|
|
1409
1426
|
homepage: "https://walletconnect.com/"
|
|
1427
|
+
// No deep link — opens its own modal
|
|
1410
1428
|
},
|
|
1411
1429
|
{
|
|
1412
1430
|
id: "rainbow",
|
|
@@ -1416,8 +1434,38 @@ var init_metadata = __esm({
|
|
|
1416
1434
|
logo: `${ASSETS_BASE_URL}/assets/wallets/rainbow.svg`,
|
|
1417
1435
|
emoji: "\u{1F308}",
|
|
1418
1436
|
homepage: "https://rainbow.me/",
|
|
1419
|
-
|
|
1420
|
-
|
|
1437
|
+
ios: "https://apps.apple.com/app/rainbow-ethereum-wallet/id1457119021",
|
|
1438
|
+
android: "https://play.google.com/store/apps/details?id=me.rainbow",
|
|
1439
|
+
detectFlags: ["isRainbow"],
|
|
1440
|
+
deepLink: (url) => formatDeepLink("rainbow", url) ?? ""
|
|
1441
|
+
},
|
|
1442
|
+
{
|
|
1443
|
+
id: "trust",
|
|
1444
|
+
name: "Trust Wallet",
|
|
1445
|
+
category: "app",
|
|
1446
|
+
ecosystem: "multi",
|
|
1447
|
+
logo: `${ASSETS_BASE_URL}/assets/wallets/trust.svg`,
|
|
1448
|
+
emoji: "\u{1F6E1}\uFE0F",
|
|
1449
|
+
homepage: "https://trustwallet.com/",
|
|
1450
|
+
ios: "https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409",
|
|
1451
|
+
android: "https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",
|
|
1452
|
+
detectFlags: ["isTrustWallet"],
|
|
1453
|
+
deepLink: (url) => formatDeepLink("trust", url) ?? ""
|
|
1454
|
+
// ✅ Added
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
id: "okx",
|
|
1458
|
+
name: "OKX",
|
|
1459
|
+
category: "injected",
|
|
1460
|
+
ecosystem: "evm",
|
|
1461
|
+
logo: `${ASSETS_BASE_URL}/assets/wallets/okx.svg`,
|
|
1462
|
+
emoji: "\u2B1B",
|
|
1463
|
+
homepage: "https://www.okx.com/web3",
|
|
1464
|
+
ios: "https://apps.apple.com/app/okx-buy-bitcoin-eth-crypto/id1327268470",
|
|
1465
|
+
android: "https://play.google.com/store/apps/details?id=com.okinc.okex.gp",
|
|
1466
|
+
detectFlags: ["isOkxWallet"],
|
|
1467
|
+
deepLink: (url) => formatDeepLink("okx", url) ?? ""
|
|
1468
|
+
// ✅ Added
|
|
1421
1469
|
},
|
|
1422
1470
|
{
|
|
1423
1471
|
id: "phantom-evm",
|
|
@@ -1427,7 +1475,10 @@ var init_metadata = __esm({
|
|
|
1427
1475
|
logo: `${ASSETS_BASE_URL}/assets/wallets/phantom.svg`,
|
|
1428
1476
|
emoji: "\u{1F47B}",
|
|
1429
1477
|
homepage: "https://phantom.app/",
|
|
1478
|
+
ios: "https://apps.apple.com/app/phantom-crypto-wallet/id1598432977",
|
|
1479
|
+
android: "https://play.google.com/store/apps/details?id=app.phantom",
|
|
1430
1480
|
detectFlags: ["isPhantom"]
|
|
1481
|
+
// No EVM dapp browser deep link — falls back to app store
|
|
1431
1482
|
},
|
|
1432
1483
|
{
|
|
1433
1484
|
id: "phantom-solana",
|
|
@@ -1437,18 +1488,9 @@ var init_metadata = __esm({
|
|
|
1437
1488
|
logo: `${ASSETS_BASE_URL}/assets/wallets/phantom.svg`,
|
|
1438
1489
|
emoji: "\u{1F47B}",
|
|
1439
1490
|
homepage: "https://phantom.app/",
|
|
1440
|
-
android: "https://play.google.com/store/apps/details?id=app.phantom",
|
|
1441
1491
|
ios: "https://apps.apple.com/app/phantom-crypto-wallet/id1598432977",
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
{
|
|
1445
|
-
id: "metamask-solana",
|
|
1446
|
-
name: "MetaMask (Solana)",
|
|
1447
|
-
category: "injected",
|
|
1448
|
-
ecosystem: "solana",
|
|
1449
|
-
logo: `${ASSETS_BASE_URL}/assets/wallets/metamask.svg`,
|
|
1450
|
-
emoji: "\u{1F98A}",
|
|
1451
|
-
homepage: "https://metamask.io/"
|
|
1492
|
+
android: "https://play.google.com/store/apps/details?id=app.phantom",
|
|
1493
|
+
deepLink: (url) => formatDeepLink("phantom-solana", url) ?? ""
|
|
1452
1494
|
},
|
|
1453
1495
|
{
|
|
1454
1496
|
id: "solflare",
|
|
@@ -1458,7 +1500,9 @@ var init_metadata = __esm({
|
|
|
1458
1500
|
logo: `${ASSETS_BASE_URL}/assets/wallets/solflare-logo.svg`,
|
|
1459
1501
|
emoji: "\u2600\uFE0F",
|
|
1460
1502
|
homepage: "https://solflare.com/",
|
|
1461
|
-
|
|
1503
|
+
ios: "https://apps.apple.com/app/solflare-solana-wallet/id1580902717",
|
|
1504
|
+
android: "https://play.google.com/store/apps/details?id=com.solflare.mobile",
|
|
1505
|
+
deepLink: (url) => formatDeepLink("solflare", url) ?? ""
|
|
1462
1506
|
},
|
|
1463
1507
|
{
|
|
1464
1508
|
id: "backpack",
|
|
@@ -1467,8 +1511,25 @@ var init_metadata = __esm({
|
|
|
1467
1511
|
ecosystem: "solana",
|
|
1468
1512
|
logo: `${ASSETS_BASE_URL}/assets/wallets/backpack-logo.svg`,
|
|
1469
1513
|
emoji: "\u{1F392}",
|
|
1470
|
-
homepage: "https://backpack.app/"
|
|
1514
|
+
homepage: "https://backpack.app/",
|
|
1515
|
+
ios: "https://apps.apple.com/app/backpack-crypto-wallet/id6445964121",
|
|
1516
|
+
android: "https://play.google.com/store/apps/details?id=app.backpack.mobile",
|
|
1517
|
+
deepLink: (url) => formatDeepLink("backpack", url) ?? ""
|
|
1518
|
+
// ✅ Added
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
id: "metamask-solana",
|
|
1522
|
+
name: "MetaMask (Solana)",
|
|
1523
|
+
category: "injected",
|
|
1524
|
+
ecosystem: "solana",
|
|
1525
|
+
logo: `${ASSETS_BASE_URL}/assets/wallets/metamask.svg`,
|
|
1526
|
+
emoji: "\u{1F98A}",
|
|
1527
|
+
homepage: "https://metamask.io/",
|
|
1528
|
+
ios: "https://apps.apple.com/app/metamask/id1438144202",
|
|
1529
|
+
android: "https://play.google.com/store/apps/details?id=io.metamask"
|
|
1530
|
+
// No Solana-specific deep link for MetaMask
|
|
1471
1531
|
},
|
|
1532
|
+
// ── Extension/desktop only — hidden on mobile ─────────────────────────────
|
|
1472
1533
|
{
|
|
1473
1534
|
id: "rabby",
|
|
1474
1535
|
name: "Rabby",
|
|
@@ -1479,6 +1540,7 @@ var init_metadata = __esm({
|
|
|
1479
1540
|
homepage: "https://rabby.io/",
|
|
1480
1541
|
chromeWebStore: "https://chromewebstore.google.com/detail/rabby/acmacodkjbdgmoleebolmdjonilkdbch",
|
|
1481
1542
|
detectFlags: ["isRabby"]
|
|
1543
|
+
// Extension only — no mobile app or deep link
|
|
1482
1544
|
},
|
|
1483
1545
|
{
|
|
1484
1546
|
id: "brave",
|
|
@@ -1489,25 +1551,7 @@ var init_metadata = __esm({
|
|
|
1489
1551
|
emoji: "\u{1F981}",
|
|
1490
1552
|
homepage: "https://brave.com/wallet/",
|
|
1491
1553
|
detectFlags: ["isBraveWallet"]
|
|
1492
|
-
|
|
1493
|
-
{
|
|
1494
|
-
id: "okx",
|
|
1495
|
-
name: "OKX",
|
|
1496
|
-
category: "injected",
|
|
1497
|
-
ecosystem: "evm",
|
|
1498
|
-
logo: `${ASSETS_BASE_URL}/assets/wallets/okx.svg`,
|
|
1499
|
-
emoji: "\u2B1B",
|
|
1500
|
-
homepage: "https://www.okx.com/web3",
|
|
1501
|
-
detectFlags: ["isOkxWallet"]
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
id: "zerion",
|
|
1505
|
-
name: "Zerion",
|
|
1506
|
-
category: "app",
|
|
1507
|
-
ecosystem: "evm",
|
|
1508
|
-
logo: `${ASSETS_BASE_URL}/assets/wallets/zerion.png`,
|
|
1509
|
-
emoji: "\u{1F9FF}",
|
|
1510
|
-
homepage: "https://zerion.io/wallet/"
|
|
1554
|
+
// Built into Brave browser — no standalone deep link
|
|
1511
1555
|
},
|
|
1512
1556
|
{
|
|
1513
1557
|
id: "taho",
|
|
@@ -1518,16 +1562,7 @@ var init_metadata = __esm({
|
|
|
1518
1562
|
emoji: "\u{1F7EA}",
|
|
1519
1563
|
homepage: "https://taho.xyz/",
|
|
1520
1564
|
detectFlags: ["isTally", "isTallyWallet", "isTahoWallet"]
|
|
1521
|
-
|
|
1522
|
-
{
|
|
1523
|
-
id: "trust",
|
|
1524
|
-
name: "Trust Wallet",
|
|
1525
|
-
category: "app",
|
|
1526
|
-
ecosystem: "multi",
|
|
1527
|
-
logo: `${ASSETS_BASE_URL}/assets/wallets/trust.svg`,
|
|
1528
|
-
emoji: "\u{1F6E1}\uFE0F",
|
|
1529
|
-
homepage: "https://trustwallet.com/",
|
|
1530
|
-
detectFlags: ["isTrustWallet"]
|
|
1565
|
+
// Extension only — no mobile app
|
|
1531
1566
|
},
|
|
1532
1567
|
{
|
|
1533
1568
|
id: "bitget",
|
|
@@ -1537,7 +1572,22 @@ var init_metadata = __esm({
|
|
|
1537
1572
|
logo: `${ASSETS_BASE_URL}/assets/wallets/bitget.svg`,
|
|
1538
1573
|
emoji: "\u{1F7E9}",
|
|
1539
1574
|
homepage: "https://web3.bitget.com/",
|
|
1575
|
+
ios: "https://apps.apple.com/app/bitget-wallet-ex-bitkeep/id1395301115",
|
|
1576
|
+
android: "https://play.google.com/store/apps/details?id=com.bitkeep.wallet",
|
|
1540
1577
|
detectFlags: ["isBitGetWallet"]
|
|
1578
|
+
// No public deep link scheme documented
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
id: "zerion",
|
|
1582
|
+
name: "Zerion",
|
|
1583
|
+
category: "app",
|
|
1584
|
+
ecosystem: "evm",
|
|
1585
|
+
logo: `${ASSETS_BASE_URL}/assets/wallets/zerion.png`,
|
|
1586
|
+
emoji: "\u{1F9FF}",
|
|
1587
|
+
homepage: "https://zerion.io/wallet/",
|
|
1588
|
+
ios: "https://apps.apple.com/app/zerion-crypto-defi-wallet/id1456732565",
|
|
1589
|
+
android: "https://play.google.com/store/apps/details?id=io.zerion.android"
|
|
1590
|
+
// Uses WalletConnect URI — not a simple page URL deep link
|
|
1541
1591
|
},
|
|
1542
1592
|
{
|
|
1543
1593
|
id: "safe",
|
|
@@ -1546,7 +1596,10 @@ var init_metadata = __esm({
|
|
|
1546
1596
|
ecosystem: "evm",
|
|
1547
1597
|
logo: `${ASSETS_BASE_URL}/assets/wallets/safe.svg`,
|
|
1548
1598
|
emoji: "\u{1F7E9}",
|
|
1549
|
-
homepage: "https://safe.global/"
|
|
1599
|
+
homepage: "https://safe.global/",
|
|
1600
|
+
ios: "https://apps.apple.com/app/safe-gnosis-safe/id1515759131",
|
|
1601
|
+
android: "https://play.google.com/store/apps/details?id=io.gnosis.safe"
|
|
1602
|
+
// Uses WalletConnect — no dapp browser deep link
|
|
1550
1603
|
},
|
|
1551
1604
|
{
|
|
1552
1605
|
id: "kucoin",
|
|
@@ -1555,7 +1608,10 @@ var init_metadata = __esm({
|
|
|
1555
1608
|
ecosystem: "evm",
|
|
1556
1609
|
logo: `${ASSETS_BASE_URL}/assets/wallets/kucoin.svg`,
|
|
1557
1610
|
emoji: "\u{1F7E6}",
|
|
1558
|
-
homepage: "https://www.kucoin.com/"
|
|
1611
|
+
homepage: "https://www.kucoin.com/",
|
|
1612
|
+
ios: "https://apps.apple.com/app/kucoin-buy-bitcoin-crypto/id1378956601",
|
|
1613
|
+
android: "https://play.google.com/store/apps/details?id=com.kubi.kucoin"
|
|
1614
|
+
// No public deep link scheme documented
|
|
1559
1615
|
}
|
|
1560
1616
|
];
|
|
1561
1617
|
}
|
|
@@ -3420,7 +3476,6 @@ function resolveConfig(input) {
|
|
|
3420
3476
|
defaultSlippage: normalizeSlippage(
|
|
3421
3477
|
input.routes.defaultSlippage ?? DEFAULT_SLIPPAGE
|
|
3422
3478
|
),
|
|
3423
|
-
routeType: input.routes.routeType ?? "swap",
|
|
3424
3479
|
options: {
|
|
3425
3480
|
...input.routes.options
|
|
3426
3481
|
}
|
|
@@ -3885,11 +3940,27 @@ function toSolanaWalletInterface(provider) {
|
|
|
3885
3940
|
serializedTransactionBase64
|
|
3886
3941
|
);
|
|
3887
3942
|
if (provider.signAndSendTransaction) {
|
|
3888
|
-
const
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3943
|
+
const MAX_INTERNAL_ERROR_ATTEMPTS = 3;
|
|
3944
|
+
const INTERNAL_ERROR_RETRY_DELAY_MS = 500;
|
|
3945
|
+
for (let attempt = 1; attempt <= MAX_INTERNAL_ERROR_ATTEMPTS; attempt++) {
|
|
3946
|
+
try {
|
|
3947
|
+
const result = await provider.signAndSendTransaction(transaction, {
|
|
3948
|
+
skipPreflight: true
|
|
3949
|
+
});
|
|
3950
|
+
if (typeof result === "string") return result;
|
|
3951
|
+
if (result?.signature) return result.signature;
|
|
3952
|
+
break;
|
|
3953
|
+
} catch (err) {
|
|
3954
|
+
const code = err?.code;
|
|
3955
|
+
if (code === -32603 && attempt < MAX_INTERNAL_ERROR_ATTEMPTS) {
|
|
3956
|
+
await new Promise(
|
|
3957
|
+
(resolve) => setTimeout(resolve, INTERNAL_ERROR_RETRY_DELAY_MS * attempt)
|
|
3958
|
+
);
|
|
3959
|
+
continue;
|
|
3960
|
+
}
|
|
3961
|
+
throw err;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3893
3964
|
}
|
|
3894
3965
|
if (!provider.signTransaction) {
|
|
3895
3966
|
throw new Error("Connected Solana wallet cannot sign transactions");
|