1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-20 11:23:24 +02:00

add Torus wallet

This commit is contained in:
Matthias Kretschmann 2020-07-22 12:31:49 +02:00
parent 1aedc40fd5
commit e9f39be9c3
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 327 additions and 0 deletions

307
package-lock.json generated
View File

@ -1168,6 +1168,11 @@
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
"dev": true
},
"@chaitanyapotti/random-id": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@chaitanyapotti/random-id/-/random-id-1.0.3.tgz",
"integrity": "sha512-xiVWA2vTL3jQeuZ+yebXAtwIeEbh/13RAFxvRq0YxeUc02RBOGyC9eyDKXjwlN0uxPtnEwWxsELkSwnaH5kxjg=="
},
"@cnakazawa/watch": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
@ -5072,6 +5077,134 @@
"tippy.js": "^6.2.0"
}
},
"@toruslabs/eccrypto": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@toruslabs/eccrypto/-/eccrypto-1.1.3.tgz",
"integrity": "sha512-hoLACz9Z6RP/ZH41Ba0iImJpl1f4Zx7pi/d3R7UIrOyt4IOgnWrlkzh2IqQYw4ouae4WZQYSZlyeYv81EWkoxQ==",
"requires": {
"acorn": "^7.3.1",
"elliptic": "^6.5.3",
"es6-promise": "^4.2.8",
"nan": "^2.14.1",
"secp256k1": "^3.8.0"
},
"dependencies": {
"secp256k1": {
"version": "3.8.0",
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz",
"integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==",
"optional": true,
"requires": {
"bindings": "^1.5.0",
"bip66": "^1.1.5",
"bn.js": "^4.11.8",
"create-hash": "^1.2.0",
"drbg.js": "^1.0.1",
"elliptic": "^6.5.2",
"nan": "^2.14.0",
"safe-buffer": "^5.1.2"
}
}
}
},
"@toruslabs/fetch-node-details": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@toruslabs/fetch-node-details/-/fetch-node-details-2.3.0.tgz",
"integrity": "sha512-QWfYxBel+XUnUgkyPnjTLZpWiYJVl3Nz6I5MwSRJ/t3GteJvvGuq93zbsIzRmyhxK5C+e+FufnEUsKFwiXtPmA==",
"requires": {
"web3-eth-contract": "^1.2.9",
"web3-utils": "^1.2.9"
}
},
"@toruslabs/http-helpers": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/@toruslabs/http-helpers/-/http-helpers-1.3.3.tgz",
"integrity": "sha512-bM0NyFCA+K8DOlhciDLIUQ05/VzuM9lgdwnNSr/gociRhPWbUDc8PkSVKYT3MshXj/ZtLvN9UvcTvY1hddN5UQ==",
"requires": {
"deepmerge": "^4.2.2",
"loglevel": "^1.6.8"
},
"dependencies": {
"deepmerge": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg=="
}
}
},
"@toruslabs/torus-embed": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/@toruslabs/torus-embed/-/torus-embed-1.7.3.tgz",
"integrity": "sha512-PMmksmG9mgRmFvliHccxV2LdDjrNKQfLojlYG3WMXB0OF3Bj3B7Y94ItSEvVf3XI+Q9xadq1cTAN+wLV3km/BA==",
"requires": {
"@chaitanyapotti/random-id": "^1.0.3",
"@toruslabs/fetch-node-details": "^2.3.0",
"@toruslabs/torus.js": "^2.2.2",
"create-hash": "^1.2.0",
"deepmerge": "^4.2.2",
"eth-json-rpc-errors": "^2.0.2",
"fast-deep-equal": "^3.1.3",
"json-rpc-engine": "^5.1.8",
"json-rpc-middleware-stream": "^2.1.1",
"loglevel": "^1.6.8",
"obj-multiplex": "^1.0.0",
"obs-store": "^4.0.3",
"post-message-stream": "^3.0.0",
"pump": "^3.0.0",
"safe-event-emitter": "^1.0.1",
"web3": "^0.20.7"
},
"dependencies": {
"bignumber.js": {
"version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934",
"from": "git+https://github.com/frozeman/bignumber.js-nolookahead.git"
},
"deepmerge": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg=="
},
"utf8": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz",
"integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY="
},
"web3": {
"version": "0.20.7",
"resolved": "https://registry.npmjs.org/web3/-/web3-0.20.7.tgz",
"integrity": "sha512-VU6/DSUX93d1fCzBz7WP/SGCQizO1rKZi4Px9j/3yRyfssHyFcZamMw2/sj4E8TlfMXONvZLoforR8B4bRoyTQ==",
"requires": {
"bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git",
"crypto-js": "^3.1.4",
"utf8": "^2.1.1",
"xhr2-cookies": "^1.1.0",
"xmlhttprequest": "*"
}
}
}
},
"@toruslabs/torus.js": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@toruslabs/torus.js/-/torus.js-2.2.3.tgz",
"integrity": "sha512-GryzcqY5/iumfCy0LNUIdjo9iKYRHof6UQzHYK/u2oc4XtCWVKnwk+6OZfuYeurEoW/VDYU+b1MEa7qqOKV9RQ==",
"requires": {
"@toruslabs/eccrypto": "^1.1.3",
"@toruslabs/http-helpers": "^1.3.3",
"bn.js": "^5.1.2",
"elliptic": "^6.5.3",
"json-stable-stringify": "^1.0.1",
"loglevel": "^1.6.8",
"memory-cache": "^0.2.0",
"web3-utils": "^1.2.9"
},
"dependencies": {
"bn.js": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz",
"integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA=="
}
}
},
"@types/anymatch": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz",
@ -10178,6 +10311,11 @@
"randomfill": "^1.0.3"
}
},
"crypto-js": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz",
"integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
},
"crypto-random-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz",
@ -12041,6 +12179,11 @@
"es6-symbol": "^3.1.1"
}
},
"es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
},
"es6-shim": {
"version": "0.35.5",
"resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.5.tgz",
@ -23114,6 +23257,44 @@
"safe-event-emitter": "^1.0.1"
}
},
"json-rpc-middleware-stream": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/json-rpc-middleware-stream/-/json-rpc-middleware-stream-2.1.1.tgz",
"integrity": "sha512-WZheufPN+/RKkjXQP3lK5tFYblqG0n+oYv5qpammwwY2vsJRB7mM4Txhr4ajzvYEZi1UkENnplrmaYiqaqafaA==",
"requires": {
"readable-stream": "^2.3.3",
"safe-event-emitter": "^1.0.1"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
}
},
"json-rpc-random-id": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz",
@ -24087,6 +24268,11 @@
"map-or-similar": "^1.5.0"
}
},
"memory-cache": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz",
"integrity": "sha1-eJCwHVLADI68nVM+H46xfjA0hxo="
},
"memory-fs": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz",
@ -25238,6 +25424,45 @@
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"obj-multiplex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/obj-multiplex/-/obj-multiplex-1.0.0.tgz",
"integrity": "sha1-Lyrmv9SuEb7+dC6p6ls2Y26r/8E=",
"requires": {
"end-of-stream": "^1.4.0",
"once": "^1.4.0",
"readable-stream": "^2.3.3"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
}
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@ -25404,6 +25629,46 @@
"http-https": "^1.0.0"
}
},
"obs-store": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-4.0.3.tgz",
"integrity": "sha512-+mm13kCRDv6IcvUDKTw0LIy5+dQhIktYaR/RwwZUFzOTi/fjMaNBnk42Adb94qZqJ00qWkjhQSZH7MXlKnTi8A==",
"requires": {
"readable-stream": "^2.2.2",
"safe-event-emitter": "^1.0.1",
"through2": "^2.0.3",
"xtend": "^4.0.1"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
}
},
"obuf": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
@ -26107,6 +26372,43 @@
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
},
"post-message-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/post-message-stream/-/post-message-stream-3.0.0.tgz",
"integrity": "sha1-kNn1S9IJ5rb110eVuHWIIFtUcEg=",
"requires": {
"readable-stream": "^2.1.4"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
}
},
"postcss": {
"version": "7.0.32",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",
@ -34442,6 +34744,11 @@
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
"dev": true
},
"xmlhttprequest": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
"integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw="
},
"xmlhttprequest-ssl": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",

