@safe-global/protocol-kit 0.1.1 → 1.0.0
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/LICENSE.md +9 -9
- package/README.md +1015 -984
- package/dist/src/Safe.d.ts +13 -52
- package/dist/src/Safe.js +168 -57
- package/dist/src/Safe.js.map +1 -1
- package/dist/src/adapters/ethers/EthersAdapter.d.ts +8 -8
- package/dist/src/adapters/ethers/EthersAdapter.js +23 -31
- package/dist/src/adapters/ethers/EthersAdapter.js.map +1 -1
- package/dist/src/adapters/ethers/contracts/CreateCall/CreateCallEthersContract.d.ts +1 -1
- package/dist/src/adapters/ethers/contracts/CreateCall/CreateCallEthersContract.js +1 -1
- package/dist/src/adapters/ethers/contracts/GnosisSafe/GnosisSafeContractEthers.d.ts +1 -1
- package/dist/src/adapters/ethers/contracts/GnosisSafe/GnosisSafeContractEthers.js +1 -1
- package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryEthersContract.d.ts +1 -1
- package/dist/src/adapters/ethers/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryEthersContract.js +1 -1
- package/dist/src/adapters/ethers/contracts/SignMessageLib/SignMessageLibEthersContract.d.ts +1 -1
- package/dist/src/adapters/ethers/contracts/SignMessageLib/SignMessageLibEthersContract.js +1 -1
- package/dist/src/adapters/ethers/utils/index.d.ts +8 -0
- package/dist/src/adapters/ethers/utils/index.js +15 -1
- package/dist/src/adapters/ethers/utils/index.js.map +1 -1
- package/dist/src/adapters/web3/Web3Adapter.d.ts +8 -8
- package/dist/src/adapters/web3/Web3Adapter.js +17 -9
- package/dist/src/adapters/web3/Web3Adapter.js.map +1 -1
- package/dist/src/adapters/web3/contracts/CreateCall/CreateCallWeb3Contract.d.ts +1 -1
- package/dist/src/adapters/web3/contracts/CreateCall/CreateCallWeb3Contract.js +1 -6
- package/dist/src/adapters/web3/contracts/CreateCall/CreateCallWeb3Contract.js.map +1 -1
- package/dist/src/adapters/web3/contracts/GnosisSafe/GnosisSafeContractWeb3.d.ts +1 -1
- package/dist/src/adapters/web3/contracts/GnosisSafe/GnosisSafeContractWeb3.js +1 -6
- package/dist/src/adapters/web3/contracts/GnosisSafe/GnosisSafeContractWeb3.js.map +1 -1
- package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryWeb3Contract.d.ts +1 -1
- package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryWeb3Contract.js +1 -6
- package/dist/src/adapters/web3/contracts/GnosisSafeProxyFactory/GnosisSafeProxyFactoryWeb3Contract.js.map +1 -1
- package/dist/src/adapters/web3/contracts/SignMessageLib/SignMessageLibWeb3Contract.d.ts +1 -1
- package/dist/src/adapters/web3/contracts/SignMessageLib/SignMessageLibWeb3Contract.js +1 -6
- package/dist/src/adapters/web3/contracts/SignMessageLib/SignMessageLibWeb3Contract.js.map +1 -1
- package/dist/src/contracts/safeDeploymentContracts.d.ts +8 -9
- package/dist/src/contracts/safeDeploymentContracts.js +15 -15
- package/dist/src/contracts/safeDeploymentContracts.js.map +1 -1
- package/dist/src/contracts/utils.d.ts +21 -0
- package/dist/src/contracts/utils.js +105 -0
- package/dist/src/contracts/utils.js.map +1 -0
- package/dist/src/index.d.ts +8 -6
- package/dist/src/index.js +27 -20
- package/dist/src/index.js.map +1 -1
- package/dist/src/managers/contractManager.d.ts +4 -5
- package/dist/src/managers/contractManager.js +27 -22
- package/dist/src/managers/contractManager.js.map +1 -1
- package/dist/src/managers/fallbackHandlerManager.d.ts +1 -1
- package/dist/src/managers/fallbackHandlerManager.js +9 -0
- package/dist/src/managers/fallbackHandlerManager.js.map +1 -1
- package/dist/src/managers/guardManager.d.ts +1 -1
- package/dist/src/managers/guardManager.js +9 -0
- package/dist/src/managers/guardManager.js.map +1 -1
- package/dist/src/managers/moduleManager.d.ts +1 -1
- package/dist/src/managers/moduleManager.js +12 -0
- package/dist/src/managers/moduleManager.js.map +1 -1
- package/dist/src/managers/ownerManager.d.ts +1 -1
- package/dist/src/managers/ownerManager.js +21 -0
- package/dist/src/managers/ownerManager.js.map +1 -1
- package/dist/src/safeFactory/index.d.ts +5 -23
- package/dist/src/safeFactory/index.js +23 -63
- package/dist/src/safeFactory/index.js.map +1 -1
- package/dist/src/types/index.d.ts +114 -0
- package/dist/src/utils/eip-3770/config.js +11 -0
- package/dist/src/utils/eip-3770/config.js.map +1 -1
- package/dist/src/utils/index.d.ts +2 -1
- package/dist/src/utils/index.js +2 -1
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/safeVersions.d.ts +2 -1
- package/dist/src/utils/safeVersions.js +3 -1
- package/dist/src/utils/safeVersions.js.map +1 -1
- package/dist/src/utils/signatures/SafeSignature.d.ts +1 -2
- package/dist/src/utils/signatures/SafeSignature.js +3 -2
- package/dist/src/utils/signatures/SafeSignature.js.map +1 -1
- package/dist/src/utils/signatures/index.d.ts +2 -12
- package/dist/src/utils/signatures/index.js +15 -90
- package/dist/src/utils/signatures/index.js.map +1 -1
- package/dist/src/utils/signatures/utils.d.ts +11 -0
- package/dist/src/utils/signatures/utils.js +91 -0
- package/dist/src/utils/signatures/utils.js.map +1 -0
- package/dist/src/utils/transactions/gas.d.ts +1 -1
- package/dist/src/utils/transactions/gas.js +10 -10
- package/dist/src/utils/transactions/gas.js.map +1 -1
- package/dist/src/utils/transactions/utils.d.ts +3 -2
- package/dist/src/utils/transactions/utils.js +26 -13
- package/dist/src/utils/transactions/utils.js.map +1 -1
- package/dist/src/utils/types.d.ts +2 -0
- package/dist/src/utils/types.js +8 -0
- package/dist/src/utils/types.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +91 -90
- package/dist/src/safeFactory/utils.d.ts +0 -3
- package/dist/src/safeFactory/utils.js +0 -19
- package/dist/src/safeFactory/utils.js.map +0 -1
package/dist/src/Safe.d.ts
CHANGED
|
@@ -1,66 +1,20 @@
|
|
|
1
1
|
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
-
import { EthAdapter,
|
|
2
|
+
import { EthAdapter, SafeMultisigTransactionResponse, SafeSignature, SafeTransaction, SafeVersion, TransactionOptions, TransactionResult } from '@safe-global/safe-core-sdk-types';
|
|
3
3
|
import ContractManager from './managers/contractManager';
|
|
4
|
-
import {
|
|
5
|
-
import SafeSignature from './utils/signatures/SafeSignature';
|
|
4
|
+
import { AddOwnerTxParams, ConnectSafeConfig, CreateTransactionProps, RemoveOwnerTxParams, SafeConfig, SwapOwnerTxParams } from './types';
|
|
6
5
|
import { SafeTransactionOptionalProps } from './utils/transactions/types';
|
|
7
|
-
export interface SafeConfig {
|
|
8
|
-
/** ethAdapter - Ethereum adapter */
|
|
9
|
-
ethAdapter: EthAdapter;
|
|
10
|
-
/** safeAddress - The address of the Safe account to use */
|
|
11
|
-
safeAddress: string;
|
|
12
|
-
/** isL1SafeMasterCopy - Forces to use the GnosisSafe L1 version of the contract instead of the L2 version */
|
|
13
|
-
isL1SafeMasterCopy?: boolean;
|
|
14
|
-
/** contractNetworks - Contract network configuration */
|
|
15
|
-
contractNetworks?: ContractNetworksConfig;
|
|
16
|
-
}
|
|
17
|
-
export interface ConnectSafeConfig {
|
|
18
|
-
/** ethAdapter - Ethereum adapter */
|
|
19
|
-
ethAdapter?: EthAdapter;
|
|
20
|
-
/** safeAddress - The address of the Safe account to use */
|
|
21
|
-
safeAddress?: string;
|
|
22
|
-
/** isL1SafeMasterCopy - Forces to use the GnosisSafe L1 version of the contract instead of the L2 version */
|
|
23
|
-
isL1SafeMasterCopy?: boolean;
|
|
24
|
-
/** contractNetworks - Contract network configuration */
|
|
25
|
-
contractNetworks?: ContractNetworksConfig;
|
|
26
|
-
}
|
|
27
|
-
export interface CreateTransactionProps {
|
|
28
|
-
/** safeTransactionData - The transaction or transaction array to process */
|
|
29
|
-
safeTransactionData: SafeTransactionDataPartial | MetaTransactionData[];
|
|
30
|
-
/** options - The transaction array optional properties */
|
|
31
|
-
options?: SafeTransactionOptionalProps;
|
|
32
|
-
/** onlyCalls - Forces the execution of the transaction array with MultiSendCallOnly contract */
|
|
33
|
-
onlyCalls?: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface AddOwnerTxParams {
|
|
36
|
-
/** ownerAddress - The address of the new owner */
|
|
37
|
-
ownerAddress: string;
|
|
38
|
-
/** threshold - The new threshold */
|
|
39
|
-
threshold?: number;
|
|
40
|
-
}
|
|
41
|
-
export interface RemoveOwnerTxParams {
|
|
42
|
-
/** ownerAddress - The address of the owner that will be removed */
|
|
43
|
-
ownerAddress: string;
|
|
44
|
-
/** threshold - The new threshold */
|
|
45
|
-
threshold?: number;
|
|
46
|
-
}
|
|
47
|
-
export interface SwapOwnerTxParams {
|
|
48
|
-
/** oldOwnerAddress - The old owner address */
|
|
49
|
-
oldOwnerAddress: string;
|
|
50
|
-
/** newOwnerAddress - The new owner address */
|
|
51
|
-
newOwnerAddress: string;
|
|
52
|
-
}
|
|
53
6
|
declare class Safe {
|
|
54
7
|
#private;
|
|
55
8
|
/**
|
|
56
9
|
* Creates an instance of the Safe Core SDK.
|
|
57
10
|
* @param config - Ethers Safe configuration
|
|
58
11
|
* @returns The Safe Core SDK instance
|
|
12
|
+
* @throws "The SDK must be initialized with a safeAddress or a predictedSafe"
|
|
59
13
|
* @throws "SafeProxy contract is not deployed on the current network"
|
|
60
14
|
* @throws "MultiSend contract is not deployed on the current network"
|
|
61
15
|
* @throws "MultiSendCallOnly contract is not deployed on the current network"
|
|
62
16
|
*/
|
|
63
|
-
static create(
|
|
17
|
+
static create(config: SafeConfig): Promise<Safe>;
|
|
64
18
|
/**
|
|
65
19
|
* Initializes the Safe Core SDK instance.
|
|
66
20
|
* @param config - Safe configuration
|
|
@@ -73,17 +27,18 @@ declare class Safe {
|
|
|
73
27
|
/**
|
|
74
28
|
* Returns a new instance of the Safe Core SDK.
|
|
75
29
|
* @param config - Connect Safe configuration
|
|
30
|
+
* @throws "A safeAddress and a predictedSafe cannot be connected at the same time"
|
|
76
31
|
* @throws "SafeProxy contract is not deployed on the current network"
|
|
77
32
|
* @throws "MultiSend contract is not deployed on the current network"
|
|
78
33
|
* @throws "MultiSendCallOnly contract is not deployed on the current network"
|
|
79
34
|
*/
|
|
80
|
-
connect(
|
|
35
|
+
connect(config: ConnectSafeConfig): Promise<Safe>;
|
|
81
36
|
/**
|
|
82
37
|
* Returns the address of the current SafeProxy contract.
|
|
83
38
|
*
|
|
84
39
|
* @returns The address of the SafeProxy contract
|
|
85
40
|
*/
|
|
86
|
-
getAddress(): string
|
|
41
|
+
getAddress(): Promise<string>;
|
|
87
42
|
/**
|
|
88
43
|
* Returns the ContractManager
|
|
89
44
|
*
|
|
@@ -108,6 +63,12 @@ declare class Safe {
|
|
|
108
63
|
* @returns The address of the MultiSendCallOnly contract
|
|
109
64
|
*/
|
|
110
65
|
getMultiSendCallOnlyAddress(): string;
|
|
66
|
+
/**
|
|
67
|
+
* Checks if the current Safe is deployed.
|
|
68
|
+
*
|
|
69
|
+
* @returns TRUE if the Safe contract is deployed
|
|
70
|
+
*/
|
|
71
|
+
isSafeDeployed(): Promise<boolean>;
|
|
111
72
|
/**
|
|
112
73
|
* Returns the Safe Master Copy contract version.
|
|
113
74
|
*
|
package/dist/src/Safe.js
CHANGED
|
@@ -13,22 +13,25 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
|
-
var _Safe_ethAdapter, _Safe_contractManager, _Safe_ownerManager, _Safe_moduleManager, _Safe_guardManager, _Safe_fallbackHandlerManager;
|
|
16
|
+
var _Safe_predictedSafe, _Safe_ethAdapter, _Safe_contractManager, _Safe_ownerManager, _Safe_moduleManager, _Safe_guardManager, _Safe_fallbackHandlerManager;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const bignumber_1 = require("@ethersproject/bignumber");
|
|
19
19
|
const safe_core_sdk_types_1 = require("@safe-global/safe-core-sdk-types");
|
|
20
|
-
const
|
|
20
|
+
const config_1 = require("./contracts/config");
|
|
21
|
+
const utils_1 = require("./contracts/utils");
|
|
21
22
|
const contractManager_1 = __importDefault(require("./managers/contractManager"));
|
|
22
23
|
const fallbackHandlerManager_1 = __importDefault(require("./managers/fallbackHandlerManager"));
|
|
23
24
|
const guardManager_1 = __importDefault(require("./managers/guardManager"));
|
|
24
25
|
const moduleManager_1 = __importDefault(require("./managers/moduleManager"));
|
|
25
26
|
const ownerManager_1 = __importDefault(require("./managers/ownerManager"));
|
|
26
|
-
const
|
|
27
|
-
const
|
|
27
|
+
const utils_2 = require("./utils");
|
|
28
|
+
const utils_3 = require("./utils/signatures/utils");
|
|
28
29
|
const SafeTransaction_1 = __importDefault(require("./utils/transactions/SafeTransaction"));
|
|
29
|
-
const
|
|
30
|
+
const utils_4 = require("./utils/transactions/utils");
|
|
31
|
+
const types_1 = require("./utils/types");
|
|
30
32
|
class Safe {
|
|
31
33
|
constructor() {
|
|
34
|
+
_Safe_predictedSafe.set(this, void 0);
|
|
32
35
|
_Safe_ethAdapter.set(this, void 0);
|
|
33
36
|
_Safe_contractManager.set(this, void 0);
|
|
34
37
|
_Safe_ownerManager.set(this, void 0);
|
|
@@ -40,13 +43,14 @@ class Safe {
|
|
|
40
43
|
* Creates an instance of the Safe Core SDK.
|
|
41
44
|
* @param config - Ethers Safe configuration
|
|
42
45
|
* @returns The Safe Core SDK instance
|
|
46
|
+
* @throws "The SDK must be initialized with a safeAddress or a predictedSafe"
|
|
43
47
|
* @throws "SafeProxy contract is not deployed on the current network"
|
|
44
48
|
* @throws "MultiSend contract is not deployed on the current network"
|
|
45
49
|
* @throws "MultiSendCallOnly contract is not deployed on the current network"
|
|
46
50
|
*/
|
|
47
|
-
static async create(
|
|
51
|
+
static async create(config) {
|
|
48
52
|
const safeSdk = new Safe();
|
|
49
|
-
await safeSdk.init(
|
|
53
|
+
await safeSdk.init(config);
|
|
50
54
|
return safeSdk;
|
|
51
55
|
}
|
|
52
56
|
/**
|
|
@@ -57,14 +61,26 @@ class Safe {
|
|
|
57
61
|
* @throws "MultiSend contract is not deployed on the current network"
|
|
58
62
|
* @throws "MultiSendCallOnly contract is not deployed on the current network"
|
|
59
63
|
*/
|
|
60
|
-
async init(
|
|
64
|
+
async init(config) {
|
|
65
|
+
const { ethAdapter, isL1SafeMasterCopy, contractNetworks } = config;
|
|
61
66
|
__classPrivateFieldSet(this, _Safe_ethAdapter, ethAdapter, "f");
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if ((0, types_1.isSafeConfigWithPredictedSafe)(config)) {
|
|
68
|
+
__classPrivateFieldSet(this, _Safe_predictedSafe, config.predictedSafe, "f");
|
|
69
|
+
__classPrivateFieldSet(this, _Safe_contractManager, await contractManager_1.default.create({
|
|
70
|
+
ethAdapter: __classPrivateFieldGet(this, _Safe_ethAdapter, "f"),
|
|
71
|
+
predictedSafe: __classPrivateFieldGet(this, _Safe_predictedSafe, "f"),
|
|
72
|
+
isL1SafeMasterCopy,
|
|
73
|
+
contractNetworks
|
|
74
|
+
}), "f");
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
__classPrivateFieldSet(this, _Safe_contractManager, await contractManager_1.default.create({
|
|
78
|
+
ethAdapter: __classPrivateFieldGet(this, _Safe_ethAdapter, "f"),
|
|
79
|
+
safeAddress: config.safeAddress,
|
|
80
|
+
isL1SafeMasterCopy,
|
|
81
|
+
contractNetworks
|
|
82
|
+
}), "f");
|
|
83
|
+
}
|
|
68
84
|
__classPrivateFieldSet(this, _Safe_ownerManager, new ownerManager_1.default(__classPrivateFieldGet(this, _Safe_ethAdapter, "f"), __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract), "f");
|
|
69
85
|
__classPrivateFieldSet(this, _Safe_moduleManager, new moduleManager_1.default(__classPrivateFieldGet(this, _Safe_ethAdapter, "f"), __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract), "f");
|
|
70
86
|
__classPrivateFieldSet(this, _Safe_guardManager, new guardManager_1.default(__classPrivateFieldGet(this, _Safe_ethAdapter, "f"), __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract), "f");
|
|
@@ -73,16 +89,43 @@ class Safe {
|
|
|
73
89
|
/**
|
|
74
90
|
* Returns a new instance of the Safe Core SDK.
|
|
75
91
|
* @param config - Connect Safe configuration
|
|
92
|
+
* @throws "A safeAddress and a predictedSafe cannot be connected at the same time"
|
|
76
93
|
* @throws "SafeProxy contract is not deployed on the current network"
|
|
77
94
|
* @throws "MultiSend contract is not deployed on the current network"
|
|
78
95
|
* @throws "MultiSendCallOnly contract is not deployed on the current network"
|
|
79
96
|
*/
|
|
80
|
-
async connect(
|
|
81
|
-
|
|
97
|
+
async connect(config) {
|
|
98
|
+
const { ethAdapter, safeAddress, predictedSafe, isL1SafeMasterCopy, contractNetworks } = config;
|
|
99
|
+
const configProps = {
|
|
82
100
|
ethAdapter: ethAdapter || __classPrivateFieldGet(this, _Safe_ethAdapter, "f"),
|
|
83
|
-
safeAddress: safeAddress || this.getAddress(),
|
|
84
101
|
isL1SafeMasterCopy: isL1SafeMasterCopy || __classPrivateFieldGet(this, _Safe_contractManager, "f").isL1SafeMasterCopy,
|
|
85
102
|
contractNetworks: contractNetworks || __classPrivateFieldGet(this, _Safe_contractManager, "f").contractNetworks
|
|
103
|
+
};
|
|
104
|
+
// A new existing Safe is connected to the Signer
|
|
105
|
+
if (safeAddress) {
|
|
106
|
+
return await Safe.create({
|
|
107
|
+
safeAddress,
|
|
108
|
+
...configProps
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// A new predicted Safe is connected to the Signer
|
|
112
|
+
if (predictedSafe) {
|
|
113
|
+
return await Safe.create({
|
|
114
|
+
predictedSafe,
|
|
115
|
+
...configProps
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// The previous predicted Safe is connected to a new Signer
|
|
119
|
+
if (__classPrivateFieldGet(this, _Safe_predictedSafe, "f")) {
|
|
120
|
+
return await Safe.create({
|
|
121
|
+
predictedSafe: __classPrivateFieldGet(this, _Safe_predictedSafe, "f"),
|
|
122
|
+
...configProps
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// The previous existing Safe is connected to a new Signer
|
|
126
|
+
return await Safe.create({
|
|
127
|
+
safeAddress: await this.getAddress(),
|
|
128
|
+
...configProps
|
|
86
129
|
});
|
|
87
130
|
}
|
|
88
131
|
/**
|
|
@@ -90,8 +133,24 @@ class Safe {
|
|
|
90
133
|
*
|
|
91
134
|
* @returns The address of the SafeProxy contract
|
|
92
135
|
*/
|
|
93
|
-
getAddress() {
|
|
94
|
-
|
|
136
|
+
async getAddress() {
|
|
137
|
+
var _a;
|
|
138
|
+
if (__classPrivateFieldGet(this, _Safe_predictedSafe, "f")) {
|
|
139
|
+
const safeVersion = await this.getContractVersion();
|
|
140
|
+
if (!(0, utils_2.hasSafeFeature)(utils_2.SAFE_FEATURES.ACCOUNT_ABSTRACTION, safeVersion)) {
|
|
141
|
+
throw new Error('Account Abstraction functionality is not available for Safes with version lower than v1.3.0');
|
|
142
|
+
}
|
|
143
|
+
const chainId = await __classPrivateFieldGet(this, _Safe_ethAdapter, "f").getChainId();
|
|
144
|
+
return (0, utils_1.predictSafeAddress)({
|
|
145
|
+
ethAdapter: __classPrivateFieldGet(this, _Safe_ethAdapter, "f"),
|
|
146
|
+
customContracts: (_a = __classPrivateFieldGet(this, _Safe_contractManager, "f").contractNetworks) === null || _a === void 0 ? void 0 : _a[chainId],
|
|
147
|
+
...__classPrivateFieldGet(this, _Safe_predictedSafe, "f")
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
151
|
+
throw new Error('Safe is not deployed');
|
|
152
|
+
}
|
|
153
|
+
return Promise.resolve(__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract.getAddress());
|
|
95
154
|
}
|
|
96
155
|
/**
|
|
97
156
|
* Returns the ContractManager
|
|
@@ -125,13 +184,30 @@ class Safe {
|
|
|
125
184
|
getMultiSendCallOnlyAddress() {
|
|
126
185
|
return __classPrivateFieldGet(this, _Safe_contractManager, "f").multiSendCallOnlyContract.getAddress();
|
|
127
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Checks if the current Safe is deployed.
|
|
189
|
+
*
|
|
190
|
+
* @returns TRUE if the Safe contract is deployed
|
|
191
|
+
*/
|
|
192
|
+
async isSafeDeployed() {
|
|
193
|
+
const safeAddress = await this.getAddress();
|
|
194
|
+
const isSafeDeployed = await __classPrivateFieldGet(this, _Safe_ethAdapter, "f").isContractDeployed(safeAddress);
|
|
195
|
+
return isSafeDeployed;
|
|
196
|
+
}
|
|
128
197
|
/**
|
|
129
198
|
* Returns the Safe Master Copy contract version.
|
|
130
199
|
*
|
|
131
200
|
* @returns The Safe Master Copy contract version
|
|
132
201
|
*/
|
|
133
202
|
async getContractVersion() {
|
|
134
|
-
|
|
203
|
+
var _a;
|
|
204
|
+
if (__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
205
|
+
return __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract.getVersion();
|
|
206
|
+
}
|
|
207
|
+
if ((_a = __classPrivateFieldGet(this, _Safe_predictedSafe, "f")) === null || _a === void 0 ? void 0 : _a.safeDeploymentConfig.safeVersion) {
|
|
208
|
+
return Promise.resolve(__classPrivateFieldGet(this, _Safe_predictedSafe, "f").safeDeploymentConfig.safeVersion);
|
|
209
|
+
}
|
|
210
|
+
return Promise.resolve(config_1.SAFE_LAST_VERSION);
|
|
135
211
|
}
|
|
136
212
|
/**
|
|
137
213
|
* Returns the list of Safe owner accounts.
|
|
@@ -147,6 +223,9 @@ class Safe {
|
|
|
147
223
|
* @returns The Safe nonce
|
|
148
224
|
*/
|
|
149
225
|
async getNonce() {
|
|
226
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
227
|
+
return Promise.resolve(0);
|
|
228
|
+
}
|
|
150
229
|
return __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract.getNonce();
|
|
151
230
|
}
|
|
152
231
|
/**
|
|
@@ -171,7 +250,7 @@ class Safe {
|
|
|
171
250
|
* @returns The ETH balance of the Safe
|
|
172
251
|
*/
|
|
173
252
|
async getBalance() {
|
|
174
|
-
return __classPrivateFieldGet(this, _Safe_ethAdapter, "f").getBalance(this.getAddress());
|
|
253
|
+
return __classPrivateFieldGet(this, _Safe_ethAdapter, "f").getBalance(await this.getAddress());
|
|
175
254
|
}
|
|
176
255
|
/**
|
|
177
256
|
* Returns the address of the FallbackHandler contract.
|
|
@@ -224,15 +303,19 @@ class Safe {
|
|
|
224
303
|
* @throws "Invalid empty array of transactions"
|
|
225
304
|
*/
|
|
226
305
|
async createTransaction({ safeTransactionData, onlyCalls = false, options }) {
|
|
227
|
-
|
|
306
|
+
const safeVersion = await this.getContractVersion();
|
|
307
|
+
if (__classPrivateFieldGet(this, _Safe_predictedSafe, "f") && !(0, utils_2.hasSafeFeature)(utils_2.SAFE_FEATURES.ACCOUNT_ABSTRACTION, safeVersion)) {
|
|
308
|
+
throw new Error('Account Abstraction functionality is not available for Safes with version lower than v1.3.0');
|
|
309
|
+
}
|
|
310
|
+
if ((0, utils_2.isMetaTransactionArray)(safeTransactionData) && safeTransactionData.length === 0) {
|
|
228
311
|
throw new Error('Invalid empty array of transactions');
|
|
229
312
|
}
|
|
230
313
|
let newTransaction;
|
|
231
|
-
if ((0,
|
|
314
|
+
if ((0, utils_2.isMetaTransactionArray)(safeTransactionData) && safeTransactionData.length > 1) {
|
|
232
315
|
const multiSendContract = onlyCalls
|
|
233
316
|
? __classPrivateFieldGet(this, _Safe_contractManager, "f").multiSendCallOnlyContract
|
|
234
317
|
: __classPrivateFieldGet(this, _Safe_contractManager, "f").multiSendContract;
|
|
235
|
-
const multiSendData = (0,
|
|
318
|
+
const multiSendData = (0, utils_4.encodeMultiSendData)(safeTransactionData.map(utils_4.standardizeMetaTransactionData));
|
|
236
319
|
const multiSendTransaction = {
|
|
237
320
|
...options,
|
|
238
321
|
to: multiSendContract.getAddress(),
|
|
@@ -243,12 +326,25 @@ class Safe {
|
|
|
243
326
|
newTransaction = multiSendTransaction;
|
|
244
327
|
}
|
|
245
328
|
else {
|
|
246
|
-
newTransaction = (0,
|
|
329
|
+
newTransaction = (0, utils_2.isMetaTransactionArray)(safeTransactionData)
|
|
247
330
|
? { ...options, ...safeTransactionData[0] }
|
|
248
331
|
: safeTransactionData;
|
|
249
332
|
}
|
|
250
|
-
|
|
251
|
-
|
|
333
|
+
if (__classPrivateFieldGet(this, _Safe_predictedSafe, "f")) {
|
|
334
|
+
return new SafeTransaction_1.default(await (0, utils_4.standardizeSafeTransactionData)({
|
|
335
|
+
predictedSafe: __classPrivateFieldGet(this, _Safe_predictedSafe, "f"),
|
|
336
|
+
ethAdapter: __classPrivateFieldGet(this, _Safe_ethAdapter, "f"),
|
|
337
|
+
tx: newTransaction
|
|
338
|
+
}));
|
|
339
|
+
}
|
|
340
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
341
|
+
throw new Error('Safe is not deployed');
|
|
342
|
+
}
|
|
343
|
+
return new SafeTransaction_1.default(await (0, utils_4.standardizeSafeTransactionData)({
|
|
344
|
+
safeContract: __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract,
|
|
345
|
+
ethAdapter: __classPrivateFieldGet(this, _Safe_ethAdapter, "f"),
|
|
346
|
+
tx: newTransaction
|
|
347
|
+
}));
|
|
252
348
|
}
|
|
253
349
|
/**
|
|
254
350
|
* Returns a Safe transaction ready to be signed by the owners that invalidates the pending Safe transaction/s with a specific nonce.
|
|
@@ -258,11 +354,11 @@ class Safe {
|
|
|
258
354
|
*/
|
|
259
355
|
async createRejectionTransaction(nonce) {
|
|
260
356
|
const safeTransactionData = {
|
|
261
|
-
to: this.getAddress(),
|
|
357
|
+
to: await this.getAddress(),
|
|
262
358
|
nonce,
|
|
263
359
|
value: '0',
|
|
264
360
|
data: '0x',
|
|
265
|
-
safeTxGas: 0
|
|
361
|
+
safeTxGas: '0'
|
|
266
362
|
};
|
|
267
363
|
return this.createTransaction({ safeTransactionData });
|
|
268
364
|
}
|
|
@@ -288,6 +384,9 @@ class Safe {
|
|
|
288
384
|
* @returns The transaction hash of the Safe transaction
|
|
289
385
|
*/
|
|
290
386
|
async getTransactionHash(safeTransaction) {
|
|
387
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
388
|
+
throw new Error('Safe is not deployed');
|
|
389
|
+
}
|
|
291
390
|
const safeTransactionData = safeTransaction.data;
|
|
292
391
|
const txHash = await __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract.getTransactionHash(safeTransactionData);
|
|
293
392
|
return txHash;
|
|
@@ -299,7 +398,7 @@ class Safe {
|
|
|
299
398
|
* @returns The Safe signature
|
|
300
399
|
*/
|
|
301
400
|
async signTransactionHash(hash) {
|
|
302
|
-
return (0,
|
|
401
|
+
return (0, utils_3.generateSignature)(__classPrivateFieldGet(this, _Safe_ethAdapter, "f"), hash);
|
|
303
402
|
}
|
|
304
403
|
/**
|
|
305
404
|
* Signs a transaction according to the EIP-712 using the current signer account.
|
|
@@ -310,12 +409,12 @@ class Safe {
|
|
|
310
409
|
*/
|
|
311
410
|
async signTypedData(safeTransaction, methodVersion) {
|
|
312
411
|
const safeTransactionEIP712Args = {
|
|
313
|
-
safeAddress: this.getAddress(),
|
|
412
|
+
safeAddress: await this.getAddress(),
|
|
314
413
|
safeVersion: await this.getContractVersion(),
|
|
315
414
|
chainId: await this.getEthAdapter().getChainId(),
|
|
316
415
|
safeTransactionData: safeTransaction.data
|
|
317
416
|
};
|
|
318
|
-
return (0,
|
|
417
|
+
return (0, utils_3.generateEIP712Signature)(__classPrivateFieldGet(this, _Safe_ethAdapter, "f"), safeTransactionEIP712Args, methodVersion);
|
|
319
418
|
}
|
|
320
419
|
/**
|
|
321
420
|
* Adds the signature of the current signer to the Safe transaction object.
|
|
@@ -326,7 +425,7 @@ class Safe {
|
|
|
326
425
|
* @throws "Transactions can only be signed by Safe owners"
|
|
327
426
|
*/
|
|
328
427
|
async signTransaction(safeTransaction, signingMethod = 'eth_signTypedData_v4') {
|
|
329
|
-
const transaction = (0,
|
|
428
|
+
const transaction = (0, utils_2.isSafeMultisigTransactionResponse)(safeTransaction)
|
|
330
429
|
? await this.toSafeTransactionType(safeTransaction)
|
|
331
430
|
: safeTransaction;
|
|
332
431
|
const owners = await this.getOwners();
|
|
@@ -334,7 +433,7 @@ class Safe {
|
|
|
334
433
|
if (!signerAddress) {
|
|
335
434
|
throw new Error('EthAdapter must be initialized with a signer to use this method');
|
|
336
435
|
}
|
|
337
|
-
const addressIsOwner = owners.find((owner) => signerAddress && (0,
|
|
436
|
+
const addressIsOwner = owners.find((owner) => signerAddress && (0, utils_2.sameString)(owner, signerAddress));
|
|
338
437
|
if (!addressIsOwner) {
|
|
339
438
|
throw new Error('Transactions can only be signed by Safe owners');
|
|
340
439
|
}
|
|
@@ -350,7 +449,7 @@ class Safe {
|
|
|
350
449
|
}
|
|
351
450
|
else {
|
|
352
451
|
const safeVersion = await this.getContractVersion();
|
|
353
|
-
if (!(0,
|
|
452
|
+
if (!(0, utils_2.hasSafeFeature)(utils_2.SAFE_FEATURES.ETH_SIGN, safeVersion)) {
|
|
354
453
|
throw new Error('eth_sign is only supported by Safes >= v1.1.0');
|
|
355
454
|
}
|
|
356
455
|
const txHash = await this.getTransactionHash(transaction);
|
|
@@ -375,12 +474,15 @@ class Safe {
|
|
|
375
474
|
* @throws "Cannot specify gas and gasLimit together in transaction options"
|
|
376
475
|
*/
|
|
377
476
|
async approveTransactionHash(hash, options) {
|
|
477
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
478
|
+
throw new Error('Safe is not deployed');
|
|
479
|
+
}
|
|
378
480
|
const owners = await this.getOwners();
|
|
379
481
|
const signerAddress = await __classPrivateFieldGet(this, _Safe_ethAdapter, "f").getSignerAddress();
|
|
380
482
|
if (!signerAddress) {
|
|
381
483
|
throw new Error('EthAdapter must be initialized with a signer to use this method');
|
|
382
484
|
}
|
|
383
|
-
const addressIsOwner = owners.find((owner) => signerAddress && (0,
|
|
485
|
+
const addressIsOwner = owners.find((owner) => signerAddress && (0, utils_2.sameString)(owner, signerAddress));
|
|
384
486
|
if (!addressIsOwner) {
|
|
385
487
|
throw new Error('Transaction hashes can only be approved by Safe owners');
|
|
386
488
|
}
|
|
@@ -399,6 +501,9 @@ class Safe {
|
|
|
399
501
|
* @returns The list of owners
|
|
400
502
|
*/
|
|
401
503
|
async getOwnersWhoApprovedTx(txHash) {
|
|
504
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
505
|
+
throw new Error('Safe is not deployed');
|
|
506
|
+
}
|
|
402
507
|
const owners = await this.getOwners();
|
|
403
508
|
const ownersWhoApproved = [];
|
|
404
509
|
for (const owner of owners) {
|
|
@@ -421,7 +526,7 @@ class Safe {
|
|
|
421
526
|
*/
|
|
422
527
|
async createEnableFallbackHandlerTx(fallbackHandlerAddress, options) {
|
|
423
528
|
const safeTransactionData = {
|
|
424
|
-
to: this.getAddress(),
|
|
529
|
+
to: await this.getAddress(),
|
|
425
530
|
value: '0',
|
|
426
531
|
data: await __classPrivateFieldGet(this, _Safe_fallbackHandlerManager, "f").encodeEnableFallbackHandlerData(fallbackHandlerAddress),
|
|
427
532
|
...options
|
|
@@ -439,7 +544,7 @@ class Safe {
|
|
|
439
544
|
*/
|
|
440
545
|
async createDisableFallbackHandlerTx(options) {
|
|
441
546
|
const safeTransactionData = {
|
|
442
|
-
to: this.getAddress(),
|
|
547
|
+
to: await this.getAddress(),
|
|
443
548
|
value: '0',
|
|
444
549
|
data: await __classPrivateFieldGet(this, _Safe_fallbackHandlerManager, "f").encodeDisableFallbackHandlerData(),
|
|
445
550
|
...options
|
|
@@ -459,7 +564,7 @@ class Safe {
|
|
|
459
564
|
*/
|
|
460
565
|
async createEnableGuardTx(guardAddress, options) {
|
|
461
566
|
const safeTransactionData = {
|
|
462
|
-
to: this.getAddress(),
|
|
567
|
+
to: await this.getAddress(),
|
|
463
568
|
value: '0',
|
|
464
569
|
data: await __classPrivateFieldGet(this, _Safe_guardManager, "f").encodeEnableGuardData(guardAddress),
|
|
465
570
|
...options
|
|
@@ -477,7 +582,7 @@ class Safe {
|
|
|
477
582
|
*/
|
|
478
583
|
async createDisableGuardTx(options) {
|
|
479
584
|
const safeTransactionData = {
|
|
480
|
-
to: this.getAddress(),
|
|
585
|
+
to: await this.getAddress(),
|
|
481
586
|
value: '0',
|
|
482
587
|
data: await __classPrivateFieldGet(this, _Safe_guardManager, "f").encodeDisableGuardData(),
|
|
483
588
|
...options
|
|
@@ -496,7 +601,7 @@ class Safe {
|
|
|
496
601
|
*/
|
|
497
602
|
async createEnableModuleTx(moduleAddress, options) {
|
|
498
603
|
const safeTransactionData = {
|
|
499
|
-
to: this.getAddress(),
|
|
604
|
+
to: await this.getAddress(),
|
|
500
605
|
value: '0',
|
|
501
606
|
data: await __classPrivateFieldGet(this, _Safe_moduleManager, "f").encodeEnableModuleData(moduleAddress),
|
|
502
607
|
...options
|
|
@@ -515,7 +620,7 @@ class Safe {
|
|
|
515
620
|
*/
|
|
516
621
|
async createDisableModuleTx(moduleAddress, options) {
|
|
517
622
|
const safeTransactionData = {
|
|
518
|
-
to: this.getAddress(),
|
|
623
|
+
to: await this.getAddress(),
|
|
519
624
|
value: '0',
|
|
520
625
|
data: await __classPrivateFieldGet(this, _Safe_moduleManager, "f").encodeDisableModuleData(moduleAddress),
|
|
521
626
|
...options
|
|
@@ -536,7 +641,7 @@ class Safe {
|
|
|
536
641
|
*/
|
|
537
642
|
async createAddOwnerTx({ ownerAddress, threshold }, options) {
|
|
538
643
|
const safeTransactionData = {
|
|
539
|
-
to: this.getAddress(),
|
|
644
|
+
to: await this.getAddress(),
|
|
540
645
|
value: '0',
|
|
541
646
|
data: await __classPrivateFieldGet(this, _Safe_ownerManager, "f").encodeAddOwnerWithThresholdData(ownerAddress, threshold),
|
|
542
647
|
...options
|
|
@@ -557,7 +662,7 @@ class Safe {
|
|
|
557
662
|
*/
|
|
558
663
|
async createRemoveOwnerTx({ ownerAddress, threshold }, options) {
|
|
559
664
|
const safeTransactionData = {
|
|
560
|
-
to: this.getAddress(),
|
|
665
|
+
to: await this.getAddress(),
|
|
561
666
|
value: '0',
|
|
562
667
|
data: await __classPrivateFieldGet(this, _Safe_ownerManager, "f").encodeRemoveOwnerData(ownerAddress, threshold),
|
|
563
668
|
...options
|
|
@@ -578,7 +683,7 @@ class Safe {
|
|
|
578
683
|
*/
|
|
579
684
|
async createSwapOwnerTx({ oldOwnerAddress, newOwnerAddress }, options) {
|
|
580
685
|
const safeTransactionData = {
|
|
581
|
-
to: this.getAddress(),
|
|
686
|
+
to: await this.getAddress(),
|
|
582
687
|
value: '0',
|
|
583
688
|
data: await __classPrivateFieldGet(this, _Safe_ownerManager, "f").encodeSwapOwnerData(oldOwnerAddress, newOwnerAddress),
|
|
584
689
|
...options
|
|
@@ -597,7 +702,7 @@ class Safe {
|
|
|
597
702
|
*/
|
|
598
703
|
async createChangeThresholdTx(threshold, options) {
|
|
599
704
|
const safeTransactionData = {
|
|
600
|
-
to: this.getAddress(),
|
|
705
|
+
to: await this.getAddress(),
|
|
601
706
|
value: '0',
|
|
602
707
|
data: await __classPrivateFieldGet(this, _Safe_ownerManager, "f").encodeChangeThresholdData(threshold),
|
|
603
708
|
...options
|
|
@@ -618,16 +723,16 @@ class Safe {
|
|
|
618
723
|
value: serviceTransactionResponse.value,
|
|
619
724
|
data: serviceTransactionResponse.data || '0x',
|
|
620
725
|
operation: serviceTransactionResponse.operation,
|
|
621
|
-
safeTxGas: serviceTransactionResponse.safeTxGas,
|
|
622
|
-
baseGas: serviceTransactionResponse.baseGas,
|
|
623
|
-
gasPrice:
|
|
726
|
+
safeTxGas: serviceTransactionResponse.safeTxGas.toString(),
|
|
727
|
+
baseGas: serviceTransactionResponse.baseGas.toString(),
|
|
728
|
+
gasPrice: serviceTransactionResponse.gasPrice,
|
|
624
729
|
gasToken: serviceTransactionResponse.gasToken,
|
|
625
730
|
refundReceiver: serviceTransactionResponse.refundReceiver,
|
|
626
731
|
nonce: serviceTransactionResponse.nonce
|
|
627
732
|
};
|
|
628
733
|
const safeTransaction = await this.createTransaction({ safeTransactionData });
|
|
629
734
|
(_a = serviceTransactionResponse.confirmations) === null || _a === void 0 ? void 0 : _a.map((confirmation) => {
|
|
630
|
-
const signature = new
|
|
735
|
+
const signature = new utils_2.EthSafeSignature(confirmation.owner, confirmation.signature);
|
|
631
736
|
safeTransaction.addSignature(signature);
|
|
632
737
|
});
|
|
633
738
|
return safeTransaction;
|
|
@@ -640,14 +745,17 @@ class Safe {
|
|
|
640
745
|
* @returns TRUE if the Safe transaction can be executed successfully with no errors
|
|
641
746
|
*/
|
|
642
747
|
async isValidTransaction(safeTransaction, options) {
|
|
643
|
-
|
|
748
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
749
|
+
throw new Error('Safe is not deployed');
|
|
750
|
+
}
|
|
751
|
+
const transaction = (0, utils_2.isSafeMultisigTransactionResponse)(safeTransaction)
|
|
644
752
|
? await this.toSafeTransactionType(safeTransaction)
|
|
645
753
|
: safeTransaction;
|
|
646
754
|
const signedSafeTransaction = await this.copyTransaction(transaction);
|
|
647
755
|
const txHash = await this.getTransactionHash(signedSafeTransaction);
|
|
648
756
|
const ownersWhoApprovedTx = await this.getOwnersWhoApprovedTx(txHash);
|
|
649
757
|
for (const owner of ownersWhoApprovedTx) {
|
|
650
|
-
signedSafeTransaction.addSignature((0,
|
|
758
|
+
signedSafeTransaction.addSignature((0, utils_3.generatePreValidatedSignature)(owner));
|
|
651
759
|
}
|
|
652
760
|
const owners = await this.getOwners();
|
|
653
761
|
const signerAddress = await __classPrivateFieldGet(this, _Safe_ethAdapter, "f").getSignerAddress();
|
|
@@ -655,7 +763,7 @@ class Safe {
|
|
|
655
763
|
throw new Error('EthAdapter must be initialized with a signer to use this method');
|
|
656
764
|
}
|
|
657
765
|
if (owners.includes(signerAddress)) {
|
|
658
|
-
signedSafeTransaction.addSignature((0,
|
|
766
|
+
signedSafeTransaction.addSignature((0, utils_3.generatePreValidatedSignature)(signerAddress));
|
|
659
767
|
}
|
|
660
768
|
const isTxValid = await __classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract.isValidTransaction(signedSafeTransaction, {
|
|
661
769
|
from: signerAddress,
|
|
@@ -674,19 +782,22 @@ class Safe {
|
|
|
674
782
|
* @throws "Cannot specify gas and gasLimit together in transaction options"
|
|
675
783
|
*/
|
|
676
784
|
async executeTransaction(safeTransaction, options) {
|
|
677
|
-
|
|
785
|
+
if (!__classPrivateFieldGet(this, _Safe_contractManager, "f").safeContract) {
|
|
786
|
+
throw new Error('Safe is not deployed');
|
|
787
|
+
}
|
|
788
|
+
const transaction = (0, utils_2.isSafeMultisigTransactionResponse)(safeTransaction)
|
|
678
789
|
? await this.toSafeTransactionType(safeTransaction)
|
|
679
790
|
: safeTransaction;
|
|
680
791
|
const signedSafeTransaction = await this.copyTransaction(transaction);
|
|
681
792
|
const txHash = await this.getTransactionHash(signedSafeTransaction);
|
|
682
793
|
const ownersWhoApprovedTx = await this.getOwnersWhoApprovedTx(txHash);
|
|
683
794
|
for (const owner of ownersWhoApprovedTx) {
|
|
684
|
-
signedSafeTransaction.addSignature((0,
|
|
795
|
+
signedSafeTransaction.addSignature((0, utils_3.generatePreValidatedSignature)(owner));
|
|
685
796
|
}
|
|
686
797
|
const owners = await this.getOwners();
|
|
687
798
|
const signerAddress = await __classPrivateFieldGet(this, _Safe_ethAdapter, "f").getSignerAddress();
|
|
688
799
|
if (signerAddress && owners.includes(signerAddress)) {
|
|
689
|
-
signedSafeTransaction.addSignature((0,
|
|
800
|
+
signedSafeTransaction.addSignature((0, utils_3.generatePreValidatedSignature)(signerAddress));
|
|
690
801
|
}
|
|
691
802
|
const threshold = await this.getThreshold();
|
|
692
803
|
if (threshold > signedSafeTransaction.signatures.size) {
|
|
@@ -710,6 +821,6 @@ class Safe {
|
|
|
710
821
|
return txResponse;
|
|
711
822
|
}
|
|
712
823
|
}
|
|
713
|
-
_Safe_ethAdapter = new WeakMap(), _Safe_contractManager = new WeakMap(), _Safe_ownerManager = new WeakMap(), _Safe_moduleManager = new WeakMap(), _Safe_guardManager = new WeakMap(), _Safe_fallbackHandlerManager = new WeakMap();
|
|
824
|
+
_Safe_predictedSafe = new WeakMap(), _Safe_ethAdapter = new WeakMap(), _Safe_contractManager = new WeakMap(), _Safe_ownerManager = new WeakMap(), _Safe_moduleManager = new WeakMap(), _Safe_guardManager = new WeakMap(), _Safe_fallbackHandlerManager = new WeakMap();
|
|
714
825
|
exports.default = Safe;
|
|
715
826
|
//# sourceMappingURL=Safe.js.map
|