Skip to content

Commit

Permalink
Merge pull request #3 from zkdice-xyz/dev
Browse files Browse the repository at this point in the history
fix build issues
  • Loading branch information
akiraonstarknet authored Mar 31, 2024
2 parents 43a5f29 + 24a9e72 commit c3fdc60
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
16 changes: 8 additions & 8 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ const nextConfig = {
exclude: ['error', 'warn'],
},
},
async rewrites() {
return [
{
source: '/rpc-api',
destination: 'https://rpc.nethermind.io/mainnet-juno?apikey=t1HPjhplOyEQpxqVMhpwLGuwmOlbXN0XivWUiPAxIBs0kHVK',
},
]
},
// async rewrites() {
// return [
// {
// source: '/rpc-api',
// destination: 'https://rpc.nethermind.io/mainnet-juno?apikey=t1HPjhplOyEQpxqVMhpwLGuwmOlbXN0XivWUiPAxIBs0kHVK',
// },
// ]
// },
};

export default nextConfig;
6 changes: 4 additions & 2 deletions src/app/strategy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default function Strategy() {
mixpanel.track('Strategy page open', {name: searchParams.get('name')})
}, [])

const colSpan1: any = {base: '5', md: '3'}
const colSpan2: any = {base: '5', md: '2'}
return (
<Container maxWidth={'1000px'} margin={'0 auto'} padding='30px 10px' fontFamily={"sans-serif"}>
<Flex marginBottom={'10px'}>
Expand All @@ -51,7 +53,7 @@ export default function Strategy() {
</Flex>
{strategy && <VStack width={'100%'}>
<Grid width={'100%'} templateColumns='repeat(5, 1fr)' gap={2}>
<GridItem display='flex' colSpan={{base: '5', md: '3'}}>
<GridItem display='flex' colSpan={colSpan1}>
<Card width='100%' padding={'15px'} color='white' bg='highlight'>
<Box display={{base: 'block', md: 'flex'}}>
<Box width={{base: '100%', md: '70%'}} float={'left'}>
Expand Down Expand Up @@ -79,7 +81,7 @@ export default function Strategy() {
</Box>
</Card>
</GridItem>
<GridItem display='flex' colSpan={{base: '5', md: '2'}}>
<GridItem display='flex' colSpan={colSpan2}>
<Card width='100%' padding={'15px'} color='white' bg='highlight'>
<Tabs position="relative" variant='unstyled' width={'100%'}>
<TabList>
Expand Down
2 changes: 1 addition & 1 deletion src/app/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function Template({ children }: { children: React.ReactNode }) {
const chains = [sepolia];
const provider = jsonRpcProvider({
rpc: (chain) => {
let args: RpcProviderOptions = {nodeUrl: 'http://localhost:3000/rpc-api', chainId: constants.StarknetChainId.SN_MAIN };
let args: RpcProviderOptions = {nodeUrl: 'https://rpc.nethermind.io/mainnet-juno?apikey=t1HPjhplOyEQpxqVMhpwLGuwmOlbXN0XivWUiPAxIBs0kHVK', chainId: constants.StarknetChainId.SN_MAIN };
return args;
}
});
Expand Down
8 changes: 4 additions & 4 deletions src/components/Deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default function Deposit(props: DepositProps) {
console.log('hookkkAmount', amount.toEtherStr(), calls)
}, [amount, calls])

function getBalanceComponent(token: TokenInfo) {
const { balance, isLoading, isError} = useERC20Balance(token);
function BalanceComponent(props: {token: TokenInfo}) {
const { balance, isLoading, isError} = useERC20Balance(props.token);
return <Box color={'light_grey'} textAlign={'right'}>
<Text>Available balance: </Text>
<LoadingWrap isLoading={isLoading} isError={isError}
Expand All @@ -49,7 +49,7 @@ export default function Deposit(props: DepositProps) {
boxSize: '15px'
}}
>
<b style={{marginLeft: '5px'}}>{balance.toEtherToFixedDecimals(token.displayDecimals)}</b>
<b style={{marginLeft: '5px'}}>{balance.toEtherToFixedDecimals(props.token.displayDecimals)}</b>
</LoadingWrap>
</Box>
}
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function Deposit(props: DepositProps) {
</Menu>
</GridItem>
<GridItem colSpan={3}>
{getBalanceComponent(selectedMarket)}
<BalanceComponent token={selectedMarket}/>
</GridItem>
</Grid>

Expand Down
2 changes: 1 addition & 1 deletion src/strategies/simple.stable.strat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class SimpleStableStrategy extends IStrategy {

constructor() {
const rewardTokens = [{logo: CONSTANTS.LOGOS.STRK}, {logo: CONSTANTS.LOGOS.USDC}, {logo: CONSTANTS.LOGOS.USDT}];
super('SSStrt', "Loop stable-coins to maximize yield", rewardTokens);
super('SSStrt', "Loop stable-coins to maximize yield", rewardTokens, []);

this.steps = [{
name: "Deposit to best pool",
Expand Down

0 comments on commit c3fdc60

Please sign in to comment.