@socket.tech/dl-common 1.0.11 → 1.0.12
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.
|
@@ -32,4 +32,8 @@ export declare class SocketSigner extends SocketRelaySigner {
|
|
|
32
32
|
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
33
33
|
signMessage(message: ethers.utils.Bytes | string): Promise<string>;
|
|
34
34
|
isTxHashSubmitted(transaction: Deferrable<TransactionRequest>): Promise<boolean>;
|
|
35
|
+
checkAndSendTransaction(transaction: Deferrable<TransactionRequest>): Promise<{
|
|
36
|
+
txSent: boolean;
|
|
37
|
+
txHash: string;
|
|
38
|
+
}>;
|
|
35
39
|
}
|
|
@@ -142,5 +142,13 @@ class SocketSigner extends relaySigner_1.SocketRelaySigner {
|
|
|
142
142
|
console.log(safeParams, "isTxSubmitted");
|
|
143
143
|
return safeParams[1] !== "0x";
|
|
144
144
|
}
|
|
145
|
+
async checkAndSendTransaction(transaction) {
|
|
146
|
+
const isSubmitted = await this.isTxHashSubmitted(transaction);
|
|
147
|
+
if (isSubmitted)
|
|
148
|
+
return { txSent: false, txHash: "" };
|
|
149
|
+
const tx = await this.sendTransaction(transaction);
|
|
150
|
+
await tx.wait();
|
|
151
|
+
return { txSent: true, txHash: tx.hash };
|
|
152
|
+
}
|
|
145
153
|
}
|
|
146
154
|
exports.SocketSigner = SocketSigner;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socket.tech/dl-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"description": "common utilities for socket data layer.",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"@aws-sdk/client-secrets-manager": "3.433.0",
|
|
52
52
|
"@aws-sdk/client-sqs": "3.421.0",
|
|
53
53
|
"@ethersproject/providers": "^5.7.2",
|
|
54
|
-
"@smithy/smithy-client": "3.1.5",
|
|
55
|
-
"@socket.tech/dl-core": "^2.
|
|
54
|
+
"@smithy/smithy-client": "^3.1.5",
|
|
55
|
+
"@socket.tech/dl-core": "^2.17.0-test.3",
|
|
56
56
|
"@socket.tech/ll-common": "^0.0.19",
|
|
57
57
|
"async-redis": "^2.0.0",
|
|
58
58
|
"aws-kms-ethers-signer": "^0.1.3",
|