From c319c26543f7670ad2cd9724571f810a8b08289b Mon Sep 17 00:00:00 2001 From: armaniferrante Date: Fri, 30 Apr 2021 19:36:29 -0700 Subject: [PATCH] update --- src/components/SwapWormholeDialog.js | 154 +++++++++++---- src/utils/connection.tsx | 3 +- yarn.lock | 280 ++++++++++++++++----------- 3 files changed, 286 insertions(+), 151 deletions(-) diff --git a/src/components/SwapWormholeDialog.js b/src/components/SwapWormholeDialog.js index 0b420c0..e62ccd0 100644 --- a/src/components/SwapWormholeDialog.js +++ b/src/components/SwapWormholeDialog.js @@ -21,7 +21,6 @@ import { useWallet, useWalletAddressForMint } from '../utils/wallet'; import { swapApiRequest } from '../utils/swap/api'; import { getErc20Decimals } from '../utils/swap/eth.js'; import { useSendTransaction } from '../utils/notifications'; -import { signAndSendTransaction } from '../utils/tokens'; import { createAssociatedTokenAccountIx } from '../utils/tokens'; // TODO: Import these constants from somewhere. @@ -32,12 +31,29 @@ const DEX_PROGRAM_ID = new PublicKey( '9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin', ); const SWAP_PROGRAM_ID = new PublicKey( - '9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin', // todo + '22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD', ); const MARKET_BASE = new PublicKey( 'CAXLccDUeS6egtNNEBLrxAqxSvuL6SwspqYX14JdKaiK', ); +// TODO: remove +const SRM_USDC = new PublicKey( + 'ByRys5tuUWDgL73G8JBAEfkdFf8JWBzPBDHsBVQ5vbQA', +); +// TODO: remove +const USDC_MINT = new PublicKey( + 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', +); +// TODO: remove +const SRM_MINT = new PublicKey( + 'SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt', +); +// TODO: remove +const SRM_TOKEN_ADDR = new PublicKey( + 'DjvAd6u2d6rqqMfzzubBeAhSpsaBd8LvYAJViEf2fV8g', +); + export default function SwapWormholeDialog({ publicKey, onClose, @@ -49,9 +65,10 @@ export default function SwapWormholeDialog({ // // * undefined => loading. // * market.accountInfo === null => no pool exists. - // * pool.accountInfo !== null => pool exists. + // * market.accountInfo !== null => pool exists. const [market, setMarket] = useState(undefined); - const [wormholeMintAddr, setWormholeMintAddr] = useState(null); + const [wormholeMintAddr, setWormholeMintAddr] = useState(null); + const [maxAvailableSwapAmount, setMaxAvailableSwapAmount] = useState(0) const [transferAmountString, setTransferAmountString] = useState(''); const [isLoading, setIsLoading] = useState(false); const wallet = useWallet(); @@ -67,6 +84,12 @@ export default function SwapWormholeDialog({ new Provider(wallet.connection, wallet), ); + // Parses the orderbook to retrieve the max swappable amount available. + const parseOrderbook = async (marketClient) => { + + setMaxAvailableSwapAmount(100); + }; + // Note: there are three "useEffect" closures to be run in order. // Each one triggers the next. @@ -98,6 +121,7 @@ export default function SwapWormholeDialog({ Buffer.from(erc20Contract.slice(2), 'hex'), ); } + _wormholeMintAddr = USDC_MINT; setWormholeMintAddr(_wormholeMintAddr); }; fetch(); @@ -116,25 +140,30 @@ export default function SwapWormholeDialog({ const seed = balanceInfo.mint.toString().slice(0, 16) + wormholeMintAddr.toString().slice(0, 16); - const publicKey = await PublicKey.createWithSeed( + /* + const publicKey = await PublicKey.createWithSeed( MARKET_BASE, seed, SWAP_PROGRAM_ID, ); + */ + const marketAddress = SRM_USDC; try { const account = await Market.load( swapClient.provider.connection, - publicKey, + marketAddress, swapClient.provider.opts, DEX_PROGRAM_ID, ); + await parseOrderbook(account); setMarket({ account, - publicKey, + publicKey: marketAddress, }); } catch (err) { + // Market not found error. setMarket({ - publicKey, + publicKey: marketAddress, account: null, }); } @@ -172,41 +201,37 @@ export default function SwapWormholeDialog({ swapCoinInfo.ticker, ]); - // Estimate the swap amount to display to the user, i.e., the maximum available - // swap given the orderbook state. - useEffect(() => { - const fetch = async () => { - if ( - market && - market.account === null && - market.publicKey && - wormholeMintAddr && - balanceAmount > 0 - ) { - // todo - } - }; - fetch(); - }, [market, balanceAmount, wormholeMintAddr]); - // Converts the sollet wrapped token into the wormhole wrapped token // by trading on swap market. async function convert() { - const swapAmount = parsedAmount * 10 ** balanceInfo.decimals; - const minExpectedAmount = swapAmount * 0.9978; // Subtract out taker fee. + const swapAmount = new BN(parsedAmount * 10 ** balanceInfo.decimals); + // const minExpectedAmount = new BN(swapAmount.toNumber() * 0.99); // Subtract out taker fee. + const minExpectedAmount = new BN(1); // todo: uncomment above const [vaultSigner] = await getVaultOwnerAndNonce( market.account._decoded.ownAddress, ); let [openOrders, needsCreateOpenOrders] = await (async () => { - const openOrders = await OpenOrders.findForOwner( + let openOrders = await OpenOrders.findForOwner( swapClient.provider.connection, wallet.publicKey, DEX_PROGRAM_ID, ); + openOrders.forEach(oo => { + console.log('open orders', oo.address.toString()); + console.log( + 'open orders', + oo.baseTokenFree.toNumber(), + oo.baseTokenTotal.toNumber(), + oo.quoteTokenFree.toNumber(), + oo.quoteTokenTotal.toNumber(), + ); + }); + return [new PublicKey('5ZuiPLwGLFWd9waU5zz7Z4ZicKjf8iCz1zgsKHnf8Cpu'), false]; // If we have an open orderes account use it. It doesn't matter which // one we use. - const addr = openOrders[0] ? openOrders[0].address : undefined; - return [addr, addr !== undefined]; +// const addr = openOrders[0] ? openOrders[0].address : undefined; + // return [addr, addr !== undefined]; + // todo: uncomment above })(); let signers = []; @@ -214,7 +239,8 @@ export default function SwapWormholeDialog({ const tx = new Transaction(); // Create the wormhole associated token account, if needed. - let _wormholeTokenAddr = wormholeTokenAddr; + // let _wormholeTokenAddr = wormholeTokenAddr; + let _wormholeTokenAddr = SRM_TOKEN_ADDR; // TODO: replace with above if (!_wormholeTokenAddr) { const [ix, addr] = await createAssociatedTokenAccountIx( wallet.publicKey, @@ -223,7 +249,9 @@ export default function SwapWormholeDialog({ ); tx.add(ix); _wormholeTokenAddr = addr; - } + } else { + _wormholeTokenAddr = new PublicKey(_wormholeTokenAddr.toString()); + } // Create the open orders account, if needed. if (needsCreateOpenOrders) { @@ -243,7 +271,7 @@ export default function SwapWormholeDialog({ // Execute the swap. tx.add( - swapClient.instruction.swap(Side.Bid, parsedAmount, minExpectedAmount, { + swapClient.instruction.swap(Side.Ask, swapAmount, minExpectedAmount, { accounts: { market: { market: market.account._decoded.ownAddress, @@ -255,7 +283,8 @@ export default function SwapWormholeDialog({ pcVault: market.account._decoded.quoteVault, vaultSigner, openOrders, - orderPayerTokenAccount: publicKey, + // orderPayerTokenAccount: publicKey, + orderPayerTokenAccount: _wormholeTokenAddr, coinWallet: _wormholeTokenAddr, }, pcWallet: publicKey, @@ -268,20 +297,26 @@ export default function SwapWormholeDialog({ ); // Close the open orders account, if needed. - if (needsCreateOpenOrders) { + if (needsCreateOpenOrders) { + // TODO: enable once the dex supports this. + /* tx.add( DexInstructions.closeOpenOrders({ openOrders, owner: swapClient.provider.wallet.publicKey, destination: swapClient.provider.wallet.publicKey, - market, + market: market.account._decoded.ownAddress, programId: DEX_PROGRAM_ID, }), ); + */ } - + console.log('tx', tx); // Send the transaction to the blockchain. - return await swapClient.provider.send(tx, signers); + return await swapClient.provider.send(tx, signers, { + preflightCommitment: false, + commitment: 'recent', + }); } async function onSubmit() { setIsLoading(true); @@ -324,8 +359,49 @@ export default function SwapWormholeDialog({ rel="noreferrer" > - + +
+ {`Estimated max swap amount: ${maxAvailableSwapAmount.toFixed(4)}`} + + + {tokenSymbol ? tokenSymbol : null} + + ), + inputProps: { + step: Math.pow(10, -decimals), + }, + }} + value={transferAmountString} + onChange={(e) => setTransferAmountString(e.target.value.trim())} + helperText={ + + setTransferAmountString( + Math.min(balanceAmountToUserAmount(balanceAmount, decimals), maxAvailableSwapAmount), + ) + } + > + Max: {Math.min(balanceAmountToUserAmount(balanceAmount, decimals), maxAvailableSwapAmount)} + + } + /> )} diff --git a/src/utils/connection.tsx b/src/utils/connection.tsx index b0afbf5..4f4366d 100644 --- a/src/utils/connection.tsx +++ b/src/utils/connection.tsx @@ -17,7 +17,8 @@ const ConnectionContext = React.createContext<{ connection: Connection; } | null>(null); -export const MAINNET_URL = 'https://solana-api.projectserum.com'; +//export const MAINNET_URL = 'https://solana-api.projectserum.com'; +export const MAINNET_URL = 'https://api.mainnet-beta.solana.com'; export function ConnectionProvider({ children }) { const [endpoint, setEndpoint] = useLocalStorageState( 'connectionEndpoint', diff --git a/yarn.lock b/yarn.lock index 6abc00b..b630e5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1254,13 +1254,6 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.5": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d" - integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/runtime@^7.12.5", "@babel/runtime@^7.9.2": version "7.12.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" @@ -1869,7 +1862,38 @@ schema-utils "^2.6.5" source-map "^0.7.3" -"@project-serum/serum@^0.13.21", "@project-serum/serum@^0.13.33": +"@project-serum/anchor@^0.4.4": + version "0.4.5" + resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.4.5.tgz#6c52b5722a3133d5f1df793bfbc1af5c07b0316d" + integrity sha512-LxcV8yZae/sOBPZULDlVGqsIyFkjhmJKi2kx1id9EybECX5QqYQTMS69ozdH2e+5VEDjw0dCfRqBCMJ97ylmmQ== + dependencies: + "@project-serum/borsh" "^0.1.1" + "@solana/web3.js" "^1.2.0" + "@types/bn.js" "^4.11.6" + "@types/bs58" "^4.0.1" + "@types/crypto-hash" "^1.1.2" + "@types/pako" "^1.0.1" + base64-js "^1.5.1" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.0" + camelcase "^5.3.1" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + find "^0.3.0" + js-sha256 "^0.9.0" + pako "^2.0.3" + snake-case "^3.0.4" + +"@project-serum/borsh@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.1.1.tgz#a810aad74e4b458fbd1ab63188f175bee765a8af" + integrity sha512-bzCea8KTyc7CNkcMn0V2HW/FdU9pnJUcVRrwLqvJkYeo+mhkXE4AxxWErN3q+UxhEm8ypGIX1OYTKJaTJvj5cQ== + dependencies: + bn.js "^5.1.2" + buffer-layout "^1.2.0" + +"@project-serum/serum@^0.13.33": version "0.13.33" resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.33.tgz#03ce8219c1bb458f56c09dc8aa621d76538e70f5" integrity sha512-g2ztZwhQAvhGE9u4/Md6uEFBpaOMV2Xa/H/FGhgTx3iBv2sikW5fheHRJ8Vy7yEA9ZhZCuzbCkw8Wz1fq82VAg== @@ -1878,19 +1902,6 @@ bn.js "^5.1.2" buffer-layout "^1.2.0" -"@project-serum/swap@^0.0.13": - version "0.0.13" - resolved "https://registry.yarnpkg.com/@project-serum/swap/-/swap-0.0.13.tgz#a9fd66daecb4f5843c13abc870ba5ef673c7d449" - integrity sha512-VKwPrzkiKOEv4U85ZnxP29rUfyT3tvvKBDyYSEjAkpqOm3LkRhHvmcm6h/0gOS8waSFiYe2nC80t5tWZOrLbGg== - dependencies: - "@project-serum/serum" "^0.13.21" - "@solana/spl-token" "^0.0.13" - "@solana/spl-token-swap" "0.1.0" - bn.js "^5.1.3" - bs58 "^4.0.1" - buffer-layout "^1.2.0" - dotenv "^8.2.0" - "@rollup/plugin-node-resolve@^7.1.1": version "7.1.3" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz#80de384edfbd7bfc9101164910f86078151a3eca" @@ -1945,54 +1956,6 @@ dependencies: cross-fetch "^3.0.6" -"@solana/spl-token-swap@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@solana/spl-token-swap/-/spl-token-swap-0.1.0.tgz#a1bc2b0c96edae8b31bb2cc000ebacdc36e131c8" - integrity sha512-h0ntp6xwRZBEKDd6oNhJTbPISjIfeGm0eqQqAccTkeluo1zHve4dnUChTKF4MQ+JqXjfqd6z6DJjfa0+dGA37w== - dependencies: - "@babel/runtime" "^7.11.2" - "@solana/web3.js" "^0.90.0" - bn.js "^5.1.3" - buffer-layout "^1.2.0" - dotenv "8.2.0" - json-to-pretty-yaml "^1.2.2" - mkdirp "1.0.4" - -"@solana/spl-token@^0.0.13": - version "0.0.13" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.0.13.tgz#5e0b235b1f8b34643280401dbfddeb34d13d1acd" - integrity sha512-WT8M9V/hxURR5jLbhr3zgwVsgcY6m8UhHtK045w7o+jx8FJ9MKARkj387WBFU7mKiFq0k8jw/8YL7XmnIUuH8Q== - dependencies: - "@babel/runtime" "^7.10.5" - "@solana/web3.js" "^0.86.1" - bn.js "^5.0.0" - buffer-layout "^1.2.0" - dotenv "8.2.0" - mkdirp "1.0.4" - -"@solana/web3.js@^0.86.1": - version "0.86.4" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-0.86.4.tgz#69216d3928ca4727c25a1ea96c405e897156ac3b" - integrity sha512-FpabDmdyxBN5aHIVUWc9Q6pXJFWiLRm/xeyxFg9O9ICHjiUkd38omds7G0CAmykIccG7zaMziwtkXp+0KvQOhA== - dependencies: - "@babel/runtime" "^7.3.1" - bn.js "^5.0.0" - bs58 "^4.0.1" - buffer "^5.4.3" - buffer-layout "^1.2.0" - crypto-hash "^1.2.2" - esdoc-inject-style-plugin "^1.0.0" - jayson "^3.0.1" - keccak "^3.0.1" - mz "^2.7.0" - node-fetch "^2.2.0" - npm-run-all "^4.1.5" - rpc-websockets "^7.4.2" - secp256k1 "^4.0.2" - superstruct "^0.8.3" - tweetnacl "^1.0.0" - ws "^7.0.0" - "@solana/web3.js@^0.87.2": version "0.87.2" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-0.87.2.tgz#92c8d344695c6113d4e0eb3339117fbc6b22d0d2" @@ -2039,6 +2002,25 @@ tweetnacl "^1.0.0" ws "^7.0.0" +"@solana/web3.js@^1.2.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.9.0.tgz#1676215a2e89e2cb6e4694c5970c3c7c8ac12a19" + integrity sha512-wal/itYezfH7ePMoBL6mtSa+J2jTkd7bOwlaen2jeJA+aHmQaLfP+XpI27Y+hPmSRChmHggVgl+/ayX4LX8sZg== + dependencies: + "@babel/runtime" "^7.12.5" + bn.js "^5.0.0" + bs58 "^4.0.1" + buffer "6.0.1" + buffer-layout "^1.2.0" + crypto-hash "^1.2.2" + jayson "^3.4.4" + js-sha3 "^0.8.0" + node-fetch "^2.6.1" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + "@surma/rollup-plugin-off-main-thread@^1.1.1": version "1.4.2" resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-1.4.2.tgz#e6786b6af5799f82f7ab3a82e53f6182d2b91a58" @@ -2257,6 +2239,13 @@ dependencies: "@types/node" "*" +"@types/bs58@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/bs58/-/bs58-4.0.1.tgz#3d51222aab067786d3bc3740a84a7f5a0effaa37" + integrity sha512-yfAgiWgVLjFCmRv8zAcOIHywYATEwiTVccTLnRp6UxTNavT55M9d/uhK3T03St/+8/z/wW+CRjGKUNmEqoHHCA== + dependencies: + base-x "^3.0.6" + "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -2269,6 +2258,13 @@ dependencies: "@types/node" "*" +"@types/crypto-hash@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@types/crypto-hash/-/crypto-hash-1.1.2.tgz#5a993deb0e6ba7c42f86eaa65d9bf563378f4569" + integrity sha512-sOmi+4Go2XKodLV4+lfP+5QMQ+6ZYqRJhK8D/n6xsxIUvlerEulmU9S4Lo02pXCH3qPBeJXEy+g8ZERktDJLSg== + dependencies: + crypto-hash "*" + "@types/eslint@^7.2.4": version "7.2.6" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.6.tgz#5e9aff555a975596c03a98b59ecd103decc70c3c" @@ -2398,6 +2394,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== +"@types/pako@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/pako/-/pako-1.0.1.tgz#33b237f3c9aff44d0f82fe63acffa4a365ef4a61" + integrity sha512-GdZbRSJ3Cv5fiwT6I0SQ3ckeN2PWNqxd26W9Z2fCK1tGrrasGy4puvNFtnddqH9UJFMQYXxEuuB7B8UK+LLwSg== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -3408,7 +3409,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base-x@^3.0.2, base-x@^3.0.8: +base-x@^3.0.2, base-x@^3.0.6, base-x@^3.0.8: version "3.0.8" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== @@ -3420,7 +3421,7 @@ base64-js@^1.0.2: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== -base64-js@^1.3.1: +base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -3545,11 +3546,6 @@ bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ== -bn.js@^5.1.3: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - body-parser@1.19.0, body-parser@^1.16.0: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -3764,6 +3760,14 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= +buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + buffer@^4.3.0: version "4.9.2" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" @@ -3781,14 +3785,6 @@ buffer@^5.0.5, buffer@^5.5.0, buffer@^5.6.0: base64-js "^1.0.2" ieee754 "^1.1.4" -buffer@^5.4.3: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - buffer@^6.0.1: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -4588,7 +4584,7 @@ crypto-browserify@3.12.0, crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-hash@^1.2.2: +crypto-hash@*, crypto-hash@^1.2.2, crypto-hash@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247" integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg== @@ -5215,6 +5211,14 @@ dot-case@^3.0.3: no-case "^3.0.3" tslib "^1.10.0" +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + dot-prop@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb" @@ -5227,7 +5231,7 @@ dotenv-expand@5.1.0: resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== -dotenv@8.2.0, dotenv@^8.2.0: +dotenv@8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== @@ -6276,6 +6280,13 @@ find-versions@^3.2.0: dependencies: semver-regex "^2.0.0" +find@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8" + integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw== + dependencies: + traverse-chain "~0.1.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -7066,16 +7077,16 @@ idna-uts46-hx@^2.3.1: dependencies: punycode "2.1.0" -ieee754@^1.1.13, ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - ieee754@^1.1.4: version "1.1.13" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" @@ -7686,6 +7697,23 @@ jayson@^3.0.1: lodash "^4.17.20" uuid "^3.4.0" +jayson@^3.4.4: + version "3.6.2" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.2.tgz#e551e25abf2efe333051a6ed88b10f08c5288f50" + integrity sha512-hbl+x2xH6FT7nckw+Pq3lKOIJaMBKOgNJEVfvloDBWB8iSfzn/1U2igj1A5rplqNMFN/OnnaTNw8qPKVmoq83Q== + dependencies: + "@types/connect" "^3.4.33" + "@types/express-serve-static-core" "^4.17.9" + "@types/lodash" "^4.14.159" + "@types/node" "^12.12.54" + JSONStream "^1.3.5" + commander "^2.20.3" + es6-promisify "^5.0.0" + eyes "^0.1.8" + json-stringify-safe "^5.0.1" + lodash "^4.17.20" + uuid "^3.4.0" + jest-changed-files@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" @@ -8121,6 +8149,11 @@ jest@26.6.0: import-local "^3.0.2" jest-cli "^26.6.0" +js-sha256@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + js-sha3@0.5.7, js-sha3@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" @@ -8221,14 +8254,6 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json-to-pretty-yaml@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/json-to-pretty-yaml/-/json-to-pretty-yaml-1.2.2.tgz#f4cd0bd0a5e8fe1df25aaf5ba118b099fd992d5b" - integrity sha1-9M0L0KXo/h3yWq9boRiwmf2ZLVs= - dependencies: - remedial "^1.0.7" - remove-trailing-spaces "^1.0.6" - json3@^3.3.2: version "3.3.3" resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" @@ -8667,6 +8692,13 @@ lower-case@^2.0.1: dependencies: tslib "^1.10.0" +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" @@ -9005,7 +9037,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@1.0.4, mkdirp@^1.0.3, mkdirp@^1.0.4: +mkdirp@*, mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== @@ -9183,12 +9215,20 @@ no-case@^3.0.3: lower-case "^2.0.1" tslib "^1.10.0" +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== -node-fetch@2.6.1, node-fetch@^2.2.0: +node-fetch@2.6.1, node-fetch@^2.2.0, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -9696,6 +9736,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +pako@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.3.tgz#cdf475e31b678565251406de9e759196a0ea7a43" + integrity sha512-WjR1hOeg+kki3ZIOjaf4b5WVcay1jaliKSYiEaB1XzwhMQZJxRdQRv0V31EKBYlxb4T7SK3hjfc/jxyU64BoSw== + pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -11285,21 +11330,11 @@ relateurl@^0.2.7: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= -remedial@^1.0.7: - version "1.0.8" - resolved "https://registry.yarnpkg.com/remedial/-/remedial-1.0.8.tgz#a5e4fd52a0e4956adbaf62da63a5a46a78c578a0" - integrity sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg== - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= -remove-trailing-spaces@^1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/remove-trailing-spaces/-/remove-trailing-spaces-1.0.8.tgz#4354d22f3236374702f58ee373168f6d6887ada7" - integrity sha512-O3vsMYfWighyFbTd8hk8VaSj9UAGENxAtX+//ugIst2RMk5e03h6RoIS+0ylsFxY1gvmPuAY/PO4It+gPEeySA== - renderkid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.3.tgz#380179c2ff5ae1365c522bf2fcfcff01c5b74149" @@ -11970,6 +12005,14 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -12434,6 +12477,11 @@ stylehacks@^4.0.0: postcss "^7.0.0" postcss-selector-parser "^3.0.0" +superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + superstruct@^0.8.3: version "0.8.4" resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.8.4.tgz#478a19649f6b02c6319c02044db6a1f5863c391f" @@ -12797,6 +12845,11 @@ tr46@^2.0.2: dependencies: punycode "^2.1.1" +traverse-chain@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" + integrity sha1-YdvC1Ttp/2CRoSoWj9fUMxB+QPE= + trim-repeated@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-repeated/-/trim-repeated-1.0.0.tgz#e3646a2ea4e891312bf7eace6cfb05380bc01c21" @@ -12829,6 +12882,11 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== +tslib@^2.0.3: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c" + integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w== + tsutils@^3.17.1: version "3.17.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"