Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/CrocSwap/ambient-ts-app
Browse files Browse the repository at this point in the history
…into mainnetDeploy
  • Loading branch information
benwolski committed Oct 11, 2024
2 parents 4495338 + 1fb4d8c commit 54a8701
Show file tree
Hide file tree
Showing 25 changed files with 641 additions and 1,158 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
{
"name": "ambient-ts-app",
"version": "2.9.1",
"version": "2.9.2",
"private": true,
"type": "module",
"dependencies": {
"@crocswap-libs/sdk": "^1.0.2",
"@crocswap-libs/sdk": "^1.0.7",
"@d3fc/d3fc-extent": "^4.0.2",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@material-ui/core": "^4.12.4",
"@mui/material": "^5.8.2",
"@web3modal/ethers": "4.2.1",
"alchemy-sdk": "^3.4.2",
"alea": "^1.0.1",
"babel-plugin-styled-components": "^2.1.4",
"d3": "^7.4.4",
"d3fc": "^15.2.4",
"emoji-picker-react": "^4.11.1",
"ethers": "^6.13.0",
"ethers": "^6.13.3",
"framer-motion": "4.1.17",
"i18next": "^21.8.16",
"i18next-browser-languagedetector": "^8.0.0",
Expand All @@ -33,7 +32,7 @@
"react-color": "^2.19.3",
"react-dom": "^18.3.1",
"react-i18next": "^12.3.1",
"react-icons": "^5.2.1",
"react-icons": "^5.3.0",
"react-idle-timer": "^5.7.2",
"react-jazzicon": "^1.0.4",
"react-lottie-player": "^2.1.0",
Expand Down Expand Up @@ -105,4 +104,4 @@
"vite-plugin-checker": "^0.6.4",
"vitest": "^1.6.0"
}
}
}
16 changes: 8 additions & 8 deletions public/ambient-token-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@
"chainId": 534352,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"chainId": 534352,
"address": "0xd29687c813d741e2f938f4ac377128810e217b1b",
"name": "Scroll",
"symbol": "SCR",
"decimals": 18,
"logoURI": "https://assets.coingecko.com/coins/images/50571/thumb/scroll.jpg?1728376125"
},
{
"name": "Pirex Ether OFT",
"address": "0x9e0d7d79735e1c63333128149c7b616a0dc0bbdb",
Expand Down Expand Up @@ -363,14 +371,6 @@
"chainId": 534352,
"logoURI": ""
},
{
"name": "Tranchess DAO Token",
"address": "0x9735fb1126b521a913697a541f768376011bccf9",
"symbol": "CHESS",
"decimals": 18,
"chainId": 534352,
"logoURI": "https://scrollscan.com/token/images/tranchess_32.png"
},
{
"name": "StargateToken",
"address": "0x8731d54E9D02c286767d56ac03e8037C07e01e98",
Expand Down
58 changes: 24 additions & 34 deletions src/App/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -231,40 +231,7 @@ input[type='number'] {
appearance: textfield;
-moz-appearance: textfield;
}
.custom_scroll_ambient {
overflow-y: auto !important;

}
.custom_scroll_ambient::-webkit-scrollbar,
.content-container::-webkit-scrollbar {
width: 8px !important; /* Adjust the width as needed */
}
.custom_scroll_ambient::-webkit-scrollbar-thumb,
.content-container::-webkit-scrollbar-thumb {
border: 2px solid transparent !important; /* Space for the border */
background-clip: padding-box !important; /* Create space for the border */
border-radius: 8px !important; /* Adjust the border radius as needed */
background-image: linear-gradient(#06060c, #06060c),
linear-gradient(
0deg,
var(--accent1) 0%,
var(--accent5) 49.48%,
var(--accent1) 100%
) !important;
background-origin: border-box !important;
background-clip: content-box, border-box !important; /* Clip the border to show gradient */
min-height: 50px !important; /* Set the minimum height for the scrollbar thumb */;



}
.custom_scroll_ambient::-webkit-scrollbar-track,
.content-container::-webkit-scrollbar-track {
background: #06060c !important; /* Background color of the scrollbar track */
border-radius: 8px !important; /* Adjust the border radius as needed */
padding: 2px !important; /* Add padding to the track */;

}

/* -----------------------FUTA------------ */

.futa_main {
Expand Down Expand Up @@ -356,6 +323,29 @@ input[type='number'] {
pointer-events: none;
/* display: none; */
}

.custom_scroll_ambient::-webkit-scrollbar {
width: 5px !important;
}


/* Handle */
.custom_scroll_ambient::-webkit-scrollbar-thumb {
background:
linear-gradient(
0deg,
var(--accent1) 0%,
var(--accent5) 49.48%,
var(--accent1) 100%
) !important;
}

/* .custom_scroll_ambient{
scrollbar-width: thin;
scrollbar-color: transparent;
} */


}

@media only screen and (min-width: 1280px) {
Expand Down
47 changes: 27 additions & 20 deletions src/ambient-utils/api/fetchNft.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
import { CrocEnv } from '@crocswap-libs/sdk';
import { memoizePromiseFn } from '../dataLayer/functions/memoizePromiseFn';
import { Alchemy } from 'alchemy-sdk';
import { ALCHEMY_API_KEY } from '../constants';

export const fetchNFT = async (
address: string,
crocEnv: CrocEnv | undefined,
client: Alchemy,
pageKey: string,
pageSize: number,
): Promise<fetchNFTReturn> => {
if (!crocEnv) return;

const nftsForOwnerResponse = await client.nft.getNftsForOwner(address, {
pageKey: pageKey,
pageSize: pageSize,
});

const nftData = nftsForOwnerResponse.ownedNfts;
const totalNFTCount = nftsForOwnerResponse.totalCount;
const pageKeyResponse = nftsForOwnerResponse.pageKey;

return {
NFTData: nftData,
totalNFTCount: totalNFTCount,
pageKey: pageKeyResponse,
userHasNFT: nftsForOwnerResponse.totalCount > 0,
};
if (!crocEnv || !ALCHEMY_API_KEY) return;

const options = { method: 'GET', headers: { accept: 'application/json' } };

try {
const response = await fetch(
`https://eth-mainnet.g.alchemy.com/nft/v3/${ALCHEMY_API_KEY}/getNFTsForOwner?owner=${address}&withMetadata=true&pageSize=${pageSize}&pageKey=${pageKey}`,
options,
);

const data = await response.json();

const nftData = data.ownedNfts;
const totalNFTCount = data.totalCount;
const pageKeyResponse = data.pageKey;

return {
NFTData: nftData,
totalNFTCount: totalNFTCount,
pageKey: pageKeyResponse,
userHasNFT: totalNFTCount > 0,
};
} catch (error) {
console.error(error);
return undefined;
}
};

export type fetchNFTReturn =
Expand All @@ -41,7 +49,6 @@ export type fetchNFTReturn =
export type NFTQueryFn = (
address: string,
crocEnv: CrocEnv | undefined,
client: Alchemy,
pageKey: string,
pageSize: number,
) => Promise<fetchNFTReturn>;
Expand Down
16 changes: 8 additions & 8 deletions src/ambient-utils/constants/ambient-token-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@
"chainId": 534352,
"logoURI": "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png"
},
{
"chainId": 534352,
"address": "0xd29687c813d741e2f938f4ac377128810e217b1b",
"name": "Scroll",
"symbol": "SCR",
"decimals": 18,
"logoURI": "https://assets.coingecko.com/coins/images/50571/thumb/scroll.jpg?1728376125"
},
{
"name": "Pirex Ether OFT",
"address": "0x9e0d7d79735e1c63333128149c7b616a0dc0bbdb",
Expand Down Expand Up @@ -363,14 +371,6 @@
"chainId": 534352,
"logoURI": ""
},
{
"name": "Tranchess DAO Token",
"address": "0x9735fb1126b521a913697a541f768376011bccf9",
"symbol": "CHESS",
"decimals": 18,
"chainId": 534352,
"logoURI": "https://scrollscan.com/token/images/tranchess_32.png"
},
{
"name": "StargateToken",
"address": "0x8731d54E9D02c286767d56ac03e8037C07e01e98",
Expand Down
11 changes: 11 additions & 0 deletions src/ambient-utils/constants/defaultTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ export const scrollWeETH: TokenIF = {
'https://tokenlogo.xyz/assets/token/0x7e7d4467112689329f7e06571ed0e8cbad4910ee.svg',
};

export const scrollScroll: TokenIF = {
name: 'Scroll',
address: '0xd29687c813d741e2f938f4ac377128810e217b1b',
symbol: 'SCR',
decimals: 18,
chainId: 534352,
logoURI:
'https://assets.coingecko.com/coins/images/50571/thumb/scroll.jpg?1728376125',
};

export const scrollSCROLLY: TokenIF = {
name: 'Scrolly The Map',
address: '0xb65aD8d81d1E4Cb2975352338805AF6e39BA8Be8',
Expand Down Expand Up @@ -750,6 +760,7 @@ export const defaultTokens: TokenIF[] = [
scrollWrappedETH,
scrollWstETH,
scrollWeETH,
scrollScroll,
scrollSCROLLY,
scrollSTG,
scrollSCRIBES,
Expand Down
4 changes: 2 additions & 2 deletions src/ambient-utils/constants/networks/scrollMainnet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lookupChain } from '@crocswap-libs/sdk/dist/context';
import {
scrollETH,
scrollSTONE,
scrollScroll,
scrollUSDC,
scrollUSDT,
scrollWBTC,
Expand Down Expand Up @@ -37,9 +37,9 @@ export const scrollMainnet: NetworkIF = {
topPools: [
new TopPool(scrollETH, scrollUSDC, lookupChain('0x82750').poolIndex),
new TopPool(scrollETH, scrollUSDT, lookupChain('0x82750').poolIndex),
new TopPool(scrollETH, scrollScroll, lookupChain('0x82750').poolIndex),
new TopPool(scrollETH, scrollWeETH, lookupChain('0x82750').poolIndex),
new TopPool(scrollETH, scrollWBTC, lookupChain('0x82750').poolIndex),
new TopPool(scrollETH, scrollSTONE, lookupChain('0x82750').poolIndex),
],
getGasPriceInGwei: async (provider?: Provider) => {
if (!provider) return 0;
Expand Down
32 changes: 32 additions & 0 deletions src/assets/images/tokens/SCR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/assets/images/tokens/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import BIG from './BIG.jpg';
import PUNKETH20 from './PUNKETH-20.jpeg';
import RSETH from './RSETH.webp';
import SCROLLY from './SCROLLY.webp';
import SCR from './SCR.svg';
import WEETH from './WEETH.svg';
import BLAST from './BLAST.png';
import ZCAT from './ZCAT.webp';
Expand Down Expand Up @@ -100,6 +101,7 @@ export {
PUNKETH20,
RSETH,
SCROLLY,
SCR,
WEETH,
BLAST,
ZCAT,
Expand Down
22 changes: 19 additions & 3 deletions src/components/Global/Explore/DexTokens/DexTokens.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@
overflow-y: auto; /* Make only the content scrollable */
scrollbar-gutter: stable; /* This will keep the layout stable when the scrollbar appears */

padding-right: 1rem;
overflow-x: hidden;

padding-right: 4px;
padding-bottom: 1rem;
}

.borderRight {
height: 100%;
width: 2px;
width: 1px;
position: absolute;
background-color: var(--dark3);
right: 18px;
right: 6px;
}

.tokens {
Expand Down Expand Up @@ -136,6 +138,20 @@
align-items: center;
}

@media only screen and (min-width: 600px) {
.contentContainer{
padding-right: 1rem;
overflow-x: auto;
}

.borderRight {
width: 2px;
right: 18px;
}


}

@media only screen and (min-width: 768px) {
.mainContainer {
border: none;
Expand Down
1 change: 1 addition & 0 deletions src/components/Global/Explore/PoolRow/PoolRow.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@


}

Loading

0 comments on commit 54a8701

Please sign in to comment.