Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRO-2111- Config Changes #65

Merged
merged 14 commits into from
Feb 28, 2024
33 changes: 33 additions & 0 deletions admin_frontend/src/components/ApiKeys.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import IconButton from "@mui/material/IconButton";
import OutlinedInput from "@mui/material/OutlinedInput";
import FormControl from "@mui/material/FormControl";
import InputLabel from "@mui/material/InputLabel";
import Checkbox from '@mui/material/Checkbox';
import Header from "./Header";

const ApiKeysPage = () => {
Expand All @@ -26,6 +27,8 @@ const ApiKeysPage = () => {
const [privateKey, setPrivateKey] = useState("");
const [supportedNetworks, setSupportedNetworks] = useState("");
const [customErc20Paymaster, setCustomErc20Paymaster] = useState("");
const [txnMode, setTxnMode] = useState(0);
const [noOfTxn, setNoOfTxn] = useState(10);
const [showPassword, setShowPassword] = useState(false);

const handleClickShowPassword = () => setShowPassword(!showPassword);
Expand All @@ -34,6 +37,10 @@ const ApiKeysPage = () => {
event.preventDefault();
};

const handleChange = (event) => {
setTxnMode(event.target.checked ? 1 : 0)
};
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved

const fetchData = async () => {
try {
setLoading(true);
Expand Down Expand Up @@ -68,6 +75,9 @@ const ApiKeysPage = () => {
PRIVATE_KEY: privateKey,
SUPPORTED_NETWORKS: supportedNetworks ?? "",
ERC20_PAYMASTERS: customErc20Paymaster ?? "",
TRANSACTION_LIMIT: txnMode,
NO_OF_TRANSACTIONS_IN_A_MONTH: noOfTxn,
INDEXER_ENDPOINT: 'http://localhost:3003'
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
};
const data = await (
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
await fetch("http://localhost:5050/saveKey", {
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -129,6 +139,8 @@ const ApiKeysPage = () => {
<TableCell>Private Key</TableCell>
<TableCell>Supported Networks</TableCell>
<TableCell>Custom ERC20 Paymasters</TableCell>
<TableCell>Transaction Limit Mode</TableCell>
<TableCell>No of Transactions Allowed</TableCell>
<TableCell>Actions Available</TableCell>
</TableRow>
</TableHead>
Expand Down Expand Up @@ -211,6 +223,25 @@ const ApiKeysPage = () => {
fullWidth
/>
</TableCell>
<TableCell>
<Checkbox
checked={txnMode === 0? false : true}
onChange={handleChange}
inputProps={{ 'aria-label': 'controlled' }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this copied from the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay i thought so, please either correct it or remove it please

/>
</TableCell>
<TableCell>
<TextField
type="number"
variant="outlined"
color="secondary"
label="NO_OF_TRANSACTIONS_IN_A_MONTH"
IAmKio marked this conversation as resolved.
Show resolved Hide resolved
onChange={(e) => setNoOfTxn(e.target.value)}
value={noOfTxn}
required
fullWidth
/>
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
</TableCell>
<TableCell>
<LoadingButton
loading={loading}
Expand Down Expand Up @@ -249,6 +280,8 @@ const ApiKeysPage = () => {
</TableCell>
<TableCell>{row.SUPPORTED_NETWORKS}</TableCell>
<TableCell>{row.ERC20_PAYMASTERS}</TableCell>
<TableCell>{row.TRANSACTION_LIMIT === 0 ? 'OFF': 'ON'}</TableCell>
<TableCell>{row.NO_OF_TRANSACTIONS_IN_A_MONTH}</TableCell>
<TableCell>
<LoadingButton
loading={loading}
Expand Down
6 changes: 5 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ config.json
database.sqlite

package-lock.json
pnpm-lock.yaml
pnpm-lock.yaml

# Ponder
/indexer/.ponder
/indexer/generated
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions backend/indexer/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "ponder"
}
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 20 additions & 0 deletions backend/indexer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# Misc
.DS_Store

# Env files
.env*.local

# Ponder
/generated/
/.ponder/

package-lock.json
vignesha22 marked this conversation as resolved.
Show resolved Hide resolved
Loading