Skip to content

Commit

Permalink
Merge pull request #57 from davisshaver/v0.4.5
Browse files Browse the repository at this point in the history
Update network support
  • Loading branch information
davisshaver authored Feb 13, 2024
2 parents 04d2395 + 328786b commit 962e731
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 22 deletions.
13 changes: 8 additions & 5 deletions inc/class-wp-rainbow-login-functionality.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,14 @@ public function nonce_callback(): WP_REST_Response {
*/
private function map_filtered_network_to_infura_endpoint( string $filtered_network ): string {
$overrides = [
'polygon' => 'polygon-mainnet',
'optimism' => 'optimism-mainnet',
'arbitrum' => 'arbitrum-mainnet',
'polygon' => 'polygon-mainnet',
'optimismGoerli' => 'optimism-goerli',
'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 ];
Expand Down
12 changes: 9 additions & 3 deletions inc/class-wp-rainbow-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,16 @@ public function action_rest_api_init() {
'description' => 'Infura network',
'enum' => [
'mainnet',
'ropsten',
'kovan',
'rinkeby',
'goerli',
'sepolia',
'polygon',
'polygonMumbai',
'optimism',
'optimismGoerli',
'optimismSepolia',
'arbitrum',
'arbitrumGoerli',
'arbitrumSepolia',
],
],
'wp_rainbow_field_walletconnect_project_id' => [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-rainbow",
"version": "0.4.4",
"version": "0.4.5",
"description": "RainbowKit Login (Web3 Integration for Sign-In With Ethereum)",
"author": "Davis Shaver",
"license": "GPL-2.0-or-later",
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== RainbowKit Login (Web3 Integration for Sign-In With Ethereum) ===
Contributors: davisshaver
Tags: WordPress, web3, SIWE, Ethereum, RainbowKit, Sign-In With Ethereum
Tested up to: 6.4.1
Tested up to: 6.4.3
Requires at least: 5.9
Requires PHP: 7.0
Stable tag: 0.4.4
Stable tag: 0.4.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -70,6 +70,9 @@ Find reference implementations of all filters in [example plugin here](https://g

== Changelog ==

= 0.4.5 =
* Fix bug with Polygon network, add Polygon Mumbai

= 0.4.4 =
* Update dependencies/support WordPress 6.4

Expand Down
20 changes: 14 additions & 6 deletions src/provider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ import {
} from '@rainbow-me/rainbowkit/wallets';
import { createConfig, configureChains, WagmiConfig } from 'wagmi';
import {
mainnet,
optimism,
arbitrum,
arbitrumGoerli,
arbitrumSepolia,
goerli,
polygon,
mainnet,
optimism,
optimismGoerli,
optimismSepolia,
polygon,
polygonMumbai,
sepolia,
} from 'wagmi/chains';
import { infuraProvider } from 'wagmi/providers/infura';
Expand Down Expand Up @@ -47,12 +51,16 @@ const themes = {
};

const allChains = {
mainnet,
optimism,
arbitrum,
arbitrumGoerli,
arbitrumSepolia,
goerli,
polygon,
mainnet,
optimism,
optimismGoerli,
optimismSepolia,
polygon,
polygonMumbai,
sepolia,
};

Expand Down
18 changes: 15 additions & 3 deletions src/settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,26 @@ function WPRainbowSettings() {
id="wp_rainbow_field_infura_network"
>
<option value="mainnet">Mainnet</option>
<option value="optimism">Optimism</option>
<option value="arbitrum">Arbitrum</option>
<option value="polygon">Polygon</option>
<option value="goerli">Goerli</option>
<option value="sepolia">Sepolia</option>
<option value="polygon">Polygon</option>
<option value="polygonMumbai">
Polygon Mumbai
</option>
<option value="optimism">Optimism</option>
<option value="optimismGoerli">
Optimism Goerli
</option>
<option value="optimismSepolia">
Optimism Sepolia
</option>
<option value="arbitrum">Arbitrum</option>
<option value="arbitrumGoerli">
Arbitrum Goerli
</option>
<option value="arbitrumSepolia">
Arbitrum Sepolia
</option>
</select>
<p>
<em>
Expand Down
4 changes: 2 additions & 2 deletions wp-rainbow.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: RainbowKit Login (Web3 Integration for Sign-In With Ethereum)
* Plugin URI: https://wp-rainbow.davisshaver.com/
* Description: RainbowKit Login allows WordPress users to log in with Ethereum using the Sign-In With Ethereum standard, powered by RainbowKit.
* Version: 0.4.4
* Version: 0.4.5
* Author: Davis Shaver
* Author URI: https://davisshaver.com/
* License: GPL v2 or later
Expand All @@ -27,7 +27,7 @@
/**
* WP Rainbow version number
*/
define( 'WP_RAINBOW_ASSETS_VERSION', '0.4.4' );
define( 'WP_RAINBOW_ASSETS_VERSION', '0.4.5' );

// Include the autoloader.
add_action(
Expand Down

0 comments on commit 962e731

Please sign in to comment.