@hazbase/simplicity 0.0.5 → 0.2.0
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.
- package/README.md +140 -1038
- package/dist/cli.js +3341 -269
- package/dist/client/SimplicityClient.d.ts +91 -290
- package/dist/client/SimplicityClient.js +93 -23
- package/dist/core/executor.js +67 -92
- package/dist/core/lineage.d.ts +18 -0
- package/dist/core/lineage.js +30 -0
- package/dist/core/outputBinding.d.ts +61 -0
- package/dist/core/outputBinding.js +552 -0
- package/dist/core/reporting.d.ts +22 -0
- package/dist/core/reporting.js +40 -0
- package/dist/core/schnorr.d.ts +5 -0
- package/dist/core/schnorr.js +46 -0
- package/dist/core/types.d.ts +799 -1
- package/dist/docs/definitions/bond-anchor.simf +19 -0
- package/dist/docs/definitions/bond-definition.json +10 -0
- package/dist/docs/definitions/bond-descriptor-bound-settlement-machine.simf +144 -0
- package/dist/docs/definitions/bond-issuance-anchor.simf +26 -0
- package/dist/docs/definitions/bond-issuance-state-partial-redemption.json +18 -0
- package/dist/docs/definitions/bond-issuance-state-redeemed.json +18 -0
- package/dist/docs/definitions/bond-issuance-state.json +12 -0
- package/dist/docs/definitions/bond-redemption-state-machine.simf +118 -0
- package/dist/docs/definitions/bond-redemption-transition.simf +41 -0
- package/dist/docs/definitions/bond-script-bound-settlement-machine.simf +142 -0
- package/dist/docs/definitions/fund-capital-call-open.simf +82 -0
- package/dist/docs/definitions/fund-capital-call-refund-only.simf +67 -0
- package/dist/docs/definitions/fund-capital-call-state.json +11 -0
- package/dist/docs/definitions/fund-definition.json +8 -0
- package/dist/docs/definitions/fund-distribution-claim.simf +57 -0
- package/dist/docs/definitions/receivable-definition.json +9 -0
- package/dist/docs/definitions/receivable-funding-claim.json +13 -0
- package/dist/docs/definitions/receivable-funding-claim.simf +58 -0
- package/dist/docs/definitions/receivable-repayment-claim.json +13 -0
- package/dist/docs/definitions/receivable-repayment-claim.simf +59 -0
- package/dist/docs/definitions/receivable-state-funded.json +20 -0
- package/dist/docs/definitions/receivable-state-originated.json +19 -0
- package/dist/docs/definitions/receivable-state-repaid.json +20 -0
- package/dist/docs/definitions/recursive-delay-direct-next.simf +60 -0
- package/dist/docs/definitions/recursive-delay-optional.simf +88 -0
- package/dist/docs/definitions/recursive-delay-required.simf +72 -0
- package/dist/docs/definitions/recursive-delay.simf +83 -0
- package/dist/docs/definitions/recursive-policy-transfer-machine.simf +65 -0
- package/dist/domain/bond.d.ts +8649 -720
- package/dist/domain/bond.js +1398 -8
- package/dist/domain/bondSettlementValidation.d.ts +2 -0
- package/dist/domain/bondSettlementValidation.js +28 -0
- package/dist/domain/bondValidation.d.ts +37 -1
- package/dist/domain/bondValidation.js +137 -11
- package/dist/domain/fund.d.ts +2452 -0
- package/dist/domain/fund.js +1756 -0
- package/dist/domain/fundValidation.d.ts +152 -0
- package/dist/domain/fundValidation.js +767 -0
- package/dist/domain/policies.d.ts +1064 -0
- package/dist/domain/policies.js +1625 -0
- package/dist/domain/receivable.d.ts +824 -0
- package/dist/domain/receivable.js +1375 -0
- package/dist/domain/receivableValidation.d.ts +147 -0
- package/dist/domain/receivableValidation.js +831 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +137 -21
- package/package.json +20 -2
|
@@ -1,305 +1,106 @@
|
|
|
1
|
+
import { evaluateOutputBindingSupport } from "../core/outputBinding";
|
|
1
2
|
import { ElementsRpcClient } from "../core/rpc";
|
|
2
|
-
import {
|
|
3
|
+
import { BondEvidenceBundle, OutputBindingSupportEvaluation, OutputBindingSupportMatrix, PolicyEvidenceBundle, ReceivableEvidenceBundle, 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 {
|
|
8
|
+
import { prepareRedemption, prepareClosing, exportFinalityPayload, buildSettlement, verifySettlement, define, executeClosing, executeRedemption, exportEvidence, inspectClosing, inspectRedemption, issue, load, verify, verifyIssuanceHistory, 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, verifyPositionReceiptChain, 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";
|
|
11
|
+
import { define as defineReceivable, exportEvidence as exportReceivableEvidence, exportFinalityPayload as exportReceivableFinalityPayload, executeFundingClaim as executeReceivableFundingClaim, executeRepaymentClaim as executeReceivableRepaymentClaim, inspectFundingClaim as inspectReceivableFundingClaim, inspectRepaymentClaim as inspectReceivableRepaymentClaim, load as loadReceivable, prepareClosing as prepareReceivableClosing, prepareFundingClaim as prepareReceivableFundingClaim, prepareFunding as prepareReceivableFunding, prepareRepaymentClaim as prepareReceivableRepaymentClaim, prepareRepayment as prepareReceivableRepayment, prepareWriteOff as prepareReceivableWriteOff, verify as verifyReceivable, verifyClosing as verifyReceivableClosing, verifyFundingClaim as verifyReceivableFundingClaim, verifyFunding as verifyReceivableFunding, verifyRepaymentClaim as verifyReceivableRepaymentClaim, verifyRepayment as verifyReceivableRepayment, verifyStateHistory as verifyReceivableStateHistory, verifyWriteOff as verifyReceivableWriteOff } from "../domain/receivable";
|
|
8
12
|
export declare class SimplicityClient {
|
|
9
13
|
readonly config: SimplicityClientConfig;
|
|
10
14
|
readonly rpc: ElementsRpcClient;
|
|
11
15
|
readonly payments: {
|
|
12
16
|
gaslessTransfer: (input: GaslessTransferInput) => Promise<GaslessTransferResult>;
|
|
13
17
|
};
|
|
18
|
+
readonly outputBinding: {
|
|
19
|
+
describeSupport: () => OutputBindingSupportMatrix;
|
|
20
|
+
evaluateSupport: (input: Parameters<typeof evaluateOutputBindingSupport>[0]) => OutputBindingSupportEvaluation;
|
|
21
|
+
};
|
|
22
|
+
readonly policies: {
|
|
23
|
+
listTemplates: () => ReturnType<typeof listPolicyTemplates>;
|
|
24
|
+
describeTemplate: (input: Parameters<typeof describePolicyTemplate>[0]) => ReturnType<typeof describePolicyTemplate>;
|
|
25
|
+
loadTemplateManifest: (input: Parameters<typeof loadPolicyTemplateManifest>[0]) => ReturnType<typeof loadPolicyTemplateManifest>;
|
|
26
|
+
validateTemplateManifest: (input: Parameters<typeof validatePolicyTemplateManifest>[0]) => PolicyTemplateManifestValidationResult;
|
|
27
|
+
validateTemplateParams: (input: Parameters<typeof validatePolicyTemplateParams>[0]) => ReturnType<typeof validatePolicyTemplateParams>;
|
|
28
|
+
buildOutputDescriptor: (input: Parameters<typeof buildPolicyOutputDescriptor>[1]) => ReturnType<typeof buildPolicyOutputDescriptor>;
|
|
29
|
+
issue: (input: Parameters<typeof issuePolicy>[1]) => ReturnType<typeof issuePolicy>;
|
|
30
|
+
prepareTransfer: (input: Parameters<typeof preparePolicyTransfer>[1]) => ReturnType<typeof preparePolicyTransfer>;
|
|
31
|
+
inspectTransfer: (input: Parameters<typeof inspectPolicyTransfer>[1]) => ReturnType<typeof inspectPolicyTransfer>;
|
|
32
|
+
executeTransfer: (input: Parameters<typeof executePolicyTransfer>[1]) => ReturnType<typeof executePolicyTransfer>;
|
|
33
|
+
verifyState: (input: Parameters<typeof verifyPolicyState>[1]) => ReturnType<typeof verifyPolicyState>;
|
|
34
|
+
verifyTransfer: (input: Parameters<typeof verifyPolicyTransfer>[1]) => ReturnType<typeof verifyPolicyTransfer>;
|
|
35
|
+
exportEvidence: (input: Parameters<typeof exportPolicyEvidence>[1]) => Promise<PolicyEvidenceBundle>;
|
|
36
|
+
};
|
|
14
37
|
readonly bonds: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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>;
|
|
38
|
+
define: (input: Parameters<typeof define>[1]) => ReturnType<typeof define>;
|
|
39
|
+
verify: (input: Parameters<typeof verify>[1]) => ReturnType<typeof verify>;
|
|
40
|
+
verifyIssuanceHistory: (input: Parameters<typeof verifyIssuanceHistory>[1]) => ReturnType<typeof verifyIssuanceHistory>;
|
|
41
|
+
load: (input: Parameters<typeof load>[1]) => ReturnType<typeof load>;
|
|
42
|
+
issue: (input: Parameters<typeof issue>[1]) => ReturnType<typeof issue>;
|
|
43
|
+
prepareRedemption: (input: Parameters<typeof prepareRedemption>[1]) => ReturnType<typeof prepareRedemption>;
|
|
44
|
+
inspectRedemption: (input: Parameters<typeof inspectRedemption>[1]) => ReturnType<typeof inspectRedemption>;
|
|
45
|
+
executeRedemption: (input: Parameters<typeof executeRedemption>[1]) => ReturnType<typeof executeRedemption>;
|
|
46
|
+
verifyRedemption: (input: Parameters<typeof verifyRedemption>[1]) => ReturnType<typeof verifyRedemption>;
|
|
47
|
+
buildSettlement: (input: Parameters<typeof buildSettlement>[1]) => ReturnType<typeof buildSettlement>;
|
|
48
|
+
verifySettlement: (input: Parameters<typeof verifySettlement>[1]) => ReturnType<typeof verifySettlement>;
|
|
49
|
+
prepareClosing: (input: Parameters<typeof prepareClosing>[1]) => ReturnType<typeof prepareClosing>;
|
|
50
|
+
inspectClosing: (input: Parameters<typeof inspectClosing>[1]) => ReturnType<typeof inspectClosing>;
|
|
51
|
+
executeClosing: (input: Parameters<typeof executeClosing>[1]) => ReturnType<typeof executeClosing>;
|
|
52
|
+
verifyClosing: (input: Parameters<typeof verifyClosing>[1]) => ReturnType<typeof verifyClosing>;
|
|
53
|
+
exportEvidence: (input: Parameters<typeof exportEvidence>[1]) => Promise<BondEvidenceBundle>;
|
|
54
|
+
exportFinalityPayload: (input: Parameters<typeof exportFinalityPayload>[1]) => ReturnType<typeof exportFinalityPayload>;
|
|
55
|
+
};
|
|
56
|
+
readonly funds: {
|
|
57
|
+
define: (input: Parameters<typeof defineFund>[1]) => ReturnType<typeof defineFund>;
|
|
58
|
+
verify: (input: Parameters<typeof verifyFund>[1]) => ReturnType<typeof verifyFund>;
|
|
59
|
+
load: (input: Parameters<typeof loadFund>[1]) => ReturnType<typeof loadFund>;
|
|
60
|
+
prepareCapitalCall: (input: Parameters<typeof prepareCapitalCall>[1]) => ReturnType<typeof prepareCapitalCall>;
|
|
61
|
+
inspectCapitalCallClaim: (input: Parameters<typeof inspectCapitalCallClaim>[1]) => ReturnType<typeof inspectCapitalCallClaim>;
|
|
62
|
+
executeCapitalCallClaim: (input: Parameters<typeof executeCapitalCallClaim>[1]) => ReturnType<typeof executeCapitalCallClaim>;
|
|
63
|
+
inspectCapitalCallRollover: (input: Parameters<typeof inspectCapitalCallRollover>[1]) => ReturnType<typeof inspectCapitalCallRollover>;
|
|
64
|
+
executeCapitalCallRollover: (input: Parameters<typeof executeCapitalCallRollover>[1]) => ReturnType<typeof executeCapitalCallRollover>;
|
|
65
|
+
inspectCapitalCallRefund: (input: Parameters<typeof inspectCapitalCallRefund>[1]) => ReturnType<typeof inspectCapitalCallRefund>;
|
|
66
|
+
executeCapitalCallRefund: (input: Parameters<typeof executeCapitalCallRefund>[1]) => ReturnType<typeof executeCapitalCallRefund>;
|
|
67
|
+
verifyCapitalCall: (input: Parameters<typeof verifyCapitalCall>[1]) => ReturnType<typeof verifyCapitalCall>;
|
|
68
|
+
signPositionReceipt: (input: Parameters<typeof signPositionReceipt>[1]) => ReturnType<typeof signPositionReceipt>;
|
|
69
|
+
verifyPositionReceipt: (input: Parameters<typeof verifyPositionReceipt>[1]) => ReturnType<typeof verifyPositionReceipt>;
|
|
70
|
+
verifyPositionReceiptChain: (input: Parameters<typeof verifyPositionReceiptChain>[1]) => ReturnType<typeof verifyPositionReceiptChain>;
|
|
71
|
+
prepareDistribution: (input: Parameters<typeof prepareDistribution>[1]) => ReturnType<typeof prepareDistribution>;
|
|
72
|
+
reconcilePosition: (input: Parameters<typeof reconcilePosition>[1]) => ReturnType<typeof reconcilePosition>;
|
|
73
|
+
inspectDistributionClaim: (input: Parameters<typeof inspectDistributionClaim>[1]) => ReturnType<typeof inspectDistributionClaim>;
|
|
74
|
+
executeDistributionClaim: (input: Parameters<typeof executeDistributionClaim>[1]) => ReturnType<typeof executeDistributionClaim>;
|
|
75
|
+
verifyDistribution: (input: Parameters<typeof verifyDistribution>[1]) => ReturnType<typeof verifyDistribution>;
|
|
76
|
+
prepareClosing: (input: Parameters<typeof prepareFundClosing>[1]) => ReturnType<typeof prepareFundClosing>;
|
|
77
|
+
verifyClosing: (input: Parameters<typeof verifyFundClosing>[1]) => ReturnType<typeof verifyFundClosing>;
|
|
78
|
+
exportEvidence: (input: Parameters<typeof exportFundEvidence>[1]) => ReturnType<typeof exportFundEvidence>;
|
|
79
|
+
exportFinalityPayload: (input: Parameters<typeof exportFundFinalityPayload>[1]) => ReturnType<typeof exportFundFinalityPayload>;
|
|
80
|
+
};
|
|
81
|
+
readonly receivables: {
|
|
82
|
+
define: (input: Parameters<typeof defineReceivable>[1]) => ReturnType<typeof defineReceivable>;
|
|
83
|
+
verify: (input: Parameters<typeof verifyReceivable>[1]) => ReturnType<typeof verifyReceivable>;
|
|
84
|
+
load: (input: Parameters<typeof loadReceivable>[1]) => ReturnType<typeof loadReceivable>;
|
|
85
|
+
prepareFunding: (input: Parameters<typeof prepareReceivableFunding>[1]) => ReturnType<typeof prepareReceivableFunding>;
|
|
86
|
+
verifyFunding: (input: Parameters<typeof verifyReceivableFunding>[1]) => ReturnType<typeof verifyReceivableFunding>;
|
|
87
|
+
prepareFundingClaim: (input: Parameters<typeof prepareReceivableFundingClaim>[1]) => ReturnType<typeof prepareReceivableFundingClaim>;
|
|
88
|
+
inspectFundingClaim: (input: Parameters<typeof inspectReceivableFundingClaim>[1]) => ReturnType<typeof inspectReceivableFundingClaim>;
|
|
89
|
+
executeFundingClaim: (input: Parameters<typeof executeReceivableFundingClaim>[1]) => ReturnType<typeof executeReceivableFundingClaim>;
|
|
90
|
+
verifyFundingClaim: (input: Parameters<typeof verifyReceivableFundingClaim>[1]) => ReturnType<typeof verifyReceivableFundingClaim>;
|
|
91
|
+
prepareRepayment: (input: Parameters<typeof prepareReceivableRepayment>[1]) => ReturnType<typeof prepareReceivableRepayment>;
|
|
92
|
+
verifyRepayment: (input: Parameters<typeof verifyReceivableRepayment>[1]) => ReturnType<typeof verifyReceivableRepayment>;
|
|
93
|
+
prepareRepaymentClaim: (input: Parameters<typeof prepareReceivableRepaymentClaim>[1]) => ReturnType<typeof prepareReceivableRepaymentClaim>;
|
|
94
|
+
inspectRepaymentClaim: (input: Parameters<typeof inspectReceivableRepaymentClaim>[1]) => ReturnType<typeof inspectReceivableRepaymentClaim>;
|
|
95
|
+
executeRepaymentClaim: (input: Parameters<typeof executeReceivableRepaymentClaim>[1]) => ReturnType<typeof executeReceivableRepaymentClaim>;
|
|
96
|
+
verifyRepaymentClaim: (input: Parameters<typeof verifyReceivableRepaymentClaim>[1]) => ReturnType<typeof verifyReceivableRepaymentClaim>;
|
|
97
|
+
prepareWriteOff: (input: Parameters<typeof prepareReceivableWriteOff>[1]) => ReturnType<typeof prepareReceivableWriteOff>;
|
|
98
|
+
verifyWriteOff: (input: Parameters<typeof verifyReceivableWriteOff>[1]) => ReturnType<typeof verifyReceivableWriteOff>;
|
|
99
|
+
prepareClosing: (input: Parameters<typeof prepareReceivableClosing>[1]) => ReturnType<typeof prepareReceivableClosing>;
|
|
100
|
+
verifyClosing: (input: Parameters<typeof verifyReceivableClosing>[1]) => ReturnType<typeof verifyReceivableClosing>;
|
|
101
|
+
verifyStateHistory: (input: Parameters<typeof verifyReceivableStateHistory>[1]) => ReturnType<typeof verifyReceivableStateHistory>;
|
|
102
|
+
exportEvidence: (input: Parameters<typeof exportReceivableEvidence>[1]) => Promise<ReceivableEvidenceBundle>;
|
|
103
|
+
exportFinalityPayload: (input: Parameters<typeof exportReceivableFinalityPayload>[1]) => ReturnType<typeof exportReceivableFinalityPayload>;
|
|
303
104
|
};
|
|
304
105
|
constructor(config: SimplicityClientConfig);
|
|
305
106
|
compileFromFile(input: CompileFromFileInput): Promise<CompiledContract>;
|
|
@@ -7,46 +7,116 @@ 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");
|
|
18
|
+
const receivable_1 = require("../domain/receivable");
|
|
15
19
|
class SimplicityClient {
|
|
16
20
|
config;
|
|
17
21
|
rpc;
|
|
18
22
|
payments;
|
|
23
|
+
outputBinding;
|
|
24
|
+
policies;
|
|
19
25
|
bonds;
|
|
26
|
+
funds;
|
|
27
|
+
receivables;
|
|
20
28
|
constructor(config) {
|
|
21
29
|
this.config = config;
|
|
22
30
|
this.rpc = new rpc_1.ElementsRpcClient(config.rpc);
|
|
23
31
|
this.payments = {
|
|
24
32
|
gaslessTransfer: async (input) => this.gaslessTransfer(input),
|
|
25
33
|
};
|
|
34
|
+
this.outputBinding = {
|
|
35
|
+
describeSupport: () => (0, outputBinding_1.describeOutputBindingSupport)(),
|
|
36
|
+
evaluateSupport: (input) => (0, outputBinding_1.evaluateOutputBindingSupport)(input),
|
|
37
|
+
};
|
|
38
|
+
this.policies = {
|
|
39
|
+
listTemplates: () => (0, policies_1.listPolicyTemplates)(),
|
|
40
|
+
describeTemplate: (input) => (0, policies_1.describePolicyTemplate)(input),
|
|
41
|
+
loadTemplateManifest: async (input) => (0, policies_1.loadPolicyTemplateManifest)(input),
|
|
42
|
+
validateTemplateManifest: (input) => (0, policies_1.validatePolicyTemplateManifest)(input),
|
|
43
|
+
validateTemplateParams: (input) => (0, policies_1.validatePolicyTemplateParams)(input),
|
|
44
|
+
buildOutputDescriptor: async (input) => (0, policies_1.buildPolicyOutputDescriptor)(this, input),
|
|
45
|
+
issue: async (input) => (0, policies_1.issue)(this, input),
|
|
46
|
+
prepareTransfer: async (input) => (0, policies_1.prepareTransfer)(this, input),
|
|
47
|
+
inspectTransfer: async (input) => (0, policies_1.inspectTransfer)(this, input),
|
|
48
|
+
executeTransfer: async (input) => (0, policies_1.executeTransfer)(this, input),
|
|
49
|
+
verifyState: async (input) => (0, policies_1.verifyState)(this, input),
|
|
50
|
+
verifyTransfer: async (input) => (0, policies_1.verifyTransfer)(this, input),
|
|
51
|
+
exportEvidence: async (input) => (0, policies_1.exportEvidence)(this, input),
|
|
52
|
+
};
|
|
26
53
|
this.bonds = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
define: async (input) => (0, bond_1.define)(this, input),
|
|
55
|
+
verify: async (input) => (0, bond_1.verify)(this, input),
|
|
56
|
+
verifyIssuanceHistory: async (input) => (0, bond_1.verifyIssuanceHistory)(this, input),
|
|
57
|
+
load: async (input) => (0, bond_1.load)(this, input),
|
|
58
|
+
issue: async (input) => (0, bond_1.issue)(this, input),
|
|
59
|
+
prepareRedemption: async (input) => (0, bond_1.prepareRedemption)(this, input),
|
|
60
|
+
inspectRedemption: async (input) => (0, bond_1.inspectRedemption)(this, input),
|
|
61
|
+
executeRedemption: async (input) => (0, bond_1.executeRedemption)(this, input),
|
|
62
|
+
verifyRedemption: async (input) => (0, bond_1.verifyRedemption)(this, input),
|
|
63
|
+
buildSettlement: async (input) => (0, bond_1.buildSettlement)(this, input),
|
|
64
|
+
verifySettlement: async (input) => (0, bond_1.verifySettlement)(this, input),
|
|
65
|
+
prepareClosing: async (input) => (0, bond_1.prepareClosing)(this, input),
|
|
66
|
+
inspectClosing: async (input) => (0, bond_1.inspectClosing)(this, input),
|
|
67
|
+
executeClosing: async (input) => (0, bond_1.executeClosing)(this, input),
|
|
68
|
+
verifyClosing: async (input) => (0, bond_1.verifyClosing)(this, input),
|
|
69
|
+
exportEvidence: async (input) => (0, bond_1.exportEvidence)(this, input),
|
|
70
|
+
exportFinalityPayload: async (input) => (0, bond_1.exportFinalityPayload)(this, input),
|
|
71
|
+
};
|
|
72
|
+
this.funds = {
|
|
73
|
+
define: async (input) => (0, fund_1.define)(this, input),
|
|
74
|
+
verify: async (input) => (0, fund_1.verify)(this, input),
|
|
75
|
+
load: async (input) => (0, fund_1.load)(this, input),
|
|
76
|
+
prepareCapitalCall: async (input) => (0, fund_1.prepareCapitalCall)(this, input),
|
|
77
|
+
inspectCapitalCallClaim: async (input) => (0, fund_1.inspectCapitalCallClaim)(this, input),
|
|
78
|
+
executeCapitalCallClaim: async (input) => (0, fund_1.executeCapitalCallClaim)(this, input),
|
|
79
|
+
inspectCapitalCallRollover: async (input) => (0, fund_1.inspectCapitalCallRollover)(this, input),
|
|
80
|
+
executeCapitalCallRollover: async (input) => (0, fund_1.executeCapitalCallRollover)(this, input),
|
|
81
|
+
inspectCapitalCallRefund: async (input) => (0, fund_1.inspectCapitalCallRefund)(this, input),
|
|
82
|
+
executeCapitalCallRefund: async (input) => (0, fund_1.executeCapitalCallRefund)(this, input),
|
|
83
|
+
verifyCapitalCall: async (input) => (0, fund_1.verifyCapitalCall)(this, input),
|
|
84
|
+
signPositionReceipt: async (input) => (0, fund_1.signPositionReceipt)(this, input),
|
|
85
|
+
verifyPositionReceipt: async (input) => (0, fund_1.verifyPositionReceipt)(this, input),
|
|
86
|
+
verifyPositionReceiptChain: async (input) => (0, fund_1.verifyPositionReceiptChain)(this, input),
|
|
87
|
+
prepareDistribution: async (input) => (0, fund_1.prepareDistribution)(this, input),
|
|
88
|
+
reconcilePosition: async (input) => (0, fund_1.reconcilePosition)(this, input),
|
|
89
|
+
inspectDistributionClaim: async (input) => (0, fund_1.inspectDistributionClaim)(this, input),
|
|
90
|
+
executeDistributionClaim: async (input) => (0, fund_1.executeDistributionClaim)(this, input),
|
|
91
|
+
verifyDistribution: async (input) => (0, fund_1.verifyDistribution)(this, input),
|
|
92
|
+
prepareClosing: async (input) => (0, fund_1.prepareClosing)(this, input),
|
|
93
|
+
verifyClosing: async (input) => (0, fund_1.verifyClosing)(this, input),
|
|
94
|
+
exportEvidence: async (input) => (0, fund_1.exportEvidence)(this, input),
|
|
95
|
+
exportFinalityPayload: async (input) => (0, fund_1.exportFinalityPayload)(this, input),
|
|
96
|
+
};
|
|
97
|
+
this.receivables = {
|
|
98
|
+
define: async (input) => (0, receivable_1.define)(this, input),
|
|
99
|
+
verify: async (input) => (0, receivable_1.verify)(this, input),
|
|
100
|
+
load: async (input) => (0, receivable_1.load)(this, input),
|
|
101
|
+
prepareFunding: async (input) => (0, receivable_1.prepareFunding)(this, input),
|
|
102
|
+
verifyFunding: async (input) => (0, receivable_1.verifyFunding)(this, input),
|
|
103
|
+
prepareFundingClaim: async (input) => (0, receivable_1.prepareFundingClaim)(this, input),
|
|
104
|
+
inspectFundingClaim: async (input) => (0, receivable_1.inspectFundingClaim)(this, input),
|
|
105
|
+
executeFundingClaim: async (input) => (0, receivable_1.executeFundingClaim)(this, input),
|
|
106
|
+
verifyFundingClaim: async (input) => (0, receivable_1.verifyFundingClaim)(this, input),
|
|
107
|
+
prepareRepayment: async (input) => (0, receivable_1.prepareRepayment)(this, input),
|
|
108
|
+
verifyRepayment: async (input) => (0, receivable_1.verifyRepayment)(this, input),
|
|
109
|
+
prepareRepaymentClaim: async (input) => (0, receivable_1.prepareRepaymentClaim)(this, input),
|
|
110
|
+
inspectRepaymentClaim: async (input) => (0, receivable_1.inspectRepaymentClaim)(this, input),
|
|
111
|
+
executeRepaymentClaim: async (input) => (0, receivable_1.executeRepaymentClaim)(this, input),
|
|
112
|
+
verifyRepaymentClaim: async (input) => (0, receivable_1.verifyRepaymentClaim)(this, input),
|
|
113
|
+
prepareWriteOff: async (input) => (0, receivable_1.prepareWriteOff)(this, input),
|
|
114
|
+
verifyWriteOff: async (input) => (0, receivable_1.verifyWriteOff)(this, input),
|
|
115
|
+
prepareClosing: async (input) => (0, receivable_1.prepareClosing)(this, input),
|
|
116
|
+
verifyClosing: async (input) => (0, receivable_1.verifyClosing)(this, input),
|
|
117
|
+
verifyStateHistory: async (input) => (0, receivable_1.verifyStateHistory)(this, input),
|
|
118
|
+
exportEvidence: async (input) => (0, receivable_1.exportEvidence)(this, input),
|
|
119
|
+
exportFinalityPayload: async (input) => (0, receivable_1.exportFinalityPayload)(this, input),
|
|
50
120
|
};
|
|
51
121
|
}
|
|
52
122
|
async compileFromFile(input) {
|