@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/package.json
CHANGED
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@safe-global/protocol-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "SDK to interact with Safe smart contracts",
|
|
5
|
-
"main": "dist/src/index.js",
|
|
6
|
-
"
|
|
7
|
-
"keywords": [
|
|
8
|
-
"Ethereum",
|
|
9
|
-
"Safe",
|
|
10
|
-
"SDK"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"safe-deployments": "ts-node scripts/checkSafeDeployments.ts",
|
|
14
|
-
"typechain": "ts-node ./scripts/generateTypechainFiles.ts",
|
|
15
|
-
"test:ganache:web3:v1.0.0": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.0.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
16
|
-
"test:ganache:web3:v1.1.1": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.1.1 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
17
|
-
"test:ganache:web3:v1.2.0": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.2.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
18
|
-
"test:ganache:web3:v1.3.0": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.3.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
19
|
-
"test:ganache:ethers:v1.0.0": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.0.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
20
|
-
"test:ganache:ethers:v1.1.1": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
21
|
-
"test:ganache:ethers:v1.2.0": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
22
|
-
"test:ganache:ethers:v1.3.0": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
23
|
-
"test:hardhat:web3:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.0.0 && hardhat deploy && nyc hardhat test",
|
|
24
|
-
"test:hardhat:web3:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.1.1 && hardhat deploy && nyc hardhat test",
|
|
25
|
-
"test:hardhat:web3:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.2.0 && hardhat deploy && nyc hardhat test",
|
|
26
|
-
"test:hardhat:web3:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.3.0 && hardhat deploy && nyc hardhat test",
|
|
27
|
-
"test:hardhat:ethers:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.0.0 && hardhat deploy && nyc hardhat test",
|
|
28
|
-
"test:hardhat:ethers:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && hardhat deploy && nyc hardhat test",
|
|
29
|
-
"test:hardhat:ethers:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && hardhat deploy && nyc hardhat test",
|
|
30
|
-
"test:hardhat:ethers:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && hardhat deploy && nyc hardhat test",
|
|
31
|
-
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
|
32
|
-
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
|
|
33
|
-
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
|
|
34
|
-
"unbuild": "rimraf dist artifacts deployments cache .nyc_output typechain *.tsbuildinfo",
|
|
35
|
-
"build": "yarn unbuild && hardhat compile && yarn typechain && yarn safe-deployments && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json"
|
|
36
|
-
},
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/safe-global/safe-core-sdk.git"
|
|
40
|
-
},
|
|
41
|
-
"author": "Safe (https://safe.global)",
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"bugs": {
|
|
44
|
-
"url": "https://github.com/safe-global/safe-core-sdk/issues"
|
|
45
|
-
},
|
|
46
|
-
"files": [
|
|
47
|
-
"dist"
|
|
48
|
-
],
|
|
49
|
-
"homepage": "https://github.com/safe-global/safe-core-sdk#readme",
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@gnosis.pm/safe-contracts-v1.2.0": "npm:@gnosis.pm/safe-contracts@1.2.0",
|
|
52
|
-
"@gnosis.pm/safe-contracts-v1.3.0": "npm:@gnosis.pm/safe-contracts@1.3.0",
|
|
53
|
-
"@nomiclabs/hardhat-ethers": "^2.2.2",
|
|
54
|
-
"@nomiclabs/hardhat-waffle": "^2.0.3",
|
|
55
|
-
"@nomiclabs/hardhat-web3": "^2.0.0",
|
|
56
|
-
"@safe-global/safe-core-sdk-types": "^
|
|
57
|
-
"@typechain/ethers-v5": "^10.2.0",
|
|
58
|
-
"@typechain/web3-v1": "^6.0.2",
|
|
59
|
-
"@types/chai": "^4.3.4",
|
|
60
|
-
"@types/chai-as-promised": "^7.1.5",
|
|
61
|
-
"@types/mocha": "^10.0.1",
|
|
62
|
-
"@types/semver": "^7.3.13",
|
|
63
|
-
"@types/web3": "1.0.19",
|
|
64
|
-
"@types/yargs": "^16.0.1",
|
|
65
|
-
"chai": "^4.3.7",
|
|
66
|
-
"chai-as-promised": "^7.1.1",
|
|
67
|
-
"coveralls": "^3.1.1",
|
|
68
|
-
"dotenv": "^16.0.3",
|
|
69
|
-
"ethereum-waffle": "^4.0.10",
|
|
70
|
-
"ethers": "5.7.2",
|
|
71
|
-
"hardhat": "^2.12.6",
|
|
72
|
-
"hardhat-deploy": "^0.11.22",
|
|
73
|
-
"mocha": "^10.2.0",
|
|
74
|
-
"nyc": "^15.1.0",
|
|
75
|
-
"ts-generator": "^0.1.1",
|
|
76
|
-
"tsconfig-paths": "^4.1.2",
|
|
77
|
-
"typechain": "^8.1.1",
|
|
78
|
-
"yargs": "^17.6.2"
|
|
79
|
-
},
|
|
80
|
-
"dependencies": {
|
|
81
|
-
"@ethersproject/
|
|
82
|
-
"@ethersproject/
|
|
83
|
-
"@
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"web3
|
|
88
|
-
"web3-
|
|
89
|
-
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@safe-global/protocol-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SDK to interact with Safe smart contracts",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"Ethereum",
|
|
9
|
+
"Safe",
|
|
10
|
+
"SDK"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"safe-deployments": "ts-node scripts/checkSafeDeployments.ts",
|
|
14
|
+
"typechain": "ts-node ./scripts/generateTypechainFiles.ts",
|
|
15
|
+
"test:ganache:web3:v1.0.0": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.0.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
16
|
+
"test:ganache:web3:v1.1.1": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.1.1 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
17
|
+
"test:ganache:web3:v1.2.0": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.2.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
18
|
+
"test:ganache:web3:v1.3.0": "export TEST_NETWORK=ganache && export ETH_LIB=web3 && export SAFE_VERSION=1.3.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
19
|
+
"test:ganache:ethers:v1.0.0": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.0.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
20
|
+
"test:ganache:ethers:v1.1.1": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
21
|
+
"test:ganache:ethers:v1.2.0": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
22
|
+
"test:ganache:ethers:v1.3.0": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && hardhat --network localhost deploy && nyc hardhat --network localhost test",
|
|
23
|
+
"test:hardhat:web3:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.0.0 && hardhat deploy && nyc hardhat test",
|
|
24
|
+
"test:hardhat:web3:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.1.1 && hardhat deploy && nyc hardhat test",
|
|
25
|
+
"test:hardhat:web3:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.2.0 && hardhat deploy && nyc hardhat test",
|
|
26
|
+
"test:hardhat:web3:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && export SAFE_VERSION=1.3.0 && hardhat deploy && nyc hardhat test",
|
|
27
|
+
"test:hardhat:ethers:v1.0.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.0.0 && hardhat deploy && nyc hardhat test",
|
|
28
|
+
"test:hardhat:ethers:v1.1.1": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.1.1 && hardhat deploy && nyc hardhat test",
|
|
29
|
+
"test:hardhat:ethers:v1.2.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.2.0 && hardhat deploy && nyc hardhat test",
|
|
30
|
+
"test:hardhat:ethers:v1.3.0": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && export SAFE_VERSION=1.3.0 && hardhat deploy && nyc hardhat test",
|
|
31
|
+
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
|
32
|
+
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"",
|
|
33
|
+
"format": "prettier --write \"*/**/*.{js,json,md,ts}\"",
|
|
34
|
+
"unbuild": "rimraf dist artifacts deployments cache .nyc_output typechain *.tsbuildinfo",
|
|
35
|
+
"build": "yarn unbuild && hardhat compile && yarn typechain && yarn safe-deployments && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/safe-global/safe-core-sdk.git"
|
|
40
|
+
},
|
|
41
|
+
"author": "Safe (https://safe.global)",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/safe-global/safe-core-sdk/issues"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist"
|
|
48
|
+
],
|
|
49
|
+
"homepage": "https://github.com/safe-global/safe-core-sdk#readme",
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@gnosis.pm/safe-contracts-v1.2.0": "npm:@gnosis.pm/safe-contracts@1.2.0",
|
|
52
|
+
"@gnosis.pm/safe-contracts-v1.3.0": "npm:@gnosis.pm/safe-contracts@1.3.0",
|
|
53
|
+
"@nomiclabs/hardhat-ethers": "^2.2.2",
|
|
54
|
+
"@nomiclabs/hardhat-waffle": "^2.0.3",
|
|
55
|
+
"@nomiclabs/hardhat-web3": "^2.0.0",
|
|
56
|
+
"@safe-global/safe-core-sdk-types": "^2.0.0",
|
|
57
|
+
"@typechain/ethers-v5": "^10.2.0",
|
|
58
|
+
"@typechain/web3-v1": "^6.0.2",
|
|
59
|
+
"@types/chai": "^4.3.4",
|
|
60
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
61
|
+
"@types/mocha": "^10.0.1",
|
|
62
|
+
"@types/semver": "^7.3.13",
|
|
63
|
+
"@types/web3": "1.0.19",
|
|
64
|
+
"@types/yargs": "^16.0.1",
|
|
65
|
+
"chai": "^4.3.7",
|
|
66
|
+
"chai-as-promised": "^7.1.1",
|
|
67
|
+
"coveralls": "^3.1.1",
|
|
68
|
+
"dotenv": "^16.0.3",
|
|
69
|
+
"ethereum-waffle": "^4.0.10",
|
|
70
|
+
"ethers": "5.7.2",
|
|
71
|
+
"hardhat": "^2.12.6",
|
|
72
|
+
"hardhat-deploy": "^0.11.22",
|
|
73
|
+
"mocha": "^10.2.0",
|
|
74
|
+
"nyc": "^15.1.0",
|
|
75
|
+
"ts-generator": "^0.1.1",
|
|
76
|
+
"tsconfig-paths": "^4.1.2",
|
|
77
|
+
"typechain": "^8.1.1",
|
|
78
|
+
"yargs": "^17.6.2"
|
|
79
|
+
},
|
|
80
|
+
"dependencies": {
|
|
81
|
+
"@ethersproject/address": "^5.7.0",
|
|
82
|
+
"@ethersproject/bignumber": "^5.7.0",
|
|
83
|
+
"@ethersproject/solidity": "^5.7.0",
|
|
84
|
+
"@safe-global/safe-deployments": "^1.22.0",
|
|
85
|
+
"ethereumjs-util": "^7.1.5",
|
|
86
|
+
"semver": "^7.3.8",
|
|
87
|
+
"web3": "^1.8.1",
|
|
88
|
+
"web3-core": "^1.8.1",
|
|
89
|
+
"web3-utils": "^1.8.1"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateSafeDeploymentConfig = exports.validateSafeAccountConfig = void 0;
|
|
4
|
-
const bignumber_1 = require("@ethersproject/bignumber");
|
|
5
|
-
const validateSafeAccountConfig = ({ owners, threshold }) => {
|
|
6
|
-
if (owners.length <= 0)
|
|
7
|
-
throw new Error('Owner list must have at least one owner');
|
|
8
|
-
if (threshold <= 0)
|
|
9
|
-
throw new Error('Threshold must be greater than or equal to 1');
|
|
10
|
-
if (threshold > owners.length)
|
|
11
|
-
throw new Error('Threshold must be lower than or equal to owners length');
|
|
12
|
-
};
|
|
13
|
-
exports.validateSafeAccountConfig = validateSafeAccountConfig;
|
|
14
|
-
const validateSafeDeploymentConfig = ({ saltNonce }) => {
|
|
15
|
-
if (bignumber_1.BigNumber.from(saltNonce).lt(0))
|
|
16
|
-
throw new Error('saltNonce must be greater than or equal to 0');
|
|
17
|
-
};
|
|
18
|
-
exports.validateSafeDeploymentConfig = validateSafeDeploymentConfig;
|
|
19
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/safeFactory/utils.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAG7C,MAAM,yBAAyB,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAqB,EAAQ,EAAE;IAC1F,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAClF,IAAI,SAAS,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACnF,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM;QAC3B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;AAC7E,CAAC,CAAA;AALY,QAAA,yBAAyB,6BAKrC;AAEM,MAAM,4BAA4B,GAAG,CAAC,EAAE,SAAS,EAAwB,EAAQ,EAAE;IACxF,IAAI,qBAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;AACnE,CAAC,CAAA;AAHY,QAAA,4BAA4B,gCAGxC"}
|