Skip to content

Commit

Permalink
feat: Add meson
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Oct 18, 2024
1 parent 83a50ad commit a6eaaaa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/canonical-bridge-ui/pages/testnet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const bridgeConfig: ICanonicalBridgeConfig = {
assetPrefix: env.ASSET_PREFIX,

appearance: {
bridgeTitle: 'BNB Chain Cross-Chain Bridge',
bridgeTitle: 'BNB Chain Cross-Chain Bridge Testnet',
locale: 'en',
messages,
mode: 'dark',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BaseAdapter, ITransferTokenPair } from '@/modules/aggregator/shared/Bas
import { IMesonChain, IMesonToken } from '@/modules/aggregator/adapters/meson/types';

const SUPPORTED_CHAIN_IDS = [56, 97, 728126427, 728126428];
const SUPPORTED_TOKENS = ['USDT'];
const SUPPORTED_TOKENS = ['USDT', 'USDC'];

export class MesonAdapter extends BaseAdapter<IMesonChain[], IMesonChain, IMesonToken> {
public bridgeType: BridgeType = 'meson';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export const useGetTronAllowance = () => {
trc20Address: selectedToken?.address,
tronBridgeAddress: transferActionInfo?.bridgeAddress,
});
if (typeof allowance === 'bigint' && !!allowance) setAllowance(allowance);
if (typeof allowance === 'bigint' && allowance !== null) {
setAllowance(allowance);
} else if (typeof allowance?.[0] === 'bigint') {
setAllowance(allowance?.[0]);
}
// eslint-disable-next-line no-console
console.log('Tron token allowance', allowance);
return { allowance };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useIntl,
InputGroup,
InputRightElement,
Checkbox,
} from '@bnb-chain/space';
import { ChangeEvent, useRef, useState } from 'react';

Expand All @@ -22,7 +23,7 @@ export function ToAccount(props: FlexProps) {
const { formatMessage } = useIntl();
const dispatch = useAppDispatch();

// const [isChecked, setIsChecked] = useState(false);
const [isChecked, setIsChecked] = useState(false);

const toAccount = useAppSelector((state) => state.transfer.toAccount);
const toChain = useAppSelector((state) => state.transfer.toChain);
Expand Down Expand Up @@ -51,13 +52,13 @@ export function ToAccount(props: FlexProps) {

const isInvalid = !isAvailableAccount && !!toAccount.address;

// const onCheckboxChange = (e: React.ChangeEvent<HTMLInputElement>) => {
// if (e.target.checked === true) {
// setIsChecked(true);
// } else {
// setIsChecked(false);
// }
// };
const onCheckboxChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (e.target.checked === true) {
setIsChecked(true);
} else {
setIsChecked(false);
}
};

return (
<Flex
Expand Down

0 comments on commit a6eaaaa

Please sign in to comment.