@socket.tech/dl-common 1.0.11 → 1.0.12-test.1

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.
@@ -2,3 +2,4 @@ export * from "./address";
2
2
  export * from "./signature";
3
3
  export * from "./kms-signer";
4
4
  export * from "./kms-ethers-signer";
5
+ export * from "./socketSigner";
@@ -18,3 +18,4 @@ __exportStar(require("./address"), exports);
18
18
  __exportStar(require("./signature"), exports);
19
19
  __exportStar(require("./kms-signer"), exports);
20
20
  __exportStar(require("./kms-ethers-signer"), exports);
21
+ __exportStar(require("./socketSigner"), exports);
@@ -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
  }
@@ -139,8 +139,15 @@ class SocketSigner extends relaySigner_1.SocketRelaySigner {
139
139
  throw Error("No Signing Wallet found!");
140
140
  const dataHash = (0, utils_1.keccak256)(utils_1.defaultAbiCoder.encode(["address", "uint256", "bytes"], [transaction.to, (_a = transaction.value) !== null && _a !== void 0 ? _a : 0, (_b = transaction.data) !== null && _b !== void 0 ? _b : "0x"]));
141
141
  const safeParams = await this.safeWrapperContract.safeParams(dataHash, this.signingWallet.address);
142
- console.log(safeParams, "isTxSubmitted");
143
142
  return safeParams[1] !== "0x";
144
143
  }
144
+ async checkAndSendTransaction(transaction) {
145
+ const isSubmitted = await this.isTxHashSubmitted(transaction);
146
+ if (isSubmitted)
147
+ return { txSent: false, txHash: "" };
148
+ const tx = await this.sendTransaction(transaction);
149
+ await tx.wait();
150
+ return { txSent: true, txHash: tx.hash };
151
+ }
145
152
  }
146
153
  exports.SocketSigner = SocketSigner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socket.tech/dl-common",
3
- "version": "1.0.11",
3
+ "version": "1.0.12-test.1",
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.7.0",
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",