@holochain/client 0.18.0-dev.2 → 0.18.0-dev.4

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.
@@ -87,7 +87,7 @@ export class AppWebsocket {
87
87
  }
88
88
  await client.authenticate({ token: options.token });
89
89
  }
90
- const appInfo = await this.requester(client, "app_info", DEFAULT_TIMEOUT)(null);
90
+ const appInfo = await AppWebsocket.requester(client, "app_info", DEFAULT_TIMEOUT)(null);
91
91
  if (!appInfo) {
92
92
  throw new HolochainError("AppNotFound", `The app your connection token was issued for was not found. The app needs to be installed and enabled.`);
93
93
  }
@@ -1,4 +1,4 @@
1
- import { Signature } from "../types.js";
1
+ import { ActionHash, AgentPubKey, Signature, Timestamp } from "../types.js";
2
2
  import { Entry } from "./entry.js";
3
3
  import { CreateLink, Delete, DeleteLink, Action, NewEntryAction, Update } from "./action.js";
4
4
  /**
@@ -19,6 +19,27 @@ export declare enum DhtOpType {
19
19
  * @public
20
20
  */
21
21
  export type DhtOp = {
22
+ ChainOp: ChainOp;
23
+ } | {
24
+ WarrantOp: WarrantOp;
25
+ };
26
+ /**
27
+ * @public
28
+ */
29
+ export interface WarrantOp {
30
+ /** The warrant which was issued */
31
+ warrant: Warrant;
32
+ /** author of the warrant */
33
+ author: AgentPubKey;
34
+ /** signature of (Warrant, Timestamp) by the author */
35
+ signature: Signature;
36
+ /** time when the warrant was issued */
37
+ timestamp: Timestamp;
38
+ }
39
+ /**
40
+ * @public
41
+ */
42
+ export type ChainOp = {
22
43
  [DhtOpType.StoreRecord]: [Signature, Action, Entry | undefined];
23
44
  } | {
24
45
  [DhtOpType.StoreEntry]: [Signature, NewEntryAction, Entry];
@@ -41,6 +62,55 @@ export type DhtOp = {
41
62
  } | {
42
63
  [DhtOpType.RegisterRemoveLink]: [Signature, DeleteLink];
43
64
  };
65
+ /**
66
+ * @public
67
+ */
68
+ export interface Warrant {
69
+ /**
70
+ * Signifies evidence of a breach of chain integrity
71
+ */
72
+ ChainIntegrity: ChainIntegrityWarrant;
73
+ }
74
+ /**
75
+ * @public
76
+ */
77
+ export type ChainIntegrityWarrant = {
78
+ /**
79
+ * Something invalid was authored on a chain.
80
+ * When we receive this warrant, we fetch the Action and validate it
81
+ * under every applicable DhtOpType.
82
+ */
83
+ InvalidChainOp: {
84
+ /** The author of the action */
85
+ action_author: AgentPubKey;
86
+ /** The hash of the action to fetch by */
87
+ action: ActionHashAndSig;
88
+ /** Whether to run app or sys validation */
89
+ validation_type: ValidationType;
90
+ } | {
91
+ /** Proof of chain fork. */
92
+ ChainFork: {
93
+ /** Author of the chain which is forked */
94
+ chain_author: AgentPubKey;
95
+ /** Two actions of the same seq number which prove the fork */
96
+ action_pair: [ActionHashAndSig, ActionHashAndSig];
97
+ };
98
+ };
99
+ };
100
+ /**
101
+ * @public
102
+ */
103
+ export type ValidationType = {
104
+ /** Sys validation */
105
+ Sys: null;
106
+ /** App validation */
107
+ App: null;
108
+ };
109
+ /**
110
+ * Action hash with the signature of the action at that hash
111
+ * @public
112
+ */
113
+ export type ActionHashAndSig = [ActionHash, Signature];
44
114
  /**
45
115
  * @public
46
116
  */
package/lib/hdk/link.d.ts CHANGED
@@ -39,6 +39,7 @@ export type RateUnits = number;
39
39
  */
40
40
  export interface Link {
41
41
  author: AgentPubKey;
42
+ base: AnyLinkableHash;
42
43
  target: AnyLinkableHash;
43
44
  timestamp: Timestamp;
44
45
  zome_index: ZomeIndex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/client",
3
- "version": "0.18.0-dev.2",
3
+ "version": "0.18.0-dev.4",
4
4
  "description": "A JavaScript client for the Holochain Conductor API",
5
5
  "author": "Holochain Foundation <info@holochain.org> (https://holochain.org)",
6
6
  "license": "CAL-1.0",