liminal 0.4.0 → 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 (239) hide show
  1. package/LICENSE +201 -15
  2. package/README.md +96 -81
  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 +21 -21
  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/jest.config.js +0 -4
  196. package/lib/array/array.d.ts +0 -6
  197. package/lib/array/array.js +0 -21
  198. package/lib/array/index.d.ts +0 -11
  199. package/lib/array/index.js +0 -17
  200. package/lib/composition/composition.d.ts +0 -6
  201. package/lib/composition/composition.js +0 -37
  202. package/lib/composition/index.d.ts +0 -9
  203. package/lib/composition/index.js +0 -13
  204. package/lib/composition/types.d.ts +0 -2
  205. package/lib/composition/types.js +0 -2
  206. package/lib/dispatch/getType.d.ts +0 -2
  207. package/lib/dispatch/getType.js +0 -15
  208. package/lib/dispatch/identity.d.ts +0 -2
  209. package/lib/dispatch/identity.js +0 -4
  210. package/lib/dispatch/index.d.ts +0 -22
  211. package/lib/dispatch/index.js +0 -13
  212. package/lib/dispatch/types.d.ts +0 -14
  213. package/lib/dispatch/types.js +0 -16
  214. package/lib/error/error.d.ts +0 -24
  215. package/lib/error/error.js +0 -25
  216. package/lib/error/index.d.ts +0 -2
  217. package/lib/error/index.js +0 -4
  218. package/lib/index.d.ts +0 -67
  219. package/lib/index.js +0 -19
  220. package/lib/multimethod/index.d.ts +0 -7
  221. package/lib/multimethod/index.js +0 -9
  222. package/lib/multimethod/multimethod.d.ts +0 -3
  223. package/lib/multimethod/multimethod.js +0 -101
  224. package/src/array/array.ts +0 -29
  225. package/src/array/index.ts +0 -12
  226. package/src/composition/composition.ts +0 -45
  227. package/src/composition/index.ts +0 -10
  228. package/src/composition/types.ts +0 -6
  229. package/src/dispatch/getType.ts +0 -17
  230. package/src/dispatch/identity.ts +0 -3
  231. package/src/dispatch/index.ts +0 -11
  232. package/src/dispatch/types.ts +0 -15
  233. package/src/error/error.ts +0 -26
  234. package/src/error/index.ts +0 -3
  235. package/src/index.ts +0 -15
  236. package/src/multimethod/index.ts +0 -8
  237. package/src/multimethod/multimethod.test.ts +0 -10
  238. package/src/multimethod/multimethod.ts +0 -148
  239. package/tsconfig.json +0 -12
@@ -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.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S,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAC1F,CAAA;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,EAAE,CAAA;IACN,MAAM,EAAE,GAAG,CAAA;CACZ;AAGD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG;IACjC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;CACjC,CAAA"}
package/esm/core/Id.js ADDED
@@ -0,0 +1,69 @@
1
+ import { Tagged } from "../util/Tagged.js";
2
+ import { unimplemented } from "../util/unimplemented.js";
3
+ import { 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,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,MAAM,KAAW,QAAQ,CAOxB;AAPD,WAAiB,QAAQ;IACvB,MAAa,GAAI,SAAQ,MAAM,CAAC,KAAK,CAAC;KAAG;IAA5B,YAAG,MAAyB,CAAA;IACzC,MAAa,KAAM,SAAQ,MAAM,CAAC,OAAO,CAAC;KAAG;IAAhC,cAAK,QAA2B,CAAA;IAC7C,MAAa,MAAO,SAAQ,MAAM,CAAC,QAAQ,CAAC;KAAG;IAAlC,eAAM,SAA4B,CAAA;IAC/C,MAAa,IAAK,SAAQ,MAAM,CAAC,MAAM,CAAC;KAAG;IAA9B,aAAI,OAA0B,CAAA;IAC3C,MAAa,MAAO,SAAQ,MAAM,CAAC,QAAQ,CAAC;KAAG;IAAlC,eAAM,SAA4B,CAAA;IAC/C,MAAa,IAAK,SAAQ,MAAM,CAAC,MAAM,CAAC;KAAG;IAA9B,aAAI,OAA0B,CAAA;AAC7C,CAAC,EAPgB,QAAQ,KAAR,QAAQ,QAOxB;AAED,MAAM,OAAO,EAAG,SAAQ,IAAI,CAAC,IA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