@silentswap/react 0.0.90 → 0.0.91
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.
|
@@ -58,6 +58,28 @@ export function createBitcoinTransactionExecutor(connector, _connection) {
|
|
|
58
58
|
// Send signed PSBT (wallet returns base64)
|
|
59
59
|
const txHash = await connector.sendPsbt(signedPsbt);
|
|
60
60
|
console.log('Bitcoin transaction sent:', txHash);
|
|
61
|
+
// Validate broadcast result — some wallets (e.g. Keplr) resolve even
|
|
62
|
+
// when the mempool rejects the tx (e.g. insufficient fee / RBF error).
|
|
63
|
+
// Without this check the code would continue to bridge monitoring and
|
|
64
|
+
// show "Waiting for bridge" indefinitely.
|
|
65
|
+
if (!txHash || typeof txHash !== 'string' || txHash.trim().length === 0) {
|
|
66
|
+
throw new Error('Bitcoin transaction was not broadcast successfully. The wallet returned an empty transaction ID. Please try again.');
|
|
67
|
+
}
|
|
68
|
+
// Brief delay then verify the transaction is actually in the mempool
|
|
69
|
+
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
70
|
+
try {
|
|
71
|
+
const res = await fetch(`https://mempool.space/api/tx/${txHash}`);
|
|
72
|
+
if (!res.ok) {
|
|
73
|
+
throw new Error('not found');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Transaction not found — likely rejected by the mempool
|
|
78
|
+
// (e.g. RBF feerate too low, dust output, etc.)
|
|
79
|
+
throw new Error(`Bitcoin transaction ${txHash} was not accepted by the network. ` +
|
|
80
|
+
'This usually means the fee rate is too low or there is a conflicting unconfirmed transaction. ' +
|
|
81
|
+
'Please wait for the previous transaction to confirm and try again.');
|
|
82
|
+
}
|
|
61
83
|
return txHash;
|
|
62
84
|
}
|
|
63
85
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silentswap/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.91",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@bigmi/core": "^0.6.5",
|
|
26
26
|
"@ensdomains/ensjs": "^4.2.0",
|
|
27
|
-
"@silentswap/sdk": "0.0.
|
|
28
|
-
"@silentswap/ui-kit": "0.0.
|
|
27
|
+
"@silentswap/sdk": "0.0.91",
|
|
28
|
+
"@silentswap/ui-kit": "0.0.91",
|
|
29
29
|
"@solana/codecs-strings": "^5.1.0",
|
|
30
30
|
"@solana/kit": "^5.1.0",
|
|
31
31
|
"@solana/rpc": "^5.1.0",
|