-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1c4681
commit 576e88c
Showing
4 changed files
with
57 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
<?php | ||
/** | ||
* General purpose functions file | ||
* | ||
* @package WP_Rainbow | ||
*/ | ||
|
||
/** | ||
* Map filtered Infura network to an Infura endpoint value. | ||
* | ||
* @param string $filtered_network Filtered Infura network. | ||
* | ||
* @return string Infura endpoint or default | ||
*/ | ||
function map_filtered_network_to_infura_endpoint( string $filtered_network ): string { | ||
$overrides = [ | ||
'arbitrum' => 'arbitrum-mainnet', | ||
'arbitrumGoerli' => 'arbitrum-goerli', | ||
'arbitrumSepolia' => 'arbitrum-sepolia', | ||
'optimism' => 'optimism-mainnet', | ||
'optimismGoerli' => 'optimism-goerli', | ||
'optimismSepolia' => 'optimism-sepolia', | ||
'polygon' => 'polygon-mainnet', | ||
'polygonMumbai' => 'polygon-mumbai', | ||
]; | ||
if ( ! empty( $overrides[ $filtered_network ] ) ) { | ||
return $overrides[ $filtered_network ]; | ||
} | ||
function wp_rainbow_map_filtered_network_to_infura_endpoint( string $filtered_network ): string { | ||
$overrides = [ | ||
'arbitrum' => 'arbitrum-mainnet', | ||
'arbitrumGoerli' => 'arbitrum-goerli', | ||
'arbitrumSepolia' => 'arbitrum-sepolia', | ||
'optimism' => 'optimism-mainnet', | ||
'optimismGoerli' => 'optimism-goerli', | ||
'optimismSepolia' => 'optimism-sepolia', | ||
'polygon' => 'polygon-mainnet', | ||
'polygonMumbai' => 'polygon-mumbai', | ||
]; | ||
if ( ! empty( $overrides[ $filtered_network ] ) ) { | ||
return $overrides[ $filtered_network ]; | ||
} | ||
|
||
return $filtered_network; | ||
return $filtered_network; | ||
} |