Skip to content
Open
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
8 changes: 6 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/yeagerai/genlayer-wallet.git"
},
"source": {
"shasum": "eY80XAM15OdmyAec7lzqcy7C3T6bQ611scgsLt6STec=",
"shasum": "juv32Btut0tfktPrqMa0kWMNU24SCROlArAiybo05KI=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand All @@ -20,7 +20,11 @@
"initialPermissions": {
"snap_dialog": {},
"endowment:transaction-insight": {},
"snap_manageState": {}
"snap_manageState": {},
"endowment:rpc": {
"dapps": true,
"snaps": false
}
},
"platformVersion": "6.14.0",
"manifestVersion": "0.1"
Expand Down
26 changes: 9 additions & 17 deletions packages/snap/src/components/AdvancedOptionsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,16 @@ import {
Option,
} from '@metamask/snaps-sdk/jsx';

export type AdvancedOptionsFormState = {
'leader-timeout-input': string;
'validator-timeout-input': string;
'genlayer-storage-input': string;
'rollup-storage-input': string;
'message-gas-input': string;
'number-of-appeals': string;
[key: string]: string;
};
import type { FeeConfigState } from '../types';

export type AdvancedOptionsFormProps = {
values: AdvancedOptionsFormState;
values: FeeConfigState;
};

export const AdvancedOptionsForm: SnapComponent<AdvancedOptionsFormProps> = ({
values,
}) => {
const numberOfAppeals = parseInt(values['number-of-appeals'] || '1', 10);
const numberOfAppeals = parseInt(values['number-of-appeals'] ?? '1', 10);
return (
<Box>
<Section>
Expand All @@ -37,7 +29,7 @@ export const AdvancedOptionsForm: SnapComponent<AdvancedOptionsFormProps> = ({
<Field label="Number of Appeals">
<Dropdown
name="number-of-appeals"
value={values['number-of-appeals'] || ''}
value={values['number-of-appeals'] ?? ''}
>
<Option value="1">1</Option>
<Option value="2">2</Option>
Expand Down Expand Up @@ -72,7 +64,7 @@ export const AdvancedOptionsForm: SnapComponent<AdvancedOptionsFormProps> = ({
type={'number'}
min={1}
placeholder="60 Sec"
value={values['leader-timeout-input'] || ''}
value={values['leader-timeout-input'] ?? ''}
/>
</Field>
<Field label="Validator Timeout (seconds)">
Expand All @@ -81,30 +73,30 @@ export const AdvancedOptionsForm: SnapComponent<AdvancedOptionsFormProps> = ({
type={'number'}
min={1}
placeholder="30 Sec"
value={values['validator-timeout-input'] || ''}
value={values['validator-timeout-input'] ?? ''}
/>
</Field>
<Field label="Max. Genlayer Storage (GEN)">
<Input
name="genlayer-storage-input"
type={'number'}
placeholder="12 GEN"
value={values['genlayer-storage-input'] || ''}
value={values['genlayer-storage-input'] ?? ''}
/>
</Field>
<Field label="Max. Rollup Storage (GEN)">
<Input
name="rollup-storage-input"
type={'number'}
placeholder="12 GEN"
value={values['rollup-storage-input'] || ''}
value={values['rollup-storage-input'] ?? ''}
/>
</Field>
<Field label="Message gas configuration">
<Input
name="message-gas-input"
placeholder="JSON here (Editable)"
value={values['message-gas-input'] || ''}
value={values['message-gas-input'] ?? ''}
/>
</Field>
<Box direction={'horizontal'} alignment={'center'}>
Expand Down
Loading