Skip to content

Commit b1fdbef

Browse files
committed
✨ Use network for connection request too
1 parent 7597c90 commit b1fdbef

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

inc/class-wp-rainbow.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ public function action_init() {
163163
'REDIRECT_URL' => esc_url( $this->get_redirect_url_filtered() ),
164164
'SITE_TITLE' => get_bloginfo( 'name' ),
165165
'COOL_MODE' => (bool) $this->get_cool_mode_filtered(),
166+
'NETWORK' => esc_textarea( $this->get_infura_network_filtered() ),
166167
]
167168
);
168169
wp_localize_script(
@@ -178,6 +179,7 @@ public function action_init() {
178179
'SITE_TITLE' => get_bloginfo( 'name' ),
179180
'LOGOUT_URL' => wp_logout_url(),
180181
'COOL_MODE' => (bool) $this->get_cool_mode_filtered(),
182+
'NETWORK' => esc_textarea( $this->get_infura_network_filtered() ),
181183
]
182184
);
183185
}
@@ -216,6 +218,7 @@ public function action_login_enqueue_scripts() {
216218
'REDIRECT_URL' => esc_url( $this->get_redirect_url_filtered() ),
217219
'SITE_TITLE' => get_bloginfo( 'name' ),
218220
'COOL_MODE' => (bool) $this->get_cool_mode_filtered(),
221+
'NETWORK' => esc_textarea( $this->get_infura_network_filtered() ),
219222
]
220223
);
221224
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wp-rainbow",
3-
"version": "0.2.13",
3+
"version": "0.2.14",
44
"description": "RainbowKit Login (Web3 Integration for Sign-In With Ethereum)",
55
"author": "Davis Shaver",
66
"license": "GPL-2.0-or-later",

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: WordPress, web3, SIWE, Ethereum, RainbowKit, Sign-In With Ethereum
44
Tested up to: 6.0
55
Requires at least: 5.9
66
Requires PHP: 7.0
7-
Stable tag: 0.2.13
7+
Stable tag: 0.2.14
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -31,6 +31,8 @@ Find reference implementations of all filters in [example plugin here](https://g
3131

3232
**`wp_rainbow_infura_id`** - Filter Infura ID to override settings value.
3333

34+
**`wp_rainbow_infura_network`** - Filter Infura network to override settings value.
35+
3436
**`wp_rainbow_redirect_url`** - Filter login redirect URL.
3537

3638
= What actions are included? =
@@ -45,6 +47,9 @@ Find reference implementations of all filters in [example plugin here](https://g
4547

4648
== Changelog ==
4749

50+
= 0.2.14 =
51+
* Use alternate network for connection request too
52+
4853
= 0.2.13 =
4954
* Add documentation for network filter
5055

src/connect.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function WPRainbowConnect( {
5555
const { signMessageAsync } = useSignMessage();
5656
const { data: ensName, isSuccess: isENSSuccess } = useEnsName( {
5757
address,
58+
chainId: 1,
5859
} );
5960
const { disconnectAsync } = useDisconnect();
6061

src/provider.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import stylePropType from 'react-style-proptype';
66
import PropTypes from 'prop-types';
77
import { WPRainbowConnect } from './connect';
88

9-
const { INFURA_ID, LOGGED_IN, SITE_TITLE, COOL_MODE } = wpRainbowData;
9+
const { INFURA_ID, LOGGED_IN, SITE_TITLE, COOL_MODE, NETWORK } = wpRainbowData;
1010

1111
const { chains, provider } = configureChains(
12-
[ chain.mainnet ],
12+
[
13+
...( NETWORK && chain[ NETWORK ] ? [ chain[ NETWORK ] ] : [] ),
14+
chain.mainnet,
15+
],
1316
[ infuraProvider( { infuraId: INFURA_ID } ) ]
1417
);
1518

wp-rainbow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* @var string
2929
*/
30-
define( 'WP_RAINBOW_ASSETS_VERSION', '0.2.13' );
30+
define( 'WP_RAINBOW_ASSETS_VERSION', '0.2.14' );
3131

3232
// Include the autoloader.
3333
add_action(

0 commit comments

Comments
 (0)