@meshconnect/uwc-types 0.20.0-snapshot.3bf4b70 → 0.20.0-snapshot.cb0b223
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
CHANGED
|
@@ -17,32 +17,14 @@ export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
|
17
17
|
* drive a reuse-outcome dashboard without high cardinality. Emitted via
|
|
18
18
|
* `WalletConnectConfig.onSessionReuseSkipped`.
|
|
19
19
|
*
|
|
20
|
-
* - `no_record`
|
|
21
|
-
*
|
|
22
|
-
* - `expired`
|
|
23
|
-
* - `no_address`
|
|
24
|
-
* - `
|
|
25
|
-
*
|
|
26
|
-
* from `ping_error` so a slow-but-alive mobile wallet (which
|
|
27
|
-
* would defeat reuse if the window is too tight) is measurable
|
|
28
|
-
* separately from a hard failure.
|
|
29
|
-
* - `ping_error` — the ping REJECTED (offline / relay / protocol error), i.e. an
|
|
30
|
-
* unknown liveness state rather than a confirmed no-ack.
|
|
31
|
-
* - `superseded` — a disconnect()/newer connect() invalidated the attempt mid-ping.
|
|
20
|
+
* - `no_record` — no topic recorded for the selected wallet (e.g. first connect),
|
|
21
|
+
* or the recorded session is no longer in storage.
|
|
22
|
+
* - `expired` — the recorded session exists but is past its expiry.
|
|
23
|
+
* - `no_address` — the session carries no account for the requested network.
|
|
24
|
+
* - `ping_failed`— the liveness ping timed out / errored (peer or relay dead).
|
|
25
|
+
* - `superseded` — a disconnect()/newer connect() invalidated the attempt mid-ping.
|
|
32
26
|
*/
|
|
33
|
-
export type WalletConnectSessionReuseSkipReason = 'no_record' | 'expired' | 'no_address' | '
|
|
34
|
-
/**
|
|
35
|
-
* Payload for `WalletConnectConfig.onSessionReuseSkipped`. Carries the coarse
|
|
36
|
-
* reason plus, for the two ping outcomes, the ping round-trip in ms — so a
|
|
37
|
-
* consumer can chart the ping-latency distribution and decide whether the bound
|
|
38
|
-
* is clipping live-but-slow wallets. (The healthy-ping latency is separately
|
|
39
|
-
* observable as the reused connect's own handoff duration.)
|
|
40
|
-
*/
|
|
41
|
-
export interface WalletConnectSessionReuseSkip {
|
|
42
|
-
reason: WalletConnectSessionReuseSkipReason;
|
|
43
|
-
/** Ping round-trip in ms; present only for `ping_timeout` / `ping_error`. */
|
|
44
|
-
pingMs?: number;
|
|
45
|
-
}
|
|
27
|
+
export type WalletConnectSessionReuseSkipReason = 'no_record' | 'expired' | 'no_address' | 'ping_failed' | 'superseded';
|
|
46
28
|
/**
|
|
47
29
|
* Pluggable logger. The default implementation (`createLogger`) is console-backed
|
|
48
30
|
* and level-gated; inject your own to redirect UWC's internal logging into your
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D
|
|
1
|
+
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,mCAAmC,GAC3C,WAAW,GACX,SAAS,GACT,YAAY,GACZ,aAAa,GACb,YAAY,CAAA;AAEhB;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAC/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAC/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;CACjD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,cAAc,GACtB,wBAAwB,GACxB,+BAA+B,GAC/B,wBAAwB,GACxB,qBAAqB,GACrB,cAAc,GACd,qBAAqB,GACrB,4BAA4B,GAC5B,wBAAwB,GACxB,SAAS,CAAA;AAEb;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACnB,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,eAAe;AACjB,iFAAiF;GAC/E,mBAAmB,GACnB,oBAAoB,GACpB,gBAAgB,GAChB,SAAS;AACX,gFAAgF;GAC9E,oBAAoB,GACpB,SAAS,CAAA;AAEb;;;;GAIG;AACH,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,WAAW,GACX,QAAQ,GACR,KAAK,GACL,SAAS,CAAA;AAEb;;;;GAIG;AACH,MAAM,MAAM,0BAA0B;AACpC,gGAAgG;AAC9F,mCAAmC;AACrC,uFAAuF;GACrF,iCAAiC;AACnC,oEAAoE;GAClE,uBAAuB;AACzB;;;;GAIG;GACD,mBAAmB;AACrB;;;GAGG;GACD,cAAc,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WalletConnectSessionReuseSkipReason } from './observability';
|
|
2
2
|
/**
|
|
3
3
|
* Configuration for WalletConnect connector
|
|
4
4
|
*/
|
|
@@ -37,25 +37,11 @@ export interface WalletConnectConfig {
|
|
|
37
37
|
onSessionRestored?: () => void;
|
|
38
38
|
/**
|
|
39
39
|
* Fired when reuse was attempted (enableSessionReuse on + wallet known) but fell
|
|
40
|
-
* back to a fresh pairing
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* enableSessionReuse is on.
|
|
40
|
+
* back to a fresh pairing, with the coarse reason. The counterpart to
|
|
41
|
+
* onSessionRestored: together they give a reuse-outcome funnel (reused vs the
|
|
42
|
+
* reason it wasn't) for monitoring. Telemetry-only; never affects behaviour.
|
|
43
|
+
* No-op unless enableSessionReuse is on.
|
|
45
44
|
*/
|
|
46
|
-
onSessionReuseSkipped?: (
|
|
47
|
-
/**
|
|
48
|
-
* Opt-in liveness-ping window (ms) for session reuse. Reuse is OPTIMISTIC by
|
|
49
|
-
* default: when this is unset (or ≤ 0) connect() adopts a stored session with no
|
|
50
|
-
* blocking probe — matching WC's own restore and every mainstream dApp connector
|
|
51
|
-
* — and a dead peer surfaces at the first sign (bounded by the app's signing
|
|
52
|
-
* escape hatch), not by making every relaunch wait. Set a positive number only if
|
|
53
|
-
* you would rather pay an up-front ping and re-pair immediately than risk a late
|
|
54
|
-
* failure; a too-tight bound will discard live-but-slow mobile peers (they often
|
|
55
|
-
* need > 4s to ack over the relay), so calibrate against the `pingMs` carried by
|
|
56
|
-
* onSessionReuseSkipped. Exposed as config so this bound can be tuned per consumer
|
|
57
|
-
* without a new UWC release. No-op unless enableSessionReuse is on.
|
|
58
|
-
*/
|
|
59
|
-
sessionReusePingTimeoutMs?: number;
|
|
45
|
+
onSessionReuseSkipped?: (reason: WalletConnectSessionReuseSkipReason) => void;
|
|
60
46
|
}
|
|
61
47
|
//# sourceMappingURL=wallet-connect-connector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-connect-connector.d.ts","sourceRoot":"","sources":["../src/wallet-connect-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wallet-connect-connector.d.ts","sourceRoot":"","sources":["../src/wallet-connect-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAA;AAE1E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,CAAA;IACD;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9B;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,mCAAmC,KAAK,IAAI,CAAA;CAC9E"}
|
package/package.json
CHANGED
package/src/observability.ts
CHANGED
|
@@ -19,40 +19,20 @@ export type LogLevel = 'debug' | 'info' | 'warn' | 'error'
|
|
|
19
19
|
* drive a reuse-outcome dashboard without high cardinality. Emitted via
|
|
20
20
|
* `WalletConnectConfig.onSessionReuseSkipped`.
|
|
21
21
|
*
|
|
22
|
-
* - `no_record`
|
|
23
|
-
*
|
|
24
|
-
* - `expired`
|
|
25
|
-
* - `no_address`
|
|
26
|
-
* - `
|
|
27
|
-
*
|
|
28
|
-
* from `ping_error` so a slow-but-alive mobile wallet (which
|
|
29
|
-
* would defeat reuse if the window is too tight) is measurable
|
|
30
|
-
* separately from a hard failure.
|
|
31
|
-
* - `ping_error` — the ping REJECTED (offline / relay / protocol error), i.e. an
|
|
32
|
-
* unknown liveness state rather than a confirmed no-ack.
|
|
33
|
-
* - `superseded` — a disconnect()/newer connect() invalidated the attempt mid-ping.
|
|
22
|
+
* - `no_record` — no topic recorded for the selected wallet (e.g. first connect),
|
|
23
|
+
* or the recorded session is no longer in storage.
|
|
24
|
+
* - `expired` — the recorded session exists but is past its expiry.
|
|
25
|
+
* - `no_address` — the session carries no account for the requested network.
|
|
26
|
+
* - `ping_failed`— the liveness ping timed out / errored (peer or relay dead).
|
|
27
|
+
* - `superseded` — a disconnect()/newer connect() invalidated the attempt mid-ping.
|
|
34
28
|
*/
|
|
35
29
|
export type WalletConnectSessionReuseSkipReason =
|
|
36
30
|
| 'no_record'
|
|
37
31
|
| 'expired'
|
|
38
32
|
| 'no_address'
|
|
39
|
-
| '
|
|
40
|
-
| 'ping_error'
|
|
33
|
+
| 'ping_failed'
|
|
41
34
|
| 'superseded'
|
|
42
35
|
|
|
43
|
-
/**
|
|
44
|
-
* Payload for `WalletConnectConfig.onSessionReuseSkipped`. Carries the coarse
|
|
45
|
-
* reason plus, for the two ping outcomes, the ping round-trip in ms — so a
|
|
46
|
-
* consumer can chart the ping-latency distribution and decide whether the bound
|
|
47
|
-
* is clipping live-but-slow wallets. (The healthy-ping latency is separately
|
|
48
|
-
* observable as the reused connect's own handoff duration.)
|
|
49
|
-
*/
|
|
50
|
-
export interface WalletConnectSessionReuseSkip {
|
|
51
|
-
reason: WalletConnectSessionReuseSkipReason
|
|
52
|
-
/** Ping round-trip in ms; present only for `ping_timeout` / `ping_error`. */
|
|
53
|
-
pingMs?: number
|
|
54
|
-
}
|
|
55
|
-
|
|
56
36
|
/**
|
|
57
37
|
* Pluggable logger. The default implementation (`createLogger`) is console-backed
|
|
58
38
|
* and level-gated; inject your own to redirect UWC's internal logging into your
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WalletConnectSessionReuseSkipReason } from './observability'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for WalletConnect connector
|
|
@@ -38,24 +38,10 @@ export interface WalletConnectConfig {
|
|
|
38
38
|
onSessionRestored?: () => void
|
|
39
39
|
/**
|
|
40
40
|
* Fired when reuse was attempted (enableSessionReuse on + wallet known) but fell
|
|
41
|
-
* back to a fresh pairing
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* enableSessionReuse is on.
|
|
41
|
+
* back to a fresh pairing, with the coarse reason. The counterpart to
|
|
42
|
+
* onSessionRestored: together they give a reuse-outcome funnel (reused vs the
|
|
43
|
+
* reason it wasn't) for monitoring. Telemetry-only; never affects behaviour.
|
|
44
|
+
* No-op unless enableSessionReuse is on.
|
|
46
45
|
*/
|
|
47
|
-
onSessionReuseSkipped?: (
|
|
48
|
-
/**
|
|
49
|
-
* Opt-in liveness-ping window (ms) for session reuse. Reuse is OPTIMISTIC by
|
|
50
|
-
* default: when this is unset (or ≤ 0) connect() adopts a stored session with no
|
|
51
|
-
* blocking probe — matching WC's own restore and every mainstream dApp connector
|
|
52
|
-
* — and a dead peer surfaces at the first sign (bounded by the app's signing
|
|
53
|
-
* escape hatch), not by making every relaunch wait. Set a positive number only if
|
|
54
|
-
* you would rather pay an up-front ping and re-pair immediately than risk a late
|
|
55
|
-
* failure; a too-tight bound will discard live-but-slow mobile peers (they often
|
|
56
|
-
* need > 4s to ack over the relay), so calibrate against the `pingMs` carried by
|
|
57
|
-
* onSessionReuseSkipped. Exposed as config so this bound can be tuned per consumer
|
|
58
|
-
* without a new UWC release. No-op unless enableSessionReuse is on.
|
|
59
|
-
*/
|
|
60
|
-
sessionReusePingTimeoutMs?: number
|
|
46
|
+
onSessionReuseSkipped?: (reason: WalletConnectSessionReuseSkipReason) => void
|
|
61
47
|
}
|