@partylayer/adapter-send 1.0.0

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/index.js ADDED
@@ -0,0 +1,636 @@
1
+ 'use strict';
2
+
3
+ var core = require('@partylayer/core');
4
+
5
+ // src/send-adapter.ts
6
+
7
+ // src/constants.ts
8
+ var SEND_KERNEL_ID = "ldmohiccoioolenadmogclhoklmanpgi";
9
+ var SEND_BUILTIN_DETECTION = {
10
+ transport: "window.canton",
11
+ matchers: [
12
+ { field: "kernel.url", match: "domain", value: "cantonwallet.com" },
13
+ { field: "kernel.userUrl", match: "domain", value: "cantonwallet.com" },
14
+ { field: "kernel.id", match: "exact", values: [SEND_KERNEL_ID] }
15
+ ]
16
+ };
17
+ var SEND_SUPPORTED_NETWORKS = ["canton:mainnet"];
18
+ var SEND_INSTALL_URL = "https://sigilry.org";
19
+ var SEND_HOMEPAGE = "https://cantonwallet.com";
20
+ var SEND_DOCS_URL = "https://sigilry.org";
21
+ var SEND_SIGNING_METHOD = "webauthn-prf";
22
+ var SendRpcErrorCode = {
23
+ PARSE_ERROR: -32700,
24
+ INVALID_REQUEST: -32600,
25
+ METHOD_NOT_FOUND: -32601,
26
+ INVALID_PARAMS: -32602,
27
+ INTERNAL_ERROR: -32603,
28
+ USER_REJECTED: 4001,
29
+ UNAUTHORIZED: 4100,
30
+ UNSUPPORTED_METHOD: 4200,
31
+ DISCONNECTED: 4900,
32
+ CHAIN_DISCONNECTED: 4901,
33
+ INVALID_INPUT: -32e3,
34
+ RESOURCE_NOT_FOUND: -32001,
35
+ RESOURCE_UNAVAILABLE: -32002,
36
+ TRANSACTION_REJECTED: -32003,
37
+ METHOD_NOT_SUPPORTED: -32004,
38
+ LIMIT_EXCEEDED: -32005
39
+ };
40
+ var WALLET_ID = "send";
41
+ var SendNotInstalledError = class extends core.WalletNotInstalledError {
42
+ constructor(reason) {
43
+ super(
44
+ WALLET_ID,
45
+ reason ?? `Send Canton Wallet is not detected. Visit ${SEND_INSTALL_URL} for installation instructions`
46
+ );
47
+ this.name = "SendNotInstalledError";
48
+ this.details = {
49
+ ...this.details ?? {},
50
+ installUrl: SEND_INSTALL_URL
51
+ };
52
+ }
53
+ };
54
+ var SendKernelMismatchError = class extends core.WalletNotInstalledError {
55
+ constructor(actualKernelId) {
56
+ super(
57
+ WALLET_ID,
58
+ `Another Canton wallet is active at window.canton (kernel.id="${actualKernelId}", expected "${SEND_KERNEL_ID}"). The Send adapter will yield to the matching adapter.`
59
+ );
60
+ this.name = "SendKernelMismatchError";
61
+ this.details = {
62
+ ...this.details ?? {},
63
+ actualKernelId,
64
+ expectedKernelId: SEND_KERNEL_ID
65
+ };
66
+ }
67
+ };
68
+ var SendAuthTimeoutError = class extends core.WalletNotInstalledError {
69
+ constructor(originalMessage) {
70
+ super(
71
+ WALLET_ID,
72
+ originalMessage ?? "Send authentication timed out. Please try again. If the problem persists, see https://cantonwallet.com"
73
+ );
74
+ this.name = "SendAuthTimeoutError";
75
+ this.details = {
76
+ ...this.details ?? {},
77
+ cause: "send-auth-timeout",
78
+ retry: true,
79
+ helpUrl: "https://cantonwallet.com",
80
+ ...originalMessage ? { originalMessage } : {}
81
+ };
82
+ }
83
+ };
84
+ function detectSendAuthTimeout(err) {
85
+ if (!err || typeof err !== "object") return false;
86
+ const raw = err.message;
87
+ if (typeof raw !== "string" || raw.length === 0) return false;
88
+ const msg = raw.toLowerCase();
89
+ return msg.includes("authentication timed out") || msg.includes("cannot reach authentication server") || msg.includes("auth.cantonwallet.com");
90
+ }
91
+ function isSendRpcError(err) {
92
+ if (!err || typeof err !== "object") return false;
93
+ const candidate = err;
94
+ return typeof candidate.code === "number" && typeof candidate.message === "string";
95
+ }
96
+ function mapSigilryError(err, context) {
97
+ if (err instanceof core.PartyLayerError) return err;
98
+ if (detectSendAuthTimeout(err)) {
99
+ const original = err instanceof Error ? err.message : void 0;
100
+ return new SendAuthTimeoutError(original);
101
+ }
102
+ if (isSendRpcError(err)) {
103
+ const code = err.code;
104
+ const message = err.message;
105
+ if (code === SendRpcErrorCode.USER_REJECTED) {
106
+ return new core.UserRejectedError(context.phase, {
107
+ walletId: context.walletId,
108
+ transport: context.transport,
109
+ rpcCode: code,
110
+ originalMessage: message
111
+ });
112
+ }
113
+ if (code === SendRpcErrorCode.UNSUPPORTED_METHOD || code === SendRpcErrorCode.METHOD_NOT_FOUND || code === SendRpcErrorCode.METHOD_NOT_SUPPORTED) {
114
+ return new core.CapabilityNotSupportedError(WALLET_ID, context.phase);
115
+ }
116
+ if (code === SendRpcErrorCode.DISCONNECTED || code === SendRpcErrorCode.CHAIN_DISCONNECTED || code === SendRpcErrorCode.UNAUTHORIZED) {
117
+ return new core.TransportError(message, err, {
118
+ walletId: context.walletId,
119
+ phase: context.phase,
120
+ transport: context.transport,
121
+ rpcCode: code
122
+ });
123
+ }
124
+ return new core.TransportError(message, err, {
125
+ walletId: context.walletId,
126
+ phase: context.phase,
127
+ transport: context.transport,
128
+ rpcCode: code
129
+ });
130
+ }
131
+ return core.mapUnknownErrorToPartyLayerError(err, context);
132
+ }
133
+ function templateIdHint(payload) {
134
+ if (!payload || typeof payload !== "object") return "";
135
+ const commands = payload.commands;
136
+ if (!Array.isArray(commands)) return "";
137
+ try {
138
+ for (const cmd of commands) {
139
+ const exercise = cmd?.ExerciseCommand ?? cmd?.exerciseCommand ?? cmd?.exercise;
140
+ const create = cmd?.CreateCommand ?? cmd?.createCommand ?? cmd?.create;
141
+ const raw = exercise?.templateId ?? create?.templateId;
142
+ const choice = exercise?.choice;
143
+ if (choice === "Amulet_Transfer" && typeof raw === "string" && raw.includes("Splice.Amulet:Amulet")) {
144
+ return " The command exercises 'Amulet_Transfer' directly on the Amulet template \u2014 that's the legacy (pre-CIP-56) path Canton no longer accepts. Use the Token Standard flow: exercise 'TransferFactory_Transfer' by interface on a TransferFactory contract (interfaceId '#splice-api-token-transfer-instruction-v1:Splice.Api.Token.TransferInstructionV1:TransferFactory'). See https://partylayer.xyz/docs/token-transfers for the canonical flow.";
145
+ }
146
+ if (typeof raw === "string" && raw.length > 0 && !raw.startsWith("#")) {
147
+ return ` The command uses templateId="${raw}" which is the short Canton form; Send requires the fully-qualified Daml form (e.g. '#splice-amulet:Splice.Amulet:Amulet').`;
148
+ }
149
+ }
150
+ } catch {
151
+ }
152
+ return "";
153
+ }
154
+ function safePreview(value, maxLen = 200) {
155
+ if (value === void 0) return "undefined";
156
+ if (value === null) return "null";
157
+ try {
158
+ const s = JSON.stringify(value);
159
+ if (typeof s !== "string") return String(value);
160
+ return s.length > maxLen ? s.slice(0, maxLen) + "..." : s;
161
+ } catch {
162
+ return String(value);
163
+ }
164
+ }
165
+ var SendProvider = class {
166
+ detection;
167
+ cachedStatus = null;
168
+ /**
169
+ * @param detection Optional. Used to match the running `window.canton`
170
+ * provider against Send's identity. When omitted, falls back to
171
+ * `SEND_BUILTIN_DETECTION` (canonical registry rule mirror).
172
+ */
173
+ constructor(detection) {
174
+ this.detection = detection ?? SEND_BUILTIN_DETECTION;
175
+ }
176
+ /**
177
+ * True when `window.canton` is present AND its self-reported status
178
+ * matches Send's detection rules. Performs an actual `status` round-trip
179
+ * on first call and caches the response for subsequent ones.
180
+ */
181
+ async isInstalled() {
182
+ if (typeof window === "undefined" || !window.canton) return false;
183
+ try {
184
+ const status = await this.fetchStatus();
185
+ return core.matchesProviderDetection(status, this.detection);
186
+ } catch {
187
+ return false;
188
+ }
189
+ }
190
+ /**
191
+ * Synchronous best-effort presence check. Used for fast picker rendering
192
+ * before any async status introspection. May report `true` for a
193
+ * non-Send provider — callers must follow up with `isInstalled()` (or
194
+ * any guarded request) before assuming Send is wired in.
195
+ */
196
+ isPotentiallyAvailable() {
197
+ return typeof window !== "undefined" && !!window.canton;
198
+ }
199
+ /**
200
+ * Read the cached `kernel.id` from the running provider, fetching status
201
+ * on demand. Diagnostic helper kept public for back-compat — detection
202
+ * itself no longer hinges on this single field.
203
+ */
204
+ async getKernelId() {
205
+ const status = await this.fetchStatus();
206
+ const id = status?.kernel?.id;
207
+ if (typeof id !== "string" || id.length === 0) {
208
+ throw new SendNotInstalledError(
209
+ "window.canton.status() did not return a kernel.id \u2014 provider is malformed."
210
+ );
211
+ }
212
+ return id;
213
+ }
214
+ /**
215
+ * Read the latest cached status object. Resolves the underlying RPC on
216
+ * demand if no cached value is present.
217
+ */
218
+ async getStatus() {
219
+ return this.fetchStatus();
220
+ }
221
+ /**
222
+ * Reset the cached status (e.g. after the user uninstalls and reinstalls
223
+ * the extension, or you suspect kernel identity changed mid-session).
224
+ * Kept under both names to avoid breaking existing test imports.
225
+ */
226
+ resetKernelCache() {
227
+ this.cachedStatus = null;
228
+ }
229
+ resetStatusCache() {
230
+ this.cachedStatus = null;
231
+ }
232
+ async fetchStatus() {
233
+ if (this.cachedStatus) return this.cachedStatus;
234
+ if (typeof window === "undefined" || !window.canton) {
235
+ throw new SendNotInstalledError();
236
+ }
237
+ const provider = window.canton;
238
+ const status = await provider.request({ method: "status" });
239
+ this.cachedStatus = status;
240
+ return status;
241
+ }
242
+ /** Internal — bypasses the detection guard. */
243
+ async rawRequest(args) {
244
+ if (typeof window === "undefined" || !window.canton) {
245
+ throw new SendNotInstalledError();
246
+ }
247
+ const provider = window.canton;
248
+ return provider.request(args);
249
+ }
250
+ /** Public dispatch — guards every call with a registry-driven detection check. */
251
+ async guardedRequest(args) {
252
+ const status = await this.fetchStatus();
253
+ if (!core.matchesProviderDetection(status, this.detection)) {
254
+ const observedId = status?.kernel?.id ?? "<unknown>";
255
+ throw new SendKernelMismatchError(observedId);
256
+ }
257
+ return this.rawRequest(args);
258
+ }
259
+ // ── Sigilry RPC methods (every one is guarded) ─────────────────────────
260
+ status() {
261
+ return this.guardedRequest({ method: "status" });
262
+ }
263
+ connect() {
264
+ return this.guardedRequest({ method: "connect" });
265
+ }
266
+ disconnect() {
267
+ return this.guardedRequest({ method: "disconnect" });
268
+ }
269
+ isConnected() {
270
+ return this.guardedRequest({ method: "isConnected" });
271
+ }
272
+ getActiveNetwork() {
273
+ return this.guardedRequest({ method: "getActiveNetwork" });
274
+ }
275
+ listAccounts() {
276
+ return this.guardedRequest({ method: "listAccounts" });
277
+ }
278
+ getPrimaryAccount() {
279
+ return this.guardedRequest({ method: "getPrimaryAccount" });
280
+ }
281
+ signMessage(message) {
282
+ return this.guardedRequest({ method: "signMessage", params: { message } });
283
+ }
284
+ prepareExecute(params) {
285
+ return this.guardedRequest({ method: "prepareExecute", params });
286
+ }
287
+ prepareExecuteAndWait(params) {
288
+ return this.guardedRequest({ method: "prepareExecuteAndWait", params });
289
+ }
290
+ ledgerApi(req) {
291
+ return this.guardedRequest({ method: "ledgerApi", params: req });
292
+ }
293
+ // ── Events ─────────────────────────────────────────────────────────────
294
+ // No kernel guard here on purpose — by the time the dApp wires up an
295
+ // event listener it has already gone through `connect()` (which IS
296
+ // guarded), so we trust the binding.
297
+ on(event, listener) {
298
+ if (typeof window === "undefined" || !window.canton) {
299
+ throw new SendNotInstalledError();
300
+ }
301
+ window.canton.on(event, listener);
302
+ }
303
+ off(event, listener) {
304
+ if (typeof window === "undefined" || !window.canton) return;
305
+ if (typeof window.canton.off === "function") {
306
+ window.canton.off(event, listener);
307
+ return;
308
+ }
309
+ if (typeof window.canton.removeListener === "function") {
310
+ window.canton.removeListener(event, listener);
311
+ }
312
+ }
313
+ };
314
+
315
+ // src/send-adapter.ts
316
+ var WALLET_ID2 = "send";
317
+ var SEND_CAPABILITIES = [
318
+ "connect",
319
+ "disconnect",
320
+ "restore",
321
+ "signMessage",
322
+ "submitTransaction",
323
+ "ledgerApi",
324
+ "events",
325
+ "injected"
326
+ ];
327
+ var SendAdapter = class {
328
+ walletId = core.toWalletId(WALLET_ID2);
329
+ name = "Send";
330
+ provider;
331
+ /**
332
+ * @param options.detection Optional. When supplied, the adapter uses
333
+ * these matcher rules to decide whether the running `window.canton`
334
+ * belongs to Send. Inject this from the registry entry's
335
+ * `providerDetection` field for canonical behaviour. Omitting it
336
+ * falls back to the built-in pattern that mirrors the canonical
337
+ * registry rule (parity is verified by tests).
338
+ * @param options.provider Optional. Pre-built provider instance, used
339
+ * primarily by tests; takes precedence over `options.detection`.
340
+ */
341
+ constructor(options) {
342
+ this.provider = options?.provider ?? new SendProvider(options?.detection);
343
+ }
344
+ getCapabilities() {
345
+ return SEND_CAPABILITIES;
346
+ }
347
+ async detectInstalled() {
348
+ if (typeof window === "undefined") {
349
+ return { installed: false, reason: "Browser environment required" };
350
+ }
351
+ if (!this.provider.isPotentiallyAvailable()) {
352
+ return {
353
+ installed: false,
354
+ reason: `Send Canton Wallet not detected. Visit ${SEND_INSTALL_URL} for installation instructions`
355
+ };
356
+ }
357
+ const installed = await this.provider.isInstalled();
358
+ if (installed) {
359
+ return { installed: true, reason: "Send Canton Wallet detected" };
360
+ }
361
+ return {
362
+ installed: false,
363
+ reason: "window.canton is present but its kernel.id does not match Send. Another Canton wallet is active."
364
+ };
365
+ }
366
+ async connect(ctx, _opts) {
367
+ try {
368
+ if (!this.provider.isPotentiallyAvailable()) {
369
+ throw new SendNotInstalledError();
370
+ }
371
+ ctx.logger.debug("Connecting to Send Canton Wallet", {
372
+ appName: ctx.appName,
373
+ network: ctx.network
374
+ });
375
+ const status = await this.provider.connect();
376
+ const account = await this.provider.getPrimaryAccount();
377
+ const partyId = core.toPartyId(account.partyId);
378
+ ctx.logger.info("Connected to Send Canton Wallet", {
379
+ partyId: account.partyId,
380
+ signingProviderId: account.signingProviderId,
381
+ kernelId: status.kernel?.id
382
+ });
383
+ return {
384
+ partyId,
385
+ session: {
386
+ walletId: this.walletId,
387
+ network: ctx.network,
388
+ createdAt: Date.now(),
389
+ metadata: buildSessionMetadata(status, account)
390
+ },
391
+ capabilities: this.getCapabilities()
392
+ };
393
+ } catch (err) {
394
+ throw mapSigilryError(err, {
395
+ walletId: this.walletId,
396
+ phase: "connect",
397
+ transport: "injected",
398
+ details: { origin: ctx.origin, network: ctx.network }
399
+ });
400
+ }
401
+ }
402
+ async disconnect(ctx, _session) {
403
+ try {
404
+ await this.provider.disconnect();
405
+ } catch (err) {
406
+ ctx.logger.warn("Error during Send wallet disconnect", err);
407
+ }
408
+ }
409
+ async restore(ctx, persisted) {
410
+ try {
411
+ if (typeof window === "undefined") return null;
412
+ if (!this.provider.isPotentiallyAvailable()) return null;
413
+ if (persisted.expiresAt && Date.now() >= persisted.expiresAt) return null;
414
+ const status = await this.provider.status();
415
+ if (!status.isConnected) return null;
416
+ const account = await this.provider.getPrimaryAccount();
417
+ if (account.partyId !== persisted.partyId) {
418
+ ctx.logger.debug(
419
+ "Send primary account changed since session was persisted; treating as expired",
420
+ {
421
+ persistedPartyId: persisted.partyId,
422
+ currentPartyId: account.partyId
423
+ }
424
+ );
425
+ return null;
426
+ }
427
+ ctx.logger.debug("Restored Send Canton Wallet session", {
428
+ partyId: account.partyId,
429
+ kernelId: status.kernel?.id
430
+ });
431
+ return {
432
+ ...persisted,
433
+ walletId: this.walletId,
434
+ metadata: {
435
+ ...persisted.metadata ?? {},
436
+ ...buildSessionMetadata(status, account)
437
+ }
438
+ };
439
+ } catch (err) {
440
+ ctx.logger.warn("Failed to restore Send wallet session", err);
441
+ return null;
442
+ }
443
+ }
444
+ async signMessage(ctx, session, params) {
445
+ try {
446
+ if (typeof params.message !== "string" || params.message.length === 0) {
447
+ throw new Error("signMessage requires a non-empty string `message`");
448
+ }
449
+ ctx.logger.debug("Signing message with Send Canton Wallet", {
450
+ sessionId: session.sessionId,
451
+ messageLength: params.message.length
452
+ });
453
+ const { signature } = await this.provider.signMessage(params.message);
454
+ return {
455
+ signature: core.toSignature(signature),
456
+ partyId: session.partyId,
457
+ message: params.message,
458
+ nonce: params.nonce,
459
+ domain: params.domain
460
+ };
461
+ } catch (err) {
462
+ throw mapSigilryError(err, {
463
+ walletId: this.walletId,
464
+ phase: "signMessage",
465
+ transport: "injected",
466
+ details: { sessionId: session.sessionId }
467
+ });
468
+ }
469
+ }
470
+ async signTransaction(_ctx, _session, _params) {
471
+ throw new core.CapabilityNotSupportedError(
472
+ this.walletId,
473
+ "signTransaction \u2014 Send fuses sign-and-submit through prepareExecuteAndWait. Use submitTransaction instead."
474
+ );
475
+ }
476
+ async submitTransaction(ctx, session, params) {
477
+ const payload = params.signedTx;
478
+ try {
479
+ if (!payload || typeof payload !== "object") {
480
+ throw new Error(
481
+ `submitTransaction requires a SendPrepareSubmissionRequest as \`signedTx\` (received ${safePreview(payload)})`
482
+ );
483
+ }
484
+ if (!payload.commands || typeof payload.commands !== "object") {
485
+ throw new Error(
486
+ `submitTransaction signedTx is missing the required 'commands' field (received ${safePreview(payload)})`
487
+ );
488
+ }
489
+ ctx.logger.debug("Submitting transaction via Send Canton Wallet", {
490
+ sessionId: session.sessionId,
491
+ commandId: payload.commandId
492
+ });
493
+ const { tx } = await this.provider.prepareExecuteAndWait(payload);
494
+ if (!tx || typeof tx !== "object" || !tx.payload?.updateId) {
495
+ throw new Error(
496
+ `Send returned an unexpected shape from prepareExecuteAndWait. Expected { tx: { commandId, status:'executed', payload: { updateId, completionOffset } } } but received ${safePreview(tx)}.`
497
+ );
498
+ }
499
+ return {
500
+ transactionHash: core.toTransactionHash(tx.payload.updateId),
501
+ submittedAt: Date.now(),
502
+ commandId: tx.commandId,
503
+ updateId: tx.payload.updateId
504
+ };
505
+ } catch (err) {
506
+ const baseHint = templateIdHint(payload);
507
+ if (baseHint && !isSendRpcError(err)) {
508
+ const baseMessage = err instanceof Error ? err.message : String(err);
509
+ throw new core.TransportError(
510
+ baseMessage + baseHint,
511
+ err instanceof Error ? err : void 0,
512
+ {
513
+ walletId: this.walletId,
514
+ phase: "submitTransaction",
515
+ transport: "injected",
516
+ sessionId: session.sessionId,
517
+ commandId: payload?.commandId
518
+ }
519
+ );
520
+ }
521
+ throw mapSigilryError(err, {
522
+ walletId: this.walletId,
523
+ phase: "submitTransaction",
524
+ transport: "injected",
525
+ details: { sessionId: session.sessionId, commandId: payload?.commandId }
526
+ });
527
+ }
528
+ }
529
+ async ledgerApi(ctx, session, params) {
530
+ try {
531
+ ctx.logger.debug("Proxying ledger API request via Send Canton Wallet", {
532
+ sessionId: session.sessionId,
533
+ requestMethod: params.requestMethod,
534
+ resource: params.resource
535
+ });
536
+ const result = await this.provider.ledgerApi({
537
+ requestMethod: params.requestMethod,
538
+ resource: params.resource,
539
+ body: params.body
540
+ });
541
+ if (result && typeof result.response === "string") {
542
+ return { response: result.response };
543
+ }
544
+ return { response: JSON.stringify(result ?? null) };
545
+ } catch (err) {
546
+ throw mapSigilryError(err, {
547
+ walletId: this.walletId,
548
+ phase: "ledgerApi",
549
+ transport: "injected",
550
+ details: {
551
+ sessionId: session.sessionId,
552
+ requestMethod: params.requestMethod,
553
+ resource: params.resource
554
+ }
555
+ });
556
+ }
557
+ }
558
+ /**
559
+ * Subscribe to PartyLayer adapter events. Currently bridges only
560
+ * `txStatus` from Send's native `txChanged` event. Other PartyLayer
561
+ * adapter events (`connect` / `disconnect` / `sessionExpired` / `error`)
562
+ * are emitted by the SDK itself, not the wallet, so we no-op them.
563
+ */
564
+ on(event, handler) {
565
+ if (event !== "txStatus") {
566
+ return () => {
567
+ };
568
+ }
569
+ const listener = (...args) => {
570
+ const tx = args[0];
571
+ if (!tx) return;
572
+ handler({
573
+ status: mapTxStatus(tx.status),
574
+ commandId: tx.commandId,
575
+ raw: tx
576
+ });
577
+ };
578
+ try {
579
+ this.provider.on("txChanged", listener);
580
+ } catch {
581
+ return () => {
582
+ };
583
+ }
584
+ return () => this.provider.off("txChanged", listener);
585
+ }
586
+ };
587
+ function mapTxStatus(status) {
588
+ switch (status) {
589
+ case "pending":
590
+ return "pending";
591
+ case "signed":
592
+ return "submitted";
593
+ case "executed":
594
+ return "committed";
595
+ case "failed":
596
+ default:
597
+ return "failed";
598
+ }
599
+ }
600
+ function buildSessionMetadata(status, account) {
601
+ const meta = {
602
+ kernelId: status.kernel?.id ?? "",
603
+ signingProviderId: account.signingProviderId,
604
+ signingMethod: SEND_SIGNING_METHOD,
605
+ publicKey: account.publicKey,
606
+ namespace: account.namespace,
607
+ networkId: account.networkId,
608
+ hint: account.hint
609
+ };
610
+ if (status.network?.ledgerApi?.baseUrl) {
611
+ meta.ledgerApiBaseUrl = status.network.ledgerApi.baseUrl;
612
+ }
613
+ if (status.session?.userId) {
614
+ meta.userId = status.session.userId;
615
+ }
616
+ return meta;
617
+ }
618
+
619
+ exports.SEND_DOCS_URL = SEND_DOCS_URL;
620
+ exports.SEND_HOMEPAGE = SEND_HOMEPAGE;
621
+ exports.SEND_INSTALL_URL = SEND_INSTALL_URL;
622
+ exports.SEND_KERNEL_ID = SEND_KERNEL_ID;
623
+ exports.SEND_SIGNING_METHOD = SEND_SIGNING_METHOD;
624
+ exports.SEND_SUPPORTED_NETWORKS = SEND_SUPPORTED_NETWORKS;
625
+ exports.SendAdapter = SendAdapter;
626
+ exports.SendAuthTimeoutError = SendAuthTimeoutError;
627
+ exports.SendKernelMismatchError = SendKernelMismatchError;
628
+ exports.SendNotInstalledError = SendNotInstalledError;
629
+ exports.SendProvider = SendProvider;
630
+ exports.SendRpcErrorCode = SendRpcErrorCode;
631
+ exports.detectSendAuthTimeout = detectSendAuthTimeout;
632
+ exports.mapSigilryError = mapSigilryError;
633
+ exports.safePreview = safePreview;
634
+ exports.templateIdHint = templateIdHint;
635
+ //# sourceMappingURL=index.js.map
636
+ //# sourceMappingURL=index.js.map