diff --git a/.gitignore b/.gitignore index 3a65fede4..a5b69f152 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ test-results.json .vscode codecov .qodo +*.log \ No newline at end of file diff --git a/public/index.html b/index.html similarity index 63% rename from public/index.html rename to index.html index 806ab9526..a08d5a5f3 100644 --- a/public/index.html +++ b/index.html @@ -1,11 +1,14 @@ - + - + - + - + - - + Boson dApp | Buy/Sell physical products as rNFTs - - - + + + - - + + @@ -59,6 +66,7 @@ >
+ ${target}`); symlinkSync(target, linkPath, "junction"); } - if (package.mode === "copy") { + if (pkg.mode === "copy") { console.log(`Copy ${target} into ${linkPath}`); cpSync(target, linkPath, { recursive: true, diff --git a/scripts/link-to-local-core-components.js b/scripts/link-to-local-core-components.cjs similarity index 87% rename from scripts/link-to-local-core-components.js rename to scripts/link-to-local-core-components.cjs index 6f9464d3b..875aa20b7 100644 --- a/scripts/link-to-local-core-components.js +++ b/scripts/link-to-local-core-components.cjs @@ -26,9 +26,9 @@ const packages = [ ]; async function main() { - for (const package of packages) { - for (const folder of package.folders) { - const target = `${resolve(ccRepo, "packages", package.path, folder)}`; + for (const pkg of packages) { + for (const folder of pkg.folders) { + const target = `${resolve(ccRepo, "packages", pkg.path, folder)}`; if (!existsSync(target)) { console.error(`Target ${target} does not exist.`); continue; @@ -37,7 +37,7 @@ async function main() { __dirname, "..", "node_modules/@bosonprotocol", - package.path, + pkg.path, folder )}`; while (existsSync(linkPath)) { @@ -45,11 +45,11 @@ async function main() { rmSync(linkPath, { recursive: true }); await new Promise((r) => setTimeout(r, 200)); } - if (package.mode === "link") { + if (pkg.mode === "link") { console.log(`Create link ${linkPath} --> ${target}`); symlinkSync(target, linkPath, "junction"); } - if (package.mode === "copy") { + if (pkg.mode === "copy") { console.log(`Copy ${target} into ${linkPath}`); cpSync(target, linkPath, { recursive: true, diff --git a/src/components/currencyInputPanel/SwapCurrencyInputPanel.tsx b/src/components/currencyInputPanel/SwapCurrencyInputPanel.tsx index 37cdc1028..f97fe3282 100644 --- a/src/components/currencyInputPanel/SwapCurrencyInputPanel.tsx +++ b/src/components/currencyInputPanel/SwapCurrencyInputPanel.tsx @@ -1,6 +1,6 @@ import { Currency, CurrencyAmount, Percent } from "@uniswap/sdk-core"; import { Pair } from "@uniswap/v2-sdk"; -import { ReactComponent as DropDown } from "assets/images/dropdown.svg"; +import DropDown from "assets/images/dropdown.svg?react"; import { flexColumnNoWrap, flexRowNoWrap } from "components/header/styles"; import { LoadingOpacityContainer, diff --git a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/BosonSnapshotGate.js b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/BosonSnapshotGate.js deleted file mode 100644 index c8ad2e549..000000000 --- a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/BosonSnapshotGate.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/common.js b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/common.js deleted file mode 100644 index c8ad2e549..000000000 --- a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/common.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/BosonSnapshotGate__factory.js b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/BosonSnapshotGate__factory.js index ac829313e..cbd699302 100644 --- a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/BosonSnapshotGate__factory.js +++ b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/BosonSnapshotGate__factory.js @@ -1,10 +1,6 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BosonSnapshotGate__factory = void 0; -/* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -const ethers_1 = require("ethers"); +import * as ethers_1 from "ethers"; const _abi = [ { inputs: [ @@ -563,7 +559,7 @@ const _abi = [ const _bytecode = "0x60806040523480156200001157600080fd5b5060405162003ec838038062003ec88339818101604052810190620000379190620003bb565b8282620000596200004d620000f760201b60201c565b620000ff60201b60201c565b81600190816200006a9190620006a0565b5080600290816200007c9190620006a0565b50505080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600760006101000a81548160ff02191690836001811115620000e957620000e862000787565b5b0217905550505050620007b6565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200022c82620001e1565b810181811067ffffffffffffffff821117156200024e576200024d620001f2565b5b80604052505050565b600062000263620001c3565b905062000271828262000221565b919050565b600067ffffffffffffffff821115620002945762000293620001f2565b5b6200029f82620001e1565b9050602081019050919050565b60005b83811015620002cc578082015181840152602081019050620002af565b60008484015250505050565b6000620002ef620002e98462000276565b62000257565b9050828152602081018484840111156200030e576200030d620001dc565b5b6200031b848285620002ac565b509392505050565b600082601f8301126200033b576200033a620001d7565b5b81516200034d848260208601620002d8565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003838262000356565b9050919050565b620003958162000376565b8114620003a157600080fd5b50565b600081519050620003b5816200038a565b92915050565b600080600060608486031215620003d757620003d6620001cd565b5b600084015167ffffffffffffffff811115620003f857620003f7620001d2565b5b620004068682870162000323565b935050602084015167ffffffffffffffff8111156200042a5762000429620001d2565b5b620004388682870162000323565b92505060406200044b86828701620003a4565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620004a857607f821691505b602082108103620004be57620004bd62000460565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005287fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620004e9565b620005348683620004e9565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620005816200057b62000575846200054c565b62000556565b6200054c565b9050919050565b6000819050919050565b6200059d8362000560565b620005b5620005ac8262000588565b848454620004f6565b825550505050565b600090565b620005cc620005bd565b620005d981848462000592565b505050565b5b818110156200060157620005f5600082620005c2565b600181019050620005df565b5050565b601f82111562000650576200061a81620004c4565b6200062584620004d9565b8101602085101562000635578190505b6200064d6200064485620004d9565b830182620005de565b50505b505050565b600082821c905092915050565b6000620006756000198460080262000655565b1980831691505092915050565b600062000690838362000662565b9150826002028217905092915050565b620006ab8262000455565b67ffffffffffffffff811115620006c757620006c6620001f2565b5b620006d382546200048f565b620006e082828562000605565b600060209050601f83116001811462000718576000841562000703578287015190505b6200070f858262000682565b8655506200077f565b601f1984166200072886620004c4565b60005b8281101562000752578489015182556001820191506020850194506020810190506200072b565b868310156200077257848901516200076e601f89168262000662565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b61370280620007c66000396000f3fe60806040526004361061011f5760003560e01c806385231205116100a0578063b88d4fde11610064578063b88d4fde146103c5578063be28b48a146103ee578063c87b56dd14610417578063e985e9c514610454578063f2fde38b146104915761011f565b806385231205146103135780638da5cb5b1461032f57806395d89b411461035a578063a22cb46514610385578063ab471434146103ae5761011f565b8063266b5db0116100e7578063266b5db01461021b57806342842e0e146102595780636352211e1461028257806370a08231146102bf578063715018a6146102fc5761011f565b806301ffc9a71461012457806306fdde0314610161578063081812fc1461018c578063095ea7b3146101c957806323b872dd146101f2575b600080fd5b34801561013057600080fd5b5061014b6004803603810190610146919061211c565b6104ba565b6040516101589190612164565b60405180910390f35b34801561016d57600080fd5b5061017661059c565b604051610183919061220f565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190612267565b61062e565b6040516101c091906122d5565b60405180910390f35b3480156101d557600080fd5b506101f060048036038101906101eb919061231c565b610674565b005b3480156101fe57600080fd5b506102196004803603810190610214919061235c565b61078b565b005b34801561022757600080fd5b50610242600480360381019061023d91906123af565b6107eb565b6040516102509291906123fe565b60405180910390f35b34801561026557600080fd5b50610280600480360381019061027b919061235c565b61089b565b005b34801561028e57600080fd5b506102a960048036038101906102a49190612267565b6108bb565b6040516102b691906122d5565b60405180910390f35b3480156102cb57600080fd5b506102e660048036038101906102e19190612427565b61099f565b6040516102f39190612454565b60405180910390f35b34801561030857600080fd5b50610311610a56565b005b61032d600480360381019061032891906124ad565b610a6a565b005b34801561033b57600080fd5b50610344610e30565b60405161035191906122d5565b60405180910390f35b34801561036657600080fd5b5061036f610e59565b60405161037c919061220f565b60405180910390f35b34801561039157600080fd5b506103ac60048036038101906103a7919061252c565b610eeb565b005b3480156103ba57600080fd5b506103c3610f01565b005b3480156103d157600080fd5b506103ec60048036038101906103e791906126a1565b610fa2565b005b3480156103fa57600080fd5b5061041560048036038101906104109190612855565b611004565b005b34801561042357600080fd5b5061043e60048036038101906104399190612267565b611195565b60405161044b919061220f565b60405180910390f35b34801561046057600080fd5b5061047b6004803603810190610476919061289e565b6111fd565b6040516104889190612164565b60405180910390f35b34801561049d57600080fd5b506104b860048036038101906104b39190612427565b611291565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061058557507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610595575061059482611314565b5b9050919050565b6060600180546105ab9061290d565b80601f01602080910402602001604051908101604052809291908181526020018280546105d79061290d565b80156106245780601f106105f957610100808354040283529160200191610624565b820191906000526020600020905b81548152906001019060200180831161060757829003601f168201915b5050505050905090565b60006106398261137e565b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061067f826113c9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036106ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e6906129b0565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661070e61147a565b73ffffffffffffffffffffffffffffffffffffffff16148061073d575061073c8161073761147a565b6111fd565b5b61077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390612a42565b60405180910390fd5b6107868383611482565b505050565b61079c61079661147a565b8261153b565b6107db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d290612ad4565b60405180910390fd5b6107e68383836115d0565b505050565b600080600b600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600c600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509250929050565b6108b683838360405180602001604052806000815250610fa2565b505050565b60006108c682611836565b610905576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fc90612b40565b60405180910390fd5b6000610910836113c9565b905060018081111561092557610924612b60565b5b600760009054906101000a900460ff16600181111561094757610946612b60565b5b0361098a57600860010154831461095d57600080fd5b600860000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050610996565b610993836113c9565b90505b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612c01565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a5e6118a2565b610a686000611920565b565b6001600760006101000a81548160ff02191690836001811115610a9057610a8f612b60565b5b0217905550600a60149054906101000a900460ff16610ae4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adb90612c6d565b60405180910390fd5b6000600b600083815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111610b7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7390612cff565b60405180910390fd5b6000600c600084815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808211610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a90612d91565b60405180910390fd5b60405180604001604052808673ffffffffffffffffffffffffffffffffffffffff16815260200184815250600860008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015590505080610c9e90612de0565b905080600c600085815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631f317d1c3487876040518463ffffffff1660e01b8152600401610d53929190612e37565b6000604051808303818588803b158015610d6c57600080fd5b505af1158015610d80573d6000803e3d6000fd5b50505050506008600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055505082848673ffffffffffffffffffffffffffffffffffffffff167fe5aebc3b9443501010c305957a362a218040ad34939a39f7ff42df0418f342ef60405160405180910390a450506000600760006101000a81548160ff02191690836001811115610e2657610e25612b60565b5b0217905550505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060028054610e689061290d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e949061290d565b8015610ee15780601f10610eb657610100808354040283529160200191610ee1565b820191906000526020600020905b815481529060010190602001808311610ec457829003601f168201915b5050505050905090565b610efd610ef661147a565b83836119e4565b5050565b610f096118a2565b600a60149054906101000a900460ff1615610f59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5090612eac565b60405180910390fd5b6001600a60146101000a81548160ff0219169083151502179055507fab3ad99ae953d0b9ab8b5cc3062f884a6e59a317deb70cd601ad05fccc9cf4bd60405160405180910390a1565b610fb3610fad61147a565b8361153b565b610ff2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe990612ad4565b60405180910390fd5b610ffe84848484611b50565b50505050565b61100c6118a2565b600a60149054906101000a900460ff161561105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105390612f18565b60405180910390fd5b60008151905060005b8181101561115957600083828151811061108257611081612f38565b5b602002602001015160000151905060008483815181106110a5576110a4612f38565b5b602002602001015160200151905060008584815181106110c8576110c7612f38565b5b602002602001015160400151905081600b600085815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061113483611836565b611143576111423084611bac565b5b505050808061115190612de0565b915050611065565b507f89187dde77b1f14d31a928ba5c8882f7db7fa0fd7498f3cb4cdfa0ab7441b195826040516111899190613076565b60405180910390a15050565b60606111a08261137e565b60006111aa611d85565b905060008151116111ca57604051806020016040528060008152506111f5565b806111d484611d9c565b6040516020016111e59291906130d4565b6040516020818303038152906040525b915050919050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6112996118a2565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611308576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ff9061316a565b60405180910390fd5b61131181611920565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61138781611836565b6113c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bd90612b40565b60405180910390fd5b50565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146890612b40565b60405180910390fd5b80915050919050565b600033905090565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166114f5836113c9565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080611547836113c9565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611589575061158881856111fd565b5b806115c757508373ffffffffffffffffffffffffffffffffffffffff166115af8461062e565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166115f0826113c9565b73ffffffffffffffffffffffffffffffffffffffff1614611646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163d906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ac9061328e565b60405180910390fd5b6116c0838383611efc565b6116cb600082611482565b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461171b91906132ae565b925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461177291906132e2565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611831838383611f01565b505050565b60008073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6118aa61147a565b73ffffffffffffffffffffffffffffffffffffffff166118c8610e30565b73ffffffffffffffffffffffffffffffffffffffff161461191e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191590613362565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a49906133ce565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611b439190612164565b60405180910390a3505050565b611b5b8484846115d0565b611b6784848484611f06565b611ba6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b9d90613460565b60405180910390fd5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c12906134cc565b60405180910390fd5b611c2481611836565b15611c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5b90613538565b60405180910390fd5b611c7060008383611efc565b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611cc091906132e2565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611d8160008383611f01565b5050565b606060405180602001604052806000815250905090565b606060008203611de3576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611ef7565b600082905060005b60008214611e15578080611dfe90612de0565b915050600a82611e0e9190613587565b9150611deb565b60008167ffffffffffffffff811115611e3157611e30612576565b5b6040519080825280601f01601f191660200182016040528015611e635781602001600182028036833780820191505090505b5090505b60008514611ef057600182611e7c91906132ae565b9150600a85611e8b91906135b8565b6030611e9791906132e2565b60f81b818381518110611ead57611eac612f38565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85611ee99190613587565b9450611e67565b8093505050505b919050565b505050565b505050565b6000611f278473ffffffffffffffffffffffffffffffffffffffff1661208d565b15612080578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02611f5061147a565b8786866040518563ffffffff1660e01b8152600401611f72949392919061363e565b6020604051808303816000875af1925050508015611fae57506040513d601f19601f82011682018060405250810190611fab919061369f565b60015b612030573d8060008114611fde576040519150601f19603f3d011682016040523d82523d6000602084013e611fe3565b606091505b506000815103612028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201f90613460565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612085565b600190505b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6120f9816120c4565b811461210457600080fd5b50565b600081359050612116816120f0565b92915050565b600060208284031215612132576121316120ba565b5b600061214084828501612107565b91505092915050565b60008115159050919050565b61215e81612149565b82525050565b60006020820190506121796000830184612155565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156121b957808201518184015260208101905061219e565b60008484015250505050565b6000601f19601f8301169050919050565b60006121e18261217f565b6121eb818561218a565b93506121fb81856020860161219b565b612204816121c5565b840191505092915050565b6000602082019050818103600083015261222981846121d6565b905092915050565b6000819050919050565b61224481612231565b811461224f57600080fd5b50565b6000813590506122618161223b565b92915050565b60006020828403121561227d5761227c6120ba565b5b600061228b84828501612252565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006122bf82612294565b9050919050565b6122cf816122b4565b82525050565b60006020820190506122ea60008301846122c6565b92915050565b6122f9816122b4565b811461230457600080fd5b50565b600081359050612316816122f0565b92915050565b60008060408385031215612333576123326120ba565b5b600061234185828601612307565b925050602061235285828601612252565b9150509250929050565b600080600060608486031215612375576123746120ba565b5b600061238386828701612307565b935050602061239486828701612307565b92505060406123a586828701612252565b9150509250925092565b600080604083850312156123c6576123c56120ba565b5b60006123d485828601612252565b92505060206123e585828601612307565b9150509250929050565b6123f881612231565b82525050565b600060408201905061241360008301856123ef565b61242060208301846123ef565b9392505050565b60006020828403121561243d5761243c6120ba565b5b600061244b84828501612307565b91505092915050565b600060208201905061246960008301846123ef565b92915050565b600061247a82612294565b9050919050565b61248a8161246f565b811461249557600080fd5b50565b6000813590506124a781612481565b92915050565b6000806000606084860312156124c6576124c56120ba565b5b60006124d486828701612498565b93505060206124e586828701612252565b92505060406124f686828701612252565b9150509250925092565b61250981612149565b811461251457600080fd5b50565b60008135905061252681612500565b92915050565b60008060408385031215612543576125426120ba565b5b600061255185828601612307565b925050602061256285828601612517565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125ae826121c5565b810181811067ffffffffffffffff821117156125cd576125cc612576565b5b80604052505050565b60006125e06120b0565b90506125ec82826125a5565b919050565b600067ffffffffffffffff82111561260c5761260b612576565b5b612615826121c5565b9050602081019050919050565b82818337600083830152505050565b600061264461263f846125f1565b6125d6565b9050828152602081018484840111156126605761265f612571565b5b61266b848285612622565b509392505050565b600082601f8301126126885761268761256c565b5b8135612698848260208601612631565b91505092915050565b600080600080608085870312156126bb576126ba6120ba565b5b60006126c987828801612307565b94505060206126da87828801612307565b93505060406126eb87828801612252565b925050606085013567ffffffffffffffff81111561270c5761270b6120bf565b5b61271887828801612673565b91505092959194509250565b600067ffffffffffffffff82111561273f5761273e612576565b5b602082029050602081019050919050565b600080fd5b600080fd5b6000606082840312156127705761276f612755565b5b61277a60606125d6565b9050600061278a84828501612252565b600083015250602061279e84828501612252565b60208301525060406127b284828501612307565b60408301525092915050565b60006127d16127cc84612724565b6125d6565b905080838252602082019050606084028301858111156127f4576127f3612750565b5b835b8181101561281d5780612809888261275a565b8452602084019350506060810190506127f6565b5050509392505050565b600082601f83011261283c5761283b61256c565b5b813561284c8482602086016127be565b91505092915050565b60006020828403121561286b5761286a6120ba565b5b600082013567ffffffffffffffff811115612889576128886120bf565b5b61289584828501612827565b91505092915050565b600080604083850312156128b5576128b46120ba565b5b60006128c385828601612307565b92505060206128d485828601612307565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061292557607f821691505b602082108103612938576129376128de565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061299a60218361218a565b91506129a58261293e565b604082019050919050565b600060208201905081810360008301526129c98161298d565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000602082015250565b6000612a2c603e8361218a565b9150612a37826129d0565b604082019050919050565b60006020820190508181036000830152612a5b81612a1f565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206e6f7220617070726f766564000000000000000000000000000000000000602082015250565b6000612abe602e8361218a565b9150612ac982612a62565b604082019050919050565b60006020820190508181036000830152612aed81612ab1565b9050919050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000612b2a60188361218a565b9150612b3582612af4565b602082019050919050565b60006020820190508181036000830152612b5981612b1d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000612beb60298361218a565b9150612bf682612b8f565b604082019050919050565b60006020820190508181036000830152612c1a81612bde565b9050919050565b7f536e617073686f74206973206e6f742066726f7a656e00000000000000000000600082015250565b6000612c5760168361218a565b9150612c6282612c21565b602082019050919050565b60006020820190508181036000830152612c8681612c4a565b9050919050565b7f42757965722068656c64206e6f2062616c616e6365206f66207468652067697660008201527f656e20746f6b656e2069642061742074696d65206f6620736e617073686f7400602082015250565b6000612ce9603f8361218a565b9150612cf482612c8d565b604082019050919050565b60006020820190508181036000830152612d1881612cdc565b9050919050565b7f427579657227732062616c616e6365206f662074686520736e617073686f742060008201527f746f6b656e20696420686173206265656e207573656400000000000000000000602082015250565b6000612d7b60368361218a565b9150612d8682612d1f565b604082019050919050565b60006020820190508181036000830152612daa81612d6e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612deb82612231565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612e1d57612e1c612db1565b5b600182019050919050565b612e318161246f565b82525050565b6000604082019050612e4c6000830185612e28565b612e5960208301846123ef565b9392505050565b7f536e617073686f7420616c72656164792066726f7a656e000000000000000000600082015250565b6000612e9660178361218a565b9150612ea182612e60565b602082019050919050565b60006020820190508181036000830152612ec581612e89565b9050919050565b7f43616e6e6f7420617070656e6420746f2066726f7a656e20736e617073686f74600082015250565b6000612f0260208361218a565b9150612f0d82612ecc565b602082019050919050565b60006020820190508181036000830152612f3181612ef5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612f9c81612231565b82525050565b612fab816122b4565b82525050565b606082016000820151612fc76000850182612f93565b506020820151612fda6020850182612f93565b506040820151612fed6040850182612fa2565b50505050565b6000612fff8383612fb1565b60608301905092915050565b6000602082019050919050565b600061302382612f67565b61302d8185612f72565b935061303883612f83565b8060005b838110156130695781516130508882612ff3565b975061305b8361300b565b92505060018101905061303c565b5085935050505092915050565b600060208201905081810360008301526130908184613018565b905092915050565b600081905092915050565b60006130ae8261217f565b6130b88185613098565b93506130c881856020860161219b565b80840191505092915050565b60006130e082856130a3565b91506130ec82846130a3565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061315460268361218a565b915061315f826130f8565b604082019050919050565b6000602082019050818103600083015261318381613147565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006131e660258361218a565b91506131f18261318a565b604082019050919050565b60006020820190508181036000830152613215816131d9565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061327860248361218a565b91506132838261321c565b604082019050919050565b600060208201905081810360008301526132a78161326b565b9050919050565b60006132b982612231565b91506132c483612231565b92508282039050818111156132dc576132db612db1565b5b92915050565b60006132ed82612231565b91506132f883612231565b92508282019050808211156133105761330f612db1565b5b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061334c60208361218a565b915061335782613316565b602082019050919050565b6000602082019050818103600083015261337b8161333f565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006133b860198361218a565b91506133c382613382565b602082019050919050565b600060208201905081810360008301526133e7816133ab565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b600061344a60328361218a565b9150613455826133ee565b604082019050919050565b600060208201905081810360008301526134798161343d565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006134b660208361218a565b91506134c182613480565b602082019050919050565b600060208201905081810360008301526134e5816134a9565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000613522601c8361218a565b915061352d826134ec565b602082019050919050565b6000602082019050818103600083015261355181613515565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061359282612231565b915061359d83612231565b9250826135ad576135ac613558565b5b828204905092915050565b60006135c382612231565b91506135ce83612231565b9250826135de576135dd613558565b5b828206905092915050565b600081519050919050565b600082825260208201905092915050565b6000613610826135e9565b61361a81856135f4565b935061362a81856020860161219b565b613633816121c5565b840191505092915050565b600060808201905061365360008301876122c6565b61366060208301866122c6565b61366d60408301856123ef565b818103606083015261367f8184613605565b905095945050505050565b600081519050613699816120f0565b92915050565b6000602082840312156136b5576136b46120ba565b5b60006136c38482850161368a565b9150509291505056fea2646970667358221220b07e82b8ddd974c3ab77f282c292f0499e9960e397179875dc734e8ef4d25b5064736f6c63430008110033"; const isSuperArgs = (xs) => xs.length > 1; -class BosonSnapshotGate__factory extends ethers_1.ContractFactory { +export class BosonSnapshotGate__factory extends ethers_1.ContractFactory { constructor(...args) { if (isSuperArgs(args)) { super(...args); @@ -595,6 +591,5 @@ class BosonSnapshotGate__factory extends ethers_1.ContractFactory { return new ethers_1.Contract(address, _abi, signerOrProvider); } } -exports.BosonSnapshotGate__factory = BosonSnapshotGate__factory; BosonSnapshotGate__factory.bytecode = _bytecode; BosonSnapshotGate__factory.abi = _abi; diff --git a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/index.js b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/index.js index 32b0d7ad9..9b810d317 100644 --- a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/index.js +++ b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/factories/index.js @@ -1,13 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BosonSnapshotGate__factory = void 0; -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -var BosonSnapshotGate__factory_1 = require("./BosonSnapshotGate__factory"); -Object.defineProperty(exports, "BosonSnapshotGate__factory", { - enumerable: true, - get: function () { - return BosonSnapshotGate__factory_1.BosonSnapshotGate__factory; - } -}); +export { BosonSnapshotGate__factory } from "./BosonSnapshotGate__factory.js"; diff --git a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/index.js b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/index.js index 55527a2a8..5ff3331c1 100644 --- a/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/index.js +++ b/src/components/detail/DetailWidget/BosonSnapshotGate/typechain/index.js @@ -1,58 +1,2 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-nocheck -"use strict"; -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if ( - !desc || - ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) - ) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } - }; - } - Object.defineProperty(o, k2, desc); - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); -var __setModuleDefault = - (this && this.__setModuleDefault) || - (Object.create - ? function (o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } - : function (o, v) { - o["default"] = v; - }); -var __importStar = - (this && this.__importStar) || - function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BosonSnapshotGate__factory = exports.factories = void 0; -exports.factories = __importStar(require("./factories")); -var BosonSnapshotGate__factory_1 = require("./factories/BosonSnapshotGate__factory"); -Object.defineProperty(exports, "BosonSnapshotGate__factory", { - enumerable: true, - get: function () { - return BosonSnapshotGate__factory_1.BosonSnapshotGate__factory; - } -}); +export * as factories from "./factories/index.js"; +export { BosonSnapshotGate__factory } from "./factories/BosonSnapshotGate__factory.js"; diff --git a/src/components/detail/DetailWidget/DetailDisputeResolver.tsx b/src/components/detail/DetailWidget/DetailDisputeResolver.tsx index 08e7a97ce..f8ecb4fc2 100644 --- a/src/components/detail/DetailWidget/DetailDisputeResolver.tsx +++ b/src/components/detail/DetailWidget/DetailDisputeResolver.tsx @@ -1,4 +1,4 @@ -import { ReactComponent } from "../../../assets/redeemeum.svg"; +import ReactComponent from "../../../assets/redeemeum.svg?react"; import { Typography } from "../../ui/Typography"; export const DetailDisputeResolver = { diff --git a/src/components/header/accountDrawer/miniPortfolio/PortfolioLogo.tsx b/src/components/header/accountDrawer/miniPortfolio/PortfolioLogo.tsx index 1a12cd457..5ac4e6c03 100644 --- a/src/components/header/accountDrawer/miniPortfolio/PortfolioLogo.tsx +++ b/src/components/header/accountDrawer/miniPortfolio/PortfolioLogo.tsx @@ -1,6 +1,6 @@ import { ChainId, Currency } from "@uniswap/sdk-core"; import blankTokenUrl from "assets/svg/blank_token.svg"; -import { ReactComponent as UnknownStatus } from "assets/svg/contract-interaction.svg"; +import UnknownStatus from "assets/svg/contract-interaction.svg?react"; import { Spinner } from "components/loading/Spinner"; import { MissingImageLogo } from "components/logo/AssetLogo"; import { Unicon } from "components/unicon"; diff --git a/src/components/modal/components/CustomStoreModal.tsx b/src/components/modal/components/CustomStoreModal.tsx index 0df5ec315..90a31aa43 100644 --- a/src/components/modal/components/CustomStoreModal.tsx +++ b/src/components/modal/components/CustomStoreModal.tsx @@ -1,8 +1,8 @@ import * as Tooltip from "@radix-ui/react-tooltip"; import * as Sentry from "@sentry/browser"; import { Form, Formik } from "formik"; +import { html as beautifyHtml } from "js-beautify"; import { Copy, CopySimple, Info } from "phosphor-react"; -import * as pretty from "pretty"; import { useState } from "react"; import toast from "react-hot-toast"; import { useSearchParams } from "react-router-dom"; @@ -346,7 +346,7 @@ export function CustomStoreModal({ tag)
    - {pretty(iframeString)} + {beautifyHtml(iframeString)} { try { @@ -368,7 +368,7 @@ export function CustomStoreModal({ For example, this is what a simple HTML page would look like:
      - {pretty(htmlString)} + {beautifyHtml(htmlString)}
    diff --git a/src/components/modal/components/Profile/ChooseProfileType.tsx b/src/components/modal/components/Profile/ChooseProfileType.tsx index 9eb3d3300..b93b9736c 100644 --- a/src/components/modal/components/Profile/ChooseProfileType.tsx +++ b/src/components/modal/components/Profile/ChooseProfileType.tsx @@ -1,6 +1,6 @@ import { Dispatch, SetStateAction } from "react"; -import { ReactComponent as LensLogo } from "../../../../assets/lens.svg"; +import LensLogo from "../../../../assets/lens.svg?react"; import Button from "../../../ui/Button"; import { Grid } from "../../../ui/Grid"; import { Typography } from "../../../ui/Typography"; diff --git a/src/components/modal/components/Profile/utils.ts b/src/components/modal/components/Profile/utils.ts index 712178043..e994e14c2 100644 --- a/src/components/modal/components/Profile/utils.ts +++ b/src/components/modal/components/Profile/utils.ts @@ -111,11 +111,9 @@ export function buildRegularProfileFromMetadata( position: coverPicture.position ?? undefined, src: coverPicture.url } - ] ?? [] - : [], - logo: profileImage - ? [{ ...profileImage, src: profileImage.url }] ?? [] + ] : [], + logo: profileImage ? [{ ...profileImage, src: profileImage.url }] : [], contactPreference: OPTIONS_CHANNEL_COMMUNICATIONS_PREFERENCE.find( (obj) => obj.value === metadata?.contactPreference diff --git a/src/components/price/CurrencyIcon.tsx b/src/components/price/CurrencyIcon.tsx index 6b9819771..a1e343c83 100644 --- a/src/components/price/CurrencyIcon.tsx +++ b/src/components/price/CurrencyIcon.tsx @@ -3,8 +3,8 @@ import * as Sentry from "@sentry/browser"; import { useConfigContext } from "components/config/ConfigContext"; import { useState } from "react"; -import { ReactComponent as bosonIcon } from "./images/boson.svg"; -import { ReactComponent as daiIcon } from "./images/dai.svg"; +import bosonIcon from "./images/boson.svg?react"; +import daiIcon from "./images/dai.svg?react"; const currencyImages = { DAI: daiIcon, diff --git a/src/components/product/ProductType.tsx b/src/components/product/ProductType.tsx index c21a61a04..9980792c8 100644 --- a/src/components/product/ProductType.tsx +++ b/src/components/product/ProductType.tsx @@ -35,10 +35,10 @@ import { Grid } from "../ui/Grid"; import { GridContainer } from "../ui/GridContainer"; import Image from "../ui/Image"; import { Typography } from "../ui/Typography"; -import differentVariantsProduct from "./img/different-variants-product.png"; -import oneItemTypeProduct from "./img/one-item-product.png"; -import phygitalProduct from "./img/phygital-product.png"; -import physicalProduct from "./img/physical-product.png"; +import differentVariantsProduct from "./img/different-variants-product.png?inline"; +import oneItemTypeProduct from "./img/one-item-product.png?inline"; +import phygitalProduct from "./img/phygital-product.png?inline"; +import physicalProduct from "./img/physical-product.png?inline"; import { ContainerProductPage, ProductButtonGroup, diff --git a/src/components/routingDiagram/RoutingDiagram.tsx b/src/components/routingDiagram/RoutingDiagram.tsx index c815d799a..532b7c6d1 100644 --- a/src/components/routingDiagram/RoutingDiagram.tsx +++ b/src/components/routingDiagram/RoutingDiagram.tsx @@ -1,7 +1,7 @@ import { Protocol } from "@uniswap/router-sdk"; import { Currency } from "@uniswap/sdk-core"; import { FeeAmount } from "@uniswap/v3-sdk"; -import { ReactComponent as DotLine } from "assets/svg/dot_line.svg"; +import DotLine from "assets/svg/dot_line.svg?react"; import CurrencyLogo from "components/logo/CurrencyLogo"; import DoubleCurrencyLogo from "components/logo/DoubleCurrencyLogo"; import Tooltip from "components/tooltip/Tooltip"; diff --git a/src/components/settings/menuButton/index.tsx b/src/components/settings/menuButton/index.tsx index 490c90a69..8bf6a9f17 100644 --- a/src/components/settings/menuButton/index.tsx +++ b/src/components/settings/menuButton/index.tsx @@ -1,4 +1,4 @@ -import { ReactComponent as Settings } from "assets/svg/settings.svg"; +import Settings from "assets/svg/settings.svg?react"; import { Grid } from "components/ui/Grid"; import { Typography } from "components/ui/Typography"; import { colors } from "lib/styles/colors"; diff --git a/src/components/swap/ConfirmSwapModal.tsx b/src/components/swap/ConfirmSwapModal.tsx index dd0425136..c2296d12d 100644 --- a/src/components/swap/ConfirmSwapModal.tsx +++ b/src/components/swap/ConfirmSwapModal.tsx @@ -3,7 +3,7 @@ import Modal from "components/modal/Modal"; import { AutoColumn } from "components/ui/column"; import { Grid } from "components/ui/Grid"; import { Typography } from "components/ui/Typography"; -import { TransactionStatus } from "graphql/data/__generated__/types-and-hooks"; +import { TransactionStatus } from "graphqlData/__generated__/types-and-hooks"; import { getChainInfo } from "lib/constants/chainInfo"; import { USDT as USDT_MAINNET } from "lib/constants/tokens"; import { isL2ChainId } from "lib/utils/chains"; diff --git a/src/components/swap/GasEstimateTooltip.tsx b/src/components/swap/GasEstimateTooltip.tsx index 60c8eeb47..457def0b5 100644 --- a/src/components/swap/GasEstimateTooltip.tsx +++ b/src/components/swap/GasEstimateTooltip.tsx @@ -10,7 +10,7 @@ import { InterfaceTrade } from "state/routing/types"; import { isUniswapXTrade } from "state/routing/utils"; import styled from "styled-components"; -import { ReactComponent as GasIcon } from "../../assets/images/gas-icon.svg"; +import GasIcon from "../../assets/images/gas-icon.svg?react"; import { GasBreakdownTooltip } from "./GasBreakdownTooltip"; const StyledGasIcon = styled(GasIcon)` diff --git a/src/components/swap/TradePrice.tsx b/src/components/swap/TradePrice.tsx index 55702d7f6..9a8fcb3f7 100644 --- a/src/components/swap/TradePrice.tsx +++ b/src/components/swap/TradePrice.tsx @@ -57,7 +57,7 @@ export default function TradePrice({ price }: TradePriceProps) { ); const text = `${ - "1 " + labelInverted + " = " + formattedPrice ?? "-" + "1 " + labelInverted + " = " + (formattedPrice ?? "-") } ${label}`; return ( diff --git a/src/components/swap/pendingModalContent/Logos.tsx b/src/components/swap/pendingModalContent/Logos.tsx index ae702393f..ce5d61f42 100644 --- a/src/components/swap/pendingModalContent/Logos.tsx +++ b/src/components/swap/pendingModalContent/Logos.tsx @@ -1,5 +1,5 @@ import { Currency } from "@uniswap/sdk-core"; -import { ReactComponent as PapersIcon } from "assets/svg/papers-text.svg"; +import PapersIcon from "assets/svg/papers-text.svg?react"; import { Spinner } from "components/loading/Spinner"; import CurrencyLogo from "components/logo/CurrencyLogo"; import { colors } from "lib/styles/colors"; diff --git a/src/components/swap/pendingModalContent/index.tsx b/src/components/swap/pendingModalContent/index.tsx index 7e451b278..db571e220 100644 --- a/src/components/swap/pendingModalContent/index.tsx +++ b/src/components/swap/pendingModalContent/index.tsx @@ -2,7 +2,7 @@ import { ChainId, Currency } from "@uniswap/sdk-core"; import Column, { ColumnCenter } from "components/ui/column"; import { Grid } from "components/ui/Grid"; import { Typography } from "components/ui/Typography"; -import { TransactionStatus } from "graphql/data/__generated__/types-and-hooks"; +import { TransactionStatus } from "graphqlData/__generated__/types-and-hooks"; import { getExplorerLink } from "lib/utils/getExplorerLink"; import { ExplorerDataType } from "lib/utils/getExplorerLink"; import { useChainId } from "lib/utils/hooks/connection/connection"; diff --git a/src/components/timeline/Timeline.tsx b/src/components/timeline/Timeline.tsx index 0fc6bc57d..26bf6d48b 100644 --- a/src/components/timeline/Timeline.tsx +++ b/src/components/timeline/Timeline.tsx @@ -2,8 +2,8 @@ import React, { Fragment } from "react"; import styled from "styled-components"; import { colors } from "../../lib/styles/colors"; -import { ReactComponent as Dot } from "./timeline-dot.svg"; -import { ReactComponent as VerticalLineSVG } from "./timeline-line.svg"; +import Dot from "./timeline-dot.svg?react"; +import VerticalLineSVG from "./timeline-line.svg?react"; const Container = styled.div<{ $height: string }>` display: flex; diff --git a/src/graphql/data/__generated__/types-and-hooks.ts b/src/graphqlData/__generated__/types-and-hooks.ts similarity index 100% rename from src/graphql/data/__generated__/types-and-hooks.ts rename to src/graphqlData/__generated__/types-and-hooks.ts diff --git a/src/graphql/data/apollo.ts b/src/graphqlData/apollo.ts similarity index 100% rename from src/graphql/data/apollo.ts rename to src/graphqlData/apollo.ts diff --git a/src/graphql/data/util.tsx b/src/graphqlData/util.tsx similarity index 96% rename from src/graphql/data/util.tsx rename to src/graphqlData/util.tsx index bef42c713..61266bdb1 100644 --- a/src/graphql/data/util.tsx +++ b/src/graphqlData/util.tsx @@ -3,8 +3,8 @@ import { ChainId, Currency, Token } from "@uniswap/sdk-core"; import { envChainIds } from "lib/config"; import ms from "ms"; -import { AVERAGE_L1_BLOCK_TIME } from "../../lib/constants/chainInfo"; -import { nativeOnChain } from "../../lib/constants/tokens"; +import { AVERAGE_L1_BLOCK_TIME } from "../lib/constants/chainInfo"; +import { nativeOnChain } from "../lib/constants/tokens"; import { Chain, TokenStandard } from "./__generated__/types-and-hooks"; export enum PollingInterval { diff --git a/src/index.tsx b/src/index.tsx index bf6168b4b..23d743a26 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,7 +3,7 @@ import { CommitWidgetReduxProvider } from "@bosonprotocol/react-kit"; import { ConfigProvider } from "components/config/ConfigProvider"; import { CoreSDKProvider } from "components/core-sdk/CoreSDKProvider"; import { FiatLinkProvider } from "components/header/accountDrawer/fiatOnrampModal/FiatLink"; -import { apolloClient } from "graphql/data/apollo"; +import { apolloClient } from "graphqlData/apollo"; import { MulticallUpdater } from "lib/state/multicall"; import { BlockNumberProvider } from "lib/utils/hooks/useBlockNumber"; import { queryClient, rootElement } from "queryClient"; diff --git a/src/lib/config.ts b/src/lib/config.ts index 6fddaf7ea..5831ecf1a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -5,6 +5,7 @@ import { ProtocolConfig } from "@bosonprotocol/react-kit"; import * as Sentry from "@sentry/browser"; +import { Buffer } from "buffer"; import { Token } from "../components/convertion-rate/ConvertionRateContext"; import lensFollowNftContractAbi from "../lib/utils/hooks/lens/abis/lens-follow-nft-contract-abi.json"; @@ -13,21 +14,22 @@ import lensPeripheryDataProvider from "../lib/utils/hooks/lens/abis/lens-periphe import { parseCurationList } from "./utils/curationList"; import { ViewMode } from "./viewMode"; -export const envName = process.env.REACT_APP_ENV_NAME as EnvironmentType; +export const envName = import.meta.env.REACT_APP_ENV_NAME as EnvironmentType; if (!envName) { throw new Error("REACT_APP_ENV_NAME is not defined"); } -const infuraKey = process.env.REACT_APP_INFURA_KEY; +const infuraKey = import.meta.env.REACT_APP_INFURA_KEY; if (!infuraKey) { throw new Error("REACT_APP_INFURA_KEY is not defined"); } -const widgetsUrl = process.env.REACT_APP_WIDGETS_URL; +const widgetsUrl = import.meta.env.REACT_APP_WIDGETS_URL; if (!widgetsUrl) { throw new Error("REACT_APP_WIDGETS_URL is not defined"); } -const infuraProjectSecret = process.env.REACT_APP_INFURA_IPFS_PROJECT_SECRET; -const infuraProjectId = process.env.REACT_APP_INFURA_IPFS_PROJECT_ID; +const infuraProjectSecret = import.meta.env + .REACT_APP_INFURA_IPFS_PROJECT_SECRET; +const infuraProjectId = import.meta.env.REACT_APP_INFURA_IPFS_PROJECT_ID; function getMetaTxApiIds(envConfig: ProtocolConfig) { const protocolAddress: string = envConfig.contracts.protocolDiamond; @@ -35,7 +37,7 @@ function getMetaTxApiIds(envConfig: ProtocolConfig) { const apiIds: Record> = {}; try { const apiIdsInputPerConfigId = JSON.parse( - process.env.REACT_APP_META_TX_API_IDS_MAP || "{}" + import.meta.env.REACT_APP_META_TX_API_IDS_MAP || "{}" ); const method = "executeMetaTransaction"; // At the moment, both protocol and tokens have the same method const tokens = defaultTokens; @@ -70,7 +72,7 @@ function getMetaTxApiKey(envConfig: ProtocolConfig) { let apiKey = ""; try { const apiKeysPerConfigId = JSON.parse( - process.env.REACT_APP_META_TX_API_KEY_MAP || "{}" + import.meta.env.REACT_APP_META_TX_API_KEY_MAP || "{}" ); apiKey = apiKeysPerConfigId[envConfig.configId]; return apiKey; @@ -97,29 +99,29 @@ export const CONFIG = { ticker: process.env.DEFAULT_CURRENCY || "USD", symbol: process.env.DEFAULT_CURRENCY_SYMBOL || "$" }, - releaseTag: process.env.REACT_APP_RELEASE_TAG, - releaseName: process.env.REACT_APP_RELEASE_NAME, + releaseTag: import.meta.env.REACT_APP_RELEASE_TAG, + releaseName: import.meta.env.REACT_APP_RELEASE_NAME, sentryDSNUrl: "https://ff9c04ed823a4658bc5de78945961937@o992661.ingest.sentry.io/6455090", offerCurationList: parseCurationList( - process.env.REACT_APP_OFFER_CURATION_LIST + import.meta.env.REACT_APP_OFFER_CURATION_LIST ), - rNFTLicenseTemplate: process.env.REACT_APP_RNFT_LICENSE_TEMPLATE ?? "", + rNFTLicenseTemplate: import.meta.env.REACT_APP_RNFT_LICENSE_TEMPLATE ?? "", buyerSellerAgreementTemplate: - process.env.REACT_APP_BUYER_SELLER_AGREEMENT_TEMPLATE ?? "", + import.meta.env.REACT_APP_BUYER_SELLER_AGREEMENT_TEMPLATE ?? "", fairExchangePolicyRules: - process.env.REACT_APP_FAIR_EXCHANGE_POLICY_RULES ?? "", + import.meta.env.REACT_APP_FAIR_EXCHANGE_POLICY_RULES ?? "", enableCurationLists: stringToBoolean( - process.env.REACT_APP_ENABLE_CURATION_LISTS, + import.meta.env.REACT_APP_ENABLE_CURATION_LISTS, true ), - mockSellerId: process.env.REACT_APP_MOCK_SELLER_ID, + mockSellerId: import.meta.env.REACT_APP_MOCK_SELLER_ID, mockConversionRates: stringToBoolean( process.env.REACT_MOCK_CONVERSION_RATES, false ), defaultDisputeResolutionPeriodDays: - process.env.REACT_APP_DEFAULT_RESOLUTION_PERIOD_DAYS || "15", + import.meta.env.REACT_APP_DEFAULT_RESOLUTION_PERIOD_DAYS || "15", defaultSellerContactMethod: "Chat App in the dApp", defaultDisputeResolverContactMethod: process.env.NODE_ENV === "production" @@ -129,31 +131,31 @@ export const CONFIG = { minimumReturnPeriodInDays: 1, defaultReturnPeriodInDays: 15, minimumDisputePeriodInDays: 30, - ipfsGateway: process.env.REACT_APP_IPFS_GATEWAY || "https://ipfs.io/ipfs", + ipfsGateway: import.meta.env.REACT_APP_IPFS_GATEWAY || "https://ipfs.io/ipfs", ipfsImageGateway: - process.env.REACT_APP_IPFS_IMAGE_GATEWAY || - process.env.REACT_APP_IPFS_GATEWAY || + import.meta.env.REACT_APP_IPFS_IMAGE_GATEWAY || + import.meta.env.REACT_APP_IPFS_GATEWAY || "https://ipfs.io/ipfs", walletConnect: { - projectId: process.env.REACT_APP_WALLET_CONNECT_PROJECT_ID || "" + projectId: import.meta.env.REACT_APP_WALLET_CONNECT_PROJECT_ID || "" }, envViewMode: { current: Object.values(ViewMode).includes( - (process.env.REACT_APP_VIEW_MODE as ViewMode) || "" + (import.meta.env.REACT_APP_VIEW_MODE as ViewMode) || "" ) - ? (process.env.REACT_APP_VIEW_MODE as ViewMode) + ? (import.meta.env.REACT_APP_VIEW_MODE as ViewMode) : ViewMode.DAPP, - dappViewModeUrl: process.env.REACT_APP_DAPP_VIEW_MODE || "", - drCenterViewModeUrl: process.env.REACT_APP_DR_CENTER_VIEW_MODE || "" + dappViewModeUrl: import.meta.env.REACT_APP_DAPP_VIEW_MODE || "", + drCenterViewModeUrl: import.meta.env.REACT_APP_DR_CENTER_VIEW_MODE || "" }, moonpay: { - api: process.env.REACT_APP_MOONPAY_API || "", - apiKey: process.env.REACT_APP_MOONPAY_API_KEY || "", - link: process.env.REACT_APP_MOONPAY_LINK || "", - externalLink: process.env.REACT_APP_MOONPAY_EXTERNAL_LINK || "" + api: import.meta.env.REACT_APP_MOONPAY_API || "", + apiKey: import.meta.env.REACT_APP_MOONPAY_API_KEY || "", + link: import.meta.env.REACT_APP_MOONPAY_LINK || "", + externalLink: import.meta.env.REACT_APP_MOONPAY_EXTERNAL_LINK || "" }, - awsApiEndpoint: process.env.REACT_APP_AWS_API_ENDPOINT as string, - uniswapApiUrl: process.env.REACT_APP_UNISWAP_API_URL as string, + awsApiEndpoint: import.meta.env.REACT_APP_AWS_API_ENDPOINT as string, + uniswapApiUrl: import.meta.env.REACT_APP_UNISWAP_API_URL as string, infuraKey, infuraProjectId, infuraProjectSecret, @@ -161,7 +163,7 @@ export const CONFIG = { infuraProjectId, infuraProjectSecret ), - magicLinkKey: process.env.REACT_APP_MAGIC_API_KEY as string, + magicLinkKey: import.meta.env.REACT_APP_MAGIC_API_KEY as string, rpcUrls: getRpcUrls(infuraKey), widgetsUrl } as const; @@ -175,18 +177,21 @@ export const getDappConfig = (envConfig: ProtocolConfig) => { envConfig, enableSentryLogging: process.env.NODE_ENV === "development" - ? stringToBoolean(process.env.REACT_APP_ENABLE_SENTRY_LOGGING, false) + ? stringToBoolean( + import.meta.env.REACT_APP_ENABLE_SENTRY_LOGGING, + false + ) : ["local", "testing"].includes(envConfig.envName), envName: envConfig.envName, theGraphIpfsUrl: - process.env.REACT_APP_THE_GRAPH_IPFS_URL || envConfig.theGraphIpfsUrl, + import.meta.env.REACT_APP_THE_GRAPH_IPFS_URL || envConfig.theGraphIpfsUrl, ipfsMetadataStorageUrl: - process.env.REACT_APP_IPFS_METADATA_URL || envConfig.ipfsMetadataUrl, + import.meta.env.REACT_APP_IPFS_METADATA_URL || envConfig.ipfsMetadataUrl, metaTx: envConfig.metaTx ? { ...envConfig.metaTx, relayerUrl: - process.env.REACT_APP_META_TX_RELAYER_URL || + import.meta.env.REACT_APP_META_TX_RELAYER_URL || envConfig.metaTx?.relayerUrl, apiKey: getMetaTxApiKey(envConfig), apiIds: getMetaTxApiIds(envConfig) diff --git a/src/lib/types/externals.d.ts b/src/lib/types/externals.d.ts index ec5f4ff93..3a513d00c 100644 --- a/src/lib/types/externals.d.ts +++ b/src/lib/types/externals.d.ts @@ -1,5 +1,32 @@ declare module "@metamask/jazzicon"; -declare module "pretty"; - declare module "*.ttf"; + +declare module "*.svg?react" { + import React from "react"; + const ReactComponent: React.FunctionComponent>; + export default ReactComponent; +} + +declare module "*.svg?url" { + const content: string; + export default content; +} + +declare module "*.png?inline" { + const content: string; + export default content; +} + +declare module "*.svg" { + const content: string; + export default content; +} + +interface ImportMetaEnv { + readonly [key: string]: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/src/lib/types/global.d.ts b/src/lib/types/global.d.ts new file mode 100644 index 000000000..4f9f7a816 --- /dev/null +++ b/src/lib/types/global.d.ts @@ -0,0 +1,7 @@ +declare global { + namespace dayjs { + type Dayjs = import("dayjs").Dayjs; + } +} + +export {}; // This makes it a module diff --git a/src/lib/types/yup.d.ts b/src/lib/types/yup.d.ts index c539bab64..6e105bd03 100644 --- a/src/lib/types/yup.d.ts +++ b/src/lib/types/yup.d.ts @@ -1,6 +1,7 @@ -import type { Dayjs } from "dayjs"; -import * as yup from "yup"; -import { MixedSchema as OriginalMixedSchema } from "yup/lib/mixed"; +import "yup"; +// import type { Dayjs } from "dayjs"; +// import * as yup from "yup"; +// import { MixedSchema as OriginalMixedSchema } from "yup/lib/mixed"; declare module "yup" { interface StringSchema< TType extends Maybe = string | undefined, @@ -32,6 +33,11 @@ declare module "yup" { AnyObject, TType | undefined >; + function addMethod( + schemaType: any, + name: string, + method: (this: T, ...args: any[]) => any + ): void; } export default yup; diff --git a/src/lib/utils/hooks/offers/__tests_/memo.test.ts b/src/lib/utils/hooks/offers/__tests_/memo.test.ts index b0fc7fa7c..ad9bd9b2a 100644 --- a/src/lib/utils/hooks/offers/__tests_/memo.test.ts +++ b/src/lib/utils/hooks/offers/__tests_/memo.test.ts @@ -1,10 +1,13 @@ /** - * @jest-environment ./jest.custom.env + * @vitest-environment jsdom */ +import { describe, expect, test, vi } from "vitest"; + import { getFirstNOffers } from "../../../../../../e2e-tests/utils/getFirstNOffers"; import { memoMergeAndSortOffers } from "../memo"; -jest.mock("@bosonprotocol/react-kit", () => { +// Convert jest.mock to vi.mock +vi.mock("@bosonprotocol/react-kit", () => { return { validation: { validateMetadata: () => true diff --git a/src/lib/utils/hooks/useUSDPrice.ts b/src/lib/utils/hooks/useUSDPrice.ts index 12251e191..ae9099b71 100644 --- a/src/lib/utils/hooks/useUSDPrice.ts +++ b/src/lib/utils/hooks/useUSDPrice.ts @@ -9,12 +9,12 @@ import { import { Chain, useTokenSpotPriceQuery -} from "graphql/data/__generated__/types-and-hooks"; +} from "graphqlData/__generated__/types-and-hooks"; import { chainIdToBackendName, isGqlSupportedChain, PollingInterval -} from "graphql/data/util"; +} from "graphqlData/util"; import { nativeOnChain } from "lib/constants/tokens"; import { getNativeTokenDBAddress } from "lib/utils/nativeTokens"; import { diff --git a/src/lib/utils/hooks/useUniswapXSwapCallback.ts b/src/lib/utils/hooks/useUniswapXSwapCallback.ts index 129374cf0..a8936cf2f 100644 --- a/src/lib/utils/hooks/useUniswapXSwapCallback.ts +++ b/src/lib/utils/hooks/useUniswapXSwapCallback.ts @@ -25,7 +25,7 @@ const isErrorResponse = ( order: DutchAuctionOrderResponse ): order is DutchAuctionOrderError => res.status < 200 || res.status > 202; -const UNISWAP_API_URL = process.env.REACT_APP_UNISWAP_API_URL; +const UNISWAP_API_URL = import.meta.env.REACT_APP_UNISWAP_API_URL; if (UNISWAP_API_URL === undefined) { throw new Error(`UNISWAP_API_URL must be a defined environment variable`); } diff --git a/src/lib/utils/ipfs.test.ts b/src/lib/utils/ipfs.test.ts index 2ed56c323..24dace039 100644 --- a/src/lib/utils/ipfs.test.ts +++ b/src/lib/utils/ipfs.test.ts @@ -1,94 +1,95 @@ import { CONFIG } from "lib/config"; +import { describe, expect, test, vi } from "vitest"; import { getIpfsGatewayUrl } from "./ipfs"; import { sanitizeUrl } from "./url"; const validIpfsHash = "QmfWPwbPZYFHamPH7oxWo97c5rfHFFYViXJ1tRBowxAFzr"; -jest.mock("lib/config", () => ({ +vi.mock("lib/config", () => ({ CONFIG: { ipfsGateway: "https://ipfs.io/ipfs" } })); describe("getIpfsGatewayUrl", () => { - it('should return the same URI when it starts with "https://lens.infura-ipfs.io/ipfs/"', () => { + test('should return the same URI when it starts with "https://lens.infura-ipfs.io/ipfs/"', () => { const uri = `https://lens.infura-ipfs.io/ipfs/${validIpfsHash}`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(uri); }); - it("should return a valid IPFS gateway URL when the input is a valid CID with additional path segments", () => { + test("should return a valid IPFS gateway URL when the input is a valid CID with additional path segments", () => { const uri = `ipfs://${validIpfsHash}/path/to/file.png`; const expected = `https://ipfs.io/ipfs/${validIpfsHash}/path/to/file.png`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(expected); }); - it("should return the same URI when it is falsy", () => { + test("should return the same URI when it is falsy", () => { const uri = ""; const result = getIpfsGatewayUrl(uri); expect(result).toBe(uri); }); - it("should return a valid IPFS gateway URL when the input is a valid IPFS URL", () => { + test("should return a valid IPFS gateway URL when the input is a valid IPFS URL", () => { const uri = `ipfs://${validIpfsHash}`; const expected = `${CONFIG.ipfsGateway}/${validIpfsHash}`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(expected); }); - it("should return a valid IPFS gateway URL when the input is a valid IPFS URL with query parameters", () => { + test("should return a valid IPFS gateway URL when the input is a valid IPFS URL with query parameters", () => { const uri = `ipfs://${validIpfsHash}?param1=value1¶m2=value2`; const expected = `https://ipfs.io/ipfs/${validIpfsHash}?param1=value1¶m2=value2`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(expected); }); - it("should return a sanitized URL when the input is not a valid CID or IPFS URL", () => { + test("should return a sanitized URL when the input is not a valid CID or IPFS URL", () => { const uri = "https://example.com/image.png"; const result = getIpfsGatewayUrl(uri); expect(result).toBe(sanitizeUrl(uri)); }); - it("should return a valid IPFS gateway URL when the input is a valid IPFS URL with additional path segments", () => { + test("should return a valid IPFS gateway URL when the input is a valid IPFS URL with additional path segments", () => { const uri = `ipfs://${validIpfsHash}/asdf.png?asd=1`; const expected = `${CONFIG.ipfsGateway}/${validIpfsHash}/asdf.png?asd=1`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(expected); }); - it("should return a sanitized URL when the input is not a valid CID or IPFS URL with additional path segments", () => { + test("should return a sanitized URL when the input is not a valid CID or IPFS URL with additional path segments", () => { const uri = "https://example.com/image.jpg?size=large"; const result = getIpfsGatewayUrl(uri); expect(result).toBe(sanitizeUrl(uri)); }); - it("should return a valid IPFS gateway URL when the input is a valid IPFS URL with additional path segments and query parameters", () => { + test("should return a valid IPFS gateway URL when the input is a valid IPFS URL with additional path segments and query parameters", () => { const uri = `ipfs://${validIpfsHash}/asdf.png?param=1`; const expected = `https://ipfs.io/ipfs/${validIpfsHash}/asdf.png?param=1`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(expected); }); - it("should return a sanitized URL when given an invalid CID input", () => { + test("should return a sanitized URL when given an invalid CID input", () => { const uri = "invalidCID"; const result = getIpfsGatewayUrl(uri); expect(result).toBe(sanitizeUrl(uri)); }); - it("should return the same URI if it's a valid ipfs.io url with path segments and query parameters", () => { + test("should return the same URI if it's a valid ipfs.io url with path segments and query parameters", () => { const uri = `https://ipfs.io/ipfs/${validIpfsHash}/nft.png?img-format=auto`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(uri); }); - it("should return a sanitized URL when the input URI contains query parameters", () => { + test("should return a sanitized URL when the input URI contains query parameters", () => { const uri = `ipfs://${validIpfsHash}/asdf.png?param1=value1¶m2=value2`; const expected = `https://ipfs.io/ipfs/${validIpfsHash}/asdf.png?param1=value1¶m2=value2`; const result = getIpfsGatewayUrl(uri); expect(result).toBe(expected); }); - it("should return a sanitized URL when the input URI is just the cid", () => { + test("should return a sanitized URL when the input URI is just the cid", () => { const cid = "QmSeuDdMZqHxTqvraUKzKKJn9Vo9RELsA8xJUbDn6BGc6d"; const expected = `https://ipfs.io/ipfs/${cid}`; const result = getIpfsGatewayUrl(cid); diff --git a/src/lib/utils/nativeTokens.ts b/src/lib/utils/nativeTokens.ts index 45a78995c..0d7ba976e 100644 --- a/src/lib/utils/nativeTokens.ts +++ b/src/lib/utils/nativeTokens.ts @@ -1,5 +1,5 @@ -import { Chain } from "../../graphql/data/__generated__/types-and-hooks"; -import { supportedChainIdFromGQLChain } from "../../graphql/data/util"; +import { Chain } from "../../graphqlData/__generated__/types-and-hooks"; +import { supportedChainIdFromGQLChain } from "../../graphqlData/util"; import { nativeOnChain } from "../constants/tokens"; export function getNativeTokenDBAddress(chain: Chain): string | undefined { diff --git a/src/lib/utils/splitHiddenTokens.tsx b/src/lib/utils/splitHiddenTokens.tsx index 5cd17a77c..b3ef56875 100644 --- a/src/lib/utils/splitHiddenTokens.tsx +++ b/src/lib/utils/splitHiddenTokens.tsx @@ -1,4 +1,4 @@ -import { TokenBalance } from "graphql/data/__generated__/types-and-hooks"; +import { TokenBalance } from "graphqlData/__generated__/types-and-hooks"; const HIDE_SMALL_USD_BALANCES_THRESHOLD = 1; diff --git a/src/pages/dcl/steps/details/DetailsStep.tsx b/src/pages/dcl/steps/details/DetailsStep.tsx index 8b47554aa..7aa269e72 100644 --- a/src/pages/dcl/steps/details/DetailsStep.tsx +++ b/src/pages/dcl/steps/details/DetailsStep.tsx @@ -3,8 +3,8 @@ import React from "react"; import { Error, FormField } from "../../../../components/form"; import Help from "../../../../components/product/Help"; -import oneItemTypeProduct from "../../../../components/product/img/one-item-product.png"; -import phygitalProduct from "../../../../components/product/img/phygital-product.png"; +import oneItemTypeProduct from "../../../../components/product/img/one-item-product.png?inline"; +import phygitalProduct from "../../../../components/product/img/phygital-product.png?inline"; import { Label, ProductImage, diff --git a/src/state/transactions/hooks.tsx b/src/state/transactions/hooks.tsx index f8031959c..6e8e2243e 100644 --- a/src/state/transactions/hooks.tsx +++ b/src/state/transactions/hooks.tsx @@ -1,7 +1,7 @@ import { BigNumber } from "@ethersproject/bignumber"; import type { TransactionResponse } from "@ethersproject/providers"; import { ChainId, SUPPORTED_CHAINS, Token } from "@uniswap/sdk-core"; -import { TransactionStatus } from "graphql/data/__generated__/types-and-hooks"; +import { TransactionStatus } from "graphqlData/__generated__/types-and-hooks"; import { useAccount, useChainId } from "lib/utils/hooks/connection/connection"; import { SwapResult } from "lib/utils/hooks/useSwapCallback"; import { useCallback, useMemo } from "react"; diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 000000000..8558775d2 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,67 @@ +import react from "@vitejs/plugin-react"; +import path from "path"; +import { defineConfig } from "vite"; +import { nodePolyfills } from "vite-plugin-node-polyfills"; +import svgr from "vite-plugin-svgr"; + +export default defineConfig({ + plugins: [ + react(), + svgr({ + svgrOptions: { + exportType: "default" + }, + // Only transform SVGs when explicitly requested with ?react + include: "**/*.svg?react" + }), + nodePolyfills({ + globals: { + process: false + } + }) + ], + envPrefix: "REACT_APP_", + define: { + global: "globalThis", + "process.env": {} + }, + build: { + outDir: "build", // CRA's default build output + commonjsOptions: { + include: [/uniswap/, /ethers/, /node_modules/] + } + }, + optimizeDeps: { + include: [ + "@uniswap/uniswapx-sdk", + "@uniswap/permit2-sdk", + "@uniswap/sdk-core", + "ethers" + ] + }, + resolve: { + alias: { + // '@': path.resolve(__dirname, './src'), + lib: path.resolve(__dirname, "./src/lib"), + components: path.resolve(__dirname, "./src/components"), + state: path.resolve(__dirname, "./src/state"), + assets: path.resolve(__dirname, "./src/assets"), + abis: path.resolve(__dirname, "./src/abis"), + theme: path.resolve(__dirname, "./src/theme"), + pages: path.resolve(__dirname, "./src/pages"), + queryClient: path.resolve(__dirname, "./src/queryClient"), + graphqlData: path.resolve(__dirname, "./src/graphqlData"), + router: path.resolve(__dirname, "./src/router"), + // 'components': path.resolve(__dirname, './src/components'), + // 'utils': path.resolve(__dirname, './src/utils'), + "@uniswap/uniswapx-sdk": "@uniswap/uniswapx-sdk/dist/src/index.js", + buffer: "buffer" + }, + extensions: [".js", ".jsx", ".ts", ".tsx", ".json", ".css", ".scss"] + }, + test: { + globals: true, + environment: "jsdom" + // setupFiles: "./src/setupTests.js" + } +});