@rabby-wallet/gnosis-sdk 1.0.1 → 1.0.2
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/dist/index.js +2 -2
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -5
- package/package.json +1 -1
- package/src/index.ts +6 -4
- package/src/utils.ts +0 -19
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { getSafeSingletonDeployment } from "@gnosis.pm/safe-deployments";
|
|
|
4
4
|
import { toChecksumAddress } from "web3-utils";
|
|
5
5
|
import SafeTransaction from "@gnosis.pm/safe-core-sdk/dist/src/utils/transactions/SafeTransaction";
|
|
6
6
|
import RequestProvider from "./api";
|
|
7
|
-
import { standardizeSafeTransactionData, sameString, generateSignature, generatePreValidatedSignature, estimateGasForTransactionExecution,
|
|
7
|
+
import { standardizeSafeTransactionData, sameString, generateSignature, generatePreValidatedSignature, estimateGasForTransactionExecution, } from "./utils";
|
|
8
8
|
class Safe {
|
|
9
9
|
constructor(safeAddress, version, provider, network = "1") {
|
|
10
10
|
this.owners = [];
|
|
@@ -155,7 +155,7 @@ class Safe {
|
|
|
155
155
|
from: signerAddress,
|
|
156
156
|
};
|
|
157
157
|
const txResponse = await contract.execTransaction(safeTransaction.data.to, safeTransaction.data.value, safeTransaction.data.data, safeTransaction.data.operation, safeTransaction.data.safeTxGas, safeTransaction.data.baseGas, safeTransaction.data.gasPrice, safeTransaction.data.gasToken, safeTransaction.data.refundReceiver, safeTransaction.encodedSignatures(), executionOptions);
|
|
158
|
-
return
|
|
158
|
+
return txResponse;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
export default Safe;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Contract, providers } from "ethers";
|
|
2
2
|
import { OperationType, SafeTransactionData, SafeTransactionDataPartial, SafeSignature, SafeTransaction } from "@gnosis.pm/safe-core-sdk-types";
|
|
3
|
-
import { TransactionOptions, Web3TransactionResult } from "@gnosis.pm/safe-core-sdk/dist/src/utils/transactions/types";
|
|
4
|
-
import { PromiEvent, TransactionReceipt } from "web3-core/types";
|
|
5
3
|
import EthSignSignature from "@gnosis.pm/safe-core-sdk/dist/src/utils/signatures/SafeSignature";
|
|
6
4
|
export declare function sameString(str1: string, str2: string): boolean;
|
|
7
5
|
export declare function isRestrictedAddress(address: string): boolean;
|
|
@@ -12,4 +10,3 @@ export declare function isTxHashSignedWithPrefix(txHash: string, signature: stri
|
|
|
12
10
|
export declare function adjustVInSignature(signature: string, hasPrefix: boolean): string;
|
|
13
11
|
export declare function generateSignature(provider: providers.Web3Provider, hash: string): Promise<EthSignSignature>;
|
|
14
12
|
export declare function estimateGasForTransactionExecution(safeContract: Contract, from: string, tx: SafeTransaction): Promise<number>;
|
|
15
|
-
export declare function toTxResult(promiEvent: PromiEvent<TransactionReceipt>, options?: TransactionOptions): Promise<Web3TransactionResult>;
|
package/dist/utils.js
CHANGED
|
@@ -154,8 +154,3 @@ export async function estimateGasForTransactionExecution(safeContract, from, tx)
|
|
|
154
154
|
return Promise.reject(error);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
export function toTxResult(promiEvent, options) {
|
|
158
|
-
return new Promise((resolve, reject) => promiEvent
|
|
159
|
-
.once("transactionHash", (hash) => resolve({ hash, promiEvent, options }))
|
|
160
|
-
.catch(reject));
|
|
161
|
-
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
generateSignature,
|
|
20
20
|
generatePreValidatedSignature,
|
|
21
21
|
estimateGasForTransactionExecution,
|
|
22
|
-
toTxResult,
|
|
23
22
|
} from "./utils";
|
|
24
23
|
|
|
25
24
|
class Safe {
|
|
@@ -89,7 +88,10 @@ class Safe {
|
|
|
89
88
|
|
|
90
89
|
async getPendingTransactions() {
|
|
91
90
|
const nonce = await this.getNonce();
|
|
92
|
-
const transactions = await this.request.getPendingTransactions(
|
|
91
|
+
const transactions = await this.request.getPendingTransactions(
|
|
92
|
+
this.safeAddress,
|
|
93
|
+
nonce
|
|
94
|
+
);
|
|
93
95
|
|
|
94
96
|
return transactions;
|
|
95
97
|
}
|
|
@@ -251,9 +253,9 @@ class Safe {
|
|
|
251
253
|
safeTransaction.data.refundReceiver,
|
|
252
254
|
safeTransaction.encodedSignatures(),
|
|
253
255
|
executionOptions
|
|
254
|
-
)
|
|
256
|
+
);
|
|
255
257
|
|
|
256
|
-
return
|
|
258
|
+
return txResponse;
|
|
257
259
|
}
|
|
258
260
|
}
|
|
259
261
|
|
package/src/utils.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { BigNumber } from "@ethersproject/bignumber";
|
|
2
2
|
import { Contract, providers } from "ethers";
|
|
3
3
|
import {
|
|
4
|
-
MetaTransactionData,
|
|
5
4
|
OperationType,
|
|
6
5
|
SafeTransactionData,
|
|
7
6
|
SafeTransactionDataPartial,
|
|
8
7
|
SafeSignature,
|
|
9
8
|
SafeTransaction,
|
|
10
9
|
} from "@gnosis.pm/safe-core-sdk-types";
|
|
11
|
-
import {
|
|
12
|
-
TransactionOptions,
|
|
13
|
-
Web3TransactionResult,
|
|
14
|
-
} from "@gnosis.pm/safe-core-sdk/dist/src/utils/transactions/types";
|
|
15
|
-
import { PromiEvent, TransactionReceipt } from "web3-core/types";
|
|
16
10
|
import { bufferToHex, ecrecover, pubToAddress } from "ethereumjs-util";
|
|
17
11
|
import { ZERO_ADDRESS, SENTINEL_ADDRESS } from "./constants";
|
|
18
12
|
import EthSignSignature from "@gnosis.pm/safe-core-sdk/dist/src/utils/signatures/SafeSignature";
|
|
@@ -236,16 +230,3 @@ export async function estimateGasForTransactionExecution(
|
|
|
236
230
|
return Promise.reject(error);
|
|
237
231
|
}
|
|
238
232
|
}
|
|
239
|
-
|
|
240
|
-
export function toTxResult(
|
|
241
|
-
promiEvent: PromiEvent<TransactionReceipt>,
|
|
242
|
-
options?: TransactionOptions
|
|
243
|
-
): Promise<Web3TransactionResult> {
|
|
244
|
-
return new Promise((resolve, reject) =>
|
|
245
|
-
promiEvent
|
|
246
|
-
.once("transactionHash", (hash: string) =>
|
|
247
|
-
resolve({ hash, promiEvent, options })
|
|
248
|
-
)
|
|
249
|
-
.catch(reject)
|
|
250
|
-
);
|
|
251
|
-
}
|