From cbd0c56399730635dbee4fc11873950463e591a6 Mon Sep 17 00:00:00 2001 From: OjusWiZard Date: Fri, 8 Dec 2023 03:53:29 +0530 Subject: [PATCH] fix (tokens): support correct casing Signed-off-by: OjusWiZard --- src/chains/tezos/tezos.base.ts | 3 +++ .../quipuswap/utils/config/config.ts | 18 ++++++++++++++++-- .../quipuswap/utils/config/tokens.ts | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/chains/tezos/tezos.base.ts b/src/chains/tezos/tezos.base.ts index cff3ff4cc3..d896b217df 100644 --- a/src/chains/tezos/tezos.base.ts +++ b/src/chains/tezos/tezos.base.ts @@ -208,6 +208,9 @@ export class TezosBase { if (spender === 'plenty') { // plenty doesn't need an allowance return { value: constants.MaxUint256, decimals: tokenDecimals }; + } else if (spender === 'quipuswap') { + // quipuswap doesn't need an allowance + return { value: constants.MaxUint256, decimals: tokenDecimals }; } let value = BigNumber.from(0); diff --git a/src/connectors/quipuswap/utils/config/config.ts b/src/connectors/quipuswap/utils/config/config.ts index 216724fec8..ab5190cdaa 100644 --- a/src/connectors/quipuswap/utils/config/config.ts +++ b/src/connectors/quipuswap/utils/config/config.ts @@ -14,9 +14,23 @@ export const KNOWN_DEX_TYPES = [ DexTypeEnum.YupanaWtez ]; +const tokenStandardiser = (token: typeof MainnetWhitelistTokens.tokens[0]) => { + if (token.metadata.symbol === 'TEZ') + token.metadata.symbol = 'XTZ'; + else + token.metadata.symbol = token.metadata.symbol.toUpperCase(); + return token; +}; + const TOKENS_MAP = { - [NetworkType.MAINNET]: MainnetWhitelistTokens, - [NetworkType.GHOSTNET]: GhostnetWhitelistTokens + [NetworkType.MAINNET]: { + ...MainnetWhitelistTokens, + tokens: MainnetWhitelistTokens.tokens.map(tokenStandardiser) + }, + [NetworkType.GHOSTNET]: { + ...GhostnetWhitelistTokens, + tokens: GhostnetWhitelistTokens.tokens.map(tokenStandardiser) + } }; export const networkTokens = (network: SupportedNetwork) => TOKENS_MAP[network]; diff --git a/src/connectors/quipuswap/utils/config/tokens.ts b/src/connectors/quipuswap/utils/config/tokens.ts index 5b2c352a58..e5e086fe7b 100644 --- a/src/connectors/quipuswap/utils/config/tokens.ts +++ b/src/connectors/quipuswap/utils/config/tokens.ts @@ -8,7 +8,7 @@ export const TEZOS_TOKEN: Token = { metadata: { decimals: 6, name: 'Tezos', - symbol: 'TEZ', + symbol: 'XTZ', thumbnailUri: `${IPFS_GATEWAY}/Qmf3brydfr8c6CKGUUu73Dd7wfBw66Zbzof5E1BWGeU222` } };