From 24bddb669a13aa6705c76072eb462ba63a244573 Mon Sep 17 00:00:00 2001 From: Juanma Hidalgo Date: Wed, 18 Oct 2023 19:29:14 +0200 Subject: [PATCH] feat: use squid to calculate route between two chains and tokens --- webapp/config-overrides.js | 5 +- webapp/package-lock.json | 991 +++++++++++------- webapp/package.json | 2 + .../BestBuyingOption.container.tsx | 22 + .../BestBuyingOption/BestBuyingOption.tsx | 3 +- .../BestBuyingOption.types.ts | 8 + .../AssetPage/BestBuyingOption/index.ts | 2 +- .../AssetPage/BuyNFTBox/BuyNFTBox.tsx | 1 + .../BuyNFTButtons/BuyNFTButtons.tsx | 7 +- .../BuyNFTButtons/BuyNFTButtons.types.ts | 3 +- .../ItemSaleActions.container.ts | 18 +- .../ItemSaleActions/ItemSaleActions.tsx | 8 +- .../ItemSaleActions/ItemSaleActions.types.ts | 6 + .../NFTSaleActions/NFTSaleActions.tsx | 1 + .../BuyWithCryptoModal.container.ts | 22 + .../BuyWithCryptoModal.module.css | 58 + .../BuyWithCryptoModal/BuyWithCryptoModal.tsx | 344 ++++++ .../BuyWithCryptoModal.types.ts | 13 + .../Modals/BuyWithCryptoModal/index.ts | 1 + webapp/src/components/Modals/index.ts | 1 + webapp/src/lib/abis/CollectionStore.ts | 404 +++++++ webapp/src/lib/abis/ERC20.ts | 422 ++++++++ webapp/src/lib/abis/ERC721.ts | 464 ++++++++ webapp/src/lib/abis/MarketplaceV2.ts | 742 +++++++++++++ webapp/src/lib/xchain.ts | 310 ++++++ webapp/src/lib/xchain_v2.ts | 355 +++++++ .../src/modules/translation/locales/en.json | 12 + 27 files changed, 3849 insertions(+), 376 deletions(-) create mode 100644 webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.container.tsx create mode 100644 webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.container.ts create mode 100644 webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.module.css create mode 100644 webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.tsx create mode 100644 webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.types.ts create mode 100644 webapp/src/components/Modals/BuyWithCryptoModal/index.ts create mode 100644 webapp/src/lib/abis/CollectionStore.ts create mode 100644 webapp/src/lib/abis/ERC20.ts create mode 100644 webapp/src/lib/abis/ERC721.ts create mode 100644 webapp/src/lib/abis/MarketplaceV2.ts create mode 100644 webapp/src/lib/xchain.ts create mode 100644 webapp/src/lib/xchain_v2.ts diff --git a/webapp/config-overrides.js b/webapp/config-overrides.js index 230a61c1b6..df4922801d 100644 --- a/webapp/config-overrides.js +++ b/webapp/config-overrides.js @@ -11,6 +11,9 @@ module.exports = override( ), path.resolve('node_modules/@metamask/utils/node_modules/superstruct'), path.resolve(__dirname, 'node_modules/@walletconnect'), - path.resolve(__dirname, 'node_modules/@dcl/single-sign-on-client') + path.resolve(__dirname, 'node_modules/@dcl/single-sign-on-client'), + path.resolve(__dirname, 'node_modules/@0xsquid/sdk'), + path.resolve(__dirname, 'node_modules/@cosmjs'), + path.resolve(__dirname, 'node_modules/cosmjs-types') ]) ) diff --git a/webapp/package-lock.json b/webapp/package-lock.json index dc38198c72..c9d4e3d048 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -8,6 +8,8 @@ "name": "@dcl/marketplace-site", "version": "0.0.0-development", "dependencies": { + "@0xsquid/sdk": "^1.14.0", + "@0xsquid/squid-types": "^0.1.28", "@dcl/crypto": "^3.0.0", "@dcl/schemas": "^9.6.0", "@dcl/single-sign-on-client": "^0.1.0", @@ -195,6 +197,35 @@ "@ethersproject/properties": "^5.0.7" } }, + "node_modules/@0xsquid/sdk": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@0xsquid/sdk/-/sdk-1.14.0.tgz", + "integrity": "sha512-bWK3N3H1mjXT77t73b0Ekik7GH2fciFOaH/8H/adus4d771hwv2T7gPBbDz4k751S3pfFsY4rR6mMX/xqKdXrA==", + "dependencies": { + "@cosmjs/encoding": "^0.31.0", + "@cosmjs/stargate": "^0.31.0", + "axios": "^0.27.2", + "cosmjs-types": "^0.8.0", + "ethers": "^5.7.1" + } + }, + "node_modules/@0xsquid/sdk/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/@0xsquid/squid-types": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/@0xsquid/squid-types/-/squid-types-0.1.28.tgz", + "integrity": "sha512-/6XECVtyx4SMpyFOJfKf4+YLKRJe31QriSGEi07DsdbMGAdPghsf9Rjc5rqvYCC4iR4sA7Z+HsUEJd2T8yIjzw==", + "peerDependencies": { + "typescript": ">=4.0.0" + } + }, "node_modules/@adobe/css-tools": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.1.0.tgz", @@ -2343,6 +2374,141 @@ "which-typed-array": "^1.1.2" } }, + "node_modules/@confio/ics23": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz", + "integrity": "sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==", + "dependencies": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "node_modules/@cosmjs/amino": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" + } + }, + "node_modules/@cosmjs/crypto": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.1.tgz", + "integrity": "sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==", + "dependencies": { + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers-sumo": "^0.7.11" + } + }, + "node_modules/@cosmjs/encoding": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.1.tgz", + "integrity": "sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/json-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz", + "integrity": "sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==", + "dependencies": { + "@cosmjs/stream": "^0.31.1", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/math": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.1.tgz", + "integrity": "sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/proto-signing": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz", + "integrity": "sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg==", + "dependencies": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0" + } + }, + "node_modules/@cosmjs/socket": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.1.tgz", + "integrity": "sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==", + "dependencies": { + "@cosmjs/stream": "^0.31.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.31.1.tgz", + "integrity": "sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg==", + "dependencies": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0", + "protobufjs": "~6.11.3", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stream": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.31.1.tgz", + "integrity": "sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==", + "dependencies": { + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz", + "integrity": "sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA==", + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/json-rpc": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/socket": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/utils": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==" + }, "node_modules/@csstools/convert-colors": { "version": "1.4.0", "license": "CC0-1.0", @@ -2625,9 +2791,9 @@ } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz", - "integrity": "sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", "funding": [ { "type": "individual", @@ -2639,17 +2805,19 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.3", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/web": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.6.2", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", "funding": [ { "type": "individual", @@ -2660,19 +2828,18 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "node_modules/@ethersproject/address": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", - "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", "funding": [ { "type": "individual", @@ -2684,17 +2851,17 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/rlp": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.1.tgz", - "integrity": "sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", "funding": [ { "type": "individual", @@ -2706,7 +2873,7 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1" + "@ethersproject/bytes": "^5.7.0" } }, "node_modules/@ethersproject/basex": { @@ -2729,7 +2896,9 @@ } }, "node_modules/@ethersproject/bignumber": { - "version": "5.6.2", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", "funding": [ { "type": "individual", @@ -2740,17 +2909,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "bn.js": "^5.2.1" } }, "node_modules/@ethersproject/bytes": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", - "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", "funding": [ { "type": "individual", @@ -2762,13 +2930,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.1.tgz", - "integrity": "sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", "funding": [ { "type": "individual", @@ -2780,11 +2948,13 @@ } ], "dependencies": { - "@ethersproject/bignumber": "^5.6.2" + "@ethersproject/bignumber": "^5.7.0" } }, "node_modules/@ethersproject/contracts": { - "version": "5.6.2", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", "funding": [ { "type": "individual", @@ -2795,22 +2965,23 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abi": "^5.6.3", - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/transactions": "^5.6.2" + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" } }, "node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi": { - "version": "5.6.3", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", "funding": [ { "type": "individual", @@ -2821,21 +2992,22 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/contracts/node_modules/@ethersproject/hash": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "funding": [ { "type": "individual", @@ -2846,16 +3018,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/hash": { @@ -2883,7 +3055,9 @@ } }, "node_modules/@ethersproject/hdnode": { - "version": "5.6.2", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", "funding": [ { "type": "individual", @@ -2894,24 +3068,25 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/basex": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/pbkdf2": "^5.6.1", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/wordlists": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" } }, "node_modules/@ethersproject/hdnode/node_modules/@ethersproject/basex": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", "funding": [ { "type": "individual", @@ -2922,14 +3097,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "node_modules/@ethersproject/hdnode/node_modules/@ethersproject/sha2": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "funding": [ { "type": "individual", @@ -2940,15 +3116,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/json-wallets": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", "funding": [ { "type": "individual", @@ -2959,25 +3136,26 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hdnode": "^5.6.2", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/pbkdf2": "^5.6.1", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" } }, "node_modules/@ethersproject/json-wallets/node_modules/@ethersproject/random": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", "funding": [ { "type": "individual", @@ -2988,16 +3166,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/keccak256": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.1.tgz", - "integrity": "sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", "funding": [ { "type": "individual", @@ -3009,14 +3186,14 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", + "@ethersproject/bytes": "^5.7.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", - "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", "funding": [ { "type": "individual", @@ -3029,9 +3206,9 @@ ] }, "node_modules/@ethersproject/networks": { - "version": "5.6.4", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.4.tgz", - "integrity": "sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", "funding": [ { "type": "individual", @@ -3043,11 +3220,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/pbkdf2": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", "funding": [ { "type": "individual", @@ -3058,14 +3237,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/sha2": "^5.6.1" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" } }, "node_modules/@ethersproject/pbkdf2/node_modules/@ethersproject/sha2": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "funding": [ { "type": "individual", @@ -3076,17 +3256,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/properties": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", - "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", "funding": [ { "type": "individual", @@ -3098,11 +3277,13 @@ } ], "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/providers": { - "version": "5.6.8", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", "funding": [ { "type": "individual", @@ -3113,32 +3294,33 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/base64": "^5.6.1", - "@ethersproject/basex": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/networks": "^5.6.3", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/rlp": "^5.6.1", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/strings": "^5.6.1", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/web": "^5.6.1", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", "bech32": "1.1.4", "ws": "7.4.6" } }, "node_modules/@ethersproject/providers/node_modules/@ethersproject/basex": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", "funding": [ { "type": "individual", @@ -3149,14 +3331,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "node_modules/@ethersproject/providers/node_modules/@ethersproject/hash": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "funding": [ { "type": "individual", @@ -3167,20 +3350,22 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/providers/node_modules/@ethersproject/random": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", "funding": [ { "type": "individual", @@ -3191,14 +3376,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/providers/node_modules/@ethersproject/sha2": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "funding": [ { "type": "individual", @@ -3209,10 +3395,9 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, @@ -3236,9 +3421,9 @@ } }, "node_modules/@ethersproject/rlp": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.1.tgz", - "integrity": "sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", "funding": [ { "type": "individual", @@ -3250,8 +3435,8 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/sha2": { @@ -3284,9 +3469,9 @@ } }, "node_modules/@ethersproject/signing-key": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.2.tgz", - "integrity": "sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", "funding": [ { "type": "individual", @@ -3298,16 +3483,18 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", "bn.js": "^5.2.1", "elliptic": "6.5.4", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/solidity": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", "funding": [ { "type": "individual", @@ -3318,18 +3505,19 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/sha2": "^5.6.1", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/solidity/node_modules/@ethersproject/sha2": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "funding": [ { "type": "individual", @@ -3340,17 +3528,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/strings": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.1.tgz", - "integrity": "sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", "funding": [ { "type": "individual", @@ -3362,15 +3549,15 @@ } ], "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.2.tgz", - "integrity": "sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", "funding": [ { "type": "individual", @@ -3382,19 +3569,21 @@ } ], "dependencies": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/rlp": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" } }, "node_modules/@ethersproject/units": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", "funding": [ { "type": "individual", @@ -3405,15 +3594,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/wallet": { - "version": "5.6.2", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", "funding": [ { "type": "individual", @@ -3424,27 +3614,28 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-provider": "^5.6.1", - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/hdnode": "^5.6.2", - "@ethersproject/json-wallets": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/random": "^5.6.1", - "@ethersproject/signing-key": "^5.6.2", - "@ethersproject/transactions": "^5.6.2", - "@ethersproject/wordlists": "^5.6.1" + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" } }, "node_modules/@ethersproject/wallet/node_modules/@ethersproject/hash": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "funding": [ { "type": "individual", @@ -3455,20 +3646,22 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/wallet/node_modules/@ethersproject/random": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", "funding": [ { "type": "individual", @@ -3479,16 +3672,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/@ethersproject/web": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.1.tgz", - "integrity": "sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", "funding": [ { "type": "individual", @@ -3500,15 +3692,17 @@ } ], "dependencies": { - "@ethersproject/base64": "^5.6.1", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/wordlists": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", "funding": [ { "type": "individual", @@ -3519,17 +3713,18 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@ethersproject/wordlists/node_modules/@ethersproject/hash": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "funding": [ { "type": "individual", @@ -3540,16 +3735,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/@fluentui/react-component-event-listener": { @@ -9318,6 +9513,15 @@ "node": ">=10" } }, + "node_modules/cosmjs-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", + "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, "node_modules/countup.js": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/countup.js/-/countup.js-2.3.0.tgz", @@ -13005,7 +13209,9 @@ } }, "node_modules/ethers": { - "version": "5.6.8", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", "funding": [ { "type": "individual", @@ -13016,42 +13222,43 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/abi": "5.6.3", - "@ethersproject/abstract-provider": "5.6.1", - "@ethersproject/abstract-signer": "5.6.2", - "@ethersproject/address": "5.6.1", - "@ethersproject/base64": "5.6.1", - "@ethersproject/basex": "5.6.1", - "@ethersproject/bignumber": "5.6.2", - "@ethersproject/bytes": "5.6.1", - "@ethersproject/constants": "5.6.1", - "@ethersproject/contracts": "5.6.2", - "@ethersproject/hash": "5.6.1", - "@ethersproject/hdnode": "5.6.2", - "@ethersproject/json-wallets": "5.6.1", - "@ethersproject/keccak256": "5.6.1", - "@ethersproject/logger": "5.6.0", - "@ethersproject/networks": "5.6.3", - "@ethersproject/pbkdf2": "5.6.1", - "@ethersproject/properties": "5.6.0", - "@ethersproject/providers": "5.6.8", - "@ethersproject/random": "5.6.1", - "@ethersproject/rlp": "5.6.1", - "@ethersproject/sha2": "5.6.1", - "@ethersproject/signing-key": "5.6.2", - "@ethersproject/solidity": "5.6.1", - "@ethersproject/strings": "5.6.1", - "@ethersproject/transactions": "5.6.2", - "@ethersproject/units": "5.6.1", - "@ethersproject/wallet": "5.6.2", - "@ethersproject/web": "5.6.1", - "@ethersproject/wordlists": "5.6.1" + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" } }, "node_modules/ethers/node_modules/@ethersproject/abi": { - "version": "5.6.3", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", "funding": [ { "type": "individual", @@ -13062,21 +13269,22 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/constants": "^5.6.1", - "@ethersproject/hash": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/ethers/node_modules/@ethersproject/basex": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", "funding": [ { "type": "individual", @@ -13087,38 +13295,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/properties": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" } }, "node_modules/ethers/node_modules/@ethersproject/hash": { - "version": "5.6.1", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "dependencies": { - "@ethersproject/abstract-signer": "^5.6.2", - "@ethersproject/address": "^5.6.1", - "@ethersproject/bignumber": "^5.6.2", - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/keccak256": "^5.6.1", - "@ethersproject/logger": "^5.6.0", - "@ethersproject/properties": "^5.6.0", - "@ethersproject/strings": "^5.6.1" - } - }, - "node_modules/ethers/node_modules/@ethersproject/networks": { - "version": "5.6.3", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", "funding": [ { "type": "individual", @@ -13129,13 +13314,22 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/logger": "^5.6.0" + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" } }, "node_modules/ethers/node_modules/@ethersproject/random": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", "funding": [ { "type": "individual", @@ -13146,14 +13340,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0" + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" } }, "node_modules/ethers/node_modules/@ethersproject/sha2": { - "version": "5.6.1", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", "funding": [ { "type": "individual", @@ -13164,10 +13359,9 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.6.1", - "@ethersproject/logger": "^5.6.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", "hash.js": "1.1.7" } }, @@ -13862,14 +14056,15 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.9", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -14446,6 +14641,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.1.0", "license": "MIT", @@ -17677,6 +17886,19 @@ "node": ">= 0.8.0" } }, + "node_modules/libsodium-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz", + "integrity": "sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==" + }, + "node_modules/libsodium-wrappers-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz", + "integrity": "sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==", + "dependencies": { + "libsodium-sumo": "^0.7.13" + } + }, "node_modules/lines-and-columns": { "version": "1.1.6", "license": "MIT" @@ -18621,8 +18843,9 @@ "integrity": "sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew==" }, "node_modules/nanoid": { - "version": "3.3.1", - "license": "MIT", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -22096,6 +22319,11 @@ "node": ">=8.10.0" } }, + "node_modules/readonly-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", + "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==" + }, "node_modules/real-require": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.1.0.tgz", @@ -24615,6 +24843,14 @@ "ultron": "~1.1.0" } }, + "node_modules/symbol-observable": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", + "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "license": "MIT" @@ -25502,6 +25738,19 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "optional": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "1.6.18", "license": "MIT", @@ -25593,7 +25842,6 @@ "version": "4.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -27765,6 +28013,15 @@ "version": "2.2.0", "license": "MIT" }, + "node_modules/xstream": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", + "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", + "dependencies": { + "globalthis": "^1.0.1", + "symbol-observable": "^2.0.3" + } + }, "node_modules/xtend": { "version": "4.0.2", "license": "MIT", diff --git a/webapp/package.json b/webapp/package.json index 0321fd7839..c6ebf2e428 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -2,6 +2,8 @@ "name": "@dcl/marketplace-site", "version": "0.0.0-development", "dependencies": { + "@0xsquid/sdk": "^1.14.0", + "@0xsquid/squid-types": "^0.1.28", "@dcl/crypto": "^3.0.0", "@dcl/schemas": "^9.6.0", "@dcl/single-sign-on-client": "^0.1.0", diff --git a/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.container.tsx b/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.container.tsx new file mode 100644 index 0000000000..25acc49a81 --- /dev/null +++ b/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.container.tsx @@ -0,0 +1,22 @@ +import { connect } from 'react-redux' +import { openModal } from 'decentraland-dapps/dist/modules/modal/actions' +import { + OwnProps, + MapDispatchProps, + MapDispatch +} from './BestBuyingOption.types' +import BestBuyingOption from './BestBuyingOption' + +const mapDispatch = ( + dispatch: MapDispatch, + ownProps: OwnProps +): MapDispatchProps => ({ + onBuyWithCrypto: () => + dispatch( + openModal('BuyWithCryptoModal', { + asset: ownProps.asset + }) + ) +}) + +export default connect(null, mapDispatch)(BestBuyingOption) diff --git a/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.tsx b/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.tsx index 2f96972981..92b78a7c46 100644 --- a/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.tsx +++ b/webapp/src/components/AssetPage/BestBuyingOption/BestBuyingOption.tsx @@ -31,7 +31,7 @@ import { ItemSaleActions } from '../SaleActionBox/ItemSaleActions' import { BuyOptions, Props } from './BestBuyingOption.types' import styles from './BestBuyingOption.module.css' -const BestBuyingOption = ({ asset, tableRef }: Props) => { +const BestBuyingOption = ({ asset, tableRef, onBuyWithCrypto }: Props) => { const [buyOption, setBuyOption] = useState(null) const [isLoading, setIsLoading] = useState(false) const [listing, setListing] = useState<{ @@ -277,6 +277,7 @@ const BestBuyingOption = ({ asset, tableRef }: Props) => { network={asset.network} tokenId={listing.order.tokenId} buyWithCardClassName={styles.buyWithCardClassName} + onBuyWithCrypto={onBuyWithCrypto} /> + + + + ) +} + +export default React.memo(BuyWithCryptoModal) diff --git a/webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.types.ts b/webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.types.ts new file mode 100644 index 0000000000..2f0d583c38 --- /dev/null +++ b/webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.types.ts @@ -0,0 +1,13 @@ +import { ModalProps } from 'decentraland-dapps/dist/providers/ModalProvider/ModalProvider.types' +import { Wallet } from 'decentraland-dapps/dist/modules/wallet/types' +import { Asset } from '../../../modules/asset/types' + +export type Props = Omit & { + metadata: { asset: Asset } + wallet: Wallet | null + onConfirm: () => void +} + +export type OwnProps = Pick +export type MapStateProps = Pick +export type MapDispatchProps = Pick diff --git a/webapp/src/components/Modals/BuyWithCryptoModal/index.ts b/webapp/src/components/Modals/BuyWithCryptoModal/index.ts new file mode 100644 index 0000000000..0ee16a9392 --- /dev/null +++ b/webapp/src/components/Modals/BuyWithCryptoModal/index.ts @@ -0,0 +1 @@ +export { default as BuyWithCryptoModal } from './BuyWithCryptoModal.container' diff --git a/webapp/src/components/Modals/index.ts b/webapp/src/components/Modals/index.ts index b244a6dd3d..4722c4b2e4 100644 --- a/webapp/src/components/Modals/index.ts +++ b/webapp/src/components/Modals/index.ts @@ -17,3 +17,4 @@ export { SaveToListModal } from './SaveToListModal' export { ShareListModal } from './ShareListModal' export { SmartWearableVideoShowcaseModal } from './SmartWearableVideoShowcaseModal' export { ExpiredListingsModal } from './ExpiredListingsModal' +export { BuyWithCryptoModal } from './BuyWithCryptoModal' diff --git a/webapp/src/lib/abis/CollectionStore.ts b/webapp/src/lib/abis/CollectionStore.ts new file mode 100644 index 0000000000..b38a92d3c0 --- /dev/null +++ b/webapp/src/lib/abis/CollectionStore.ts @@ -0,0 +1,404 @@ +export const CollectionStore = [ + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address' + }, + { + internalType: 'contract IERC20', + name: '_acceptedToken', + type: 'address' + }, + { + internalType: 'address', + name: '_feeOwner', + type: 'address' + }, + { + internalType: 'uint256', + name: '_fee', + type: 'uint256' + } + ], + stateMutability: 'nonpayable', + type: 'constructor' + }, + { + anonymous: false, + inputs: [ + { + components: [ + { + internalType: 'contract IERC721CollectionV2', + name: 'collection', + type: 'address' + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]' + }, + { + internalType: 'uint256[]', + name: 'prices', + type: 'uint256[]' + }, + { + internalType: 'address[]', + name: 'beneficiaries', + type: 'address[]' + } + ], + indexed: false, + internalType: 'struct CollectionStore.ItemToBuy[]', + name: '_itemsToBuy', + type: 'tuple[]' + } + ], + name: 'Bought', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'userAddress', + type: 'address' + }, + { + indexed: false, + internalType: 'address', + name: 'relayerAddress', + type: 'address' + }, + { + indexed: false, + internalType: 'bytes', + name: 'functionSignature', + type: 'bytes' + } + ], + name: 'MetaTransactionExecuted', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address' + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'OwnershipTransferred', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: '_oldFee', + type: 'uint256' + }, + { + indexed: false, + internalType: 'uint256', + name: '_newFee', + type: 'uint256' + } + ], + name: 'SetFee', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: '_oldFeeOwner', + type: 'address' + }, + { + indexed: true, + internalType: 'address', + name: '_newFeeOwner', + type: 'address' + } + ], + name: 'SetFeeOwner', + type: 'event' + }, + { + inputs: [], + name: 'BASE_FEE', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'acceptedToken', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + components: [ + { + internalType: 'contract IERC721CollectionV2', + name: 'collection', + type: 'address' + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]' + }, + { + internalType: 'uint256[]', + name: 'prices', + type: 'uint256[]' + }, + { + internalType: 'address[]', + name: 'beneficiaries', + type: 'address[]' + } + ], + internalType: 'struct CollectionStore.ItemToBuy[]', + name: '_itemsToBuy', + type: 'tuple[]' + } + ], + name: 'buy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [], + name: 'domainSeparator', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'userAddress', + type: 'address' + }, + { + internalType: 'bytes', + name: 'functionSignature', + type: 'bytes' + }, + { + internalType: 'bytes32', + name: 'sigR', + type: 'bytes32' + }, + { + internalType: 'bytes32', + name: 'sigS', + type: 'bytes32' + }, + { + internalType: 'uint8', + name: 'sigV', + type: 'uint8' + } + ], + name: 'executeMetaTransaction', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes' + } + ], + stateMutability: 'payable', + type: 'function' + }, + { + inputs: [], + name: 'fee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'feeOwner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'getChainId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'pure', + type: 'function' + }, + { + inputs: [ + { + internalType: 'contract IERC721CollectionV2', + name: '_collection', + type: 'address' + }, + { + internalType: 'uint256', + name: '_itemId', + type: 'uint256' + } + ], + name: 'getItemBuyData', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + }, + { + internalType: 'address', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address' + } + ], + name: 'getNonce', + outputs: [ + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_newFee', + type: 'uint256' + } + ], + name: 'setFee', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: '_newFeeOwner', + type: 'address' + } + ], + name: 'setFeeOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + } +] diff --git a/webapp/src/lib/abis/ERC20.ts b/webapp/src/lib/abis/ERC20.ts new file mode 100644 index 0000000000..bde08982bb --- /dev/null +++ b/webapp/src/lib/abis/ERC20.ts @@ -0,0 +1,422 @@ +export const ERC20 = [ + { + constant: true, + inputs: [], + name: 'mintingFinished', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + name: '', + type: 'string' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_spender', + type: 'address' + }, + { + name: '_value', + type: 'uint256' + } + ], + name: 'approve', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + name: '', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_from', + type: 'address' + }, + { + name: '_to', + type: 'address' + }, + { + name: '_value', + type: 'uint256' + } + ], + name: 'transferFrom', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [ + { + name: '', + type: 'uint8' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [], + name: 'unpause', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address' + }, + { + name: '_amount', + type: 'uint256' + } + ], + name: 'mint', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_value', + type: 'uint256' + } + ], + name: 'burn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'paused', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address' + } + ], + name: 'balanceOf', + outputs: [ + { + name: 'balance', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [], + name: 'finishMinting', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: false, + inputs: [], + name: 'pause', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + name: '', + type: 'address' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + name: '', + type: 'string' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address' + }, + { + name: '_value', + type: 'uint256' + } + ], + name: 'transfer', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address' + }, + { + name: '_spender', + type: 'address' + } + ], + name: 'allowance', + outputs: [ + { + name: 'remaining', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: 'to', + type: 'address' + }, + { + name: 'amount', + type: 'uint256' + } + ], + name: 'setBalance', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: 'newOwner', + type: 'address' + } + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: 'to', + type: 'address' + }, + { + indexed: false, + name: 'amount', + type: 'uint256' + } + ], + name: 'Mint', + type: 'event' + }, + { + anonymous: false, + inputs: [], + name: 'MintFinished', + type: 'event' + }, + { + anonymous: false, + inputs: [], + name: 'Pause', + type: 'event' + }, + { + anonymous: false, + inputs: [], + name: 'Unpause', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: 'burner', + type: 'address' + }, + { + indexed: false, + name: 'value', + type: 'uint256' + } + ], + name: 'Burn', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: 'owner', + type: 'address' + }, + { + indexed: true, + name: 'spender', + type: 'address' + }, + { + indexed: false, + name: 'value', + type: 'uint256' + } + ], + name: 'Approval', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: 'from', + type: 'address' + }, + { + indexed: true, + name: 'to', + type: 'address' + }, + { + indexed: false, + name: 'value', + type: 'uint256' + } + ], + name: 'Transfer', + type: 'event' + } +] diff --git a/webapp/src/lib/abis/ERC721.ts b/webapp/src/lib/abis/ERC721.ts new file mode 100644 index 0000000000..08a30884fc --- /dev/null +++ b/webapp/src/lib/abis/ERC721.ts @@ -0,0 +1,464 @@ +export const ERC721 = [ + { + constant: true, + inputs: [ + { + name: '_interfaceId', + type: 'bytes4' + } + ], + name: 'supportsInterface', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + name: '', + type: 'string' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'getApproved', + outputs: [ + { + name: '', + type: 'address' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address' + }, + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'approve', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + name: '', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'InterfaceId_ERC165', + outputs: [ + { + name: '', + type: 'bytes4' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_from', + type: 'address' + }, + { + name: '_to', + type: 'address' + }, + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'transferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address' + }, + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'transfer', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address' + }, + { + name: '_index', + type: 'uint256' + } + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + name: '', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_from', + type: 'address' + }, + { + name: '_to', + type: 'address' + }, + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'exists', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_index', + type: 'uint256' + } + ], + name: 'tokenByIndex', + outputs: [ + { + name: '', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'ownerOf', + outputs: [ + { + name: '', + type: 'address' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address' + } + ], + name: 'balanceOf', + outputs: [ + { + name: '', + type: 'uint256' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + name: '', + type: 'string' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address' + }, + { + name: '_approved', + type: 'bool' + } + ], + name: 'setApprovalForAll', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: false, + inputs: [ + { + name: '_from', + type: 'address' + }, + { + name: '_to', + type: 'address' + }, + { + name: '_tokenId', + type: 'uint256' + }, + { + name: '_data', + type: 'bytes' + } + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_tokenId', + type: 'uint256' + } + ], + name: 'tokenURI', + outputs: [ + { + name: '', + type: 'string' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + constant: true, + inputs: [ + { + name: '_owner', + type: 'address' + }, + { + name: '_operator', + type: 'address' + } + ], + name: 'isApprovedForAll', + outputs: [ + { + name: '', + type: 'bool' + } + ], + payable: false, + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + name: '_name', + type: 'string' + }, + { + name: '_symbol', + type: 'string' + } + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: '_from', + type: 'address' + }, + { + indexed: true, + name: '_to', + type: 'address' + }, + { + indexed: true, + name: '_tokenId', + type: 'uint256' + } + ], + name: 'Transfer', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: '_owner', + type: 'address' + }, + { + indexed: true, + name: '_approved', + type: 'address' + }, + { + indexed: true, + name: '_tokenId', + type: 'uint256' + } + ], + name: 'Approval', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: '_owner', + type: 'address' + }, + { + indexed: true, + name: '_operator', + type: 'address' + }, + { + indexed: false, + name: '_approved', + type: 'bool' + } + ], + name: 'ApprovalForAll', + type: 'event' + }, + { + constant: false, + inputs: [ + { + name: '_to', + type: 'address' + }, + { + name: '_tokenId', + type: 'uint256' + }, + { + name: '_tokenURI', + type: 'string' + } + ], + name: 'mintUniqueTokenTo', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function' + } +] diff --git a/webapp/src/lib/abis/MarketplaceV2.ts b/webapp/src/lib/abis/MarketplaceV2.ts new file mode 100644 index 0000000000..65534776ea --- /dev/null +++ b/webapp/src/lib/abis/MarketplaceV2.ts @@ -0,0 +1,742 @@ +export const MarketplaceV2 = [ + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address' + }, + { + internalType: 'address', + name: '_feesCollector', + type: 'address' + }, + { + internalType: 'address', + name: '_acceptedToken', + type: 'address' + }, + { + internalType: 'contract IRoyaltiesManager', + name: '_royaltiesManager', + type: 'address' + }, + { + internalType: 'uint256', + name: '_feesCollectorCutPerMillion', + type: 'uint256' + }, + { + internalType: 'uint256', + name: '_royaltiesCutPerMillion', + type: 'uint256' + } + ], + stateMutability: 'nonpayable', + type: 'constructor' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'feesCollectorCutPerMillion', + type: 'uint256' + } + ], + name: 'ChangedFeesCollectorCutPerMillion', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'publicationFee', + type: 'uint256' + } + ], + name: 'ChangedPublicationFee', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'royaltiesCutPerMillion', + type: 'uint256' + } + ], + name: 'ChangedRoyaltiesCutPerMillion', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'oldFeesCollector', + type: 'address' + }, + { + indexed: true, + internalType: 'address', + name: 'newFeesCollector', + type: 'address' + } + ], + name: 'FeesCollectorSet', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'userAddress', + type: 'address' + }, + { + indexed: false, + internalType: 'address', + name: 'relayerAddress', + type: 'address' + }, + { + indexed: false, + internalType: 'bytes', + name: 'functionSignature', + type: 'bytes' + } + ], + name: 'MetaTransactionExecuted', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bytes32', + name: 'id', + type: 'bytes32' + }, + { + indexed: true, + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + }, + { + indexed: true, + internalType: 'address', + name: 'seller', + type: 'address' + }, + { + indexed: false, + internalType: 'address', + name: 'nftAddress', + type: 'address' + } + ], + name: 'OrderCancelled', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bytes32', + name: 'id', + type: 'bytes32' + }, + { + indexed: true, + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + }, + { + indexed: true, + internalType: 'address', + name: 'seller', + type: 'address' + }, + { + indexed: false, + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + indexed: false, + internalType: 'uint256', + name: 'priceInWei', + type: 'uint256' + }, + { + indexed: false, + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256' + } + ], + name: 'OrderCreated', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bytes32', + name: 'id', + type: 'bytes32' + }, + { + indexed: true, + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + }, + { + indexed: true, + internalType: 'address', + name: 'seller', + type: 'address' + }, + { + indexed: false, + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalPrice', + type: 'uint256' + }, + { + indexed: true, + internalType: 'address', + name: 'buyer', + type: 'address' + } + ], + name: 'OrderSuccessful', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address' + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'OwnershipTransferred', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address' + } + ], + name: 'Paused', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract IRoyaltiesManager', + name: 'oldRoyaltiesManager', + type: 'address' + }, + { + indexed: true, + internalType: 'contract IRoyaltiesManager', + name: 'newRoyaltiesManager', + type: 'address' + } + ], + name: 'RoyaltiesManagerSet', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address' + } + ], + name: 'Unpaused', + type: 'event' + }, + { + inputs: [], + name: 'ERC721_Interface', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'InterfaceId_ValidateFingerprint', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'acceptedToken', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + } + ], + name: 'cancelOrder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + }, + { + internalType: 'uint256', + name: 'priceInWei', + type: 'uint256' + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256' + } + ], + name: 'createOrder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [], + name: 'domainSeparator', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'userAddress', + type: 'address' + }, + { + internalType: 'bytes', + name: 'functionSignature', + type: 'bytes' + }, + { + internalType: 'bytes32', + name: 'sigR', + type: 'bytes32' + }, + { + internalType: 'bytes32', + name: 'sigS', + type: 'bytes32' + }, + { + internalType: 'uint8', + name: 'sigV', + type: 'uint8' + } + ], + name: 'executeMetaTransaction', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes' + } + ], + stateMutability: 'payable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256' + } + ], + name: 'executeOrder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [], + name: 'feesCollector', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'feesCollectorCutPerMillion', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'getChainId', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'user', + type: 'address' + } + ], + name: 'getNonce', + outputs: [ + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address' + }, + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + name: 'orderByAssetId', + outputs: [ + { + internalType: 'bytes32', + name: 'id', + type: 'bytes32' + }, + { + internalType: 'address', + name: 'seller', + type: 'address' + }, + { + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256' + }, + { + internalType: 'uint256', + name: 'expiresAt', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'publicationFeeInWei', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [], + name: 'royaltiesCutPerMillion', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'royaltiesManager', + outputs: [ + { + internalType: 'contract IRoyaltiesManager', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'nftAddress', + type: 'address' + }, + { + internalType: 'uint256', + name: 'assetId', + type: 'uint256' + }, + { + internalType: 'uint256', + name: 'price', + type: 'uint256' + }, + { + internalType: 'bytes', + name: 'fingerprint', + type: 'bytes' + } + ], + name: 'safeExecuteOrder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: '_newFeesCollector', + type: 'address' + } + ], + name: 'setFeesCollector', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_feesCollectorCutPerMillion', + type: 'uint256' + } + ], + name: 'setFeesCollectorCutPerMillion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_publicationFee', + type: 'uint256' + } + ], + name: 'setPublicationFee', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_royaltiesCutPerMillion', + type: 'uint256' + } + ], + name: 'setRoyaltiesCutPerMillion', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'contract IRoyaltiesManager', + name: '_newRoyaltiesManager', + type: 'address' + } + ], + name: 'setRoyaltiesManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' + } +] diff --git a/webapp/src/lib/xchain.ts b/webapp/src/lib/xchain.ts new file mode 100644 index 0000000000..ac71605102 --- /dev/null +++ b/webapp/src/lib/xchain.ts @@ -0,0 +1,310 @@ +import { ethers } from 'ethers' +import { Squid } from '@0xsquid/sdk' +import { RouteResponse, SquidCallType } from '@0xsquid/sdk/dist/types' +import { ChainId } from '@dcl/schemas' +import { ContractName, getContract } from 'decentraland-transactions' +import { Provider } from 'decentraland-dapps/dist/modules/wallet/types' +import { ERC20 } from './abis/ERC20' +import { MarketplaceV2 } from './abis/MarketplaceV2' +import { ERC721 } from './abis/ERC721' +import { CollectionStore } from './abis/CollectionStore' + +export type BuyNFTXChainData = { + fromAddress: string + fromAmount: string + toAmount: string + fromToken: string + fromChain: ChainId + toChain: ChainId // TODO: Do we need ETH? + enableExpress?: boolean + slippage?: number + nft: { + collectionAddress: string + tokenId: string + price: string + } + // toToken: string // it will be MANA + // toChain: ChainId.MATIC_MAINNET | ChainId.MATIC_MUMBAI // TODO: Do we need ETH? + // toAddress: string +} + +export type MintNFTXChainData = Omit & { + item: { + collectionAddress: string + itemId: string + price: string + } +} + +export interface XChainProvider { + buyNFT( + provider: Provider, + buyNFTXChainData: BuyNFTXChainData + ): Promise + mintNFT(provider: Provider, ChainCallData: MintNFTXChainData): Promise +} + +export class AxelarProvider implements XChainProvider { + private squid: Squid + private squidMulticall = '0x4fd39C9E151e50580779bd04B1f7eCc310079fd3' // Squid calling contract + + constructor() { + this.squid = new Squid({ + baseUrl: 'https://api.squidrouter.com', + integratorId: 'decentraland-sdk' + }) + } + + private async init() { + if (!this.squid.initialized) { + await this.squid.init() + } + } + + private async executeRoute( + route: RouteResponse, + provider: Provider + ): Promise { + const { route: data } = route + const signer = await new ethers.providers.Web3Provider(provider).getSigner() + + // tslint:disable-next-line + // @ts-ignore + const txResponse = (await this.squid.executeRoute({ + route: data, + signer + })) as ethers.providers.TransactionResponse + return txResponse.wait() + } + + async buyNFT( + provider: Provider, + buyNFTXChainData: BuyNFTXChainData + ): Promise { + const route = await this.getBuyNFTRoute(buyNFTXChainData) + const tx = await this.executeRoute(route, provider) + return tx.transactionHash + } + + async getBuyNFTRoute( + buyNFTXChainData: BuyNFTXChainData + ): Promise { + await this.init() + const { + fromAddress, + fromAmount, + fromChain, + fromToken, + toChain, + toAmount, // the item price + enableExpress = true, // TODO: check if we need this + slippage = 1, // TODO: check if we need this + nft: { collectionAddress, price, tokenId } + } = buyNFTXChainData + + const ERC20ContractInterface = new ethers.utils.Interface(ERC20) + const marketplaceInterface = new ethers.utils.Interface(MarketplaceV2) + const ERC721ContractInterface = new ethers.utils.Interface(ERC721) + + const destinyChainMANA = getContract(ContractName.MANAToken, toChain) + .address + const destinyChainMarketplaceV2 = getContract( + ContractName.MarketplaceV2, + toChain + ).address + + return this.squid.getRoute({ + fromAddress, + fromAmount, + fromToken, + fromChain: fromChain.toString(), + toToken: destinyChainMANA, + toChain: toChain.toString(), + toAddress: destinyChainMarketplaceV2, + enableExpress, + slippage, + customContractCalls: [ + // =================================== + // Approve MANA to be spent by Decentraland contract + // =================================== + { + callType: SquidCallType.FULL_TOKEN_BALANCE, + target: destinyChainMANA, + value: '0', + callData: ERC20ContractInterface.encodeFunctionData('approve', [ + getContract(ContractName.MarketplaceV2, toChain).address, + toAmount + ]), + payload: { + tokenAddress: destinyChainMarketplaceV2, + inputPos: 1 + }, + estimatedGas: '50000' + }, + // =================================== + // EXECUTE ORDER + // =================================== + { + callType: SquidCallType.DEFAULT, + target: destinyChainMANA, + value: '0', + callData: marketplaceInterface.encodeFunctionData('executeOrder', [ + collectionAddress, + tokenId, + price + ]), + + payload: { + tokenAddress: '0x', // TODO: what's this? + inputPos: 0 + }, + estimatedGas: '300000' + }, + // =================================== + // Transfer NFT to buyer + // =================================== + { + callType: SquidCallType.DEFAULT, + target: collectionAddress, + value: '0', + callData: ERC721ContractInterface.encodeFunctionData( + 'safeTransferFrom(address, address, uint256)', + [this.squidMulticall, fromAddress, tokenId] + ), + payload: { + tokenAddress: '0x', + inputPos: 1 + }, + estimatedGas: '50000' + }, + // =================================== + // Transfer remaining MANA to buyer + // =================================== + { + callType: SquidCallType.FULL_TOKEN_BALANCE, + target: destinyChainMANA, + value: '0', + callData: ERC20ContractInterface.encodeFunctionData('transfer', [ + fromAddress, + '0' + ]), + payload: { + tokenAddress: destinyChainMANA, + // This will replace the parameter at index 1 in the encoded Function, + // with FULL_TOKEN_BALANCE (instead of "0") + inputPos: 1 + }, + estimatedGas: '50000' + } + ] + }) + } + + // MINT + async mintNFT( + provider: Provider, + mintNFTXChainData: MintNFTXChainData + ): Promise { + const route = await this.getMintNFTRoute(mintNFTXChainData) + const tx = await this.executeRoute(route, provider) + return tx.transactionHash + } + + async getMintNFTRoute( + buyNFTXChainData: MintNFTXChainData + ): Promise { + await this.init() + const { + fromAddress, + fromAmount, + fromChain, + fromToken, + toChain, + toAmount, // the item price + enableExpress = true, + slippage = 1, + item: { collectionAddress, price, itemId } + } = buyNFTXChainData + + const ERC20ContractInterface = new ethers.utils.Interface(ERC20) + const collectionStoreInterface = new ethers.utils.Interface(CollectionStore) + + const destinyChainMANA = getContract(ContractName.MANAToken, toChain) + .address + const destinyChaiCollectionStoreAddress = getContract( + ContractName.CollectionStore, + toChain + ).address + + const args = [collectionAddress, [itemId], [price], [fromAddress]] + console.log('args: ', args) + + return this.squid.getRoute({ + fromAddress, + fromAmount, + fromToken, + fromChain: fromChain.toString(), + toToken: destinyChainMANA, + toChain: toChain.toString(), + toAddress: destinyChaiCollectionStoreAddress, + enableExpress, // TODO: check if we need this + slippage, + customContractCalls: [ + // =================================== + // Approve MANA to be spent by Decentraland contract + // =================================== + { + callType: SquidCallType.FULL_TOKEN_BALANCE, + target: destinyChainMANA, + value: '0', + callData: ERC20ContractInterface.encodeFunctionData('approve', [ + getContract(ContractName.CollectionStore, toChain).address, + toAmount + ]), + payload: { + tokenAddress: destinyChaiCollectionStoreAddress, + inputPos: 1 + }, + estimatedGas: '50000' + }, + // =================================== + // BUY ITEM + // =================================== + { + callType: SquidCallType.DEFAULT, + target: destinyChainMANA, + value: '0', // @TODO: WHY 0? + callData: collectionStoreInterface.encodeFunctionData( + 'buy((address,uint256[],uint256[],address[])[])', + [[[collectionAddress, [itemId], [price], [fromAddress]]]] + ), + + payload: { + tokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // TODO: do we need this to be set as the native? it's working like this + inputPos: 0 + }, + estimatedGas: '300000' // TODO: where do we get this value from? + }, + // =================================== + // Transfer remaining MANA to buyer + // =================================== + { + callType: SquidCallType.FULL_TOKEN_BALANCE, + target: destinyChainMANA, + value: '0', + callData: ERC20ContractInterface.encodeFunctionData('transfer', [ + fromAddress, + '0' + ]), + payload: { + tokenAddress: destinyChainMANA, + // This will replace the parameter at index 1 in the encoded Function, + // with FULL_TOKEN_BALANCE (instead of "0") + inputPos: 1 + }, + estimatedGas: '50000' + } + ] + }) + } +} diff --git a/webapp/src/lib/xchain_v2.ts b/webapp/src/lib/xchain_v2.ts new file mode 100644 index 0000000000..74599f5622 --- /dev/null +++ b/webapp/src/lib/xchain_v2.ts @@ -0,0 +1,355 @@ +// // import { Provider } from 'decentraland-transactions' +// import { ethers } from 'ethers' +// import { Squid } from '@0xsquid/sdk' +// import { +// RouteResponse, +// SquidCallType, +// // SlippageMode, +// ChainType +// } from '@0xsquid/sdk/dist/types' +// import { ChainId } from '@dcl/schemas' +// import { ContractName, getContract } from 'decentraland-transactions' +// import { Provider } from 'decentraland-dapps/dist/modules/wallet/types' +// import { ERC20 } from './abis/ERC20' +// import { MarketplaceV2 } from './abis/MarketplaceV2' +// import { ERC721 } from './abis/ERC721' +// import { CollectionStore } from './abis/CollectionStore' + +// export type BuyNFTXChainData = { +// fromAddress: string +// fromAmount: string +// toAmount: string +// fromToken: string +// fromChain: ChainId +// toChain: ChainId // TODO: Do we need ETH? +// enableExpress?: boolean +// slippage?: number +// nft: { +// collectionAddress: string +// tokenId: string +// price: string +// } +// // toToken: string // it will be MANA +// // toChain: ChainId.MATIC_MAINNET | ChainId.MATIC_MUMBAI // TODO: Do we need ETH? +// // toAddress: string +// } + +// export type MintNFTXChainData = Omit & { +// item: { +// collectionAddress: string +// itemId: string +// price: string +// } +// } + +// export interface XChainProvider { +// buyNFT( +// provider: Provider, +// buyNFTXChainData: BuyNFTXChainData +// ): Promise +// mintNFT(provider: Provider, ChainCallData: MintNFTXChainData): Promise +// } + +// export class AxelarProvider implements XChainProvider { +// private squid: Squid +// private initiated = false +// private squidMulticall = '0x4fd39C9E151e50580779bd04B1f7eCc310079fd3' // Squid calling contract + +// constructor() { +// // Initialize Squid SDK in the constructor +// this.squid = new Squid({ +// baseUrl: 'https://testnet.v2.api.squidrouter.com', +// // baseUrl: 'https://api.squidrouter.com', +// integratorId: 'decentraland-sdk' +// }) +// } + +// private async init() { +// if (!this.initiated) { +// await this.squid.init() +// this.initiated = true +// } +// } + +// private async executeRoute( +// route: RouteResponse, +// provider: Provider +// ): Promise { +// const { route: data } = route +// const signer = await new ethers.providers.Web3Provider(provider).getSigner() + +// // tslint:disable-next-line +// // @ts-ignore +// const txResponse = (await this.squid.executeRoute({ +// route: data, +// signer +// })) as ethers.providers.TransactionResponse +// return txResponse.wait() +// } + +// async buyNFT( +// provider: Provider, +// buyNFTXChainData: BuyNFTXChainData +// ): Promise { +// // const signer = await new ethers.providers.Web3Provider(provider).getSigner() +// const route = await this.getBuyNFTRoute(buyNFTXChainData) +// console.log('route: ', route) +// return '' +// // const tx = await this.executeRoute(route, provider) +// // console.log('tx: ', tx) +// // return tx.transactionHash +// } + +// async getBuyNFTRoute( +// buyNFTXChainData: BuyNFTXChainData +// ): Promise { +// await this.init() +// const { +// fromAddress, +// fromAmount, +// fromChain, +// fromToken, +// // toAddress, +// toChain, +// toAmount, // the item price +// // toToken, +// enableExpress = true, +// slippage = 1, +// nft: { collectionAddress, price, tokenId } +// } = buyNFTXChainData + +// const ERC20ContractInterface = new ethers.utils.Interface(ERC20) +// const marketplaceInterface = new ethers.utils.Interface(MarketplaceV2) +// const ERC721ContractInterface = new ethers.utils.Interface(ERC721) + +// const destinyChainMANA = getContract(ContractName.MANAToken, toChain) +// .address +// const destinyChainMarketplaceV2 = getContract( +// ContractName.MarketplaceV2, +// toChain +// ).address + +// return this.squid.getRoute({ +// fromAddress, +// fromAmount, +// fromToken, +// fromChain: fromChain.toString(), +// toToken: destinyChainMANA, +// toChain: toChain.toString(), +// toAddress: destinyChainMarketplaceV2, +// slippageConfig: { +// autoMode: SlippageMode.NORMAL +// }, +// postHook: { +// chainType: ChainType.EVM, +// fundAmount: '', +// fundToken: '', +// calls: [ +// // =================================== +// // Approve MANA to be spent by Decentraland contract +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.FULL_TOKEN_BALANCE, +// target: destinyChainMANA, +// value: '0', +// callData: ERC20ContractInterface.encodeFunctionData('approve', [ +// getContract(ContractName.MarketplaceV2, toChain).address, +// toAmount +// ]), +// payload: { +// tokenAddress: destinyChainMarketplaceV2, +// inputPos: 1 +// }, +// estimatedGas: '50000' +// }, +// // =================================== +// // EXECUTE ORDER +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.DEFAULT, +// target: destinyChainMANA, +// value: '0', +// callData: marketplaceInterface.encodeFunctionData('executeOrder', [ +// collectionAddress, +// tokenId, +// price +// ]), + +// payload: { +// tokenAddress: '0x', // TODO: what's this? +// inputPos: 0 +// }, +// estimatedGas: '300000' +// }, +// // =================================== +// // Transfer NFT to buyer +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.DEFAULT, +// target: collectionAddress, +// value: '0', +// callData: ERC721ContractInterface.encodeFunctionData( +// 'safeTransferFrom(address, address, uint256)', +// [this.squidMulticall, fromAddress, tokenId] +// ), +// payload: { +// tokenAddress: '0x', +// inputPos: 1 +// }, +// estimatedGas: '50000' +// }, +// // =================================== +// // Transfer remaining MANA to buyer +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.FULL_TOKEN_BALANCE, +// target: destinyChainMANA, +// value: '0', +// callData: ERC20ContractInterface.encodeFunctionData('transfer', [ +// fromAddress, +// '0' +// ]), +// payload: { +// tokenAddress: destinyChainMANA, +// // This will replace the parameter at index 1 in the encoded Function, +// // with FULL_TOKEN_BALANCE (instead of "0") +// inputPos: 1 +// }, +// estimatedGas: '50000' +// } +// ] +// } +// }) +// } + +// // MINT + +// async mintNFT( +// provider: Provider, +// mintNFTXChainData: MintNFTXChainData +// ): Promise { +// // const signer = await new ethers.providers.Web3Provider(provider).getSigner() +// const route = await this.getMintNFTRoute(mintNFTXChainData) +// const tx = await this.executeRoute(route, provider) +// console.log('tx: ', tx) +// return tx.transactionHash +// } + +// async getMintNFTRoute( +// buyNFTXChainData: MintNFTXChainData +// ): Promise { +// await this.init() +// const { +// fromAddress, +// fromAmount, +// fromChain, +// fromToken, +// // toAddress, +// toChain, +// toAmount, // the item price +// // toToken, +// enableExpress = true, +// slippage = 1, +// item: { collectionAddress, price, itemId } +// } = buyNFTXChainData + +// const ERC20ContractInterface = new ethers.utils.Interface(ERC20) +// const collectionStoreInterface = new ethers.utils.Interface(CollectionStore) + +// const destinyChainMANA = getContract(ContractName.MANAToken, toChain) +// .address +// const destinyChaiCollectionStoreAddress = getContract( +// ContractName.CollectionStore, +// toChain +// ).address + +// const args = [collectionAddress, [itemId], [price], [fromAddress]] +// console.log('args: ', args) + +// return this.squid.getRoute({ +// fromAddress, +// fromAmount, +// fromToken, +// fromChain: fromChain.toString(), +// toToken: destinyChainMANA, +// toChain: toChain.toString(), +// toAddress: destinyChaiCollectionStoreAddress, +// slippageConfig: { +// autoMode: SlippageMode.NORMAL +// }, +// postHook: { +// chainType: ChainType.EVM, +// fundAmount: '', +// fundToken: '', +// calls: [ +// // =================================== +// // Approve MANA to be spent by Decentraland contract +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.FULL_TOKEN_BALANCE, +// target: destinyChainMANA, +// value: '0', +// callData: ERC20ContractInterface.encodeFunctionData('approve', [ +// // config.decentralandBuyAddress, +// getContract(ContractName.CollectionStore, toChain).address, +// toAmount +// // config.item.price +// ]), +// payload: { +// tokenAddress: destinyChaiCollectionStoreAddress, +// inputPos: 1 +// }, +// estimatedGas: '50000' +// }, +// // =================================== +// // BUY ITEM +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.DEFAULT, +// target: destinyChainMANA, +// value: '0', // @TODO: WHY 0? +// callData: collectionStoreInterface.encodeFunctionData( +// 'buy((address,uint256[],uint256[],address[])[])', +// [[[collectionAddress, [itemId], [price], [fromAddress]]]] +// ), + +// payload: { +// tokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // TODO: what's this? +// inputPos: 0 +// }, +// estimatedGas: '300000' +// }, +// // =================================== +// // Transfer remaining MANA to buyer +// // =================================== +// { +// chainType: ChainType.EVM, +// callType: SquidCallType.FULL_TOKEN_BALANCE, +// target: destinyChainMANA, +// value: '0', +// callData: ERC20ContractInterface.encodeFunctionData('transfer', [ +// fromAddress, +// '0' +// ]), +// payload: { +// tokenAddress: destinyChainMANA, + +// // This will replace the parameter at index 1 in the encoded Function, +// // with FULL_TOKEN_BALANCE (instead of "0") +// inputPos: 1 +// }, +// estimatedGas: '50000' +// } +// ] +// } +// }) +// } +// } + +export default {} \ No newline at end of file diff --git a/webapp/src/modules/translation/locales/en.json b/webapp/src/modules/translation/locales/en.json index f7ab047827..0894875bca 100644 --- a/webapp/src/modules/translation/locales/en.json +++ b/webapp/src/modules/translation/locales/en.json @@ -523,6 +523,7 @@ "update_listing": "Update listing", "buy": "Buy", "buy_with_mana": "Buy with MANA", + "buy_with_crypto": "Buy with Crypto", "get_mana": "Get MANA", "buy_with_card": "Buy with card", "mint": "Mint", @@ -821,6 +822,17 @@ "regions_where_operates": "regions where Transak operates", "explanation": "Card payments are processed by {link_to_transak} and are available for the {regions}. Both credit and debit cards are supported." }, + "buy_with_crypto": { + "title": "Buying {name}", + "subtitle": "You are about to buy {name} for {amount}.", + "balance": "Balance", + "buy_with_token": "Buy with {token}", + "select_a_token": "Select a token to buy", + "summary": "Summary", + "exchange_rate": "Exchange Rate: 1 {symbol} = {manaAmount} MANA", + "fetching_route": "Calculating route...", + "insufficient_funds": "You don't have enough {token} balance..." + }, "partially_supported_network_card": { "content": "You are connected to the Polygon Network for purchasing items below 1. You will need to have MATIC in your wallet to cover the transaction fee for this purchase." },