Skip to content

Commit

Permalink
fix (tokens): support correct casing
Browse files Browse the repository at this point in the history
Signed-off-by: OjusWiZard <ojuswimail@gmail.com>
  • Loading branch information
OjusWiZard committed Dec 19, 2023
1 parent bdc1f56 commit cbd0c56
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/chains/tezos/tezos.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 16 additions & 2 deletions src/connectors/quipuswap/utils/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/quipuswap/utils/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const TEZOS_TOKEN: Token = {
metadata: {
decimals: 6,
name: 'Tezos',
symbol: 'TEZ',
symbol: 'XTZ',
thumbnailUri: `${IPFS_GATEWAY}/Qmf3brydfr8c6CKGUUu73Dd7wfBw66Zbzof5E1BWGeU222`
}
};
Expand Down

0 comments on commit cbd0c56

Please sign in to comment.