@web3auth/no-modal 10.5.5 → 10.5.6
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.
- package/dist/lib.cjs/base/utils.js +1 -1
- package/dist/lib.cjs/react/wagmi/provider.js +15 -1
- package/dist/lib.cjs/types/base/chain/IChainInterface.d.ts +4 -1
- package/dist/lib.cjs/vue/wagmi/provider.js +15 -1
- package/dist/lib.esm/base/utils.js +1 -1
- package/dist/lib.esm/react/wagmi/provider.js +16 -2
- package/dist/lib.esm/vue/wagmi/provider.js +16 -2
- package/package.json +2 -2
|
@@ -145,7 +145,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
|
|
|
145
145
|
ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig1 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig1 === void 0 ? void 0 : _walletServicesConfig1.defaultPortfolio
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
-
const sdkVersion = "10.5.
|
|
148
|
+
const sdkVersion = "10.5.6";
|
|
149
149
|
const getErrorAnalyticsProperties = error => {
|
|
150
150
|
try {
|
|
151
151
|
const code = error instanceof index.Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
|
|
@@ -124,6 +124,20 @@ function WagmiProvider(_ref) {
|
|
|
124
124
|
web3Auth,
|
|
125
125
|
isInitialized
|
|
126
126
|
} = useWeb3Auth.useWeb3Auth();
|
|
127
|
+
const getTransport = chain => {
|
|
128
|
+
const {
|
|
129
|
+
wsTarget,
|
|
130
|
+
rpcTarget,
|
|
131
|
+
fallbackWsTargets = [],
|
|
132
|
+
fallbackRpcTargets = []
|
|
133
|
+
} = chain;
|
|
134
|
+
const transports = [];
|
|
135
|
+
if (wsTarget) transports.push(wagmi.webSocket(wsTarget));
|
|
136
|
+
if (fallbackWsTargets.length > 0) transports.push(...fallbackWsTargets.map(target => wagmi.webSocket(target)));
|
|
137
|
+
if (rpcTarget) transports.push(wagmi.http(rpcTarget));
|
|
138
|
+
if (fallbackRpcTargets.length > 0) transports.push(...fallbackRpcTargets.map(target => wagmi.http(target)));
|
|
139
|
+
return wagmi.fallback(transports);
|
|
140
|
+
};
|
|
127
141
|
const finalConfig = react.useMemo(() => {
|
|
128
142
|
var _web3Auth$coreOptions;
|
|
129
143
|
web3Auth === null || web3Auth === void 0 || web3Auth.setAnalyticsProperties({
|
|
@@ -174,7 +188,7 @@ function WagmiProvider(_ref) {
|
|
|
174
188
|
} else {
|
|
175
189
|
wagmiChains.push(wagmiChain);
|
|
176
190
|
}
|
|
177
|
-
finalConfig.transports[wagmiChain.id] =
|
|
191
|
+
finalConfig.transports[wagmiChain.id] = getTransport(chain);
|
|
178
192
|
});
|
|
179
193
|
finalConfig.chains = [wagmiChains[0], ...wagmiChains.slice(1)];
|
|
180
194
|
}
|
|
@@ -8,4 +8,7 @@ export declare const CONNECTOR_NAMESPACES: {
|
|
|
8
8
|
};
|
|
9
9
|
export type ConnectorNamespaceType = (typeof CONNECTOR_NAMESPACES)[keyof typeof CONNECTOR_NAMESPACES];
|
|
10
10
|
export { CHAIN_NAMESPACES, type ChainNamespaceType };
|
|
11
|
-
export type CustomChainConfig = ProviderConfig
|
|
11
|
+
export type CustomChainConfig = ProviderConfig & {
|
|
12
|
+
fallbackRpcTargets?: string[];
|
|
13
|
+
fallbackWsTargets?: string[];
|
|
14
|
+
};
|
|
@@ -150,6 +150,20 @@ const WagmiProvider = vue.defineComponent({
|
|
|
150
150
|
} = useWeb3Auth.useWeb3Auth();
|
|
151
151
|
const finalConfig = vue.shallowRef(constants.defaultWagmiConfig);
|
|
152
152
|
const configKey = vue.ref(auth.randomId());
|
|
153
|
+
const getTransport = chain => {
|
|
154
|
+
const {
|
|
155
|
+
wsTarget,
|
|
156
|
+
rpcTarget,
|
|
157
|
+
fallbackWsTargets = [],
|
|
158
|
+
fallbackRpcTargets = []
|
|
159
|
+
} = chain;
|
|
160
|
+
const transports = [];
|
|
161
|
+
if (wsTarget) transports.push(viem.webSocket(wsTarget));
|
|
162
|
+
if (fallbackWsTargets.length > 0) transports.push(...fallbackWsTargets.map(target => viem.webSocket(target)));
|
|
163
|
+
if (rpcTarget) transports.push(viem.http(rpcTarget));
|
|
164
|
+
if (fallbackRpcTargets.length > 0) transports.push(...fallbackRpcTargets.map(target => viem.http(target)));
|
|
165
|
+
return viem.fallback(transports);
|
|
166
|
+
};
|
|
153
167
|
const defineWagmiConfig = () => {
|
|
154
168
|
var _web3Auth$value;
|
|
155
169
|
const configParams = _objectSpread(_objectSpread({
|
|
@@ -196,7 +210,7 @@ const WagmiProvider = vue.defineComponent({
|
|
|
196
210
|
} else {
|
|
197
211
|
wagmiChains.push(wagmiChain);
|
|
198
212
|
}
|
|
199
|
-
configParams.transports[wagmiChain.id] =
|
|
213
|
+
configParams.transports[wagmiChain.id] = getTransport(chain);
|
|
200
214
|
});
|
|
201
215
|
configParams.chains = [wagmiChains[0], ...wagmiChains.slice(1)];
|
|
202
216
|
}
|
|
@@ -145,7 +145,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
|
|
|
145
145
|
ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig1 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig1 === void 0 ? void 0 : _walletServicesConfig1.defaultPortfolio
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
|
-
const sdkVersion = "10.5.
|
|
148
|
+
const sdkVersion = "10.5.6";
|
|
149
149
|
const getErrorAnalyticsProperties = error => {
|
|
150
150
|
try {
|
|
151
151
|
const code = error instanceof Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
|
|
@@ -2,7 +2,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import { useMemo, createElement, useEffect, Fragment } from 'react';
|
|
4
4
|
import { defineChain } from 'viem';
|
|
5
|
-
import {
|
|
5
|
+
import { createConfig, WagmiProvider as WagmiProvider$1, webSocket, http, fallback, useConfig, useReconnect, useAccountEffect } from 'wagmi';
|
|
6
6
|
import { injected } from 'wagmi/connectors';
|
|
7
7
|
import { defaultWagmiConfig } from './constants.js';
|
|
8
8
|
import { useWeb3Auth } from '../hooks/useWeb3Auth.js';
|
|
@@ -113,6 +113,20 @@ function WagmiProvider(_ref) {
|
|
|
113
113
|
web3Auth,
|
|
114
114
|
isInitialized
|
|
115
115
|
} = useWeb3Auth();
|
|
116
|
+
const getTransport = chain => {
|
|
117
|
+
const {
|
|
118
|
+
wsTarget,
|
|
119
|
+
rpcTarget,
|
|
120
|
+
fallbackWsTargets = [],
|
|
121
|
+
fallbackRpcTargets = []
|
|
122
|
+
} = chain;
|
|
123
|
+
const transports = [];
|
|
124
|
+
if (wsTarget) transports.push(webSocket(wsTarget));
|
|
125
|
+
if (fallbackWsTargets.length > 0) transports.push(...fallbackWsTargets.map(target => webSocket(target)));
|
|
126
|
+
if (rpcTarget) transports.push(http(rpcTarget));
|
|
127
|
+
if (fallbackRpcTargets.length > 0) transports.push(...fallbackRpcTargets.map(target => http(target)));
|
|
128
|
+
return fallback(transports);
|
|
129
|
+
};
|
|
116
130
|
const finalConfig = useMemo(() => {
|
|
117
131
|
var _web3Auth$coreOptions;
|
|
118
132
|
web3Auth === null || web3Auth === void 0 || web3Auth.setAnalyticsProperties({
|
|
@@ -163,7 +177,7 @@ function WagmiProvider(_ref) {
|
|
|
163
177
|
} else {
|
|
164
178
|
wagmiChains.push(wagmiChain);
|
|
165
179
|
}
|
|
166
|
-
finalConfig.transports[wagmiChain.id] =
|
|
180
|
+
finalConfig.transports[wagmiChain.id] = getTransport(chain);
|
|
167
181
|
});
|
|
168
182
|
finalConfig.chains = [wagmiChains[0], ...wagmiChains.slice(1)];
|
|
169
183
|
}
|
|
@@ -3,7 +3,7 @@ import { hydrate } from '@wagmi/core';
|
|
|
3
3
|
import { configKey, createConfig, useConfig, useReconnect, useAccountEffect } from '@wagmi/vue';
|
|
4
4
|
import { injected } from '@wagmi/vue/connectors';
|
|
5
5
|
import { randomId } from '@web3auth/auth';
|
|
6
|
-
import { defineChain, webSocket, http } from 'viem';
|
|
6
|
+
import { defineChain, webSocket, http, fallback } from 'viem';
|
|
7
7
|
import { defineComponent, h, shallowRef, ref, watch, provide } from 'vue';
|
|
8
8
|
import { log } from '../../base/loglevel.js';
|
|
9
9
|
import { defaultWagmiConfig } from './constants.js';
|
|
@@ -142,6 +142,20 @@ const WagmiProvider = defineComponent({
|
|
|
142
142
|
} = useWeb3Auth();
|
|
143
143
|
const finalConfig = shallowRef(defaultWagmiConfig);
|
|
144
144
|
const configKey = ref(randomId());
|
|
145
|
+
const getTransport = chain => {
|
|
146
|
+
const {
|
|
147
|
+
wsTarget,
|
|
148
|
+
rpcTarget,
|
|
149
|
+
fallbackWsTargets = [],
|
|
150
|
+
fallbackRpcTargets = []
|
|
151
|
+
} = chain;
|
|
152
|
+
const transports = [];
|
|
153
|
+
if (wsTarget) transports.push(webSocket(wsTarget));
|
|
154
|
+
if (fallbackWsTargets.length > 0) transports.push(...fallbackWsTargets.map(target => webSocket(target)));
|
|
155
|
+
if (rpcTarget) transports.push(http(rpcTarget));
|
|
156
|
+
if (fallbackRpcTargets.length > 0) transports.push(...fallbackRpcTargets.map(target => http(target)));
|
|
157
|
+
return fallback(transports);
|
|
158
|
+
};
|
|
145
159
|
const defineWagmiConfig = () => {
|
|
146
160
|
var _web3Auth$value;
|
|
147
161
|
const configParams = _objectSpread(_objectSpread({
|
|
@@ -188,7 +202,7 @@ const WagmiProvider = defineComponent({
|
|
|
188
202
|
} else {
|
|
189
203
|
wagmiChains.push(wagmiChain);
|
|
190
204
|
}
|
|
191
|
-
configParams.transports[wagmiChain.id] =
|
|
205
|
+
configParams.transports[wagmiChain.id] = getTransport(chain);
|
|
192
206
|
});
|
|
193
207
|
configParams.chains = [wagmiChains[0], ...wagmiChains.slice(1)];
|
|
194
208
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/no-modal",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.6",
|
|
4
4
|
"description": "Multi chain wallet aggregator for web3Auth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web3Auth/no-modal",
|
|
@@ -203,5 +203,5 @@
|
|
|
203
203
|
"node": ">=20.x",
|
|
204
204
|
"npm": ">=9.x"
|
|
205
205
|
},
|
|
206
|
-
"gitHead": "
|
|
206
|
+
"gitHead": "beecdc3960697bcaf3575b89d88ca21625c1ff59"
|
|
207
207
|
}
|