diff --git a/appic_frontend/app/layout.jsx b/appic_frontend/app/layout.jsx index 1939ab3..dba2b25 100644 --- a/appic_frontend/app/layout.jsx +++ b/appic_frontend/app/layout.jsx @@ -26,4 +26,3 @@ export default function RootLayout({ children }) { ); } - diff --git a/appic_frontend/app/page.jsx b/appic_frontend/app/page.jsx index c9d23fe..f6aa632 100644 --- a/appic_frontend/app/page.jsx +++ b/appic_frontend/app/page.jsx @@ -7,6 +7,7 @@ import { useDispatch, useSelector } from 'react-redux'; import LoadingComponent from '@/components/higerOrderComponents/loadingComponent'; import Sidebar from '@/components/sidebar'; import DCA from '@/components/dcaRoot'; +import MultiSwap from '@/components/MultiSwap'; export default function Home() { const dispatch = useDispatch(); const [activeComponent, setActiveComponent] = useState(''); @@ -20,11 +21,10 @@ export default function Home() { <> {activeComponent == '' && } {activeComponent == 'DCA' && } + {activeComponent == 'MULTI-SWAP' && } )} - ; ); } - diff --git a/appic_frontend/artemis-web3-adapter/package-lock.json b/appic_frontend/artemis-web3-adapter/package-lock.json index 933247c..95647c2 100644 --- a/appic_frontend/artemis-web3-adapter/package-lock.json +++ b/appic_frontend/artemis-web3-adapter/package-lock.json @@ -5795,11 +5795,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -7591,9 +7591,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, diff --git a/appic_frontend/components/MultiSwap.jsx b/appic_frontend/components/MultiSwap.jsx new file mode 100644 index 0000000..a2ef210 --- /dev/null +++ b/appic_frontend/components/MultiSwap.jsx @@ -0,0 +1,629 @@ +'use client'; + +import { useSelector } from 'react-redux'; +import LoadingComponent from './higerOrderComponents/loadingComponent'; +import { useState } from 'react'; +import MultiSwapTable from './MultiSwapTable'; +import Modal from './higerOrderComponents/modal'; +import darkModeClassnamegenerator, { darkClassGenerator } from '@/utils/darkClassGenerator'; +import BigNumber from 'bignumber.js'; +import { BatchTransact } from '@/artemis-web3-adapter'; +import { AppicMultiswapidlFactory, icrcIdlFactory, dip20IdleFactory, icpSwapPools, icpSwapFactory, sonicIdlFactory } from '@/did'; +import canistersIDs from '@/config/canistersIDs'; +import { artemisWalletAdapter } from '@/utils/walletConnector'; +import { Principal } from '@dfinity/principal'; +import { AccountIdentifier, SubAccount } from '@dfinity/ledger-icp'; +function MultiSwap() { + const [isModalOpen, setIsModalOpen] = useState(false); + const [modalSearchValue, setModalSearchValue] = useState(''); + + const allTokens = useSelector((state) => state.supportedTokens.tokens); + const loader = useSelector((state) => state.wallet.items.loader); + const totalBalance = useSelector((state) => state.wallet.items.totalBalance); + const ownedTokens = useSelector((state) => state.wallet.items.assets); + const ownedTokensWithAddedProperties = ownedTokens.map((ownedToken) => { + const percentage = (ownedToken.usdBalance / totalBalance) * 100; + return { + ...ownedToken, + percentage: Math.round(percentage), + value: ownedToken.usdBalance, + newValue: ownedToken.usdBalance, + newPercentage: Math.round(percentage), + }; + }); + + const principalID = useSelector((state) => state.wallet.items.principalID); + + const [swapTokens, setSwapTokens] = useState(ownedTokensWithAddedProperties); + + const [checkedTokens, setCheckedTokens] = useState(() => swapTokens.map((swapToken) => swapToken.id)); + const filteredAllTokens = allTokens.filter((token) => token.name.toLowerCase().includes(modalSearchValue)); + + const handleSwapTokens = (addedTokens) => { + setSwapTokens([...swapTokens, ...addedTokens]); + }; + + const handleModalClose = () => { + const result = checkedTokens.filter((tokenId) => swapTokens.some((swapToken) => swapToken.id === tokenId)); + setCheckedTokens(result); + setIsModalOpen(false); + }; + + const handleTokenUpdate = (tokenId, newPercentage) => { + const newSwapTokens = swapTokens.map((swapToken) => { + if (swapToken.id !== tokenId) return swapToken; + const newValue = (totalBalance * newPercentage) / 100; + return { ...swapToken, newValue, newPercentage }; + }); + + setSwapTokens(newSwapTokens); + }; + + async function icpSwapAmountOut(token0Address, token0Standard, token1Address, token1Standard, amountIn) { + let swapFactoryCanister = await artemisWalletAdapter.getCanisterActor(canistersIDs.ICP_SWAP_FACTORY, icpSwapFactory, true); + const token0 = { address: token0Address, standard: token0Standard }; + const token1 = { address: token1Address, standard: token1Standard }; + + const poolArgs = { fee: 3000, token0, token1 }; + + try { + const poolResult = await swapFactoryCanister.getPool(poolArgs); + + if (poolResult.ok) { + const poolData = poolResult.ok; + let canID = new Principal(poolData.canisterId._arr).toString(); + const swapPoolCanister = await artemisWalletAdapter.getCanisterActor(canID, icpSwapPools, true); + const zto = poolData.token0.address === token0Address; + + const swapArgs = { + amountIn: amountIn.toString(), + zeroForOne: zto, + amountOutMinimum: '0', + }; + + const quoteResult = await swapPoolCanister.quote(swapArgs); + console.log(quoteResult.ok); + + if (quoteResult.ok) { + return parseInt(quoteResult.ok); + } else { + return 0; + } + } else { + return 0; + } + } catch (error) { + console.log(error); + return 0; + } + } + async function sonicSwapAmountOut(t0, t1, amountIn) { + function getAmountOut(amountIn, reserveIn, reserveOut) { + const actualAmount = (amountIn * 997n) / 1000n; + const amountInWithFee = amountIn * 997n; + const numerator = amountInWithFee * reserveOut; + const denominator = reserveIn * 1000n + amountInWithFee; + return [numerator / denominator, amountIn - actualAmount]; + } + try { + let swapFactoryCanister = await artemisWalletAdapter.getCanisterActor(canistersIDs.SONIC_SWAP_FACTORY, sonicIdlFactory, true); + const pairResult = await swapFactoryCanister.getPair(Principal.fromText(t0), Principal.fromText(t1)); + if (pairResult[0]) { + const p = pairResult[0]; + const [reserveIn, reserveOut] = p.token0 === t0 ? [p.reserve0, p.reserve1] : [p.reserve1, p.reserve0]; + const [amountOut, _] = getAmountOut(BigInt(amountIn), BigInt(reserveIn), BigInt(reserveOut)); + console.log(amountOut); + return Number(amountOut); + } else { + return 0; + } + } catch (error) { + console.log(error); + return 0; + } + } + async function swapWithSonic(sellToken, buyToken, sellTokenType, buyTokenType, amtSell) { + let amountOut = await sonicSwapAmountOut(sellToken, buyToken, amtSell); + if (amountOut != 0) { + let AppicActor = await artemisWalletAdapter.getCanisterActor(canistersIDs.APPIC_MULTISWAP, AppicMultiswapidlFactory, false); + let caller = Principal.fromText(principalID); + let fee; + const subAccount = await AppicActor.getICRC1SubAccount(caller); + console.log('subAccount', subAccount); + if (sellTokenType === 'ICRC1') { + let icrc1 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc1.icrc1_fee(); + const tx = await icrc1.icrc1_transfer({ + to: { + owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), + subaccount: [subAccount], + }, + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + }); + } else if (sellTokenType === 'ICRC2') { + let icrc2 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc2.icrc1_fee(); + const tx = await icrc2.icrc2_approve({ + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + expected_allowance: [], + expires_at: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + spender: { owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), subaccount: [] }, + }); + } else if (sellTokenType === 'YC' || sellTokenType === 'DIP20') { + let dip20 = await artemisWalletAdapter.getCanisterActor(sellToken, dip20IdleFactory, false); + fee = dip20.getTokenFee(); + const tx = await dip20.approve(Principal.fromText(canistersIDs.APPIC_MULTISWAP), BigNumber(amtSell).minus(fee).toNumber()); + } + let sendMultiTras = await AppicActor.sonicSwap( + Principal.fromText(sellToken), + Principal.fromText(buyToken), + sellTokenType, + buyTokenType, + BigNumber(amtSell).minus(fee).toNumber() + ); + console.log(sendMultiTras); + return sendMultiTras; + } + } + async function swapWithICPswap(sellToken, buyToken, sellTokenType, buyTokenType, amtSell) { + let amountOut = await icpSwapAmountOut(sellToken, buyToken, amtSell); + if (amountOut != 0) { + let AppicActor = await artemisWalletAdapter.getCanisterActor(canistersIDs.APPIC_MULTISWAP, AppicMultiswapidlFactory, false); + let caller = Principal.fromText(principalID); + let fee; + const subAccount = await AppicActor.getICRC1SubAccount(caller); + console.log('subAccount', subAccount); + if (sellTokenType === 'ICRC1') { + let icrc1 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc1.icrc1_fee(); + const tx = await icrc1.icrc1_transfer({ + to: { + owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), + subaccount: [subAccount], + }, + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + }); + } else if (sellTokenType === 'ICRC2') { + let icrc2 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc2.icrc1_fee(); + const tx = await icrc2.icrc2_approve({ + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + expected_allowance: [], + expires_at: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + spender: { owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), subaccount: [] }, + }); + } else if (sellTokenType === 'YC' || sellTokenType === 'DIP20') { + let dip20 = await artemisWalletAdapter.getCanisterActor(sellToken, dip20IdleFactory, false); + fee = dip20.getTokenFee(); + const tx = await dip20.approve(Principal.fromText(canistersIDs.APPIC_MULTISWAP), BigNumber(amtSell).minus(fee).toNumber()); + } + let sendMultiTras = await AppicActor.icpSwap( + Principal.fromText(sellToken), + Principal.fromText(buyToken), + sellTokenType, + buyTokenType, + BigNumber(amtSell).minus(fee).toNumber() + ); + console.log(sendMultiTras); + return sendMultiTras; + } + } + async function comparisionSwap(sellToken, buyToken, sellTokenType, buyTokenType, amtSell) { + let amountOut0 = await icpSwapAmountOut(sellToken, buyToken, amtSell); + let amountOut1 = await sonicSwapAmountOut(sellToken, buyToken, amtSell); + if (amountOut1 != 0 && amountOut0 != 0) { + let AppicActor = await artemisWalletAdapter.getCanisterActor(canistersIDs.APPIC_MULTISWAP, AppicMultiswapidlFactory, false); + let caller = Principal.fromText(principalID); + let fee; + const subAccount = await AppicActor.getICRC1SubAccount(caller); + console.log('subAccount', subAccount); + if (sellTokenType === 'ICRC1') { + let icrc1 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc1.icrc1_fee(); + const tx = await icrc1.icrc1_transfer({ + to: { + owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), + subaccount: [subAccount], + }, + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + }); + } else if (sellTokenType === 'ICRC2') { + let icrc2 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc2.icrc1_fee(); + const tx = await icrc2.icrc2_approve({ + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + expected_allowance: [], + expires_at: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + spender: { owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), subaccount: [] }, + }); + } else if (sellTokenType === 'YC' || sellTokenType === 'DIP20') { + let dip20 = await artemisWalletAdapter.getCanisterActor(sellToken, dip20IdleFactory, false); + fee = dip20.getTokenFee(); + const tx = await dip20.approve(Principal.fromText(canistersIDs.APPIC_MULTISWAP), BigNumber(amtSell).minus(fee).toNumber()); + } + let sendMultiTras = await AppicActor.singleComparedSwap( + Principal.fromText(sellToken), + Principal.fromText(buyToken), + sellTokenType, + buyTokenType, + BigNumber(amtSell).minus(fee).toNumber() + ); + console.log(sendMultiTras); + return sendMultiTras; + } + } + async function swapWithMidToken(sellToken, buyToken, sellTokenType, buyTokenType, amtSell) { + let amountOut00 = await icpSwapAmountOut(sellToken, canistersIDs.NNS_ICP_LEDGER, amtSell); + let amountOut01 = await icpSwapAmountOut(canistersIDs.NNS_ICP_LEDGER, buyToken, amountOut00); + let amountOut10 = await sonicSwapAmountOut(sellToken, canistersIDs.NNS_ICP_LEDGER, amtSell); + let amountOut11 = await sonicSwapAmountOut(canistersIDs.NNS_ICP_LEDGER, buyToken, amountOut10); + if (amountOut11 != 0 && amountOut01 != 0) { + let midToken = Principal.fromText(canistersIDs.NNS_ICP_LEDGER); + let AppicActor = await artemisWalletAdapter.getCanisterActor(canistersIDs.APPIC_MULTISWAP, AppicMultiswapidlFactory, false); + let caller = Principal.fromText(principalID); + let fee; + const subAccount = await AppicActor.getICRC1SubAccount(caller); + console.log('subAccount', subAccount); + if (sellTokenType === 'ICRC1') { + let icrc1 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc1.icrc1_fee(); + const tx = await icrc1.icrc1_transfer({ + to: { + owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), + subaccount: [subAccount], + }, + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + }); + } else if (sellTokenType === 'ICRC2') { + let icrc2 = await artemisWalletAdapter.getCanisterActor(sellToken, icrcIdlFactory, false); + fee = icrc2.icrc1_fee(); + const tx = await icrc2.icrc2_approve({ + fee: [], + memo: [], + from_subaccount: [], + created_at_time: [], + expected_allowance: [], + expires_at: [], + amount: BigNumber(amtSell).minus(fee).toNumber(), + spender: { owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), subaccount: [] }, + }); + } else if (sellTokenType === 'YC' || sellTokenType === 'DIP20') { + let dip20 = await artemisWalletAdapter.getCanisterActor(sellToken, dip20IdleFactory, false); + fee = dip20.getTokenFee(); + const tx = await dip20.approve(Principal.fromText(canistersIDs.APPIC_MULTISWAP), BigNumber(amtSell).minus(fee).toNumber()); + } + let sendMultiTras = await AppicActor.swapWithMidToken( + Principal.fromText(sellToken), + midToken, + Principal.fromText(buyToken), + BigNumber(amtSell).minus(fee).toNumber(), + sellTokenType, + 'ICRC2', + buyTokenType + ); + console.log(sendMultiTras); + return sendMultiTras; + } + } + + const handleConfirmSwap = async () => { + await sonicSwapAmountOut('qbizb-wiaaa-aaaaq-aabwq-cai', 'ryjl3-tyaaa-aaaaa-aaaba-cai', '1000000000000'); + await icpSwapAmountOut('qbizb-wiaaa-aaaaq-aabwq-cai', 'ICRC2', 'ryjl3-tyaaa-aaaaa-aaaba-cai', 'ICRC2', '1000000000000'); + // let sellTokenssDetails = []; + // let buyTokensDetails = []; + // let sellingTokens = []; // List of tokens being sold + // let buyingTokens = []; // List of tokens being bought + // let sellAmounts = []; // Amounts of tokens being sold + // let buyAmounts = []; // Amounts of tokens being bought + // let midToken = Principal.fromText(canistersIDs.NNS_ICP_LEDGER); // The middle token used for swaps + // let midTokenType = 'ICRC2'; // Type of the middle token + // let sellingTokensType = []; // Types of the selling tokens + // let buyingTokensType = []; // Types of the buying tokens + // let caller = Principal.fromText(principalID); // Principal of the user initiating the swap + // swapTokens.forEach((token) => { + // let newPercentage = parseFloat(token.newPercentage); + // if (Math.trunc(parseFloat(token.percentage) - newPercentage) > 0) { + // // Calculate amtSell + // let balance = new BigNumber(token.balance); + // let percentageDiff = new BigNumber(token.percentage).minus(newPercentage); + // let amtSell = Number(percentageDiff.times(balance).div(token.percentage).toFixed(0)); // No decimals + // amtSell = Number(new BigNumber(amtSell).minus(token.fee).toFixed(0)); + // token.amtSell = amtSell; + // sellTokenssDetails.push(token); + // } else if (Math.trunc(parseFloat(token.percentage) - newPercentage) < 0) { + // buyTokensDetails.push(token); + // } + // }); + // let sellTokenIds = sellTokenssDetails.map((token) => token.id); + // sellingTokens = sellTokenssDetails.map((token) => Principal.fromText(token.id)); + // sellAmounts = sellTokenssDetails.map((token) => token.amtSell); + // sellingTokensType = sellTokenssDetails.map((token) => String(token.tokenType)); + // buyTokensDetails = buyTokensDetails.filter((token) => !sellTokenIds.includes(token.id)); + // let totalBuyPer = 0; + // buyTokensDetails.forEach((token) => { + // totalBuyPer = totalBuyPer + Number(token.newPercentage) - Number(token.percentage); + // }); + // buyTokensDetails.forEach((token) => { + // let a = new BigNumber(token.newPercentage).minus(token.percentage).times(100).div(totalBuyPer).toFixed(0); + // if (new BigNumber(a).toNumber() !== 0) { + // buyAmounts.push(new BigNumber(a).toNumber()); + // buyingTokens.push(Principal.fromText(token.id)); + // buyingTokensType.push(String(token.tokenType)); + // } + // }); + // console.log('Selling Tokens:', sellingTokens); + // console.log('Buying Tokens:', buyingTokens); + // console.log('Sell Amounts:', sellAmounts); + // console.log('Buy Amounts:', buyAmounts); + // console.log('Mid Token:', midToken); + // console.log('Mid Token Type:', midTokenType); + // console.log('Selling Tokens Type:', sellingTokensType); + // console.log('Buying Tokens Type:', buyingTokensType); + // try { + // let AppicActor = await artemisWalletAdapter.getCanisterActor(canistersIDs.APPIC_MULTISWAP, AppicMultiswapidlFactory, true); + // const subAccount = await AppicActor.getICRC1SubAccount(caller); + // console.log('subAccount', subAccount); + // let transactions = {}; + // for (let i = 0; i < sellTokenssDetails.length; i++) { + // if (sellTokenssDetails[i].tokenType === 'ICRC1') { + // let icrc1 = await artemisWalletAdapter.getCanisterActor(sellTokenssDetails[i].id, icrcIdlFactory, false); + // const tx = await icrc1.icrc1_transfer({ + // to: { + // owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), + // subaccount: [subAccount], + // }, + // fee: [], + // memo: [], + // from_subaccount: [], + // created_at_time: [], + // amount: BigNumber(sellTokenssDetails[i].amtSell).toNumber(), + // }); + // } else if (sellTokenssDetails[i].tokenType === 'ICRC2') { + // transactions[sellTokenssDetails[i].id] = { + // canisterId: Principal.fromText(sellTokenssDetails[i].id), + // idl: icrcIdlFactory, + // methodName: 'icrc2_approve', + // args: [ + // { + // fee: [], + // memo: [], + // from_subaccount: [], + // created_at_time: [], + // expected_allowance: [], + // expires_at: [], + // amount: BigNumber(sellTokenssDetails[i].amtSell).toNumber(), + // spender: { owner: Principal.fromText(canistersIDs.APPIC_MULTISWAP), subaccount: [] }, + // }, + // ], + // }; + // } else if (sellTokenssDetails[i].tokenType === 'YC' || sellTokenssDetails[i].tokenType === 'DIP20') { + // transactions[sellTokenssDetails[i].id] = { + // canisterId: Principal.fromText(sellTokenssDetails[i].id), + // idl: dip20IdleFactory, + // methodName: 'approve', + // args: [Principal.fromText(canistersIDs.APPIC_MULTISWAP), BigNumber(sellTokenssDetails[i].amtSell).toNumber()], + // }; + // } + // } + // let transactionsList = new BatchTransact(transactions, artemisWalletAdapter); + // await transactionsList.execute(); + // console.log('----------------------'); + // // let sendMultiTras = await AppicActor.multiswap( + // // sellingTokens, // List of tokens being sold + // // buyingTokens, // List of tokens being bought + // // sellAmounts, // Amounts of tokens being sold + // // buyAmounts, // Amounts of tokens being bought + // // midToken, // The middle token used for swaps + // // midTokenType, // Type of the middle token + // // sellingTokensType, // Types of the selling tokens + // // buyingTokensType // Types of the buying tokens + // // ); + // let AppicActo = await artemisWalletAdapter.getCanisterActor(canistersIDs.APPIC_MULTISWAP, AppicMultiswapidlFactory, false); + // console.log('----------------------'); + // console.log(sellingTokens[0], buyingTokens[0], sellingTokensType[0], buyingTokensType[0], sellAmounts[0]); + // console.log('----------------------'); + // let sendMultiTras = await AppicActo.singleComparedSwap( + // sellingTokens[0], + // buyingTokens[0], + // sellingTokensType[0], + // buyingTokensType[0], + // sellAmounts[0] + // ); + // console.log(sendMultiTras); + return sendMultiTras; + // } catch (error) { + // console.log(error); + // } + }; + + const calcTotalAndLeft = () => { + const totall = swapTokens.reduce((accumulator, token) => { + return accumulator + Number(token.newPercentage); + }, 0); + + const left = totall > 100 ? 0 : 100 - totall; + + return [totall, left]; + }; + + const [totall, left] = calcTotalAndLeft(); + + const handleModalSearch = (e) => { + setModalSearchValue(e.target.value); + }; + + const handleCheckBox = (tokenId) => { + const isAlreadyChecked = checkedTokens.includes(tokenId); + if (isAlreadyChecked) { + setCheckedTokens([...checkedTokens].filter((checkedTokenId) => tokenId !== checkedTokenId)); + } else { + setCheckedTokens([...checkedTokens, tokenId]); + } + }; + + const handleAddTokens = () => { + const toAddTokens = allTokens + .filter((token) => { + return checkedTokens.includes(token.id); + }) + .map((toAddToken) => { + return { ...toAddToken, value: 0, percentage: 0, newValue: 0, newPercentage: 0 }; + }) + .filter((toAddToken) => ownedTokens.some((ownedToken) => toAddToken.id !== ownedToken.id)); + + let arr = [...toAddTokens, ...ownedTokensWithAddedProperties]; + // Create a new array to store filtered objects + let filteredArr = []; + // Create an object to keep track of seen IDs + let seenIds = {}; + + // Iterate through the original array + for (let obj of arr) { + // If the ID has not been seen before + if (!seenIds[obj.id]) { + // Mark the ID as seen + seenIds[obj.id] = true; + obj.newPercentage = Math.round(obj.newPercentage); + obj.percentage = Math.round(obj.percentage); + // Add the object to the filtered array + filteredArr.push(obj); + } else if (seenIds[obj.id] && obj.newPercentage !== 0) { + // If the ID has been seen before and the current object's newPercentage is not zero + // Replace the previous object with the current object in the filtered array + filteredArr = filteredArr.filter((o) => o.id !== obj.id); + obj.newPercentage = Math.round(obj.newPercentage); + obj.percentage = Math.round(obj.percentage); + filteredArr.push(obj); + } + } + setSwapTokens(filteredArr); + setIsModalOpen(false); + }; + + return ( +
+ {loader && } + + {totall > 100 ?

Total percentage should NOT exceed 100%

: null} +
+ + +

+ Total: {'~' + totall + '%'} + {left + '% Left'} +

+
+ + +
+
+ +

Select a token

+ +
+
+ + + + +
+
+ +
+
+ {filteredAllTokens?.map((token) => { + return ( +
{ + // handleTokenSelection(token); + }} + key={token.id} + className="token token--multi-swap" + > +
+ +
+

{token.name}

+

{token.symbol}

+
+
+ {/*
+

{token.price}

+
*/} + handleCheckBox(token.id)} + checked={checkedTokens.includes(token.id)} + disabled={ownedTokens.some((ownedToken) => ownedToken.id === token.id)} + /> +
+ ); + })} +
+ +
+
+
+ ); +} + +export default MultiSwap; + diff --git a/appic_frontend/components/MultiSwapTable.jsx b/appic_frontend/components/MultiSwapTable.jsx new file mode 100644 index 0000000..5a5eded --- /dev/null +++ b/appic_frontend/components/MultiSwapTable.jsx @@ -0,0 +1,65 @@ +'use client'; + +import { formatSignificantNumber } from '@/helper/number_formatter'; + +// Utility function to pick specified properties from an array of objects +const pickPropertiesFromArray = (array, properties) => { + return array.map((item) => { + return properties.reduce((acc, prop) => { + if (item.hasOwnProperty(prop)) { + acc[prop] = item[prop]; + } + return acc; + }, {}); + }); +}; + +const SELECTED_PROPERTIES = ['id', 'logo', 'name', 'price', 'value', 'percentage', 'newValue', 'newPercentage']; + +const MultiSwapTable = ({ swapTokens = [], onUpdate }) => { + console.log('sss', swapTokens); + const swapTokensWithSelectedProperties = pickPropertiesFromArray(swapTokens, SELECTED_PROPERTIES); + + // Extract the headers from the keys of the first object in the data array + const headers = swapTokensWithSelectedProperties.length > 0 ? Object.keys(swapTokensWithSelectedProperties[0]) : []; + + const getProperJSXForCell = (row, header) => { + switch (header) { + case 'logo': + return token logo; + case 'name': + return row[header]; + case 'newPercentage': + return ( +
+ onUpdate(row.id, e.target.value)} /> % +
+ ); + default: + return formatSignificantNumber(row[header]); + } + }; + + return ( +
+ + + {headers.map((header) => (header === 'id' ? null : ))} + + + {swapTokensWithSelectedProperties.map((row, index) => ( + + {headers.map((header) => { + if (header === 'id') return null; + return ; + })} + + ))} + +
{header.charAt(0).toUpperCase() + header.slice(1)}
{getProperJSXForCell(row, header)}
+
+ ); +}; + +export default MultiSwapTable; + diff --git a/appic_frontend/components/higerOrderComponents/modal.jsx b/appic_frontend/components/higerOrderComponents/modal.jsx index 42c86ec..1b2bb18 100644 --- a/appic_frontend/components/higerOrderComponents/modal.jsx +++ b/appic_frontend/components/higerOrderComponents/modal.jsx @@ -1,6 +1,5 @@ 'use client'; import darkModeClassnamegenerator from '@/utils/darkClassGenerator'; -import { useSelector } from 'react-redux'; function Modal({ children, active }) { return ( @@ -13,4 +12,3 @@ function Modal({ children, active }) { } export default Modal; - diff --git a/appic_frontend/components/sidebar.jsx b/appic_frontend/components/sidebar.jsx index 212317d..35868d7 100644 --- a/appic_frontend/components/sidebar.jsx +++ b/appic_frontend/components/sidebar.jsx @@ -50,7 +50,12 @@ function Sidebar({ setActiveComponent, activeComponent }) {

Auto Invest

-
+
{ + setActiveComponent('MULTI-SWAP'); + }} + className={`sidebar__options ${activeComponent == 'MULTI-SWAP' ? 'active' : ''} `} + > @@ -86,4 +91,3 @@ function Sidebar({ setActiveComponent, activeComponent }) { } export default Sidebar; - diff --git a/appic_frontend/components/walletTokens.jsx b/appic_frontend/components/walletTokens.jsx index 4467c3f..49a0d51 100644 --- a/appic_frontend/components/walletTokens.jsx +++ b/appic_frontend/components/walletTokens.jsx @@ -142,4 +142,3 @@ function WalletTokens({ setEditMode }) { } export default WalletTokens; - diff --git a/appic_frontend/config/canistersIDs.js b/appic_frontend/config/canistersIDs.js index 11d65f0..ea83131 100644 --- a/appic_frontend/config/canistersIDs.js +++ b/appic_frontend/config/canistersIDs.js @@ -6,5 +6,8 @@ export default { WICP: 'utozz-siaaa-aaaam-qaaxq-cai', XTC: 'aanaa-xaaaa-aaaah-aaeiq-cai', APPIC_ROOT: 'vd7yn-iqaaa-aaaak-qdbxq-cai', + APPIC_MULTISWAP: 'iyi4m-kqaaa-aaaan-qmmqq-cai', + ICP_SWAP_FACTORY: '4mmnk-kiaaa-aaaag-qbllq-cai', + SONIC_SWAP_FACTORY: '3xwpq-ziaaa-aaaah-qcn4a-cai', }; diff --git a/appic_frontend/did/appic/appic_multiswap.did.js b/appic_frontend/did/appic/appic_multiswap.did.js new file mode 100644 index 0000000..af4bd12 --- /dev/null +++ b/appic_frontend/did/appic/appic_multiswap.did.js @@ -0,0 +1,108 @@ +export const AppicMultiswapidlFactory = ({ IDL }) => { + const ERR = IDL.Variant({ + GenericError: IDL.Record({ + message: IDL.Text, + error_code: IDL.Nat, + }), + TemporarilyUnavailable: IDL.Null, + InsufficientAllowance: IDL.Record({ allowance: IDL.Nat }), + BadBurn: IDL.Record({ min_burn_amount: IDL.Nat }), + Duplicate: IDL.Record({ duplicate_of: IDL.Nat }), + BadFee: IDL.Record({ expected_fee: IDL.Nat }), + AllowanceChanged: IDL.Record({ current_allowance: IDL.Nat }), + CreatedInFuture: IDL.Record({ ledger_time: IDL.Nat64 }), + TooOld: IDL.Null, + Expired: IDL.Record({ ledger_time: IDL.Nat64 }), + InsufficientFunds: IDL.Record({ balance: IDL.Nat }), + }); + const TransferReceipt = IDL.Variant({ Ok: IDL.Nat, Err: ERR }); + const TokenActor = IDL.Service({ + allowance: IDL.Func([IDL.Principal, IDL.Principal], [IDL.Nat], []), + approve: IDL.Func([IDL.Principal, IDL.Nat], [TransferReceipt], []), + balanceOf: IDL.Func([IDL.Principal], [IDL.Nat], []), + decimals: IDL.Func([], [IDL.Nat8], []), + getTokenFee: IDL.Func([], [IDL.Nat], []), + name: IDL.Func([], [IDL.Text], []), + symbol: IDL.Func([], [IDL.Text], []), + totalSupply: IDL.Func([], [IDL.Nat], []), + transfer: IDL.Func([IDL.Principal, IDL.Nat], [TransferReceipt], []), + transferFrom: IDL.Func([IDL.Principal, IDL.Principal, IDL.Nat], [TransferReceipt], []), + }); + const Subaccount = IDL.Vec(IDL.Nat8); + const ICRCAccount = IDL.Record({ + owner: IDL.Principal, + subaccount: IDL.Opt(Subaccount), + }); + const ICRCTransferArg = IDL.Record({ + to: ICRCAccount, + from_subaccount: IDL.Opt(Subaccount), + amount: IDL.Nat, + }); + const ICRC1TokenActor = IDL.Service({ + icrc1_balance_of: IDL.Func([ICRCAccount], [IDL.Nat], []), + icrc1_decimals: IDL.Func([], [IDL.Nat8], []), + icrc1_fee: IDL.Func([], [IDL.Nat], []), + icrc1_name: IDL.Func([], [IDL.Text], []), + icrc1_symbol: IDL.Func([], [IDL.Text], []), + icrc1_total_supply: IDL.Func([], [IDL.Nat], []), + icrc1_transfer: IDL.Func([ICRCTransferArg], [TransferReceipt], []), + }); + const Account = IDL.Record({ + owner: IDL.Principal, + subaccount: IDL.Opt(Subaccount), + }); + const ApproveArg = IDL.Record({ amount: IDL.Nat, spender: Account }); + const ICRC2TransferArg = IDL.Record({ + to: ICRCAccount, + from: ICRCAccount, + amount: IDL.Nat, + }); + const ICRC2TokenActor = IDL.Service({ + icrc1_balance_of: IDL.Func([ICRCAccount], [IDL.Nat], []), + icrc1_decimals: IDL.Func([], [IDL.Nat8], []), + icrc1_fee: IDL.Func([], [IDL.Nat], []), + icrc1_name: IDL.Func([], [IDL.Text], []), + icrc1_symbol: IDL.Func([], [IDL.Text], []), + icrc1_total_supply: IDL.Func([], [IDL.Nat], []), + icrc1_transfer: IDL.Func([ICRCTransferArg], [TransferReceipt], []), + icrc2_allowance: IDL.Func([Subaccount, IDL.Principal], [IDL.Nat, IDL.Opt(IDL.Nat64)], []), + icrc2_approve: IDL.Func([ApproveArg], [TransferReceipt], []), + icrc2_transfer_from: IDL.Func([ICRC2TransferArg], [TransferReceipt], []), + }); + const TokenActorVariable = IDL.Variant({ + DIPtokenActor: TokenActor, + ICRC1TokenActor: ICRC1TokenActor, + ICRC2TokenActor: ICRC2TokenActor, + }); + return IDL.Service({ + _getTokenActorWithType: IDL.Func([IDL.Text, IDL.Text], [TokenActorVariable], ['query']), + _transfer: IDL.Func([IDL.Text, IDL.Text, IDL.Principal, IDL.Nat], [TransferReceipt], []), + _transferFrom: IDL.Func([IDL.Text, IDL.Text, IDL.Principal, IDL.Nat], [TransferReceipt], []), + changeFee: IDL.Func([IDL.Nat], [], []), + changeOwner: IDL.Func([IDL.Principal], [], []), + getICRC1SubAccount: IDL.Func([IDL.Principal], [Subaccount], ['query']), + icpSwap: IDL.Func([IDL.Principal, IDL.Principal, IDL.Text, IDL.Text, IDL.Nat], [IDL.Nat], []), + icpSwapAmountOut: IDL.Func([IDL.Text, IDL.Text, IDL.Text, IDL.Text, IDL.Nat], [IDL.Nat], []), + multiswap: IDL.Func( + [ + IDL.Vec(IDL.Principal), + IDL.Vec(IDL.Principal), + IDL.Vec(IDL.Nat), + IDL.Vec(IDL.Nat), + IDL.Principal, + IDL.Text, + IDL.Vec(IDL.Text), + IDL.Vec(IDL.Text), + ], + [], + [] + ), + singleComparedSwap: IDL.Func([IDL.Principal, IDL.Principal, IDL.Text, IDL.Text, IDL.Nat], [IDL.Nat], []), + sonicSwap: IDL.Func([IDL.Principal, IDL.Principal, IDL.Text, IDL.Text, IDL.Nat], [IDL.Nat], []), + sonicSwapAmountOut: IDL.Func([IDL.Principal, IDL.Principal, IDL.Nat], [IDL.Nat], []), + swapWithICPSwap: IDL.Func([IDL.Text, IDL.Text, IDL.Text, IDL.Text, IDL.Nat], [IDL.Nat], []), + swapWithSonic: IDL.Func([IDL.Principal, IDL.Principal, IDL.Text, IDL.Text, IDL.Nat], [IDL.Nat], []), + withdrawTransferICRC1: IDL.Func([IDL.Principal], [], []), + }); +}; + diff --git a/appic_frontend/did/icpSwap/icpPools.did.js b/appic_frontend/did/icpSwap/icpPools.did.js new file mode 100644 index 0000000..2bc24b3 --- /dev/null +++ b/appic_frontend/did/icpSwap/icpPools.did.js @@ -0,0 +1,385 @@ +export const icpSwapPools = ({ IDL }) => { + const AccountBalance = IDL.Record({ + balance0: IDL.Nat, + balance1: IDL.Nat, + }); + const Page_5 = IDL.Record({ + content: IDL.Vec(IDL.Tuple(IDL.Principal, AccountBalance)), + offset: IDL.Nat, + limit: IDL.Nat, + totalElements: IDL.Nat, + }); + const Error = IDL.Variant({ + CommonError: IDL.Null, + InternalError: IDL.Text, + UnsupportedToken: IDL.Text, + InsufficientFunds: IDL.Null, + }); + const Result_26 = IDL.Variant({ ok: Page_5, err: Error }); + const Result_2 = IDL.Variant({ ok: IDL.Bool, err: Error }); + const Result_25 = IDL.Variant({ + ok: IDL.Record({ + tokenIncome: IDL.Vec(IDL.Tuple(IDL.Nat, IDL.Record({ tokensOwed0: IDL.Nat, tokensOwed1: IDL.Nat }))), + totalTokensOwed0: IDL.Nat, + totalTokensOwed1: IDL.Nat, + }), + err: Error, + }); + const ClaimArgs = IDL.Record({ positionId: IDL.Nat }); + const Result_24 = IDL.Variant({ + ok: IDL.Record({ amount0: IDL.Nat, amount1: IDL.Nat }), + err: Error, + }); + const DecreaseLiquidityArgs = IDL.Record({ + liquidity: IDL.Text, + positionId: IDL.Nat, + }); + const DepositArgs = IDL.Record({ + fee: IDL.Nat, + token: IDL.Text, + amount: IDL.Nat, + }); + const Result = IDL.Variant({ ok: IDL.Nat, err: Error }); + const DepositAndMintArgs = IDL.Record({ + tickUpper: IDL.Int, + fee0: IDL.Nat, + fee1: IDL.Nat, + amount0: IDL.Nat, + amount1: IDL.Nat, + positionOwner: IDL.Principal, + amount0Desired: IDL.Text, + amount1Desired: IDL.Text, + tickLower: IDL.Int, + }); + const Result_23 = IDL.Variant({ + ok: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Principal)), + err: Error, + }); + const CycleInfo = IDL.Record({ balance: IDL.Nat, available: IDL.Nat }); + const Result_22 = IDL.Variant({ ok: CycleInfo, err: Error }); + const Token = IDL.Record({ address: IDL.Text, standard: IDL.Text }); + const GetPositionArgs = IDL.Record({ + tickUpper: IDL.Int, + tickLower: IDL.Int, + }); + const PositionInfo = IDL.Record({ + tokensOwed0: IDL.Nat, + tokensOwed1: IDL.Nat, + feeGrowthInside1LastX128: IDL.Nat, + liquidity: IDL.Nat, + feeGrowthInside0LastX128: IDL.Nat, + }); + const Result_21 = IDL.Variant({ ok: PositionInfo, err: Error }); + const PositionInfoWithId = IDL.Record({ + id: IDL.Text, + tokensOwed0: IDL.Nat, + tokensOwed1: IDL.Nat, + feeGrowthInside1LastX128: IDL.Nat, + liquidity: IDL.Nat, + feeGrowthInside0LastX128: IDL.Nat, + }); + const Page_4 = IDL.Record({ + content: IDL.Vec(PositionInfoWithId), + offset: IDL.Nat, + limit: IDL.Nat, + totalElements: IDL.Nat, + }); + const Result_20 = IDL.Variant({ ok: Page_4, err: Error }); + const Result_19 = IDL.Variant({ ok: IDL.Principal, err: Error }); + const TransactionType = IDL.Variant({ + decreaseLiquidity: IDL.Null, + claim: IDL.Null, + swap: IDL.Null, + addLiquidity: IDL.Null, + increaseLiquidity: IDL.Null, + }); + const SwapRecordInfo = IDL.Record({ + to: IDL.Text, + feeAmount: IDL.Int, + action: TransactionType, + feeAmountTotal: IDL.Int, + token0Id: IDL.Text, + token1Id: IDL.Text, + token0AmountTotal: IDL.Nat, + liquidityTotal: IDL.Nat, + from: IDL.Text, + tick: IDL.Int, + feeTire: IDL.Nat, + recipient: IDL.Text, + token0ChangeAmount: IDL.Nat, + token1AmountTotal: IDL.Nat, + liquidityChange: IDL.Nat, + token1Standard: IDL.Text, + TVLToken0: IDL.Int, + TVLToken1: IDL.Int, + token0Fee: IDL.Nat, + token1Fee: IDL.Nat, + timestamp: IDL.Int, + token1ChangeAmount: IDL.Nat, + token0Standard: IDL.Text, + price: IDL.Nat, + poolId: IDL.Text, + }); + const PushError = IDL.Record({ time: IDL.Int, message: IDL.Text }); + const Result_18 = IDL.Variant({ + ok: IDL.Record({ + infoCid: IDL.Text, + records: IDL.Vec(SwapRecordInfo), + errors: IDL.Vec(PushError), + retryCount: IDL.Nat, + }), + err: Error, + }); + const TickLiquidityInfo = IDL.Record({ + tickIndex: IDL.Int, + price0Decimal: IDL.Nat, + liquidityNet: IDL.Int, + price0: IDL.Nat, + price1: IDL.Nat, + liquidityGross: IDL.Nat, + price1Decimal: IDL.Nat, + }); + const Page_3 = IDL.Record({ + content: IDL.Vec(TickLiquidityInfo), + offset: IDL.Nat, + limit: IDL.Nat, + totalElements: IDL.Nat, + }); + const Result_17 = IDL.Variant({ ok: Page_3, err: Error }); + const TickInfoWithId = IDL.Record({ + id: IDL.Text, + initialized: IDL.Bool, + feeGrowthOutside1X128: IDL.Nat, + secondsPerLiquidityOutsideX128: IDL.Nat, + liquidityNet: IDL.Int, + secondsOutside: IDL.Nat, + liquidityGross: IDL.Nat, + feeGrowthOutside0X128: IDL.Nat, + tickCumulativeOutside: IDL.Int, + }); + const Page_2 = IDL.Record({ + content: IDL.Vec(TickInfoWithId), + offset: IDL.Nat, + limit: IDL.Nat, + totalElements: IDL.Nat, + }); + const Result_16 = IDL.Variant({ ok: Page_2, err: Error }); + const Result_15 = IDL.Variant({ + ok: IDL.Record({ + swapFee0Repurchase: IDL.Nat, + token0Amount: IDL.Nat, + swapFeeReceiver: IDL.Text, + token1Amount: IDL.Nat, + swapFee1Repurchase: IDL.Nat, + }), + err: Error, + }); + const Value = IDL.Variant({ + Int: IDL.Int, + Nat: IDL.Nat, + Blob: IDL.Vec(IDL.Nat8), + Text: IDL.Text, + }); + const TransferLog = IDL.Record({ + to: IDL.Principal, + fee: IDL.Nat, + result: IDL.Text, + token: Token, + action: IDL.Text, + daysFrom19700101: IDL.Nat, + owner: IDL.Principal, + from: IDL.Principal, + fromSubaccount: IDL.Opt(IDL.Vec(IDL.Nat8)), + timestamp: IDL.Nat, + index: IDL.Nat, + amount: IDL.Nat, + errorMsg: IDL.Text, + }); + const Result_14 = IDL.Variant({ ok: IDL.Vec(TransferLog), err: Error }); + const Result_1 = IDL.Variant({ ok: IDL.Text, err: Error }); + const UserPositionInfo = IDL.Record({ + tickUpper: IDL.Int, + tokensOwed0: IDL.Nat, + tokensOwed1: IDL.Nat, + feeGrowthInside1LastX128: IDL.Nat, + liquidity: IDL.Nat, + feeGrowthInside0LastX128: IDL.Nat, + tickLower: IDL.Int, + }); + const Result_13 = IDL.Variant({ ok: UserPositionInfo, err: Error }); + const Result_12 = IDL.Variant({ + ok: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Nat))), + err: Error, + }); + const Result_11 = IDL.Variant({ ok: IDL.Vec(IDL.Nat), err: Error }); + const UserPositionInfoWithTokenAmount = IDL.Record({ + id: IDL.Nat, + tickUpper: IDL.Int, + tokensOwed0: IDL.Nat, + tokensOwed1: IDL.Nat, + feeGrowthInside1LastX128: IDL.Nat, + liquidity: IDL.Nat, + feeGrowthInside0LastX128: IDL.Nat, + token0Amount: IDL.Nat, + token1Amount: IDL.Nat, + tickLower: IDL.Int, + }); + const Page_1 = IDL.Record({ + content: IDL.Vec(UserPositionInfoWithTokenAmount), + offset: IDL.Nat, + limit: IDL.Nat, + totalElements: IDL.Nat, + }); + const Result_10 = IDL.Variant({ ok: Page_1, err: Error }); + const UserPositionInfoWithId = IDL.Record({ + id: IDL.Nat, + tickUpper: IDL.Int, + tokensOwed0: IDL.Nat, + tokensOwed1: IDL.Nat, + feeGrowthInside1LastX128: IDL.Nat, + liquidity: IDL.Nat, + feeGrowthInside0LastX128: IDL.Nat, + tickLower: IDL.Int, + }); + const Page = IDL.Record({ + content: IDL.Vec(UserPositionInfoWithId), + offset: IDL.Nat, + limit: IDL.Nat, + totalElements: IDL.Nat, + }); + const Result_9 = IDL.Variant({ ok: Page, err: Error }); + const Result_8 = IDL.Variant({ + ok: IDL.Vec(UserPositionInfoWithId), + err: Error, + }); + const Result_7 = IDL.Variant({ + ok: IDL.Record({ balance0: IDL.Nat, balance1: IDL.Nat }), + err: Error, + }); + const WithdrawErrorLog = IDL.Record({ + token: Token, + time: IDL.Int, + user: IDL.Principal, + amount: IDL.Nat, + }); + const Result_6 = IDL.Variant({ + ok: IDL.Vec(IDL.Tuple(IDL.Nat, WithdrawErrorLog)), + err: Error, + }); + const IncreaseLiquidityArgs = IDL.Record({ + positionId: IDL.Nat, + amount0Desired: IDL.Text, + amount1Desired: IDL.Text, + }); + const PoolMetadata = IDL.Record({ + fee: IDL.Nat, + key: IDL.Text, + sqrtPriceX96: IDL.Nat, + tick: IDL.Int, + liquidity: IDL.Nat, + token0: Token, + token1: Token, + maxLiquidityPerTick: IDL.Nat, + nextPositionId: IDL.Nat, + }); + const Result_5 = IDL.Variant({ ok: PoolMetadata, err: Error }); + const MintArgs = IDL.Record({ + fee: IDL.Nat, + tickUpper: IDL.Int, + token0: IDL.Text, + token1: IDL.Text, + amount0Desired: IDL.Text, + amount1Desired: IDL.Text, + tickLower: IDL.Int, + }); + const SwapArgs = IDL.Record({ + amountIn: IDL.Text, + zeroForOne: IDL.Bool, + amountOutMinimum: IDL.Text, + }); + const Result_4 = IDL.Variant({ + ok: IDL.Record({ tokensOwed0: IDL.Nat, tokensOwed1: IDL.Nat }), + err: Error, + }); + const Result_3 = IDL.Variant({ ok: IDL.Int, err: Error }); + const WithdrawArgs = IDL.Record({ + fee: IDL.Nat, + token: IDL.Text, + amount: IDL.Nat, + }); + return IDL.Service({ + allTokenBalance: IDL.Func([IDL.Nat, IDL.Nat], [Result_26], ['query']), + approvePosition: IDL.Func([IDL.Principal, IDL.Nat], [Result_2], []), + batchRefreshIncome: IDL.Func([IDL.Vec(IDL.Nat)], [Result_25], ['query']), + checkOwnerOfUserPosition: IDL.Func([IDL.Principal, IDL.Nat], [Result_2], ['query']), + claim: IDL.Func([ClaimArgs], [Result_24], []), + decreaseLiquidity: IDL.Func([DecreaseLiquidityArgs], [Result_24], []), + deposit: IDL.Func([DepositArgs], [Result], []), + depositAllAndMint: IDL.Func([DepositAndMintArgs], [Result], []), + depositFrom: IDL.Func([DepositArgs], [Result], []), + getAddressPrincipals: IDL.Func([], [Result_23], ['query']), + getAdmins: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']), + getAvailabilityState: IDL.Func( + [], + [ + IDL.Record({ + whiteList: IDL.Vec(IDL.Principal), + available: IDL.Bool, + }), + ], + ['query'] + ), + getClaimLog: IDL.Func([], [IDL.Vec(IDL.Text)], ['query']), + getCycleInfo: IDL.Func([], [Result_22], []), + getMistransferBalance: IDL.Func([Token], [Result], []), + getPosition: IDL.Func([GetPositionArgs], [Result_21], ['query']), + getPositions: IDL.Func([IDL.Nat, IDL.Nat], [Result_20], ['query']), + getPrincipal: IDL.Func([IDL.Text], [Result_19], ['query']), + getSwapRecordState: IDL.Func([], [Result_18], ['query']), + getTickInfos: IDL.Func([IDL.Nat, IDL.Nat], [Result_17], ['query']), + getTicks: IDL.Func([IDL.Nat, IDL.Nat], [Result_16], ['query']), + getTokenAmountState: IDL.Func([], [Result_15], ['query']), + getTokenBalance: IDL.Func([], [IDL.Record({ token0: IDL.Nat, token1: IDL.Nat })], []), + getTokenMeta: IDL.Func( + [], + [ + IDL.Record({ + token0: IDL.Vec(IDL.Tuple(IDL.Text, Value)), + token1: IDL.Vec(IDL.Tuple(IDL.Text, Value)), + }), + ], + [] + ), + getTransferLogs: IDL.Func([], [Result_14], ['query']), + getUserByPositionId: IDL.Func([IDL.Nat], [Result_1], ['query']), + getUserPosition: IDL.Func([IDL.Nat], [Result_13], ['query']), + getUserPositionIds: IDL.Func([], [Result_12], ['query']), + getUserPositionIdsByPrincipal: IDL.Func([IDL.Principal], [Result_11], ['query']), + getUserPositionWithTokenAmount: IDL.Func([IDL.Nat, IDL.Nat], [Result_10], ['query']), + getUserPositions: IDL.Func([IDL.Nat, IDL.Nat], [Result_9], ['query']), + getUserPositionsByPrincipal: IDL.Func([IDL.Principal], [Result_8], ['query']), + getUserUnusedBalance: IDL.Func([IDL.Principal], [Result_7], ['query']), + getVersion: IDL.Func([], [IDL.Text], ['query']), + getWithdrawErrorLog: IDL.Func([], [Result_6], ['query']), + increaseLiquidity: IDL.Func([IncreaseLiquidityArgs], [Result], []), + init: IDL.Func([IDL.Nat, IDL.Int, IDL.Nat], [], []), + metadata: IDL.Func([], [Result_5], ['query']), + mint: IDL.Func([MintArgs], [Result], []), + quote: IDL.Func([SwapArgs], [Result], ['query']), + quoteForAll: IDL.Func([SwapArgs], [Result], ['query']), + refreshIncome: IDL.Func([IDL.Nat], [Result_4], ['query']), + removeErrorTransferLog: IDL.Func([IDL.Nat, IDL.Bool], [], []), + removeWithdrawErrorLog: IDL.Func([IDL.Nat, IDL.Bool], [], []), + resetTokenAmountState: IDL.Func([IDL.Nat, IDL.Nat, IDL.Nat, IDL.Nat], [], []), + setAdmins: IDL.Func([IDL.Vec(IDL.Principal)], [], []), + setAvailable: IDL.Func([IDL.Bool], [], []), + setWhiteList: IDL.Func([IDL.Vec(IDL.Principal)], [], []), + sumTick: IDL.Func([], [Result_3], ['query']), + swap: IDL.Func([SwapArgs], [Result], []), + transferPosition: IDL.Func([IDL.Principal, IDL.Principal, IDL.Nat], [Result_2], []), + upgradeTokenStandard: IDL.Func([IDL.Principal], [Result_1], []), + withdraw: IDL.Func([WithdrawArgs], [Result], []), + withdrawMistransferBalance: IDL.Func([Token], [Result], []), + }); +}; + diff --git a/appic_frontend/did/icpSwap/icpSwapFactory.did.js b/appic_frontend/did/icpSwap/icpSwapFactory.did.js new file mode 100644 index 0000000..e2c801f --- /dev/null +++ b/appic_frontend/did/icpSwap/icpSwapFactory.did.js @@ -0,0 +1,68 @@ +export const icpSwapFactory = ({ IDL }) => { + const Token = IDL.Record({ address: IDL.Text, standard: IDL.Text }); + const CreatePoolArgs = IDL.Record({ + fee: IDL.Nat, + sqrtPriceX96: IDL.Text, + token0: Token, + token1: Token, + }); + const PoolData = IDL.Record({ + fee: IDL.Nat, + key: IDL.Text, + tickSpacing: IDL.Int, + token0: Token, + token1: Token, + canisterId: IDL.Principal, + }); + const Error = IDL.Variant({ + CommonError: IDL.Null, + InternalError: IDL.Text, + UnsupportedToken: IDL.Text, + InsufficientFunds: IDL.Null, + }); + const Result_1 = IDL.Variant({ ok: PoolData, err: Error }); + const CycleInfo = IDL.Record({ balance: IDL.Nat, available: IDL.Nat }); + const Result_2 = IDL.Variant({ ok: CycleInfo, err: Error }); + const GetPoolArgs = IDL.Record({ + fee: IDL.Nat, + token0: Token, + token1: Token, + }); + const Result = IDL.Variant({ ok: IDL.Vec(PoolData), err: Error }); + const SwapFactory = IDL.Service({ + createPool: IDL.Func([CreatePoolArgs], [Result_1], []), + deletePool: IDL.Func([IDL.Text], [], []), + getAccessControlState: IDL.Func( + [], + [ + IDL.Record({ + owners: IDL.Vec(IDL.Principal), + clients: IDL.Vec(IDL.Principal), + }), + ], + [] + ), + getAvailabilityState: IDL.Func( + [], + [ + IDL.Record({ + whiteList: IDL.Vec(IDL.Principal), + available: IDL.Bool, + }), + ], + [] + ), + getCycleInfo: IDL.Func([], [Result_2], []), + getPool: IDL.Func([GetPoolArgs], [Result_1], ['query']), + getPools: IDL.Func([], [Result], ['query']), + getRemovedPools: IDL.Func([], [Result], ['query']), + removePool: IDL.Func([GetPoolArgs], [], []), + setAvailable: IDL.Func([IDL.Bool], [], []), + setClients: IDL.Func([IDL.Vec(IDL.Principal)], [], []), + setOwnerToPool: IDL.Func([IDL.Text, IDL.Vec(IDL.Principal)], [], []), + setOwners: IDL.Func([IDL.Vec(IDL.Principal)], [], []), + setWhiteList: IDL.Func([IDL.Vec(IDL.Principal)], [], []), + }); + return SwapFactory; +}; + diff --git a/appic_frontend/did/index.js b/appic_frontend/did/index.js index 9c3a562..ae5872e 100644 --- a/appic_frontend/did/index.js +++ b/appic_frontend/did/index.js @@ -1,4 +1,8 @@ -export * from "./appic/appic.did"; -export * from "./ledger/icrc1.did"; -export * from "./ledger/dip20.did"; -export * from "./sonic/sonic.did"; +export * from './appic/appic.did'; +export * from './appic/appic_multiswap.did'; +export * from './ledger/icrc1.did'; +export * from './ledger/dip20.did'; +export * from './sonic/sonic.did'; +export * from './icpSwap/icpPools.did'; +export * from './icpSwap/icpSwapFactory.did'; + diff --git a/appic_frontend/package-lock.json b/appic_frontend/package-lock.json index 1e15da8..e046aed 100644 --- a/appic_frontend/package-lock.json +++ b/appic_frontend/package-lock.json @@ -9,6 +9,8 @@ "version": "0.1.0", "dependencies": { "@dfinity/agent": "^1.1.1", + "@dfinity/ledger-icp": "^2.3.1", + "@dfinity/nns": "^5.1.2", "@reduxjs/toolkit": "^2.2.2", "axios": "^1.6.8", "bignumber.js": "^9.1.2", @@ -49,11 +51,11 @@ } }, "node_modules/@dfinity/agent": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-1.1.1.tgz", - "integrity": "sha512-FR7Vd+WMKetuwVhan5qevzk7QnsR44IfooaRjB/PohO+DztIg77uNsYKieloqeBqsqkxYkSJc8hYoAQm64YHNw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-1.3.0.tgz", + "integrity": "sha512-gFc2CqjWURv/Th+vxwHIb7Y39TpRZccjyRm8c51LtyAGLYSpSwJDWbzM/y66h++DSSc3A+1DjN/dRT+6ik3xLw==", "dependencies": { - "@noble/curves": "^1.2.0", + "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", "base64-arraybuffer": "^0.2.0", "borc": "^2.1.1", @@ -61,28 +63,66 @@ "simple-cbor": "^0.4.1" }, "peerDependencies": { - "@dfinity/candid": "^1.1.1", - "@dfinity/principal": "^1.1.1" + "@dfinity/candid": "^1.3.0", + "@dfinity/principal": "^1.3.0" } }, "node_modules/@dfinity/candid": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-1.1.1.tgz", - "integrity": "sha512-CQlM5zWkzdlZ5tO4zQL6Ch0Wj9zROJpQ6Lcof8d3OE42FMIQwpLQeDKQ3i/CtxDuIHYia8dFI0rxM1E96WBpKQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-1.3.0.tgz", + "integrity": "sha512-tt5NYfpv8C+3iKS3Awbi+NAIxjwjIRUOLT+1ys/xpA+6DNEqwgfU8WZu0+bKnf/xlASCyJXUmoMzQ6I01GBp9A==", "peer": true, "peerDependencies": { - "@dfinity/principal": "^1.1.1" + "@dfinity/principal": "^1.3.0" + } + }, + "node_modules/@dfinity/ledger-icp": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@dfinity/ledger-icp/-/ledger-icp-2.3.1.tgz", + "integrity": "sha512-L8nLXSlYzVJuLqnbj+qS41t5vnip5Qjv2ahP8i+leATLSZQ2t1rLw4Vui10vNw90gVDSkRDRBfMBPgMf68u1Tg==", + "peerDependencies": { + "@dfinity/agent": "^1.3.0", + "@dfinity/candid": "^1.3.0", + "@dfinity/principal": "^1.3.0", + "@dfinity/utils": "^2.3.1" + } + }, + "node_modules/@dfinity/nns": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@dfinity/nns/-/nns-5.1.2.tgz", + "integrity": "sha512-yAt7fihb/tv8dvt338JQ5uLEamR5QVWrp7vzl72v8oetkQ7bUEcQhIH/ZhUsY1V/HeJuR8uNcxUd5YMWURPGbg==", + "dependencies": { + "@noble/hashes": "^1.3.2", + "randombytes": "^2.1.0" + }, + "peerDependencies": { + "@dfinity/agent": "^1.3.0", + "@dfinity/candid": "^1.3.0", + "@dfinity/ledger-icp": "^2.3.1", + "@dfinity/principal": "^1.3.0", + "@dfinity/utils": "^2.3.1" } }, "node_modules/@dfinity/principal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-1.1.1.tgz", - "integrity": "sha512-nXk8Cx01Y76/FAjYlMQHUpiI4cJkafAksgvnWFljIFWQMvOzjo2YCUIcZ3H+aVtEXJpXy61a6aseSSUQuaxlVw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-1.3.0.tgz", + "integrity": "sha512-04Ly9/VxztgmSk3LeUv1H+aA/8zCfed5gzgydVKBv9U0pk2lcCjUOMhv3G+1UCUSd8GwzrWaSwIsrzrAcHZm/g==", "peer": true, "dependencies": { "@noble/hashes": "^1.3.1" } }, + "node_modules/@dfinity/utils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@dfinity/utils/-/utils-2.3.1.tgz", + "integrity": "sha512-FvMBwlKBJGJhugGRn13U0Jvfldu01P2QZXDqogkWTHnQs+IJ8N1sVLQ8DQaT+bnOaT5Ii8kEes0ecaMaeTdHgw==", + "peer": true, + "peerDependencies": { + "@dfinity/agent": "^1.3.0", + "@dfinity/candid": "^1.3.0", + "@dfinity/principal": "^1.3.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -176,7 +216,6 @@ "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -193,7 +232,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, "engines": { "node": ">=12" }, @@ -205,7 +243,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -431,7 +468,6 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, "optional": true, "engines": { "node": ">=14" @@ -633,7 +669,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -642,7 +677,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -905,8 +939,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-arraybuffer": { "version": "0.2.0", @@ -998,18 +1031,17 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1166,7 +1198,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1177,8 +1208,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/combined-stream": { "version": "1.0.8", @@ -1199,14 +1229,12 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1390,14 +1418,12 @@ "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/enhanced-resolve": { "version": "5.16.0", @@ -2062,9 +2088,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2140,7 +2166,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", - "dev": true, "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -2272,7 +2297,6 @@ "version": "10.3.10", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", - "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.3.5", @@ -2306,7 +2330,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -2315,7 +2338,6 @@ "version": "9.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2724,7 +2746,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -2948,8 +2969,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/iso-url": { "version": "0.4.7", @@ -2976,7 +2996,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", - "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -3136,7 +3155,6 @@ "version": "10.2.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", - "dev": true, "engines": { "node": "14 || >=16.14" } @@ -3186,7 +3204,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3207,7 +3224,6 @@ "version": "7.0.4", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", - "dev": true, "engines": { "node": ">=16 || 14 >=14.17" } @@ -3295,9 +3311,9 @@ } }, "node_modules/npm": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/npm/-/npm-10.5.0.tgz", - "integrity": "sha512-Ejxwvfh9YnWVU2yA5FzoYLTW52vxHCz+MHrOFg9Cc8IFgF/6f5AGPAvb5WTay5DIUP1NIfN3VBZ0cLlGO0Ys+A==", + "version": "10.8.1", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.8.1.tgz", + "integrity": "sha512-Dp1C6SvSMYQI7YHq/y2l94uvI+59Eqbu1EpuKQHQ8p16txXRuRit5gH3Lnaagk2aXDIjg/Iru9pd05bnneKgdw==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -3306,6 +3322,7 @@ "@npmcli/map-workspaces", "@npmcli/package-json", "@npmcli/promise-spawn", + "@npmcli/redact", "@npmcli/run-script", "@sigstore/tuf", "abbrev", @@ -3314,8 +3331,6 @@ "chalk", "ci-info", "cli-columns", - "cli-table3", - "columnify", "fastest-levenshtein", "fs-minipass", "glob", @@ -3351,7 +3366,6 @@ "npm-profile", "npm-registry-fetch", "npm-user-validate", - "npmlog", "p-map", "pacote", "parse-conflict-json", @@ -3372,73 +3386,71 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^7.2.1", - "@npmcli/config": "^8.0.2", - "@npmcli/fs": "^3.1.0", - "@npmcli/map-workspaces": "^3.0.4", - "@npmcli/package-json": "^5.0.0", - "@npmcli/promise-spawn": "^7.0.1", - "@npmcli/run-script": "^7.0.4", - "@sigstore/tuf": "^2.3.1", + "@npmcli/arborist": "^7.5.3", + "@npmcli/config": "^8.3.3", + "@npmcli/fs": "^3.1.1", + "@npmcli/map-workspaces": "^3.0.6", + "@npmcli/package-json": "^5.1.1", + "@npmcli/promise-spawn": "^7.0.2", + "@npmcli/redact": "^2.0.0", + "@npmcli/run-script": "^8.1.0", + "@sigstore/tuf": "^2.3.4", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^18.0.2", + "cacache": "^18.0.3", "chalk": "^5.3.0", "ci-info": "^4.0.0", "cli-columns": "^4.0.0", - "cli-table3": "^0.6.3", - "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.10", + "glob": "^10.4.1", "graceful-fs": "^4.2.11", - "hosted-git-info": "^7.0.1", - "ini": "^4.1.1", - "init-package-json": "^6.0.0", - "is-cidr": "^5.0.3", - "json-parse-even-better-errors": "^3.0.1", - "libnpmaccess": "^8.0.1", - "libnpmdiff": "^6.0.3", - "libnpmexec": "^7.0.4", - "libnpmfund": "^5.0.1", - "libnpmhook": "^10.0.0", - "libnpmorg": "^6.0.1", - "libnpmpack": "^6.0.3", - "libnpmpublish": "^9.0.2", - "libnpmsearch": "^7.0.0", - "libnpmteam": "^6.0.0", - "libnpmversion": "^5.0.1", - "make-fetch-happen": "^13.0.0", - "minimatch": "^9.0.3", - "minipass": "^7.0.4", + "hosted-git-info": "^7.0.2", + "ini": "^4.1.3", + "init-package-json": "^6.0.3", + "is-cidr": "^5.1.0", + "json-parse-even-better-errors": "^3.0.2", + "libnpmaccess": "^8.0.6", + "libnpmdiff": "^6.1.3", + "libnpmexec": "^8.1.2", + "libnpmfund": "^5.0.11", + "libnpmhook": "^10.0.5", + "libnpmorg": "^6.0.6", + "libnpmpack": "^7.0.3", + "libnpmpublish": "^9.0.9", + "libnpmsearch": "^7.0.6", + "libnpmteam": "^6.0.5", + "libnpmversion": "^6.0.3", + "make-fetch-happen": "^13.0.1", + "minimatch": "^9.0.4", + "minipass": "^7.1.1", "minipass-pipeline": "^1.2.4", "ms": "^2.1.2", - "node-gyp": "^10.0.1", - "nopt": "^7.2.0", - "normalize-package-data": "^6.0.0", + "node-gyp": "^10.1.0", + "nopt": "^7.2.1", + "normalize-package-data": "^6.0.1", "npm-audit-report": "^5.0.0", "npm-install-checks": "^6.3.0", - "npm-package-arg": "^11.0.1", - "npm-pick-manifest": "^9.0.0", - "npm-profile": "^9.0.0", - "npm-registry-fetch": "^16.1.0", - "npm-user-validate": "^2.0.0", - "npmlog": "^7.0.1", + "npm-package-arg": "^11.0.2", + "npm-pick-manifest": "^9.0.1", + "npm-profile": "^10.0.0", + "npm-registry-fetch": "^17.0.1", + "npm-user-validate": "^2.0.1", "p-map": "^4.0.0", - "pacote": "^17.0.6", + "pacote": "^18.0.6", "parse-conflict-json": "^3.0.1", - "proc-log": "^3.0.0", + "proc-log": "^4.2.0", "qrcode-terminal": "^0.12.0", - "read": "^2.1.0", - "semver": "^7.6.0", - "spdx-expression-parse": "^3.0.1", - "ssri": "^10.0.5", + "read": "^3.0.1", + "semver": "^7.6.2", + "spdx-expression-parse": "^4.0.0", + "ssri": "^10.0.6", "supports-color": "^9.4.0", - "tar": "^6.2.0", + "tar": "^6.2.1", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^3.0.0", - "validate-npm-package-name": "^5.0.0", + "validate-npm-package-name": "^5.0.1", "which": "^4.0.0", "write-file-atomic": "^5.0.1" }, @@ -3450,15 +3462,6 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/npm/node_modules/@colors/colors": { - "version": "1.5.0", - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", "inBundle": true, @@ -3527,7 +3530,7 @@ "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { - "version": "2.2.1", + "version": "2.2.2", "inBundle": true, "license": "ISC", "dependencies": { @@ -3535,48 +3538,50 @@ "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.1", "lru-cache": "^10.0.1", - "socks-proxy-agent": "^8.0.1" + "socks-proxy-agent": "^8.0.3" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "7.4.0", + "version": "7.5.3", "inBundle": true, "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/fs": "^3.1.0", - "@npmcli/installed-package-contents": "^2.0.2", + "@npmcli/fs": "^3.1.1", + "@npmcli/installed-package-contents": "^2.1.0", "@npmcli/map-workspaces": "^3.0.2", - "@npmcli/metavuln-calculator": "^7.0.0", + "@npmcli/metavuln-calculator": "^7.1.1", "@npmcli/name-from-folder": "^2.0.0", "@npmcli/node-gyp": "^3.0.0", - "@npmcli/package-json": "^5.0.0", + "@npmcli/package-json": "^5.1.0", "@npmcli/query": "^3.1.0", - "@npmcli/run-script": "^7.0.2", - "bin-links": "^4.0.1", - "cacache": "^18.0.0", + "@npmcli/redact": "^2.0.0", + "@npmcli/run-script": "^8.1.0", + "bin-links": "^4.0.4", + "cacache": "^18.0.3", "common-ancestor-path": "^1.0.1", - "hosted-git-info": "^7.0.1", - "json-parse-even-better-errors": "^3.0.0", + "hosted-git-info": "^7.0.2", + "json-parse-even-better-errors": "^3.0.2", "json-stringify-nice": "^1.1.4", - "minimatch": "^9.0.0", - "nopt": "^7.0.0", + "lru-cache": "^10.2.2", + "minimatch": "^9.0.4", + "nopt": "^7.2.1", "npm-install-checks": "^6.2.0", - "npm-package-arg": "^11.0.1", - "npm-pick-manifest": "^9.0.0", - "npm-registry-fetch": "^16.0.0", - "npmlog": "^7.0.1", - "pacote": "^17.0.4", + "npm-package-arg": "^11.0.2", + "npm-pick-manifest": "^9.0.1", + "npm-registry-fetch": "^17.0.1", + "pacote": "^18.0.6", "parse-conflict-json": "^3.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.2.0", + "proggy": "^2.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", - "ssri": "^10.0.5", + "ssri": "^10.0.6", "treeverse": "^3.0.0", "walk-up-path": "^3.0.1" }, @@ -3588,15 +3593,15 @@ } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "8.2.0", + "version": "8.3.3", "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/map-workspaces": "^3.0.2", "ci-info": "^4.0.0", - "ini": "^4.1.0", - "nopt": "^7.0.0", - "proc-log": "^3.0.0", + "ini": "^4.1.2", + "nopt": "^7.2.1", + "proc-log": "^4.2.0", "read-package-json-fast": "^3.0.2", "semver": "^7.3.5", "walk-up-path": "^3.0.1" @@ -3605,33 +3610,8 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/@npmcli/disparity-colors": { - "version": "3.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "ansi-styles": "^4.3.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles": { - "version": "4.3.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/npm/node_modules/@npmcli/fs": { - "version": "3.1.0", + "version": "3.1.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -3642,14 +3622,14 @@ } }, "node_modules/npm/node_modules/@npmcli/git": { - "version": "5.0.4", + "version": "5.0.7", "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/promise-spawn": "^7.0.0", "lru-cache": "^10.0.1", "npm-pick-manifest": "^9.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", @@ -3660,7 +3640,7 @@ } }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { - "version": "2.0.2", + "version": "2.1.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -3668,14 +3648,14 @@ "npm-normalize-package-bin": "^3.0.0" }, "bin": { - "installed-package-contents": "lib/index.js" + "installed-package-contents": "bin/index.js" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { - "version": "3.0.4", + "version": "3.0.6", "inBundle": true, "license": "ISC", "dependencies": { @@ -3689,13 +3669,14 @@ } }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { - "version": "7.0.0", + "version": "7.1.1", "inBundle": true, "license": "ISC", "dependencies": { "cacache": "^18.0.0", "json-parse-even-better-errors": "^3.0.0", - "pacote": "^17.0.0", + "pacote": "^18.0.0", + "proc-log": "^4.1.0", "semver": "^7.3.5" }, "engines": { @@ -3719,7 +3700,7 @@ } }, "node_modules/npm/node_modules/@npmcli/package-json": { - "version": "5.0.0", + "version": "5.1.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -3728,7 +3709,7 @@ "hosted-git-info": "^7.0.0", "json-parse-even-better-errors": "^3.0.0", "normalize-package-data": "^6.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.5.3" }, "engines": { @@ -3736,7 +3717,7 @@ } }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { - "version": "7.0.1", + "version": "7.0.2", "inBundle": true, "license": "ISC", "dependencies": { @@ -3757,8 +3738,16 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/@npmcli/redact": { + "version": "2.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/@npmcli/run-script": { - "version": "7.0.4", + "version": "8.1.0", "inBundle": true, "license": "ISC", "dependencies": { @@ -3766,6 +3755,7 @@ "@npmcli/package-json": "^5.0.0", "@npmcli/promise-spawn": "^7.0.0", "node-gyp": "^10.0.0", + "proc-log": "^4.0.0", "which": "^4.0.0" }, "engines": { @@ -3782,18 +3772,18 @@ } }, "node_modules/npm/node_modules/@sigstore/bundle": { - "version": "2.2.0", + "version": "2.3.2", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/protobuf-specs": "^0.3.2" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@sigstore/core": { - "version": "1.0.0", + "version": "1.1.0", "inBundle": true, "license": "Apache-2.0", "engines": { @@ -3801,47 +3791,49 @@ } }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { - "version": "0.3.0", + "version": "0.3.2", "inBundle": true, "license": "Apache-2.0", "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@sigstore/sign": { - "version": "2.2.3", + "version": "2.3.2", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.2", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", - "make-fetch-happen": "^13.0.0" + "@sigstore/protobuf-specs": "^0.3.2", + "make-fetch-happen": "^13.0.1", + "proc-log": "^4.2.0", + "promise-retry": "^2.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "2.3.1", + "version": "2.3.4", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0", - "tuf-js": "^2.2.0" + "@sigstore/protobuf-specs": "^0.3.2", + "tuf-js": "^2.2.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/@sigstore/verify": { - "version": "1.1.0", + "version": "1.2.1", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^2.2.0", - "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0" + "@sigstore/bundle": "^2.3.2", + "@sigstore/core": "^1.1.0", + "@sigstore/protobuf-specs": "^0.3.2" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -3856,12 +3848,12 @@ } }, "node_modules/npm/node_modules/@tufjs/models": { - "version": "2.0.0", + "version": "2.0.1", "inBundle": true, "license": "MIT", "dependencies": { "@tufjs/canonical-json": "2.0.0", - "minimatch": "^9.0.3" + "minimatch": "^9.0.4" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -3876,7 +3868,7 @@ } }, "node_modules/npm/node_modules/agent-base": { - "version": "7.1.0", + "version": "7.1.1", "inBundle": true, "license": "MIT", "dependencies": { @@ -3927,21 +3919,13 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/are-we-there-yet": { - "version": "4.0.2", - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { - "version": "4.0.3", + "version": "4.0.4", "inBundle": true, "license": "ISC", "dependencies": { @@ -3955,11 +3939,14 @@ } }, "node_modules/npm/node_modules/binary-extensions": { - "version": "2.2.0", + "version": "2.3.0", "inBundle": true, "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/brace-expansion": { @@ -3970,16 +3957,8 @@ "balanced-match": "^1.0.0" } }, - "node_modules/npm/node_modules/builtins": { - "version": "5.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "semver": "^7.0.0" - } - }, "node_modules/npm/node_modules/cacache": { - "version": "18.0.2", + "version": "18.0.3", "inBundle": true, "license": "ISC", "dependencies": { @@ -4034,7 +4013,7 @@ } }, "node_modules/npm/node_modules/cidr-regex": { - "version": "4.0.3", + "version": "4.1.1", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -4064,30 +4043,8 @@ "node": ">= 10" } }, - "node_modules/npm/node_modules/cli-table3": { - "version": "0.6.3", - "inBundle": true, - "license": "MIT", - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/npm/node_modules/clone": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/npm/node_modules/cmd-shim": { - "version": "6.0.2", + "version": "6.0.3", "inBundle": true, "license": "ISC", "engines": { @@ -4110,36 +4067,11 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/color-support": { - "version": "1.1.3", - "inBundle": true, - "license": "ISC", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/npm/node_modules/columnify": { - "version": "1.6.0", - "inBundle": true, - "license": "MIT", - "dependencies": { - "strip-ansi": "^6.0.1", - "wcwidth": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/console-control-strings": { - "version": "1.1.0", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", "inBundle": true, @@ -4199,17 +4131,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/defaults": { - "version": "1.0.4", - "inBundle": true, - "license": "MIT", - "dependencies": { - "clone": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", "inBundle": true, @@ -4297,40 +4218,22 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/npm/node_modules/gauge": { - "version": "5.0.1", - "inBundle": true, - "license": "ISC", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^4.0.1", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/glob": { - "version": "10.3.10", + "version": "10.4.1", "inBundle": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4341,13 +4244,8 @@ "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/has-unicode": { - "version": "2.0.1", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/hasown": { - "version": "2.0.1", + "version": "2.0.2", "inBundle": true, "license": "MIT", "dependencies": { @@ -4358,7 +4256,7 @@ } }, "node_modules/npm/node_modules/hosted-git-info": { - "version": "7.0.1", + "version": "7.0.2", "inBundle": true, "license": "ISC", "dependencies": { @@ -4410,7 +4308,7 @@ } }, "node_modules/npm/node_modules/ignore-walk": { - "version": "6.0.4", + "version": "6.0.5", "inBundle": true, "license": "ISC", "dependencies": { @@ -4437,7 +4335,7 @@ } }, "node_modules/npm/node_modules/ini": { - "version": "4.1.1", + "version": "4.1.3", "inBundle": true, "license": "ISC", "engines": { @@ -4445,14 +4343,14 @@ } }, "node_modules/npm/node_modules/init-package-json": { - "version": "6.0.0", + "version": "6.0.3", "inBundle": true, "license": "ISC", "dependencies": { + "@npmcli/package-json": "^5.0.0", "npm-package-arg": "^11.0.0", "promzard": "^1.0.0", - "read": "^2.0.0", - "read-package-json": "^7.0.0", + "read": "^3.0.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^5.0.0" @@ -4473,11 +4371,6 @@ "node": ">= 12" } }, - "node_modules/npm/node_modules/ip-address/node_modules/sprintf-js": { - "version": "1.1.3", - "inBundle": true, - "license": "BSD-3-Clause" - }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", "inBundle": true, @@ -4490,11 +4383,11 @@ } }, "node_modules/npm/node_modules/is-cidr": { - "version": "5.0.3", + "version": "5.1.0", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "cidr-regex": "4.0.3" + "cidr-regex": "^4.1.1" }, "engines": { "node": ">=14" @@ -4530,7 +4423,7 @@ "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { - "version": "2.3.6", + "version": "3.1.2", "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -4552,7 +4445,7 @@ "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { - "version": "3.0.1", + "version": "3.0.2", "inBundle": true, "license": "MIT", "engines": { @@ -4586,49 +4479,47 @@ "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "8.0.2", + "version": "8.0.6", "inBundle": true, "license": "ISC", "dependencies": { - "npm-package-arg": "^11.0.1", - "npm-registry-fetch": "^16.0.0" + "npm-package-arg": "^11.0.2", + "npm-registry-fetch": "^17.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "6.0.7", + "version": "6.1.3", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^7.2.1", - "@npmcli/disparity-colors": "^3.0.0", - "@npmcli/installed-package-contents": "^2.0.2", - "binary-extensions": "^2.2.0", + "@npmcli/arborist": "^7.5.3", + "@npmcli/installed-package-contents": "^2.1.0", + "binary-extensions": "^2.3.0", "diff": "^5.1.0", - "minimatch": "^9.0.0", - "npm-package-arg": "^11.0.1", - "pacote": "^17.0.4", - "tar": "^6.2.0" + "minimatch": "^9.0.4", + "npm-package-arg": "^11.0.2", + "pacote": "^18.0.6", + "tar": "^6.2.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "7.0.8", + "version": "8.1.2", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^7.2.1", - "@npmcli/run-script": "^7.0.2", + "@npmcli/arborist": "^7.5.3", + "@npmcli/run-script": "^8.1.0", "ci-info": "^4.0.0", - "npm-package-arg": "^11.0.1", - "npmlog": "^7.0.1", - "pacote": "^17.0.4", - "proc-log": "^3.0.0", - "read": "^2.0.0", + "npm-package-arg": "^11.0.2", + "pacote": "^18.0.6", + "proc-log": "^4.2.0", + "read": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "walk-up-path": "^3.0.1" @@ -4638,104 +4529,104 @@ } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "5.0.5", + "version": "5.0.11", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^7.2.1" + "@npmcli/arborist": "^7.5.3" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "10.0.1", + "version": "10.0.5", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^17.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "6.0.2", + "version": "6.0.6", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^17.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "6.0.7", + "version": "7.0.3", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/arborist": "^7.2.1", - "@npmcli/run-script": "^7.0.2", - "npm-package-arg": "^11.0.1", - "pacote": "^17.0.4" + "@npmcli/arborist": "^7.5.3", + "@npmcli/run-script": "^8.1.0", + "npm-package-arg": "^11.0.2", + "pacote": "^18.0.6" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "9.0.4", + "version": "9.0.9", "inBundle": true, "license": "ISC", "dependencies": { "ci-info": "^4.0.0", - "normalize-package-data": "^6.0.0", - "npm-package-arg": "^11.0.1", - "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0", + "normalize-package-data": "^6.0.1", + "npm-package-arg": "^11.0.2", + "npm-registry-fetch": "^17.0.1", + "proc-log": "^4.2.0", "semver": "^7.3.7", "sigstore": "^2.2.0", - "ssri": "^10.0.5" + "ssri": "^10.0.6" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "7.0.1", + "version": "7.0.6", "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^17.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "6.0.1", + "version": "6.0.5", "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^17.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmversion": { - "version": "5.0.2", + "version": "6.0.3", "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/git": "^5.0.3", - "@npmcli/run-script": "^7.0.2", - "json-parse-even-better-errors": "^3.0.0", - "proc-log": "^3.0.0", + "@npmcli/git": "^5.0.7", + "@npmcli/run-script": "^8.1.0", + "json-parse-even-better-errors": "^3.0.2", + "proc-log": "^4.2.0", "semver": "^7.3.7" }, "engines": { @@ -4743,7 +4634,7 @@ } }, "node_modules/npm/node_modules/lru-cache": { - "version": "10.2.0", + "version": "10.2.2", "inBundle": true, "license": "ISC", "engines": { @@ -4751,7 +4642,7 @@ } }, "node_modules/npm/node_modules/make-fetch-happen": { - "version": "13.0.0", + "version": "13.0.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -4764,6 +4655,7 @@ "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", + "proc-log": "^4.2.0", "promise-retry": "^2.0.1", "ssri": "^10.0.0" }, @@ -4772,7 +4664,7 @@ } }, "node_modules/npm/node_modules/minimatch": { - "version": "9.0.3", + "version": "9.0.4", "inBundle": true, "license": "ISC", "dependencies": { @@ -4786,7 +4678,7 @@ } }, "node_modules/npm/node_modules/minipass": { - "version": "7.0.4", + "version": "7.1.2", "inBundle": true, "license": "ISC", "engines": { @@ -4805,7 +4697,7 @@ } }, "node_modules/npm/node_modules/minipass-fetch": { - "version": "3.0.4", + "version": "3.0.5", "inBundle": true, "license": "MIT", "dependencies": { @@ -4962,7 +4854,7 @@ } }, "node_modules/npm/node_modules/node-gyp": { - "version": "10.0.1", + "version": "10.1.0", "inBundle": true, "license": "MIT", "dependencies": { @@ -4984,8 +4876,16 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/node-gyp/node_modules/proc-log": { + "version": "3.0.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/nopt": { - "version": "7.2.0", + "version": "7.2.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -4999,7 +4899,7 @@ } }, "node_modules/npm/node_modules/normalize-package-data": { - "version": "6.0.0", + "version": "6.0.1", "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -5021,7 +4921,7 @@ } }, "node_modules/npm/node_modules/npm-bundled": { - "version": "3.0.0", + "version": "3.0.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -5051,12 +4951,12 @@ } }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "11.0.1", + "version": "11.0.2", "inBundle": true, "license": "ISC", "dependencies": { "hosted-git-info": "^7.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" }, @@ -5076,7 +4976,7 @@ } }, "node_modules/npm/node_modules/npm-pick-manifest": { - "version": "9.0.0", + "version": "9.0.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -5090,56 +4990,43 @@ } }, "node_modules/npm/node_modules/npm-profile": { - "version": "9.0.0", + "version": "10.0.0", "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0" + "npm-registry-fetch": "^17.0.1", + "proc-log": "^4.0.0" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": ">=18.0.0" } }, "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "16.1.0", + "version": "17.0.1", "inBundle": true, "license": "ISC", "dependencies": { + "@npmcli/redact": "^2.0.0", "make-fetch-happen": "^13.0.0", "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", "minipass-json-stream": "^1.0.1", "minizlib": "^2.1.2", "npm-package-arg": "^11.0.0", - "proc-log": "^3.0.0" + "proc-log": "^4.0.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/npm-user-validate": { - "version": "2.0.0", + "version": "2.0.1", "inBundle": true, "license": "BSD-2-Clause", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/npmlog": { - "version": "7.0.1", - "inBundle": true, - "license": "ISC", - "dependencies": { - "are-we-there-yet": "^4.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^5.0.0", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", "inBundle": true, @@ -5155,31 +5042,30 @@ } }, "node_modules/npm/node_modules/pacote": { - "version": "17.0.6", + "version": "18.0.6", "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/git": "^5.0.0", "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/package-json": "^5.1.0", "@npmcli/promise-spawn": "^7.0.0", - "@npmcli/run-script": "^7.0.0", + "@npmcli/run-script": "^8.0.0", "cacache": "^18.0.0", "fs-minipass": "^3.0.0", "minipass": "^7.0.2", "npm-package-arg": "^11.0.0", "npm-packlist": "^8.0.0", "npm-pick-manifest": "^9.0.0", - "npm-registry-fetch": "^16.0.0", - "proc-log": "^3.0.0", + "npm-registry-fetch": "^17.0.0", + "proc-log": "^4.0.0", "promise-retry": "^2.0.1", - "read-package-json": "^7.0.0", - "read-package-json-fast": "^3.0.0", "sigstore": "^2.2.0", "ssri": "^10.0.0", "tar": "^6.1.11" }, "bin": { - "pacote": "lib/bin.js" + "pacote": "bin/index.js" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -5207,22 +5093,22 @@ } }, "node_modules/npm/node_modules/path-scurry": { - "version": "1.10.1", + "version": "1.11.1", "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/npm/node_modules/postcss-selector-parser": { - "version": "6.0.15", + "version": "6.1.0", "inBundle": true, "license": "MIT", "dependencies": { @@ -5234,7 +5120,15 @@ } }, "node_modules/npm/node_modules/proc-log": { - "version": "3.0.0", + "version": "4.2.0", + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm/node_modules/proggy": { + "version": "2.0.0", "inBundle": true, "license": "ISC", "engines": { @@ -5275,11 +5169,11 @@ } }, "node_modules/npm/node_modules/promzard": { - "version": "1.0.0", + "version": "1.0.2", "inBundle": true, "license": "ISC", "dependencies": { - "read": "^2.0.0" + "read": "^3.0.1" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -5293,11 +5187,11 @@ } }, "node_modules/npm/node_modules/read": { - "version": "2.1.0", + "version": "3.0.1", "inBundle": true, "license": "ISC", "dependencies": { - "mute-stream": "~1.0.0" + "mute-stream": "^1.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -5311,20 +5205,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/read-package-json": { - "version": "7.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "glob": "^10.2.2", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", "inBundle": true, @@ -5352,12 +5232,9 @@ "optional": true }, "node_modules/npm/node_modules/semver": { - "version": "7.6.0", + "version": "7.6.2", "inBundle": true, "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -5365,22 +5242,6 @@ "node": ">=10" } }, - "node_modules/npm/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm/node_modules/set-blocking": { - "version": "2.0.0", - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", "inBundle": true, @@ -5412,16 +5273,16 @@ } }, "node_modules/npm/node_modules/sigstore": { - "version": "2.2.2", + "version": "2.3.1", "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@sigstore/bundle": "^2.2.0", + "@sigstore/bundle": "^2.3.2", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.0", - "@sigstore/sign": "^2.2.3", - "@sigstore/tuf": "^2.3.1", - "@sigstore/verify": "^1.1.0" + "@sigstore/protobuf-specs": "^0.3.2", + "@sigstore/sign": "^2.3.2", + "@sigstore/tuf": "^2.3.4", + "@sigstore/verify": "^1.2.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -5437,7 +5298,7 @@ } }, "node_modules/npm/node_modules/socks": { - "version": "2.8.0", + "version": "2.8.3", "inBundle": true, "license": "MIT", "dependencies": { @@ -5445,16 +5306,16 @@ "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 16.0.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, "node_modules/npm/node_modules/socks-proxy-agent": { - "version": "8.0.2", + "version": "8.0.3", "inBundle": true, "license": "MIT", "dependencies": { - "agent-base": "^7.0.2", + "agent-base": "^7.1.1", "debug": "^4.3.4", "socks": "^2.7.1" }, @@ -5471,13 +5332,22 @@ "spdx-license-ids": "^3.0.0" } }, + "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { - "version": "3.0.1", + "version": "4.0.0", "inBundle": true, "license": "MIT", "dependencies": { @@ -5486,12 +5356,17 @@ } }, "node_modules/npm/node_modules/spdx-license-ids": { - "version": "3.0.17", + "version": "3.0.18", "inBundle": true, "license": "CC0-1.0" }, + "node_modules/npm/node_modules/sprintf-js": { + "version": "1.1.3", + "inBundle": true, + "license": "BSD-3-Clause" + }, "node_modules/npm/node_modules/ssri": { - "version": "10.0.5", + "version": "10.0.6", "inBundle": true, "license": "ISC", "dependencies": { @@ -5563,7 +5438,7 @@ } }, "node_modules/npm/node_modules/tar": { - "version": "6.2.0", + "version": "6.2.1", "inBundle": true, "license": "ISC", "dependencies": { @@ -5627,13 +5502,13 @@ } }, "node_modules/npm/node_modules/tuf-js": { - "version": "2.2.0", + "version": "2.2.1", "inBundle": true, "license": "MIT", "dependencies": { - "@tufjs/models": "2.0.0", + "@tufjs/models": "2.0.1", "debug": "^4.3.4", - "make-fetch-happen": "^13.0.0" + "make-fetch-happen": "^13.0.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -5675,13 +5550,19 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/npm/node_modules/validate-npm-package-name": { - "version": "5.0.0", + "version": "5.0.1", "inBundle": true, "license": "ISC", - "dependencies": { - "builtins": "^5.0.0" - }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } @@ -5691,14 +5572,6 @@ "inBundle": true, "license": "ISC" }, - "node_modules/npm/node_modules/wcwidth": { - "version": "1.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "defaults": "^1.0.3" - } - }, "node_modules/npm/node_modules/which": { "version": "4.0.0", "inBundle": true, @@ -5721,14 +5594,6 @@ "node": ">=16" } }, - "node_modules/npm/node_modules/wide-align": { - "version": "1.1.5", - "inBundle": true, - "license": "ISC", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", "inBundle": true, @@ -6050,7 +5915,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -6065,7 +5929,6 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -6192,6 +6055,14 @@ } ] }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, "node_modules/react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -6528,7 +6399,6 @@ "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -6543,7 +6413,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -6587,7 +6456,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -6599,7 +6467,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -6626,7 +6493,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "engines": { "node": ">=14" }, @@ -6676,7 +6542,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -6694,7 +6559,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6707,14 +6571,12 @@ "node_modules/string-width-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/string-width/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, "engines": { "node": ">=12" }, @@ -6726,7 +6588,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -6813,7 +6674,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6826,7 +6686,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7117,7 +6976,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -7211,7 +7069,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -7229,7 +7086,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -7245,14 +7101,12 @@ "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -7266,7 +7120,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, "engines": { "node": ">=12" }, @@ -7278,7 +7131,6 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, "engines": { "node": ">=12" }, @@ -7290,7 +7142,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "dependencies": { "ansi-regex": "^6.0.1" }, @@ -7310,8 +7161,7 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yocto-queue": { "version": "0.1.0", diff --git a/appic_frontend/package.json b/appic_frontend/package.json index 61ab471..1a42bda 100644 --- a/appic_frontend/package.json +++ b/appic_frontend/package.json @@ -10,6 +10,8 @@ }, "dependencies": { "@dfinity/agent": "^1.1.1", + "@dfinity/ledger-icp": "^2.3.1", + "@dfinity/nns": "^5.1.2", "@reduxjs/toolkit": "^2.2.2", "axios": "^1.6.8", "bignumber.js": "^9.1.2", diff --git a/appic_frontend/redux/store.js b/appic_frontend/redux/store.js index 27d4553..fd273f3 100644 --- a/appic_frontend/redux/store.js +++ b/appic_frontend/redux/store.js @@ -30,4 +30,3 @@ export const store = configureStore({ }); export const getState = store.getState; - diff --git a/appic_frontend/styles/style.scss b/appic_frontend/styles/style.scss index 933472b..0280cbd 100644 --- a/appic_frontend/styles/style.scss +++ b/appic_frontend/styles/style.scss @@ -224,7 +224,8 @@ a { @import './styleComponents/DCAtransactionModal.scss'; @import './styleComponents/DCApositions.scss'; @import './styleComponents/createDCA.scss'; +@import './styleComponents/multi-swap.scss'; + //pages @import './pages/main.scss'; @import './pages/dca.scss'; - diff --git a/appic_frontend/styles/styleComponents/higherOrderComponents/modal.scss b/appic_frontend/styles/styleComponents/higherOrderComponents/modal.scss index dd3c72d..ce1ec84 100644 --- a/appic_frontend/styles/styleComponents/higherOrderComponents/modal.scss +++ b/appic_frontend/styles/styleComponents/higherOrderComponents/modal.scss @@ -8,6 +8,10 @@ overflow: hidden; pointer-events: none; + .tokens { + margin-bottom: 3rem; + } + .bg { width: 100%; height: 100%; @@ -100,7 +104,7 @@ opacity: 1; pointer-events: all; .container { - height: auto; + min-height: 40vh; max-height: 70%; padding: 2% 0; } @@ -112,9 +116,37 @@ .container { background-color: $dark-bg; + + .addTokenModal .topSection .closeBTN { + color: rgb(211, 57, 57); + } + + .title { + color: rgb(150, 150, 150); + } + .searchContainer { + background-color: $dark-tertiary; + + input { + color: inherit; + } + } + + .token--multi-swap { + input[type='checkbox']:disabled + .token-check-label { + background-color: rgba(white, $alpha: 0.1); + border: 2px solid rgb(86, 86, 86); + } + } + .token { + border-radius: 1rem; + background-color: $dark-tertiary; + .token_info .token_name { + color: white; + } + } } } } } } - diff --git a/appic_frontend/styles/styleComponents/multi-swap.scss b/appic_frontend/styles/styleComponents/multi-swap.scss new file mode 100644 index 0000000..6655511 --- /dev/null +++ b/appic_frontend/styles/styleComponents/multi-swap.scss @@ -0,0 +1,240 @@ +.multi-swap { + padding: 4rem; + background-color: white; + border-radius: 36px; + margin-top: 2rem; + border: 1px solid $light-border; + overflow: hidden; + color: $light-primary; + + &.dark { + border-color: $dark-border; + background-color: $dark-box-bg; + color: $dark-primary; + + .warning-message { + background-color: $dark-tertiary; + color: rgb(255, 40, 40); + } + + .cta-container { + .btn:disabled { + color: rgb(76, 74, 74); + background-color: rgba(255, 255, 255, 0.05); + } + + p > span + span { + text-align: center; + width: 100px; + padding: 1rem; + background-color: $dark-tertiary; + border-radius: 2rem; + color: rgb(221, 53, 53); + } + } + + .multi-swap-table { + th { + color: $dark-secondary; + } + + tr { + border-color: $dark-border; + } + + td { + .new-percentage { + background-color: $dark-tertiary; + } + } + } + } + + .warning-message { + text-align: center; + color: rgb(236, 66, 66); + font-size: 16px; + background-color: rgb(248, 240, 240); + padding: 1rem; + border-radius: 1rem; + margin-block: 2rem; + } + + .multi-swap-table-container { + overflow-x: auto; + } + + .multi-swap-table { + width: 100%; + min-width: 700px; + margin-bottom: 2rem; + font-size: 14px; + + th { + color: $light-secondary; + padding: 2rem; + } + + tr { + border-bottom: 1px solid $light-border; + } + + td { + height: 5rem; + text-align: center; + vertical-align: middle; + padding: 1rem; + + img { + max-height: 100%; + } + + .new-percentage { + font-weight: bold; + margin: 0 auto; + width: 70px; + padding: 1rem; + background-color: #f7eff9; + color: $light-secondary; + border-radius: 100px; + + * { + font-weight: bold; + } + } + + input[type='number'] { + width: 50%; + font-size: 14px; + color: $light-secondary; + outline: none; + background-color: transparent; + -moz-appearance: textfield; + } + + input[type='number']::-webkit-outer-spin-button, + input[type='number']::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + } + } + + .cta-container { + margin-top: 2rem; + display: flex; + align-items: center; + gap: 2rem; + + @media screen and (max-width: 700px) { + flex-direction: column; + } + + .btn { + font-size: 14px; + padding: 1rem 1.7rem; + border-radius: 4px; + background-color: $light-buttons; + color: white; + cursor: pointer; + transition: all 0.2s ease-in-out; + &:not(:disabled):hover { + color: $light-secondary; + background-color: transparent; + box-shadow: 0px 0px 0px 2px $light-secondary; + } + + &:disabled { + color: rgb(168, 168, 168); + background-color: #d7d7d7; + cursor: not-allowed; + } + + @media screen and (max-width: 700px) { + width: 100%; + } + } + + .btn-add, + .btn-confirm { + display: flex; + gap: 1rem; + align-items: center; + justify-content: center; + // vertical-align: middle; + } + + p { + display: flex; + align-items: center; + gap: 1rem; + margin-left: 3rem; + font-weight: bold; + font-size: 16px; + color: $light-secondary; + + span { + margin-left: 1rem; + font-weight: normal; + color: rgb(22, 164, 22); + } + + span + span { + text-align: center; + width: 100px; + padding: 1rem; + background-color: rgb(252, 243, 243); + border-radius: 2rem; + color: rgb(255, 71, 71); + } + } + } + + .token--multi-swap { + position: relative; + margin-right: 1.25rem; + } + + .token_balance--multi-swap { + margin-left: auto; + margin-right: 1rem; + } + + .token-check-label { + position: absolute; + cursor: pointer; + top: 0; + bottom: 0; + left: 0; + right: 0; + } + + input[type='checkbox']:checked + .token-check-label { + border: 2px solid teal; + border-radius: 1rem; + } + + input[type='checkbox']:disabled + .token-check-label { + border: 2px solid rgb(205, 205, 205); + } + .confirm-add-swap-tokens { + margin-top: auto; + margin-bottom: 2rem; + font-size: 16px; + padding: 1rem 2.5rem; + border-radius: 4px; + background-color: $light-buttons; + color: white; + cursor: pointer; + display: flex; + gap: 1rem; + align-items: center; + transition: all 0.2s ease-in-out; + + &:hover { + color: $light-secondary; + background-color: transparent; + box-shadow: 0px 0px 0px 2px $light-secondary; + } + } +} diff --git a/appic_frontend/utils/darkClassGenerator.js b/appic_frontend/utils/darkClassGenerator.js index 57d67ef..bd49bf4 100644 --- a/appic_frontend/utils/darkClassGenerator.js +++ b/appic_frontend/utils/darkClassGenerator.js @@ -1,7 +1,7 @@ -"use client"; +'use client'; -import { getState } from "@/redux/store"; -import { useSelector } from "react-redux"; +import { getState } from '@/redux/store'; +import { useSelector } from 'react-redux'; // function for generating class name for dark mode @@ -29,13 +29,10 @@ export default function darkModeClassnamegenerator(className, activable) { } } - -export function darkClassGenerator(isDark,className) { - +export function darkClassGenerator(isDark, className) { if (isDark == true) { return `${className} dark`; } else { return `${className} `; } - -} \ No newline at end of file +}