liminal 0.4.1 → 1.0.0-beta.2

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 (195) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +109 -0
  3. package/esm/client/Client.d.ts +39 -0
  4. package/esm/client/Client.d.ts.map +1 -0
  5. package/esm/client/Client.js +9 -0
  6. package/esm/client/Client.js.map +1 -0
  7. package/esm/client/Store.d.ts +3 -0
  8. package/esm/client/Store.d.ts.map +1 -0
  9. package/esm/client/Store.js +3 -0
  10. package/esm/client/Store.js.map +1 -0
  11. package/esm/client/Tx.d.ts +40 -0
  12. package/esm/client/Tx.d.ts.map +1 -0
  13. package/esm/client/Tx.js +36 -0
  14. package/esm/client/Tx.js.map +1 -0
  15. package/esm/client/mod.d.ts +4 -0
  16. package/esm/client/mod.d.ts.map +1 -0
  17. package/esm/client/mod.js +5 -0
  18. package/esm/client/mod.js.map +1 -0
  19. package/esm/core/Bool.d.ts +104 -0
  20. package/esm/core/Bool.d.ts.map +1 -0
  21. package/esm/core/Bool.js +73 -0
  22. package/esm/core/Bool.js.map +1 -0
  23. package/esm/core/Bytes.d.ts +39 -0
  24. package/esm/core/Bytes.d.ts.map +1 -0
  25. package/esm/core/Bytes.js +7 -0
  26. package/esm/core/Bytes.js.map +1 -0
  27. package/esm/core/Call.d.ts +11 -0
  28. package/esm/core/Call.d.ts.map +1 -0
  29. package/esm/core/Call.js +23 -0
  30. package/esm/core/Call.js.map +1 -0
  31. package/esm/core/Effect.d.ts +20 -0
  32. package/esm/core/Effect.d.ts.map +1 -0
  33. package/esm/core/Effect.js +37 -0
  34. package/esm/core/Effect.js.map +1 -0
  35. package/esm/core/Hash.d.ts +41 -0
  36. package/esm/core/Hash.d.ts.map +1 -0
  37. package/esm/core/Hash.js +8 -0
  38. package/esm/core/Hash.js.map +1 -0
  39. package/esm/core/Id.d.ts +198 -0
  40. package/esm/core/Id.d.ts.map +1 -0
  41. package/esm/core/Id.js +69 -0
  42. package/esm/core/Id.js.map +1 -0
  43. package/esm/core/Int.d.ts +768 -0
  44. package/esm/core/Int.d.ts.map +1 -0
  45. package/esm/core/Int.js +201 -0
  46. package/esm/core/Int.js.map +1 -0
  47. package/esm/core/Key.d.ts +40 -0
  48. package/esm/core/Key.d.ts.map +1 -0
  49. package/esm/core/Key.js +7 -0
  50. package/esm/core/Key.js.map +1 -0
  51. package/esm/core/MerkleList.d.ts +105 -0
  52. package/esm/core/MerkleList.d.ts.map +1 -0
  53. package/esm/core/MerkleList.js +82 -0
  54. package/esm/core/MerkleList.js.map +1 -0
  55. package/esm/core/MerkleMap.d.ts +87 -0
  56. package/esm/core/MerkleMap.d.ts.map +1 -0
  57. package/esm/core/MerkleMap.js +67 -0
  58. package/esm/core/MerkleMap.js.map +1 -0
  59. package/esm/core/None.d.ts +52 -0
  60. package/esm/core/None.d.ts.map +1 -0
  61. package/esm/core/None.js +12 -0
  62. package/esm/core/None.js.map +1 -0
  63. package/esm/core/State.d.ts +16 -0
  64. package/esm/core/State.d.ts.map +1 -0
  65. package/esm/core/State.js +22 -0
  66. package/esm/core/State.js.map +1 -0
  67. package/esm/core/String.d.ts +41 -0
  68. package/esm/core/String.d.ts.map +1 -0
  69. package/esm/core/String.js +4 -0
  70. package/esm/core/String.js.map +1 -0
  71. package/esm/core/Struct.d.ts +58 -0
  72. package/esm/core/Struct.d.ts.map +1 -0
  73. package/esm/core/Struct.js +13 -0
  74. package/esm/core/Struct.js.map +1 -0
  75. package/esm/core/Type.d.ts +78 -0
  76. package/esm/core/Type.d.ts.map +1 -0
  77. package/esm/core/Type.js +71 -0
  78. package/esm/core/Type.js.map +1 -0
  79. package/esm/core/Union.d.ts +43 -0
  80. package/esm/core/Union.d.ts.map +1 -0
  81. package/esm/core/Union.js +7 -0
  82. package/esm/core/Union.js.map +1 -0
  83. package/esm/core/Use.d.ts +62 -0
  84. package/esm/core/Use.d.ts.map +1 -0
  85. package/esm/core/Use.js +16 -0
  86. package/esm/core/Use.js.map +1 -0
  87. package/esm/core/mod.d.ts +18 -0
  88. package/esm/core/mod.d.ts.map +1 -0
  89. package/esm/core/mod.js +19 -0
  90. package/esm/core/mod.js.map +1 -0
  91. package/esm/lib/MerkleList.d.ts +4 -0
  92. package/esm/lib/MerkleList.d.ts.map +1 -0
  93. package/esm/lib/MerkleList.js +4 -0
  94. package/esm/lib/MerkleList.js.map +1 -0
  95. package/esm/lib/MerkleMap.d.ts +4 -0
  96. package/esm/lib/MerkleMap.d.ts.map +1 -0
  97. package/esm/lib/MerkleMap.js +4 -0
  98. package/esm/lib/MerkleMap.js.map +1 -0
  99. package/esm/lib/mod.d.ts +3 -0
  100. package/esm/lib/mod.d.ts.map +1 -0
  101. package/esm/lib/mod.js +3 -0
  102. package/esm/lib/mod.js.map +1 -0
  103. package/esm/mod.d.ts +3 -0
  104. package/esm/mod.d.ts.map +1 -0
  105. package/esm/mod.js +4 -0
  106. package/esm/mod.js.map +1 -0
  107. package/esm/package.json +3 -0
  108. package/esm/test/Signer.d.ts +10 -0
  109. package/esm/test/Signer.d.ts.map +1 -0
  110. package/esm/test/Signer.js +13 -0
  111. package/esm/test/Signer.js.map +1 -0
  112. package/esm/test/mod.d.ts +2 -0
  113. package/esm/test/mod.d.ts.map +1 -0
  114. package/esm/test/mod.js +2 -0
  115. package/esm/test/mod.js.map +1 -0
  116. package/esm/util/AbortController.d.ts +4 -0
  117. package/esm/util/AbortController.d.ts.map +1 -0
  118. package/esm/util/AbortController.js +2 -0
  119. package/esm/util/AbortController.js.map +1 -0
  120. package/esm/util/ArrayOfLength.d.ts +2 -0
  121. package/esm/util/ArrayOfLength.d.ts.map +1 -0
  122. package/esm/util/ArrayOfLength.js +2 -0
  123. package/esm/util/ArrayOfLength.js.map +1 -0
  124. package/esm/util/Flatten.d.ts +4 -0
  125. package/esm/util/Flatten.d.ts.map +1 -0
  126. package/esm/util/Flatten.js +2 -0
  127. package/esm/util/Flatten.js.map +1 -0
  128. package/esm/util/Rest.d.ts +2 -0
  129. package/esm/util/Rest.d.ts.map +1 -0
  130. package/esm/util/Rest.js +2 -0
  131. package/esm/util/Rest.js.map +1 -0
  132. package/esm/util/Subscription.d.ts +5 -0
  133. package/esm/util/Subscription.d.ts.map +1 -0
  134. package/esm/util/Subscription.js +2 -0
  135. package/esm/util/Subscription.js.map +1 -0
  136. package/esm/util/Tagged.d.ts +6 -0
  137. package/esm/util/Tagged.d.ts.map +1 -0
  138. package/esm/util/Tagged.js +6 -0
  139. package/esm/util/Tagged.js.map +1 -0
  140. package/esm/util/U2I.d.ts +2 -0
  141. package/esm/util/U2I.d.ts.map +1 -0
  142. package/esm/util/U2I.js +2 -0
  143. package/esm/util/U2I.js.map +1 -0
  144. package/esm/util/generator/collect.d.ts +3 -0
  145. package/esm/util/generator/collect.d.ts.map +1 -0
  146. package/esm/util/generator/collect.js +16 -0
  147. package/esm/util/generator/collect.js.map +1 -0
  148. package/esm/util/isKey.d.ts +2 -0
  149. package/esm/util/isKey.d.ts.map +1 -0
  150. package/esm/util/isKey.js +8 -0
  151. package/esm/util/isKey.js.map +1 -0
  152. package/esm/util/unimplemented.d.ts +2 -0
  153. package/esm/util/unimplemented.d.ts.map +1 -0
  154. package/esm/util/unimplemented.js +6 -0
  155. package/esm/util/unimplemented.js.map +1 -0
  156. package/package.json +24 -10
  157. package/src/client/Client.ts +49 -0
  158. package/src/client/Store.ts +1 -0
  159. package/src/client/Tx.ts +62 -0
  160. package/src/client/mod.ts +5 -0
  161. package/src/core/Bool.ts +75 -0
  162. package/src/core/Bytes.ts +9 -0
  163. package/src/core/Call.ts +38 -0
  164. package/src/core/Effect.ts +87 -0
  165. package/src/core/Hash.ts +23 -0
  166. package/src/core/Id.ts +97 -0
  167. package/src/core/Int.ts +177 -0
  168. package/src/core/Key.ts +9 -0
  169. package/src/core/MerkleList.ts +92 -0
  170. package/src/core/MerkleMap.ts +86 -0
  171. package/src/core/None.ts +11 -0
  172. package/src/core/State.ts +31 -0
  173. package/src/core/String.ts +5 -0
  174. package/src/core/Struct.ts +49 -0
  175. package/src/core/Type.ts +120 -0
  176. package/src/core/Union.ts +17 -0
  177. package/src/core/Use.ts +33 -0
  178. package/src/core/mod.ts +19 -0
  179. package/src/lib/MerkleList.ts +4 -0
  180. package/src/lib/MerkleMap.ts +4 -0
  181. package/src/lib/mod.ts +2 -0
  182. package/src/mod.ts +4 -0
  183. package/src/test/Signer.ts +22 -0
  184. package/src/test/mod.ts +1 -0
  185. package/src/util/AbortController.ts +3 -0
  186. package/src/util/ArrayOfLength.ts +5 -0
  187. package/src/util/Flatten.ts +2 -0
  188. package/src/util/Rest.ts +1 -0
  189. package/src/util/Subscription.ts +5 -0
  190. package/src/util/Tagged.ts +5 -0
  191. package/src/util/U2I.ts +1 -0
  192. package/src/util/generator/collect.ts +16 -0
  193. package/src/util/isKey.ts +7 -0
  194. package/src/util/unimplemented.ts +4 -0
  195. package/lib/index.js +0 -1
