From d69dc4dfe1a08b0697d6d70fa1d92ee5313b987b Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 12:57:20 -0500 Subject: [PATCH 1/9] save to localstorage on create account --- src/scenes/Account/AccountCreate.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scenes/Account/AccountCreate.tsx b/src/scenes/Account/AccountCreate.tsx index 275be8a..0ec7a3a 100644 --- a/src/scenes/Account/AccountCreate.tsx +++ b/src/scenes/Account/AccountCreate.tsx @@ -62,6 +62,10 @@ function AccountCreate() { // Update the account state with the newly created account setAccount(result.account); + + if (localStorage.getItem(recoveryPhraseKeyName) !== result.seedPhrase) { + localStorage.setItem(recoveryPhraseKeyName, result.seedPhrase); + } } return ( From 44eccaa5f9738cd212fba8eec726846a9d493ca1 Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 12:58:19 -0500 Subject: [PATCH 2/9] remove Index when creating a new account to keep it simple we will only use the first wallet generated from a seed phrase --- src/utils/AccountUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/AccountUtils.ts b/src/utils/AccountUtils.ts index 3c49f00..8b19cef 100644 --- a/src/utils/AccountUtils.ts +++ b/src/utils/AccountUtils.ts @@ -1,7 +1,7 @@ import { Wallet } from 'ethers'; import { Account } from '../models/Account'; -export function generateAccount(seedPhrase: string = "", index: number = 0): +export function generateAccount(seedPhrase: string = ""): { account: Account, seedPhrase: string } { let wallet: Wallet; @@ -11,7 +11,7 @@ export function generateAccount(seedPhrase: string = "", index: number = 0): } // If the seed phrase does not contain spaces, it is likely a mnemonic - wallet = (seedPhrase.includes(" ")) ? Wallet.fromMnemonic(seedPhrase, `m/44'/60'/0'/0/${index}`) : + wallet = (seedPhrase.includes(" ")) ? Wallet.fromMnemonic(seedPhrase) : new Wallet(seedPhrase); const { address } = wallet; From cc4c3f01463e5e473efd80fd8334fb38d43d2a11 Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 13:36:17 -0500 Subject: [PATCH 3/9] use tabs for account detail page see: https://getbootstrap.com/docs/5.0/components/navs-tabs/#javascript-behavior --- src/components/BuySellCrypto.tsx | 9 +++++++++ src/scenes/Account/AccountDetail.tsx | 24 ++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/components/BuySellCrypto.tsx diff --git a/src/components/BuySellCrypto.tsx b/src/components/BuySellCrypto.tsx new file mode 100644 index 0000000..3b52b87 --- /dev/null +++ b/src/components/BuySellCrypto.tsx @@ -0,0 +1,9 @@ +import React from 'react' + +function BuySellCrypto() { + return ( +
BuySellCrypto
+ ) +} + +export default BuySellCrypto \ No newline at end of file diff --git a/src/scenes/Account/AccountDetail.tsx b/src/scenes/Account/AccountDetail.tsx index 7c374d4..b56f2d0 100644 --- a/src/scenes/Account/AccountDetail.tsx +++ b/src/scenes/Account/AccountDetail.tsx @@ -6,6 +6,7 @@ import AccountTransactions from './AccountTransactions'; import { ethers } from 'ethers'; import { toFixedIfNecessary } from '../../utils/AccountUtils'; import './Account.css'; +import BuySellCrypto from '../../components/BuySellCrypto'; interface AccountDetailProps { account: Account @@ -123,8 +124,27 @@ const AccountDetail: React.FC = ({account}) => { {networkResponse.status === 'error' &&

Error occurred while transferring tokens: {networkResponse.message}

} } - - +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+ +
+
...
+
+ +
+
+ ) From f59cfb3ccebb8dcaa7927ca330774704edf6b92b Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 14:07:42 -0500 Subject: [PATCH 4/9] moved SendCrypto into separate component using chatgpt --- src/components/SendCrypto.tsx | 109 +++++++++++++++++++ src/scenes/Account/AccountDetail.tsx | 116 +++------------------ src/scenes/Account/AccountTransactions.tsx | 2 - 3 files changed, 121 insertions(+), 106 deletions(-) create mode 100644 src/components/SendCrypto.tsx diff --git a/src/components/SendCrypto.tsx b/src/components/SendCrypto.tsx new file mode 100644 index 0000000..0a7125e --- /dev/null +++ b/src/components/SendCrypto.tsx @@ -0,0 +1,109 @@ +import React, { useState } from 'react'; +import { Account } from '../models/Account'; +import { goerli } from '../models/Chain'; +import { sendToken } from '../utils/TransactionUtils'; + +interface SendCryptoProps { + account: Account +} + +function SendCrypto({account}: SendCryptoProps) { + const [destinationAddress, setDestinationAddress] = useState(''); + const [amount, setAmount] = useState(0); + + const [networkResponse, setNetworkResponse] = useState<{ status: null | 'pending' | 'complete' | 'error', message: string | React.ReactElement }>({ + status: null, + message: '', + }); + + function handleDestinationAddressChange(event: React.ChangeEvent) { + setDestinationAddress(event.target.value); + } + + function handleAmountChange(event: React.ChangeEvent) { + setAmount(Number.parseFloat(event.target.value)); + } + + async function transfer() { + // Set the network response status to "pending" + setNetworkResponse({ + status: 'pending', + message: '', + }); + + try { + const { receipt } = await sendToken(amount, account.address, destinationAddress, account.privateKey); + + if (receipt.status === 1) { + // Set the network response status to "complete" and the message to the transaction hash + setNetworkResponse({ + status: 'complete', + message:

Transfer complete! + View transaction +

, + }); + return receipt; + } else { + // Transaction failed + console.log(`Failed to send ${receipt}`); + // Set the network response status to "error" and the message to the receipt + setNetworkResponse({ + status: 'error', + message: JSON.stringify(receipt), + }); + return { receipt }; + } + } catch (error: any) { + // An error occurred while sending the transaction + console.error({ error }); + // Set the network response status to "error" and the message to the error + setNetworkResponse({ + status: 'error', + message: error.reason || JSON.stringify(error), + }); + } + } + + return ( +
+
+ + +
+ +
+ + +
+ + + + {networkResponse.status && + <> + {networkResponse.status === 'pending' &&

Transfer is pending...

} + {networkResponse.status === 'complete' &&

{networkResponse.message}

} + {networkResponse.status === 'error' &&

Error occurred while transferring tokens: {networkResponse.message}

} + + } +
+ ) +} + +export default SendCrypto; diff --git a/src/scenes/Account/AccountDetail.tsx b/src/scenes/Account/AccountDetail.tsx index b56f2d0..f5bb074 100644 --- a/src/scenes/Account/AccountDetail.tsx +++ b/src/scenes/Account/AccountDetail.tsx @@ -1,27 +1,20 @@ -import React, {useEffect, useState} from 'react'; -import { sendToken } from '../../utils/TransactionUtils'; -import { goerli } from '../../models/Chain'; -import { Account } from '../../models/Account'; -import AccountTransactions from './AccountTransactions'; +import { useState, useEffect } from 'react'; import { ethers } from 'ethers'; +import BuySellCrypto from '../../components/BuySellCrypto'; +import SendCrypto from '../../components/SendCrypto'; +import { Account } from '../../models/Account'; +import { goerli } from '../../models/Chain'; import { toFixedIfNecessary } from '../../utils/AccountUtils'; import './Account.css'; -import BuySellCrypto from '../../components/BuySellCrypto'; +import AccountTransactions from './AccountTransactions'; interface AccountDetailProps { account: Account } -const AccountDetail: React.FC = ({account}) => { - const [destinationAddress, setDestinationAddress] = useState(''); - const [amount, setAmount] = useState(0); +function AccountDetail({account}: AccountDetailProps) { const [balance, setBalance] = useState(account.balance) - const [networkResponse, setNetworkResponse] = useState<{ status: null | 'pending' | 'complete' | 'error', message: string | React.ReactElement }>({ - status: null, - message: '', - }); - useEffect(() => { const fetchData = async () => { const provider = new ethers.providers.JsonRpcProvider(goerli.rpcUrl); @@ -31,54 +24,6 @@ const AccountDetail: React.FC = ({account}) => { fetchData(); }, [account.address]) - function handleDestinationAddressChange(event: React.ChangeEvent) { - setDestinationAddress(event.target.value); - } - - function handleAmountChange(event: React.ChangeEvent) { - setAmount(Number.parseFloat(event.target.value)); - } - - async function transfer() { - // Set the network response status to "pending" - setNetworkResponse({ - status: 'pending', - message: '', - }); - - try { - const { receipt } = await sendToken(amount, account.address, destinationAddress, account.privateKey); - - if (receipt.status === 1) { - // Set the network response status to "complete" and the message to the transaction hash - setNetworkResponse({ - status: 'complete', - message:

Transfer complete! - View transaction -

, - }); - return receipt; - } else { - // Transaction failed - console.log(`Failed to send ${receipt}`); - // Set the network response status to "error" and the message to the receipt - setNetworkResponse({ - status: 'error', - message: JSON.stringify(receipt), - }); - return { receipt }; - } - } catch (error: any) { - // An error occurred while sending the transaction - console.error({ error }); - // Set the network response status to "error" and the message to the error - setNetworkResponse({ - status: 'error', - message: error.reason || JSON.stringify(error), - }); - } - } - return (

@@ -87,44 +32,7 @@ const AccountDetail: React.FC = ({account}) => {
Balance: {balance} ETH

- -
- - -
- -
- - -
- - - - {networkResponse.status && - <> - {networkResponse.status === 'pending' &&

Transfer is pending...

} - {networkResponse.status === 'complete' &&

{networkResponse.message}

} - {networkResponse.status === 'error' &&

Error occurred while transferring tokens: {networkResponse.message}

} - - } -
    +
    • @@ -139,15 +47,15 @@ const AccountDetail: React.FC = ({account}) => {
      -
      ...
      +
      + +
- - ) } -export default AccountDetail; \ No newline at end of file +export default AccountDetail; diff --git a/src/scenes/Account/AccountTransactions.tsx b/src/scenes/Account/AccountTransactions.tsx index 04e3171..4a87aaa 100644 --- a/src/scenes/Account/AccountTransactions.tsx +++ b/src/scenes/Account/AccountTransactions.tsx @@ -48,8 +48,6 @@ const AccountTransactions: React.FC = ({ account }) => return (
- -

Transactions

{networkResponse.status === "complete" && transactions.length === 0 && (

No transactions found for this address

From ed3203ca1e97ea8d256120891d2357197593a436 Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 14:17:00 -0500 Subject: [PATCH 5/9] refactor tabs to be a list use a function for tab.component() so that props gets updated on each rerender --- src/scenes/Account/AccountDetail.tsx | 75 ++++++++++++++++++---------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/src/scenes/Account/AccountDetail.tsx b/src/scenes/Account/AccountDetail.tsx index f5bb074..f15a619 100644 --- a/src/scenes/Account/AccountDetail.tsx +++ b/src/scenes/Account/AccountDetail.tsx @@ -1,5 +1,5 @@ -import { useState, useEffect } from 'react'; import { ethers } from 'ethers'; +import { useState, useEffect } from 'react'; import BuySellCrypto from '../../components/BuySellCrypto'; import SendCrypto from '../../components/SendCrypto'; import { Account } from '../../models/Account'; @@ -22,37 +22,62 @@ function AccountDetail({account}: AccountDetailProps) { setBalance((String(toFixedIfNecessary(ethers.utils.formatEther(accountBalance))))); } fetchData(); -}, [account.address]) + }, [account.address]) + + const tabs = [ + { + id: 'transactions', + label: 'Transactions', + component: ({account}: {account: Account}) => , + }, + { + id: 'send', + label: 'Send', + component: ({account}: {account: Account}) => , + }, + { + id: 'buy-sell', + label: 'Buy/Sell', + component: ({account}: {account: Account}) => , + } + ]; + + const [activeTab, setActiveTab] = useState(tabs[0]); return (
-

+

Address: {account.address}
Balance: {balance} ETH -

-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
-
-
- -
-
- -
-
- -
+

+
    + {tabs.map(tab => ( +
  • + +
  • + ))} +
+
+
+ { + activeTab.component({account}) + }
) From 43f7f54af62df2d16614664127e1da2f5b941e91 Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 15:20:10 -0500 Subject: [PATCH 6/9] add transak sdk see: https://gist.github.com/ademidun/5fe733f71165163a6a8dddf8f85a045d and https://github.com/Transak/transak-sdk/issues/7#issuecomment-1356863538 --- package.json | 1 + src/@types/transak-sdk.d.ts | 44 +++++ src/components/BuySellCrypto.tsx | 52 +++++- src/utils/Environment.ts | 11 ++ yarn.lock | 279 ++++++++++++++++++++++++++++++- 5 files changed, 373 insertions(+), 14 deletions(-) create mode 100644 src/@types/transak-sdk.d.ts create mode 100644 src/utils/Environment.ts diff --git a/package.json b/package.json index 2179e0b..4b7ef39 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "@transak/transak-sdk": "^1.2.3", "@types/jest": "^27.5.2", "@types/node": "^16.18.7", "@types/react": "^18.0.26", diff --git a/src/@types/transak-sdk.d.ts b/src/@types/transak-sdk.d.ts new file mode 100644 index 0000000..cabcc96 --- /dev/null +++ b/src/@types/transak-sdk.d.ts @@ -0,0 +1,44 @@ +declare module '@transak/transak-sdk' { + export enum Foo { + STAGING = "STAGING", + PRODUCTION = "PRODUCTION" + } + export interface Settings { + apiKey: string; + environment: string; // tried to set this to be -> environment: 'STAGING' | 'PRODUCTION', but it gave error: 'string is not assignable to type 'STAGING' | 'PRODUCTION'' + defaultCryptoCurrency: string; + themeColor: string; + hostURL: string; + widgetHeight: string; + widgetWidth: string; + } + + export interface EventData { + [key: string]: any; + } + + export interface OrderData { + [key: string]: any; + } + + export default class Transak { + public readonly ALL_EVENTS = 'ALL_EVENTS'; + public readonly ERROR = 'TRANSAK_ERROR'; + public readonly EVENTS: { + TRANSAK_ORDER_CANCELLED: "TRANSAK_ORDER_CANCELLED" + TRANSAK_ORDER_CREATED: "TRANSAK_ORDER_CREATED" + TRANSAK_ORDER_FAILED: "TRANSAK_ORDER_FAILED" + TRANSAK_ORDER_SUCCESSFUL: "TRANSAK_ORDER_SUCCESSFUL" + TRANSAK_WIDGET_CLOSE: "TRANSAK_WIDGET_CLOSE" + TRANSAK_WIDGET_CLOSE_REQUEST: "TRANSAK_WIDGET_CLOSE_REQUEST" + TRANSAK_WIDGET_INITIALISED: "TRANSAK_WIDGET_INITIALISED" + TRANSAK_WIDGET_OPEN: "TRANSAK_WIDGET_OPEN" + }; + + constructor(settings: Settings); + + public init(): void; + public on(event: string, callback: (data: EventData) => void): void; + public close(): void; + } +} diff --git a/src/components/BuySellCrypto.tsx b/src/components/BuySellCrypto.tsx index 3b52b87..08eb1b3 100644 --- a/src/components/BuySellCrypto.tsx +++ b/src/components/BuySellCrypto.tsx @@ -1,9 +1,51 @@ -import React from 'react' +import React from 'react'; +import transakSDK from "@transak/transak-sdk"; + +const settings = { + apiKey: '', // Your API Key + environment: "STAGING", // STAGING/PRODUCTION + defaultCryptoCurrency: 'ETH', + themeColor: '000000', // App theme color + hostURL: window.location.origin, + widgetHeight: "700px", + widgetWidth: "500px", +} + function BuySellCrypto() { - return ( -
BuySellCrypto
- ) + + function openTransak() { + const transak = new transakSDK(settings); + + transak.init(); + + console.log({transakSDK, transak}) + + // To get all the events + transak.on(transak.ALL_EVENTS, (data: any) => { + console.log(data) + }); + + // This will trigger when the user closed the widget + transak.on(transak.EVENTS.TRANSAK_WIDGET_CLOSE, (eventData: any) => { + console.log(eventData); + transak.close(); + }); + + // This will trigger when the user marks payment is made. + transak.on(transak.EVENTS.TRANSAK_ORDER_SUCCESSFUL, (orderData: any) => { + console.log(orderData); + window.alert("Payment Success") + transak.close(); + }); + } + return ( +
+ +
+ ); } -export default BuySellCrypto \ No newline at end of file +export default BuySellCrypto; \ No newline at end of file diff --git a/src/utils/Environment.ts b/src/utils/Environment.ts new file mode 100644 index 0000000..aef3f88 --- /dev/null +++ b/src/utils/Environment.ts @@ -0,0 +1,11 @@ +const development = { + infuraAPIKey: '', + transakAPIKey: '', +}; + + const production = { + ...development, + transakAPIKey: '', +}; + + export default process.env.NODE_ENV === 'production' ? production : development; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index caaa2b8..9f1b196 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2138,6 +2138,15 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@transak/transak-sdk@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@transak/transak-sdk/-/transak-sdk-1.2.3.tgz#e678cb4d32d55df9c0e5ea8f333e2a1d3664c067" + integrity sha512-nmpMB6zUwVO/2VlTQIrlDawUbMVTGoio4IiwHxCbNRiFGzxxXwymXNqlspxCszWtznUHFHWtEMomRAdW05MAkw== + dependencies: + events "^3.1.0" + query-string "^6.12.1" + request "^2.88.2" + "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" @@ -2793,7 +2802,7 @@ ajv-keywords@^5.0.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -2967,6 +2976,18 @@ asap@~2.0.6: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + ast-types-flow@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" @@ -3004,6 +3025,16 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" + integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== + axe-core@^4.4.3: version "4.5.2" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.5.2.tgz#823fdf491ff717ac3c58a52631d4206930c1d9f7" @@ -3169,6 +3200,13 @@ batch@0.6.1: resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + bech32@1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" @@ -3367,6 +3405,11 @@ case-sensitive-paths-webpack-plugin@^2.4.0: resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4" integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw== +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + chalk@^2.0.0, chalk@^2.4.1: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -3506,7 +3549,7 @@ colorette@^2.0.10: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== -combined-stream@^1.0.8: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3622,6 +3665,11 @@ core-js@^3.19.2: resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.1.tgz#7a9816dabd9ee846c1c0fe0e8fcad68f3709134e" integrity sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA== +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -3863,6 +3911,13 @@ damerau-levenshtein@^1.0.8: resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + data-urls@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" @@ -3898,6 +3953,11 @@ decimal.js@^10.2.1: resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== +decode-uri-component@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -4152,6 +4212,14 @@ duplexer@^0.1.2: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -4651,7 +4719,7 @@ eventemitter3@^4.0.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.2.0: +events@^3.1.0, events@^3.2.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -4734,6 +4802,21 @@ express@^4.17.3: utils-merge "1.0.1" vary "~1.1.2" +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -4815,6 +4898,11 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +filter-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" + integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== + finalhandler@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" @@ -4885,6 +4973,11 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + fork-ts-checker-webpack-plugin@^6.5.0: version "6.5.2" resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.5.2.tgz#4f67183f2f9eb8ba7df7177ce3cf3e75cdafb340" @@ -4922,6 +5015,15 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -5033,6 +5135,13 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -5133,6 +5242,19 @@ handle-thing@^2.0.0: resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + harmony-reflect@^1.4.6: version "1.6.2" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.2.tgz#31ecbd32e648a34d030d86adb67d4d47547fe710" @@ -5327,6 +5449,15 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -5637,7 +5768,7 @@ is-typed-array@^1.1.10: gopd "^1.0.1" has-tostringtag "^1.0.0" -is-typedarray@^1.0.0: +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== @@ -5684,6 +5815,11 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" @@ -6300,6 +6436,11 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + jsdom@^16.6.0: version "16.7.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710" @@ -6358,7 +6499,7 @@ json-schema-traverse@^1.0.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@^0.4.0: +json-schema@0.4.0, json-schema@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== @@ -6368,6 +6509,11 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -6394,6 +6540,16 @@ jsonpointer@^5.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.2: version "3.3.3" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" @@ -6633,7 +6789,7 @@ mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -6810,6 +6966,11 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.2.tgz#e5418863e7905df67d51ec95938d67bf801f0bb0" integrity sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw== +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -7772,7 +7933,7 @@ proxy-from-env@^1.1.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -psl@^1.1.33: +psl@^1.1.28, psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== @@ -7794,6 +7955,21 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + +query-string@^6.12.1: + version "6.14.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" + integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== + dependencies: + decode-uri-component "^0.2.0" + filter-obj "^1.1.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -8109,6 +8285,32 @@ renderkid@^3.0.0: lodash "^4.17.21" strip-ansi "^6.0.1" +request@^2.88.2: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -8221,7 +8423,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -8235,7 +8437,7 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -8531,11 +8733,31 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== +sshpk@^1.7.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + stable@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" @@ -8563,6 +8785,11 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== + string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -8922,6 +9149,14 @@ tough-cookie@^4.0.0: universalify "^0.2.0" url-parse "^1.5.3" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -8968,6 +9203,18 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -9135,6 +9382,11 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -9154,6 +9406,15 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" From 6771fdad8a6ffb923ccbc3bec34767e559e5325a Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 16:03:53 -0500 Subject: [PATCH 7/9] add transak api key with environment variables --- .env.example | 1 + .gitignore | 3 ++- README.md | 6 ++++++ src/components/BuySellCrypto.tsx | 24 ++++++++++++------------ src/utils/Environment.ts | 19 ++++++++++++------- 5 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..43bf927 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +REACT_APP_TRANSAK_API_KEY='' # Transak API Key for allowing users to buy and sell crypto. https://docs.transak.com/docs/setup-your-partner-account#get-api-key \ No newline at end of file diff --git a/.gitignore b/.gitignore index 398be36..735286f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -build.zip \ No newline at end of file +build.zip +.env \ No newline at end of file diff --git a/README.md b/README.md index e3a39de..61fdc7d 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,9 @@ yarn start 1. Zip `build/` folder: `zip -r build.zip build` 1. Upload package in Chrome web store developer dashboard 1. Follow instructions on page to submit for review + +## Environment Variables + +If you want to use additional features like buying crypto. Check the `.env.example file` + +`cp .env.example .env` \ No newline at end of file diff --git a/src/components/BuySellCrypto.tsx b/src/components/BuySellCrypto.tsx index 08eb1b3..6899603 100644 --- a/src/components/BuySellCrypto.tsx +++ b/src/components/BuySellCrypto.tsx @@ -1,25 +1,25 @@ import React from 'react'; import transakSDK from "@transak/transak-sdk"; - -const settings = { - apiKey: '', // Your API Key - environment: "STAGING", // STAGING/PRODUCTION - defaultCryptoCurrency: 'ETH', - themeColor: '000000', // App theme color - hostURL: window.location.origin, - widgetHeight: "700px", - widgetWidth: "500px", -} - +import { Environment } from '../utils/Environment'; function BuySellCrypto() { + const settings = { + apiKey: Environment.TRANSAK_API_KEY, // Your API Key + environment: "STAGING", // STAGING/PRODUCTION + defaultCryptoCurrency: 'ETH', + themeColor: '000000', // App theme color + hostURL: window.location.origin, + widgetHeight: "700px", + widgetWidth: "500px", + } + function openTransak() { const transak = new transakSDK(settings); transak.init(); - console.log({transakSDK, transak}) + console.log({transakSDK, transak, settings, Environment}) // To get all the events transak.on(transak.ALL_EVENTS, (data: any) => { diff --git a/src/utils/Environment.ts b/src/utils/Environment.ts index aef3f88..92cd2bc 100644 --- a/src/utils/Environment.ts +++ b/src/utils/Environment.ts @@ -1,11 +1,16 @@ +const common = { + INFURA_API_KEY: '', + TRANSAK_API_KEY: process.env.REACT_APP_TRANSAK_API_KEY || '', +}; + const development = { - infuraAPIKey: '', - transakAPIKey: '', + ...common, + HOST_URL: 'http://localhost:3000', }; - - const production = { - ...development, - transakAPIKey: '', + +const production = { + ...common, + HOST_URL: 'https://wallet.atila.ca', }; - export default process.env.NODE_ENV === 'production' ? production : development; \ No newline at end of file + export const Environment = process.env.NODE_ENV === 'production' ? production : development; \ No newline at end of file From db47c5a30ea86c170450b5b040653bbcf2d2bd3b Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 16:05:18 -0500 Subject: [PATCH 8/9] remove _redirects file when building extension, then add it back after project is built Cannot load extension with file or directory name _redirects. Filenames starting with "_" are reserved for use by the system. Could not load manifest. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b7ef39..34a9a28 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "build:extension": "craco build", + "build:extension": "rm _redirects && craco build && touch redirects && echo '/* /index.html 200' > _redirects", "test": "react-scripts test", "eject": "react-scripts eject" }, From b3cd0ebf551564f4d3c30299e477589b82f69240 Mon Sep 17 00:00:00 2001 From: ademidun Date: Sun, 18 Dec 2022 16:14:17 -0500 Subject: [PATCH 9/9] remove _redirects file from build folder when building as extension add css style so that full widget is viewable as browser extension Chrome extension doesn't like build folders. Cannot load extension with file or directory name _redirects. Filenames starting with "_" are reserved for use by the system. Could not load manifest. --- package.json | 2 +- src/App.css | 4 ++++ src/components/BuySellCrypto.tsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 34a9a28..88d7996 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "build:extension": "rm _redirects && craco build && touch redirects && echo '/* /index.html 200' > _redirects", + "build:extension": "react-scripts build && rm build/_redirects", "test": "react-scripts test", "eject": "react-scripts eject" }, diff --git a/src/App.css b/src/App.css index 201cd36..1cadedb 100644 --- a/src/App.css +++ b/src/App.css @@ -1,9 +1,13 @@ .App { text-align: center; width: 575px; + height: 584px; max-width: 100%; } +#transakFiatOnOffRamp { + zoom: 0.8; +} input.form-control { margin-top: 5px; diff --git a/src/components/BuySellCrypto.tsx b/src/components/BuySellCrypto.tsx index 6899603..3c8e297 100644 --- a/src/components/BuySellCrypto.tsx +++ b/src/components/BuySellCrypto.tsx @@ -42,7 +42,7 @@ function BuySellCrypto() { return (
);