@meshconnect/uwc-types 0.34.1-snapshot.de1f497 → 0.35.0
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/connector.d.ts +28 -23
- package/dist/connector.d.ts.map +1 -1
- package/dist/observability.d.ts +1 -1
- package/package.json +1 -1
- package/src/connector.ts +29 -23
- package/src/observability.ts +1 -1
package/dist/connector.d.ts
CHANGED
|
@@ -53,6 +53,27 @@ export interface SwitchNetworkResult {
|
|
|
53
53
|
address: string;
|
|
54
54
|
availableAddresses?: AvailableAddress[];
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Where an auto-picked connect may fall back to, and how the connector reports
|
|
58
|
+
* and abandons it. The three fields belong together: core builds them as one
|
|
59
|
+
* value on its own connector call (see {@link ConnectorConnectOptions.fallback}).
|
|
60
|
+
*/
|
|
61
|
+
export interface NamespaceFallback {
|
|
62
|
+
/** The network to connect on instead. */
|
|
63
|
+
network: Network;
|
|
64
|
+
/**
|
|
65
|
+
* Called once when the connector moves the connect to `network`, before it
|
|
66
|
+
* asks the wallet for it, so this attempt's own terminal is filed under the
|
|
67
|
+
* fallback, whatever other attempt started meanwhile.
|
|
68
|
+
*/
|
|
69
|
+
onFallback: () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Fires when this connect is cancelled or superseded (a newer connect on any
|
|
72
|
+
* mode). The connector does not start the fallback, or its prompt, once it
|
|
73
|
+
* has fired. Read by the fallback only.
|
|
74
|
+
*/
|
|
75
|
+
signal: AbortSignal;
|
|
76
|
+
}
|
|
56
77
|
/**
|
|
57
78
|
* Per-attempt options for {@link Connector.connect}.
|
|
58
79
|
*
|
|
@@ -111,11 +132,12 @@ export interface ConnectorConnectOptions {
|
|
|
111
132
|
*/
|
|
112
133
|
secondaryPromptGapMs?: number;
|
|
113
134
|
/**
|
|
114
|
-
*
|
|
115
|
-
* because its ACTIVE account cannot hold the target's namespace:
|
|
116
|
-
* a Solana-only account answers `eth_requestAccounts` with
|
|
117
|
-
* "Requested resource not available." after its "Unsupported account"
|
|
118
|
-
* dialog, and connects that same account on Solana.
|
|
135
|
+
* Lets an auto-picked connect move to another network when the wallet refuses
|
|
136
|
+
* the target because its ACTIVE account cannot hold the target's namespace:
|
|
137
|
+
* Phantom with a Solana-only account answers `eth_requestAccounts` with
|
|
138
|
+
* -32002 "Requested resource not available." after its "Unsupported account"
|
|
139
|
+
* dialog, and connects that same account on Solana. See
|
|
140
|
+
* {@link NamespaceFallback}.
|
|
119
141
|
*
|
|
120
142
|
* Core sets it only for a network it auto-picked; an explicit `networkId`
|
|
121
143
|
* never falls back. Honoured by the injected connector, for an eip155 target
|
|
@@ -125,24 +147,7 @@ export interface ConnectorConnectOptions {
|
|
|
125
147
|
* Part of the core ↔ connector contract: core sets it on its own connector
|
|
126
148
|
* call. App code calling `UniversalWalletConnector.connect` never sets it.
|
|
127
149
|
*/
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Called once when the connector moves this connect to `fallbackNetwork`,
|
|
131
|
-
* before it asks the wallet for it. Core sets it with `fallbackNetwork` so
|
|
132
|
-
* this attempt's own terminal is filed under the fallback, whatever other
|
|
133
|
-
* attempt started meanwhile.
|
|
134
|
-
*
|
|
135
|
-
* Part of the core ↔ connector contract, set with `fallbackNetwork`.
|
|
136
|
-
*/
|
|
137
|
-
onNamespaceFallback?: () => void;
|
|
138
|
-
/**
|
|
139
|
-
* The connect's own abort signal (caller cancel, or a newer connect on any
|
|
140
|
-
* mode). Core sets it with `fallbackNetwork`; the injected connector does not
|
|
141
|
-
* start a fallback, or its prompt, once it has fired.
|
|
142
|
-
*
|
|
143
|
-
* Part of the core ↔ connector contract, set with `fallbackNetwork`.
|
|
144
|
-
*/
|
|
145
|
-
signal?: AbortSignal;
|
|
150
|
+
fallback?: NamespaceFallback;
|
|
146
151
|
}
|
|
147
152
|
/**
|
|
148
153
|
* Common interface for all wallet connectors
|
package/dist/connector.d.ts.map
CHANGED
|
@@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AAwB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAE7B,qBAAqB,CAAC,CACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EAAE,GAClB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;IAE3C;;;;OAIG;IACH,0BAA0B,CAAC,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE1E;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CAAC,CACf,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,EAC/C,OAAO,EAAE,sBAAsB,GAC9B,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAE3B;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,CAChB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,EACtC,OAAO,EAAE,sBAAsB,GAC9B,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAC9D"}
|
package/dist/observability.d.ts
CHANGED
|
@@ -130,7 +130,7 @@ export type WalletStepName =
|
|
|
130
130
|
* The target namespace was refused because the wallet's active account
|
|
131
131
|
* cannot hold it (Phantom, Solana-only account, -32002 "Requested resource
|
|
132
132
|
* not available."), and the connect moved to `namespace`, the auto-picked
|
|
133
|
-
* network's fallback ({@link ConnectorConnectOptions.
|
|
133
|
+
* network's fallback ({@link ConnectorConnectOptions.fallback}).
|
|
134
134
|
* Wraps that namespace's own connect.
|
|
135
135
|
*/
|
|
136
136
|
| 'namespaceFallback';
|
package/package.json
CHANGED
package/src/connector.ts
CHANGED
|
@@ -68,6 +68,28 @@ export interface SwitchNetworkResult {
|
|
|
68
68
|
availableAddresses?: AvailableAddress[]
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Where an auto-picked connect may fall back to, and how the connector reports
|
|
73
|
+
* and abandons it. The three fields belong together: core builds them as one
|
|
74
|
+
* value on its own connector call (see {@link ConnectorConnectOptions.fallback}).
|
|
75
|
+
*/
|
|
76
|
+
export interface NamespaceFallback {
|
|
77
|
+
/** The network to connect on instead. */
|
|
78
|
+
network: Network
|
|
79
|
+
/**
|
|
80
|
+
* Called once when the connector moves the connect to `network`, before it
|
|
81
|
+
* asks the wallet for it, so this attempt's own terminal is filed under the
|
|
82
|
+
* fallback, whatever other attempt started meanwhile.
|
|
83
|
+
*/
|
|
84
|
+
onFallback: () => void
|
|
85
|
+
/**
|
|
86
|
+
* Fires when this connect is cancelled or superseded (a newer connect on any
|
|
87
|
+
* mode). The connector does not start the fallback, or its prompt, once it
|
|
88
|
+
* has fired. Read by the fallback only.
|
|
89
|
+
*/
|
|
90
|
+
signal: AbortSignal
|
|
91
|
+
}
|
|
92
|
+
|
|
71
93
|
/**
|
|
72
94
|
* Per-attempt options for {@link Connector.connect}.
|
|
73
95
|
*
|
|
@@ -126,11 +148,12 @@ export interface ConnectorConnectOptions {
|
|
|
126
148
|
*/
|
|
127
149
|
secondaryPromptGapMs?: number
|
|
128
150
|
/**
|
|
129
|
-
*
|
|
130
|
-
* because its ACTIVE account cannot hold the target's namespace:
|
|
131
|
-
* a Solana-only account answers `eth_requestAccounts` with
|
|
132
|
-
* "Requested resource not available." after its "Unsupported account"
|
|
133
|
-
* dialog, and connects that same account on Solana.
|
|
151
|
+
* Lets an auto-picked connect move to another network when the wallet refuses
|
|
152
|
+
* the target because its ACTIVE account cannot hold the target's namespace:
|
|
153
|
+
* Phantom with a Solana-only account answers `eth_requestAccounts` with
|
|
154
|
+
* -32002 "Requested resource not available." after its "Unsupported account"
|
|
155
|
+
* dialog, and connects that same account on Solana. See
|
|
156
|
+
* {@link NamespaceFallback}.
|
|
134
157
|
*
|
|
135
158
|
* Core sets it only for a network it auto-picked; an explicit `networkId`
|
|
136
159
|
* never falls back. Honoured by the injected connector, for an eip155 target
|
|
@@ -140,24 +163,7 @@ export interface ConnectorConnectOptions {
|
|
|
140
163
|
* Part of the core ↔ connector contract: core sets it on its own connector
|
|
141
164
|
* call. App code calling `UniversalWalletConnector.connect` never sets it.
|
|
142
165
|
*/
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Called once when the connector moves this connect to `fallbackNetwork`,
|
|
146
|
-
* before it asks the wallet for it. Core sets it with `fallbackNetwork` so
|
|
147
|
-
* this attempt's own terminal is filed under the fallback, whatever other
|
|
148
|
-
* attempt started meanwhile.
|
|
149
|
-
*
|
|
150
|
-
* Part of the core ↔ connector contract, set with `fallbackNetwork`.
|
|
151
|
-
*/
|
|
152
|
-
onNamespaceFallback?: () => void
|
|
153
|
-
/**
|
|
154
|
-
* The connect's own abort signal (caller cancel, or a newer connect on any
|
|
155
|
-
* mode). Core sets it with `fallbackNetwork`; the injected connector does not
|
|
156
|
-
* start a fallback, or its prompt, once it has fired.
|
|
157
|
-
*
|
|
158
|
-
* Part of the core ↔ connector contract, set with `fallbackNetwork`.
|
|
159
|
-
*/
|
|
160
|
-
signal?: AbortSignal
|
|
166
|
+
fallback?: NamespaceFallback
|
|
161
167
|
}
|
|
162
168
|
|
|
163
169
|
/**
|
package/src/observability.ts
CHANGED
|
@@ -161,7 +161,7 @@ export type WalletStepName =
|
|
|
161
161
|
* The target namespace was refused because the wallet's active account
|
|
162
162
|
* cannot hold it (Phantom, Solana-only account, -32002 "Requested resource
|
|
163
163
|
* not available."), and the connect moved to `namespace`, the auto-picked
|
|
164
|
-
* network's fallback ({@link ConnectorConnectOptions.
|
|
164
|
+
* network's fallback ({@link ConnectorConnectOptions.fallback}).
|
|
165
165
|
* Wraps that namespace's own connect.
|
|
166
166
|
*/
|
|
167
167
|
| 'namespaceFallback'
|