@hazbase/simplicity 0.0.5 → 0.1.1

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 (45) hide show
  1. package/README.md +645 -148
  2. package/dist/cli.js +2125 -159
  3. package/dist/client/SimplicityClient.d.ts +64 -290
  4. package/dist/client/SimplicityClient.js +65 -23
  5. package/dist/core/executor.js +67 -92
  6. package/dist/core/outputBinding.d.ts +61 -0
  7. package/dist/core/outputBinding.js +552 -0
  8. package/dist/core/schnorr.d.ts +5 -0
  9. package/dist/core/schnorr.js +34 -0
  10. package/dist/core/types.d.ts +553 -1
  11. package/dist/docs/definitions/bond-anchor.simf +19 -0
  12. package/dist/docs/definitions/bond-definition.json +10 -0
  13. package/dist/docs/definitions/bond-descriptor-bound-settlement-machine.simf +144 -0
  14. package/dist/docs/definitions/bond-issuance-anchor.simf +26 -0
  15. package/dist/docs/definitions/bond-issuance-state-partial-redemption.json +18 -0
  16. package/dist/docs/definitions/bond-issuance-state-redeemed.json +18 -0
  17. package/dist/docs/definitions/bond-issuance-state.json +12 -0
  18. package/dist/docs/definitions/bond-redemption-state-machine.simf +118 -0
  19. package/dist/docs/definitions/bond-redemption-transition.simf +41 -0
  20. package/dist/docs/definitions/bond-script-bound-settlement-machine.simf +142 -0
  21. package/dist/docs/definitions/fund-capital-call-open.simf +82 -0
  22. package/dist/docs/definitions/fund-capital-call-refund-only.simf +33 -0
  23. package/dist/docs/definitions/fund-capital-call-state.json +11 -0
  24. package/dist/docs/definitions/fund-definition.json +8 -0
  25. package/dist/docs/definitions/fund-distribution-claim.simf +57 -0
  26. package/dist/docs/definitions/recursive-delay-direct-next.simf +60 -0
  27. package/dist/docs/definitions/recursive-delay-optional.simf +88 -0
  28. package/dist/docs/definitions/recursive-delay-required.simf +72 -0
  29. package/dist/docs/definitions/recursive-delay.simf +83 -0
  30. package/dist/docs/definitions/recursive-policy-transfer-machine.simf +65 -0
  31. package/dist/domain/bond.d.ts +8583 -721
  32. package/dist/domain/bond.js +1272 -31
  33. package/dist/domain/bondSettlementValidation.d.ts +2 -0
  34. package/dist/domain/bondSettlementValidation.js +28 -0
  35. package/dist/domain/bondValidation.d.ts +6 -0
  36. package/dist/domain/bondValidation.js +65 -3
  37. package/dist/domain/fund.d.ts +2069 -0
  38. package/dist/domain/fund.js +1384 -0
  39. package/dist/domain/fundValidation.d.ts +122 -0
  40. package/dist/domain/fundValidation.js +635 -0
  41. package/dist/domain/policies.d.ts +1051 -0
  42. package/dist/domain/policies.js +1605 -0
  43. package/dist/index.d.ts +5 -1
  44. package/dist/index.js +85 -21
  45. package/package.json +15 -2
@@ -1,305 +1,79 @@
1
+ import { evaluateOutputBindingSupport } from "../core/outputBinding";
1
2
  import { ElementsRpcClient } from "../core/rpc";
2
- import { BondDefinition, BondIssuanceState, BondSettlementDescriptor, DefinitionInput, DefinitionVerificationResult, CompileFromFileInput, CompileFromPresetInput, DefinitionDescriptor, StateDocumentDescriptor, StateDocumentInput, StateVerificationResult, SimplicityArtifact, SimplicityClientConfig } from "../core/types";
3
+ import { BondEvidenceBundle, OutputBindingSupportEvaluation, OutputBindingSupportMatrix, PolicyEvidenceBundle, PolicyTemplateManifestValidationResult, DefinitionInput, DefinitionVerificationResult, CompileFromFileInput, CompileFromPresetInput, DefinitionDescriptor, StateDocumentDescriptor, StateDocumentInput, StateVerificationResult, SimplicityArtifact, SimplicityClientConfig } from "../core/types";
3
4
  import { RelayerClient } from "../gasless/RelayerClient";
4
5
  import { GaslessTransferInput, GaslessTransferResult, RelayerClientConfig } from "../gasless/types";
5
6
  import { CompiledContract } from "./ContractFactory";
6
7
  import { DeployedContract } from "./DeployedContract";
