Skip to content

Commit

Permalink
feat: Update meson token name, symbol and address
Browse files Browse the repository at this point in the history
  • Loading branch information
Halibao-Lala committed Dec 18, 2024
1 parent 517bf53 commit 1744cd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class MesonAdapter extends BaseAdapter<IMesonChain[], IMesonChain, IMeson
symbolMap.set(chainId, new Map<string, IMesonToken>());

filteredTokens.forEach((token) => {
symbolMap.get(chainId)?.set(token.id?.toUpperCase(), token);
symbolMap.get(chainId)?.set(token.symbol?.toUpperCase(), token);
});

tokenMap.set(chainId, filteredTokens);
Expand All @@ -85,7 +85,7 @@ export class MesonAdapter extends BaseAdapter<IMesonChain[], IMesonChain, IMeson
const toToken = this.getToToken({
fromChainId: Number(fromChain.chainId),
toChainId: Number(toChain.chainId),
fromTokenSymbol: fromToken.id?.toUpperCase(),
fromTokenSymbol: fromToken.symbol?.toUpperCase(),
});

if (toToken) {
Expand All @@ -97,7 +97,7 @@ export class MesonAdapter extends BaseAdapter<IMesonChain[], IMesonChain, IMeson
fromTokenAddress: fromToken.addr,
toTokenAddress: toToken.addr,
};
transferableTokenMap.set(fromToken.id?.toUpperCase(), tokenPair);
transferableTokenMap.set(fromToken.symbol?.toUpperCase(), tokenPair);
}
});

Expand Down Expand Up @@ -131,14 +131,14 @@ export class MesonAdapter extends BaseAdapter<IMesonChain[], IMesonChain, IMeson

public getTokenInfo({ chainId, token }: { chainId: number; token: IMesonToken }) {
return {
name: (token as any).id?.toUpperCase(), // TODO
symbol: token.id.toUpperCase(),
name: token.name?.toUpperCase(), // TODO
symbol: token.symbol.toUpperCase(),
address: token.addr ?? '0x0000000000000000000000000000000000000000',
decimals: token.decimals,
...this.getTokenDisplaySymbolAndIcon({
chainId,
tokenAddress: token.addr ?? '0x0000000000000000000000000000000000000000',
defaultSymbol: token.id.toUpperCase(),
defaultSymbol: token.symbol.toUpperCase(),
}),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,13 @@ export function TransferButton({
const isValidToken = await bridgeSDK.meson.validateMesonToken({
fromChainId: fromChain?.id,
toChainId: toChain?.id,
fromTokenAddress: selectedToken.meson?.raw?.addr as `0x${string}`,
fromTokenAddress:
selectedToken.meson?.raw?.addr ?? '0x0000000000000000000000000000000000000000',
fromTokenSymbol: selectedToken.meson?.raw?.id as string,
fromTokenDecimals: selectedToken.meson?.raw?.decimals as number,
fromChainType: fromChain?.chainType,
toChainType: toChain?.chainType,
toTokenAddress: toToken?.meson?.raw?.addr as `0x${string}`,
toTokenAddress: toToken?.meson?.raw?.addr ?? '0x0000000000000000000000000000000000000000',
toTokenSymbol: toToken?.meson?.raw?.id,
toTokenDecimals: toToken?.meson?.raw?.decimals,
amount: Number(sendValue),
Expand Down

0 comments on commit 1744cd7

Please sign in to comment.