@hazbase/simplicity 0.0.4 → 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.
- package/README.md +679 -42
- package/dist/cli.js +2268 -5
- package/dist/client/SimplicityClient.d.ts +64 -25
- package/dist/client/SimplicityClient.js +65 -3
- package/dist/core/executor.js +67 -92
- package/dist/core/outputBinding.d.ts +61 -0
- package/dist/core/outputBinding.js +552 -0
- package/dist/core/schnorr.d.ts +5 -0
- package/dist/core/schnorr.js +34 -0
- package/dist/core/types.d.ts +586 -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 +33 -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/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 +9855 -1
- package/dist/domain/bond.js +2156 -1
- package/dist/domain/bondSettlementValidation.d.ts +20 -0
- package/dist/domain/bondSettlementValidation.js +150 -0
- package/dist/domain/bondValidation.d.ts +26 -0
- package/dist/domain/bondValidation.js +278 -3
- package/dist/domain/fund.d.ts +2069 -0
- package/dist/domain/fund.js +1384 -0
- package/dist/domain/fundValidation.d.ts +122 -0
- package/dist/domain/fundValidation.js +635 -0
- package/dist/domain/policies.d.ts +1051 -0
- package/dist/domain/policies.js +1605 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +92 -1
- package/package.json +15 -2
package/dist/core/types.d.ts
CHANGED
|
@@ -153,6 +153,51 @@ export interface ArtifactStateMetadata {
|
|
|
153
153
|
sourceVerified: boolean;
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
+
export type BondIssuanceStatus = "ISSUED" | "PARTIALLY_REDEEMED" | "REDEEMED" | "CLOSED";
|
|
157
|
+
export type BondTransitionType = "ISSUE" | "REDEEM";
|
|
158
|
+
export type BondOutputBindingMode = "none" | "script-bound" | "descriptor-bound";
|
|
159
|
+
export type PropagationMode = "required" | "optional" | "none";
|
|
160
|
+
export type OutputBindingReasonCode = "OK_EXPLICIT" | "OK_RAW_OUTPUT" | "OK_MANUAL_HASH" | "OK_SCRIPT_BOUND" | "OK_NONE" | "FALLBACK_UNSUPPORTED_ASSET" | "FALLBACK_UNSUPPORTED_OUTPUT_FORM" | "FALLBACK_MISSING_HASH_INPUT" | "FALLBACK_INCOMPLETE_RAW_OUTPUT" | "FALLBACK_INVALID_RAW_OUTPUT";
|
|
161
|
+
export type OutputBindingSupportedForm = "explicit-v1" | "raw-output-v1" | "unsupported";
|
|
162
|
+
export type OutputAssetForm = "explicit" | "confidential";
|
|
163
|
+
export type OutputAmountForm = "explicit" | "confidential";
|
|
164
|
+
export type OutputNonceForm = "null" | "confidential";
|
|
165
|
+
export type OutputRangeProofForm = "empty" | "non-empty";
|
|
166
|
+
export interface OutputForm {
|
|
167
|
+
assetForm: OutputAssetForm;
|
|
168
|
+
amountForm: OutputAmountForm;
|
|
169
|
+
nonceForm: OutputNonceForm;
|
|
170
|
+
rangeProofForm: OutputRangeProofForm;
|
|
171
|
+
}
|
|
172
|
+
export interface OutputRawFields {
|
|
173
|
+
assetBytesHex: string;
|
|
174
|
+
amountBytesHex: string;
|
|
175
|
+
nonceBytesHex: string;
|
|
176
|
+
scriptPubKeyHex?: string;
|
|
177
|
+
scriptPubKeyHashHex?: string;
|
|
178
|
+
rangeProofHex?: string;
|
|
179
|
+
rangeProofHashHex?: string;
|
|
180
|
+
}
|
|
181
|
+
export interface OutputBindingInputs {
|
|
182
|
+
assetId: string;
|
|
183
|
+
assetForm: OutputAssetForm;
|
|
184
|
+
amountForm: OutputAmountForm;
|
|
185
|
+
nonceForm: OutputNonceForm;
|
|
186
|
+
rangeProofForm: OutputRangeProofForm;
|
|
187
|
+
nextAmountSat: number;
|
|
188
|
+
nextOutputIndex: number;
|
|
189
|
+
feeIndex: number;
|
|
190
|
+
maxFeeSat: number;
|
|
191
|
+
rawOutputComponents?: {
|
|
192
|
+
scriptPubKey: "raw-bytes" | "hash";
|
|
193
|
+
rangeProof: "raw-bytes" | "hash";
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
export interface BondStateTransition {
|
|
197
|
+
type: BondTransitionType;
|
|
198
|
+
amount: number;
|
|
199
|
+
at: string;
|
|
200
|
+
}
|
|
156
201
|
export interface DeploymentInfo {
|
|
157
202
|
contractAddress: string;
|
|
158
203
|
internalKey: string;
|
|
@@ -194,6 +239,7 @@ export interface CallBaseInput {
|
|
|
194
239
|
periodId?: string;
|
|
195
240
|
bondDefinitionId?: string;
|
|
196
241
|
sequence?: number;
|
|
242
|
+
locktimeHeight?: number;
|
|
197
243
|
witness?: WitnessConfig;
|
|
198
244
|
}
|
|
199
245
|
export interface InspectCallInput extends CallBaseInput {
|
|
@@ -280,6 +326,7 @@ export interface GaslessExecuteInput {
|
|
|
280
326
|
contractChangeAddress?: string;
|
|
281
327
|
sponsorChangeAddress?: string;
|
|
282
328
|
utxoPolicy?: UtxoPolicy;
|
|
329
|
+
locktimeHeight?: number;
|
|
283
330
|
broadcast?: boolean;
|
|
284
331
|
}
|
|
285
332
|
export interface GaslessExecuteResult {
|
|
@@ -342,7 +389,545 @@ export interface BondIssuanceState {
|
|
|
342
389
|
currencyAssetId: string;
|
|
343
390
|
controllerXonly: string;
|
|
344
391
|
issuedAt: string;
|
|
345
|
-
status:
|
|
392
|
+
status: BondIssuanceStatus;
|
|
393
|
+
previousStateHash?: string | null;
|
|
394
|
+
lastTransition?: BondStateTransition;
|
|
395
|
+
closedAt?: string;
|
|
396
|
+
closingReason?: "REDEEMED" | "CANCELLED" | "MATURED_OUT";
|
|
397
|
+
finalSettlementDescriptorHash?: string;
|
|
398
|
+
}
|
|
399
|
+
export interface BondSettlementDescriptor {
|
|
400
|
+
settlementId: string;
|
|
401
|
+
bondId: string;
|
|
402
|
+
issuanceId: string;
|
|
403
|
+
definitionHash: string;
|
|
404
|
+
previousStateHash: string;
|
|
405
|
+
nextStateHash: string;
|
|
406
|
+
previousStatus: BondIssuanceStatus;
|
|
407
|
+
nextStatus: BondIssuanceStatus;
|
|
408
|
+
transitionKind: BondTransitionType;
|
|
409
|
+
redeemAmount: number;
|
|
410
|
+
transitionAt: string;
|
|
411
|
+
assetId: string;
|
|
412
|
+
nextContractAddress: string;
|
|
413
|
+
nextAmountSat: number;
|
|
414
|
+
maxFeeSat: number;
|
|
415
|
+
expectedOutputDescriptorHash?: string;
|
|
416
|
+
outputBindingMode?: BondOutputBindingMode;
|
|
417
|
+
principal: {
|
|
418
|
+
issued: number;
|
|
419
|
+
previousOutstanding: number;
|
|
420
|
+
nextOutstanding: number;
|
|
421
|
+
previousRedeemed: number;
|
|
422
|
+
nextRedeemed: number;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
export interface BondExpectedOutputDescriptor {
|
|
426
|
+
nextContractAddress: string;
|
|
427
|
+
nextOutputHash?: string;
|
|
428
|
+
nextOutputScriptHash?: string;
|
|
429
|
+
nextAmountSat: number;
|
|
430
|
+
assetId: string;
|
|
431
|
+
requestedOutputBindingMode?: BondOutputBindingMode;
|
|
432
|
+
outputForm?: OutputForm;
|
|
433
|
+
rawOutput?: Partial<OutputRawFields>;
|
|
434
|
+
feeIndex: number;
|
|
435
|
+
nextOutputIndex: number;
|
|
436
|
+
maxFeeSat: number;
|
|
437
|
+
outputBindingMode?: BondOutputBindingMode;
|
|
438
|
+
}
|
|
439
|
+
export interface BondClosingDescriptor {
|
|
440
|
+
closingId: string;
|
|
441
|
+
bondId: string;
|
|
442
|
+
issuanceId: string;
|
|
443
|
+
previousStateHash: string;
|
|
444
|
+
closedStateHash: string;
|
|
445
|
+
finalStatus: "CLOSED";
|
|
446
|
+
closingReason: "REDEEMED" | "CANCELLED" | "MATURED_OUT";
|
|
447
|
+
closedAt: string;
|
|
448
|
+
definitionHash: string;
|
|
449
|
+
stateHash: string;
|
|
450
|
+
finalSettlementDescriptorHash: string;
|
|
451
|
+
}
|
|
452
|
+
export interface BondVerificationReport {
|
|
453
|
+
artifactTrust: {
|
|
454
|
+
definition: DefinitionVerificationResult["trust"];
|
|
455
|
+
state: StateVerificationResult["trust"];
|
|
456
|
+
};
|
|
457
|
+
stateTrust: StateVerificationResult["trust"];
|
|
458
|
+
settlementTrust?: {
|
|
459
|
+
descriptorHashMatch: boolean;
|
|
460
|
+
outputBindingMode: BondOutputBindingMode;
|
|
461
|
+
};
|
|
462
|
+
outputBindingTrust?: {
|
|
463
|
+
mode: BondOutputBindingMode;
|
|
464
|
+
requestedMode?: BondOutputBindingMode;
|
|
465
|
+
supportedForm?: OutputBindingSupportedForm;
|
|
466
|
+
nextContractAddressCommitted: boolean;
|
|
467
|
+
expectedOutputDescriptorCommitted: boolean;
|
|
468
|
+
settlementDescriptorCommitted?: boolean;
|
|
469
|
+
outputCountRuntimeBound: boolean;
|
|
470
|
+
feeIndexRuntimeBound: boolean;
|
|
471
|
+
nextOutputHashRuntimeBound?: boolean;
|
|
472
|
+
nextOutputScriptRuntimeBound: boolean;
|
|
473
|
+
amountRuntimeBound: boolean;
|
|
474
|
+
reasonCode?: OutputBindingReasonCode;
|
|
475
|
+
autoDerived?: boolean;
|
|
476
|
+
fallbackReason?: string;
|
|
477
|
+
bindingInputs?: OutputBindingInputs;
|
|
478
|
+
};
|
|
479
|
+
arithmeticTrust?: {
|
|
480
|
+
principalArithmeticCommitted: boolean;
|
|
481
|
+
principalArithmeticValid: boolean;
|
|
482
|
+
statusProgressionCommitted: boolean;
|
|
483
|
+
statusProgressionValid: boolean;
|
|
484
|
+
};
|
|
485
|
+
closingTrust?: {
|
|
486
|
+
finalStatusValid: boolean;
|
|
487
|
+
finalSettlementDescriptorHashMatch: boolean;
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
export interface BondEvidenceBundle {
|
|
491
|
+
artifact: SimplicityArtifact;
|
|
492
|
+
definition: {
|
|
493
|
+
canonicalJson: string;
|
|
494
|
+
hash: string;
|
|
495
|
+
};
|
|
496
|
+
issuance: {
|
|
497
|
+
canonicalJson: string;
|
|
498
|
+
hash: string;
|
|
499
|
+
};
|
|
500
|
+
transition?: {
|
|
501
|
+
canonicalJson: string;
|
|
502
|
+
hash: string;
|
|
503
|
+
};
|
|
504
|
+
settlement?: {
|
|
505
|
+
canonicalJson: string;
|
|
506
|
+
hash: string;
|
|
507
|
+
};
|
|
508
|
+
closing?: {
|
|
509
|
+
canonicalJson: string;
|
|
510
|
+
hash: string;
|
|
511
|
+
};
|
|
512
|
+
trust: BondVerificationReport;
|
|
513
|
+
renderedSourceHash?: string;
|
|
514
|
+
sourceVerificationMode: "source-reloaded" | "artifact-only";
|
|
515
|
+
compiled: {
|
|
516
|
+
program: string;
|
|
517
|
+
cmr: string;
|
|
518
|
+
contractAddress: string;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
export type CapitalCallStatus = "OPEN" | "CLAIMED" | "REFUND_ONLY" | "REFUNDED";
|
|
522
|
+
export type CapitalCallStage = "open" | "claimed" | "refund-only" | "refunded";
|
|
523
|
+
export type CapitalCallCutoffMode = "rollover-window";
|
|
524
|
+
export type LPPositionReceiptStatus = "ACTIVE" | "PARTIALLY_DISTRIBUTED" | "FULLY_DISTRIBUTED" | "CLOSED";
|
|
525
|
+
export type FundClosingReason = "LIQUIDATED" | "CANCELLED" | "WRITTEN_OFF";
|
|
526
|
+
export type FundVerificationReportSchemaVersion = "fund-verification-report/v1";
|
|
527
|
+
export type FundEvidenceBundleSchemaVersion = "fund-evidence-bundle/v1";
|
|
528
|
+
export type FundFinalityPayloadSchemaVersion = "fund-finality-payload/v1";
|
|
529
|
+
export type LPPositionReceiptSchemaVersion = "lp-position-receipt/v2";
|
|
530
|
+
export type LPPositionReceiptAttestationScheme = "bip340-sha256";
|
|
531
|
+
export interface FundDefinition {
|
|
532
|
+
fundId: string;
|
|
533
|
+
managerEntityId: string;
|
|
534
|
+
managerXonly: string;
|
|
535
|
+
currencyAssetId: string;
|
|
536
|
+
jurisdiction?: string;
|
|
537
|
+
vintage?: string;
|
|
538
|
+
}
|
|
539
|
+
export interface CapitalCallState {
|
|
540
|
+
callId: string;
|
|
541
|
+
fundId: string;
|
|
542
|
+
lpId: string;
|
|
543
|
+
currencyAssetId: string;
|
|
544
|
+
amount: number;
|
|
545
|
+
lpXonly: string;
|
|
546
|
+
managerXonly: string;
|
|
547
|
+
status: CapitalCallStatus;
|
|
548
|
+
fundedAt?: string;
|
|
549
|
+
claimedAt?: string;
|
|
550
|
+
refundedAt?: string;
|
|
551
|
+
previousStateHash?: string | null;
|
|
552
|
+
claimCutoffHeight: number;
|
|
553
|
+
}
|
|
554
|
+
export interface LPPositionReceipt {
|
|
555
|
+
schemaVersion: LPPositionReceiptSchemaVersion;
|
|
556
|
+
positionId: string;
|
|
557
|
+
fundId: string;
|
|
558
|
+
lpId: string;
|
|
559
|
+
callId: string;
|
|
560
|
+
currencyAssetId: string;
|
|
561
|
+
lpXonly: string;
|
|
562
|
+
sequence: number;
|
|
563
|
+
committedAmount: number;
|
|
564
|
+
fundedAmount: number;
|
|
565
|
+
distributedAmount: number;
|
|
566
|
+
distributionCount: number;
|
|
567
|
+
effectiveAt: string;
|
|
568
|
+
lastDistributedAt?: string;
|
|
569
|
+
status: LPPositionReceiptStatus;
|
|
570
|
+
previousReceiptHash?: string | null;
|
|
571
|
+
}
|
|
572
|
+
export interface LPPositionReceiptAttestation {
|
|
573
|
+
positionReceiptHash: string;
|
|
574
|
+
sequence: number;
|
|
575
|
+
managerXonly: string;
|
|
576
|
+
signedAt: string;
|
|
577
|
+
signature: string;
|
|
578
|
+
scheme: LPPositionReceiptAttestationScheme;
|
|
579
|
+
}
|
|
580
|
+
export interface LPPositionReceiptEnvelope {
|
|
581
|
+
receipt: LPPositionReceipt;
|
|
582
|
+
attestation: LPPositionReceiptAttestation;
|
|
583
|
+
}
|
|
584
|
+
export interface DistributionDescriptor {
|
|
585
|
+
distributionId: string;
|
|
586
|
+
positionId: string;
|
|
587
|
+
fundId: string;
|
|
588
|
+
lpId: string;
|
|
589
|
+
assetId: string;
|
|
590
|
+
amountSat: number;
|
|
591
|
+
approvedAt: string;
|
|
592
|
+
positionReceiptHash: string;
|
|
593
|
+
}
|
|
594
|
+
export interface FundPayoutDescriptor {
|
|
595
|
+
receiverAddress: string;
|
|
596
|
+
nextOutputHash?: string;
|
|
597
|
+
nextOutputScriptHash?: string;
|
|
598
|
+
amountSat: number;
|
|
599
|
+
assetId: string;
|
|
600
|
+
requestedOutputBindingMode?: BondOutputBindingMode;
|
|
601
|
+
outputForm?: OutputForm;
|
|
602
|
+
rawOutput?: Partial<OutputRawFields>;
|
|
603
|
+
feeIndex: number;
|
|
604
|
+
nextOutputIndex: number;
|
|
605
|
+
maxFeeSat: number;
|
|
606
|
+
outputBindingMode: BondOutputBindingMode;
|
|
607
|
+
}
|
|
608
|
+
export interface FundClosingDescriptor {
|
|
609
|
+
closingId: string;
|
|
610
|
+
fundId: string;
|
|
611
|
+
lpId: string;
|
|
612
|
+
positionId: string;
|
|
613
|
+
positionReceiptHash: string;
|
|
614
|
+
finalDistributionHashes: string[];
|
|
615
|
+
closedAt: string;
|
|
616
|
+
closingReason: FundClosingReason;
|
|
617
|
+
}
|
|
618
|
+
export interface FundVerificationReport {
|
|
619
|
+
schemaVersion: FundVerificationReportSchemaVersion;
|
|
620
|
+
artifactTrust?: {
|
|
621
|
+
definition: DefinitionVerificationResult["trust"];
|
|
622
|
+
state: StateVerificationResult["trust"];
|
|
623
|
+
};
|
|
624
|
+
stateTrust?: StateVerificationResult["trust"];
|
|
625
|
+
capitalCallTrust?: {
|
|
626
|
+
capitalCallStage: CapitalCallStage;
|
|
627
|
+
cutoffMode: CapitalCallCutoffMode;
|
|
628
|
+
fundIdMatch: boolean;
|
|
629
|
+
currencyMatch: boolean;
|
|
630
|
+
managerMatch: boolean;
|
|
631
|
+
claimCutoffCommitted: boolean;
|
|
632
|
+
lpCommitted: boolean;
|
|
633
|
+
managerCommitted: boolean;
|
|
634
|
+
claimPathRuntimeAvailable: boolean;
|
|
635
|
+
refundPathRuntimeAvailable: boolean;
|
|
636
|
+
statusValid: boolean;
|
|
637
|
+
};
|
|
638
|
+
distributionTrust?: {
|
|
639
|
+
fundIdMatch: boolean;
|
|
640
|
+
lpIdMatch: boolean;
|
|
641
|
+
positionIdMatch: boolean;
|
|
642
|
+
positionReceiptHashMatch: boolean;
|
|
643
|
+
positionStatusEligible: boolean;
|
|
644
|
+
};
|
|
645
|
+
outputBindingTrust?: {
|
|
646
|
+
mode: BondOutputBindingMode;
|
|
647
|
+
requestedMode?: BondOutputBindingMode;
|
|
648
|
+
supportedForm?: OutputBindingSupportedForm;
|
|
649
|
+
nextReceiverRuntimeCommitted: boolean;
|
|
650
|
+
outputCountRuntimeBound: boolean;
|
|
651
|
+
feeIndexRuntimeBound: boolean;
|
|
652
|
+
nextOutputHashRuntimeBound?: boolean;
|
|
653
|
+
nextOutputScriptRuntimeBound: boolean;
|
|
654
|
+
amountRuntimeBound: boolean;
|
|
655
|
+
reasonCode?: OutputBindingReasonCode;
|
|
656
|
+
autoDerived?: boolean;
|
|
657
|
+
fallbackReason?: string;
|
|
658
|
+
bindingInputs?: OutputBindingInputs;
|
|
659
|
+
};
|
|
660
|
+
receiptTrust?: {
|
|
661
|
+
generated: boolean;
|
|
662
|
+
positionReceiptHash?: string;
|
|
663
|
+
positionStatus: LPPositionReceiptStatus;
|
|
664
|
+
attested: boolean;
|
|
665
|
+
attestationVerified: boolean;
|
|
666
|
+
sequence?: number;
|
|
667
|
+
sequenceMonotonic?: boolean;
|
|
668
|
+
attestingSignerMatch?: boolean;
|
|
669
|
+
};
|
|
670
|
+
closingTrust?: {
|
|
671
|
+
positionReceiptHashMatch: boolean;
|
|
672
|
+
finalDistributionHashesPresent: boolean;
|
|
673
|
+
positionStatusEligible: boolean;
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
export interface FundEvidenceBundle {
|
|
677
|
+
schemaVersion: FundEvidenceBundleSchemaVersion;
|
|
678
|
+
artifact?: SimplicityArtifact;
|
|
679
|
+
definition: {
|
|
680
|
+
canonicalJson: string;
|
|
681
|
+
hash: string;
|
|
682
|
+
};
|
|
683
|
+
capitalCall?: {
|
|
684
|
+
canonicalJson: string;
|
|
685
|
+
hash: string;
|
|
686
|
+
};
|
|
687
|
+
positionReceipt?: {
|
|
688
|
+
canonicalJson: string;
|
|
689
|
+
hash: string;
|
|
690
|
+
};
|
|
691
|
+
positionReceiptEnvelope?: {
|
|
692
|
+
canonicalJson: string;
|
|
693
|
+
hash: string;
|
|
694
|
+
};
|
|
695
|
+
distribution?: {
|
|
696
|
+
canonicalJson: string;
|
|
697
|
+
hash: string;
|
|
698
|
+
};
|
|
699
|
+
distributions?: Array<{
|
|
700
|
+
canonicalJson: string;
|
|
701
|
+
hash: string;
|
|
702
|
+
}>;
|
|
703
|
+
closing?: {
|
|
704
|
+
canonicalJson: string;
|
|
705
|
+
hash: string;
|
|
706
|
+
};
|
|
707
|
+
trust: FundVerificationReport;
|
|
708
|
+
renderedSourceHash?: string;
|
|
709
|
+
sourceVerificationMode: "source-reloaded" | "artifact-only";
|
|
710
|
+
compiled?: {
|
|
711
|
+
program: string;
|
|
712
|
+
cmr: string;
|
|
713
|
+
contractAddress: string;
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
export interface FundFinalityPayload {
|
|
717
|
+
schemaVersion: FundFinalityPayloadSchemaVersion;
|
|
718
|
+
fundId: string;
|
|
719
|
+
lpId: string;
|
|
720
|
+
callId?: string;
|
|
721
|
+
positionId?: string;
|
|
722
|
+
definitionHash: string;
|
|
723
|
+
capitalCallStateHash?: string | null;
|
|
724
|
+
positionReceiptHash?: string | null;
|
|
725
|
+
positionReceiptEnvelopeHash?: string | null;
|
|
726
|
+
distributionHash?: string | null;
|
|
727
|
+
distributionHashes?: string[] | null;
|
|
728
|
+
closingHash?: string | null;
|
|
729
|
+
bindingMode: BondOutputBindingMode;
|
|
730
|
+
trust: FundVerificationReport;
|
|
731
|
+
trustSummary: {
|
|
732
|
+
definition?: DefinitionVerificationResult["trust"];
|
|
733
|
+
state?: StateVerificationResult["trust"];
|
|
734
|
+
bindingMode: BondOutputBindingMode;
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
export interface PolicyReceiver {
|
|
738
|
+
mode: "plain" | "policy";
|
|
739
|
+
address?: string;
|
|
740
|
+
recipientXonly?: string;
|
|
741
|
+
defaultPolicyTemplateId?: string;
|
|
742
|
+
defaultParams?: Record<string, string | number | boolean>;
|
|
743
|
+
}
|
|
744
|
+
export interface PolicyTemplateDocument {
|
|
745
|
+
policyTemplateId: string;
|
|
746
|
+
description?: string;
|
|
747
|
+
metadata?: Record<string, unknown>;
|
|
748
|
+
}
|
|
749
|
+
export type PolicyTemplateManifestVersion = "policy-template-manifest/v1";
|
|
750
|
+
export type PolicyVerificationReportSchemaVersion = "policy-verification-report/v1";
|
|
751
|
+
export type PolicyEvidenceBundleSchemaVersion = "policy-evidence-bundle/v1";
|
|
752
|
+
export type PolicyOutputBindingReasonCode = OutputBindingReasonCode;
|
|
753
|
+
export type PolicyOutputBindingSupportedForm = OutputBindingSupportedForm;
|
|
754
|
+
export type PolicyOutputAssetForm = OutputAssetForm;
|
|
755
|
+
export type PolicyOutputAmountForm = OutputAmountForm;
|
|
756
|
+
export type PolicyOutputNonceForm = OutputNonceForm;
|
|
757
|
+
export type PolicyOutputRangeProofForm = OutputRangeProofForm;
|
|
758
|
+
export type PolicyTemplateManifestValidationReasonCode = "OK" | "MANIFEST_VERSION_UNSUPPORTED" | "MANIFEST_FIELD_REQUIRED" | "MANIFEST_FIELD_INVALID" | "MANIFEST_PARAMETER_SCHEMA_INVALID" | "MANIFEST_BINDING_MODE_INVALID" | "MANIFEST_PROPAGATION_MODE_INVALID";
|
|
759
|
+
export interface PolicyTemplateManifest {
|
|
760
|
+
templateId: string;
|
|
761
|
+
manifestVersion: PolicyTemplateManifestVersion;
|
|
762
|
+
title: string;
|
|
763
|
+
description: string;
|
|
764
|
+
stateSimfPath: string;
|
|
765
|
+
directStateSimfPath?: string;
|
|
766
|
+
parameterSchema: Record<string, "string" | "number" | "boolean">;
|
|
767
|
+
supportedBindingModes: BondOutputBindingMode[];
|
|
768
|
+
supportsPlainExit: boolean;
|
|
769
|
+
defaultPropagationMode: PropagationMode;
|
|
770
|
+
}
|
|
771
|
+
export interface PolicyTemplateInput {
|
|
772
|
+
templateId?: string;
|
|
773
|
+
manifestPath?: string;
|
|
774
|
+
manifestValue?: PolicyTemplateManifest;
|
|
775
|
+
jsonPath?: string;
|
|
776
|
+
value?: unknown;
|
|
777
|
+
stateSimfPath?: string;
|
|
778
|
+
directStateSimfPath?: string;
|
|
779
|
+
transferMachineSimfPath?: string;
|
|
780
|
+
}
|
|
781
|
+
export interface PolicyState {
|
|
782
|
+
policyTemplateId: string;
|
|
783
|
+
policyHash: string;
|
|
784
|
+
recipient: string;
|
|
785
|
+
amountSat: number;
|
|
786
|
+
assetId: string;
|
|
787
|
+
params: Record<string, string | number | boolean>;
|
|
788
|
+
propagationMode: PropagationMode;
|
|
789
|
+
previousStateHash?: string | null;
|
|
790
|
+
hop: number;
|
|
791
|
+
status: "LOCKED" | "SPENT";
|
|
792
|
+
}
|
|
793
|
+
export interface PolicyOutputDescriptor {
|
|
794
|
+
nextContractAddress: string;
|
|
795
|
+
nextOutputHash?: string;
|
|
796
|
+
nextOutputScriptHash?: string;
|
|
797
|
+
nextAmountSat: number;
|
|
798
|
+
assetId: string;
|
|
799
|
+
requestedOutputBindingMode?: BondOutputBindingMode;
|
|
800
|
+
outputForm?: OutputForm;
|
|
801
|
+
rawOutput?: Partial<OutputRawFields>;
|
|
802
|
+
feeIndex: number;
|
|
803
|
+
nextOutputIndex: number;
|
|
804
|
+
maxFeeSat: number;
|
|
805
|
+
outputBindingMode: BondOutputBindingMode;
|
|
806
|
+
}
|
|
807
|
+
export interface PolicyTransferDescriptor {
|
|
808
|
+
policyTemplateId: string;
|
|
809
|
+
previousPolicyHash: string;
|
|
810
|
+
nextPolicyHash?: string | null;
|
|
811
|
+
previousStateHash: string;
|
|
812
|
+
nextStateHash?: string | null;
|
|
813
|
+
propagationMode: PropagationMode;
|
|
814
|
+
plainExitAddress?: string | null;
|
|
815
|
+
outputDescriptor?: PolicyOutputDescriptor;
|
|
816
|
+
}
|
|
817
|
+
export interface PolicyVerificationReport {
|
|
818
|
+
schemaVersion: PolicyVerificationReportSchemaVersion;
|
|
819
|
+
templateTrust?: DefinitionVerificationResult["trust"];
|
|
820
|
+
stateTrust: StateVerificationResult["trust"];
|
|
821
|
+
propagationMode: PropagationMode;
|
|
822
|
+
nextPolicyRequired: boolean;
|
|
823
|
+
nextPolicyPresent: boolean;
|
|
824
|
+
plainExitAllowed: boolean;
|
|
825
|
+
outputBinding?: {
|
|
826
|
+
mode: BondOutputBindingMode;
|
|
827
|
+
supportedForm: PolicyOutputBindingSupportedForm;
|
|
828
|
+
committed: boolean;
|
|
829
|
+
runtimeBound: boolean;
|
|
830
|
+
sdkVerified: boolean;
|
|
831
|
+
amountRuntimeBound: boolean;
|
|
832
|
+
nextOutputHashRuntimeBound: boolean;
|
|
833
|
+
nextOutputScriptRuntimeBound: boolean;
|
|
834
|
+
reasonCode: PolicyOutputBindingReasonCode;
|
|
835
|
+
nextOutputHash?: string;
|
|
836
|
+
autoDerived?: boolean;
|
|
837
|
+
fallbackReason?: string;
|
|
838
|
+
bindingInputs?: OutputBindingInputs;
|
|
839
|
+
};
|
|
840
|
+
enforcement: "sdk-path" | "conditional-hop" | "direct-hop";
|
|
841
|
+
}
|
|
842
|
+
export interface PolicyEvidenceBundle {
|
|
843
|
+
schemaVersion: PolicyEvidenceBundleSchemaVersion;
|
|
844
|
+
artifact: SimplicityArtifact;
|
|
845
|
+
template: {
|
|
846
|
+
canonicalJson: string;
|
|
847
|
+
hash: string;
|
|
848
|
+
};
|
|
849
|
+
state: {
|
|
850
|
+
canonicalJson: string;
|
|
851
|
+
hash: string;
|
|
852
|
+
};
|
|
853
|
+
transfer?: {
|
|
854
|
+
canonicalJson: string;
|
|
855
|
+
hash: string;
|
|
856
|
+
};
|
|
857
|
+
report: PolicyVerificationReport;
|
|
858
|
+
renderedSourceHash?: string;
|
|
859
|
+
sourceVerificationMode: "source-reloaded" | "artifact-only";
|
|
860
|
+
compiled: {
|
|
861
|
+
program: string;
|
|
862
|
+
cmr: string;
|
|
863
|
+
contractAddress: string;
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
export interface OutputBindingSupportMatrix {
|
|
867
|
+
supportedForms: Array<{
|
|
868
|
+
form: OutputBindingSupportedForm;
|
|
869
|
+
description: string;
|
|
870
|
+
autoDerived: boolean;
|
|
871
|
+
}>;
|
|
872
|
+
unsupportedOutputFeatures: Array<{
|
|
873
|
+
feature: string;
|
|
874
|
+
description: string;
|
|
875
|
+
fallbackReasonCode: Extract<OutputBindingReasonCode, "FALLBACK_UNSUPPORTED_ASSET" | "FALLBACK_UNSUPPORTED_OUTPUT_FORM">;
|
|
876
|
+
manualHashSupported: boolean;
|
|
877
|
+
}>;
|
|
878
|
+
outputBindingModes: Record<BondOutputBindingMode, {
|
|
879
|
+
description: string;
|
|
880
|
+
runtimeBinding: "none" | "script-hash" | "output-hash";
|
|
881
|
+
fallbackBehavior: string;
|
|
882
|
+
}>;
|
|
883
|
+
autoDeriveConditions: {
|
|
884
|
+
assetInput: string[];
|
|
885
|
+
amountForm: string;
|
|
886
|
+
nonceForm: string;
|
|
887
|
+
rangeProofForm: string;
|
|
888
|
+
rawOutputFields?: string[];
|
|
889
|
+
rawOutputFieldAlternatives?: Record<string, string[]>;
|
|
890
|
+
outputHashExclusions?: string[];
|
|
891
|
+
};
|
|
892
|
+
manualHashPath: {
|
|
893
|
+
supported: boolean;
|
|
894
|
+
description: string;
|
|
895
|
+
};
|
|
896
|
+
fallbackBehavior: {
|
|
897
|
+
defaultMode: BondOutputBindingMode;
|
|
898
|
+
reasonCodes: OutputBindingReasonCode[];
|
|
899
|
+
};
|
|
900
|
+
publicValidationMatrix: {
|
|
901
|
+
local: string[];
|
|
902
|
+
testnet: string[];
|
|
903
|
+
};
|
|
904
|
+
nonGoals: string[];
|
|
905
|
+
}
|
|
906
|
+
export type PolicyBindingSupportMatrix = OutputBindingSupportMatrix;
|
|
907
|
+
export interface OutputBindingSupportEvaluation {
|
|
908
|
+
requestedBindingMode: BondOutputBindingMode;
|
|
909
|
+
resolvedBindingMode: BondOutputBindingMode;
|
|
910
|
+
supportedForm: OutputBindingSupportedForm;
|
|
911
|
+
reasonCode: OutputBindingReasonCode;
|
|
912
|
+
autoDerived: boolean;
|
|
913
|
+
fallbackReason?: string;
|
|
914
|
+
assetId: string;
|
|
915
|
+
outputForm: OutputForm;
|
|
916
|
+
unsupportedFeatures: string[];
|
|
917
|
+
explicitAssetInputSupported: boolean;
|
|
918
|
+
manualHashSupplied: boolean;
|
|
919
|
+
nextOutputScriptAvailable: boolean;
|
|
920
|
+
rawOutputProvided?: boolean;
|
|
921
|
+
rawOutputComponents?: {
|
|
922
|
+
scriptPubKey: "raw-bytes" | "hash";
|
|
923
|
+
rangeProof: "raw-bytes" | "hash";
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
export interface PolicyTemplateManifestValidationResult {
|
|
927
|
+
ok: boolean;
|
|
928
|
+
reasonCode: PolicyTemplateManifestValidationReasonCode;
|
|
929
|
+
reason?: string;
|
|
930
|
+
manifest?: PolicyTemplateManifest;
|
|
346
931
|
}
|
|
347
932
|
export interface WaitForFundingInput {
|
|
348
933
|
minAmountSat?: number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Bond definition hash anchor via executed logic.
|
|
3
|
+
*/
|
|
4
|
+
fn not(bit: bool) -> bool {
|
|
5
|
+
<u1>::into(jet::complement_1(<bool>::into(bit)))
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
fn require_definition_anchor() {
|
|
9
|
+
let anchored_definition_hash: u256 = 0x{{DEFINITION_HASH}};
|
|
10
|
+
let zero_hash: u256 = 0x0000000000000000000000000000000000000000000000000000000000000000;
|
|
11
|
+
assert!(not(jet::eq_256(anchored_definition_hash, zero_hash)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
fn main() {
|
|
15
|
+
require_definition_anchor();
|
|
16
|
+
jet::check_lock_height({{MIN_HEIGHT}});
|
|
17
|
+
let signer: Pubkey = 0x{{SIGNER_XONLY}};
|
|
18
|
+
jet::bip_0340_verify((signer, jet::sig_all_hash()), witness::SIGNER_SIGNATURE)
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bondId": "BOND-2026-001",
|
|
3
|
+
"issuer": "Hazbase Treasury",
|
|
4
|
+
"faceValue": 1000000,
|
|
5
|
+
"couponBps": 500,
|
|
6
|
+
"issueDate": "2026-03-10",
|
|
7
|
+
"maturityDate": 2344430,
|
|
8
|
+
"currencyAssetId": "bitcoin",
|
|
9
|
+
"controllerXonly": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"
|
|
10
|
+
}
|