Skip to content

Commit 01846dd

Browse files
authored
Merge pull request #12 from lidofinance/feature/si-1836-base-tamplate-for-transactions
Base template for transactions
2 parents 5332d01 + 525fbc6 commit 01846dd

File tree

214 files changed

+5403
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+5403
-281
lines changed

abi/predeposit-guarantee.ts

Lines changed: 1732 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const VaultDataViewerAbi = [
1+
export const VaultViewerAbi = [
22
{
33
inputs: [
44
{

assets/icons/mosaic.svg

Lines changed: 14 additions & 0 deletions
Loading

config/external-config/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export enum ManifestConfigPageEnum {
2424
overview = '/overview',
2525
settings = '/settings',
2626
createVault = '/create-vault',
27+
supply = '/supply',
28+
adjustment = '/adjustment',
29+
validators = '/validators',
30+
claim = '/claim',
31+
notFound = '/404',
2732
}
2833

2934
export type ManifestConfigPage = `${ManifestConfigPageEnum}`;

consts/predeposit-guarantee.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CHAINS } from '@lidofinance/lido-ethereum-sdk';
44
export const PRE_DEPOSIT_GUARANTEE_BY_NETWORK: {
55
[key in CHAINS]?: Address;
66
} = {
7-
[CHAINS.Mainnet]: '0x',
87
[CHAINS.Sepolia]: '0x935b089d9a4F1789783C3db0F466817bB4c9Ac16',
98
};
109

consts/vault-factory.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CHAINS } from '@lidofinance/lido-ethereum-sdk';
44
export const VAULT_FACTORY_BY_NETWORK: {
55
[key in CHAINS]?: Address;
66
} = {
7-
[CHAINS.Mainnet]: '0x',
87
[CHAINS.Sepolia]: '0xcD42e7505060b9931DD1B5B56C923b55f2D17561',
98
};
109

consts/vault-hub.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { CHAINS } from '@lidofinance/lido-ethereum-sdk';
44
export const VAULT_HUB_BY_NETWORK: {
55
[key in CHAINS]?: Address;
66
} = {
7-
[CHAINS.Mainnet]: '0x',
8-
[CHAINS.Sepolia]: '0x699009AFFE51215eF7EA1Cd1e51f2750177d6055',
7+
[CHAINS.Sepolia]: '0x33532749B2e74CE7e4e222a70Df89b7a1523AF67',
98
};
109

1110
export const getVaultHubAddress = (chainId: CHAINS): Address | undefined =>
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import type { Address } from 'viem';
22
import { CHAINS } from '@lidofinance/lido-ethereum-sdk';
33

4-
export const VAULT_DATA_VIEWER_BY_NETWORK: {
4+
export const VAULT_VIEWER_BY_NETWORK: {
55
[key in CHAINS]?: Address;
66
} = {
7-
[CHAINS.Mainnet]: '0x',
87
[CHAINS.Sepolia]: '0xF124672D263BB6e7A5B5cbcF8e6F39b4F6cbe582',
98
};
109

11-
export const getVaultDateViewerAddress = (
12-
chainId: CHAINS,
13-
): Address | undefined => VAULT_DATA_VIEWER_BY_NETWORK?.[chainId];
10+
export const getVaultViewerAddress = (chainId: CHAINS): Address | undefined =>
11+
VAULT_VIEWER_BY_NETWORK?.[chainId];
1412

1513
export const VAULTS_PER_PAGE = 4;

consts/weth.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { AbstractLidoSDKErc20 } from '@lidofinance/lido-ethereum-sdk/erc20';
2+
import { CHAINS, LidoSDKCore } from '@lidofinance/lido-ethereum-sdk';
3+
import type { Address } from 'viem';
4+
5+
export const WETH_BY_NETWORK: {
6+
[key in CHAINS]?: Address;
7+
} = {
8+
[CHAINS.Sepolia]: '0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9',
9+
};
10+
11+
export class LidoSDKwETH extends AbstractLidoSDKErc20 {
12+
#address = WETH_BY_NETWORK[CHAINS.Sepolia] as Address;
13+
14+
public async contractAddress(): Promise<Address> {
15+
return this.#address;
16+
}
17+
18+
constructor(props: { core: LidoSDKCore }) {
19+
super(props);
20+
}
21+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { useRouter } from 'next/router';
2+
import { useAdjustment } from 'features/adjustment/contexts/adjustment-provider';
3+
import { useVaultInfo } from 'features/overview/contexts';
4+
5+
import { ToggleSwitch } from 'shared/components/toggle';
6+
import { Mint } from './mint';
7+
import { Repay } from './repay';
8+
import { FormBlock, PageWrapper } from './styles';
9+
10+
import { AdjustmentPaths, adjustmentToggleList } from './const';
11+
import { ManifestConfigPageEnum } from 'config/external-config';
12+
13+
export const AdjustmentTabs = () => {
14+
const router = useRouter();
15+
const initialPath = router.query.mode as AdjustmentPaths;
16+
const { isMintTab } = useAdjustment();
17+
const { activeVault } = useVaultInfo();
18+
19+
const handleToggleCb = (value: AdjustmentPaths) => {
20+
void router.push(
21+
`/${activeVault?.address}/${ManifestConfigPageEnum.adjustment}/${value}`,
22+
);
23+
};
24+
25+
return (
26+
<PageWrapper>
27+
<ToggleSwitch
28+
options={adjustmentToggleList}
29+
defaultActive={initialPath}
30+
onToggle={({ value }) => handleToggleCb(value as AdjustmentPaths)}
31+
/>
32+
<FormBlock>{isMintTab ? <Mint /> : <Repay />}</FormBlock>
33+
</PageWrapper>
34+
);
35+
};

0 commit comments

Comments
 (0)