View File

@ -25,6 +25,7 @@
"@oceanprotocol/typographies": "^0.1.0",
"@sindresorhus/slugify": "^1.0.0",
"@tippyjs/react": "^4.1.0",
"@toruslabs/torus-embed": "^1.7.3",
"@types/classnames": "^2.2.10",
"@vercel/node": "^1.7.2",
"@walletconnect/web3-provider": "^1.0.18",

View File

@ -47,6 +47,10 @@ div.web3modal-provider-description {
margin-top: 0;
}
#torusIframe {
z-index: 3;
}
@keyframes fadeIn {
from {
opacity: 0;

View File

@ -15,6 +15,7 @@ export async function connectWallet(
const { default: WalletConnectProvider } = await import(
'@walletconnect/web3-provider'
)
const { default: Torus } = await import('@toruslabs/torus-embed')
// Provider Options
// https://github.com/Web3Modal/web3modal#provider-options
@ -24,6 +25,20 @@ export async function connectWallet(
options: {
infuraId: infuraProjectId
}
},
torus: {
package: Torus
// options: {
// networkParams: {
// host: 'https://localhost:8545' // optional
// chainId: 1337, // optional
// networkId: 1337 // optional
// },
// config: {
// buildEnv: 'development' // optional
// }
// }
// }
}
}