@spirobel/monero-wallet-api 0.5.4 → 0.6.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.
Files changed (91) hide show
  1. package/dist/actionlog/actionLogOpened.d.ts +96 -1
  2. package/dist/actionlog/actionLogOpened.js +386 -1
  3. package/dist/actionlog/actionLogTypes.d.ts +114 -0
  4. package/dist/actionlog/actionLogTypes.js +198 -0
  5. package/dist/actionlog/backend/idbBackend.d.ts +13 -0
  6. package/dist/actionlog/backend/idbBackend.js +109 -0
  7. package/dist/actionlog/backend/jsonlBackend.d.ts +19 -0
  8. package/dist/actionlog/backend/jsonlBackend.js +110 -0
  9. package/dist/actionlog/backend/memoryBackend.d.ts +11 -0
  10. package/dist/actionlog/backend/memoryBackend.js +31 -0
  11. package/dist/actionlog/backend/sqliteBackend.d.ts +14 -0
  12. package/dist/actionlog/backend/sqliteBackend.js +96 -0
  13. package/dist/actionlog/backend.d.ts +12 -0
  14. package/dist/actionlog/backend.js +1 -0
  15. package/dist/actionlog/idbBackend.d.ts +19 -0
  16. package/dist/actionlog/idbBackend.js +98 -0
  17. package/dist/actionlog/jsonlBackend.d.ts +19 -0
  18. package/dist/actionlog/jsonlBackend.js +75 -0
  19. package/dist/actionlog/memoryBackend.d.ts +14 -0
  20. package/dist/actionlog/memoryBackend.js +38 -0
  21. package/dist/actionlog/openMaps.d.ts +11 -0
  22. package/dist/actionlog/openMaps.js +32 -0
  23. package/dist/actionlog/sqliteBackend.d.ts +18 -0
  24. package/dist/actionlog/sqliteBackend.js +105 -0
  25. package/dist/actionlog/toolContext.d.ts +36 -0
  26. package/dist/actionlog/toolContext.js +1 -0
  27. package/dist/actionlog/types.d.ts +62 -0
  28. package/dist/actionlog/types.js +62 -0
  29. package/dist/api.d.ts +4 -0
  30. package/dist/api.js +3 -0
  31. package/dist/io/sleep.d.ts +1 -1
  32. package/dist/io/sleep.js +16 -1
  33. package/dist/scanning-syncing/backgroundWorker.d.ts +2 -0
  34. package/dist/scanning-syncing/backgroundWorker.js +92 -10
  35. package/dist/scanning-syncing/blocksbuffer/blocksBufferFetchLoop.js +33 -2
  36. package/dist/scanning-syncing/blocksbuffer/blocksbufferCoordination.js +2 -2
  37. package/dist/scanning-syncing/connectionStatus.d.ts +8 -0
  38. package/dist/scanning-syncing/connectionStatus.js +50 -0
  39. package/dist/scanning-syncing/connectionStatusOpened.d.ts +3 -1
  40. package/dist/scanning-syncing/connectionStatusOpened.js +22 -14
  41. package/dist/scanning-syncing/openWallet.d.ts +4 -1
  42. package/dist/scanning-syncing/openWallet.js +3 -0
  43. package/dist/scanning-syncing/scanresult/scanCache.d.ts +5 -1
  44. package/dist/scanning-syncing/scanresult/scanCache.js +11 -2
  45. package/dist/scanning-syncing/scanresult/scanCacheOpened.d.ts +56 -5
  46. package/dist/scanning-syncing/scanresult/scanCacheOpened.js +422 -83
  47. package/dist/scanning-syncing/scanresult/scanCoordination.d.ts +7 -3
  48. package/dist/scanning-syncing/scanresult/scanCoordination.js +126 -28
  49. package/dist/scanning-syncing/scanresult/scanLoop.d.ts +1 -2
  50. package/dist/scanning-syncing/scanresult/scanLoop.js +0 -13
  51. package/dist/scanning-syncing/scanresult/scanResult.js +17 -12
  52. package/dist/scanning-syncing/scanresult/scanStats.js +8 -5
  53. package/dist/scanning-syncing/worker-entrypoints/worker.js +1 -1
  54. package/dist/scanning-syncing/worker-mains/coordinator-main.d.ts +1 -0
  55. package/dist/scanning-syncing/worker-mains/coordinator-main.js +16 -1
  56. package/dist/scanning-syncing/worker-mains/cpubound-main.js +3 -2
  57. package/dist/scanning-syncing/worker-mains/worker.js +45 -2
  58. package/dist/tools/calls/001.d.ts +20 -0
  59. package/dist/tools/calls/001.js +236 -0
  60. package/dist/tools/calls/002-content.d.ts +46 -0
  61. package/dist/tools/calls/002-content.js +135 -0
  62. package/dist/tools/calls/002-fail-cleanup.d.ts +27 -0
  63. package/dist/tools/calls/002-fail-cleanup.js +60 -0
  64. package/dist/tools/calls/002.d.ts +64 -0
  65. package/dist/tools/calls/002.js +353 -0
  66. package/dist/tools/content.d.ts +22 -0
  67. package/dist/tools/content.js +41 -0
  68. package/dist/tools/counterparty.d.ts +3 -0
  69. package/dist/tools/counterparty.js +1 -0
  70. package/dist/tools/download-public-suffix.d.ts +1 -0
  71. package/dist/tools/download-public-suffix.js +20 -0
  72. package/dist/tools/globals.d.ts +196 -0
  73. package/dist/tools/globals.js +14 -0
  74. package/dist/tools/monero-tools-content.d.ts +29 -0
  75. package/dist/tools/monero-tools-content.js +80 -0
  76. package/dist/tools/monero-tools.d.ts +27 -52
  77. package/dist/tools/monero-tools.js +127 -222
  78. package/dist/tools/public-suffix-list.d.ts +1 -0
  79. package/dist/tools/public-suffix-list.js +10336 -0
  80. package/dist/tools/runtimeMessages.d.ts +4 -0
  81. package/dist/tools/runtimeMessages.js +18 -0
  82. package/dist/tools/toolActionLogContext.d.ts +33 -0
  83. package/dist/tools/toolActionLogContext.js +1 -0
  84. package/dist/tools/toolArm.d.ts +47 -0
  85. package/dist/tools/toolArm.js +1 -0
  86. package/dist/tools/ui.d.ts +2 -0
  87. package/dist/tools/ui.js +1 -0
  88. package/dist/tools/worker.d.ts +1 -0
  89. package/dist/tools/worker.js +1 -0
  90. package/dist/wasm-processing/wasmFile.js +2 -2
  91. package/package.json +8 -1
