@meshconnect/uwc-types 0.33.1 → 0.33.2-snapshot.37e9f8f
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/observability.d.ts +25 -9
- package/dist/observability.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/observability.ts +24 -8
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
|
/**
|
|
@@ -115,7 +116,16 @@ export type WalletStepName =
|
|
|
115
116
|
* Snap, a multi-namespace wallet's Tron leg). Unbounded before ONC-183 and
|
|
116
117
|
* the dominant source of connects that hang AFTER the user already approved.
|
|
117
118
|
*/
|
|
118
|
-
| 'secondaryGather'
|
|
119
|
+
| 'secondaryGather'
|
|
120
|
+
/**
|
|
121
|
+
* Waiting for a wallet window a `secondaryGather` left open past its deadline
|
|
122
|
+
* (`namespace` is that gather's), because the wallet refused the target
|
|
123
|
+
* namespace's connect while it was open (-32002, "already pending"). Ends
|
|
124
|
+
* when the user answers the window; the connect then asks again (ONC-2390),
|
|
125
|
+
* or reports `skipped` and does not ask when the attempt was disconnected or
|
|
126
|
+
* superseded meanwhile.
|
|
127
|
+
*/
|
|
128
|
+
| 'awaitOpenPrompt';
|
|
119
129
|
/** How a {@link WalletStepName} phase ended. */
|
|
120
130
|
export type WalletStepOutcome = 'ok'
|
|
121
131
|
/** Threw. For a best-effort step this is still a degraded-but-continuing connect. */
|
|
@@ -123,14 +133,12 @@ export type WalletStepOutcome = 'ok'
|
|
|
123
133
|
/** Hit its deadline and was abandoned; the underlying promise may still be pending. */
|
|
124
134
|
| 'timedOut'
|
|
125
135
|
/**
|
|
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.
|
|
136
|
+
* Deliberately not run because a gate suppressed it, which is distinct from
|
|
137
|
+
* `ok` with no result. Emitted today only by `awaitOpenPrompt`, when the
|
|
138
|
+
* attempt it waited for is gone. The injected connector's legacy-`injectedId`
|
|
139
|
+
* / framed gates on the secondary Solana gather still report only through
|
|
140
|
+
* their own `secondarySolanaConnectSkipped` sink, so a suppressed leg is
|
|
141
|
+
* ABSENT from the step timeline rather than present-and-skipped.
|
|
134
142
|
*/
|
|
135
143
|
| 'skipped';
|
|
136
144
|
/**
|
|
@@ -147,5 +155,13 @@ export interface WalletStepInfo {
|
|
|
147
155
|
namespace?: Namespace | undefined;
|
|
148
156
|
/** The deadline that elapsed; set only when `outcome` is `timedOut`. */
|
|
149
157
|
timeoutMs?: number | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* The thrown error's `name` (e.g. `WalletAccountError`); set only when
|
|
160
|
+
* `outcome` is `failed` and a step knows what threw. Never the message, which
|
|
161
|
+
* can carry wallet-supplied text.
|
|
162
|
+
*/
|
|
163
|
+
errorName?: string | undefined;
|
|
164
|
+
/** Whether the user declined (`rejected`); set alongside `errorName`. */
|
|
165
|
+
errorType?: ErrorType | undefined;
|
|
150
166
|
}
|
|
151
167
|
//# 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,CA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,MAAM,GAAG,SAAS,CAAA;IAC9B,yEAAyE;IACzE,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAClC"}
|
package/package.json
CHANGED
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'
|
|
@@ -147,6 +148,15 @@ export type WalletStepName =
|
|
|
147
148
|
* the dominant source of connects that hang AFTER the user already approved.
|
|
148
149
|
*/
|
|
149
150
|
| 'secondaryGather'
|
|
151
|
+
/**
|
|
152
|
+
* Waiting for a wallet window a `secondaryGather` left open past its deadline
|
|
153
|
+
* (`namespace` is that gather's), because the wallet refused the target
|
|
154
|
+
* namespace's connect while it was open (-32002, "already pending"). Ends
|
|
155
|
+
* when the user answers the window; the connect then asks again (ONC-2390),
|
|
156
|
+
* or reports `skipped` and does not ask when the attempt was disconnected or
|
|
157
|
+
* superseded meanwhile.
|
|
158
|
+
*/
|
|
159
|
+
| 'awaitOpenPrompt'
|
|
150
160
|
|
|
151
161
|
/** How a {@link WalletStepName} phase ended. */
|
|
152
162
|
export type WalletStepOutcome =
|
|
@@ -156,14 +166,12 @@ export type WalletStepOutcome =
|
|
|
156
166
|
/** Hit its deadline and was abandoned; the underlying promise may still be pending. */
|
|
157
167
|
| 'timedOut'
|
|
158
168
|
/**
|
|
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.
|
|
169
|
+
* Deliberately not run because a gate suppressed it, which is distinct from
|
|
170
|
+
* `ok` with no result. Emitted today only by `awaitOpenPrompt`, when the
|
|
171
|
+
* attempt it waited for is gone. The injected connector's legacy-`injectedId`
|
|
172
|
+
* / framed gates on the secondary Solana gather still report only through
|
|
173
|
+
* their own `secondarySolanaConnectSkipped` sink, so a suppressed leg is
|
|
174
|
+
* ABSENT from the step timeline rather than present-and-skipped.
|
|
167
175
|
*/
|
|
168
176
|
| 'skipped'
|
|
169
177
|
|
|
@@ -181,4 +189,12 @@ export interface WalletStepInfo {
|
|
|
181
189
|
namespace?: Namespace | undefined
|
|
182
190
|
/** The deadline that elapsed; set only when `outcome` is `timedOut`. */
|
|
183
191
|
timeoutMs?: number | undefined
|
|
192
|
+
/**
|
|
193
|
+
* The thrown error's `name` (e.g. `WalletAccountError`); set only when
|
|
194
|
+
* `outcome` is `failed` and a step knows what threw. Never the message, which
|
|
195
|
+
* can carry wallet-supplied text.
|
|
196
|
+
*/
|
|
197
|
+
errorName?: string | undefined
|
|
198
|
+
/** Whether the user declined (`rejected`); set alongside `errorName`. */
|
|
199
|
+
errorType?: ErrorType | undefined
|
|
184
200
|
}
|