phantasma-sdk-ts 0.10.0 → 0.10.1
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/cjs/link/v5/client.js +11 -0
- package/dist/cjs/link/v5/deeplink.js +11 -1
- package/dist/cjs/link/v5/transport.js +6 -1
- package/dist/esm/link/v5/client.js +11 -0
- package/dist/esm/link/v5/deeplink.js +11 -1
- package/dist/esm/link/v5/transport.js +6 -1
- package/dist/types/link/v5/client.d.ts.map +1 -1
- package/dist/types/link/v5/deeplink.d.ts +5 -0
- package/dist/types/link/v5/deeplink.d.ts.map +1 -1
- package/dist/types/link/v5/transport.d.ts +6 -0
- package/dist/types/link/v5/transport.d.ts.map +1 -1
- package/dist/types/link/v5/web-deeplink.d.ts +4 -0
- package/dist/types/link/v5/web-deeplink.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,15 @@ class PhantasmaLink5 {
|
|
|
45
45
|
if (event === protocol_js_1.LinkEvent.SessionEstablished && isConnectResult(data)) {
|
|
46
46
|
this.adoptConnectResult(data);
|
|
47
47
|
}
|
|
48
|
+
else if (event === protocol_js_1.LinkEvent.SessionDeleted || event === protocol_js_1.LinkEvent.SessionExpired) {
|
|
49
|
+
// The wallet tore this session down (user revoke / LRU evict / idle expiry) and notified us
|
|
50
|
+
// over the channel. Drop our session so a reload cannot resume a dead one: forgetSession
|
|
51
|
+
// clears lastConnect + the session id and fires onSessionChange(undefined), which also drops
|
|
52
|
+
// the persisted web-deeplink record. The deleted id rides the envelope `session` field, not
|
|
53
|
+
// `data` (the wallet sends data:{}), so no payload is needed - the frame already decrypted
|
|
54
|
+
// with this session's channel key, which authenticates it as ours.
|
|
55
|
+
this.forgetSession();
|
|
56
|
+
}
|
|
48
57
|
});
|
|
49
58
|
}
|
|
50
59
|
/** Build a client over the desktop loopback transport (plaintext, trusted-local). */
|
|
@@ -142,11 +151,13 @@ class PhantasmaLink5 {
|
|
|
142
151
|
topic: stored.topic,
|
|
143
152
|
opener: hooks.opener,
|
|
144
153
|
walletBase: options.walletBase,
|
|
154
|
+
log: options.log,
|
|
145
155
|
}), {
|
|
146
156
|
dapp: options.dapp,
|
|
147
157
|
sessionKey,
|
|
148
158
|
sessionId: stored.sessionId,
|
|
149
159
|
requestTimeoutMs: options.requestTimeoutMs ?? deeplink_js_1.DEEPLINK_REQUEST_TIMEOUT_MS,
|
|
160
|
+
log: options.log,
|
|
150
161
|
onSessionChange: (connect) => {
|
|
151
162
|
// Session layer only - the pairing material stays valid across disconnects.
|
|
152
163
|
stored.sessionId = connect?.session.id;
|
|
@@ -84,6 +84,7 @@ class DeeplinkTransport {
|
|
|
84
84
|
this.topic = options.topic;
|
|
85
85
|
this.opener = options.opener;
|
|
86
86
|
this.walletBase = options.walletBase ?? exports.WALLET_SCHEME_BASE;
|
|
87
|
+
this.log = options.log;
|
|
87
88
|
}
|
|
88
89
|
send(frame) {
|
|
89
90
|
if (this.closed) {
|
|
@@ -106,9 +107,18 @@ class DeeplinkTransport {
|
|
|
106
107
|
return false;
|
|
107
108
|
}
|
|
108
109
|
const parsed = parseResponseUrl(url);
|
|
109
|
-
if (!parsed
|
|
110
|
+
if (!parsed) {
|
|
111
|
+
return false; // not a v5 response URL: a foreign navigation, not ours - stay silent
|
|
112
|
+
}
|
|
113
|
+
if (parsed.topic !== this.topic) {
|
|
114
|
+
// A v5 response for a DIFFERENT channel. The usual cause is a regenerated pairing (the page
|
|
115
|
+
// reloaded or opened in another tab with a fresh topic), so the wallet's answer can never
|
|
116
|
+
// match. Log it: this is the silent drop that makes a "nothing happened" deeplink return so
|
|
117
|
+
// hard to diagnose.
|
|
118
|
+
this.log?.('deliverUrl: v5 response for a different topic, ignored (pairing likely regenerated)');
|
|
110
119
|
return false;
|
|
111
120
|
}
|
|
121
|
+
this.log?.('deliverUrl: v5 response matched this channel, dispatching');
|
|
112
122
|
this.messageHandler?.(parsed.frame);
|
|
113
123
|
return true;
|
|
114
124
|
}
|
|
@@ -27,6 +27,7 @@ class LinkSessionClient {
|
|
|
27
27
|
this.sessionId = options.sessionId;
|
|
28
28
|
this.requestTimeoutMs = options.requestTimeoutMs ?? 60000;
|
|
29
29
|
this.onUnmatchedResponse = options.onUnmatchedResponse;
|
|
30
|
+
this.log = options.log;
|
|
30
31
|
transport.onMessage((frame) => this.handleFrame(frame));
|
|
31
32
|
transport.onClose?.((reason) => this.handleClose(reason));
|
|
32
33
|
}
|
|
@@ -129,7 +130,10 @@ class LinkSessionClient {
|
|
|
129
130
|
message = this.decodeIncoming(frame);
|
|
130
131
|
}
|
|
131
132
|
catch {
|
|
132
|
-
// Drop undecodable/forged frames; a real authenticated peer never sends these.
|
|
133
|
+
// Drop undecodable/forged frames; a real authenticated peer never sends these. Log the drop
|
|
134
|
+
// (no payload) so a wrong-key channel - e.g. a deeplink return after the pairing was
|
|
135
|
+
// regenerated - is visible instead of silently vanishing.
|
|
136
|
+
this.log?.('frame dropped: undecodable or wrong session key');
|
|
133
137
|
return;
|
|
134
138
|
}
|
|
135
139
|
if ((0, envelope_js_1.isLinkEvent)(message)) {
|
|
@@ -171,6 +175,7 @@ class LinkSessionClient {
|
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
177
|
emitEvent(message) {
|
|
178
|
+
this.log?.(`event received: ${message.event}`);
|
|
174
179
|
for (const handler of this.eventHandlers) {
|
|
175
180
|
try {
|
|
176
181
|
handler(message.event, message.data, message.session);
|
|
@@ -42,6 +42,15 @@ export class PhantasmaLink5 {
|
|
|
42
42
|
if (event === LinkEvent.SessionEstablished && isConnectResult(data)) {
|
|
43
43
|
this.adoptConnectResult(data);
|
|
44
44
|
}
|
|
45
|
+
else if (event === LinkEvent.SessionDeleted || event === LinkEvent.SessionExpired) {
|
|
46
|
+
// The wallet tore this session down (user revoke / LRU evict / idle expiry) and notified us
|
|
47
|
+
// over the channel. Drop our session so a reload cannot resume a dead one: forgetSession
|
|
48
|
+
// clears lastConnect + the session id and fires onSessionChange(undefined), which also drops
|
|
49
|
+
// the persisted web-deeplink record. The deleted id rides the envelope `session` field, not
|
|
50
|
+
// `data` (the wallet sends data:{}), so no payload is needed - the frame already decrypted
|
|
51
|
+
// with this session's channel key, which authenticates it as ours.
|
|
52
|
+
this.forgetSession();
|
|
53
|
+
}
|
|
45
54
|
});
|
|
46
55
|
}
|
|
47
56
|
/** Build a client over the desktop loopback transport (plaintext, trusted-local). */
|
|
@@ -139,11 +148,13 @@ export class PhantasmaLink5 {
|
|
|
139
148
|
topic: stored.topic,
|
|
140
149
|
opener: hooks.opener,
|
|
141
150
|
walletBase: options.walletBase,
|
|
151
|
+
log: options.log,
|
|
142
152
|
}), {
|
|
143
153
|
dapp: options.dapp,
|
|
144
154
|
sessionKey,
|
|
145
155
|
sessionId: stored.sessionId,
|
|
146
156
|
requestTimeoutMs: options.requestTimeoutMs ?? DEEPLINK_REQUEST_TIMEOUT_MS,
|
|
157
|
+
log: options.log,
|
|
147
158
|
onSessionChange: (connect) => {
|
|
148
159
|
// Session layer only - the pairing material stays valid across disconnects.
|
|
149
160
|
stored.sessionId = connect?.session.id;
|
|
@@ -77,6 +77,7 @@ export class DeeplinkTransport {
|
|
|
77
77
|
this.topic = options.topic;
|
|
78
78
|
this.opener = options.opener;
|
|
79
79
|
this.walletBase = options.walletBase ?? WALLET_SCHEME_BASE;
|
|
80
|
+
this.log = options.log;
|
|
80
81
|
}
|
|
81
82
|
send(frame) {
|
|
82
83
|
if (this.closed) {
|
|
@@ -99,9 +100,18 @@ export class DeeplinkTransport {
|
|
|
99
100
|
return false;
|
|
100
101
|
}
|
|
101
102
|
const parsed = parseResponseUrl(url);
|
|
102
|
-
if (!parsed
|
|
103
|
+
if (!parsed) {
|
|
104
|
+
return false; // not a v5 response URL: a foreign navigation, not ours - stay silent
|
|
105
|
+
}
|
|
106
|
+
if (parsed.topic !== this.topic) {
|
|
107
|
+
// A v5 response for a DIFFERENT channel. The usual cause is a regenerated pairing (the page
|
|
108
|
+
// reloaded or opened in another tab with a fresh topic), so the wallet's answer can never
|
|
109
|
+
// match. Log it: this is the silent drop that makes a "nothing happened" deeplink return so
|
|
110
|
+
// hard to diagnose.
|
|
111
|
+
this.log?.('deliverUrl: v5 response for a different topic, ignored (pairing likely regenerated)');
|
|
103
112
|
return false;
|
|
104
113
|
}
|
|
114
|
+
this.log?.('deliverUrl: v5 response matched this channel, dispatching');
|
|
105
115
|
this.messageHandler?.(parsed.frame);
|
|
106
116
|
return true;
|
|
107
117
|
}
|
|
@@ -24,6 +24,7 @@ export class LinkSessionClient {
|
|
|
24
24
|
this.sessionId = options.sessionId;
|
|
25
25
|
this.requestTimeoutMs = options.requestTimeoutMs ?? 60000;
|
|
26
26
|
this.onUnmatchedResponse = options.onUnmatchedResponse;
|
|
27
|
+
this.log = options.log;
|
|
27
28
|
transport.onMessage((frame) => this.handleFrame(frame));
|
|
28
29
|
transport.onClose?.((reason) => this.handleClose(reason));
|
|
29
30
|
}
|
|
@@ -126,7 +127,10 @@ export class LinkSessionClient {
|
|
|
126
127
|
message = this.decodeIncoming(frame);
|
|
127
128
|
}
|
|
128
129
|
catch {
|
|
129
|
-
// Drop undecodable/forged frames; a real authenticated peer never sends these.
|
|
130
|
+
// Drop undecodable/forged frames; a real authenticated peer never sends these. Log the drop
|
|
131
|
+
// (no payload) so a wrong-key channel - e.g. a deeplink return after the pairing was
|
|
132
|
+
// regenerated - is visible instead of silently vanishing.
|
|
133
|
+
this.log?.('frame dropped: undecodable or wrong session key');
|
|
130
134
|
return;
|
|
131
135
|
}
|
|
132
136
|
if (isLinkEvent(message)) {
|
|
@@ -168,6 +172,7 @@ export class LinkSessionClient {
|
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
emitEvent(message) {
|
|
175
|
+
this.log?.(`event received: ${message.event}`);
|
|
171
176
|
for (const handler of this.eventHandlers) {
|
|
172
177
|
try {
|
|
173
178
|
handler(message.event, message.data, message.session);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","source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AG,SAAS,CAEnC;IAED,oEAAoE;IACpE,IAAI,OAAO,IAAI,aAAa,GAAG,SAAS,CAEvC;IAED,+EAA+E;IAC/E,IAAI,YAAY,IAAI,kBAAkB,GAAG,SAAS,CAEjD;IAED;;6FAEyF;IACnF,OAAO,CACX,IAAI,CAAC,EAAE,YAAY,EACnB,KAAK,GAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAM,GACtC,OAAO,CAAC,aAAa,CAAC;IAmBzB;uFACmF;IACnF,OAAO,CAAC,kBAAkB;IAM1B,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAIzC,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAIrC,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI7C,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIlE,wFAAwF;IACxF,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI9E,sEAAsE;IACtE,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI9E,kDAAkD;IAClD,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI/D,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAU7C;;;mGAG+F;IAC/F,aAAa,IAAI,IAAI;IAMrB,yEAAyE;IACzE,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAI9C,wEAAwE;IACxE,KAAK,IAAI,IAAI;IAiBb,OAAO,CAAC,OAAO;CAMhB"}
|
|
@@ -25,6 +25,10 @@ export interface DeeplinkTransportOptions {
|
|
|
25
25
|
opener: (url: string) => void;
|
|
26
26
|
/** Wallet base; defaults to the custom scheme {@link WALLET_SCHEME_BASE}. */
|
|
27
27
|
walletBase?: string;
|
|
28
|
+
/** Optional diagnostic sink for inbound response URLs: whether a delivered URL matched this
|
|
29
|
+
* channel's topic or was ignored (foreign topic / not a v5 response). METADATA ONLY - never the
|
|
30
|
+
* sealed `f` payload. Default: no-op. */
|
|
31
|
+
log?: (message: string) => void;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* {@link LinkTransport} over deeplink ping-pong. `send` opens a wallet URL carrying the frame;
|
|
@@ -35,6 +39,7 @@ export declare class DeeplinkTransport implements LinkTransport {
|
|
|
35
39
|
private readonly topic;
|
|
36
40
|
private readonly opener;
|
|
37
41
|
private readonly walletBase;
|
|
42
|
+
private readonly log?;
|
|
38
43
|
private messageHandler?;
|
|
39
44
|
private closeHandler?;
|
|
40
45
|
private closed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deeplink.d.ts","sourceRoot":"","sources":["../../../../src/link/v5/deeplink.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;2FAE2F;AAC3F,eAAO,MAAM,2BAA2B,SAAS,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;mFACmF;AACnF,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAMhE;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvF;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAMjE;AAmBD,MAAM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KAAK,IAAI,CAAC;CACjC;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,aAAa;IACrD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAA4B;IACjD,OAAO,CAAC,cAAc,CAAC,CAA0B;IACjD,OAAO,CAAC,YAAY,CAAC,CAA4B;IACjD,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,wBAAwB;IAU7C,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOzB,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAIjD,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAIjD;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAqBhC,KAAK,IAAI,IAAI;CAOd"}
|
|
@@ -23,6 +23,11 @@ export interface LinkSessionClientOptions {
|
|
|
23
23
|
* the wallet was open, discarding the original request promise). Without it such responses
|
|
24
24
|
* are dropped. Never fires on same-page flows - those always have a pending entry. */
|
|
25
25
|
onUnmatchedResponse?: (response: UnmatchedResponse) => void;
|
|
26
|
+
/** Optional diagnostic sink for the receive path: frames dropped (undecodable / wrong key) and
|
|
27
|
+
* events received. Mirrors the relay transport's `log` seam so a host can trace the otherwise
|
|
28
|
+
* silent deeplink/relay receive path. METADATA ONLY - never receives secrets or plaintext
|
|
29
|
+
* payloads. Default: no-op. */
|
|
30
|
+
log?: (message: string) => void;
|
|
26
31
|
}
|
|
27
32
|
/** A wallet response that arrived with no in-flight request to match it - the deeplink reload
|
|
28
33
|
* case, where the page that issued the request was discarded before the answer came back.
|
|
@@ -47,6 +52,7 @@ export declare class LinkSessionClient {
|
|
|
47
52
|
private sessionId?;
|
|
48
53
|
private readonly requestTimeoutMs;
|
|
49
54
|
private readonly onUnmatchedResponse?;
|
|
55
|
+
private readonly log?;
|
|
50
56
|
private readonly pending;
|
|
51
57
|
private readonly eventHandlers;
|
|
52
58
|
private closed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../src/link/v5/transport.ts"],"names":[],"mappings":"AA0BA,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IAClD,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IACnD,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAExF,MAAM,WAAW,wBAAwB;IACvC;;wBAEoB;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;qFAEiF;IACjF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;0FAEsF;IACtF,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../src/link/v5/transport.ts"],"names":[],"mappings":"AA0BA,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,KAAK,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CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAwC;IAC7E,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAA4B;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAC7D,OAAO,CAAC,MAAM,CAAS;gBAEX,SAAS,EAAE,aAAa,EAAE,OAAO,GAAE,wBAA6B;IAY5E;qEACiE;IACjE,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAI1C,2DAA2D;IAC3D,YAAY,IAAI,MAAM,GAAG,SAAS;IAIlC;;kFAE8E;IAC9E,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAOpC,yEAAyE;IACzE,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAO9C,2EAA2E;IAC3E,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAwD3E,2DAA2D;IAC3D,KAAK,IAAI,IAAI;IASb,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,WAAW;IAoDnB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,SAAS;CASlB"}
|
|
@@ -35,6 +35,10 @@ export interface WebDeeplinkOptions {
|
|
|
35
35
|
callback?: string;
|
|
36
36
|
/** Per-request timeout; the web default is 5 minutes (an app switch + human consent). */
|
|
37
37
|
requestTimeoutMs?: number;
|
|
38
|
+
/** Optional diagnostic sink for the deeplink lifecycle (return-URL matched / ignored, frame
|
|
39
|
+
* drops, events received). METADATA ONLY - never the symKey or sealed payload. Default: no-op.
|
|
40
|
+
* A host can wire this to surface why a deeplink return did or did not land. */
|
|
41
|
+
log?: (message: string) => void;
|
|
38
42
|
}
|
|
39
43
|
/** The persisted pairing/session state of one web dApp <-> wallet deeplink channel. */
|
|
40
44
|
export interface WebDeeplinkRecord {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-deeplink.d.ts","sourceRoot":"","sources":["../../../../src/link/v5/web-deeplink.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIhE,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAExE;yFACyF;AACzF,MAAM,WAAW,kBAAkB;IACjC,uFAAuF;IACvF,IAAI,EAAE,YAAY,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;IACvB;8FAC0F;IAC1F,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAClD;+FAC2F;IAC3F,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;iGAC6F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