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