@meshconnect/uwc-react 0.15.17 → 0.15.18-snapshot.c392d3d
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UniversalWalletConnector, type UWCObserver } from '@meshconnect/uwc-core';
|
|
3
|
-
import type { Session, Network, WalletMetadata, WalletConnectConfig, TonConnectConfig, TronConnectorConfig, Logger, LogLevel } from '@meshconnect/uwc-types';
|
|
3
|
+
import type { Session, Network, WalletMetadata, WalletConnectConfig, TonConnectConfig, TronConnectorConfig, Logger, LogLevel, Namespace } from '@meshconnect/uwc-types';
|
|
4
4
|
export interface ConnectionContextValue {
|
|
5
5
|
/**
|
|
6
6
|
* `null` when the provider is mounted without wallets. `@meshconnect/uwc-core`
|
|
@@ -43,7 +43,13 @@ interface ConnectionProviderProps {
|
|
|
43
43
|
* connector construction, like the observability props above.
|
|
44
44
|
*/
|
|
45
45
|
secondaryGatherTimeoutMs?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Namespace preference for a connect that names no network (injected mode,
|
|
48
|
+
* detected namespaces only). See `UWCConfig.preferredNamespaces`. Read once at
|
|
49
|
+
* connector construction.
|
|
50
|
+
*/
|
|
51
|
+
preferredNamespaces?: readonly Namespace[];
|
|
46
52
|
}
|
|
47
|
-
export declare function ConnectionProvider({ children, networks, wallets, usingIntegratedBrowser, walletConnectConfig, tonConnectConfig, tronConnectorConfig, observer, logger, logLevel, correlationId, secondaryGatherTimeoutMs }: ConnectionProviderProps): React.ReactElement;
|
|
53
|
+
export declare function ConnectionProvider({ children, networks, wallets, usingIntegratedBrowser, walletConnectConfig, tonConnectConfig, tronConnectorConfig, observer, logger, logLevel, correlationId, secondaryGatherTimeoutMs, preferredNamespaces }: ConnectionProviderProps): React.ReactElement;
|
|
48
54
|
export { ConnectionContext };
|
|
49
55
|
//# sourceMappingURL=ConnectionProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ConnectionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAA;AACjE,OAAO,EACL,wBAAwB,EAExB,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,EACN,QAAQ,
|
|
1
|
+
{"version":3,"file":"ConnectionProvider.d.ts","sourceRoot":"","sources":["../../src/providers/ConnectionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAA;AACjE,OAAO,EACL,wBAAwB,EAExB,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,EACV,MAAM,wBAAwB,CAAA;AAkC/B,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,SAAS,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAC1C,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,iBAAiB,8CAAqD,CAAA;AAE5E,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;IACvC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;CAC3C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,sBAA8B,EAC9B,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACpB,EAAE,uBAAuB,GAAG,KAAK,CAAC,YAAY,CAwF9C;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -27,7 +27,7 @@ const EMPTY_SESSION = {
|
|
|
27
27
|
availableAddresses: []
|
|
28
28
|
};
|
|
29
29
|
const ConnectionContext = createContext(null);
|
|
30
|
-
export function ConnectionProvider({ children, networks, wallets, usingIntegratedBrowser = false, walletConnectConfig, tonConnectConfig, tronConnectorConfig, observer, logger, logLevel, correlationId, secondaryGatherTimeoutMs }) {
|
|
30
|
+
export function ConnectionProvider({ children, networks, wallets, usingIntegratedBrowser = false, walletConnectConfig, tonConnectConfig, tronConnectorConfig, observer, logger, logLevel, correlationId, secondaryGatherTimeoutMs, preferredNamespaces }) {
|
|
31
31
|
// Core rejects an empty wallet list, so only construct once there is at least
|
|
32
32
|
// one wallet. A wallet-less session keeps `connector` null; the effect below
|
|
33
33
|
// adopts the connector if wallets arrive later (async catalog population).
|
|
@@ -53,6 +53,8 @@ export function ConnectionProvider({ children, networks, wallets, usingIntegrate
|
|
|
53
53
|
// bound" value and would be dropped by a truthy check.
|
|
54
54
|
if (secondaryGatherTimeoutMs !== undefined)
|
|
55
55
|
config.secondaryGatherTimeoutMs = secondaryGatherTimeoutMs;
|
|
56
|
+
if (preferredNamespaces !== undefined)
|
|
57
|
+
config.preferredNamespaces = preferredNamespaces;
|
|
56
58
|
sharedConnector = new UniversalWalletConnector(config);
|
|
57
59
|
capturedObservability = {
|
|
58
60
|
hadObserver: !!observer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionProvider.js","sourceRoot":"","sources":["../../src/providers/ConnectionProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EACL,wBAAwB,EAGzB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ConnectionProvider.js","sourceRoot":"","sources":["../../src/providers/ConnectionProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EACL,wBAAwB,EAGzB,MAAM,uBAAuB,CAAA;AAa9B,sCAAsC;AACtC,IAAI,eAAe,GAAoC,IAAI,CAAA;AAC3D,yEAAyE;AACzE,4EAA4E;AAC5E,gEAAgE;AAChE,IAAI,qBAAqB,GAKd,IAAI,CAAA;AACf,IAAI,uBAAuB,GAAG,KAAK,CAAA;AAEnC;;;;;;GAMG;AACH,MAAM,aAAa,GAAY;IAC7B,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,wBAAwB,EAAE,IAAI;IAC9B,+BAA+B,EAAE,IAAI;IACrC,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,IAAI;IACf,iBAAiB,EAAE,EAAE;IACrB,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,EAAE;CACvB,CAAA;AAkBD,MAAM,iBAAiB,GAAG,aAAa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C/C,CAAA;IACD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC,CAAA;IAE3E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,SAAS;YAAE,OAAM;QAEtB,0EAA0E;QAC1E,6DAA6D;QAC7D,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAA;QAClC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;QAE/B,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE;YAC3C,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAA;YAClC,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;QAEF,OAAO,WAAW,CAAA;IACpB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,MAAM,KAAK,GAA2B;QACpC,SAAS;QACT,OAAO;QACP,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,OAAO;QACrD,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,QAAQ;QACxD,OAAO;KACR,CAAA;IAED,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACrC,QAAQ,GACkB,CAC9B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshconnect/uwc-react",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.18-snapshot.c392d3d",
|
|
4
4
|
"description": "React hooks and components for Universal Wallet Connector",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"src"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@meshconnect/uwc-core": "2.
|
|
20
|
-
"@meshconnect/uwc-types": "0.
|
|
19
|
+
"@meshconnect/uwc-core": "2.7.0-snapshot.c392d3d",
|
|
20
|
+
"@meshconnect/uwc-types": "0.32.0-snapshot.c392d3d"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.3.0 || ^19.0.0"
|
|
@@ -12,7 +12,8 @@ import type {
|
|
|
12
12
|
TonConnectConfig,
|
|
13
13
|
TronConnectorConfig,
|
|
14
14
|
Logger,
|
|
15
|
-
LogLevel
|
|
15
|
+
LogLevel,
|
|
16
|
+
Namespace
|
|
16
17
|
} from '@meshconnect/uwc-types'
|
|
17
18
|
|
|
18
19
|
// Guard against double initialization
|
|
@@ -91,6 +92,12 @@ interface ConnectionProviderProps {
|
|
|
91
92
|
* connector construction, like the observability props above.
|
|
92
93
|
*/
|
|
93
94
|
secondaryGatherTimeoutMs?: number
|
|
95
|
+
/**
|
|
96
|
+
* Namespace preference for a connect that names no network (injected mode,
|
|
97
|
+
* detected namespaces only). See `UWCConfig.preferredNamespaces`. Read once at
|
|
98
|
+
* connector construction.
|
|
99
|
+
*/
|
|
100
|
+
preferredNamespaces?: readonly Namespace[]
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
export function ConnectionProvider({
|
|
@@ -105,7 +112,8 @@ export function ConnectionProvider({
|
|
|
105
112
|
logger,
|
|
106
113
|
logLevel,
|
|
107
114
|
correlationId,
|
|
108
|
-
secondaryGatherTimeoutMs
|
|
115
|
+
secondaryGatherTimeoutMs,
|
|
116
|
+
preferredNamespaces
|
|
109
117
|
}: ConnectionProviderProps): React.ReactElement {
|
|
110
118
|
// Core rejects an empty wallet list, so only construct once there is at least
|
|
111
119
|
// one wallet. A wallet-less session keeps `connector` null; the effect below
|
|
@@ -125,6 +133,8 @@ export function ConnectionProvider({
|
|
|
125
133
|
// bound" value and would be dropped by a truthy check.
|
|
126
134
|
if (secondaryGatherTimeoutMs !== undefined)
|
|
127
135
|
config.secondaryGatherTimeoutMs = secondaryGatherTimeoutMs
|
|
136
|
+
if (preferredNamespaces !== undefined)
|
|
137
|
+
config.preferredNamespaces = preferredNamespaces
|
|
128
138
|
sharedConnector = new UniversalWalletConnector(config)
|
|
129
139
|
capturedObservability = {
|
|
130
140
|
hadObserver: !!observer,
|