@@ -0,0 +1,196 @@
1
+ import type { ToolWorkerContext } from "../actionlog/actionLogTypes";
2
+ export declare const TOOL_MAGIC_STRING = "monerochan";
3
+ export type ToolInvocationValidity = "valid" | "invalid" | "unverified";
4
+ export type ExtensionMessageByKind = {
5
+ toolCall: {
6
+ tool: {
7
+ tool_id: string;
8
+ payload: unknown;
9
+ };
10
+ destination_domain: string;
11
+ context_domain: string;
12
+ found_in: "link" | "linkText";
13
+ link: string;
14
+ linkText: string;
15
+ timestamp: number;
16
+ invocation_id: string;
17
+ context_href: string;
18
+ valid: ToolInvocationValidity;
19
+ };
20
+ execute: {
21
+ invocationId: string;
22
+ args?: Record<string, unknown>;
23
+ };
24
+ dismiss: {
25
+ invocationId: string;
26
+ };
27
+ dismissNotice: {
28
+ noticeId: string;
29
+ };
30
+ openSidebar: null;
31
+ actionLogChanged: null;
32
+ walletCacheChanged: string;
33
+ "worker.setNodeUrl": {
34
+ node_url?: string;
35
+ };
36
+ "worker.setStartHeight": {
37
+ start_height?: number | null;
38
+ };
39
+ "worker.changeNodeUrlAndStartHeight": {
40
+ node_url?: string;
41
+ start_height?: number | null;
42
+ };
43
+ "worker.buildWallets": null;
44
+ "worker.stopWorker": null;
45
+ "worker.makeSignSend": {
46
+ primary_address: string;
47
+ payments: {
48
+ address: string;
49
+ amount: string;
50
+ }[];
51
+ input_indexes: string[];
52
+ };
53
+ "worker.sweepSignSend": {
54
+ primary_address: string;
55
+ address: string;
56
+ input_indexes: string[];
57
+ };
58
+ "worker.rebroadcastTx": {
59
+ primary_address: string;
60
+ tx_log_index: number;
61
+ };
62
+ "worker.dismissSendPlate": {
63
+ primary_address: string;
64
+ };
65
+ "worker.setLogSettings": {
66
+ logs?: "console" | "file" | "console-and-file" | "off" | null;
67
+ logs_include?: string[] | null;
68
+ logs_exclude?: string[] | null;
69
+ };
70
+ "worker.getTxLogs": null;
71
+ shareViewkeyOK: {
72
+ invocationId: string;
73
+ };
74
+ shareViewkeyFAILED: {
75
+ viewkey: string;
76
+ primary_address: string;
77
+ error?: string;
78
+ tool_invo: {
79
+ tool: {
80
+ tool_id: string;
81
+ payload: unknown;
82
+ };
83
+ found_in: "link" | "linkText";
84
+ link: string;
85
+ linkText: string;
86
+ valid: ToolInvocationValidity;
87
+ };
88
+ };
89
+ };
90
+ export type ExtensionMessageKind = keyof ExtensionMessageByKind;
91
+ export type ToolPermission = "spend" | "share_view";
92
+ export type ToolNotice = {
93
+ id: string;
94
+ permission: ToolPermission;
95
+ title: string;
96
+ message: string;
97
+ context_domain?: string;
98
+ context_href?: string;
99
+ wallet_slot?: number;
100
+ timestamp?: number | string;
101
+ };
102
+ export type ToolUiCopy = {
103
+ openTitle: string;
104
+ acceptLabel?: string;
105
+ dismissLabel?: string;
106
+ };
107
+ export type ExtensionPort = {
108
+ name: string;
109
+ postMessage: (msg: unknown) => void;
110
+ disconnect: () => void;
111
+ onMessage: {
112
+ addListener: (cb: (msg: unknown) => void) => void;
113
+ };
114
+ onDisconnect: {
115
+ addListener: (cb: () => void) => void;
116
+ };
117
+ };
118
+ export type ExtensionRuntime = {
119
+ sendMessage: (msg: unknown) => Promise<unknown>;
120
+ connect: (info: {
121
+ name: string;
122
+ }) => ExtensionPort;
123
+ onMessage: {
124
+ addListener: (cb: (msg: unknown, sender: unknown) => void) => void;
125
+ };
126
+ onConnect: {
127
+ addListener: (cb: (port: ExtensionPort) => void) => void;
128
+ };
129
+ };
130
+ export declare function getExtensionRuntime(): ExtensionRuntime | null;
131
+ export declare function sendToBackground<K extends ExtensionMessageKind>(kind: K, payload: ExtensionMessageByKind[K]): Promise<unknown>;
132
+ export type PortMessageByKind = {
133
+ shareViewkey: {
134
+ viewkey: string;
135
+ primary_address: string;
136
+ tool_invo: {
137
+ tool: {
138
+ tool_id: string;
139
+ payload: {
140
+ wallet_slot: number;
141
+ };
142
+ };
143
+ found_in: "link" | "linkText";
144
+ link: string;
145
+ linkText: string;
146
+ valid: ToolInvocationValidity;
147
+ };
148
+ };
149
+ };
150
+ export type PortMessageKind = keyof PortMessageByKind;
151
+ export declare function sendToPort<K extends PortMessageKind>(port: ExtensionPort, kind: K, payload: PortMessageByKind[K]): void;
152
+ export type ToolInvocationForValidate = {
153
+ tool: {
154
+ tool_id: string;
155
+ payload: unknown;
156
+ };
157
+ destination_domain: string;
158
+ context_domain: string;
159
+ found_in: "link" | "linkText";
160
+ link: string;
161
+ linkText: string;
162
+ timestamp: number;
163
+ invocation_id: string;
164
+ context_href: string;
165
+ valid: ToolInvocationValidity;
166
+ };
167
+ export type ToolContentZone<TPayload = unknown> = {
168
+ recognize_parse: (args: string[]) => {
169
+ tool_id: string;
170
+ payload: TPayload;
171
+ } | null;
172
+ validate_check?: (invo: ToolInvocationForValidate) => Promise<ToolInvocationValidity> | ToolInvocationValidity;
173
+ execute_deliver?: (invo: ToolInvocationForValidate) => void;
174
+ };
175
+ export type ToolWorkerZone = {
176
+ invoke_write?: (ctx: ToolWorkerContext, invo: ToolInvocationForValidate) => Promise<void>;
177
+ validate_write?: (ctx: ToolWorkerContext, invo: ToolInvocationForValidate) => Promise<void>;
178
+ accept_yes?: (ctx: ToolWorkerContext, invocationId: string, args: Record<string, unknown>) => Promise<void>;
179
+ accept_no?: (ctx: ToolWorkerContext, invocationId: string) => Promise<void>;
180
+ execute_run?: (ctx: ToolWorkerContext, invocationId: string, args: Record<string, unknown>) => Promise<void>;
181
+ execute_abort?: (ctx: ToolWorkerContext, invocationId: string) => Promise<void>;
182
+ execute_ok?: (ctx: ToolWorkerContext, payload: {
183
+ invocationId: string;
184
+ }) => Promise<void>;
185
+ execute_fail?: (ctx: ToolWorkerContext, payload: unknown) => Promise<void>;
186
+ };
187
+ export type ToolCounterpartyZone<TPayload = unknown, TExtra extends object = {}> = {
188
+ make: (payload: TPayload) => string;
189
+ } & TExtra;
190
+ export type ToolArm<TPayload = unknown, TCounterpartyExtra extends object = {}> = {
191
+ permissions: readonly ToolPermission[];
192
+ ui: ToolUiCopy;
193
+ content: ToolContentZone<TPayload>;
194
+ worker: ToolWorkerZone;
195
+ counterparty: ToolCounterpartyZone<TPayload, TCounterpartyExtra>;
196
+ };
@@ -0,0 +1,14 @@
1
+ export const TOOL_MAGIC_STRING = "monerochan";
2
+ export function getExtensionRuntime() {
3
+ const g = globalThis;
4
+ return g.browser?.runtime ?? g.chrome?.runtime ?? null;
5
+ }
6
+ export function sendToBackground(kind, payload) {
7
+ const rt = getExtensionRuntime();
8
+ if (!rt?.sendMessage)
9
+ return Promise.resolve(null);
10
+ return rt.sendMessage({ kind, payload });
11
+ }
12
+ export function sendToPort(port, kind, payload) {
13
+ port.postMessage({ kind, payload });
14
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * content-script entry graph only. do not import api.ts (indexedDB top-level await).
3
+ */
4
+ import { type ToolInvocationValidity } from "./globals";
5
+ import { type SendTransactionTool } from "./calls/001";
6
+ import { type CreateAndShareViewOnlyWalletTool } from "./calls/002";
7
+ export type MoneroTool = SendTransactionTool | CreateAndShareViewOnlyWalletTool;
8
+ export type ToolId = "001" | "002";
9
+ export type ParsedMoneroToolInvocation = {
10
+ tool: MoneroTool;
11
+ destination_domain: string;
12
+ context_domain: string;
13
+ found_in: "link" | "linkText";
14
+ link: string;
15
+ linkText: string;
16
+ timestamp: number;
17
+ invocation_id: string;
18
+ context_href: string;
19
+ valid: ToolInvocationValidity;
20
+ };
21
+ export declare const tools: {
22
+ readonly "001": import("./toolArm").ToolArm<import("./monero-tools").SendTransactionToolPayload>;
23
+ readonly "002": import("./toolArm").ToolArm<import("./monero-tools").CreateAndShareViewOnlyWalletToolPayload>;
24
+ };
25
+ export declare function getDomainWithTLD(hostname: string): string;
26
+ export declare function parseDestination(destination: string): string;
27
+ export declare function parseToolLink(link: string): MoneroTool | null;
28
+ export declare function parseToolInvocation(link: string, linkText: string, context_location: Location): ParsedMoneroToolInvocation | null;
29
+ export declare function checkToolInvocationValidity(invo: ParsedMoneroToolInvocation): Promise<ToolInvocationValidity>;
@@ -0,0 +1,80 @@
1
+ /**
2
+ * content-script entry graph only. do not import api.ts (indexedDB top-level await).
3
+ */
4
+ import { TOOL_MAGIC_STRING, } from "./globals";
5
+ import { parseSendTransactionToolArgs, } from "./calls/001";
6
+ import tool001 from "./calls/001";
7
+ import tool002, { parseCreateAndShareViewOnlyWalletToolArgs, } from "./calls/002";
8
+ export const tools = {
9
+ "001": tool001,
10
+ "002": tool002,
11
+ };
12
+ export function getDomainWithTLD(hostname) {
13
+ const parts = hostname.split(".");
14
+ if (parts.length <= 1)
15
+ return hostname;
16
+ return parts.slice(-2).join(".");
17
+ }
18
+ export function parseDestination(destination) {
19
+ const url = new URL(destination);
20
+ return getDomainWithTLD(url.hostname);
21
+ }
22
+ export function parseToolLink(link) {
23
+ const magic_str_index = link.lastIndexOf(TOOL_MAGIC_STRING);
24
+ if (magic_str_index === -1)
25
+ return null;
26
+ const link_start_index = magic_str_index + TOOL_MAGIC_STRING.length;
27
+ const tool_id = link.substring(link_start_index, link_start_index + 3);
28
+ const args = link
29
+ .substring(link_start_index + 3)
30
+ .split("_")
31
+ .slice(1);
32
+ if (tool_id === "001")
33
+ return parseSendTransactionToolArgs(args);
34
+ if (tool_id === "002")
35
+ return parseCreateAndShareViewOnlyWalletToolArgs(args);
36
+ return null;
37
+ }
38
+ export function parseToolInvocation(link, linkText, context_location) {
39
+ const context_domain = getDomainWithTLD(context_location.hostname);
40
+ const context_href = context_location.href;
41
+ const link_parse = parseToolLink(link);
42
+ if (link_parse) {
43
+ return {
44
+ tool: link_parse,
45
+ destination_domain: parseDestination(link),
46
+ context_domain,
47
+ found_in: "link",
48
+ link,
49
+ linkText,
50
+ timestamp: Date.now(),
51
+ invocation_id: crypto.randomUUID(),
52
+ context_href,
53
+ valid: "unverified",
54
+ };
55
+ }
56
+ const linkText_parse = parseToolLink(linkText);
57
+ if (linkText_parse) {
58
+ return {
59
+ tool: linkText_parse,
60
+ destination_domain: parseDestination(linkText),
61
+ context_domain,
62
+ found_in: "linkText",
63
+ link,
64
+ linkText,
65
+ timestamp: Date.now(),
66
+ invocation_id: crypto.randomUUID(),
67
+ context_href,
68
+ valid: "unverified",
69
+ };
70
+ }
71
+ return null;
72
+ }
73
+ export async function checkToolInvocationValidity(invo) {
74
+ const id = invo.tool.tool_id;
75
+ const arm = tools[id];
76
+ const validate = arm?.content?.validate;
77
+ if (!validate)
78
+ return "unverified";
79
+ return validate(invo);
80
+ }
@@ -1,7 +1,27 @@
1
- import type { ScanSettingOpened } from "../api";
2
- export declare const TOOL_MAGIC_STRING = "monerochan";
3
- export declare function parseToolLink(link: string): MoneroTool | null;
4
- export type ToolInvocationValidity = "valid" | "invalid" | "unverified";
1
+ import { TOOL_MAGIC_STRING, type ToolArm, type ToolInvocationValidity, type ToolPermission, type ToolUiCopy } from "./globals";
2
+ export { TOOL_MAGIC_STRING, type ToolInvocationValidity };
3
+ export type { ToolArm, ToolContentZone, ToolCounterpartyZone, ToolInvocationForValidate, ToolWorkerZone, } from "./globals";
4
+ export type { ToolUiCopy, ToolNotice, ToolPermission, } from "./globals";
5
+ export declare const tools: {
6
+ readonly "001": ToolArm<import("./calls/001").SendTransactionToolPayload, {
7
+ validate_route: (deps: {
8
+ isPayAddressKnown: import("./calls/001").IsPayAddressKnown;
9
+ }) => (req: Request) => Promise<Response>;
10
+ }>;
11
+ readonly "002": ToolArm<import("./calls/002").CreateAndShareViewOnlyWalletToolPayload, {
12
+ execute_route: (mco: import("./calls/002").ShareViewMco, opts?: import("./calls/002").HandleShareOpts) => (req: Request) => Promise<Response>;
13
+ }>;
14
+ };
15
+ export type ToolId = keyof typeof tools;
16
+ export declare const TOOL_IDS: ToolId[];
17
+ export declare function getToolUiByPermissions(permissions: ToolPermission[]): ToolUiCopy | null;
18
+ type PayloadOf<A> = A extends ToolArm<infer P, infer _E> ? P : never;
19
+ export type MoneroTool = {
20
+ [K in ToolId]: {
21
+ tool_id: K;
22
+ payload: PayloadOf<(typeof tools)[K]>;
23
+ };
24
+ }[ToolId];
5
25
  export type ParsedMoneroToolInvocation = {
6
26
  tool: MoneroTool;
7
27
  destination_domain: string;
@@ -14,54 +34,9 @@ export type ParsedMoneroToolInvocation = {
14
34
  context_href: string;
15
35
  valid: ToolInvocationValidity;
16
36
  };
17
- export declare function parseToolInvocation(link: string, linkText: string, context_location: Location): ParsedMoneroToolInvocation | null;
18
- export type SendTransactionTool = {
19
- tool_id: "001";
20
- payload: SendTransactionToolPayload;
21
- };
22
- export type SendTransactionToolPayload = {
23
- address: string;
24
- amount: string;
25
- };
26
- export declare function parseSendTransactionToolArgs(args: string[]): SendTransactionTool | null;
27
- export declare function createSendTransactionToolLink(address: string, amount: string): string;
28
- export declare function make001ToolLink(address: string, amount: string): string;
29
- export type CreateAndShareViewOnlyWalletTool = {
30
- tool_id: "002";
31
- payload: CreateAndShareViewOnlyWalletToolPayload;
32
- };
33
- export type CreateAndShareViewOnlyWalletToolPayload = {
34
- wallet_slot: number;
35
- };
36
- export declare function parseCreateAndShareViewOnlyWalletToolArgs(args: string[]): CreateAndShareViewOnlyWalletTool | null;
37
- export declare function createCreateAndShareViewOnlyWalletToolLink(wallet_slot?: number): string;
38
- export declare function make002ToolLink(wallet_slot?: number): string;
39
- export type MoneroTool = SendTransactionTool | CreateAndShareViewOnlyWalletTool;
37
+ export declare function parseToolLink(link: string): MoneroTool | null;
40
38
  export declare function createToolLink(tool: MoneroTool): string;
39
+ export declare function parseToolInvocation(link: string, linkText: string, context_location: Location): ParsedMoneroToolInvocation | null;
40
+ export declare function checkToolInvocationValidity(invo: ParsedMoneroToolInvocation): Promise<ToolInvocationValidity>;
41
41
  export declare function getDomainWithTLD(hostname: string): string;
42
42
  export declare function parseDestination(destination: string): string;
43
- export declare const OPEN_DOMAINS: string[];
44
- export declare function checkToolInvocationValidity(invo: ParsedMoneroToolInvocation): Promise<ToolInvocationValidity>;
45
- export declare const ADDRESS_VALID_RESPONSE: {
46
- readonly valid_address: true;
47
- };
48
- export declare const ADDRESS_INVALID_RESPONSE: {
49
- readonly valid_address: false;
50
- };
51
- export type ShareViewkeyPayload = {
52
- viewkey: string;
53
- primary_address: string;
54
- tool_invo: ParsedMoneroToolInvocation;
55
- };
56
- export type ShareViewkeyResult = {
57
- ok: boolean;
58
- successUrl: string | null;
59
- };
60
- export declare function shareViewKey002(payload: ShareViewkeyPayload): Promise<ShareViewkeyResult>;
61
- export type ShareViewkey002Pruned = {
62
- viewkey: string;
63
- primary_address: string;
64
- wallet_slot: number;
65
- };
66
- export declare function potentialSuccessRedirect002(payload: ShareViewkeyPayload): Promise<ShareViewkeyResult | undefined>;
67
- export declare function handle002ShareRequest(req: Request, wallets: ScanSettingOpened[], parsed_cb: (parsed_body: ShareViewkey002Pruned) => Promise<void>, successUrl?: string): Promise<ShareViewkeyResult>;