@rabby-wallet/gnosis-sdk 1.0.2 → 1.0.3
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.d.ts +3 -3
- package/dist/index.js +7 -6
- package/package.json +1 -1
- package/src/index.ts +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -16,13 +16,13 @@ declare class Safe {
|
|
|
16
16
|
network: string;
|
|
17
17
|
constructor(safeAddress: string, version: string, provider: providers.Web3Provider, network?: string);
|
|
18
18
|
static getSafeInfo(safeAddress: string, network: string): Promise<SafeInfo>;
|
|
19
|
+
static getPendingTransactions(safeAddress: string, network: string): Promise<{
|
|
20
|
+
results: import("./api").SafeTransactionItem[];
|
|
21
|
+
}>;
|
|
19
22
|
init(): Promise<void>;
|
|
20
23
|
getOwners(): Promise<string[]>;
|
|
21
24
|
getThreshold(): Promise<any>;
|
|
22
25
|
getNonce(): Promise<number>;
|
|
23
|
-
getPendingTransactions(): Promise<{
|
|
24
|
-
results: import("./api").SafeTransactionItem[];
|
|
25
|
-
}>;
|
|
26
26
|
buildTransaction(data: SafeTransactionDataPartial): Promise<SafeTransaction>;
|
|
27
27
|
getTransactionHash(transaction: SafeTransaction): Promise<any>;
|
|
28
28
|
signTransactionHash(hash: string): Promise<SafeSignature>;
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,13 @@ class Safe {
|
|
|
26
26
|
}
|
|
27
27
|
static getSafeInfo(safeAddress, network) {
|
|
28
28
|
const request = new RequestProvider(network);
|
|
29
|
-
return request.getSafeInfo(safeAddress);
|
|
29
|
+
return request.getSafeInfo(toChecksumAddress(safeAddress));
|
|
30
|
+
}
|
|
31
|
+
static async getPendingTransactions(safeAddress, network) {
|
|
32
|
+
const request = new RequestProvider(network);
|
|
33
|
+
const nonce = (await request.getSafeInfo(toChecksumAddress(safeAddress))).nonce;
|
|
34
|
+
const transactions = await request.getPendingTransactions(safeAddress, nonce);
|
|
35
|
+
return transactions;
|
|
30
36
|
}
|
|
31
37
|
async init() {
|
|
32
38
|
const safeInfo = await Safe.getSafeInfo(this.safeAddress, this.network);
|
|
@@ -49,11 +55,6 @@ class Safe {
|
|
|
49
55
|
const nonce = await this.contract.nonce();
|
|
50
56
|
return nonce.toNumber();
|
|
51
57
|
}
|
|
52
|
-
async getPendingTransactions() {
|
|
53
|
-
const nonce = await this.getNonce();
|
|
54
|
-
const transactions = await this.request.getPendingTransactions(this.safeAddress, nonce);
|
|
55
|
-
return transactions;
|
|
56
|
-
}
|
|
57
58
|
async buildTransaction(data) {
|
|
58
59
|
const transaction = await standardizeSafeTransactionData(this.safeAddress, this.contract, this.provider, data);
|
|
59
60
|
return new SafeTransaction(transaction);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -55,7 +55,18 @@ class Safe {
|
|
|
55
55
|
|
|
56
56
|
static getSafeInfo(safeAddress: string, network: string) {
|
|
57
57
|
const request = new RequestProvider(network);
|
|
58
|
-
return request.getSafeInfo(safeAddress);
|
|
58
|
+
return request.getSafeInfo(toChecksumAddress(safeAddress));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static async getPendingTransactions(safeAddress: string, network: string) {
|
|
62
|
+
const request = new RequestProvider(network);
|
|
63
|
+
const nonce = (await request.getSafeInfo(toChecksumAddress(safeAddress))).nonce;
|
|
64
|
+
const transactions = await request.getPendingTransactions(
|
|
65
|
+
safeAddress,
|
|
66
|
+
nonce
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return transactions;
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
async init() {
|
|
@@ -86,16 +97,6 @@ class Safe {
|
|
|
86
97
|
return nonce.toNumber();
|
|
87
98
|
}
|
|
88
99
|
|
|
89
|
-
async getPendingTransactions() {
|
|
90
|
-
const nonce = await this.getNonce();
|
|
91
|
-
const transactions = await this.request.getPendingTransactions(
|
|
92
|
-
this.safeAddress,
|
|
93
|
-
nonce
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
return transactions;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
100
|
async buildTransaction(data: SafeTransactionDataPartial) {
|
|
100
101
|
const transaction = await standardizeSafeTransactionData(
|
|
101
102
|
this.safeAddress,
|