@cryptorubic/web3 1.0.0-alpha.no-sdk.37 → 1.0.0-alpha.no-sdk.38
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/package.json
CHANGED
|
@@ -23,7 +23,7 @@ class BitcoinAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSign
|
|
|
23
23
|
return this.transfer(params.txOptions);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
async transfer(txConfig
|
|
26
|
+
async transfer(txConfig) {
|
|
27
27
|
const hashPromise = new Promise((resolve, reject) => {
|
|
28
28
|
this.wallet.request({
|
|
29
29
|
method: 'transfer',
|
|
@@ -45,7 +45,7 @@ class BitcoinAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSign
|
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
47
|
const hash = txHash;
|
|
48
|
-
|
|
48
|
+
txConfig?.onTransactionHash?.(hash);
|
|
49
49
|
resolve(hash);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
@@ -62,7 +62,7 @@ class BitcoinAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSign
|
|
|
62
62
|
throw new Error('Failed to transfer funds');
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
async sendPsbtTransaction(txConfig
|
|
65
|
+
async sendPsbtTransaction(txConfig) {
|
|
66
66
|
const hashPromise = new Promise((resolve, reject) => {
|
|
67
67
|
this.wallet.request({
|
|
68
68
|
method: 'sign_psbt',
|
|
@@ -82,7 +82,7 @@ class BitcoinAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSign
|
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
const txData = txHash;
|
|
85
|
-
|
|
85
|
+
txConfig.onTransactionHash?.(txData.result.txId);
|
|
86
86
|
resolve(txData.result.txId);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
@@ -100,7 +100,7 @@ class BitcoinAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSign
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
async getSrcStatusRecursive(srcTxHash) {
|
|
103
|
-
const srcTxStatus = await this.getSrcTxStatus(
|
|
103
|
+
const srcTxStatus = await this.getSrcTxStatus(srcTxHash);
|
|
104
104
|
if (srcTxStatus === tx_status_1.TX_STATUS.FAIL || srcTxStatus === tx_status_1.TX_STATUS.SUCCESS) {
|
|
105
105
|
return {
|
|
106
106
|
status: srcTxStatus,
|
|
@@ -118,14 +118,9 @@ class BitcoinAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSign
|
|
|
118
118
|
const { confirmations } = await this.httpClient.get(url);
|
|
119
119
|
return confirmations > 0 ? tx_status_1.TX_STATUS.SUCCESS : tx_status_1.TX_STATUS.PENDING;
|
|
120
120
|
}
|
|
121
|
-
async getSrcTxStatus(
|
|
121
|
+
async getSrcTxStatus(srcTxHash) {
|
|
122
122
|
try {
|
|
123
123
|
const status = await this.getTransactionStatus(srcTxHash);
|
|
124
|
-
if (status === tx_status_1.TX_STATUS.FAIL && blockchain === core_1.BLOCKCHAIN_NAME.ZK_SYNC) {
|
|
125
|
-
const zkSyncAwarenessTime = 4000;
|
|
126
|
-
await (0, waitFor_1.waitFor)(zkSyncAwarenessTime);
|
|
127
|
-
return this.getTransactionStatus(srcTxHash);
|
|
128
|
-
}
|
|
129
124
|
return status;
|
|
130
125
|
}
|
|
131
126
|
catch {
|