@meshconnect/uwc-types 0.33.1 → 0.33.2-snapshot.149a27e
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 +30 -0
- package/dist/connector.d.ts.map +1 -1
- package/dist/observability.d.ts +15 -8
- package/dist/observability.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/connector.ts +30 -0
- package/src/observability.ts +15 -8
package/dist/connector.d.ts
CHANGED
|
@@ -93,6 +93,36 @@ export interface ConnectorConnectOptions {
|
|
|
93
93
|
* reaching the wallet. Omitted or false: unchanged behaviour.
|
|
94
94
|
*/
|
|
95
95
|
silentOnly?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Never open a first-time approval prompt for a SECONDARY namespace.
|
|
98
|
+
*
|
|
99
|
+
* After the target namespace connects, a connector normally gathers the
|
|
100
|
+
* wallet's other namespaces and connects any it finds unauthorized, which
|
|
101
|
+
* opens the wallet's approval prompt for each. With this set, a secondary
|
|
102
|
+
* namespace is only read from an existing authorization, or reconnected
|
|
103
|
+
* where this browser connected it before; the connector makes no other
|
|
104
|
+
* secondary request. The target namespace still prompts as usual.
|
|
105
|
+
*
|
|
106
|
+
* For in-app browsers that leave a request unanswered when it arrives right
|
|
107
|
+
* after the user approved another one (Trust Wallet on iOS): each such
|
|
108
|
+
* secondary request held the connect for its full gather deadline. Honoured
|
|
109
|
+
* by the injected connector only; the other connectors make no secondary
|
|
110
|
+
* requests. Omitted or false: unchanged behaviour.
|
|
111
|
+
*/
|
|
112
|
+
quietSecondaries?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Wait this many ms before each SECONDARY request that can open a prompt.
|
|
115
|
+
*
|
|
116
|
+
* After the target namespace connects, the secondary gathers send their
|
|
117
|
+
* prompting connects back to back, the first one right after the user
|
|
118
|
+
* approved the target. Trust Wallet on iOS leaves a prompt unanswered when it
|
|
119
|
+
* arrives while the previous one is still closing, but answers it a second
|
|
120
|
+
* later. With a gap, every secondary namespace still gets its own prompt.
|
|
121
|
+
* Reads of an existing authorization are not delayed. Has no effect with
|
|
122
|
+
* `silentOnly` or `quietSecondaries`, which send no such request. Honoured
|
|
123
|
+
* by the injected connector only. Omitted or 0: no wait.
|
|
124
|
+
*/
|
|
125
|
+
secondaryPromptGapMs?: number;
|
|
96
126
|
}
|
|
97
127
|
/**
|
|
98
128
|
* Common interface for all wallet connectors
|
package/dist/connector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACf,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,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iC,GACjC,qBAAqB,GACrB,wBAAwB,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
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* UWC ships NO third-party telemetry SDK. The consumer implements the sinks and
|
|
11
11
|
* wires them to whatever backend they run (Datadog, Amplitude, Segment, …).
|
|
12
12
|
*/
|
|
13
|
+
import type { ErrorType } from './errors';
|
|
13
14
|
import type { Namespace } from './networks';
|
|
14
15
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
15
16
|
/**
|
|
@@ -123,14 +124,12 @@ export type WalletStepOutcome = 'ok'
|
|
|
123
124
|
/** Hit its deadline and was abandoned; the underlying promise may still be pending. */
|
|
124
125
|
| 'timedOut'
|
|
125
126
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* dedicated `secondarySolanaConnectSkipped` sink — so a suppressed leg is
|
|
133
|
-
* currently ABSENT from the step timeline rather than present-and-skipped.
|
|
127
|
+
* Deliberately not run because a gate suppressed it, which is distinct from
|
|
128
|
+
* `ok` with no result. Emitted today by a `secondaryGather` that
|
|
129
|
+
* `quietSecondaries` kept from prompting for a detected namespace. The
|
|
130
|
+
* legacy-`injectedId` / framed gates on the secondary Solana gather still
|
|
131
|
+
* report only through their own `secondarySolanaConnectSkipped` sink, so
|
|
132
|
+
* those suppressed legs are ABSENT from the step timeline.
|
|
134
133
|
*/
|
|
135
134
|
| 'skipped';
|
|
136
135
|
/**
|
|
@@ -147,5 +146,13 @@ export interface WalletStepInfo {
|
|
|
147
146
|
namespace?: Namespace | undefined;
|
|
148
147
|
/** The deadline that elapsed; set only when `outcome` is `timedOut`. */
|
|
149
148
|
timeoutMs?: number | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* The thrown error's `name` (e.g. `WalletAccountError`); set only when
|
|
151
|
+
* `outcome` is `failed` and a step knows what threw. Never the message, which
|
|
152
|
+
* can carry wallet-supplied text.
|
|
153
|
+
*/
|
|
154
|
+
errorName?: string | undefined;
|
|
155
|
+
/** Whether the user declined (`rejected`); set alongside `errorName`. */
|
|
156
|
+
errorType?: ErrorType | undefined;
|
|
150
157
|
}
|
|
151
158
|
//# sourceMappingURL=observability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,MAAM;I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AAS,CAAA;CAClC"}
|
package/package.json
CHANGED
package/src/connector.ts
CHANGED
|
@@ -108,6 +108,36 @@ export interface ConnectorConnectOptions {
|
|
|
108
108
|
* reaching the wallet. Omitted or false: unchanged behaviour.
|
|
109
109
|
*/
|
|
110
110
|
silentOnly?: boolean
|
|
111
|
+
/**
|
|
112
|
+
* Never open a first-time approval prompt for a SECONDARY namespace.
|
|
113
|
+
*
|
|
114
|
+
* After the target namespace connects, a connector normally gathers the
|
|
115
|
+
* wallet's other namespaces and connects any it finds unauthorized, which
|
|
116
|
+
* opens the wallet's approval prompt for each. With this set, a secondary
|
|
117
|
+
* namespace is only read from an existing authorization, or reconnected
|
|
118
|
+
* where this browser connected it before; the connector makes no other
|
|
119
|
+
* secondary request. The target namespace still prompts as usual.
|
|
120
|
+
*
|
|
121
|
+
* For in-app browsers that leave a request unanswered when it arrives right
|
|
122
|
+
* after the user approved another one (Trust Wallet on iOS): each such
|
|
123
|
+
* secondary request held the connect for its full gather deadline. Honoured
|
|
124
|
+
* by the injected connector only; the other connectors make no secondary
|
|
125
|
+
* requests. Omitted or false: unchanged behaviour.
|
|
126
|
+
*/
|
|
127
|
+
quietSecondaries?: boolean
|
|
128
|
+
/**
|
|
129
|
+
* Wait this many ms before each SECONDARY request that can open a prompt.
|
|
130
|
+
*
|
|
131
|
+
* After the target namespace connects, the secondary gathers send their
|
|
132
|
+
* prompting connects back to back, the first one right after the user
|
|
133
|
+
* approved the target. Trust Wallet on iOS leaves a prompt unanswered when it
|
|
134
|
+
* arrives while the previous one is still closing, but answers it a second
|
|
135
|
+
* later. With a gap, every secondary namespace still gets its own prompt.
|
|
136
|
+
* Reads of an existing authorization are not delayed. Has no effect with
|
|
137
|
+
* `silentOnly` or `quietSecondaries`, which send no such request. Honoured
|
|
138
|
+
* by the injected connector only. Omitted or 0: no wait.
|
|
139
|
+
*/
|
|
140
|
+
secondaryPromptGapMs?: number
|
|
111
141
|
}
|
|
112
142
|
|
|
113
143
|
/**
|
package/src/observability.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* wires them to whatever backend they run (Datadog, Amplitude, Segment, …).
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import type { ErrorType } from './errors'
|
|
14
15
|
import type { Namespace } from './networks'
|
|
15
16
|
|
|
16
17
|
export type LogLevel = 'debug' | 'info' | 'warn' | 'error'
|
|
@@ -156,14 +157,12 @@ export type WalletStepOutcome =
|
|
|
156
157
|
/** Hit its deadline and was abandoned; the underlying promise may still be pending. */
|
|
157
158
|
| 'timedOut'
|
|
158
159
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* dedicated `secondarySolanaConnectSkipped` sink — so a suppressed leg is
|
|
166
|
-
* currently ABSENT from the step timeline rather than present-and-skipped.
|
|
160
|
+
* Deliberately not run because a gate suppressed it, which is distinct from
|
|
161
|
+
* `ok` with no result. Emitted today by a `secondaryGather` that
|
|
162
|
+
* `quietSecondaries` kept from prompting for a detected namespace. The
|
|
163
|
+
* legacy-`injectedId` / framed gates on the secondary Solana gather still
|
|
164
|
+
* report only through their own `secondarySolanaConnectSkipped` sink, so
|
|
165
|
+
* those suppressed legs are ABSENT from the step timeline.
|
|
167
166
|
*/
|
|
168
167
|
| 'skipped'
|
|
169
168
|
|
|
@@ -181,4 +180,12 @@ export interface WalletStepInfo {
|
|
|
181
180
|
namespace?: Namespace | undefined
|
|
182
181
|
/** The deadline that elapsed; set only when `outcome` is `timedOut`. */
|
|
183
182
|
timeoutMs?: number | undefined
|
|
183
|
+
/**
|
|
184
|
+
* The thrown error's `name` (e.g. `WalletAccountError`); set only when
|
|
185
|
+
* `outcome` is `failed` and a step knows what threw. Never the message, which
|
|
186
|
+
* can carry wallet-supplied text.
|
|
187
|
+
*/
|
|
188
|
+
errorName?: string | undefined
|
|
189
|
+
/** Whether the user declined (`rejected`); set alongside `errorName`. */
|
|
190
|
+
errorType?: ErrorType | undefined
|
|
184
191
|
}
|