@holochain/client 0.12.4 → 0.12.6

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.
@@ -6,32 +6,32 @@ import { DisableCloneCellRequest } from "../index.js";
6
6
  /**
7
7
  * @public
8
8
  */
9
- export declare type AttachAppInterfaceRequest = {
9
+ export type AttachAppInterfaceRequest = {
10
10
  port: number;
11
11
  };
12
12
  /**
13
13
  * @public
14
14
  */
15
- export declare type AttachAppInterfaceResponse = {
15
+ export type AttachAppInterfaceResponse = {
16
16
  port: number;
17
17
  };
18
18
  /**
19
19
  * @public
20
20
  */
21
- export declare type EnableAppRequest = {
21
+ export type EnableAppRequest = {
22
22
  installed_app_id: InstalledAppId;
23
23
  };
24
24
  /**
25
25
  * @public
26
26
  */
27
- export declare type EnableAppResponse = {
27
+ export type EnableAppResponse = {
28
28
  app: AppInfo;
29
29
  errors: Array<[CellId, string]>;
30
30
  };
31
31
  /**
32
32
  * @public
33
33
  */
34
- export declare type DeactivationReason = {
34
+ export type DeactivationReason = {
35
35
  never_activated: null;
36
36
  } | {
37
37
  normal: null;
@@ -43,13 +43,13 @@ export declare type DeactivationReason = {
43
43
  /**
44
44
  * @public
45
45
  */
46
- export declare type PausedAppReason = {
46
+ export type PausedAppReason = {
47
47
  error: string;
48
48
  };
49
49
  /**
50
50
  * @public
51
51
  */
52
- export declare type DisabledAppReason = {
52
+ export type DisabledAppReason = {
53
53
  never_started: null;
54
54
  } | {
55
55
  user: null;
@@ -59,7 +59,7 @@ export declare type DisabledAppReason = {
59
59
  /**
60
60
  * @public
61
61
  */
62
- export declare type InstalledAppInfoStatus = {
62
+ export type InstalledAppInfoStatus = {
63
63
  paused: {
64
64
  reason: PausedAppReason;
65
65
  };
@@ -108,7 +108,7 @@ export declare enum CellType {
108
108
  /**
109
109
  * @public
110
110
  */
111
- export declare type CellInfo = {
111
+ export type CellInfo = {
112
112
  [CellType.Provisioned]: ProvisionedCell;
113
113
  } | {
114
114
  [CellType.Cloned]: ClonedCell;
@@ -118,7 +118,7 @@ export declare type CellInfo = {
118
118
  /**
119
119
  * @public
120
120
  */
121
- export declare type AppInfo = {
121
+ export type AppInfo = {
122
122
  agent_pub_key: AgentPubKey;
123
123
  installed_app_id: InstalledAppId;
124
124
  cell_info: Record<RoleName, Array<CellInfo>>;
@@ -127,60 +127,60 @@ export declare type AppInfo = {
127
127
  /**
128
128
  * @public
129
129
  */
130
- export declare type MembraneProof = Buffer;
130
+ export type MembraneProof = Buffer;
131
131
  /**
132
132
  * @public
133
133
  */
134
- export declare type DisableAppRequest = {
134
+ export type DisableAppRequest = {
135
135
  installed_app_id: InstalledAppId;
136
136
  };
137
137
  /**
138
138
  * @public
139
139
  */
140
- export declare type DisableAppResponse = null;
140
+ export type DisableAppResponse = null;
141
141
  /**
142
142
  * @public
143
143
  */
144
- export declare type StartAppRequest = {
144
+ export type StartAppRequest = {
145
145
  installed_app_id: InstalledAppId;
146
146
  };
147
147
  /**
148
148
  * @public
149
149
  */
150
- export declare type StartAppResponse = boolean;
150
+ export type StartAppResponse = boolean;
151
151
  /**
152
152
  * @public
153
153
  */
154
- export declare type DumpStateRequest = {
154
+ export type DumpStateRequest = {
155
155
  cell_id: CellId;
156
156
  };
157
157
  /**
158
158
  * @public
159
159
  */
160
- export declare type DumpStateResponse = any;
160
+ export type DumpStateResponse = any;
161
161
  /**
162
162
  * @public
163
163
  */
164
- export declare type DumpFullStateRequest = {
164
+ export type DumpFullStateRequest = {
165
165
  cell_id: CellId;
166
166
  dht_ops_cursor: number | undefined;
167
167
  };
168
168
  /**
169
169
  * @public
170
170
  */
171
- export declare type DumpFullStateResponse = FullStateDump;
171
+ export type DumpFullStateResponse = FullStateDump;
172
172
  /**
173
173
  * @public
174
174
  */
175
- export declare type GenerateAgentPubKeyRequest = void;
175
+ export type GenerateAgentPubKeyRequest = void;
176
176
  /**
177
177
  * @public
178
178
  */
179
- export declare type GenerateAgentPubKeyResponse = AgentPubKey;
179
+ export type GenerateAgentPubKeyResponse = AgentPubKey;
180
180
  /**
181
181
  * @public
182
182
  */
183
- export declare type RegisterDnaRequest = {
183
+ export type RegisterDnaRequest = {
184
184
  modifiers?: {
185
185
  network_seed?: string;
186
186
  properties?: DnaProperties;
@@ -189,11 +189,11 @@ export declare type RegisterDnaRequest = {
189
189
  /**
190
190
  * @public
191
191
  */
192
- export declare type RegisterDnaResponse = HoloHash;
192
+ export type RegisterDnaResponse = HoloHash;
193
193
  /**
194
194
  * @public
195
195
  */
196
- export declare type DnaModifiers = {
196
+ export type DnaModifiers = {
197
197
  network_seed: NetworkSeed;
198
198
  properties: DnaProperties;
199
199
  origin_time: Timestamp;
@@ -202,15 +202,15 @@ export declare type DnaModifiers = {
202
202
  /**
203
203
  * @public
204
204
  */
205
- export declare type FunctionName = string;
205
+ export type FunctionName = string;
206
206
  /**
207
207
  * @public
208
208
  */
209
- export declare type ZomeName = string;
209
+ export type ZomeName = string;
210
210
  /**
211
211
  * @public
212
212
  */
213
- export declare type ZomeDefinition = [
213
+ export type ZomeDefinition = [
214
214
  ZomeName,
215
215
  {
216
216
  wasm_hash: WasmHash;
@@ -220,15 +220,15 @@ export declare type ZomeDefinition = [
220
220
  /**
221
221
  * @public
222
222
  */
223
- export declare type IntegrityZome = ZomeDefinition;
223
+ export type IntegrityZome = ZomeDefinition;
224
224
  /**
225
225
  * @public
226
226
  */
227
- export declare type CoordinatorZome = ZomeDefinition;
227
+ export type CoordinatorZome = ZomeDefinition;
228
228
  /**
229
229
  * @public
230
230
  */
231
- export declare type DnaDefinition = {
231
+ export type DnaDefinition = {
232
232
  name: string;
233
233
  modifiers: DnaModifiers;
234
234
  integrity_zomes: IntegrityZome[];
@@ -237,29 +237,29 @@ export declare type DnaDefinition = {
237
237
  /**
238
238
  * @public
239
239
  */
240
- export declare type GetDnaDefinitionRequest = DnaHash;
240
+ export type GetDnaDefinitionRequest = DnaHash;
241
241
  /**
242
242
  * @public
243
243
  */
244
- export declare type GetDnaDefinitionResponse = DnaDefinition;
244
+ export type GetDnaDefinitionResponse = DnaDefinition;
245
245
  /**
246
246
  * @public
247
247
  */
248
- export declare type UninstallAppRequest = {
248
+ export type UninstallAppRequest = {
249
249
  installed_app_id: InstalledAppId;
250
250
  };
251
251
  /**
252
252
  * @public
253
253
  */
254
- export declare type UninstallAppResponse = null;
254
+ export type UninstallAppResponse = null;
255
255
  /**
256
256
  * @public
257
257
  */
258
- export declare type ResourceBytes = Uint8Array;
258
+ export type ResourceBytes = Uint8Array;
259
259
  /**
260
260
  * @public
261
261
  */
262
- export declare type ResourceMap = {
262
+ export type ResourceMap = {
263
263
  [key: string]: ResourceBytes;
264
264
  };
265
265
  /**
@@ -297,7 +297,7 @@ export interface CellProvisioning {
297
297
  /**
298
298
  * @public
299
299
  */
300
- export declare type Location = {
300
+ export type Location = {
301
301
  /**
302
302
  * Expect file to be part of this bundle
303
303
  */
@@ -316,11 +316,11 @@ export declare type Location = {
316
316
  /**
317
317
  * @public
318
318
  */
319
- export declare type DnaVersionSpec = Array<HoloHashB64>;
319
+ export type DnaVersionSpec = Array<HoloHashB64>;
320
320
  /**
321
321
  * @public
322
322
  */
323
- export declare type DnaVersionFlexible = {
323
+ export type DnaVersionFlexible = {
324
324
  singleton: HoloHashB64;
325
325
  } | {
326
326
  multiple: DnaVersionSpec;
@@ -328,7 +328,7 @@ export declare type DnaVersionFlexible = {
328
328
  /**
329
329
  * @public
330
330
  */
331
- export declare type AppRoleDnaManifest = {
331
+ export type AppRoleDnaManifest = {
332
332
  clone_limit?: number;
333
333
  modifiers?: Partial<DnaModifiers>;
334
334
  version?: DnaVersionFlexible;
@@ -336,7 +336,7 @@ export declare type AppRoleDnaManifest = {
336
336
  /**
337
337
  * @public
338
338
  */
339
- export declare type AppRoleManifest = {
339
+ export type AppRoleManifest = {
340
340
  name: RoleName;
341
341
  provisioning?: CellProvisioning;
342
342
  dna: AppRoleDnaManifest;
@@ -344,7 +344,7 @@ export declare type AppRoleManifest = {
344
344
  /**
345
345
  * @public
346
346
  */
347
- export declare type AppManifest = {
347
+ export type AppManifest = {
348
348
  manifest_version: string;
349
349
  name: string;
350
350
  description?: string;
@@ -353,14 +353,14 @@ export declare type AppManifest = {
353
353
  /**
354
354
  * @public
355
355
  */
356
- export declare type AppBundle = {
356
+ export type AppBundle = {
357
357
  manifest: AppManifest;
358
358
  resources: ResourceMap;
359
359
  };
360
360
  /**
361
361
  * @public
362
362
  */
363
- export declare type AppBundleSource = {
363
+ export type AppBundleSource = {
364
364
  bundle: AppBundle;
365
365
  } | {
366
366
  path: string;
@@ -368,11 +368,11 @@ export declare type AppBundleSource = {
368
368
  /**
369
369
  * @public
370
370
  */
371
- export declare type NetworkSeed = string;
371
+ export type NetworkSeed = string;
372
372
  /**
373
373
  * @public
374
374
  */
375
- export declare type InstallAppRequest = {
375
+ export type InstallAppRequest = {
376
376
  agent_key: AgentPubKey;
377
377
  installed_app_id?: InstalledAppId;
378
378
  membrane_proofs: {
@@ -383,31 +383,31 @@ export declare type InstallAppRequest = {
383
383
  /**
384
384
  * @public
385
385
  */
386
- export declare type InstallAppResponse = AppInfo;
386
+ export type InstallAppResponse = AppInfo;
387
387
  /**
388
388
  * @public
389
389
  */
390
- export declare type ListDnasRequest = void;
390
+ export type ListDnasRequest = void;
391
391
  /**
392
392
  * @public
393
393
  */
394
- export declare type ListDnasResponse = Array<string>;
394
+ export type ListDnasResponse = Array<string>;
395
395
  /**
396
396
  * @public
397
397
  */
398
- export declare type ListCellIdsRequest = void;
398
+ export type ListCellIdsRequest = void;
399
399
  /**
400
400
  * @public
401
401
  */
402
- export declare type ListCellIdsResponse = Array<CellId>;
402
+ export type ListCellIdsResponse = Array<CellId>;
403
403
  /**
404
404
  * @public
405
405
  */
406
- export declare type ListActiveAppsRequest = void;
406
+ export type ListActiveAppsRequest = void;
407
407
  /**
408
408
  * @public
409
409
  */
410
- export declare type ListActiveAppsResponse = Array<InstalledAppId>;
410
+ export type ListActiveAppsResponse = Array<InstalledAppId>;
411
411
  /**
412
412
  * @public
413
413
  */
@@ -421,55 +421,55 @@ export declare enum AppStatusFilter {
421
421
  /**
422
422
  * @public
423
423
  */
424
- export declare type ListAppsRequest = {
424
+ export type ListAppsRequest = {
425
425
  status_filter?: AppStatusFilter;
426
426
  };
427
427
  /**
428
428
  * @public
429
429
  */
430
- export declare type ListAppsResponse = Array<AppInfo>;
430
+ export type ListAppsResponse = Array<AppInfo>;
431
431
  /**
432
432
  * @public
433
433
  */
434
- export declare type ListAppInterfacesRequest = void;
434
+ export type ListAppInterfacesRequest = void;
435
435
  /**
436
436
  * @public
437
437
  */
438
- export declare type ListAppInterfacesResponse = Array<number>;
438
+ export type ListAppInterfacesResponse = Array<number>;
439
439
  /**
440
440
  * This type is meant to be opaque
441
441
  *
442
442
  * @public
443
443
  */
444
- export declare type AgentInfoSigned = unknown;
444
+ export type AgentInfoSigned = unknown;
445
445
  /**
446
446
  * @public
447
447
  */
448
- export declare type AgentInfoRequest = {
448
+ export type AgentInfoRequest = {
449
449
  cell_id: CellId | null;
450
450
  };
451
451
  /**
452
452
  * @public
453
453
  */
454
- export declare type AgentInfoResponse = Array<AgentInfoSigned>;
454
+ export type AgentInfoResponse = Array<AgentInfoSigned>;
455
455
  /**
456
456
  * @public
457
457
  */
458
- export declare type AddAgentInfoRequest = {
458
+ export type AddAgentInfoRequest = {
459
459
  agent_infos: Array<AgentInfoSigned>;
460
460
  };
461
461
  /**
462
462
  * @public
463
463
  */
464
- export declare type AddAgentInfoResponse = any;
464
+ export type AddAgentInfoResponse = any;
465
465
  /**
466
466
  * @public
467
467
  */
468
- export declare type DeleteCloneCellRequest = DisableCloneCellRequest;
468
+ export type DeleteCloneCellRequest = DisableCloneCellRequest;
469
469
  /**
470
470
  * @public
471
471
  */
472
- export declare type DeleteCloneCellResponse = void;
472
+ export type DeleteCloneCellResponse = void;
473
473
  /**
474
474
  * @public
475
475
  */
@@ -487,11 +487,11 @@ export interface GrantZomeCallCapabilityRequest {
487
487
  /**
488
488
  * @public
489
489
  */
490
- export declare type GrantZomeCallCapabilityResponse = void;
490
+ export type GrantZomeCallCapabilityResponse = void;
491
491
  /**
492
492
  * @public
493
493
  */
494
- export declare type InstallAppDnaPayload = {
494
+ export type InstallAppDnaPayload = {
495
495
  hash: HoloHash;
496
496
  role_name: RoleName;
497
497
  membrane_proof?: MembraneProof;
@@ -499,18 +499,18 @@ export declare type InstallAppDnaPayload = {
499
499
  /**
500
500
  * @public
501
501
  */
502
- export declare type ZomeLocation = Location;
502
+ export type ZomeLocation = Location;
503
503
  /**
504
504
  * @public
505
505
  */
506
- export declare type ZomeManifest = {
506
+ export type ZomeManifest = {
507
507
  name: string;
508
508
  hash?: string;
509
509
  } & ZomeLocation;
510
510
  /**
511
511
  * @public
512
512
  */
513
- export declare type DnaManifest = {
513
+ export type DnaManifest = {
514
514
  /**
515
515
  * Currently one "1" is supported
516
516
  */
@@ -536,14 +536,14 @@ export declare type DnaManifest = {
536
536
  /**
537
537
  * @public
538
538
  */
539
- export declare type DnaBundle = {
539
+ export type DnaBundle = {
540
540
  manifest: DnaManifest;
541
541
  resources: ResourceMap;
542
542
  };
543
543
  /**
544
544
  * @public
545
545
  */
546
- export declare type DnaSource = {
546
+ export type DnaSource = {
547
547
  hash: HoloHash;
548
548
  } | {
549
549
  path: string;
@@ -553,13 +553,13 @@ export declare type DnaSource = {
553
553
  /**
554
554
  * @public
555
555
  */
556
- export declare type Zomes = Array<[string, {
556
+ export type Zomes = Array<[string, {
557
557
  wasm_hash: Array<HoloHash>;
558
558
  }]>;
559
559
  /**
560
560
  * @public
561
561
  */
562
- export declare type WasmCode = [HoloHash, {
562
+ export type WasmCode = [HoloHash, {
563
563
  code: Array<number>;
564
564
  }];
565
565
  /**
@@ -4,7 +4,7 @@ import { Requester } from "../common.js";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare type CallZomeRequestGeneric<Payload> = {
7
+ export type CallZomeRequestGeneric<Payload> = {
8
8
  cell_id: CellId;
9
9
  zome_name: ZomeName;
10
10
  fn_name: FunctionName;
@@ -14,25 +14,25 @@ export declare type CallZomeRequestGeneric<Payload> = {
14
14
  /**
15
15
  * @public
16
16
  */
17
- export declare type CallZomeRequest = CallZomeRequestGeneric<any>;
17
+ export type CallZomeRequest = CallZomeRequestGeneric<any>;
18
18
  /**
19
19
  * @public
20
20
  */
21
- export declare type CallZomeResponseGeneric<Payload> = Payload;
21
+ export type CallZomeResponseGeneric<Payload> = Payload;
22
22
  /**
23
23
  * @public
24
24
  */
25
- export declare type CallZomeResponse = CallZomeResponseGeneric<any>;
25
+ export type CallZomeResponse = CallZomeResponseGeneric<any>;
26
26
  /**
27
27
  * @public
28
28
  */
29
- export declare type AppInfoRequest = {
29
+ export type AppInfoRequest = {
30
30
  installed_app_id: InstalledAppId;
31
31
  };
32
32
  /**
33
33
  * @public
34
34
  */
35
- export declare type AppInfoResponse = AppInfo;
35
+ export type AppInfoResponse = AppInfo;
36
36
  /**
37
37
  * @public
38
38
  */
@@ -83,7 +83,7 @@ export interface CreateCloneCellRequest {
83
83
  /**
84
84
  * @public
85
85
  */
86
- export declare type CreateCloneCellResponse = ClonedCell;
86
+ export type CreateCloneCellResponse = ClonedCell;
87
87
  /**
88
88
  * @public
89
89
  */
@@ -100,15 +100,15 @@ export interface DisableCloneCellRequest {
100
100
  /**
101
101
  * @public
102
102
  */
103
- export declare type DisableCloneCellResponse = void;
103
+ export type DisableCloneCellResponse = void;
104
104
  /**
105
105
  * @public
106
106
  */
107
- export declare type EnableCloneCellRequest = DisableCloneCellRequest;
107
+ export type EnableCloneCellRequest = DisableCloneCellRequest;
108
108
  /**
109
109
  * @public
110
110
  */
111
- export declare type EnableCloneCellResponse = CreateCloneCellResponse;
111
+ export type EnableCloneCellResponse = CreateCloneCellResponse;
112
112
  /**
113
113
  * @public
114
114
  */
@@ -128,7 +128,7 @@ export declare const SignalType: {
128
128
  /**
129
129
  * @public
130
130
  */
131
- export declare type Signal = {
131
+ export type Signal = {
132
132
  [SignalType.App]: EncodedAppSignal;
133
133
  } | {
134
134
  [SignalType.System]: unknown;
@@ -136,7 +136,7 @@ export declare type Signal = {
136
136
  /**
137
137
  * @public
138
138
  */
139
- export declare type EncodedAppSignal = {
139
+ export type EncodedAppSignal = {
140
140
  cell_id: CellId;
141
141
  zome_name: string;
142
142
  signal: Uint8Array;
@@ -144,7 +144,7 @@ export declare type EncodedAppSignal = {
144
144
  /**
145
145
  * @public
146
146
  */
147
- export declare type AppSignal = {
147
+ export type AppSignal = {
148
148
  cell_id: CellId;
149
149
  zome_name: string;
150
150
  payload: unknown;
@@ -152,11 +152,11 @@ export declare type AppSignal = {
152
152
  /**
153
153
  * @public
154
154
  */
155
- export declare type AppSignalCb = (signal: AppSignal) => void;
155
+ export type AppSignalCb = (signal: AppSignal) => void;
156
156
  /**
157
157
  * @public
158
158
  */
159
- export declare type NetworkInfoResponse = NetworkInfo[];
159
+ export type NetworkInfoResponse = NetworkInfo[];
160
160
  /**
161
161
  * @public
162
162
  */
@@ -2,7 +2,7 @@ import { hashZomeCall } from "@holochain/serialization";
2
2
  import { decode, encode } from "@msgpack/msgpack";
3
3
  import Emittery from "emittery";
4
4
  import nacl from "tweetnacl";
5
- import { getLauncherEnvironment, isLauncher, signZomeCallTauri, } from "../../environments/launcher.js";
5
+ import { getHostZomeCallSigner, getLauncherEnvironment, isLauncher, signZomeCallTauri, } from "../../environments/launcher.js";
6
6
  import { encodeHashToBase64 } from "../../utils/base64.js";
7
7
  import { WsClient } from "../client.js";
8
8
  import { catchError, DEFAULT_TIMEOUT, promiseTimeout, requesterTransformer, } from "../common.js";
@@ -87,10 +87,14 @@ const callZomeTransform = {
87
87
  if ("signature" in request) {
88
88
  return request;
89
89
  }
90
- const signedZomeCall = isLauncher
91
- ? await signZomeCallTauri(request)
92
- : await signZomeCall(request);
93
- return signedZomeCall;
90
+ const hostSigner = getHostZomeCallSigner();
91
+ if (hostSigner) {
92
+ return hostSigner.signZomeCall(request);
93
+ }
94
+ else if (isLauncher) {
95
+ return signZomeCallTauri(request);
96
+ }
97
+ return signZomeCall(request);
94
98
  },
95
99
  output: (response) => decode(response),
96
100
  };
@@ -5,35 +5,35 @@ import { CreateCloneCellRequest, CreateCloneCellResponse, DisableCloneCellRespon
5
5
  /**
6
6
  * @public
7
7
  */
8
- export declare type NonProvenanceCallZomeRequest = Omit<CallZomeRequest, "provenance">;
8
+ export type NonProvenanceCallZomeRequest = Omit<CallZomeRequest, "provenance">;
9
9
  /**
10
10
  * @public
11
11
  */
12
- export declare type RoleNameCallZomeRequest = Omit<NonProvenanceCallZomeRequest, "cell_id"> & {
12
+ export type RoleNameCallZomeRequest = Omit<NonProvenanceCallZomeRequest, "cell_id"> & {
13
13
  role_name: RoleName;
14
14
  };
15
15
  /**
16
16
  * @public
17
17
  */
18
- export declare type RoleNameCallZomeRequestSigned = Omit<CallZomeRequestSigned, "cell_id"> & {
18
+ export type RoleNameCallZomeRequestSigned = Omit<CallZomeRequestSigned, "cell_id"> & {
19
19
  role_name: RoleName;
20
20
  };
21
21
  /**
22
22
  * @public
23
23
  */
24
- export declare type AppAgentCallZomeRequest = NonProvenanceCallZomeRequest | RoleNameCallZomeRequest | CallZomeRequestSigned | RoleNameCallZomeRequestSigned;
24
+ export type AppAgentCallZomeRequest = NonProvenanceCallZomeRequest | RoleNameCallZomeRequest | CallZomeRequestSigned | RoleNameCallZomeRequestSigned;
25
25
  /**
26
26
  * @public
27
27
  */
28
- export declare type AppCreateCloneCellRequest = Omit<CreateCloneCellRequest, "app_id">;
28
+ export type AppCreateCloneCellRequest = Omit<CreateCloneCellRequest, "app_id">;
29
29
  /**
30
30
  * @public
31
31
  */
32
- export declare type AppEnableCloneCellRequest = Omit<EnableCloneCellRequest, "app_id">;
32
+ export type AppEnableCloneCellRequest = Omit<EnableCloneCellRequest, "app_id">;
33
33
  /**
34
34
  * @public
35
35
  */
36
- export declare type AppDisableCloneCellRequest = Omit<DisableCloneCellRequest, "app_id">;
36
+ export type AppDisableCloneCellRequest = Omit<DisableCloneCellRequest, "app_id">;
37
37
  /**
38
38
  * @public
39
39
  */
package/lib/api/client.js CHANGED
@@ -64,16 +64,16 @@ export class WsClient extends Emittery {
64
64
  console.error(`Got unrecognized Websocket message type: ${message.type}`);
65
65
  }
66
66
  };
67
- socket.on("close", (event) => {
67
+ socket.onclose = (event) => {
68
68
  const pendingRequestIds = Object.keys(this.pendingRequests).map((id) => parseInt(id));
69
69
  if (pendingRequestIds.length) {
70
70
  pendingRequestIds.forEach((id) => {
71
- const error = new Error(`Websocket closed with pending requests. Close event: ${event}, request id: ${id}`);
71
+ const error = new Error(`Websocket closed with pending requests. Close event code: ${event.code}, request id: ${id}`);
72
72
  this.pendingRequests[id].reject(error);
73
73
  delete this.pendingRequests[id];
74
74
  });
75
75
  }
76
- });
76
+ };
77
77
  }
78
78
  /**
79
79
  * Instance factory for creating WsClients.
@@ -3,22 +3,22 @@ export declare const DEFAULT_TIMEOUT = 15000;
3
3
  /**
4
4
  * @public
5
5
  */
6
- export declare type Transformer<ReqI, ReqO, ResI, ResO> = {
6
+ export type Transformer<ReqI, ReqO, ResI, ResO> = {
7
7
  input: (req: ReqI) => ReqO;
8
8
  output: (res: ResI) => ResO;
9
9
  };
10
10
  /**
11
11
  * @public
12
12
  */
13
- export declare type Requester<Req, Res> = (req: Req, timeout?: number) => Promise<Res>;
13
+ export type Requester<Req, Res> = (req: Req, timeout?: number) => Promise<Res>;
14
14
  /**
15
15
  * @public
16
16
  */
17
- export declare type RequesterUnit<Res> = () => Promise<Res>;
17
+ export type RequesterUnit<Res> = () => Promise<Res>;
18
18
  /**
19
19
  * @public
20
20
  */
21
- export declare type Tagged<T> = {
21
+ export type Tagged<T> = {
22
22
  type: string;
23
23
  data: T;
24
24
  };
@@ -4,7 +4,7 @@ import { AgentPubKey, CellId } from "../types.js";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare type Nonce256Bit = Uint8Array;
7
+ export type Nonce256Bit = Uint8Array;
8
8
  /**
9
9
  * @public
10
10
  */
@@ -5,12 +5,18 @@ export interface LauncherEnvironment {
5
5
  ADMIN_INTERFACE_PORT?: number;
6
6
  INSTALLED_APP_ID?: InstalledAppId;
7
7
  }
8
+ export interface HostZomeCallSigner {
9
+ signZomeCall: (request: CallZomeRequest) => Promise<CallZomeRequestSigned>;
10
+ }
8
11
  declare const __HC_LAUNCHER_ENV__ = "__HC_LAUNCHER_ENV__";
12
+ declare const __HC_ZOME_CALL_SIGNER__ = "__HC_ZOME_CALL_SIGNER__";
9
13
  export declare const isLauncher: boolean;
10
14
  export declare const getLauncherEnvironment: () => LauncherEnvironment | undefined;
15
+ export declare const getHostZomeCallSigner: () => HostZomeCallSigner | undefined;
11
16
  declare global {
12
17
  interface Window {
13
18
  [__HC_LAUNCHER_ENV__]: LauncherEnvironment | undefined;
19
+ [__HC_ZOME_CALL_SIGNER__]?: HostZomeCallSigner;
14
20
  }
15
21
  }
16
22
  export declare const signZomeCallTauri: (request: CallZomeRequest) => Promise<CallZomeRequestSigned>;
@@ -2,8 +2,10 @@ import { invoke } from "@tauri-apps/api/tauri";
2
2
  import { getNonceExpiration, randomNonce, } from "../api/index.js";
3
3
  import { encode } from "@msgpack/msgpack";
4
4
  const __HC_LAUNCHER_ENV__ = "__HC_LAUNCHER_ENV__";
5
+ const __HC_ZOME_CALL_SIGNER__ = "__HC_ZOME_CALL_SIGNER__";
5
6
  export const isLauncher = typeof window === "object" && __HC_LAUNCHER_ENV__ in window;
6
7
  export const getLauncherEnvironment = () => isLauncher ? window[__HC_LAUNCHER_ENV__] : undefined;
8
+ export const getHostZomeCallSigner = () => globalThis.window && globalThis.window[__HC_ZOME_CALL_SIGNER__];
7
9
  export const signZomeCallTauri = async (request) => {
8
10
  const zomeCallUnsigned = {
9
11
  provenance: Array.from(request.provenance),
@@ -10,7 +10,7 @@ export interface SignedActionHashed<H extends Action = Action> {
10
10
  /**
11
11
  * @public
12
12
  */
13
- export declare type ActionHashed = HoloHashed<Action>;
13
+ export type ActionHashed = HoloHashed<Action>;
14
14
  /**
15
15
  * @public
16
16
  */
@@ -29,11 +29,11 @@ export declare enum ActionType {
29
29
  /**
30
30
  * @public
31
31
  */
32
- export declare type Action = Dna | AgentValidationPkg | InitZomesComplete | CreateLink | DeleteLink | OpenChain | CloseChain | Delete | NewEntryAction;
32
+ export type Action = Dna | AgentValidationPkg | InitZomesComplete | CreateLink | DeleteLink | OpenChain | CloseChain | Delete | NewEntryAction;
33
33
  /**
34
34
  * @public
35
35
  */
36
- export declare type NewEntryAction = Create | Update;
36
+ export type NewEntryAction = Create | Update;
37
37
  /**
38
38
  * @public
39
39
  */
@@ -3,7 +3,7 @@ import { AgentPubKey } from "../types.js";
3
3
  /**
4
4
  * @public
5
5
  */
6
- export declare type CapSecret = Uint8Array;
6
+ export type CapSecret = Uint8Array;
7
7
  /**
8
8
  * @public
9
9
  */
@@ -22,7 +22,7 @@ export declare enum GrantedFunctionsType {
22
22
  /**
23
23
  * @public
24
24
  */
25
- export declare type GrantedFunctions = {
25
+ export type GrantedFunctions = {
26
26
  [GrantedFunctionsType.All]: null;
27
27
  } | {
28
28
  [GrantedFunctionsType.Listed]: [ZomeName, FunctionName][];
@@ -38,7 +38,7 @@ export interface ZomeCallCapGrant {
38
38
  /**
39
39
  * @public
40
40
  */
41
- export declare type CapAccess = "Unrestricted" | {
41
+ export type CapAccess = "Unrestricted" | {
42
42
  Transferable: {
43
43
  secret: CapSecret;
44
44
  };
@@ -51,7 +51,7 @@ export declare type CapAccess = "Unrestricted" | {
51
51
  /**
52
52
  * @public
53
53
  */
54
- export declare type CapGrant = {
54
+ export type CapGrant = {
55
55
  ChainAuthor: AgentPubKey;
56
56
  } | {
57
57
  RemoteAgent: ZomeCallCapGrant;
@@ -28,7 +28,7 @@ export interface CounterSigningSessionTimes {
28
28
  /**
29
29
  * @public
30
30
  */
31
- export declare type ActionBase = {
31
+ export type ActionBase = {
32
32
  Create: CreateBase;
33
33
  } | {
34
34
  Update: UpdateBase;
@@ -50,15 +50,15 @@ export interface UpdateBase {
50
50
  /**
51
51
  * @public
52
52
  */
53
- export declare type CounterSigningAgents = Array<[AgentPubKey, Array<Role>]>;
53
+ export type CounterSigningAgents = Array<[AgentPubKey, Array<Role>]>;
54
54
  /**
55
55
  * @public
56
56
  */
57
- export declare type PreflightBytes = Uint8Array;
57
+ export type PreflightBytes = Uint8Array;
58
58
  /**
59
59
  * @public
60
60
  */
61
- export declare type Role = number;
61
+ export type Role = number;
62
62
  /**
63
63
  * @public
64
64
  */
@@ -18,7 +18,7 @@ export declare enum DhtOpType {
18
18
  /**
19
19
  * @public
20
20
  */
21
- export declare type DhtOp = {
21
+ export type DhtOp = {
22
22
  [DhtOpType.StoreRecord]: [Signature, Action, Entry | undefined];
23
23
  } | {
24
24
  [DhtOpType.StoreEntry]: [Signature, NewEntryAction, Entry];
@@ -4,7 +4,7 @@ import { CounterSigningSessionData } from "./countersigning.js";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare type EntryVisibility = {
7
+ export type EntryVisibility = {
8
8
  Public: null;
9
9
  } | {
10
10
  Private: null;
@@ -12,7 +12,7 @@ export declare type EntryVisibility = {
12
12
  /**
13
13
  * @public
14
14
  */
15
- export declare type AppEntryDef = {
15
+ export type AppEntryDef = {
16
16
  entry_index: number;
17
17
  zome_index: number;
18
18
  visibility: EntryVisibility;
@@ -20,7 +20,7 @@ export declare type AppEntryDef = {
20
20
  /**
21
21
  * @public
22
22
  */
23
- export declare type EntryType = "Agent" | {
23
+ export type EntryType = "Agent" | {
24
24
  App: AppEntryDef;
25
25
  } | "CapClaim" | "CapGrant";
26
26
  /**
@@ -33,4 +33,4 @@ export interface EntryContent<E extends string, C> {
33
33
  /**
34
34
  * @public
35
35
  */
36
- export declare type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", Uint8Array> | EntryContent<"CounterSign", [CounterSigningSessionData, Uint8Array]> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
36
+ export type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", Uint8Array> | EntryContent<"CounterSign", [CounterSigningSessionData, Uint8Array]> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
@@ -3,14 +3,14 @@ import { Entry } from "./entry.js";
3
3
  /**
4
4
  * @public
5
5
  */
6
- export declare type Record = {
6
+ export type Record = {
7
7
  signed_action: SignedActionHashed;
8
8
  entry: RecordEntry;
9
9
  };
10
10
  /**
11
11
  * @public
12
12
  */
13
- export declare type RecordEntry = {
13
+ export type RecordEntry = {
14
14
  Present: Entry;
15
15
  } | {
16
16
  Hidden: void;
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.33.7"
8
+ "packageVersion": "7.39.4"
9
9
  }
10
10
  ]
11
11
  }
package/lib/types.d.ts CHANGED
@@ -1,99 +1,99 @@
1
1
  /**
2
2
  * @public
3
3
  */
4
- export declare type HoloHash = Uint8Array;
4
+ export type HoloHash = Uint8Array;
5
5
  /**
6
6
  * @public
7
7
  */
8
- export declare type AgentPubKey = HoloHash;
8
+ export type AgentPubKey = HoloHash;
9
9
  /**
10
10
  * @public
11
11
  */
12
- export declare type DnaHash = HoloHash;
12
+ export type DnaHash = HoloHash;
13
13
  /**
14
14
  * @public
15
15
  */
16
- export declare type WasmHash = HoloHash;
16
+ export type WasmHash = HoloHash;
17
17
  /**
18
18
  * @public
19
19
  */
20
- export declare type EntryHash = HoloHash;
20
+ export type EntryHash = HoloHash;
21
21
  /**
22
22
  * @public
23
23
  */
24
- export declare type ActionHash = HoloHash;
24
+ export type ActionHash = HoloHash;
25
25
  /**
26
26
  * @public
27
27
  */
28
- export declare type AnyDhtHash = HoloHash;
28
+ export type AnyDhtHash = HoloHash;
29
29
  /**
30
30
  * @public
31
31
  */
32
- export declare type KitsuneAgent = Uint8Array;
32
+ export type KitsuneAgent = Uint8Array;
33
33
  /**
34
34
  * @public
35
35
  */
36
- export declare type KitsuneSpace = Uint8Array;
36
+ export type KitsuneSpace = Uint8Array;
37
37
  /** Base64 hash types */
38
38
  /**
39
39
  * @public
40
40
  */
41
- export declare type HoloHashB64 = string;
41
+ export type HoloHashB64 = string;
42
42
  /**
43
43
  * @public
44
44
  */
45
- export declare type AgentPubKeyB64 = HoloHashB64;
45
+ export type AgentPubKeyB64 = HoloHashB64;
46
46
  /**
47
47
  * @public
48
48
  */
49
- export declare type DnaHashB64 = HoloHashB64;
49
+ export type DnaHashB64 = HoloHashB64;
50
50
  /**
51
51
  * @public
52
52
  */
53
- export declare type WasmHashB64 = HoloHashB64;
53
+ export type WasmHashB64 = HoloHashB64;
54
54
  /**
55
55
  * @public
56
56
  */
57
- export declare type EntryHashB64 = HoloHashB64;
57
+ export type EntryHashB64 = HoloHashB64;
58
58
  /**
59
59
  * @public
60
60
  */
61
- export declare type ActionHashB64 = HoloHashB64;
61
+ export type ActionHashB64 = HoloHashB64;
62
62
  /**
63
63
  * @public
64
64
  */
65
- export declare type AnyDhtHashB64 = HoloHashB64;
65
+ export type AnyDhtHashB64 = HoloHashB64;
66
66
  /**
67
67
  * @public
68
68
  */
69
- export declare type InstalledAppId = string;
69
+ export type InstalledAppId = string;
70
70
  /**
71
71
  * @public
72
72
  */
73
- export declare type Signature = Uint8Array;
73
+ export type Signature = Uint8Array;
74
74
  /**
75
75
  * @public
76
76
  */
77
- export declare type CellId = [DnaHash, AgentPubKey];
77
+ export type CellId = [DnaHash, AgentPubKey];
78
78
  /**
79
79
  * @public
80
80
  */
81
- export declare type DnaProperties = any;
81
+ export type DnaProperties = any;
82
82
  /**
83
83
  * @public
84
84
  */
85
- export declare type RoleName = string;
85
+ export type RoleName = string;
86
86
  /**
87
87
  * @public
88
88
  */
89
- export declare type InstalledCell = {
89
+ export type InstalledCell = {
90
90
  cell_id: CellId;
91
91
  role_name: RoleName;
92
92
  };
93
93
  /**
94
94
  * @public
95
95
  */
96
- export declare type Timestamp = number;
96
+ export type Timestamp = number;
97
97
  /**
98
98
  * @public
99
99
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/client",
3
- "version": "0.12.4",
3
+ "version": "0.12.6",
4
4
  "description": "A JavaScript client for the Holochain Conductor API",
5
5
  "author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
6
6
  "license": "CAL-1.0",