feat: add LINK token support

This commit is contained in:
c4605
2025-04-07 10:38:45 +02:00
parent 84ddd2d878
commit 9a1c650359
3 changed files with 18 additions and 0 deletions

View File

@@ -225,6 +225,7 @@ const _getOnChainConfigsImpl = async (
ONCHAIN_CONFIG_KEY.TOKEN_GHIBLICZ,
ONCHAIN_CONFIG_KEY.TOKEN_ETH,
ONCHAIN_CONFIG_KEY.TOKEN_SOL,
ONCHAIN_CONFIG_KEY.TOKEN_LINK,
],
],
}).catch(err => {
@@ -274,6 +275,7 @@ const _getOnChainConfigsImpl = async (
[EVMToken.GHIBLICZ]: maybeAddress(configs[19]),
[EVMToken.ETH]: maybeAddress(configs[20]),
[EVMToken.SOL]: maybeAddress(configs[21]),
[EVMToken.LINK]: maybeAddress(configs[22]),
}
}
function maybeAddress(value: string | null): Address | undefined {
@@ -329,4 +331,7 @@ enum ONCHAIN_CONFIG_KEY {
// https://t.me/c/1599543687/73387
TOKEN_SOL = "TOKEN_SOL",
// https://t.me/c/1599543687/73476
TOKEN_LINK = "TOKEN_LINK",
}

View File

@@ -370,4 +370,14 @@ export const stxTokenContractAddresses_legacy: Record<
contractName: "token-sol",
}),
},
[KnownTokenId.Stacks.LINK]: {
[KnownChainId.Stacks.Mainnet]: wrapContractAddress("mainnet", {
deployerAddress: xlinkContractsMultisigMainnet,
contractName: "token-link",
}),
[KnownChainId.Stacks.Testnet]: wrapContractAddress("testnet", {
deployerAddress: xlinkContractsMultisigTestnet,
contractName: "token-link",
}),
},
}

View File

@@ -86,6 +86,7 @@ export namespace KnownTokenId {
export const GHIBLICZ = tokenId("evm-ghiblicz")
export const ETH = tokenId("evm-eth")
export const SOL = tokenId("evm-sol")
export const LINK = tokenId("evm-link")
}
/** This type includes all known tokens on EVM-compatible blockchains. */
export type EVMToken = (typeof _allKnownEVMTokens)[number]
@@ -120,6 +121,7 @@ export namespace KnownTokenId {
export const GHIBLICZ = tokenId("stx-ghiblicz")
export const ETH = tokenId("stx-eth")
export const SOL = tokenId("stx-sol")
export const LINK = tokenId("stx-link")
}
const _allKnownStacksTokens = [
Stacks.sUSDT,
@@ -138,6 +140,7 @@ export namespace KnownTokenId {
Stacks.GHIBLICZ,
Stacks.ETH,
Stacks.SOL,
Stacks.LINK,
] as const
export type StacksToken =
| TokenId<`a Stacks token`>