@@ -0,0 +1,73 @@
1
+ import { Tagged } from "../util/Tagged.js";
2
+ import { unimplemented } from "../util/unimplemented.js";
3
+ import { Call } from "./Call.js";
4
+ import { Effect } from "./Effect.js";
5
+ import { Type } from "./Type.js";
6
+ export class bool extends Type.make("bool") {
7
+ if(call) {
8
+ return new If(this, call);
9
+ }
10
+ not() {
11
+ return new bool(new BoolSource.Not(this));
12
+ }
13
+ assert(_error) {
14
+ unimplemented();
15
+ }
16
+ }
17
+ export class If extends Effect {
18
+ self;
19
+ call;
20
+ constructor(self, call) {
21
+ super();
22
+ this.self = self;
23
+ this.call = call;
24
+ const [yields, result] = Call.collect(call);
25
+ this.yields = yields;
26
+ this.result = result;
27
+ }
28
+ else(_call) {
29
+ return unimplemented();
30
+ }
31
+ }
32
+ export var BoolSource;
33
+ (function (BoolSource) {
34
+ class True extends Tagged("True") {
35
+ }
36
+ BoolSource.True = True;
37
+ class False extends Tagged("False") {
38
+ }
39
+ BoolSource.False = False;
40
+ class Not extends Tagged("Not") {
41
+ not;
42
+ constructor(not) {
43
+ super();
44
+ this.not = not;
45
+ }
46
+ }
47
+ BoolSource.Not = Not;
48
+ class Equals extends Tagged("Equals") {
49
+ left;
50
+ right;
51
+ constructor(left, right) {
52
+ super();
53
+ this.left = left;
54
+ this.right = right;
55
+ }
56
+ }
57
+ BoolSource.Equals = Equals;
58
+ class Is extends Tagged("Is") {
59
+ inQuestion;
60
+ match;
61
+ constructor(inQuestion, match) {
62
+ super();
63
+ this.inQuestion = inQuestion;
64
+ this.match = match;
65
+ }
66
+ }
67
+ BoolSource.Is = Is;
68
+ })(BoolSource || (BoolSource = {}));
69
+ const true_ = new bool(new BoolSource.True());
70
+ export { true_ as true };
71
+ const false_ = new bool(new BoolSource.False());
72
+ export { false_ as false };
73
+ //# sourceMappingURL=Bool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bool.js","sourceRoot":"","sources":["../../src/core/Bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAiB,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAW,IAAI,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,OAAO,IAAK,SAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAoC;IAK5E,EAAE,CAAC,IAAS;QACV,OAAO,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,GAAG;QACD,OAAO,IAAI,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3C,CAAC;IAED,MAAM,CAAiB,MAAS;QAC9B,aAAa,EAAE,CAAA;IACjB,CAAC;CACF;AAED,MAAM,OAAO,EAAsC,SAAQ,MAAmB;IACvD;IAAqB;IAA1C,YAAqB,IAAU,EAAW,IAAg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,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAA;AAC7C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAA;AAExB,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC,CAAA;AAC/C,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { Type } from "./Type.js";
2
+ export declare function Bytes<Size extends number>(size: Size): {
3
+ new (source: import("./Type.js").TypeSource): {
4
+ size: Size;
5
+ ""?: [Uint8Array, Uint8Array, never] | undefined;
6
+ readonly typeName: "Bytes";
7
+ readonly source: import("./Type.js").TypeSource;
8
+ ctor: new (source: import("./Type.js").TypeSource) => any;
9
+ into<O extends never>(into: import("./Type.js").Factory<O>): O;
10
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
11
+ is<T_1 extends Type<any, any, any, any, any>, M extends import("./Type.js").Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
12
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends import("./Type.js").Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
13
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends import("./Type.js").Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): import("./Effect.js").Effect<Y, U_1>;
14
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends import("./Type.js").Factory<T_4>>(this: T_4, match: M_3): import("./Effect.js").Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
15
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends import("./Type.js").Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): import("./Effect.js").Effect<W, Exclude<T_5, InstanceType<M_4>>>;
16
+ };
17
+ make<Name extends string>(name: Name): {
18
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: Source | import("./Type.js").TypeSource): {
19
+ ""?: [Native, From, Into] | undefined;
20
+ readonly typeName: Name;
21
+ readonly source: Source | import("./Type.js").TypeSource;
22
+ ctor: new (source: Source | import("./Type.js").TypeSource) => any;
23
+ into<O_1 extends Into>(into: import("./Type.js").Factory<O_1>): O_1;
24
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
25
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends import("./Type.js").Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
26
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends import("./Type.js").Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
27
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends import("./Type.js").Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): import("./Effect.js").Effect<Y_1, U_3>;
28
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends import("./Type.js").Factory<T_10>>(this: T_10, match: M_8): import("./Effect.js").Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
29
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends import("./Type.js").Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): import("./Effect.js").Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
30
+ };
31
+ make<Name extends string>(name: Name): any;
32
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
33
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): import("./State.js").State<T_13>;
34
+ };
35
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
36
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): import("./State.js").State<T_13>;
37
+ };
38
+ export type BytesSource = never;
39
+ //# sourceMappingURL=Bytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bytes.d.ts","sourceRoot":"","sources":["../../src/core/Bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,wBAAgB,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,IAAI,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpD;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { Type } from "./Type.js";
2
+ export function Bytes(size) {
3
+ return class extends Type.make("Bytes") {
4
+ size = size;
5
+ };
6
+ }
7
+ //# sourceMappingURL=Bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bytes.js","sourceRoot":"","sources":["../../src/core/Bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,UAAU,KAAK,CAAsB,IAAU;IACnD,OAAO,KAAM,SAAQ,IAAI,CAAC,IAAI,CAAC,OAAO,CAA0B;QAC9D,IAAI,GAAG,IAAI,CAAA;KACZ,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as G from "../util/generator/collect.js";
2
+ import { Type } from "./Type.js";
3
+ export type Yield = Type;
4
+ export type Result = Type | void;
5
+ export type ValueCall<R, A extends unknown[]> = R | ((...args: A) => R);
6
+ export type GenCall<Y extends Yield = any, R extends Result = any, A extends unknown[] = any> = Generator<Y, R> | ((...args: A) => Generator<Y, R>);
7
+ export type Call<Y extends Yield = any, R extends Result = any, A extends unknown[] = any> = ValueCall<R, A> | GenCall<Y, R, A>;
8
+ export declare namespace Call {
9
+ function collect<Y extends Yield, R extends Result>(call: Call<Y, R>): G.Collected<Y, R>;
10
+ }
11
+ //# sourceMappingURL=Call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Call.d.ts","sourceRoot":"","sources":["../../src/core/Call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,MAAM,KAAK,GAAG,IAAI,CAAA;AACxB,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;AAEhC,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAEvE,MAAM,MAAM,OAAO,CACjB,CAAC,SAAS,KAAK,GAAG,GAAG,EACrB,CAAC,SAAS,MAAM,GAAG,GAAG,EACtB,CAAC,SAAS,OAAO,EAAE,GAAG,GAAG,IACvB,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAEvD,MAAM,MAAM,IAAI,CACd,CAAC,SAAS,KAAK,GAAG,GAAG,EACrB,CAAC,SAAS,MAAM,GAAG,GAAG,EACtB,CAAC,SAAS,OAAO,EAAE,GAAG,GAAG,IACvB,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEtC,yBAAiB,IAAI,CAAC;IACpB,SAAgB,OAAO,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,MAAM,EACvD,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACf,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAanB;CACF"}
@@ -0,0 +1,23 @@
1
+ import * as G from "../util/generator/collect.js";
2
+ export var Call;
3
+ (function (Call) {
4
+ function collect(call) {
5
+ if (typeof call === "function") {
6
+ const maybeGen = call();
7
+ if (typeof maybeGen === "object" && Symbol.iterator in maybeGen) {
8
+ return G.collect(maybeGen);
9
+ }
10
+ else {
11
+ return [[], maybeGen];
12
+ }
13
+ }
14
+ else if (typeof call === "object" && Symbol.iterator in call) {
15
+ return G.collect(call);
16
+ }
17
+ else {
18
+ return [[], call];
19
+ }
20
+ }
21
+ Call.collect = collect;
22
+ })(Call || (Call = {}));
23
+ //# sourceMappingURL=Call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Call.js","sourceRoot":"","sources":["../../src/core/Call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAA;AAoBjD,MAAM,KAAW,IAAI,CAiBpB;AAjBD,WAAiB,IAAI;IACnB,SAAgB,OAAO,CACrB,IAAgB;QAEhB,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAA;YACvB,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;gBAChE,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YAC5B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;YACvB,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;YAC/D,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAfe,YAAO,UAetB,CAAA;AACH,CAAC,EAjBgB,IAAI,KAAJ,IAAI,QAiBpB"}
@@ -0,0 +1,20 @@
1
+ import { Flatten } from "../util/Flatten.js";
2
+ import { GenCall, Result, ValueCall, Yield } from "./Call.js";
3
+ import { Factory, Type } from "./Type.js";
4
+ import { ExtractUse, Use } from "./Use.js";
5
+ export declare abstract class Effect<Y extends Yield, R extends Result> implements Generator<Y, R> {
6
+ yields?: Y[];
7
+ result?: R;
8
+ map<R2 extends Result>(_f: (value: R) => R2): Effect<Y, R2>;
9
+ next(): IteratorResult<Y, R>;
10
+ return(): IteratorResult<Y, R>;
11
+ throw(): IteratorResult<Y, R>;
12
+ [Symbol.iterator](): Generator<Y, R>;
13
+ "?"<M extends Factory<Exclude<R, void>>>(match: M): Effect<Y | InstanceType<M>, Exclude<R, InstanceType<M>>>;
14
+ "?"<M extends Factory<Exclude<R, void>>, W extends Type>(match: M, with_: W): Effect<Y | W, Exclude<R, InstanceType<M>>>;
15
+ handle<M extends Factory<Y>, R extends Result>(match: M, f: ValueCall<R, [value: InstanceType<M>]>): [Exclude<Y, InstanceType<M>>] extends [never] ? R : Effect<Exclude<Y, InstanceType<M>>, R>;
16
+ handle<M extends Factory<Y>, Y2 extends Yield, R extends Result>(match: M, f: GenCall<Y2, R, [value: InstanceType<M>]>): [Exclude<Y, InstanceType<M>> | Y2] extends [never] ? R : Effect<Exclude<Y, InstanceType<M>> | Y2, R>;
17
+ rehandle<M extends Factory[]>(..._match: M): [Exclude<Y, InstanceType<M[number]>>] extends [never] ? Extract<Y, InstanceType<M[number]>> | R : Effect<Exclude<Y, InstanceType<M[number]>>, R>;
18
+ }
19
+ export declare function call<Y extends Yield, R extends Result, D extends ExtractUse<Y>, A extends Partial<D>, N extends Omit<D, keyof A>>(_call: Generator<Y, R> | (() => Generator<Y, R>), _uses: A): Effect<Exclude<Y, Use> | [keyof N] extends [never] ? never : Use<Flatten<N>>, R>;
20
+ //# sourceMappingURL=Effect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Effect.d.ts","sourceRoot":"","sources":["../../src/core/Effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE1C,8BAAsB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,MAAM,CAAE,YAAW,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAChF,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IACZ,MAAM,CAAC,EAAE,CAAC,CAAA;IAElB,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC;IAI3D,IAAI,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAI5B,MAAM,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAI9B,KAAK,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAI5B,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAUrC,GAAG,CAAC,CAAC,SAAS,OAAO,CAAC,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AC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAK/C,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,EAC1B,GAAG,MAAM,EAAE,CAAC,GACX,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAC9F,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAInD;AAED,wBAAgB,IAAI,CAClB,CAAC,SAAS,KAAK,EACf,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EACvB,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EACpB,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAE1B,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE,CAAC,GACP,MAAM,CACP,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EACrE,CAAC,CACF,CAEA"}
@@ -0,0 +1,37 @@
1
+ import { unimplemented } from "../util/unimplemented.js";
2
+ export class Effect {
3
+ map(_f) {
4
+ unimplemented();
5
+ }
6
+ next() {
7
+ unimplemented();
8
+ }
9
+ return() {
10
+ unimplemented();
11
+ }
12
+ throw() {
13
+ unimplemented();
14
+ }
15
+ *[Symbol.iterator]() {
16
+ while (this.yields?.length) {
17
+ yield this.yields.shift();
18
+ }
19
+ delete this.yields;
20
+ const result = this.result;
21
+ delete this.result;
22
+ return result;
23
+ }
24
+ "?"(_match, _maybeWith_) {
25
+ return unimplemented();
26
+ }
27
+ handle(_match, _f) {
28
+ unimplemented();
29
+ }
30
+ rehandle(..._match) {
31
+ unimplemented();
32
+ }
33
+ }
34
+ export function call(_call, _uses) {
35
+ unimplemented();
36
+ }
37
+ //# sourceMappingURL=Effect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Effect.js","sourceRoot":"","sources":["../../src/core/Effect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAKxD,MAAM,OAAgB,MAAM;IAI1B,GAAG,CAAoB,EAAoB;QACzC,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,IAAI;QACF,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,MAAM;QACJ,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,KAAK;QACH,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAA;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAO,CAAA;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAA;QAClB,OAAO,MAAM,CAAA;IACf,CAAC;IASD,GAAG,CACD,MAAiC,EACjC,WAAkB;QAElB,OAAO,aAAa,EAAE,CAAA;IACxB,CAAC;IAWD,MAAM,CAAC,MAAW,EAAE,EAAO;QACzB,aAAa,EAAE,CAAA;IACjB,CAAC;IAED,QAAQ,CACN,GAAG,MAAS;QAIZ,aAAa,EAAE,CAAA;IACjB,CAAC;CACF;AAED,MAAM,UAAU,IAAI,CAOlB,KAAgD,EAChD,KAAQ;IAKR,aAAa,EAAE,CAAA;AACjB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Factory, Type } from "./Type.js";
2
+ export declare function Hash<T extends Type, A extends HashAlgorithm>(targetType: Factory<T>, algorithm: A): {
3
+ new (source: import("./Type.js").TypeSource): {
4
+ targetType: Factory<T>;
5
+ algorithm: A;
6
+ ""?: [Uint8Array, never, never] | undefined;
7
+ readonly typeName: "Hash";
8
+ readonly source: import("./Type.js").TypeSource;
9
+ ctor: new (source: import("./Type.js").TypeSource) => any;
10
+ into<O extends never>(into: Factory<O>): O;
11
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
12
+ is<T_1 extends Type<any, any, any, any, any>, M extends Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
13
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
14
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): import("./Effect.js").Effect<Y, U_1>;
15
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends Factory<T_4>>(this: T_4, match: M_3): import("./Effect.js").Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
16
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): import("./Effect.js").Effect<W, Exclude<T_5, InstanceType<M_4>>>;
17
+ };
18
+ make<Name extends string>(name: Name): {
19
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: Source | import("./Type.js").TypeSource): {
20
+ ""?: [Native, From, Into] | undefined;
21
+ readonly typeName: Name;
22
+ readonly source: Source | import("./Type.js").TypeSource;
23
+ ctor: new (source: Source | import("./Type.js").TypeSource) => any;
24
+ into<O_1 extends Into>(into: Factory<O_1>): O_1;
25
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
26
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
27
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
28
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): import("./Effect.js").Effect<Y_1, U_3>;
29
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends Factory<T_10>>(this: T_10, match: M_8): import("./Effect.js").Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
30
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): import("./Effect.js").Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
31
+ };
32
+ make<Name extends string>(name: Name): any;
33
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
34
+ state<T_13 extends Type<any, any, any, any, any>>(this: Factory<T_13>): import("./State.js").State<T_13>;
35
+ };
36
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
37
+ state<T_13 extends Type<any, any, any, any, any>>(this: Factory<T_13>): import("./State.js").State<T_13>;
38
+ };
39
+ export type HashAlgorithm = "Keccak256" | "Keccak384" | "Keccak512" | "Poseidon" | "SHA2_256" | "SHA3_256" | "SHA3_384" | "SHA3_512";
40
+ export type HashSource = never;
41
+ //# sourceMappingURL=Hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../src/core/Hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEzC,wBAAgB,IAAI,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,aAAa,EAC1D,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMb;AAED,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAA;AAEd,MAAM,MAAM,UAAU,GAAG,KAAK,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { Type } from "./Type.js";
2
+ export function Hash(targetType, algorithm) {
3
+ return class extends Type.make("Hash") {
4
+ targetType = targetType;
5
+ algorithm = algorithm;
6
+ };
7
+ }
8
+ //# sourceMappingURL=Hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hash.js","sourceRoot":"","sources":["../../src/core/Hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAE,MAAM,WAAW,CAAA;AAEzC,MAAM,UAAU,IAAI,CAClB,UAAsB,EACtB,SAAY;IAEZ,OAAO,KAAM,SAAQ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAuC;QAC1E,UAAU,GAAG,UAAU,CAAA;QACvB,SAAS,GAAG,SAAS,CAAA;KACtB,CAAA;AACH,CAAC"}
@@ -0,0 +1,198 @@
1
+ import { Store } from "../client/mod.js";
2
+ import { Effect } from "./Effect.js";
3
+ import { u64 } from "./Int.js";
4
+ import { State } from "./State.js";
5
+ import { Type } from "./Type.js";
6
+ export type IdSource = IdSource.Sender | IdSource.Self | IdSource.Caller | IdSource.Null;
7
+ export declare namespace IdSource {
8
+ const Hex_base: {
9
+ new (): {
10
+ readonly tag: "Hex";
11
+ };
12
+ };
13
+ export class Hex extends Hex_base {
14
+ }
15
+ const Bytes_base: {
16
+ new (): {
17
+ readonly tag: "Bytes";
18
+ };
19
+ };
20
+ export class Bytes extends Bytes_base {
21
+ }
22
+ const Sender_base: {
23
+ new (): {
24
+ readonly tag: "Sender";
25
+ };
26
+ };
27
+ export class Sender extends Sender_base {
28
+ }
29
+ const Self_base: {
30
+ new (): {
31
+ readonly tag: "Self";
32
+ };
33
+ };
34
+ export class Self extends Self_base {
35
+ }
36
+ const Caller_base: {
37
+ new (): {
38
+ readonly tag: "Caller";
39
+ };
40
+ };
41
+ export class Caller extends Caller_base {
42
+ }
43
+ const Null_base: {
44
+ new (): {
45
+ readonly tag: "Null";
46
+ };
47
+ };
48
+ export class Null extends Null_base {
49
+ }
50
+ export {};
51
+ }
52
+ declare const id_base: {
53
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: import("./Type.js").TypeSource | Source): {
54
+ ""?: [Native, From, Into] | undefined;
55
+ readonly typeName: "id";
56
+ readonly source: import("./Type.js").TypeSource | Source;
57
+ ctor: new (source: import("./Type.js").TypeSource | Source) => any;
58
+ into<O extends Into>(into: import("./Type.js").Factory<O>): O;
59
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
60
+ is<T_1 extends Type<any, any, any, any, any>, M extends import("./Type.js").Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
61
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends import("./Type.js").Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
62
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends import("./Type.js").Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): Effect<Y, U_1>;
63
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends import("./Type.js").Factory<T_4>>(this: T_4, match: M_3): Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
64
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends import("./Type.js").Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): Effect<W, Exclude<T_5, InstanceType<M_4>>>;
65
+ };
66
+ make<Name extends string>(name: Name): {
67
+ new <Source_1, Native_1 = never, From_1 = Native_1, Into_1 extends Type<any, any, any, any, any> = never>(source: Source_1 | import("./Type.js").TypeSource): {
68
+ ""?: [Native_1, From_1, Into_1] | undefined;
69
+ readonly typeName: Name;
70
+ readonly source: Source_1 | import("./Type.js").TypeSource;
71
+ ctor: new (source: Source_1 | import("./Type.js").TypeSource) => any;
72
+ into<O_1 extends Into_1>(into: import("./Type.js").Factory<O_1>): O_1;
73
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
74
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends import("./Type.js").Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
75
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends import("./Type.js").Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
76
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends import("./Type.js").Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): Effect<Y_1, U_3>;
77
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends import("./Type.js").Factory<T_10>>(this: T_10, match: M_8): Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
78
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends import("./Type.js").Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
79
+ };
80
+ make<Name extends string>(name: Name): any;
81
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
82
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): State<T_13>;
83
+ };
84
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
85
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): State<T_13>;
86
+ };
87
+ export declare class id extends id_base<IdSource, Uint8Array, Uint8Array> {
88
+ static fromHex(_hex: string): id;
89
+ bind<N>(_namespace: N): Contract<N>;
90
+ signer<K extends string>(_key: K): SignerEffect<K>;
91
+ }
92
+ export declare class SignerEffect<K extends string> extends Effect<SignerRequirement<K>, signer<K>> {
93
+ readonly key: K;
94
+ constructor(key: K);
95
+ deploy<N>(_namespace: N, _deployOptions: DeployOptions<N>): Generator<SignerRequirement<K>, Contract<N>>;
96
+ }
97
+ declare const SignerRequirement_base: {
98
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: import("./Type.js").TypeSource | Source): {
99
+ ""?: [Native, From, Into] | undefined;
100
+ readonly typeName: "SignerRequirement";
101
+ readonly source: import("./Type.js").TypeSource | Source;
102
+ ctor: new (source: import("./Type.js").TypeSource | Source) => any;
103
+ into<O extends Into>(into: import("./Type.js").Factory<O>): O;
104
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
105
+ is<T_1 extends Type<any, any, any, any, any>, M extends import("./Type.js").Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
106
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends import("./Type.js").Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
107
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends import("./Type.js").Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): Effect<Y, U_1>;
108
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends import("./Type.js").Factory<T_4>>(this: T_4, match: M_3): Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
109
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends import("./Type.js").Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): Effect<W, Exclude<T_5, InstanceType<M_4>>>;
110
+ };
111
+ make<Name extends string>(name: Name): {
112
+ new <Source_1, Native_1 = never, From_1 = Native_1, Into_1 extends Type<any, any, any, any, any> = never>(source: Source_1 | import("./Type.js").TypeSource): {
113
+ ""?: [Native_1, From_1, Into_1] | undefined;
114
+ readonly typeName: Name;
115
+ readonly source: Source_1 | import("./Type.js").TypeSource;
116
+ ctor: new (source: Source_1 | import("./Type.js").TypeSource) => any;
117
+ into<O_1 extends Into_1>(into: import("./Type.js").Factory<O_1>): O_1;
118
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
119
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends import("./Type.js").Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
120
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends import("./Type.js").Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
121
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends import("./Type.js").Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): Effect<Y_1, U_3>;
122
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends import("./Type.js").Factory<T_10>>(this: T_10, match: M_8): Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
123
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends import("./Type.js").Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
124
+ };
125
+ make<Name extends string>(name: Name): any;
126
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
127
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): State<T_13>;
128
+ };
129
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
130
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): State<T_13>;
131
+ };
132
+ export declare class SignerRequirement<K extends string = any> extends SignerRequirement_base<K, never> {
133
+ readonly key: K;
134
+ constructor(key: K);
135
+ }
136
+ export interface signer<K extends keyof any = any> extends InstanceType<ReturnType<typeof signer<K>>> {
137
+ }
138
+ export declare function signer<K extends keyof any>(key: K): {
139
+ new (source: import("./Type.js").TypeSource | IdSource): {
140
+ readonly key: K;
141
+ deploy<N>(_namespace: N, _deployOptions: DeployOptions<N>): Generator<never, Contract<N>, unknown>;
142
+ send(_props: SendProps): Effect<never, never>;
143
+ bind<N_1>(_namespace: N_1): Contract<N_1>;
144
+ signer<K extends string>(_key: K): SignerEffect<K>;
145
+ ""?: [Uint8Array, Uint8Array, never] | undefined;
146
+ readonly typeName: "id";
147
+ readonly source: import("./Type.js").TypeSource | IdSource;
148
+ ctor: new (source: import("./Type.js").TypeSource | IdSource) => any;
149
+ into<O extends never>(into: import("./Type.js").Factory<O>): O;
150
+ equals<T extends Type<any, any, any, any, any>>(this: T, inQuestion: T): import("./Bool.js").bool;
151
+ is<T_1 extends Type<any, any, any, any, any>, M extends import("./Type.js").Factory<T_1>>(this: T_1, match: M): import("./Bool.js").bool;
152
+ case<T_2 extends Type<any, any, any, any, any>, M_1 extends import("./Type.js").Factory<T_2>, R extends import("./Call.js").Result, U extends R | Exclude<T_2, InstanceType<M_1>>>(this: T_2, match: M_1, f: import("./Call.js").ValueCall<R, [InstanceType<M_1>]>): U;
153
+ case<T_3 extends Type<any, any, any, any, any>, M_2 extends import("./Type.js").Factory<T_3>, Y extends import("./Call.js").Yield, R_1 extends import("./Call.js").Result, U_1 extends R_1 | Exclude<T_3, InstanceType<M_2>>>(this: T_3, match: M_2, f: import("./Call.js").GenCall<Y, R_1, [InstanceType<M_2>]>): Effect<Y, U_1>;
154
+ "?"<T_4 extends Type<any, any, any, any, any>, M_3 extends import("./Type.js").Factory<T_4>>(this: T_4, match: M_3): Effect<InstanceType<M_3>, Exclude<T_4, InstanceType<M_3>>>;
155
+ "?"<T_5 extends Type<any, any, any, any, any>, M_4 extends import("./Type.js").Factory<T_5>, W extends Type<any, any, any, any, any>>(this: T_5, match: M_4, with_: W): Effect<W, Exclude<T_5, InstanceType<M_4>>>;
156
+ };
157
+ fromHex(_hex: string): id;
158
+ make<Name extends string>(name: Name): {
159
+ new <Source, Native = never, From = Native, Into extends Type<any, any, any, any, any> = never>(source: Source | import("./Type.js").TypeSource): {
160
+ ""?: [Native, From, Into] | undefined;
161
+ readonly typeName: Name;
162
+ readonly source: Source | import("./Type.js").TypeSource;
163
+ ctor: new (source: Source | import("./Type.js").TypeSource) => any;
164
+ into<O_1 extends Into>(into: import("./Type.js").Factory<O_1>): O_1;
165
+ equals<T_6 extends Type<any, any, any, any, any>>(this: T_6, inQuestion: T_6): import("./Bool.js").bool;
166
+ is<T_7 extends Type<any, any, any, any, any>, M_5 extends import("./Type.js").Factory<T_7>>(this: T_7, match: M_5): import("./Bool.js").bool;
167
+ case<T_8 extends Type<any, any, any, any, any>, M_6 extends import("./Type.js").Factory<T_8>, R_2 extends import("./Call.js").Result, U_2 extends R_2 | Exclude<T_8, InstanceType<M_6>>>(this: T_8, match: M_6, f: import("./Call.js").ValueCall<R_2, [InstanceType<M_6>]>): U_2;
168
+ case<T_9 extends Type<any, any, any, any, any>, M_7 extends import("./Type.js").Factory<T_9>, Y_1 extends import("./Call.js").Yield, R_3 extends import("./Call.js").Result, U_3 extends R_3 | Exclude<T_9, InstanceType<M_7>>>(this: T_9, match: M_7, f: import("./Call.js").GenCall<Y_1, R_3, [InstanceType<M_7>]>): Effect<Y_1, U_3>;
169
+ "?"<T_10 extends Type<any, any, any, any, any>, M_8 extends import("./Type.js").Factory<T_10>>(this: T_10, match: M_8): Effect<InstanceType<M_8>, Exclude<T_10, InstanceType<M_8>>>;
170
+ "?"<T_11 extends Type<any, any, any, any, any>, M_9 extends import("./Type.js").Factory<T_11>, W_1 extends Type<any, any, any, any, any>>(this: T_11, match: M_9, with_: W_1): Effect<W_1, Exclude<T_11, InstanceType<M_9>>>;
171
+ };
172
+ make<Name extends string>(name: Name): any;
173
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
174
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): State<T_13>;
175
+ };
176
+ "new"<T_12 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_12>, ...[value]: import("../util/Rest.js").Rest<Type.From<T_12>>): T_12;
177
+ state<T_13 extends Type<any, any, any, any, any>>(this: import("./Type.js").Factory<T_13>): State<T_13>;
178
+ };
179
+ export declare const nullId: id;
180
+ export declare const caller: id;
181
+ export declare const self: id;
182
+ export declare const sender: id;
183
+ export interface DeployOptions<N> {
184
+ deployer?: signer;
185
+ state: DeployState<N>;
186
+ }
187
+ export type DeployState<N> = {
188
+ [K in keyof N as N[K] extends State ? K : never]: N[K] extends State<infer T> ? T : never;
189
+ };
190
+ export interface SendProps {
191
+ to: id;
192
+ amount: u64;
193
+ }
194
+ export type Contract<T> = id & T & {
195
+ store(store: Store): Contract<T>;
196
+ };
197
+ export {};
198
+ //# sourceMappingURL=Id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Id.d.ts","sourceRoot":"","sources":["../../src/core/Id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAGxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAA;AACxF,yBAAiB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Effect } from "./Effect.js";
4
+ import { Type } from "./Type.js";
5
+ export var IdSource;
6
+ (function (IdSource) {
7
+ class Hex extends Tagged("Hex") {
8
+ }
9
+ IdSource.Hex = Hex;
10
+ class Bytes extends Tagged("Bytes") {
11
+ }
12
+ IdSource.Bytes = Bytes;
13
+ class Sender extends Tagged("Sender") {
14
+ }
15
+ IdSource.Sender = Sender;
16
+ class Self extends Tagged("Self") {
17
+ }
18
+ IdSource.Self = Self;
19
+ class Caller extends Tagged("Caller") {
20
+ }
21
+ IdSource.Caller = Caller;
22
+ class Null extends Tagged("Null") {
23
+ }
24
+ IdSource.Null = Null;
25
+ })(IdSource || (IdSource = {}));
26
+ export class id extends Type.make("id") {
27
+ static fromHex(_hex) {
28
+ unimplemented();
29
+ }
30
+ bind(_namespace) {
31
+ unimplemented();
32
+ }
33
+ signer(_key) {
34
+ unimplemented();
35
+ }
36
+ }
37
+ export class SignerEffect extends Effect {
38
+ key;
39
+ constructor(key) {
40
+ super();
41
+ this.key = key;
42
+ }
43
+ deploy(_namespace, _deployOptions) {
44
+ unimplemented();
45
+ }
46
+ }
47
+ export class SignerRequirement extends Type.make("SignerRequirement") {
48
+ key;
49
+ constructor(key) {
50
+ super(key);
51
+ this.key = key;
52
+ }
53
+ }
54
+ export function signer(key) {
55
+ return class extends id {
56
+ key = key;
57
+ deploy(_namespace, _deployOptions) {
58
+ unimplemented();
59
+ }
60
+ send(_props) {
61
+ unimplemented();
62
+ }
63
+ };
64
+ }
65
+ export const nullId = new id(new IdSource.Null());
66
+ export const caller = new id(new IdSource.Caller());
67
+ export const self = new id(new IdSource.Self());
68
+ export const sender = new id(new IdSource.Sender());
69
+ //# sourceMappingURL=Id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Id.js","sourceRoot":"","sources":["../../src/core/Id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,C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