Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ npm i
npm run dev
```

### Local Development

To develop against a local Miden node (default port `57291`), set the RPC endpoint
to the Vite dev server's origin in your `.env`:

```bash
VITE_RPC_ENDPOINT=http://localhost:5173
VITE_NETWORK_ID=localhost
```

This keeps gRPC-web requests same-origin, avoiding CORS issues. A dev-server
middleware in `vite.config.ts` automatically proxies these requests to
`localhost:57291`.

## Resetting the MidenClientDB

The Miden webclient stores account and note data in the browser. To clear the account and node data in the browser, paste this code snippet into the browser console:
Expand Down
179 changes: 147 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"postinstall": "setup-para"
},
"dependencies": {
"@demox-labs/miden-sdk": "^0.12.5",
"@demox-labs/miden-wallet-adapter": "0.10.0",
"@getpara/react-sdk-lite": "^2.2.0",
"@miden-sdk/miden-para": "^0.10.10",
"@miden-sdk/use-miden-para-react": "^0.10.10",
"@miden-sdk/miden-para": "^0.13.0",
"@miden-sdk/miden-sdk": "^0.13.0",
"@miden-sdk/react": "^0.13.2",
"@miden-sdk/use-miden-para-react": "^0.13.0",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-slot": "^1.2.4",
"@tanstack/react-query": "^5.90.12",
Expand Down Expand Up @@ -52,6 +53,7 @@
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"http-proxy-middleware": "^3.0.5",
"postcss": "^8.5.6",
"puppeteer": "^24.32.1",
"tailwindcss": "^3.4.18",
Expand Down
11 changes: 10 additions & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,18 @@ export function Footer() {
>
About us
</a>
<a
href='https://zoroswap.com/developer-integration'
className='text-primary hover:text-foreground transition-colors'
title='Developer integration for ZoroSwap'
target='_blank'
rel='noopener noreferrer'
>
Developers
</a>
</div>
<div className='opacity-25 absolute right-4 text-xs sm:block hidden'>
testnet v.12
testnet 0.13
</div>
</div>
</footer>
Expand Down
14 changes: 11 additions & 3 deletions src/components/PoolModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useDeposit } from '@/hooks/useDeposit';
import { useWithdraw } from '@/hooks/useWithdraw';
import { ZoroContext } from '@/providers/ZoroContext';
import type { TokenConfig } from '@/providers/ZoroProvider';
import { NoteType } from '@demox-labs/miden-sdk';
import { NoteType } from '@miden-sdk/miden-sdk';
import { Loader, X } from 'lucide-react';
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { parseUnits } from 'viem';
Expand Down Expand Up @@ -123,17 +123,25 @@ const PoolModal = (
if (token == null) return;
await deposit({
amount: rawValue,
minAmountOut: BigInt(0), // rawValue,

// TODO: This needs to be the correct LP amount, not token amount
// BigInt(rawValue * BigInt(1e8 - 1e6 * slippage) / BigInt(1e8))
// find a way to simulate it properly
minAmountOut: BigInt(1),
token,
noteType: NoteType.Public,
});
}, [rawValue, deposit, token]);

const writeWithdraw = useCallback(async () => {
if (token == null) return;

await withdraw({
amount: rawValue,
minAmountOut: rawValue,
// TODO: This needs to be the correct LP amount, not token amount
// BigInt(rawValue * BigInt(1e8 - 1e6 * slippage) / BigInt(1e8))
// find a way to simulate it properly
minAmountOut: BigInt(1),
token,
noteType: NoteType.Public,
});
Expand Down
Loading