7
- import { buildBondPayload, buildBondRedemption, buildBondTransitionPayload, buildBondRolloverPlan, buildBondMachineRolloverPlan, buildBondMachineSettlementPlan, buildBondSettlementDescriptor, buildBondSettlementPayload, compileBondRedemptionMachine, compileBondTransition, executeBondStateRollover, executeBondMachineRollover, executeBondMachineSettlement, inspectBondStateRollover, inspectBondMachineRollover, inspectBondMachineSettlement, loadBond, redeemBond, verifyBond, verifyBondSettlementDescriptor, verifyBondRedemptionMachineArtifact, verifyBondTransition } from "../domain/bond";
8
+ import { prepareRedemption, prepareClosing, exportFinalityPayload, buildSettlement, verifySettlement, define, executeClosing, executeRedemption, exportEvidence, inspectClosing, inspectRedemption, issue, load, verify, verifyClosing, verifyRedemption } from "../domain/bond";
9
+ import { define as defineFund, verify as verifyFund, load as loadFund, prepareCapitalCall, inspectCapitalCallClaim, executeCapitalCallClaim, inspectCapitalCallRollover, executeCapitalCallRollover, inspectCapitalCallRefund, executeCapitalCallRefund, verifyCapitalCall, signPositionReceipt, verifyPositionReceipt, prepareDistribution, reconcilePosition, inspectDistributionClaim, executeDistributionClaim, verifyDistribution, prepareClosing as prepareFundClosing, verifyClosing as verifyFundClosing, exportEvidence as exportFundEvidence, exportFinalityPayload as exportFundFinalityPayload } from "../domain/fund";
10
+ import { buildPolicyOutputDescriptor, describePolicyTemplate, listPolicyTemplates, loadPolicyTemplateManifest, executeTransfer as executePolicyTransfer, exportEvidence as exportPolicyEvidence, inspectTransfer as inspectPolicyTransfer, issue as issuePolicy, prepareTransfer as preparePolicyTransfer, validatePolicyTemplateManifest, validatePolicyTemplateParams, verifyState as verifyPolicyState, verifyTransfer as verifyPolicyTransfer } from "../domain/policies";
8
11
  export declare class SimplicityClient {
9
12
  readonly config: SimplicityClientConfig;
10
13
  readonly rpc: ElementsRpcClient;
11
14
  readonly payments: {
12
15
  gaslessTransfer: (input: GaslessTransferInput) => Promise<GaslessTransferResult>;
13
16
  };
17
+ readonly outputBinding: {
18
+ describeSupport: () => OutputBindingSupportMatrix;
19
+ evaluateSupport: (input: Parameters<typeof evaluateOutputBindingSupport>[0]) => OutputBindingSupportEvaluation;
20
+ };
21
+ readonly policies: {
22
+ listTemplates: () => ReturnType<typeof listPolicyTemplates>;
23
+ describeTemplate: (input: Parameters<typeof describePolicyTemplate>[0]) => ReturnType<typeof describePolicyTemplate>;
24
+ loadTemplateManifest: (input: Parameters<typeof loadPolicyTemplateManifest>[0]) => ReturnType<typeof loadPolicyTemplateManifest>;
25
+ validateTemplateManifest: (input: Parameters<typeof validatePolicyTemplateManifest>[0]) => PolicyTemplateManifestValidationResult;
26
+ validateTemplateParams: (input: Parameters<typeof validatePolicyTemplateParams>[0]) => ReturnType<typeof validatePolicyTemplateParams>;
27
+ buildOutputDescriptor: (input: Parameters<typeof buildPolicyOutputDescriptor>[1]) => ReturnType<typeof buildPolicyOutputDescriptor>;
28
+ issue: (input: Parameters<typeof issuePolicy>[1]) => ReturnType<typeof issuePolicy>;
29
+ prepareTransfer: (input: Parameters<typeof preparePolicyTransfer>[1]) => ReturnType<typeof preparePolicyTransfer>;
30
+ inspectTransfer: (input: Parameters<typeof inspectPolicyTransfer>[1]) => ReturnType<typeof inspectPolicyTransfer>;
31
+ executeTransfer: (input: Parameters<typeof executePolicyTransfer>[1]) => ReturnType<typeof executePolicyTransfer>;
32
+ verifyState: (input: Parameters<typeof verifyPolicyState>[1]) => ReturnType<typeof verifyPolicyState>;
33
+ verifyTransfer: (input: Parameters<typeof verifyPolicyTransfer>[1]) => ReturnType<typeof verifyPolicyTransfer>;
34
+ exportEvidence: (input: Parameters<typeof exportPolicyEvidence>[1]) => Promise<PolicyEvidenceBundle>;
35
+ };
14
36
  readonly bonds: {
15
- defineBond: (input: {
16
- definitionPath?: string;
17
- definitionValue?: BondDefinition;
18
- issuancePath?: string;
19
- issuanceValue?: BondIssuanceState;
20
- simfPath?: string;
21
- artifactPath?: string;
22
- }) => Promise<CompiledContract>;
23
- verifyBond: (input: {
24
- artifactPath?: string;
25
- artifact?: SimplicityArtifact;
26
- definitionPath?: string;
27
- definitionValue?: BondDefinition;
28
- issuancePath?: string;
29
- issuanceValue?: BondIssuanceState;
30
- }) => ReturnType<typeof verifyBond>;
31
- redeemBond: (input: {
32
- definitionPath?: string;
33
- definitionValue?: BondDefinition;
34
- previousIssuancePath?: string;
35
- previousIssuanceValue?: BondIssuanceState;
36
- amount: number;
37
- redeemedAt: string;
38
- simfPath?: string;
39
- artifactPath?: string;
40
- }) => ReturnType<typeof redeemBond>;
41
- verifyBondTransition: (input: {
42
- previousIssuancePath?: string;
43
- previousIssuanceValue?: BondIssuanceState;
44
- nextIssuancePath?: string;
45
- nextIssuanceValue?: BondIssuanceState;
46
- }) => ReturnType<typeof verifyBondTransition>;
47
- buildBondRedemption: (input: {
48
- definitionPath?: string;
49
- definitionValue?: BondDefinition;
50
- previousIssuancePath?: string;
51
- previousIssuanceValue?: BondIssuanceState;
52
- amount: number;
53
- redeemedAt: string;
54
- }) => ReturnType<typeof buildBondRedemption>;
55
- buildBondPayload: (input: {
56
- artifactPath?: string;
57
- artifact?: SimplicityArtifact;
58
- definitionPath?: string;
59
- definitionValue?: BondDefinition;
60
- issuancePath?: string;
61
- issuanceValue?: BondIssuanceState;
62
- }) => ReturnType<typeof buildBondPayload>;
63
- buildBondTransitionPayload: (input: {
64
- definitionPath?: string;
65
- definitionValue?: BondDefinition;
66
- previousIssuancePath?: string;
67
- previousIssuanceValue?: BondIssuanceState;
68
- nextIssuancePath?: string;
69
- nextIssuanceValue?: BondIssuanceState;
70
- }) => ReturnType<typeof buildBondTransitionPayload>;
71
- buildBondSettlementDescriptor: (input: {
72
- definitionPath?: string;
73
- definitionValue?: BondDefinition;
74
- previousIssuancePath?: string;
75
- previousIssuanceValue?: BondIssuanceState;
76
- nextIssuancePath?: string;
77
- nextIssuanceValue?: BondIssuanceState;
78
- nextStateSimfPath?: string;
79
- nextAmountSat: number;
80
- maxFeeSat?: number;
81
- }) => ReturnType<typeof buildBondSettlementDescriptor>;
82
- verifyBondSettlementDescriptor: (input: {
83
- descriptorPath?: string;
84
- descriptorValue?: BondSettlementDescriptor;
85
- definitionPath?: string;
86
- definitionValue?: BondDefinition;
87
- previousIssuancePath?: string;
88
- previousIssuanceValue?: BondIssuanceState;
89
- nextIssuancePath?: string;
90
- nextIssuanceValue?: BondIssuanceState;
91
- nextStateSimfPath?: string;
92
- nextAmountSat?: number;
93
- maxFeeSat?: number;
94
- }) => ReturnType<typeof verifyBondSettlementDescriptor>;
95
- buildBondSettlementPayload: (input: {
96
- definitionPath?: string;
97
- definitionValue?: BondDefinition;
98
- previousIssuancePath?: string;
99
- previousIssuanceValue?: BondIssuanceState;
100
- nextIssuancePath?: string;
101
- nextIssuanceValue?: BondIssuanceState;
102
- nextStateSimfPath?: string;
103
- nextAmountSat: number;
104
- maxFeeSat?: number;
105
- }) => ReturnType<typeof buildBondSettlementPayload>;
106
- buildBondRolloverPlan: (input: {
107
- currentArtifactPath?: string;
108
- currentArtifact?: SimplicityArtifact;
109
- definitionPath?: string;
110
- definitionValue?: BondDefinition;
111
- previousIssuancePath?: string;
112
- previousIssuanceValue?: BondIssuanceState;
113
- nextIssuancePath?: string;
114
- nextIssuanceValue?: BondIssuanceState;
115
- nextSimfPath?: string;
116
- nextArtifactPath?: string;
117
- }) => ReturnType<typeof buildBondRolloverPlan>;
118
- buildBondMachineRolloverPlan: (input: {
119
- currentArtifactPath?: string;
120
- currentArtifact?: SimplicityArtifact;
121
- definitionPath?: string;
122
- definitionValue?: BondDefinition;
123
- previousIssuancePath?: string;
124
- previousIssuanceValue?: BondIssuanceState;
125
- nextIssuancePath?: string;
126
- nextIssuanceValue?: BondIssuanceState;
127
- nextStateSimfPath?: string;
128
- machineSimfPath?: string;
129
- machineArtifactPath?: string;
130
- }) => ReturnType<typeof buildBondMachineRolloverPlan>;
131
- buildBondMachineSettlementPlan: (input: {
132
- currentMachineArtifactPath?: string;
133
- currentMachineArtifact?: SimplicityArtifact;
134
- definitionPath?: string;
135
- definitionValue?: BondDefinition;
136
- previousIssuancePath?: string;
137
- previousIssuanceValue?: BondIssuanceState;
138
- nextIssuancePath?: string;
139
- nextIssuanceValue?: BondIssuanceState;
140
- nextSimfPath?: string;
141
- nextArtifactPath?: string;
142
- }) => ReturnType<typeof buildBondMachineSettlementPlan>;
143
- compileBondTransition: (input: {
144
- definitionPath?: string;
145
- definitionValue?: BondDefinition;
146
- previousIssuancePath?: string;
147
- previousIssuanceValue?: BondIssuanceState;
148
- nextIssuancePath?: string;
149
- nextIssuanceValue?: BondIssuanceState;
150
- simfPath?: string;
151
- artifactPath?: string;
152
- }) => ReturnType<typeof compileBondTransition>;
153
- compileBondRedemptionMachine: (input: {
154
- definitionPath?: string;
155
- definitionValue?: BondDefinition;
156
- previousIssuancePath?: string;
157
- previousIssuanceValue?: BondIssuanceState;
158
- nextIssuancePath?: string;
159
- nextIssuanceValue?: BondIssuanceState;
160
- nextStateSimfPath?: string;
161
- nextAmountSat?: number;
162
- maxFeeSat?: number;
163
- simfPath?: string;
164
- artifactPath?: string;
165
- }) => ReturnType<typeof compileBondRedemptionMachine>;
166
- verifyBondRedemptionMachineArtifact: (input: {
167
- artifactPath?: string;
168
- artifact?: SimplicityArtifact;
169
- definitionPath?: string;
170
- definitionValue?: BondDefinition;
171
- previousIssuancePath?: string;
172
- previousIssuanceValue?: BondIssuanceState;
173
- nextIssuancePath?: string;
174
- nextIssuanceValue?: BondIssuanceState;
175
- nextStateSimfPath?: string;
176
- nextAmountSat?: number;
177
- maxFeeSat?: number;
178
- }) => ReturnType<typeof verifyBondRedemptionMachineArtifact>;
179
- inspectBondStateRollover: (input: {
180
- currentArtifactPath?: string;
181
- currentArtifact?: SimplicityArtifact;
182
- definitionPath?: string;
183
- definitionValue?: BondDefinition;
184
- previousIssuancePath?: string;
185
- previousIssuanceValue?: BondIssuanceState;
186
- nextIssuancePath?: string;
187
- nextIssuanceValue?: BondIssuanceState;
188
- nextSimfPath?: string;
189
- nextArtifactPath?: string;
190
- wallet: string;
191
- signer: {
192
- type: "schnorrPrivkeyHex";
193
- privkeyHex: string;
194
- };
195
- feeSat?: number;
196
- utxoPolicy?: "smallest_over" | "largest" | "newest";
197
- }) => ReturnType<typeof inspectBondStateRollover>;
198
- inspectBondMachineRollover: (input: {
199
- currentArtifactPath?: string;
200
- currentArtifact?: SimplicityArtifact;
201
- definitionPath?: string;
202
- definitionValue?: BondDefinition;
203
- previousIssuancePath?: string;
204
- previousIssuanceValue?: BondIssuanceState;
205
- nextIssuancePath?: string;
206
- nextIssuanceValue?: BondIssuanceState;
207
- machineSimfPath?: string;
208
- machineArtifactPath?: string;
209
- wallet: string;
210
- signer: {
211
- type: "schnorrPrivkeyHex";
212
- privkeyHex: string;
213
- };
214
- feeSat?: number;
215
- utxoPolicy?: "smallest_over" | "largest" | "newest";
216
- }) => ReturnType<typeof inspectBondMachineRollover>;
217
- inspectBondMachineSettlement: (input: {
218
- currentMachineArtifactPath?: string;
219
- currentMachineArtifact?: SimplicityArtifact;
220
- definitionPath?: string;
221
- definitionValue?: BondDefinition;
222
- previousIssuancePath?: string;
223
- previousIssuanceValue?: BondIssuanceState;
224
- nextIssuancePath?: string;
225
- nextIssuanceValue?: BondIssuanceState;
226
- nextSimfPath?: string;
227
- nextArtifactPath?: string;
228
- wallet: string;
229
- signer: {
230
- type: "schnorrPrivkeyHex";
231
- privkeyHex: string;
232
- };
233
- feeSat?: number;
234
- utxoPolicy?: "smallest_over" | "largest" | "newest";
235
- }) => ReturnType<typeof inspectBondMachineSettlement>;
236
- executeBondStateRollover: (input: {
237
- currentArtifactPath?: string;
238
- currentArtifact?: SimplicityArtifact;
239
- definitionPath?: string;
240
- definitionValue?: BondDefinition;
241
- previousIssuancePath?: string;
242
- previousIssuanceValue?: BondIssuanceState;
243
- nextIssuancePath?: string;
244
- nextIssuanceValue?: BondIssuanceState;
245
- nextSimfPath?: string;
246
- nextArtifactPath?: string;
247
- wallet: string;
248
- signer: {
249
- type: "schnorrPrivkeyHex";
250
- privkeyHex: string;
251
- };
252
- feeSat?: number;
253
- utxoPolicy?: "smallest_over" | "largest" | "newest";
254
- broadcast?: boolean;
255
- }) => ReturnType<typeof executeBondStateRollover>;
256
- executeBondMachineRollover: (input: {
257
- currentArtifactPath?: string;
258
- currentArtifact?: SimplicityArtifact;
259
- definitionPath?: string;
260
- definitionValue?: BondDefinition;
261
- previousIssuancePath?: string;
262
- previousIssuanceValue?: BondIssuanceState;
263
- nextIssuancePath?: string;
264
- nextIssuanceValue?: BondIssuanceState;
265
- machineSimfPath?: string;
266
- machineArtifactPath?: string;
267
- wallet: string;
268
- signer: {
269
- type: "schnorrPrivkeyHex";
270
- privkeyHex: string;
271
- };
272
- feeSat?: number;
273
- utxoPolicy?: "smallest_over" | "largest" | "newest";
274
- broadcast?: boolean;
275
- }) => ReturnType<typeof executeBondMachineRollover>;
276
- executeBondMachineSettlement: (input: {
277
- currentMachineArtifactPath?: string;
278
- currentMachineArtifact?: SimplicityArtifact;
279
- definitionPath?: string;
280
- definitionValue?: BondDefinition;
281
- previousIssuancePath?: string;
282
- previousIssuanceValue?: BondIssuanceState;
283
- nextIssuancePath?: string;
284
- nextIssuanceValue?: BondIssuanceState;
285
- nextSimfPath?: string;
286
- nextArtifactPath?: string;
287
- wallet: string;
288
- signer: {
289
- type: "schnorrPrivkeyHex";
290
- privkeyHex: string;
291
- };
292
- feeSat?: number;
293
- utxoPolicy?: "smallest_over" | "largest" | "newest";
294
- broadcast?: boolean;
295
- }) => ReturnType<typeof executeBondMachineSettlement>;
296
- loadBond: (input: {
297
- artifactPath: string;
298
- definitionPath?: string;
299
- definitionValue?: BondDefinition;
300
- issuancePath?: string;
301
- issuanceValue?: BondIssuanceState;
302
- }) => ReturnType<typeof loadBond>;
37
+ define: (input: Parameters<typeof define>[1]) => ReturnType<typeof define>;
38
+ verify: (input: Parameters<typeof verify>[1]) => ReturnType<typeof verify>;
39
+ load: (input: Parameters<typeof load>[1]) => ReturnType<typeof load>;
40
+ issue: (input: Parameters<typeof issue>[1]) => ReturnType<typeof issue>;
41
+ prepareRedemption: (input: Parameters<typeof prepareRedemption>[1]) => ReturnType<typeof prepareRedemption>;
42
+ inspectRedemption: (input: Parameters<typeof inspectRedemption>[1]) => ReturnType<typeof inspectRedemption>;
43
+ executeRedemption: (input: Parameters<typeof executeRedemption>[1]) => ReturnType<typeof executeRedemption>;
44
+ verifyRedemption: (input: Parameters<typeof verifyRedemption>[1]) => ReturnType<typeof verifyRedemption>;
45
+ buildSettlement: (input: Parameters<typeof buildSettlement>[1]) => ReturnType<typeof buildSettlement>;
46
+ verifySettlement: (input: Parameters<typeof verifySettlement>[1]) => ReturnType<typeof verifySettlement>;
47
+ prepareClosing: (input: Parameters<typeof prepareClosing>[1]) => ReturnType<typeof prepareClosing>;
48
+ inspectClosing: (input: Parameters<typeof inspectClosing>[1]) => ReturnType<typeof inspectClosing>;
49
+ executeClosing: (input: Parameters<typeof executeClosing>[1]) => ReturnType<typeof executeClosing>;
50
+ verifyClosing: (input: Parameters<typeof verifyClosing>[1]) => ReturnType<typeof verifyClosing>;
51
+ exportEvidence: (input: Parameters<typeof exportEvidence>[1]) => Promise<BondEvidenceBundle>;
52
+ exportFinalityPayload: (input: Parameters<typeof exportFinalityPayload>[1]) => ReturnType<typeof exportFinalityPayload>;
53
+ };
54
+ readonly funds: {
55
+ define: (input: Parameters<typeof defineFund>[1]) => ReturnType<typeof defineFund>;
56
+ verify: (input: Parameters<typeof verifyFund>[1]) => ReturnType<typeof verifyFund>;
57
+ load: (input: Parameters<typeof loadFund>[1]) => ReturnType<typeof loadFund>;
58
+ prepareCapitalCall: (input: Parameters<typeof prepareCapitalCall>[1]) => ReturnType<typeof prepareCapitalCall>;
59
+ inspectCapitalCallClaim: (input: Parameters<typeof inspectCapitalCallClaim>[1]) => ReturnType<typeof inspectCapitalCallClaim>;
60
+ executeCapitalCallClaim: (input: Parameters<typeof executeCapitalCallClaim>[1]) => ReturnType<typeof executeCapitalCallClaim>;
61
+ inspectCapitalCallRollover: (input: Parameters<typeof inspectCapitalCallRollover>[1]) => ReturnType<typeof inspectCapitalCallRollover>;
62
+ executeCapitalCallRollover: (input: Parameters<typeof executeCapitalCallRollover>[1]) => ReturnType<typeof executeCapitalCallRollover>;
63
+ inspectCapitalCallRefund: (input: Parameters<typeof inspectCapitalCallRefund>[1]) => ReturnType<typeof inspectCapitalCallRefund>;
64
+ executeCapitalCallRefund: (input: Parameters<typeof executeCapitalCallRefund>[1]) => ReturnType<typeof executeCapitalCallRefund>;
65
+ verifyCapitalCall: (input: Parameters<typeof verifyCapitalCall>[1]) => ReturnType<typeof verifyCapitalCall>;
66
+ signPositionReceipt: (input: Parameters<typeof signPositionReceipt>[1]) => ReturnType<typeof signPositionReceipt>;
67
+ verifyPositionReceipt: (input: Parameters<typeof verifyPositionReceipt>[1]) => ReturnType<typeof verifyPositionReceipt>;
68
+ prepareDistribution: (input: Parameters<typeof prepareDistribution>[1]) => ReturnType<typeof prepareDistribution>;
69
+ reconcilePosition: (input: Parameters<typeof reconcilePosition>[1]) => ReturnType<typeof reconcilePosition>;
70
+ inspectDistributionClaim: (input: Parameters<typeof inspectDistributionClaim>[1]) => ReturnType<typeof inspectDistributionClaim>;
71
+ executeDistributionClaim: (input: Parameters<typeof executeDistributionClaim>[1]) => ReturnType<typeof executeDistributionClaim>;
72
+ verifyDistribution: (input: Parameters<typeof verifyDistribution>[1]) => ReturnType<typeof verifyDistribution>;
73
+ prepareClosing: (input: Parameters<typeof prepareFundClosing>[1]) => ReturnType<typeof prepareFundClosing>;
74
+ verifyClosing: (input: Parameters<typeof verifyFundClosing>[1]) => ReturnType<typeof verifyFundClosing>;
75
+ exportEvidence: (input: Parameters<typeof exportFundEvidence>[1]) => ReturnType<typeof exportFundEvidence>;
76
+ exportFinalityPayload: (input: Parameters<typeof exportFundFinalityPayload>[1]) => ReturnType<typeof exportFundFinalityPayload>;
303
77
  };
304
78
  constructor(config: SimplicityClientConfig);
305
79
  compileFromFile(input: CompileFromFileInput): Promise<CompiledContract>;
@@ -7,46 +7,88 @@ const compiler_1 = require("../core/compiler");
7
7
  const definition_1 = require("../core/definition");
8
8
  const state_1 = require("../core/state");
9
9
  const errors_1 = require("../core/errors");
10
+ const outputBinding_1 = require("../core/outputBinding");
10
11
  const rpc_1 = require("../core/rpc");
11
12
  const RelayerClient_1 = require("../gasless/RelayerClient");
12
13
  const ContractFactory_1 = require("./ContractFactory");
13
14
  const DeployedContract_1 = require("./DeployedContract");
14
15
  const bond_1 = require("../domain/bond");
16
+ const fund_1 = require("../domain/fund");
17
+ const policies_1 = require("../domain/policies");
15
18
  class SimplicityClient {
16
19
  config;
17
20
  rpc;
18
21
  payments;
22
+ outputBinding;
23
+ policies;
19
24
  bonds;
25
+ funds;
20
26
  constructor(config) {
21
27
  this.config = config;
22
28
  this.rpc = new rpc_1.ElementsRpcClient(config.rpc);
23
29
  this.payments = {
24
30
  gaslessTransfer: async (input) => this.gaslessTransfer(input),
25
31
  };
32
+ this.outputBinding = {
33
+ describeSupport: () => (0, outputBinding_1.describeOutputBindingSupport)(),
34
+ evaluateSupport: (input) => (0, outputBinding_1.evaluateOutputBindingSupport)(input),
35
+ };
36
+ this.policies = {
37
+ listTemplates: () => (0, policies_1.listPolicyTemplates)(),
38
+ describeTemplate: (input) => (0, policies_1.describePolicyTemplate)(input),
39
+ loadTemplateManifest: async (input) => (0, policies_1.loadPolicyTemplateManifest)(input),
40
+ validateTemplateManifest: (input) => (0, policies_1.validatePolicyTemplateManifest)(input),
41
+ validateTemplateParams: (input) => (0, policies_1.validatePolicyTemplateParams)(input),
42
+ buildOutputDescriptor: async (input) => (0, policies_1.buildPolicyOutputDescriptor)(this, input),
43
+ issue: async (input) => (0, policies_1.issue)(this, input),
44
+ prepareTransfer: async (input) => (0, policies_1.prepareTransfer)(this, input),
45
+ inspectTransfer: async (input) => (0, policies_1.inspectTransfer)(this, input),
46
+ executeTransfer: async (input) => (0, policies_1.executeTransfer)(this, input),
47
+ verifyState: async (input) => (0, policies_1.verifyState)(this, input),
48
+ verifyTransfer: async (input) => (0, policies_1.verifyTransfer)(this, input),
49
+ exportEvidence: async (input) => (0, policies_1.exportEvidence)(this, input),
50
+ };
26
51
  this.bonds = {
27
- defineBond: async (input) => (0, bond_1.defineBond)(this, input),
28
- verifyBond: async (input) => (0, bond_1.verifyBond)(this, input),
29
- redeemBond: async (input) => (0, bond_1.redeemBond)(this, input),
30
- verifyBondTransition: async (input) => (0, bond_1.verifyBondTransition)(this, input),
31
- buildBondRedemption: async (input) => (0, bond_1.buildBondRedemption)(this, input),
32
- buildBondPayload: async (input) => (0, bond_1.buildBondPayload)(this, input),
33
- buildBondTransitionPayload: async (input) => (0, bond_1.buildBondTransitionPayload)(this, input),
34
- buildBondSettlementDescriptor: async (input) => (0, bond_1.buildBondSettlementDescriptor)(this, input),
35
- verifyBondSettlementDescriptor: async (input) => (0, bond_1.verifyBondSettlementDescriptor)(this, input),
36
- buildBondSettlementPayload: async (input) => (0, bond_1.buildBondSettlementPayload)(this, input),
37
- buildBondRolloverPlan: async (input) => (0, bond_1.buildBondRolloverPlan)(this, input),
38
- buildBondMachineRolloverPlan: async (input) => (0, bond_1.buildBondMachineRolloverPlan)(this, input),
39
- buildBondMachineSettlementPlan: async (input) => (0, bond_1.buildBondMachineSettlementPlan)(this, input),
40
- compileBondTransition: async (input) => (0, bond_1.compileBondTransition)(this, input),
41
- compileBondRedemptionMachine: async (input) => (0, bond_1.compileBondRedemptionMachine)(this, input),
42
- verifyBondRedemptionMachineArtifact: async (input) => (0, bond_1.verifyBondRedemptionMachineArtifact)(this, input),
43
- inspectBondStateRollover: async (input) => (0, bond_1.inspectBondStateRollover)(this, input),
44
- inspectBondMachineRollover: async (input) => (0, bond_1.inspectBondMachineRollover)(this, input),
45
- inspectBondMachineSettlement: async (input) => (0, bond_1.inspectBondMachineSettlement)(this, input),
46
- executeBondStateRollover: async (input) => (0, bond_1.executeBondStateRollover)(this, input),
47
- executeBondMachineRollover: async (input) => (0, bond_1.executeBondMachineRollover)(this, input),
48
- executeBondMachineSettlement: async (input) => (0, bond_1.executeBondMachineSettlement)(this, input),
49
- loadBond: async (input) => (0, bond_1.loadBond)(this, input),
52
+ define: async (input) => (0, bond_1.define)(this, input),
53
+ verify: async (input) => (0, bond_1.verify)(this, input),
54
+ load: async (input) => (0, bond_1.load)(this, input),
55
+ issue: async (input) => (0, bond_1.issue)(this, input),
56
+ prepareRedemption: async (input) => (0, bond_1.prepareRedemption)(this, input),
57
+ inspectRedemption: async (input) => (0, bond_1.inspectRedemption)(this, input),
58
+ executeRedemption: async (input) => (0, bond_1.executeRedemption)(this, input),
59
+ verifyRedemption: async (input) => (0, bond_1.verifyRedemption)(this, input),
60
+ buildSettlement: async (input) => (0, bond_1.buildSettlement)(this, input),
61
+ verifySettlement: async (input) => (0, bond_1.verifySettlement)(this, input),
62
+ prepareClosing: async (input) => (0, bond_1.prepareClosing)(this, input),
63
+ inspectClosing: async (input) => (0, bond_1.inspectClosing)(this, input),
64
+ executeClosing: async (input) => (0, bond_1.executeClosing)(this, input),
65
+ verifyClosing: async (input) => (0, bond_1.verifyClosing)(this, input),
66
+ exportEvidence: async (input) => (0, bond_1.exportEvidence)(this, input),
67
+ exportFinalityPayload: async (input) => (0, bond_1.exportFinalityPayload)(this, input),
68
+ };
69
+ this.funds = {
70
+ define: async (input) => (0, fund_1.define)(this, input),
71
+ verify: async (input) => (0, fund_1.verify)(this, input),
72
+ load: async (input) => (0, fund_1.load)(this, input),
73
+ prepareCapitalCall: async (input) => (0, fund_1.prepareCapitalCall)(this, input),
74
+ inspectCapitalCallClaim: async (input) => (0, fund_1.inspectCapitalCallClaim)(this, input),
75
+ executeCapitalCallClaim: async (input) => (0, fund_1.executeCapitalCallClaim)(this, input),
76
+ inspectCapitalCallRollover: async (input) => (0, fund_1.inspectCapitalCallRollover)(this, input),
77
+ executeCapitalCallRollover: async (input) => (0, fund_1.executeCapitalCallRollover)(this, input),
78
+ inspectCapitalCallRefund: async (input) => (0, fund_1.inspectCapitalCallRefund)(this, input),
79
+ executeCapitalCallRefund: async (input) => (0, fund_1.executeCapitalCallRefund)(this, input),
80
+ verifyCapitalCall: async (input) => (0, fund_1.verifyCapitalCall)(this, input),
81
+ signPositionReceipt: async (input) => (0, fund_1.signPositionReceipt)(this, input),
82
+ verifyPositionReceipt: async (input) => (0, fund_1.verifyPositionReceipt)(this, input),
83
+ prepareDistribution: async (input) => (0, fund_1.prepareDistribution)(this, input),
84
+ reconcilePosition: async (input) => (0, fund_1.reconcilePosition)(this, input),
85
+ inspectDistributionClaim: async (input) => (0, fund_1.inspectDistributionClaim)(this, input),
86
+ executeDistributionClaim: async (input) => (0, fund_1.executeDistributionClaim)(this, input),
87
+ verifyDistribution: async (input) => (0, fund_1.verifyDistribution)(this, input),
88
+ prepareClosing: async (input) => (0, fund_1.prepareClosing)(this, input),
89
+ verifyClosing: async (input) => (0, fund_1.verifyClosing)(this, input),
90
+ exportEvidence: async (input) => (0, fund_1.exportEvidence)(this, input),
91
+ exportFinalityPayload: async (input) => (0, fund_1.exportFinalityPayload)(this, input),
50
92
  };
51
93
  }
52
94
  async compileFromFile(input) {