1
- import { Network } from '@wormhole-foundation/sdk-base' ;
1
+ import { Chain , Network } from '@wormhole-foundation/sdk-base' ;
2
2
3
3
export type FastTransferContracts = 'MatchingEngine' | 'TokenRouter' | 'USDCMint' ;
4
4
5
- // Will define more as we know what the mainnet addresses are
6
- export type MatchingEngineProgramId = 'mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS' ;
7
- export type TokenRouterProgramId = 'tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md' ;
8
- export type USDCMintAddress = '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU' ;
9
- export type SwapLayerProgramId = 'SwapLayer1111111111111111111111111111111111' ;
5
+ export type MatchingEngineProgramId =
6
+ | 'mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS'
7
+ | 'HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb' ;
8
+ export type TokenRouterProgramId =
9
+ | 'tD8RmtdcV7bzBeuFgyrFc8wvayj988ChccEzRQzo6md'
10
+ | '28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe' ;
11
+ export type USDCMintAddress =
12
+ | '4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU'
13
+ | 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' ;
14
+ export type SwapLayerProgramId =
15
+ | 'SwapLayer1111111111111111111111111111111111'
16
+ | '9Zv8ajzFjacRoYCgCPus4hq3pYjpNa9KkTFQ1sHa1h3d' ;
10
17
11
18
export interface SolanaContractAddresses {
12
19
MatchingEngine : MatchingEngineProgramId ;
@@ -27,15 +34,30 @@ export type ContractAddresses = SolanaContractAddresses | EthereumContractAddres
27
34
28
35
export type FastTransferContractAddresses = {
29
36
[ key in Network ] ?: {
30
- Solana ?: SolanaContractAddresses ;
31
- ArbitrumSepolia ?: EthereumContractAddresses ;
32
- Ethereum ?: EthereumContractAddresses ;
37
+ // For each chain, use SolanaContractAddresses if it's Solana, otherwise use EthereumContractAddresses
38
+ [ chain in Chain ] ?: chain extends 'Solana' ? SolanaContractAddresses : EthereumContractAddresses ;
33
39
} ;
34
40
} ;
35
41
36
42
// Will add more chains as needed
37
43
export const FAST_TRANSFER_CONTRACTS : FastTransferContractAddresses = {
38
- Mainnet : { } ,
44
+ Mainnet : {
45
+ Solana : {
46
+ MatchingEngine : 'HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb' ,
47
+ TokenRouter : '28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe' ,
48
+ USDCMint : 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' ,
49
+ // TODO: uncomment this when SwapLayer is deployed on Solana Mainnet
50
+ // SwapLayer: '9Zv8ajzFjacRoYCgCPus4hq3pYjpNa9KkTFQ1sHa1h3d',
51
+ } ,
52
+ Arbitrum : {
53
+ TokenRouter : '0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47' ,
54
+ CircleBridge : '0x19330d10D9Cc8751218eaf51E8885D058642E08A' ,
55
+ } ,
56
+ Base : {
57
+ TokenRouter : '0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47' ,
58
+ CircleBridge : '0x1682Ae6375C4E4A97e4B583BC394c861A46D8962' ,
59
+ } ,
60
+ } ,
39
61
Testnet : {
40
62
Solana : {
41
63
MatchingEngine : 'mPydpGUWxzERTNpyvTKdvS7v8kvw5sgwfiP8WQFrXVS' ,
@@ -49,5 +71,19 @@ export const FAST_TRANSFER_CONTRACTS: FastTransferContractAddresses = {
49
71
} ,
50
72
} ;
51
73
52
- // Will add more chains as needed
53
- export type FTChains = 'ArbitrumSepolia' ;
74
+ // Separate testnet and mainnet chains
75
+ export type FTEVMMainnetChain = 'Arbitrum' | 'Base' ;
76
+ export type FTEVMTestnetChain = 'ArbitrumSepolia' ;
77
+ export type FTEVMChain = FTEVMMainnetChain | FTEVMTestnetChain ;
78
+
79
+ export const FTEVMMainnetChains : FTEVMMainnetChain [ ] = [ 'Arbitrum' , 'Base' ] ;
80
+ export const FTEVMTestnetChains : FTEVMTestnetChain [ ] = [ 'ArbitrumSepolia' ] ;
81
+
82
+ export const isFTEVMChain = ( chain : Chain , network : Network ) : chain is FTEVMChain => {
83
+ if ( network === 'Mainnet' ) {
84
+ return FTEVMMainnetChains . includes ( chain as FTEVMMainnetChain ) ;
85
+ } else if ( network === 'Testnet' ) {
86
+ return FTEVMTestnetChains . includes ( chain as FTEVMTestnetChain ) ;
87
+ }
88
+ return false ;
89
+ } ;
0 commit comments