feat: add support for Base chain USDC

This commit is contained in:
c4605
2024-12-10 22:13:50 +01:00
parent 0b8bc1e32e
commit 6651d083ca
3 changed files with 21 additions and 12 deletions

View File

@@ -268,11 +268,11 @@ export async function fromCorrespondingStacksToken(
assertExclude(restEVMTokenPossibilities, EVMToken.vLiALEX)
if (stacksToken === StacksToken.sUSDT) {
return [EVMToken.USDT, EVMToken.sUSDT]
return [EVMToken.sUSDT, EVMToken.USDT, EVMToken.USDC]
}
assertExclude(restEVMTokenPossibilities, EVMToken.USDT)
assertExclude(restEVMTokenPossibilities, EVMToken.sUSDT)
assertExclude(restEVMTokenPossibilities, EVMToken.USDT)
assertExclude(restEVMTokenPossibilities, EVMToken.USDC)
if (stacksToken === StacksToken.aBTC) {
return [EVMToken.aBTC, EVMToken.WBTC, EVMToken.BTCB, EVMToken.cbBTC]
}
@@ -317,8 +317,9 @@ export async function toCorrespondingStacksToken(
return StacksToken.vLiSTX
case EVMToken.vLiALEX:
return StacksToken.vLiALEX
case EVMToken.USDT:
case EVMToken.sUSDT:
case EVMToken.USDT:
case EVMToken.USDC:
return StacksToken.sUSDT
case EVMToken.aBTC:
case EVMToken.BTCB:

View File

@@ -230,7 +230,11 @@ const _getOnChainConfigsImpl = async (
[EVMToken.ALEX]: maybeAddress(configs[4]),
[EVMToken.vLiALEX]: maybeAddress(configs[5]),
[EVMToken.vLiSTX]: maybeAddress(configs[6]),
[EVMToken.USDT]: maybeAddress(configs[7]),
// prettier-ignore
[
chain === KnownChainId.EVM.Base ? EVMToken.USDC :
EVMToken.USDT
]: maybeAddress(configs[7]),
// prettier-ignore
[
chain === KnownChainId.EVM.BSC ? EVMToken.BTCB :

View File

@@ -49,10 +49,17 @@ export namespace KnownTokenId {
/** A namespace that contains constants and types for EVM-compatible tokens. */
export namespace EVM {
// USD[X]s
/** Represents the sUSDT token ID on EVM-compatible blockchains. */
export const sUSDT = tokenId("evm-susdt")
/** Represents the USDT token ID on EVM-compatible blockchains. */
export const USDT = tokenId("evm-usdt")
/** Represents the LUNR token ID on EVM-compatible blockchains. */
export const LUNR = tokenId("evm-lunr")
/** Represents the USDC token ID on EVM-compatible blockchains. */
export const USDC = tokenId("evm-usdc")
// BTC
/** Represents the aBTC token ID on EVM-compatible blockchains. */
export const aBTC = tokenId("evm-abtc")
/** Represents the WBTC token ID on EVM-compatible blockchains. */
export const WBTC = tokenId("evm-wbtc")
/** Represents the BTCB token ID on EVM-compatible blockchains. */
@@ -60,11 +67,8 @@ export namespace KnownTokenId {
/** Represents the cbBTC token ID on EVM-compatible blockchains. */
export const cbBTC = tokenId("evm-cbbtc")
// wrapped tokens
/** Represents the aBTC token ID on EVM-compatible blockchains. */
export const aBTC = tokenId("evm-abtc")
/** Represents the sUSDT token ID on EVM-compatible blockchains. */
export const sUSDT = tokenId("evm-susdt")
/** Represents the LUNR token ID on EVM-compatible blockchains. */
export const LUNR = tokenId("evm-lunr")
/** Represents the ALEX token ID on EVM-compatible blockchains. */
export const ALEX = tokenId("evm-alex")
/** Represents the SKO token ID on EVM-compatible blockchains. */