Skip to content

Commit

Permalink
feat: call deposit method (#21)
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
irubido authored Mar 20, 2023
1 parent 49abd81 commit 94a3ad6
Show file tree
Hide file tree
Showing 13 changed files with 8,657 additions and 5,667 deletions.
30 changes: 0 additions & 30 deletions src/abi.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/JSONDropzone/JSONDropzone.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { FC, SyntheticEvent, useCallback, useEffect, useMemo, useState } from 'react';
import { FileRejection, useDropzone } from 'react-dropzone';
import styled from 'styled-components';
import { GENESIS_FORK_VERSION, DEPOSIT_ADAPTER_TARGET } from '../../utils/envVars';
import { DEPOSIT_ADAPTER_TARGET } from '../../contracts';
import { GENESIS_FORK_VERSION } from '../../utils/envVars';
import {
DepositKeyInterface,
DepositStatus,
Expand Down
17 changes: 10 additions & 7 deletions src/components/JSONDropzone/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,21 @@ export interface BeaconchainDepositInterface {
status: string;
}

export interface DepositKeyInterface {
pubkey: string;
withdrawal_credentials: string;
export interface DepositDataJSON {
amount: number;
signature: string;
deposit_message_root: string;
deposit_cli_version: string;
deposit_data_root: string;
deposit_message_root: string;
fork_version: string;
deposit_cli_version: string;
network_name: string;
pubkey: string;
signature: string;
withdrawal_credentials: string;
}
export interface DepositKeyInterface extends DepositDataJSON {
transactionStatus: TransactionStatus;
txHash?: string;
depositStatus: DepositStatus;
txHash?: string;
}

export enum TransactionStatus {
Expand Down
18 changes: 18 additions & 0 deletions src/components/SideMenu/SideMenu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.sidebar {
/* Take full size */
height: 100%;
left: 0;
position: fixed;
top: 0;
z-index: 9999;
display: none;
}

.sidebar menu {
/* Take full height */
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 12.5rem;
}
2 changes: 1 addition & 1 deletion src/context/WalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function WalletContextProvider({ children }: PropsWithChildren): JSX.Elem

// TODO remove ts ignore;
// @ts-ignore
if (switchError.code === 4902) {
if (switchError.code === 4902 || switchError.code === 4001) {
await provider.request({
method: 'wallet_addEthereumChain',
params: [getNetwork(network)],
Expand Down
Loading

0 comments on commit 94a3ad6

Please sign in to comment.