mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
refactoring for web3.js 1.2.2
This commit is contained in:
parent
d69cccf901
commit
2fd4e94f29
@ -1,9 +1,9 @@
|
||||
import { Config } from '../src'
|
||||
const HDWalletProvider = require('@truffle/hdwallet-provider')
|
||||
import HDWalletProvider from '@truffle/hdwallet-provider'
|
||||
|
||||
const configJson: Config = {
|
||||
nodeUri: 'http://localhost:8545',
|
||||
aquariusUri: 'http://172.15.0.15:5000',
|
||||
aquariusUri: 'http://aquarius:5000',
|
||||
brizoUri: 'http://localhost:8030',
|
||||
secretStoreUri: 'http://localhost:12001',
|
||||
brizoAddress: '0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0',
|
||||
|
@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"lib": ["es6", "es7", "dom"],
|
||||
"noUnusedLocals": true
|
||||
"noUnusedLocals": true,
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
|
365
package-lock.json
generated
365
package-lock.json
generated
@ -171,13 +171,6 @@
|
||||
"integrity": "sha512-5yNNA+qdjut9/nMiFKJd4D4io+GhzdfvdqVd5YMkgT9RV1qDosGj6NVsKArYay6g+tQH7pCJ6Y1FiAbhaaFB9g==",
|
||||
"requires": {
|
||||
"node-fetch": "^2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@octokit/endpoint": {
|
||||
@ -666,6 +659,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/bn.js": {
|
||||
"version": "4.11.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz",
|
||||
"integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==",
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/chai": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.4.tgz",
|
||||
@ -725,8 +726,7 @@
|
||||
"@types/node": {
|
||||
"version": "12.12.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz",
|
||||
"integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA=="
|
||||
},
|
||||
"@types/node-fetch": {
|
||||
"version": "2.5.3",
|
||||
@ -2290,7 +2290,6 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
@ -2312,7 +2311,6 @@
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz",
|
||||
"integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
@ -3810,7 +3808,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz",
|
||||
"integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browserify-aes": "^1.0.6",
|
||||
"create-hash": "^1.1.2",
|
||||
@ -4796,6 +4793,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ethereum-bloom-filters": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.6.tgz",
|
||||
"integrity": "sha512-dE9CGNzgOOsdh7msZirvv8qjHtnHpvBlKe2647kM8v+yeF71IRso55jpojemvHV+jMjr48irPWxMRaHuOWzAFA==",
|
||||
"requires": {
|
||||
"js-sha3": "^0.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-sha3": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz",
|
||||
"integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"ethereum-common": {
|
||||
"version": "0.0.18",
|
||||
"resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz",
|
||||
@ -4902,14 +4914,21 @@
|
||||
"ethereumjs-common": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.3.2.tgz",
|
||||
"integrity": "sha512-GkltYRIqBLzaZLmF/K3E+g9lZ4O4FL+TtpisAlD3N+UVlR+mrtoG+TvxavqVa6PwOY4nKIEMe5pl6MrTio3Lww==",
|
||||
"dev": true
|
||||
"integrity": "sha512-GkltYRIqBLzaZLmF/K3E+g9lZ4O4FL+TtpisAlD3N+UVlR+mrtoG+TvxavqVa6PwOY4nKIEMe5pl6MrTio3Lww=="
|
||||
},
|
||||
"ethereumjs-tx": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.1.tgz",
|
||||
"integrity": "sha512-QtVriNqowCFA19X9BCRPMgdVNJ0/gMBS91TQb1DfrhsbR748g4STwxZptFAwfqehMyrF8rDwB23w87PQwru0wA==",
|
||||
"requires": {
|
||||
"ethereumjs-common": "^1.3.1",
|
||||
"ethereumjs-util": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"ethereumjs-util": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz",
|
||||
"integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.11.0",
|
||||
"create-hash": "^1.1.2",
|
||||
@ -5102,7 +5121,6 @@
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz",
|
||||
"integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-hex-prefixed": "1.0.0",
|
||||
"strip-hex-prefix": "1.0.0"
|
||||
@ -5534,8 +5552,7 @@
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "4.0.0",
|
||||
@ -7797,7 +7814,6 @@
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz",
|
||||
"integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bindings": "^1.2.1",
|
||||
"inherits": "^2.0.3",
|
||||
@ -9801,7 +9817,8 @@
|
||||
"randomhex": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz",
|
||||
"integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU="
|
||||
"integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=",
|
||||
"dev": true
|
||||
},
|
||||
"range-parser": {
|
||||
"version": "1.2.1",
|
||||
@ -10360,7 +10377,6 @@
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz",
|
||||
"integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.11.1",
|
||||
"safe-buffer": "^5.1.1"
|
||||
@ -10472,6 +10488,21 @@
|
||||
"resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz",
|
||||
"integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q="
|
||||
},
|
||||
"scrypt-shim": {
|
||||
"version": "github:web3-js/scrypt-shim#be5e616323a8b5e568788bf94d03c1b8410eac54",
|
||||
"from": "github:web3-js/scrypt-shim",
|
||||
"requires": {
|
||||
"scryptsy": "^2.1.0",
|
||||
"semver": "^6.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"scrypt.js": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz",
|
||||
@ -10502,7 +10533,6 @@
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz",
|
||||
"integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bindings": "^1.5.0",
|
||||
"bip66": "^1.1.5",
|
||||
@ -10517,8 +10547,7 @@
|
||||
"nan": {
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -12228,139 +12257,151 @@
|
||||
}
|
||||
},
|
||||
"web3": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz",
|
||||
"integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3/-/web3-1.2.2.tgz",
|
||||
"integrity": "sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg==",
|
||||
"requires": {
|
||||
"web3-bzz": "1.2.1",
|
||||
"web3-core": "1.2.1",
|
||||
"web3-eth": "1.2.1",
|
||||
"web3-eth-personal": "1.2.1",
|
||||
"web3-net": "1.2.1",
|
||||
"web3-shh": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"@types/node": "^12.6.1",
|
||||
"web3-bzz": "1.2.2",
|
||||
"web3-core": "1.2.2",
|
||||
"web3-eth": "1.2.2",
|
||||
"web3-eth-personal": "1.2.2",
|
||||
"web3-net": "1.2.2",
|
||||
"web3-shh": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-bzz": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.1.tgz",
|
||||
"integrity": "sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.2.tgz",
|
||||
"integrity": "sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA==",
|
||||
"requires": {
|
||||
"@types/node": "^10.12.18",
|
||||
"got": "9.6.0",
|
||||
"swarm-js": "0.1.39",
|
||||
"underscore": "1.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "10.17.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.5.tgz",
|
||||
"integrity": "sha512-RElZIr/7JreF1eY6oD5RF3kpmdcreuQPjg5ri4oQ5g9sq7YWU8HkfB3eH8GwAwxf5OaCh0VPi7r4N/yoTGelrA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"web3-core": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.1.tgz",
|
||||
"integrity": "sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.2.tgz",
|
||||
"integrity": "sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ==",
|
||||
"requires": {
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-core-requestmanager": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"@types/bn.js": "^4.11.4",
|
||||
"@types/node": "^12.6.1",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-core-requestmanager": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-core-helpers": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz",
|
||||
"integrity": "sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz",
|
||||
"integrity": "sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ==",
|
||||
"requires": {
|
||||
"underscore": "1.9.1",
|
||||
"web3-eth-iban": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-eth-iban": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-core-method": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.1.tgz",
|
||||
"integrity": "sha512-Ghg2WS23qi6Xj8Od3VCzaImLHseEA7/usvnOItluiIc5cKs00WYWsNy2YRStzU9a2+z8lwQywPYp0nTzR/QXdQ==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.2.tgz",
|
||||
"integrity": "sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA==",
|
||||
"requires": {
|
||||
"underscore": "1.9.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-promievent": "1.2.1",
|
||||
"web3-core-subscriptions": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-promievent": "1.2.2",
|
||||
"web3-core-subscriptions": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-core-promievent": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz",
|
||||
"integrity": "sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz",
|
||||
"integrity": "sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ==",
|
||||
"requires": {
|
||||
"any-promise": "1.3.0",
|
||||
"eventemitter3": "3.1.2"
|
||||
}
|
||||
},
|
||||
"web3-core-requestmanager": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.1.tgz",
|
||||
"integrity": "sha512-xfknTC69RfYmLKC+83Jz73IC3/sS2ZLhGtX33D4Q5nQ8yc39ElyAolxr9sJQS8kihOcM6u4J+8gyGMqsLcpIBg==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz",
|
||||
"integrity": "sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw==",
|
||||
"requires": {
|
||||
"underscore": "1.9.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-providers-http": "1.2.1",
|
||||
"web3-providers-ipc": "1.2.1",
|
||||
"web3-providers-ws": "1.2.1"
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-providers-http": "1.2.2",
|
||||
"web3-providers-ipc": "1.2.2",
|
||||
"web3-providers-ws": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-core-subscriptions": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz",
|
||||
"integrity": "sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz",
|
||||
"integrity": "sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ==",
|
||||
"requires": {
|
||||
"eventemitter3": "3.1.2",
|
||||
"underscore": "1.9.1",
|
||||
"web3-core-helpers": "1.2.1"
|
||||
"web3-core-helpers": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-eth": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.1.tgz",
|
||||
"integrity": "sha512-/2xly4Yry5FW1i+uygPjhfvgUP/MS/Dk+PDqmzp5M88tS86A+j8BzKc23GrlA8sgGs0645cpZK/999LpEF5UdA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.2.tgz",
|
||||
"integrity": "sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA==",
|
||||
"requires": {
|
||||
"underscore": "1.9.1",
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-core-subscriptions": "1.2.1",
|
||||
"web3-eth-abi": "1.2.1",
|
||||
"web3-eth-accounts": "1.2.1",
|
||||
"web3-eth-contract": "1.2.1",
|
||||
"web3-eth-ens": "1.2.1",
|
||||
"web3-eth-iban": "1.2.1",
|
||||
"web3-eth-personal": "1.2.1",
|
||||
"web3-net": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-core-subscriptions": "1.2.2",
|
||||
"web3-eth-abi": "1.2.2",
|
||||
"web3-eth-accounts": "1.2.2",
|
||||
"web3-eth-contract": "1.2.2",
|
||||
"web3-eth-ens": "1.2.2",
|
||||
"web3-eth-iban": "1.2.2",
|
||||
"web3-eth-personal": "1.2.2",
|
||||
"web3-net": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-eth-abi": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz",
|
||||
"integrity": "sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz",
|
||||
"integrity": "sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw==",
|
||||
"requires": {
|
||||
"ethers": "4.0.0-beta.3",
|
||||
"underscore": "1.9.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-eth-accounts": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz",
|
||||
"integrity": "sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz",
|
||||
"integrity": "sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA==",
|
||||
"requires": {
|
||||
"any-promise": "1.3.0",
|
||||
"crypto-browserify": "3.12.0",
|
||||
"eth-lib": "0.2.7",
|
||||
"scryptsy": "2.1.0",
|
||||
"semver": "6.2.0",
|
||||
"ethereumjs-common": "^1.3.2",
|
||||
"ethereumjs-tx": "^2.1.1",
|
||||
"scrypt-shim": "github:web3-js/scrypt-shim",
|
||||
"underscore": "1.9.1",
|
||||
"uuid": "3.3.2",
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"eth-lib": {
|
||||
@ -12373,11 +12414,6 @@
|
||||
"xhr-request-promise": "^0.1.2"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz",
|
||||
"integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A=="
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
@ -12386,64 +12422,66 @@
|
||||
}
|
||||
},
|
||||
"web3-eth-contract": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz",
|
||||
"integrity": "sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz",
|
||||
"integrity": "sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA==",
|
||||
"requires": {
|
||||
"@types/bn.js": "^4.11.4",
|
||||
"underscore": "1.9.1",
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-core-promievent": "1.2.1",
|
||||
"web3-core-subscriptions": "1.2.1",
|
||||
"web3-eth-abi": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-core-promievent": "1.2.2",
|
||||
"web3-core-subscriptions": "1.2.2",
|
||||
"web3-eth-abi": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-eth-ens": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz",
|
||||
"integrity": "sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz",
|
||||
"integrity": "sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg==",
|
||||
"requires": {
|
||||
"eth-ens-namehash": "2.0.8",
|
||||
"underscore": "1.9.1",
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-promievent": "1.2.1",
|
||||
"web3-eth-abi": "1.2.1",
|
||||
"web3-eth-contract": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-promievent": "1.2.2",
|
||||
"web3-eth-abi": "1.2.2",
|
||||
"web3-eth-contract": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-eth-iban": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz",
|
||||
"integrity": "sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz",
|
||||
"integrity": "sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ==",
|
||||
"requires": {
|
||||
"bn.js": "4.11.8",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-eth-personal": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.1.tgz",
|
||||
"integrity": "sha512-RNDVSiaSoY4aIp8+Hc7z+X72H7lMb3fmAChuSBADoEc7DsJrY/d0R5qQDK9g9t2BO8oxgLrLNyBP/9ub2Hc6Bg==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz",
|
||||
"integrity": "sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg==",
|
||||
"requires": {
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-net": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"@types/node": "^12.6.1",
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-net": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-net": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.1.tgz",
|
||||
"integrity": "sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.2.tgz",
|
||||
"integrity": "sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw==",
|
||||
"requires": {
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-utils": "1.2.1"
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-utils": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-provider-engine": {
|
||||
@ -12510,55 +12548,56 @@
|
||||
}
|
||||
},
|
||||
"web3-providers-http": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.1.tgz",
|
||||
"integrity": "sha512-BDtVUVolT9b3CAzeGVA/np1hhn7RPUZ6YYGB/sYky+GjeO311Yoq8SRDUSezU92x8yImSC2B+SMReGhd1zL+bQ==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.2.tgz",
|
||||
"integrity": "sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg==",
|
||||
"requires": {
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"xhr2-cookies": "1.1.0"
|
||||
}
|
||||
},
|
||||
"web3-providers-ipc": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.1.tgz",
|
||||
"integrity": "sha512-oPEuOCwxVx8L4CPD0TUdnlOUZwGBSRKScCz/Ws2YHdr9Ium+whm+0NLmOZjkjQp5wovQbyBzNa6zJz1noFRvFA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz",
|
||||
"integrity": "sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA==",
|
||||
"requires": {
|
||||
"oboe": "2.1.4",
|
||||
"underscore": "1.9.1",
|
||||
"web3-core-helpers": "1.2.1"
|
||||
"web3-core-helpers": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-providers-ws": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.1.tgz",
|
||||
"integrity": "sha512-oqsQXzu+ejJACVHy864WwIyw+oB21nw/pI65/sD95Zi98+/HQzFfNcIFneF1NC4bVF3VNX4YHTNq2I2o97LAiA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz",
|
||||
"integrity": "sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA==",
|
||||
"requires": {
|
||||
"underscore": "1.9.1",
|
||||
"web3-core-helpers": "1.2.1",
|
||||
"web3-core-helpers": "1.2.2",
|
||||
"websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis"
|
||||
}
|
||||
},
|
||||
"web3-shh": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.1.tgz",
|
||||
"integrity": "sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.2.tgz",
|
||||
"integrity": "sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg==",
|
||||
"requires": {
|
||||
"web3-core": "1.2.1",
|
||||
"web3-core-method": "1.2.1",
|
||||
"web3-core-subscriptions": "1.2.1",
|
||||
"web3-net": "1.2.1"
|
||||
"web3-core": "1.2.2",
|
||||
"web3-core-method": "1.2.2",
|
||||
"web3-core-subscriptions": "1.2.2",
|
||||
"web3-net": "1.2.2"
|
||||
}
|
||||
},
|
||||
"web3-utils": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.1.tgz",
|
||||
"integrity": "sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz",
|
||||
"integrity": "sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A==",
|
||||
"requires": {
|
||||
"bn.js": "4.11.8",
|
||||
"eth-lib": "0.2.7",
|
||||
"ethereum-bloom-filters": "^1.0.6",
|
||||
"ethjs-unit": "0.1.6",
|
||||
"number-to-bn": "1.7.0",
|
||||
"randomhex": "0.1.5",
|
||||
"randombytes": "^2.1.0",
|
||||
"underscore": "1.9.1",
|
||||
"utf8": "3.0.0"
|
||||
},
|
||||
|
@ -49,7 +49,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/oceanprotocol/squid-js#readme",
|
||||
"peerDependencies": {
|
||||
"web3": "^1.2.0"
|
||||
"web3": "^1.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/keeper-contracts": "^0.12.7",
|
||||
@ -59,7 +59,7 @@
|
||||
"node-fetch": "^2.6.0",
|
||||
"save-file": "^2.3.1",
|
||||
"uuid": "^3.3.3",
|
||||
"web3": "1.2.1",
|
||||
"web3": "^1.2.2",
|
||||
"whatwg-url": "^7.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as Web3 from 'web3'
|
||||
import Web3 from 'web3'
|
||||
import Config from './models/Config'
|
||||
import { Logger, LoggerInstance, LogLevel } from './utils'
|
||||
import Web3Provider from './keeper/Web3Provider'
|
||||
|
@ -1,4 +1,3 @@
|
||||
import * as Web3 from 'web3'
|
||||
import Web3Provider from '../keeper/Web3Provider'
|
||||
import { Ocean } from '../ocean/Ocean'
|
||||
import { Authentication } from './Authentication'
|
||||
@ -110,7 +109,7 @@ export class DDO {
|
||||
|
||||
/**
|
||||
* Generates proof using personal sing.
|
||||
* @param {Web3} web3 Web3 instance.
|
||||
* @param {Ocean} ocean Ocean instance.
|
||||
* @param {string} publicKey Public key to be used on personal sign.
|
||||
* @param {string} password Password if it's required.
|
||||
* @return {Promise<Proof>} Proof object.
|
||||
@ -130,15 +129,15 @@ export class DDO {
|
||||
|
||||
/**
|
||||
* Generates and adds a proof using personal sing on the DDO.
|
||||
* @param {Web3} web3 Web3 instance.
|
||||
* @param {Ocean} ocean Ocean instance.
|
||||
* @param {string} publicKey Public key to be used on personal sign.
|
||||
* @param {string} password Password if it's required.
|
||||
* @return {Promise<Proof>} Proof object.
|
||||
*/
|
||||
public async addProof(web3: Web3, publicKey: string, password?: string): Promise<void> {
|
||||
public async addProof(ocean: Ocean, publicKey: string, password?: string): Promise<void> {
|
||||
if (this.proof) {
|
||||
throw new Error('Proof already exists')
|
||||
}
|
||||
this.proof = await this.generateProof(web3, publicKey, password)
|
||||
this.proof = await this.generateProof(ocean, publicKey, password)
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ export class Keeper extends Instantiable {
|
||||
* @return {Promise<string>} Network name.
|
||||
*/
|
||||
public getNetworkName(): Promise<string> {
|
||||
return this.web3.eth.net.getId().then(networkId => {
|
||||
return this.web3.eth.net.getId().then((networkId: number) => {
|
||||
switch (networkId) {
|
||||
case 1:
|
||||
return 'Main'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as Web3 from 'web3'
|
||||
import Web3 from 'web3'
|
||||
import Config from '../models/Config'
|
||||
|
||||
export default class Web3Provider {
|
||||
@ -7,6 +7,8 @@ export default class Web3Provider {
|
||||
* @return {Web3}
|
||||
*/
|
||||
public static getWeb3(config: Partial<Config> = {}): Web3 {
|
||||
return new Web3(config.web3Provider || Web3.givenProvider || new Web3.providers.HttpProvider(config.nodeUri))
|
||||
return new Web3(
|
||||
config.web3Provider || (Web3 as any).givenProvider || new Web3.providers.HttpProvider(config.nodeUri)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ export class ServiceAgreement extends Instantiable {
|
||||
timelocks: number[],
|
||||
timeouts: number[]
|
||||
): string {
|
||||
const args = [
|
||||
const args: any = [
|
||||
{ type: 'address', value: zeroX(serviceAgreementTemplateId) },
|
||||
{ type: 'bytes32[]', value: valueHashes.map(zeroX) },
|
||||
{ type: 'uint256[]', value: timelocks },
|
||||
@ -80,7 +80,7 @@ export class ServiceAgreement extends Instantiable {
|
||||
{ type: 'bytes32', value: zeroX(serviceAgreementId) }
|
||||
]
|
||||
|
||||
return this.web3.utils.soliditySha3(...args).toString('hex')
|
||||
return this.web3.utils.soliditySha3(...args)
|
||||
}
|
||||
|
||||
private getTimeValuesFromService(service: ServiceAccess, type: 'timeout' | 'timelock'): number[] {
|
||||
|
@ -7,7 +7,7 @@ export class SignatureUtils extends Instantiable {
|
||||
}
|
||||
|
||||
public async signText(text: string, publicKey: string, password?: string): Promise<string> {
|
||||
const isMetaMask = this.web3 && this.web3.currentProvider && this.web3.currentProvider.isMetaMask
|
||||
const isMetaMask = this.web3 && this.web3.currentProvider && (this.web3.currentProvider as any).isMetaMask
|
||||
try {
|
||||
return await this.web3.eth.personal.sign(text, publicKey, password)
|
||||
} catch (e) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import fetch, { BodyInit, RequestInit, Response } from 'node-fetch'
|
||||
import * as fs from 'fs'
|
||||
|
||||
import { BodyInit, RequestInit, Response } from 'node-fetch'
|
||||
import fs from 'fs'
|
||||
import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract'
|
||||
|
||||
const fetch = require('node-fetch')
|
||||
import save = require('save-file')
|
||||
|
||||
/**
|
||||
@ -48,7 +48,7 @@ export class WebServiceConnector extends Instantiable {
|
||||
if (!response.ok) {
|
||||
throw new Error('Response error.')
|
||||
}
|
||||
let filename
|
||||
let filename: string
|
||||
try {
|
||||
filename = response.headers.get('content-disposition').match(/attachment;filename=(.+)/)[1]
|
||||
} catch {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as assert from 'assert'
|
||||
import assert from 'assert'
|
||||
import * as squid from '../src/squid'
|
||||
|
||||
describe('Squid', () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
import { Ocean } from '../../src/ocean/Ocean'
|
||||
import { Aquarius, SearchQuery } from '../../src/aquarius/Aquarius'
|
||||
import { DDO } from '../../src/ddo/DDO'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import * as Web3 from 'web3'
|
||||
import spies from 'chai-spies'
|
||||
import Web3 from 'web3'
|
||||
|
||||
import { DDO } from '../../src/ddo/DDO'
|
||||
import { Service } from '../../src/ddo/Service'
|
||||
@ -270,7 +270,7 @@ describe('DDO', () => {
|
||||
} as any
|
||||
const ddo = new DDO(testDDO)
|
||||
const generateProofSpy = spy.on(ddo, 'generateProof', () => fakeProof)
|
||||
await ddo.addProof(web3, publicKey)
|
||||
await ddo.addProof(ocean, publicKey)
|
||||
|
||||
assert.equal(ddo.proof, fakeProof)
|
||||
expect(generateProofSpy).to.have.been.called.with(publicKey)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
import { EventHandler } from '../../src/keeper/EventHandler'
|
||||
import { Ocean } from '../../src/ocean/Ocean'
|
||||
import config from '../config'
|
||||
|
@ -1,9 +1,14 @@
|
||||
import Contract from 'web3-eth-contract'
|
||||
import { Contract } from 'web3-eth-contract'
|
||||
import ContractHandler from '../../src/keeper/ContractHandler'
|
||||
import Web3Provider from '../../src/keeper/Web3Provider'
|
||||
import Logger from '../../src/utils/Logger'
|
||||
import config from '../config'
|
||||
|
||||
interface ContractTest extends Contract {
|
||||
testContract?: boolean
|
||||
$initialized?: boolean
|
||||
}
|
||||
|
||||
export default class TestContractHandler extends ContractHandler {
|
||||
public static async prepareContracts() {
|
||||
const web3 = Web3Provider.getWeb3(config)
|
||||
@ -106,26 +111,26 @@ export default class TestContractHandler extends ContractHandler {
|
||||
from: string,
|
||||
args: any[] = [],
|
||||
tokens: { [name: string]: string } = {}
|
||||
): Promise<Contract & { $initialized: boolean }> {
|
||||
): Promise<ContractTest> {
|
||||
const where = this.networkId
|
||||
|
||||
// dont redeploy if there is already something loaded
|
||||
if (TestContractHandler.hasContract(name, where)) {
|
||||
const contract = await ContractHandler.getContract(name, where)
|
||||
const contract: ContractTest = await ContractHandler.getContract(name, where)
|
||||
if (contract.testContract) {
|
||||
return { ...contract, $initialized: true }
|
||||
return { ...contract, $initialized: true } as any
|
||||
}
|
||||
}
|
||||
|
||||
const web3 = Web3Provider.getWeb3(config)
|
||||
|
||||
let contractInstance: Contract
|
||||
let contractInstance: ContractTest
|
||||
try {
|
||||
Logger.log('Deploying', name)
|
||||
const sendConfig = {
|
||||
from,
|
||||
gas: 3000000,
|
||||
gasPrice: 10000000000
|
||||
gasPrice: String(10000000000)
|
||||
}
|
||||
const artifact = require(`@oceanprotocol/keeper-contracts/artifacts/${name}.development.json`)
|
||||
const tempContract = new web3.eth.Contract(artifact.abi, artifact.address)
|
||||
@ -154,7 +159,7 @@ export default class TestContractHandler extends ContractHandler {
|
||||
}
|
||||
contractInstance.testContract = true
|
||||
ContractHandler.setContract(name, where, contractInstance)
|
||||
// Logger.log("Deployed", name, "at", contractInstance.options.address);
|
||||
// Logger.log('Deployed', name, 'at', contractInstance.options.address)
|
||||
} catch (err) {
|
||||
Logger.error('Deployment failed for', name, 'with args', JSON.stringify(args, null, 2), err.message)
|
||||
throw err
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as assert from 'assert'
|
||||
import assert from 'assert'
|
||||
import DID from '../../src/ocean/DID'
|
||||
|
||||
describe('DID', () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
|
||||
import Account from '../../src/ocean/Account'
|
||||
import { Ocean } from '../../src/ocean/Ocean'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
|
||||
import config from '../config'
|
||||
import Account from '../../src/ocean/Account'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
|
||||
import config from '../config'
|
||||
import Account from '../../src/ocean/Account'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
|
||||
import Account from '../../src/ocean/Account'
|
||||
import { Ocean } from '../../src/ocean/Ocean'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
|
||||
import spies from 'chai-spies'
|
||||
import Web3 from 'web3'
|
||||
import config from '../../config'
|
||||
|
||||
import { Ocean } from '../../../src/ocean/Ocean'
|
||||
@ -11,7 +11,7 @@ describe('SignatureUtils', () => {
|
||||
const publicKey = `0x${'a'.repeat(40)}`
|
||||
const text = '0123456789abcde'
|
||||
const signature = `0x${'a'.repeat(130)}`
|
||||
let web3
|
||||
let web3: Web3
|
||||
let ocean: Ocean
|
||||
|
||||
before(async () => {
|
||||
|
@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"lib": ["es6", "es7"],
|
||||
"noUnusedLocals": true
|
||||
"noUnusedLocals": true,
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
|
||||
import { SubscribableObserver } from '../../src/utils/SubscribableObserver'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { assert, expect, spy, use } from 'chai'
|
||||
import * as spies from 'chai-spies'
|
||||
import spies from 'chai-spies'
|
||||
|
||||
import { SubscribablePromise } from '../../src/utils/SubscribablePromise'
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"lib": ["es2017", "es6", "es7", "dom"],
|
||||
"declaration": true,
|
||||
"module": "commonjs",
|
||||
|
Loading…
Reference in New Issue
Block a user