Skip to content

Commit

Permalink
Merge pull request #186 from bnb-chain/feat/addressCheck
Browse files Browse the repository at this point in the history
feat(bnb-chain-ui): Token transfer validation
  • Loading branch information
Halibao-Lala authored Dec 12, 2024
2 parents 5aa4289 + 9e98097 commit 2f4d584
Show file tree
Hide file tree
Showing 24 changed files with 2,164 additions and 166,243 deletions.
28,421 changes: 0 additions & 28,421 deletions apps/canonical-bridge-ui/token-config/mainnet/cBridge/config.json

This file was deleted.

137,706 changes: 0 additions & 137,706 deletions apps/canonical-bridge-ui/token-config/mainnet/deBridge/config.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"address": "0x19e26B0638bf63aa9fa4d14c6baF8D52eBE86C5C",
"bridgeAddress": "0x77C71633C34C3784ede189d74223122422492a0f",
"decimals": 6,
"symbol": "USDC",
"symbol": "USDC.e",
"type": "hydra",
"endpointID": 30290,
"name": "USD Coin"
Expand Down Expand Up @@ -407,7 +407,7 @@
"address": "0x06efdbff2a14a7c8e15944d1f4a48f9f95f663a4",
"bridgeAddress": "0x3Fc69CC4A842838bCDC9499178740226062b14E4",
"decimals": 6,
"symbol": "USDC.e",
"symbol": "USDC",
"endpointID": 30214,
"name": "USD Coin"
},
Expand Down
20 changes: 9 additions & 11 deletions apps/canonical-bridge-ui/token-config/mainnet/useTransferConfig.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
import { useEffect, useState } from 'react';
import {
// ICBridgeTransferConfig,
ICBridgeTransferConfig,
IDeBridgeTransferConfig,
ITransferConfig,
} from '@bnb-chain/canonical-bridge-widget';
// import axios from 'axios';
import axios from 'axios';

// import { env } from '@/core/env';
import { env } from '@/core/env';
import stargateConfig from '@/token-config/mainnet/stargate/config.json';
import layerZeroConfig from '@/token-config/mainnet/layerZero/config.json';
import mesonConfig from '@/token-config/mainnet/meson/config.json';
import deBridgeRes from '@/token-config/mainnet/deBridge/config.json';
import cBridgeRes from '@/token-config/mainnet/cBridge/config.json';

export function useTransferConfig() {
const [transferConfig, setTransferConfig] = useState<ITransferConfig>();

useEffect(() => {
const initConfig = async () => {
// const [cBridgeRes, deBridgeRes] = await Promise.all([
// axios.get<{ data: ICBridgeTransferConfig }>(`${env.SERVER_ENDPOINT}/api/bridge/cbridge`),
// axios.get<{ data: IDeBridgeTransferConfig }>(`${env.SERVER_ENDPOINT}/api/bridge/debridge`),
// ]);
const [cBridgeRes, deBridgeRes] = await Promise.all([
axios.get<{ data: ICBridgeTransferConfig }>(`${env.SERVER_ENDPOINT}/api/bridge/cbridge`),
axios.get<{ data: IDeBridgeTransferConfig }>(`${env.SERVER_ENDPOINT}/api/bridge/debridge`),
]);

const cBridgeConfig = cBridgeRes.data;
const deBridgeConfig = handleDeBridgeConfig(deBridgeRes as any);
const cBridgeConfig = cBridgeRes.data.data;
const deBridgeConfig = handleDeBridgeConfig(deBridgeRes.data.data);

const transferConfig: ITransferConfig = {
defaultSelectedInfo: {
Expand Down
119 changes: 118 additions & 1 deletion common/config/rush/pnpm-lock.yaml

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

Loading

0 comments on commit 2f4d584

Please sign in to comment.