@wagmi/core 0.8.13 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -131,7 +131,7 @@ function fallbackProvider(targetQuorum, minQuorum, providers_, { stallTimeout })
|
|
|
131
131
|
|
|
132
132
|
// src/client.ts
|
|
133
133
|
import { persist, subscribeWithSelector } from "zustand/middleware";
|
|
134
|
-
import {
|
|
134
|
+
import { createStore } from "zustand/vanilla";
|
|
135
135
|
|
|
136
136
|
// src/utils/assertActiveChain.ts
|
|
137
137
|
function assertActiveChain({
|
|
@@ -504,7 +504,7 @@ var Client = class {
|
|
|
504
504
|
} catch (_error) {
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
this.store =
|
|
507
|
+
this.store = createStore(
|
|
508
508
|
subscribeWithSelector(
|
|
509
509
|
persist(
|
|
510
510
|
() => ({
|
|
@@ -514,9 +514,8 @@ var Client = class {
|
|
|
514
514
|
webSocketProvider: this.getWebSocketProvider({ chainId })
|
|
515
515
|
}),
|
|
516
516
|
{
|
|
517
|
-
deserialize: (state) => state,
|
|
518
517
|
name: storeKey,
|
|
519
|
-
|
|
518
|
+
storage,
|
|
520
519
|
partialize: (state) => ({
|
|
521
520
|
...autoConnect && {
|
|
522
521
|
data: {
|
|
@@ -526,7 +525,6 @@ var Client = class {
|
|
|
526
525
|
},
|
|
527
526
|
chains: state?.chains
|
|
528
527
|
}),
|
|
529
|
-
serialize: (state) => state,
|
|
530
528
|
version: 2
|
|
531
529
|
}
|
|
532
530
|
)
|
|
@@ -2431,7 +2429,7 @@ async function readContracts({
|
|
|
2431
2429
|
}
|
|
2432
2430
|
|
|
2433
2431
|
// src/actions/contracts/watchContractEvent.ts
|
|
2434
|
-
import shallow from "zustand/shallow";
|
|
2432
|
+
import { shallow } from "zustand/shallow";
|
|
2435
2433
|
function watchContractEvent({
|
|
2436
2434
|
address,
|
|
2437
2435
|
abi,
|
|
@@ -2472,7 +2470,7 @@ function watchContractEvent({
|
|
|
2472
2470
|
}
|
|
2473
2471
|
|
|
2474
2472
|
// src/actions/network-status/watchBlockNumber.ts
|
|
2475
|
-
import shallow2 from "zustand/shallow";
|
|
2473
|
+
import { shallow as shallow2 } from "zustand/shallow";
|
|
2476
2474
|
|
|
2477
2475
|
// src/actions/network-status/fetchBlockNumber.ts
|
|
2478
2476
|
async function fetchBlockNumber({
|
|
@@ -2740,7 +2738,7 @@ async function waitForTransaction({
|
|
|
2740
2738
|
}
|
|
2741
2739
|
|
|
2742
2740
|
// src/actions/transactions/watchPendingTransactions.ts
|
|
2743
|
-
import shallow3 from "zustand/shallow";
|
|
2741
|
+
import { shallow as shallow3 } from "zustand/shallow";
|
|
2744
2742
|
function watchPendingTransactions(args, callback) {
|
|
2745
2743
|
let previousProvider;
|
|
2746
2744
|
const createListener = (provider) => {
|
|
@@ -3003,7 +3001,7 @@ async function switchNetwork({
|
|
|
3003
3001
|
}
|
|
3004
3002
|
|
|
3005
3003
|
// src/actions/accounts/watchAccount.ts
|
|
3006
|
-
import shallow4 from "zustand/shallow";
|
|
3004
|
+
import { shallow as shallow4 } from "zustand/shallow";
|
|
3007
3005
|
function watchAccount(callback, { selector = (x) => x } = {}) {
|
|
3008
3006
|
const client2 = getClient();
|
|
3009
3007
|
const handleChange = () => callback(getAccount());
|
|
@@ -3022,7 +3020,7 @@ function watchAccount(callback, { selector = (x) => x } = {}) {
|
|
|
3022
3020
|
}
|
|
3023
3021
|
|
|
3024
3022
|
// src/actions/accounts/watchNetwork.ts
|
|
3025
|
-
import shallow5 from "zustand/shallow";
|
|
3023
|
+
import { shallow as shallow5 } from "zustand/shallow";
|
|
3026
3024
|
function watchNetwork(callback, { selector = (x) => x } = {}) {
|
|
3027
3025
|
const client2 = getClient();
|
|
3028
3026
|
const handleChange = () => callback(getNetwork());
|
|
@@ -3037,7 +3035,7 @@ function watchNetwork(callback, { selector = (x) => x } = {}) {
|
|
|
3037
3035
|
}
|
|
3038
3036
|
|
|
3039
3037
|
// src/actions/accounts/watchSigner.ts
|
|
3040
|
-
import shallow6 from "zustand/shallow";
|
|
3038
|
+
import { shallow as shallow6 } from "zustand/shallow";
|
|
3041
3039
|
function watchSigner({ chainId }, callback) {
|
|
3042
3040
|
const client2 = getClient();
|
|
3043
3041
|
const handleChange = async () => {
|
package/dist/index.d.ts
CHANGED
|
@@ -855,6 +855,10 @@ declare class Client<TProvider extends Provider = Provider, TWebSocketProvider e
|
|
|
855
855
|
(listener: (selectedState: State<TProvider, TWebSocketProvider>, previousSelectedState: State<TProvider, TWebSocketProvider>) => void): () => void;
|
|
856
856
|
<U>(selector: (state: State<TProvider, TWebSocketProvider>) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
857
857
|
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
858
|
+
/**
|
|
859
|
+
* Custom storage for data persistance
|
|
860
|
+
* @default window.localStorage
|
|
861
|
+
*/
|
|
858
862
|
fireImmediately?: boolean | undefined;
|
|
859
863
|
} | undefined): () => void;
|
|
860
864
|
};
|
package/dist/index.js
CHANGED
package/dist/internal/index.js
CHANGED
package/dist/internal/test.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wagmi/core",
|
|
3
3
|
"description": "Vanilla JS library for Ethereum",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.14",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/wagmi-dev/wagmi.git",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"abitype": "^0.2.5",
|
|
115
115
|
"eventemitter3": "^4.0.7",
|
|
116
|
-
"zustand": "^4.1
|
|
116
|
+
"zustand": "^4.3.1",
|
|
117
117
|
"@wagmi/chains": "0.1.9",
|
|
118
118
|
"@wagmi/connectors": "0.1.7"
|
|
119
119
|
},
|