@gvnrdao/dh-sdk 0.0.131 → 0.0.143

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/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ethers, DeferredTopicFilter, EventFragment, EventLog as EventLog$1, ContractTransactionResponse, FunctionFragment, ContractTransaction, LogDescription, Typed, TransactionRequest, BaseContract, ContractRunner, Listener, BigNumberish, BytesLike, AddressLike, ContractMethod, Interface, Result as Result$2, Wallet, providers } from 'ethers';
2
2
  import { LitNetwork, LitOps } from '@gvnrdao/dh-lit-ops';
3
+ export { DiamondHandsLitActions, LitActionName } from '@gvnrdao/dh-lit-actions';
3
4
 
4
5
  /**
5
6
  * Result type for standardized error handling across the SDK
@@ -337,9 +338,9 @@ interface ContractAddresses {
337
338
  communityManager?: string;
338
339
  liquidationManager?: string;
339
340
  ucdToken: string;
340
- btcProofValidator: string;
341
341
  priceFeedConsumer: string;
342
342
  operationAuthorizationRegistry?: string;
343
+ btcProofValidator?: string;
343
344
  mockUsdcToken?: string;
344
345
  mockUsdcOwner?: string;
345
346
  mockUsdtToken?: string;
@@ -417,13 +418,23 @@ interface BaseSDKConfig {
417
418
  maxContextKeys?: number;
418
419
  verboseInProduction?: boolean;
419
420
  };
420
- validatorVersion?: number;
421
+ validators: {
422
+ /** Validator version for position creation (createPosition) - usually v1 for PKP security validation */
423
+ loanCreation: number;
424
+ /** Validator version for UCD minting (mintUCD) - usually v4 for business rules validation */
425
+ minting: number;
426
+ /** Validator version for partial payments (makePayment) - usually v1 for payment validation */
427
+ payment: number;
428
+ /** Validator version for loan extension/renewal (extendPosition) - usually v4 for extension validation */
429
+ extension: number;
430
+ };
421
431
  defaultSelectedTermMonths?: number;
422
432
  telegram?: {
423
433
  chatId: string;
424
434
  chatToken: string;
425
435
  threadId?: number;
426
436
  };
437
+ temperSignaturesTest?: boolean;
427
438
  }
428
439
  /**
429
440
  * Service Mode Configuration
@@ -611,29 +622,6 @@ declare namespace IPositionManagerCore {
611
622
  };
612
623
  }
613
624
  declare namespace IPositionManager {
614
- type PKPPositionDataStruct = {
615
- positionId: BytesLike;
616
- borrower: AddressLike;
617
- amount: BigNumberish;
618
- requestedCollateralRatio: BigNumberish;
619
- selectedTerm: BigNumberish;
620
- createdAt: BigNumberish;
621
- };
622
- type PKPPositionDataStructOutput = [
623
- positionId: string,
624
- borrower: string,
625
- amount: bigint,
626
- requestedCollateralRatio: bigint,
627
- selectedTerm: bigint,
628
- createdAt: bigint
629
- ] & {
630
- positionId: string;
631
- borrower: string;
632
- amount: bigint;
633
- requestedCollateralRatio: bigint;
634
- selectedTerm: bigint;
635
- createdAt: bigint;
636
- };
637
625
  type PositionStruct = {
638
626
  positionId: BytesLike;
639
627
  pkpId: BytesLike;
@@ -673,6 +661,7 @@ declare namespace ICollateralManager {
673
661
  actionHash: BytesLike;
674
662
  authorizedSpendsHash: BytesLike;
675
663
  ucdDebtHash: BytesLike;
664
+ contractBundleHash: BytesLike;
676
665
  withdrawalAddress: string;
677
666
  totalDeduction: BigNumberish;
678
667
  newCollateral: BigNumberish;
@@ -686,6 +675,7 @@ declare namespace ICollateralManager {
686
675
  actionHash: string,
687
676
  authorizedSpendsHash: string,
688
677
  ucdDebtHash: string,
678
+ contractBundleHash: string,
689
679
  withdrawalAddress: string,
690
680
  totalDeduction: bigint,
691
681
  newCollateral: bigint,
@@ -698,6 +688,7 @@ declare namespace ICollateralManager {
698
688
  actionHash: string;
699
689
  authorizedSpendsHash: string;
700
690
  ucdDebtHash: string;
691
+ contractBundleHash: string;
701
692
  withdrawalAddress: string;
702
693
  totalDeduction: bigint;
703
694
  newCollateral: bigint;
@@ -708,8 +699,8 @@ declare namespace ICollateralManager {
708
699
  };
709
700
  }
710
701
  interface PositionManagerInterface extends Interface {
711
- getFunction(nameOrSignature: "ADMIN_ROLE" | "COMMUNITY_FEE_DISTRIBUTOR_ROLE" | "COMMUNITY_MINTER_ROLE" | "DEFAULT_ADMIN_ROLE" | "EMERGENCY_PAUSE_ROLE" | "LIQUIDATOR_ROLE" | "ORACLE_UPDATER_ROLE" | "UPGRADE_INTERFACE_VERSION" | "VERSION" | "_performExtensionValidation" | "admin" | "authorizationRegistry" | "calculateCollateralRatio" | "circuitBreaker" | "clearExtensionPending" | "collateral" | "commitLiquidation" | "communityManager" | "core" | "createPosition" | "extendPosition" | "getExpiredLoanLiquidationThreshold" | "getPKPLoanParams" | "getPKPPositionData" | "getPositionDetails" | "getPositionStatus" | "getRoleAdmin" | "grantRole" | "hasRole" | "initialize" | "isExpiredLoanLiquidatable" | "liquidatePosition" | "liquidation" | "loanOps" | "makePartialPayment" | "paused" | "pkpValidationRegistry" | "proxiableUUID" | "renounceRole" | "repayPosition" | "revealAndLiquidate" | "revokeRole" | "setAuthorizationRegistry" | "setPKPValidationRegistry" | "supportsInterface" | "termManager" | "updateDebtFromLoanOps" | "updateModules" | "updatePosition" | "updatePositionStatusFromLoanOps" | "upgradeToAndCall" | "validatePKPLogic" | "validateUpgrade" | "views" | "withdrawBTC"): FunctionFragment;
712
- getEvent(nameOrSignatureOrTopic: "CollateralRatioUpdated" | "ExtensionPendingCleared" | "Initialized" | "IntegrityCheckFailed" | "ModulesUpdatedBatch" | "PKPLogicValidated" | "PKPValidationRegistryUpdated" | "PartialPaymentMade" | "Paused" | "PositionClosed" | "PositionCreated" | "PositionLiquidated" | "PositionRenewed" | "PositionRepaid" | "PositionStatusUpdated" | "PositionUpdated" | "RoleAdminChanged" | "RoleGranted" | "RoleRevoked" | "UCDMinted" | "Unpaused" | "Upgraded"): EventFragment;
702
+ getFunction(nameOrSignature: "ADMIN_ROLE" | "COMMUNITY_FEE_DISTRIBUTOR_ROLE" | "COMMUNITY_MINTER_ROLE" | "DEFAULT_ADMIN_ROLE" | "EMERGENCY_PAUSE_ROLE" | "LIQUIDATOR_ROLE" | "ORACLE_UPDATER_ROLE" | "UPGRADE_INTERFACE_VERSION" | "VERSION" | "_performExtensionValidation" | "admin" | "authorizationRegistry" | "circuitBreaker" | "clearExtensionPending" | "collateral" | "commitLiquidation" | "communityManager" | "computeMintMessageHash" | "core" | "createPosition" | "extendPosition" | "getExpiredLoanLiquidationThreshold" | "getMintMessageHashParameters" | "getPositionById" | "getPositionByPkp" | "getRoleAdmin" | "grantRole" | "hasRole" | "initialize" | "isExpiredLoanLiquidatable" | "isExtensionPending" | "liquidatePosition" | "liquidation" | "loanOps" | "makePayment" | "mintUCD" | "paused" | "pkpValidationRegistry" | "proxiableUUID" | "renounceRole" | "revealAndLiquidate" | "revokeRole" | "setAuthorizationRegistry" | "setPKPValidationRegistry" | "supportsInterface" | "termManager" | "updateBalance" | "updateDebtFromLoanOps" | "updateModules" | "updatePositionStatusFromLoanOps" | "upgradeToAndCall" | "verifyAuthorization" | "views" | "withdrawBTC"): FunctionFragment;
703
+ getEvent(nameOrSignatureOrTopic: "BalanceConfirmed" | "ExtensionPendingCleared" | "Initialized" | "ModulesUpdatedBatch" | "PKPLogicValidated" | "PKPValidationRegistryUpdated" | "PartialPaymentMade" | "Paused" | "PositionClosed" | "PositionCreated" | "PositionLiquidated" | "PositionRenewed" | "PositionRepaid" | "PositionStatusUpdated" | "PositionUpdated" | "RoleAdminChanged" | "RoleGranted" | "RoleRevoked" | "UCDMinted" | "Unpaused" | "Upgraded"): EventFragment;
713
704
  encodeFunctionData(functionFragment: "ADMIN_ROLE", values?: undefined): string;
714
705
  encodeFunctionData(functionFragment: "COMMUNITY_FEE_DISTRIBUTOR_ROLE", values?: undefined): string;
715
706
  encodeFunctionData(functionFragment: "COMMUNITY_MINTER_ROLE", values?: undefined): string;
@@ -719,23 +710,46 @@ interface PositionManagerInterface extends Interface {
719
710
  encodeFunctionData(functionFragment: "ORACLE_UPDATER_ROLE", values?: undefined): string;
720
711
  encodeFunctionData(functionFragment: "UPGRADE_INTERFACE_VERSION", values?: undefined): string;
721
712
  encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
722
- encodeFunctionData(functionFragment: "_performExtensionValidation", values: [IPositionManagerCore.PositionStruct, BigNumberish, BigNumberish]): string;
713
+ encodeFunctionData(functionFragment: "_performExtensionValidation", values: [
714
+ IPositionManagerCore.PositionStruct,
715
+ BigNumberish,
716
+ BigNumberish,
717
+ BigNumberish
718
+ ]): string;
723
719
  encodeFunctionData(functionFragment: "admin", values?: undefined): string;
724
720
  encodeFunctionData(functionFragment: "authorizationRegistry", values?: undefined): string;
725
- encodeFunctionData(functionFragment: "calculateCollateralRatio", values: [BytesLike]): string;
726
721
  encodeFunctionData(functionFragment: "circuitBreaker", values?: undefined): string;
727
722
  encodeFunctionData(functionFragment: "clearExtensionPending", values: [BytesLike]): string;
728
723
  encodeFunctionData(functionFragment: "collateral", values?: undefined): string;
729
- encodeFunctionData(functionFragment: "commitLiquidation", values: [BytesLike, BytesLike]): string;
724
+ encodeFunctionData(functionFragment: "commitLiquidation", values: [BytesLike, BigNumberish, BigNumberish, BytesLike]): string;
730
725
  encodeFunctionData(functionFragment: "communityManager", values?: undefined): string;
726
+ encodeFunctionData(functionFragment: "computeMintMessageHash", values: [
727
+ BytesLike,
728
+ BytesLike,
729
+ BytesLike,
730
+ BytesLike,
731
+ BytesLike,
732
+ BigNumberish,
733
+ BigNumberish,
734
+ BigNumberish,
735
+ BigNumberish,
736
+ BigNumberish,
737
+ BigNumberish
738
+ ]): string;
731
739
  encodeFunctionData(functionFragment: "core", values?: undefined): string;
732
740
  encodeFunctionData(functionFragment: "createPosition", values: [BytesLike, BytesLike, string, string, BigNumberish, BigNumberish]): string;
733
- encodeFunctionData(functionFragment: "extendPosition", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish, BytesLike]): string;
741
+ encodeFunctionData(functionFragment: "extendPosition", values: [
742
+ BytesLike,
743
+ BigNumberish,
744
+ BigNumberish,
745
+ BigNumberish,
746
+ BigNumberish,
747
+ BytesLike
748
+ ]): string;
734
749
  encodeFunctionData(functionFragment: "getExpiredLoanLiquidationThreshold", values: [BytesLike]): string;
735
- encodeFunctionData(functionFragment: "getPKPLoanParams", values: [BytesLike]): string;
736
- encodeFunctionData(functionFragment: "getPKPPositionData", values: [BytesLike]): string;
737
- encodeFunctionData(functionFragment: "getPositionDetails", values: [BytesLike]): string;
738
- encodeFunctionData(functionFragment: "getPositionStatus", values: [BytesLike]): string;
750
+ encodeFunctionData(functionFragment: "getMintMessageHashParameters", values?: undefined): string;
751
+ encodeFunctionData(functionFragment: "getPositionById", values: [BytesLike]): string;
752
+ encodeFunctionData(functionFragment: "getPositionByPkp", values: [BytesLike]): string;
739
753
  encodeFunctionData(functionFragment: "getRoleAdmin", values: [BytesLike]): string;
740
754
  encodeFunctionData(functionFragment: "grantRole", values: [BytesLike, AddressLike]): string;
741
755
  encodeFunctionData(functionFragment: "hasRole", values: [BytesLike, AddressLike]): string;
@@ -752,21 +766,35 @@ interface PositionManagerInterface extends Interface {
752
766
  AddressLike
753
767
  ]): string;
754
768
  encodeFunctionData(functionFragment: "isExpiredLoanLiquidatable", values: [BytesLike, BigNumberish, BigNumberish]): string;
755
- encodeFunctionData(functionFragment: "liquidatePosition", values: [BytesLike]): string;
769
+ encodeFunctionData(functionFragment: "isExtensionPending", values: [BytesLike]): string;
770
+ encodeFunctionData(functionFragment: "liquidatePosition", values: [BytesLike, BigNumberish, BigNumberish, BytesLike]): string;
756
771
  encodeFunctionData(functionFragment: "liquidation", values?: undefined): string;
757
772
  encodeFunctionData(functionFragment: "loanOps", values?: undefined): string;
758
- encodeFunctionData(functionFragment: "makePartialPayment", values: [BytesLike, BigNumberish]): string;
773
+ encodeFunctionData(functionFragment: "makePayment", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish, BytesLike]): string;
774
+ encodeFunctionData(functionFragment: "mintUCD", values: [
775
+ BytesLike,
776
+ BigNumberish,
777
+ BigNumberish,
778
+ BigNumberish,
779
+ BigNumberish,
780
+ BigNumberish,
781
+ BytesLike,
782
+ BytesLike,
783
+ BytesLike,
784
+ BigNumberish,
785
+ BytesLike
786
+ ]): string;
759
787
  encodeFunctionData(functionFragment: "paused", values?: undefined): string;
760
788
  encodeFunctionData(functionFragment: "pkpValidationRegistry", values?: undefined): string;
761
789
  encodeFunctionData(functionFragment: "proxiableUUID", values?: undefined): string;
762
790
  encodeFunctionData(functionFragment: "renounceRole", values: [BytesLike, AddressLike]): string;
763
- encodeFunctionData(functionFragment: "repayPosition", values: [BytesLike, BigNumberish]): string;
764
- encodeFunctionData(functionFragment: "revealAndLiquidate", values: [BytesLike, BigNumberish, BigNumberish]): string;
791
+ encodeFunctionData(functionFragment: "revealAndLiquidate", values: [BytesLike, BigNumberish, BigNumberish, BytesLike, BigNumberish]): string;
765
792
  encodeFunctionData(functionFragment: "revokeRole", values: [BytesLike, AddressLike]): string;
766
793
  encodeFunctionData(functionFragment: "setAuthorizationRegistry", values: [AddressLike]): string;
767
794
  encodeFunctionData(functionFragment: "setPKPValidationRegistry", values: [AddressLike]): string;
768
795
  encodeFunctionData(functionFragment: "supportsInterface", values: [BytesLike]): string;
769
796
  encodeFunctionData(functionFragment: "termManager", values?: undefined): string;
797
+ encodeFunctionData(functionFragment: "updateBalance", values: [BytesLike, BigNumberish, BigNumberish, BytesLike]): string;
770
798
  encodeFunctionData(functionFragment: "updateDebtFromLoanOps", values: [BytesLike, BigNumberish, BigNumberish]): string;
771
799
  encodeFunctionData(functionFragment: "updateModules", values: [
772
800
  AddressLike,
@@ -777,11 +805,9 @@ interface PositionManagerInterface extends Interface {
777
805
  AddressLike,
778
806
  AddressLike
779
807
  ]): string;
780
- encodeFunctionData(functionFragment: "updatePosition", values: [BytesLike, BigNumberish]): string;
781
808
  encodeFunctionData(functionFragment: "updatePositionStatusFromLoanOps", values: [BytesLike, BigNumberish]): string;
782
809
  encodeFunctionData(functionFragment: "upgradeToAndCall", values: [AddressLike, BytesLike]): string;
783
- encodeFunctionData(functionFragment: "validatePKPLogic", values: [BytesLike]): string;
784
- encodeFunctionData(functionFragment: "validateUpgrade", values: [AddressLike]): string;
810
+ encodeFunctionData(functionFragment: "verifyAuthorization", values: [BytesLike, BytesLike, BytesLike]): string;
785
811
  encodeFunctionData(functionFragment: "views", values?: undefined): string;
786
812
  encodeFunctionData(functionFragment: "withdrawBTC", values: [ICollateralManager.WithdrawalParamsStruct, BytesLike]): string;
787
813
  decodeFunctionResult(functionFragment: "ADMIN_ROLE", data: BytesLike): Result$2;
@@ -796,65 +822,67 @@ interface PositionManagerInterface extends Interface {
796
822
  decodeFunctionResult(functionFragment: "_performExtensionValidation", data: BytesLike): Result$2;
797
823
  decodeFunctionResult(functionFragment: "admin", data: BytesLike): Result$2;
798
824
  decodeFunctionResult(functionFragment: "authorizationRegistry", data: BytesLike): Result$2;
799
- decodeFunctionResult(functionFragment: "calculateCollateralRatio", data: BytesLike): Result$2;
800
825
  decodeFunctionResult(functionFragment: "circuitBreaker", data: BytesLike): Result$2;
801
826
  decodeFunctionResult(functionFragment: "clearExtensionPending", data: BytesLike): Result$2;
802
827
  decodeFunctionResult(functionFragment: "collateral", data: BytesLike): Result$2;
803
828
  decodeFunctionResult(functionFragment: "commitLiquidation", data: BytesLike): Result$2;
804
829
  decodeFunctionResult(functionFragment: "communityManager", data: BytesLike): Result$2;
830
+ decodeFunctionResult(functionFragment: "computeMintMessageHash", data: BytesLike): Result$2;
805
831
  decodeFunctionResult(functionFragment: "core", data: BytesLike): Result$2;
806
832
  decodeFunctionResult(functionFragment: "createPosition", data: BytesLike): Result$2;
807
833
  decodeFunctionResult(functionFragment: "extendPosition", data: BytesLike): Result$2;
808
834
  decodeFunctionResult(functionFragment: "getExpiredLoanLiquidationThreshold", data: BytesLike): Result$2;
809
- decodeFunctionResult(functionFragment: "getPKPLoanParams", data: BytesLike): Result$2;
810
- decodeFunctionResult(functionFragment: "getPKPPositionData", data: BytesLike): Result$2;
811
- decodeFunctionResult(functionFragment: "getPositionDetails", data: BytesLike): Result$2;
812
- decodeFunctionResult(functionFragment: "getPositionStatus", data: BytesLike): Result$2;
835
+ decodeFunctionResult(functionFragment: "getMintMessageHashParameters", data: BytesLike): Result$2;
836
+ decodeFunctionResult(functionFragment: "getPositionById", data: BytesLike): Result$2;
837
+ decodeFunctionResult(functionFragment: "getPositionByPkp", data: BytesLike): Result$2;
813
838
  decodeFunctionResult(functionFragment: "getRoleAdmin", data: BytesLike): Result$2;
814
839
  decodeFunctionResult(functionFragment: "grantRole", data: BytesLike): Result$2;
815
840
  decodeFunctionResult(functionFragment: "hasRole", data: BytesLike): Result$2;
816
841
  decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result$2;
817
842
  decodeFunctionResult(functionFragment: "isExpiredLoanLiquidatable", data: BytesLike): Result$2;
843
+ decodeFunctionResult(functionFragment: "isExtensionPending", data: BytesLike): Result$2;
818
844
  decodeFunctionResult(functionFragment: "liquidatePosition", data: BytesLike): Result$2;
819
845
  decodeFunctionResult(functionFragment: "liquidation", data: BytesLike): Result$2;
820
846
  decodeFunctionResult(functionFragment: "loanOps", data: BytesLike): Result$2;
821
- decodeFunctionResult(functionFragment: "makePartialPayment", data: BytesLike): Result$2;
847
+ decodeFunctionResult(functionFragment: "makePayment", data: BytesLike): Result$2;
848
+ decodeFunctionResult(functionFragment: "mintUCD", data: BytesLike): Result$2;
822
849
  decodeFunctionResult(functionFragment: "paused", data: BytesLike): Result$2;
823
850
  decodeFunctionResult(functionFragment: "pkpValidationRegistry", data: BytesLike): Result$2;
824
851
  decodeFunctionResult(functionFragment: "proxiableUUID", data: BytesLike): Result$2;
825
852
  decodeFunctionResult(functionFragment: "renounceRole", data: BytesLike): Result$2;
826
- decodeFunctionResult(functionFragment: "repayPosition", data: BytesLike): Result$2;
827
853
  decodeFunctionResult(functionFragment: "revealAndLiquidate", data: BytesLike): Result$2;
828
854
  decodeFunctionResult(functionFragment: "revokeRole", data: BytesLike): Result$2;
829
855
  decodeFunctionResult(functionFragment: "setAuthorizationRegistry", data: BytesLike): Result$2;
830
856
  decodeFunctionResult(functionFragment: "setPKPValidationRegistry", data: BytesLike): Result$2;
831
857
  decodeFunctionResult(functionFragment: "supportsInterface", data: BytesLike): Result$2;
832
858
  decodeFunctionResult(functionFragment: "termManager", data: BytesLike): Result$2;
859
+ decodeFunctionResult(functionFragment: "updateBalance", data: BytesLike): Result$2;
833
860
  decodeFunctionResult(functionFragment: "updateDebtFromLoanOps", data: BytesLike): Result$2;
834
861
  decodeFunctionResult(functionFragment: "updateModules", data: BytesLike): Result$2;
835
- decodeFunctionResult(functionFragment: "updatePosition", data: BytesLike): Result$2;
836
862
  decodeFunctionResult(functionFragment: "updatePositionStatusFromLoanOps", data: BytesLike): Result$2;
837
863
  decodeFunctionResult(functionFragment: "upgradeToAndCall", data: BytesLike): Result$2;
838
- decodeFunctionResult(functionFragment: "validatePKPLogic", data: BytesLike): Result$2;
839
- decodeFunctionResult(functionFragment: "validateUpgrade", data: BytesLike): Result$2;
864
+ decodeFunctionResult(functionFragment: "verifyAuthorization", data: BytesLike): Result$2;
840
865
  decodeFunctionResult(functionFragment: "views", data: BytesLike): Result$2;
841
866
  decodeFunctionResult(functionFragment: "withdrawBTC", data: BytesLike): Result$2;
842
867
  }
843
- declare namespace CollateralRatioUpdatedEvent {
868
+ declare namespace BalanceConfirmedEvent {
844
869
  type InputTuple = [
845
870
  positionId: BytesLike,
846
- oldRatio: BigNumberish,
847
- newRatio: BigNumberish
871
+ collateralValue: BigNumberish,
872
+ quantumTimestamp: BigNumberish,
873
+ confirmedAt: BigNumberish
848
874
  ];
849
875
  type OutputTuple = [
850
876
  positionId: string,
851
- oldRatio: bigint,
852
- newRatio: bigint
877
+ collateralValue: bigint,
878
+ quantumTimestamp: bigint,
879
+ confirmedAt: bigint
853
880
  ];
854
881
  interface OutputObject {
855
882
  positionId: string;
856
- oldRatio: bigint;
857
- newRatio: bigint;
883
+ collateralValue: bigint;
884
+ quantumTimestamp: bigint;
885
+ confirmedAt: bigint;
858
886
  }
859
887
  type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
860
888
  type Filter = TypedDeferredTopicFilter<Event>;
@@ -884,30 +912,6 @@ declare namespace InitializedEvent$1 {
884
912
  type Log = TypedEventLog<Event>;
885
913
  type LogDescription = TypedLogDescription<Event>;
886
914
  }
887
- declare namespace IntegrityCheckFailedEvent {
888
- type InputTuple = [
889
- positionId: BytesLike,
890
- checkType: string,
891
- reason: string,
892
- timestamp: BigNumberish
893
- ];
894
- type OutputTuple = [
895
- positionId: string,
896
- checkType: string,
897
- reason: string,
898
- timestamp: bigint
899
- ];
900
- interface OutputObject {
901
- positionId: string;
902
- checkType: string;
903
- reason: string;
904
- timestamp: bigint;
905
- }
906
- type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
907
- type Filter = TypedDeferredTopicFilter<Event>;
908
- type Log = TypedEventLog<Event>;
909
- type LogDescription = TypedLogDescription<Event>;
910
- }
911
915
  declare namespace ModulesUpdatedBatchEvent {
912
916
  type InputTuple = [updatedBy: AddressLike, moduleCount: BigNumberish];
913
917
  type OutputTuple = [updatedBy: string, moduleCount: bigint];
@@ -958,22 +962,19 @@ declare namespace PartialPaymentMadeEvent {
958
962
  positionId: BytesLike,
959
963
  payer: AddressLike,
960
964
  paymentAmount: BigNumberish,
961
- remainingDebt: BigNumberish,
962
- newCollateralRatio: BigNumberish
965
+ remainingDebt: BigNumberish
963
966
  ];
964
967
  type OutputTuple = [
965
968
  positionId: string,
966
969
  payer: string,
967
970
  paymentAmount: bigint,
968
- remainingDebt: bigint,
969
- newCollateralRatio: bigint
971
+ remainingDebt: bigint
970
972
  ];
971
973
  interface OutputObject {
972
974
  positionId: string;
973
975
  payer: string;
974
976
  paymentAmount: bigint;
975
977
  remainingDebt: bigint;
976
- newCollateralRatio: bigint;
977
978
  }
978
979
  type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
979
980
  type Filter = TypedDeferredTopicFilter<Event>;
@@ -1284,7 +1285,8 @@ interface PositionManager extends BaseContract {
1284
1285
  _performExtensionValidation: TypedContractMethod<[
1285
1286
  position: IPositionManagerCore.PositionStruct,
1286
1287
  selectedTerm: BigNumberish,
1287
- btcPrice: BigNumberish
1288
+ btcPrice: BigNumberish,
1289
+ availableBTCBalance: BigNumberish
1288
1290
  ], [
1289
1291
  [
1290
1292
  bigint,
@@ -1300,11 +1302,6 @@ interface PositionManager extends BaseContract {
1300
1302
  ], "view">;
1301
1303
  admin: TypedContractMethod<[], [string], "view">;
1302
1304
  authorizationRegistry: TypedContractMethod<[], [string], "view">;
1303
- calculateCollateralRatio: TypedContractMethod<[
1304
- positionId: BytesLike
1305
- ], [
1306
- bigint
1307
- ], "view">;
1308
1305
  circuitBreaker: TypedContractMethod<[], [string], "view">;
1309
1306
  clearExtensionPending: TypedContractMethod<[
1310
1307
  positionId: BytesLike
@@ -1314,11 +1311,28 @@ interface PositionManager extends BaseContract {
1314
1311
  collateral: TypedContractMethod<[], [string], "view">;
1315
1312
  commitLiquidation: TypedContractMethod<[
1316
1313
  positionId: BytesLike,
1317
- commitHash: BytesLike
1314
+ quantumTimestamp: BigNumberish,
1315
+ btcPrice: BigNumberish,
1316
+ liquidationValidatorSignature: BytesLike
1318
1317
  ], [
1319
1318
  void
1320
1319
  ], "nonpayable">;
1321
1320
  communityManager: TypedContractMethod<[], [string], "view">;
1321
+ computeMintMessageHash: TypedContractMethod<[
1322
+ positionId: BytesLike,
1323
+ actionHash: BytesLike,
1324
+ authorizedSpendsHash: BytesLike,
1325
+ ucdDebtHash: BytesLike,
1326
+ contractHash: BytesLike,
1327
+ btcPrice: BigNumberish,
1328
+ mintAmount: BigNumberish,
1329
+ mintFee: BigNumberish,
1330
+ newCollateral: BigNumberish,
1331
+ newDebt: BigNumberish,
1332
+ quantumTimestamp: BigNumberish
1333
+ ], [
1334
+ string
1335
+ ], "view">;
1322
1336
  core: TypedContractMethod<[], [string], "view">;
1323
1337
  createPosition: TypedContractMethod<[
1324
1338
  pkpId: BytesLike,
@@ -1335,6 +1349,7 @@ interface PositionManager extends BaseContract {
1335
1349
  selectedTerm: BigNumberish,
1336
1350
  quantumTimestamp: BigNumberish,
1337
1351
  btcPrice: BigNumberish,
1352
+ availableBTCBalance: BigNumberish,
1338
1353
  extensionValidatorSignature: BytesLike
1339
1354
  ], [
1340
1355
  boolean
@@ -1344,26 +1359,13 @@ interface PositionManager extends BaseContract {
1344
1359
  ], [
1345
1360
  bigint
1346
1361
  ], "view">;
1347
- getPKPLoanParams: TypedContractMethod<[
1348
- arg0: BytesLike
1349
- ], [
1350
- [bigint, bigint, bigint]
1351
- ], "view">;
1352
- getPKPPositionData: TypedContractMethod<[
1353
- arg0: BytesLike
1354
- ], [
1355
- IPositionManager.PKPPositionDataStructOutput
1356
- ], "view">;
1357
- getPositionDetails: TypedContractMethod<[
1362
+ getMintMessageHashParameters: TypedContractMethod<[], [string[]], "view">;
1363
+ getPositionById: TypedContractMethod<[
1358
1364
  positionId: BytesLike
1359
1365
  ], [
1360
1366
  IPositionManager.PositionStructOutput
1361
1367
  ], "view">;
1362
- getPositionStatus: TypedContractMethod<[
1363
- positionId: BytesLike
1364
- ], [
1365
- bigint
1366
- ], "view">;
1368
+ getPositionByPkp: TypedContractMethod<[pkpId: BytesLike], [string], "view">;
1367
1369
  getRoleAdmin: TypedContractMethod<[role: BytesLike], [string], "view">;
1368
1370
  grantRole: TypedContractMethod<[
1369
1371
  role: BytesLike,
@@ -1398,16 +1400,42 @@ interface PositionManager extends BaseContract {
1398
1400
  ], [
1399
1401
  boolean
1400
1402
  ], "view">;
1401
- liquidatePosition: TypedContractMethod<[
1403
+ isExtensionPending: TypedContractMethod<[
1402
1404
  positionId: BytesLike
1403
1405
  ], [
1404
1406
  boolean
1407
+ ], "view">;
1408
+ liquidatePosition: TypedContractMethod<[
1409
+ positionId: BytesLike,
1410
+ btcPrice: BigNumberish,
1411
+ quantumTimestamp: BigNumberish,
1412
+ liquidationValidatorSignature: BytesLike
1413
+ ], [
1414
+ boolean
1405
1415
  ], "nonpayable">;
1406
1416
  liquidation: TypedContractMethod<[], [string], "view">;
1407
1417
  loanOps: TypedContractMethod<[], [string], "view">;
1408
- makePartialPayment: TypedContractMethod<[
1418
+ makePayment: TypedContractMethod<[
1409
1419
  positionId: BytesLike,
1410
- paymentAmount: BigNumberish
1420
+ paymentAmount: BigNumberish,
1421
+ quantumTimestamp: BigNumberish,
1422
+ btcPrice: BigNumberish,
1423
+ paymentValidatorSignature: BytesLike
1424
+ ], [
1425
+ boolean
1426
+ ], "nonpayable">;
1427
+ mintUCD: TypedContractMethod<[
1428
+ positionId: BytesLike,
1429
+ mintAmount: BigNumberish,
1430
+ mintFee: BigNumberish,
1431
+ newDebt: BigNumberish,
1432
+ newCollateral: BigNumberish,
1433
+ btcPrice: BigNumberish,
1434
+ authorizedSpendsHash: BytesLike,
1435
+ ucdDebtHash: BytesLike,
1436
+ contractHash: BytesLike,
1437
+ quantumTimestamp: BigNumberish,
1438
+ mintValidatorSignature: BytesLike
1411
1439
  ], [
1412
1440
  boolean
1413
1441
  ], "nonpayable">;
@@ -1420,15 +1448,11 @@ interface PositionManager extends BaseContract {
1420
1448
  ], [
1421
1449
  void
1422
1450
  ], "nonpayable">;
1423
- repayPosition: TypedContractMethod<[
1424
- positionId: BytesLike,
1425
- repaymentAmount: BigNumberish
1426
- ], [
1427
- boolean
1428
- ], "nonpayable">;
1429
1451
  revealAndLiquidate: TypedContractMethod<[
1430
1452
  positionId: BytesLike,
1431
- nonce: BigNumberish,
1453
+ quantumTimestamp: BigNumberish,
1454
+ btcPrice: BigNumberish,
1455
+ liquidationValidatorSignature: BytesLike,
1432
1456
  deadline: BigNumberish
1433
1457
  ], [
1434
1458
  boolean
@@ -1455,6 +1479,14 @@ interface PositionManager extends BaseContract {
1455
1479
  boolean
1456
1480
  ], "view">;
1457
1481
  termManager: TypedContractMethod<[], [string], "view">;
1482
+ updateBalance: TypedContractMethod<[
1483
+ positionId: BytesLike,
1484
+ collateralValue: BigNumberish,
1485
+ quantumTimestamp: BigNumberish,
1486
+ signature: BytesLike
1487
+ ], [
1488
+ void
1489
+ ], "nonpayable">;
1458
1490
  updateDebtFromLoanOps: TypedContractMethod<[
1459
1491
  positionId: BytesLike,
1460
1492
  newDebt: BigNumberish,
@@ -1473,12 +1505,6 @@ interface PositionManager extends BaseContract {
1473
1505
  ], [
1474
1506
  void
1475
1507
  ], "nonpayable">;
1476
- updatePosition: TypedContractMethod<[
1477
- positionId: BytesLike,
1478
- newDebt: BigNumberish
1479
- ], [
1480
- boolean
1481
- ], "nonpayable">;
1482
1508
  updatePositionStatusFromLoanOps: TypedContractMethod<[
1483
1509
  positionId: BytesLike,
1484
1510
  newStatus: BigNumberish
@@ -1491,9 +1517,10 @@ interface PositionManager extends BaseContract {
1491
1517
  ], [
1492
1518
  void
1493
1519
  ], "payable">;
1494
- validatePKPLogic: TypedContractMethod<[pkpId: BytesLike], [boolean], "view">;
1495
- validateUpgrade: TypedContractMethod<[
1496
- newImplementation: AddressLike
1520
+ verifyAuthorization: TypedContractMethod<[
1521
+ selector: BytesLike,
1522
+ messageHash: BytesLike,
1523
+ signature: BytesLike
1497
1524
  ], [
1498
1525
  boolean
1499
1526
  ], "view">;
@@ -1517,7 +1544,8 @@ interface PositionManager extends BaseContract {
1517
1544
  getFunction(nameOrSignature: "_performExtensionValidation"): TypedContractMethod<[
1518
1545
  position: IPositionManagerCore.PositionStruct,
1519
1546
  selectedTerm: BigNumberish,
1520
- btcPrice: BigNumberish
1547
+ btcPrice: BigNumberish,
1548
+ availableBTCBalance: BigNumberish
1521
1549
  ], [
1522
1550
  [
1523
1551
  bigint,
@@ -1533,17 +1561,33 @@ interface PositionManager extends BaseContract {
1533
1561
  ], "view">;
1534
1562
  getFunction(nameOrSignature: "admin"): TypedContractMethod<[], [string], "view">;
1535
1563
  getFunction(nameOrSignature: "authorizationRegistry"): TypedContractMethod<[], [string], "view">;
1536
- getFunction(nameOrSignature: "calculateCollateralRatio"): TypedContractMethod<[positionId: BytesLike], [bigint], "view">;
1537
1564
  getFunction(nameOrSignature: "circuitBreaker"): TypedContractMethod<[], [string], "view">;
1538
1565
  getFunction(nameOrSignature: "clearExtensionPending"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
1539
1566
  getFunction(nameOrSignature: "collateral"): TypedContractMethod<[], [string], "view">;
1540
1567
  getFunction(nameOrSignature: "commitLiquidation"): TypedContractMethod<[
1541
1568
  positionId: BytesLike,
1542
- commitHash: BytesLike
1569
+ quantumTimestamp: BigNumberish,
1570
+ btcPrice: BigNumberish,
1571
+ liquidationValidatorSignature: BytesLike
1543
1572
  ], [
1544
1573
  void
1545
1574
  ], "nonpayable">;
1546
1575
  getFunction(nameOrSignature: "communityManager"): TypedContractMethod<[], [string], "view">;
1576
+ getFunction(nameOrSignature: "computeMintMessageHash"): TypedContractMethod<[
1577
+ positionId: BytesLike,
1578
+ actionHash: BytesLike,
1579
+ authorizedSpendsHash: BytesLike,
1580
+ ucdDebtHash: BytesLike,
1581
+ contractHash: BytesLike,
1582
+ btcPrice: BigNumberish,
1583
+ mintAmount: BigNumberish,
1584
+ mintFee: BigNumberish,
1585
+ newCollateral: BigNumberish,
1586
+ newDebt: BigNumberish,
1587
+ quantumTimestamp: BigNumberish
1588
+ ], [
1589
+ string
1590
+ ], "view">;
1547
1591
  getFunction(nameOrSignature: "core"): TypedContractMethod<[], [string], "view">;
1548
1592
  getFunction(nameOrSignature: "createPosition"): TypedContractMethod<[
1549
1593
  pkpId: BytesLike,
@@ -1560,23 +1604,19 @@ interface PositionManager extends BaseContract {
1560
1604
  selectedTerm: BigNumberish,
1561
1605
  quantumTimestamp: BigNumberish,
1562
1606
  btcPrice: BigNumberish,
1607
+ availableBTCBalance: BigNumberish,
1563
1608
  extensionValidatorSignature: BytesLike
1564
1609
  ], [
1565
1610
  boolean
1566
1611
  ], "nonpayable">;
1567
1612
  getFunction(nameOrSignature: "getExpiredLoanLiquidationThreshold"): TypedContractMethod<[positionId: BytesLike], [bigint], "view">;
1568
- getFunction(nameOrSignature: "getPKPLoanParams"): TypedContractMethod<[arg0: BytesLike], [[bigint, bigint, bigint]], "view">;
1569
- getFunction(nameOrSignature: "getPKPPositionData"): TypedContractMethod<[
1570
- arg0: BytesLike
1571
- ], [
1572
- IPositionManager.PKPPositionDataStructOutput
1573
- ], "view">;
1574
- getFunction(nameOrSignature: "getPositionDetails"): TypedContractMethod<[
1613
+ getFunction(nameOrSignature: "getMintMessageHashParameters"): TypedContractMethod<[], [string[]], "view">;
1614
+ getFunction(nameOrSignature: "getPositionById"): TypedContractMethod<[
1575
1615
  positionId: BytesLike
1576
1616
  ], [
1577
1617
  IPositionManager.PositionStructOutput
1578
1618
  ], "view">;
1579
- getFunction(nameOrSignature: "getPositionStatus"): TypedContractMethod<[positionId: BytesLike], [bigint], "view">;
1619
+ getFunction(nameOrSignature: "getPositionByPkp"): TypedContractMethod<[pkpId: BytesLike], [string], "view">;
1580
1620
  getFunction(nameOrSignature: "getRoleAdmin"): TypedContractMethod<[role: BytesLike], [string], "view">;
1581
1621
  getFunction(nameOrSignature: "grantRole"): TypedContractMethod<[
1582
1622
  role: BytesLike,
@@ -1611,12 +1651,38 @@ interface PositionManager extends BaseContract {
1611
1651
  ], [
1612
1652
  boolean
1613
1653
  ], "view">;
1614
- getFunction(nameOrSignature: "liquidatePosition"): TypedContractMethod<[positionId: BytesLike], [boolean], "nonpayable">;
1654
+ getFunction(nameOrSignature: "isExtensionPending"): TypedContractMethod<[positionId: BytesLike], [boolean], "view">;
1655
+ getFunction(nameOrSignature: "liquidatePosition"): TypedContractMethod<[
1656
+ positionId: BytesLike,
1657
+ btcPrice: BigNumberish,
1658
+ quantumTimestamp: BigNumberish,
1659
+ liquidationValidatorSignature: BytesLike
1660
+ ], [
1661
+ boolean
1662
+ ], "nonpayable">;
1615
1663
  getFunction(nameOrSignature: "liquidation"): TypedContractMethod<[], [string], "view">;
1616
1664
  getFunction(nameOrSignature: "loanOps"): TypedContractMethod<[], [string], "view">;
1617
- getFunction(nameOrSignature: "makePartialPayment"): TypedContractMethod<[
1665
+ getFunction(nameOrSignature: "makePayment"): TypedContractMethod<[
1666
+ positionId: BytesLike,
1667
+ paymentAmount: BigNumberish,
1668
+ quantumTimestamp: BigNumberish,
1669
+ btcPrice: BigNumberish,
1670
+ paymentValidatorSignature: BytesLike
1671
+ ], [
1672
+ boolean
1673
+ ], "nonpayable">;
1674
+ getFunction(nameOrSignature: "mintUCD"): TypedContractMethod<[
1618
1675
  positionId: BytesLike,
1619
- paymentAmount: BigNumberish
1676
+ mintAmount: BigNumberish,
1677
+ mintFee: BigNumberish,
1678
+ newDebt: BigNumberish,
1679
+ newCollateral: BigNumberish,
1680
+ btcPrice: BigNumberish,
1681
+ authorizedSpendsHash: BytesLike,
1682
+ ucdDebtHash: BytesLike,
1683
+ contractHash: BytesLike,
1684
+ quantumTimestamp: BigNumberish,
1685
+ mintValidatorSignature: BytesLike
1620
1686
  ], [
1621
1687
  boolean
1622
1688
  ], "nonpayable">;
@@ -1629,15 +1695,11 @@ interface PositionManager extends BaseContract {
1629
1695
  ], [
1630
1696
  void
1631
1697
  ], "nonpayable">;
1632
- getFunction(nameOrSignature: "repayPosition"): TypedContractMethod<[
1633
- positionId: BytesLike,
1634
- repaymentAmount: BigNumberish
1635
- ], [
1636
- boolean
1637
- ], "nonpayable">;
1638
1698
  getFunction(nameOrSignature: "revealAndLiquidate"): TypedContractMethod<[
1639
1699
  positionId: BytesLike,
1640
- nonce: BigNumberish,
1700
+ quantumTimestamp: BigNumberish,
1701
+ btcPrice: BigNumberish,
1702
+ liquidationValidatorSignature: BytesLike,
1641
1703
  deadline: BigNumberish
1642
1704
  ], [
1643
1705
  boolean
@@ -1652,6 +1714,14 @@ interface PositionManager extends BaseContract {
1652
1714
  getFunction(nameOrSignature: "setPKPValidationRegistry"): TypedContractMethod<[registry: AddressLike], [void], "nonpayable">;
1653
1715
  getFunction(nameOrSignature: "supportsInterface"): TypedContractMethod<[interfaceId: BytesLike], [boolean], "view">;
1654
1716
  getFunction(nameOrSignature: "termManager"): TypedContractMethod<[], [string], "view">;
1717
+ getFunction(nameOrSignature: "updateBalance"): TypedContractMethod<[
1718
+ positionId: BytesLike,
1719
+ collateralValue: BigNumberish,
1720
+ quantumTimestamp: BigNumberish,
1721
+ signature: BytesLike
1722
+ ], [
1723
+ void
1724
+ ], "nonpayable">;
1655
1725
  getFunction(nameOrSignature: "updateDebtFromLoanOps"): TypedContractMethod<[
1656
1726
  positionId: BytesLike,
1657
1727
  newDebt: BigNumberish,
@@ -1670,12 +1740,6 @@ interface PositionManager extends BaseContract {
1670
1740
  ], [
1671
1741
  void
1672
1742
  ], "nonpayable">;
1673
- getFunction(nameOrSignature: "updatePosition"): TypedContractMethod<[
1674
- positionId: BytesLike,
1675
- newDebt: BigNumberish
1676
- ], [
1677
- boolean
1678
- ], "nonpayable">;
1679
1743
  getFunction(nameOrSignature: "updatePositionStatusFromLoanOps"): TypedContractMethod<[
1680
1744
  positionId: BytesLike,
1681
1745
  newStatus: BigNumberish
@@ -1688,8 +1752,13 @@ interface PositionManager extends BaseContract {
1688
1752
  ], [
1689
1753
  void
1690
1754
  ], "payable">;
1691
- getFunction(nameOrSignature: "validatePKPLogic"): TypedContractMethod<[pkpId: BytesLike], [boolean], "view">;
1692
- getFunction(nameOrSignature: "validateUpgrade"): TypedContractMethod<[newImplementation: AddressLike], [boolean], "view">;
1755
+ getFunction(nameOrSignature: "verifyAuthorization"): TypedContractMethod<[
1756
+ selector: BytesLike,
1757
+ messageHash: BytesLike,
1758
+ signature: BytesLike
1759
+ ], [
1760
+ boolean
1761
+ ], "view">;
1693
1762
  getFunction(nameOrSignature: "views"): TypedContractMethod<[], [string], "view">;
1694
1763
  getFunction(nameOrSignature: "withdrawBTC"): TypedContractMethod<[
1695
1764
  params: ICollateralManager.WithdrawalParamsStruct,
@@ -1697,10 +1766,9 @@ interface PositionManager extends BaseContract {
1697
1766
  ], [
1698
1767
  boolean
1699
1768
  ], "nonpayable">;
1700
- getEvent(key: "CollateralRatioUpdated"): TypedContractEvent<CollateralRatioUpdatedEvent.InputTuple, CollateralRatioUpdatedEvent.OutputTuple, CollateralRatioUpdatedEvent.OutputObject>;
1769
+ getEvent(key: "BalanceConfirmed"): TypedContractEvent<BalanceConfirmedEvent.InputTuple, BalanceConfirmedEvent.OutputTuple, BalanceConfirmedEvent.OutputObject>;
1701
1770
  getEvent(key: "ExtensionPendingCleared"): TypedContractEvent<ExtensionPendingClearedEvent.InputTuple, ExtensionPendingClearedEvent.OutputTuple, ExtensionPendingClearedEvent.OutputObject>;
1702
1771
  getEvent(key: "Initialized"): TypedContractEvent<InitializedEvent$1.InputTuple, InitializedEvent$1.OutputTuple, InitializedEvent$1.OutputObject>;
1703
- getEvent(key: "IntegrityCheckFailed"): TypedContractEvent<IntegrityCheckFailedEvent.InputTuple, IntegrityCheckFailedEvent.OutputTuple, IntegrityCheckFailedEvent.OutputObject>;
1704
1772
  getEvent(key: "ModulesUpdatedBatch"): TypedContractEvent<ModulesUpdatedBatchEvent.InputTuple, ModulesUpdatedBatchEvent.OutputTuple, ModulesUpdatedBatchEvent.OutputObject>;
1705
1773
  getEvent(key: "PKPLogicValidated"): TypedContractEvent<PKPLogicValidatedEvent.InputTuple, PKPLogicValidatedEvent.OutputTuple, PKPLogicValidatedEvent.OutputObject>;
1706
1774
  getEvent(key: "PKPValidationRegistryUpdated"): TypedContractEvent<PKPValidationRegistryUpdatedEvent.InputTuple, PKPValidationRegistryUpdatedEvent.OutputTuple, PKPValidationRegistryUpdatedEvent.OutputObject>;
@@ -1720,21 +1788,19 @@ interface PositionManager extends BaseContract {
1720
1788
  getEvent(key: "Unpaused"): TypedContractEvent<UnpausedEvent$1.InputTuple, UnpausedEvent$1.OutputTuple, UnpausedEvent$1.OutputObject>;
1721
1789
  getEvent(key: "Upgraded"): TypedContractEvent<UpgradedEvent$1.InputTuple, UpgradedEvent$1.OutputTuple, UpgradedEvent$1.OutputObject>;
1722
1790
  filters: {
1723
- "CollateralRatioUpdated(bytes32,uint256,uint256)": TypedContractEvent<CollateralRatioUpdatedEvent.InputTuple, CollateralRatioUpdatedEvent.OutputTuple, CollateralRatioUpdatedEvent.OutputObject>;
1724
- CollateralRatioUpdated: TypedContractEvent<CollateralRatioUpdatedEvent.InputTuple, CollateralRatioUpdatedEvent.OutputTuple, CollateralRatioUpdatedEvent.OutputObject>;
1791
+ "BalanceConfirmed(bytes32,uint256,uint256,uint256)": TypedContractEvent<BalanceConfirmedEvent.InputTuple, BalanceConfirmedEvent.OutputTuple, BalanceConfirmedEvent.OutputObject>;
1792
+ BalanceConfirmed: TypedContractEvent<BalanceConfirmedEvent.InputTuple, BalanceConfirmedEvent.OutputTuple, BalanceConfirmedEvent.OutputObject>;
1725
1793
  "ExtensionPendingCleared(bytes32,address)": TypedContractEvent<ExtensionPendingClearedEvent.InputTuple, ExtensionPendingClearedEvent.OutputTuple, ExtensionPendingClearedEvent.OutputObject>;
1726
1794
  ExtensionPendingCleared: TypedContractEvent<ExtensionPendingClearedEvent.InputTuple, ExtensionPendingClearedEvent.OutputTuple, ExtensionPendingClearedEvent.OutputObject>;
1727
1795
  "Initialized(uint64)": TypedContractEvent<InitializedEvent$1.InputTuple, InitializedEvent$1.OutputTuple, InitializedEvent$1.OutputObject>;
1728
1796
  Initialized: TypedContractEvent<InitializedEvent$1.InputTuple, InitializedEvent$1.OutputTuple, InitializedEvent$1.OutputObject>;
1729
- "IntegrityCheckFailed(bytes32,string,string,uint256)": TypedContractEvent<IntegrityCheckFailedEvent.InputTuple, IntegrityCheckFailedEvent.OutputTuple, IntegrityCheckFailedEvent.OutputObject>;
1730
- IntegrityCheckFailed: TypedContractEvent<IntegrityCheckFailedEvent.InputTuple, IntegrityCheckFailedEvent.OutputTuple, IntegrityCheckFailedEvent.OutputObject>;
1731
1797
  "ModulesUpdatedBatch(address,uint256)": TypedContractEvent<ModulesUpdatedBatchEvent.InputTuple, ModulesUpdatedBatchEvent.OutputTuple, ModulesUpdatedBatchEvent.OutputObject>;
1732
1798
  ModulesUpdatedBatch: TypedContractEvent<ModulesUpdatedBatchEvent.InputTuple, ModulesUpdatedBatchEvent.OutputTuple, ModulesUpdatedBatchEvent.OutputObject>;
1733
1799
  "PKPLogicValidated(bytes32,bool)": TypedContractEvent<PKPLogicValidatedEvent.InputTuple, PKPLogicValidatedEvent.OutputTuple, PKPLogicValidatedEvent.OutputObject>;
1734
1800
  PKPLogicValidated: TypedContractEvent<PKPLogicValidatedEvent.InputTuple, PKPLogicValidatedEvent.OutputTuple, PKPLogicValidatedEvent.OutputObject>;
1735
1801
  "PKPValidationRegistryUpdated(address,address,address)": TypedContractEvent<PKPValidationRegistryUpdatedEvent.InputTuple, PKPValidationRegistryUpdatedEvent.OutputTuple, PKPValidationRegistryUpdatedEvent.OutputObject>;
1736
1802
  PKPValidationRegistryUpdated: TypedContractEvent<PKPValidationRegistryUpdatedEvent.InputTuple, PKPValidationRegistryUpdatedEvent.OutputTuple, PKPValidationRegistryUpdatedEvent.OutputObject>;
1737
- "PartialPaymentMade(bytes32,address,uint256,uint256,uint256)": TypedContractEvent<PartialPaymentMadeEvent.InputTuple, PartialPaymentMadeEvent.OutputTuple, PartialPaymentMadeEvent.OutputObject>;
1803
+ "PartialPaymentMade(bytes32,address,uint256,uint256)": TypedContractEvent<PartialPaymentMadeEvent.InputTuple, PartialPaymentMadeEvent.OutputTuple, PartialPaymentMadeEvent.OutputObject>;
1738
1804
  PartialPaymentMade: TypedContractEvent<PartialPaymentMadeEvent.InputTuple, PartialPaymentMadeEvent.OutputTuple, PartialPaymentMadeEvent.OutputObject>;
1739
1805
  "Paused(address)": TypedContractEvent<PausedEvent$1.InputTuple, PausedEvent$1.OutputTuple, PausedEvent$1.OutputObject>;
1740
1806
  Paused: TypedContractEvent<PausedEvent$1.InputTuple, PausedEvent$1.OutputTuple, PausedEvent$1.OutputObject>;
@@ -2134,11 +2200,11 @@ interface ICommunityManager extends BaseContract {
2134
2200
  interface ILiquidationManagerInterface extends Interface {
2135
2201
  getFunction(nameOrSignature: "calculateLiquidationBonus" | "commitLiquidation" | "isLiquidatable" | "liquidatePosition" | "revealAndLiquidate" | "supportsInterface"): FunctionFragment;
2136
2202
  getEvent(nameOrSignatureOrTopic: "PositionLiquidated"): EventFragment;
2137
- encodeFunctionData(functionFragment: "calculateLiquidationBonus", values: [BytesLike]): string;
2138
- encodeFunctionData(functionFragment: "commitLiquidation", values: [BytesLike, BytesLike]): string;
2139
- encodeFunctionData(functionFragment: "isLiquidatable", values: [BytesLike]): string;
2140
- encodeFunctionData(functionFragment: "liquidatePosition", values: [BytesLike]): string;
2141
- encodeFunctionData(functionFragment: "revealAndLiquidate", values: [BytesLike, BigNumberish, BigNumberish]): string;
2203
+ encodeFunctionData(functionFragment: "calculateLiquidationBonus", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish, BytesLike]): string;
2204
+ encodeFunctionData(functionFragment: "commitLiquidation", values: [BytesLike, BigNumberish, BigNumberish]): string;
2205
+ encodeFunctionData(functionFragment: "isLiquidatable", values: [BytesLike, BigNumberish, BigNumberish, BytesLike]): string;
2206
+ encodeFunctionData(functionFragment: "liquidatePosition", values: [BytesLike, BigNumberish, BigNumberish]): string;
2207
+ encodeFunctionData(functionFragment: "revealAndLiquidate", values: [BytesLike, BigNumberish, BigNumberish, BytesLike, BigNumberish]): string;
2142
2208
  encodeFunctionData(functionFragment: "supportsInterface", values: [BytesLike]): string;
2143
2209
  decodeFunctionResult(functionFragment: "calculateLiquidationBonus", data: BytesLike): Result$2;
2144
2210
  decodeFunctionResult(functionFragment: "commitLiquidation", data: BytesLike): Result$2;
@@ -2188,29 +2254,41 @@ interface ILiquidationManager extends BaseContract {
2188
2254
  listeners(eventName?: string): Promise<Array<Listener>>;
2189
2255
  removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
2190
2256
  calculateLiquidationBonus: TypedContractMethod<[
2191
- positionId: BytesLike
2257
+ positionId: BytesLike,
2258
+ quantumTimestamp: BigNumberish,
2259
+ btcPrice: BigNumberish,
2260
+ btcAmountSats: BigNumberish,
2261
+ liquidationValidatorSignature: BytesLike
2192
2262
  ], [
2193
2263
  bigint
2194
- ], "view">;
2264
+ ], "nonpayable">;
2195
2265
  commitLiquidation: TypedContractMethod<[
2196
2266
  positionId: BytesLike,
2197
- commitHash: BytesLike
2267
+ quantumTimestamp: BigNumberish,
2268
+ btcPrice: BigNumberish
2198
2269
  ], [
2199
2270
  void
2200
2271
  ], "nonpayable">;
2201
2272
  isLiquidatable: TypedContractMethod<[
2202
- positionId: BytesLike
2273
+ positionId: BytesLike,
2274
+ btcPrice: BigNumberish,
2275
+ quantumTimestamp: BigNumberish,
2276
+ liquidationValidatorSignature: BytesLike
2203
2277
  ], [
2204
2278
  boolean
2205
- ], "view">;
2279
+ ], "nonpayable">;
2206
2280
  liquidatePosition: TypedContractMethod<[
2207
- positionId: BytesLike
2281
+ positionId: BytesLike,
2282
+ btcPrice: BigNumberish,
2283
+ quantumTimestamp: BigNumberish
2208
2284
  ], [
2209
2285
  boolean
2210
2286
  ], "nonpayable">;
2211
2287
  revealAndLiquidate: TypedContractMethod<[
2212
2288
  positionId: BytesLike,
2213
- nonce: BigNumberish,
2289
+ quantumTimestamp: BigNumberish,
2290
+ btcPrice: BigNumberish,
2291
+ liquidationValidatorSignature: BytesLike,
2214
2292
  deadline: BigNumberish
2215
2293
  ], [
2216
2294
  boolean
@@ -2221,18 +2299,42 @@ interface ILiquidationManager extends BaseContract {
2221
2299
  boolean
2222
2300
  ], "view">;
2223
2301
  getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
2224
- getFunction(nameOrSignature: "calculateLiquidationBonus"): TypedContractMethod<[positionId: BytesLike], [bigint], "view">;
2302
+ getFunction(nameOrSignature: "calculateLiquidationBonus"): TypedContractMethod<[
2303
+ positionId: BytesLike,
2304
+ quantumTimestamp: BigNumberish,
2305
+ btcPrice: BigNumberish,
2306
+ btcAmountSats: BigNumberish,
2307
+ liquidationValidatorSignature: BytesLike
2308
+ ], [
2309
+ bigint
2310
+ ], "nonpayable">;
2225
2311
  getFunction(nameOrSignature: "commitLiquidation"): TypedContractMethod<[
2226
2312
  positionId: BytesLike,
2227
- commitHash: BytesLike
2313
+ quantumTimestamp: BigNumberish,
2314
+ btcPrice: BigNumberish
2228
2315
  ], [
2229
2316
  void
2230
2317
  ], "nonpayable">;
2231
- getFunction(nameOrSignature: "isLiquidatable"): TypedContractMethod<[positionId: BytesLike], [boolean], "view">;
2232
- getFunction(nameOrSignature: "liquidatePosition"): TypedContractMethod<[positionId: BytesLike], [boolean], "nonpayable">;
2318
+ getFunction(nameOrSignature: "isLiquidatable"): TypedContractMethod<[
2319
+ positionId: BytesLike,
2320
+ btcPrice: BigNumberish,
2321
+ quantumTimestamp: BigNumberish,
2322
+ liquidationValidatorSignature: BytesLike
2323
+ ], [
2324
+ boolean
2325
+ ], "nonpayable">;
2326
+ getFunction(nameOrSignature: "liquidatePosition"): TypedContractMethod<[
2327
+ positionId: BytesLike,
2328
+ btcPrice: BigNumberish,
2329
+ quantumTimestamp: BigNumberish
2330
+ ], [
2331
+ boolean
2332
+ ], "nonpayable">;
2233
2333
  getFunction(nameOrSignature: "revealAndLiquidate"): TypedContractMethod<[
2234
2334
  positionId: BytesLike,
2235
- nonce: BigNumberish,
2335
+ quantumTimestamp: BigNumberish,
2336
+ btcPrice: BigNumberish,
2337
+ liquidationValidatorSignature: BytesLike,
2236
2338
  deadline: BigNumberish
2237
2339
  ], [
2238
2340
  boolean
@@ -2246,7 +2348,7 @@ interface ILiquidationManager extends BaseContract {
2246
2348
  }
2247
2349
 
2248
2350
  interface ILoanOperationsManagerInterface extends Interface {
2249
- getFunction(nameOrSignature: "authorizeBTCSpend" | "calculateCollateralRatio" | "getCurrentBTCPrice" | "getOriginationFeeBalance" | "getPKPActualCollateral" | "getUcdController" | "isPriceFeedStale" | "liquidationThreshold" | "maximumLtvRatio" | "minimumLoanValueWei" | "mintUCD" | "processPartialPayment" | "repayPosition" | "supportsInterface" | "transferOriginationFee" | "ucdToken" | "updatePosition"): FunctionFragment;
2351
+ getFunction(nameOrSignature: "authorizeBTCSpend" | "calculateCollateralRatio" | "getOriginationFeeBalance" | "getPKPActualCollateral" | "getTotalAuthorizedSats" | "getUcdController" | "isPriceFeedStale" | "liquidationThreshold" | "maximumLtvRatio" | "minimumLoanValueWei" | "mintUCD" | "processPayment" | "supportsInterface" | "transferOriginationFee" | "ucdToken" | "updatePosition"): FunctionFragment;
2250
2352
  getEvent(nameOrSignatureOrTopic: "PositionRepaid" | "PositionUpdated" | "UCDMinted"): EventFragment;
2251
2353
  encodeFunctionData(functionFragment: "authorizeBTCSpend", values: [
2252
2354
  BytesLike,
@@ -2257,10 +2359,10 @@ interface ILoanOperationsManagerInterface extends Interface {
2257
2359
  BigNumberish,
2258
2360
  BytesLike
2259
2361
  ]): string;
2260
- encodeFunctionData(functionFragment: "calculateCollateralRatio", values: [BytesLike]): string;
2261
- encodeFunctionData(functionFragment: "getCurrentBTCPrice", values?: undefined): string;
2362
+ encodeFunctionData(functionFragment: "calculateCollateralRatio", values: [BytesLike, BigNumberish]): string;
2262
2363
  encodeFunctionData(functionFragment: "getOriginationFeeBalance", values?: undefined): string;
2263
2364
  encodeFunctionData(functionFragment: "getPKPActualCollateral", values: [BytesLike]): string;
2365
+ encodeFunctionData(functionFragment: "getTotalAuthorizedSats", values: [BytesLike]): string;
2264
2366
  encodeFunctionData(functionFragment: "getUcdController", values?: undefined): string;
2265
2367
  encodeFunctionData(functionFragment: "isPriceFeedStale", values?: undefined): string;
2266
2368
  encodeFunctionData(functionFragment: "liquidationThreshold", values?: undefined): string;
@@ -2274,28 +2376,26 @@ interface ILoanOperationsManagerInterface extends Interface {
2274
2376
  BigNumberish,
2275
2377
  BigNumberish,
2276
2378
  BytesLike,
2277
- BigNumberish,
2278
- BytesLike
2379
+ BytesLike,
2380
+ BigNumberish
2279
2381
  ]): string;
2280
- encodeFunctionData(functionFragment: "processPartialPayment", values: [BytesLike, BigNumberish]): string;
2281
- encodeFunctionData(functionFragment: "repayPosition", values: [BytesLike, BigNumberish]): string;
2382
+ encodeFunctionData(functionFragment: "processPayment", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish]): string;
2282
2383
  encodeFunctionData(functionFragment: "supportsInterface", values: [BytesLike]): string;
2283
2384
  encodeFunctionData(functionFragment: "transferOriginationFee", values: [AddressLike, BigNumberish]): string;
2284
2385
  encodeFunctionData(functionFragment: "ucdToken", values?: undefined): string;
2285
- encodeFunctionData(functionFragment: "updatePosition", values: [BytesLike, BigNumberish]): string;
2386
+ encodeFunctionData(functionFragment: "updatePosition", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish, BytesLike]): string;
2286
2387
  decodeFunctionResult(functionFragment: "authorizeBTCSpend", data: BytesLike): Result$2;
2287
2388
  decodeFunctionResult(functionFragment: "calculateCollateralRatio", data: BytesLike): Result$2;
2288
- decodeFunctionResult(functionFragment: "getCurrentBTCPrice", data: BytesLike): Result$2;
2289
2389
  decodeFunctionResult(functionFragment: "getOriginationFeeBalance", data: BytesLike): Result$2;
2290
2390
  decodeFunctionResult(functionFragment: "getPKPActualCollateral", data: BytesLike): Result$2;
2391
+ decodeFunctionResult(functionFragment: "getTotalAuthorizedSats", data: BytesLike): Result$2;
2291
2392
  decodeFunctionResult(functionFragment: "getUcdController", data: BytesLike): Result$2;
2292
2393
  decodeFunctionResult(functionFragment: "isPriceFeedStale", data: BytesLike): Result$2;
2293
2394
  decodeFunctionResult(functionFragment: "liquidationThreshold", data: BytesLike): Result$2;
2294
2395
  decodeFunctionResult(functionFragment: "maximumLtvRatio", data: BytesLike): Result$2;
2295
2396
  decodeFunctionResult(functionFragment: "minimumLoanValueWei", data: BytesLike): Result$2;
2296
2397
  decodeFunctionResult(functionFragment: "mintUCD", data: BytesLike): Result$2;
2297
- decodeFunctionResult(functionFragment: "processPartialPayment", data: BytesLike): Result$2;
2298
- decodeFunctionResult(functionFragment: "repayPosition", data: BytesLike): Result$2;
2398
+ decodeFunctionResult(functionFragment: "processPayment", data: BytesLike): Result$2;
2299
2399
  decodeFunctionResult(functionFragment: "supportsInterface", data: BytesLike): Result$2;
2300
2400
  decodeFunctionResult(functionFragment: "transferOriginationFee", data: BytesLike): Result$2;
2301
2401
  decodeFunctionResult(functionFragment: "ucdToken", data: BytesLike): Result$2;
@@ -2389,17 +2489,22 @@ interface ILoanOperationsManager extends BaseContract {
2389
2489
  bigint
2390
2490
  ], "nonpayable">;
2391
2491
  calculateCollateralRatio: TypedContractMethod<[
2392
- positionId: BytesLike
2492
+ positionId: BytesLike,
2493
+ btcPrice: BigNumberish
2393
2494
  ], [
2394
2495
  bigint
2395
2496
  ], "view">;
2396
- getCurrentBTCPrice: TypedContractMethod<[], [bigint], "view">;
2397
2497
  getOriginationFeeBalance: TypedContractMethod<[], [bigint], "view">;
2398
2498
  getPKPActualCollateral: TypedContractMethod<[
2399
2499
  pkpId: BytesLike
2400
2500
  ], [
2401
2501
  bigint
2402
2502
  ], "view">;
2503
+ getTotalAuthorizedSats: TypedContractMethod<[
2504
+ positionId: BytesLike
2505
+ ], [
2506
+ bigint
2507
+ ], "view">;
2403
2508
  getUcdController: TypedContractMethod<[], [string], "view">;
2404
2509
  isPriceFeedStale: TypedContractMethod<[], [boolean], "view">;
2405
2510
  liquidationThreshold: TypedContractMethod<[], [bigint], "view">;
@@ -2413,20 +2518,16 @@ interface ILoanOperationsManager extends BaseContract {
2413
2518
  newCollateral: BigNumberish,
2414
2519
  btcPrice: BigNumberish,
2415
2520
  authorizedSpendsHash: BytesLike,
2416
- quantumTimestamp: BigNumberish,
2417
- mintValidatorSignature: BytesLike
2521
+ ucdDebtHash: BytesLike,
2522
+ quantumTimestamp: BigNumberish
2418
2523
  ], [
2419
2524
  boolean
2420
2525
  ], "nonpayable">;
2421
- processPartialPayment: TypedContractMethod<[
2526
+ processPayment: TypedContractMethod<[
2422
2527
  positionId: BytesLike,
2423
- paymentAmount: BigNumberish
2424
- ], [
2425
- boolean
2426
- ], "nonpayable">;
2427
- repayPosition: TypedContractMethod<[
2428
- positionId: BytesLike,
2429
- repaymentAmount: BigNumberish
2528
+ paymentAmount: BigNumberish,
2529
+ quantumTimestamp: BigNumberish,
2530
+ btcPrice: BigNumberish
2430
2531
  ], [
2431
2532
  boolean
2432
2533
  ], "nonpayable">;
@@ -2444,7 +2545,10 @@ interface ILoanOperationsManager extends BaseContract {
2444
2545
  ucdToken: TypedContractMethod<[], [string], "view">;
2445
2546
  updatePosition: TypedContractMethod<[
2446
2547
  positionId: BytesLike,
2447
- newDebt: BigNumberish
2548
+ newDebt: BigNumberish,
2549
+ quantumTimestamp: BigNumberish,
2550
+ btcPrice: BigNumberish,
2551
+ updateValidatorSignature: BytesLike
2448
2552
  ], [
2449
2553
  boolean
2450
2554
  ], "nonpayable">;
@@ -2460,10 +2564,15 @@ interface ILoanOperationsManager extends BaseContract {
2460
2564
  ], [
2461
2565
  bigint
2462
2566
  ], "nonpayable">;
2463
- getFunction(nameOrSignature: "calculateCollateralRatio"): TypedContractMethod<[positionId: BytesLike], [bigint], "view">;
2464
- getFunction(nameOrSignature: "getCurrentBTCPrice"): TypedContractMethod<[], [bigint], "view">;
2567
+ getFunction(nameOrSignature: "calculateCollateralRatio"): TypedContractMethod<[
2568
+ positionId: BytesLike,
2569
+ btcPrice: BigNumberish
2570
+ ], [
2571
+ bigint
2572
+ ], "view">;
2465
2573
  getFunction(nameOrSignature: "getOriginationFeeBalance"): TypedContractMethod<[], [bigint], "view">;
2466
2574
  getFunction(nameOrSignature: "getPKPActualCollateral"): TypedContractMethod<[pkpId: BytesLike], [bigint], "view">;
2575
+ getFunction(nameOrSignature: "getTotalAuthorizedSats"): TypedContractMethod<[positionId: BytesLike], [bigint], "view">;
2467
2576
  getFunction(nameOrSignature: "getUcdController"): TypedContractMethod<[], [string], "view">;
2468
2577
  getFunction(nameOrSignature: "isPriceFeedStale"): TypedContractMethod<[], [boolean], "view">;
2469
2578
  getFunction(nameOrSignature: "liquidationThreshold"): TypedContractMethod<[], [bigint], "view">;
@@ -2477,20 +2586,16 @@ interface ILoanOperationsManager extends BaseContract {
2477
2586
  newCollateral: BigNumberish,
2478
2587
  btcPrice: BigNumberish,
2479
2588
  authorizedSpendsHash: BytesLike,
2480
- quantumTimestamp: BigNumberish,
2481
- mintValidatorSignature: BytesLike
2589
+ ucdDebtHash: BytesLike,
2590
+ quantumTimestamp: BigNumberish
2482
2591
  ], [
2483
2592
  boolean
2484
2593
  ], "nonpayable">;
2485
- getFunction(nameOrSignature: "processPartialPayment"): TypedContractMethod<[
2594
+ getFunction(nameOrSignature: "processPayment"): TypedContractMethod<[
2486
2595
  positionId: BytesLike,
2487
- paymentAmount: BigNumberish
2488
- ], [
2489
- boolean
2490
- ], "nonpayable">;
2491
- getFunction(nameOrSignature: "repayPosition"): TypedContractMethod<[
2492
- positionId: BytesLike,
2493
- repaymentAmount: BigNumberish
2596
+ paymentAmount: BigNumberish,
2597
+ quantumTimestamp: BigNumberish,
2598
+ btcPrice: BigNumberish
2494
2599
  ], [
2495
2600
  boolean
2496
2601
  ], "nonpayable">;
@@ -2504,7 +2609,10 @@ interface ILoanOperationsManager extends BaseContract {
2504
2609
  getFunction(nameOrSignature: "ucdToken"): TypedContractMethod<[], [string], "view">;
2505
2610
  getFunction(nameOrSignature: "updatePosition"): TypedContractMethod<[
2506
2611
  positionId: BytesLike,
2507
- newDebt: BigNumberish
2612
+ newDebt: BigNumberish,
2613
+ quantumTimestamp: BigNumberish,
2614
+ btcPrice: BigNumberish,
2615
+ updateValidatorSignature: BytesLike
2508
2616
  ], [
2509
2617
  boolean
2510
2618
  ], "nonpayable">;
@@ -4240,6 +4348,7 @@ interface UCDMintRequest {
4240
4348
  skipValidation?: boolean;
4241
4349
  customRpcUrl?: string;
4242
4350
  customBitcoinRpcUrl?: string;
4351
+ testBtcPrice?: number;
4243
4352
  }
4244
4353
  /**
4245
4354
  * UCD Mint Result Interface
@@ -4288,6 +4397,8 @@ interface LiquidationRequest {
4288
4397
  interface PartialPaymentRequest {
4289
4398
  positionId: string;
4290
4399
  paymentAmount: number;
4400
+ customRpcUrl?: string;
4401
+ customBitcoinRpcUrl?: string;
4291
4402
  }
4292
4403
  /**
4293
4404
  * Partial Payment Result Interface
@@ -4413,9 +4524,9 @@ interface BitcoinOperationsConfig {
4413
4524
  providers: BitcoinProviderConfig[];
4414
4525
  /** Consensus mode: single or majority */
4415
4526
  consensusMode?: "single" | "majority";
4416
- /** Cache for balance results */
4527
+ /** Cache for balance results (keyed by address) */
4417
4528
  balanceCache?: Cache<BitcoinBalanceResult>;
4418
- /** Cache for address derivations */
4529
+ /** Cache for address derivations (keyed by PKP public key) */
4419
4530
  addressCache?: Cache<BitcoinAddresses>;
4420
4531
  /** LitOps instance for price oracle queries (optional) */
4421
4532
  litOps?: any;
@@ -4983,16 +5094,22 @@ declare class DiamondHandsSDK {
4983
5094
  /**
4984
5095
  * Extend position term
4985
5096
  *
4986
- * @param positionId - Position identifier
4987
- * @param selectedTerm - Extension term in months
5097
+ * Follows main's security pattern: authorization → LIT validation → contract execution
5098
+ *
5099
+ * @param _positionId - Position identifier
5100
+ * @param _selectedTerm - Extension term in months
4988
5101
  * @returns Transaction receipt
4989
5102
  */
5103
+ extendPosition(_positionId: string, _selectedTerm: number): Promise<ethers.providers.TransactionReceipt>;
4990
5104
  /**
4991
- * Make a partial payment on a loan
5105
+ * Make a payment on a loan position
5106
+ *
5107
+ * Follows main's security pattern: authorization → LIT validation → contract execution
4992
5108
  *
4993
- * @param request - Partial payment request with position ID and amount
4994
- * @returns Partial payment result with transaction details
5109
+ * @param request - Payment request with position ID and amount
5110
+ * @returns Payment result with transaction details
4995
5111
  */
5112
+ makePayment(request: PartialPaymentRequest): Promise<PartialPaymentResult>;
4996
5113
  /**
4997
5114
  * Withdraw Bitcoin from a position
4998
5115
  *
@@ -5245,6 +5362,15 @@ declare class DiamondHandsSDK {
5245
5362
  * Get Bitcoin network based on chain
5246
5363
  */
5247
5364
  private getBitcoinNetwork;
5365
+ /**
5366
+ * Extract error message from LIT Action response
5367
+ * Checks both `error` and `reason` fields and parses nested error structures
5368
+ *
5369
+ * @private
5370
+ * @remarks Production-ready error parser for LIT Protocol responses
5371
+ * Will be integrated into core methods in Round 2
5372
+ */
5373
+ private extractLitActionError;
5248
5374
  /**
5249
5375
  * Get provider or throw error
5250
5376
  */
@@ -5707,8 +5833,6 @@ interface LoanCreatorConfig {
5707
5833
  litOpsSigner?: Wallet;
5708
5834
  /** SDK mode: 'service' or 'standalone' */
5709
5835
  mode?: "service" | "standalone";
5710
- /** Service endpoint for backend operations (service mode only) */
5711
- serviceEndpoint?: string;
5712
5836
  /** LIT Action CID for loan creation */
5713
5837
  litActionCid: string;
5714
5838
  /** User ID (typically wallet address) */
@@ -5717,8 +5841,10 @@ interface LoanCreatorConfig {
5717
5841
  debug?: boolean;
5718
5842
  /** Transaction timeout (ms) */
5719
5843
  transactionTimeoutMs?: number;
5720
- /** PKP validator version to use for signature verification */
5721
- validatorVersion?: number;
5844
+ /** Validator version for loan creation (createPosition) - REQUIRED */
5845
+ loanCreationValidatorVersion: number;
5846
+ /** Security testing: Temper signatures to test contract validation */
5847
+ temperSignaturesTest?: boolean;
5722
5848
  }
5723
5849
  /**
5724
5850
  * Loan creation audit trail
@@ -5758,6 +5884,7 @@ interface LoanCreationAudit {
5758
5884
  declare class LoanCreator {
5759
5885
  private readonly config;
5760
5886
  private readonly transactionTimeoutMs;
5887
+ private pkpValidationRegistryAddressCache;
5761
5888
  constructor(config: LoanCreatorConfig);
5762
5889
  /**
5763
5890
  * Create a new loan
@@ -5969,47 +6096,279 @@ interface MonitoringOptions {
5969
6096
  }
5970
6097
 
5971
6098
  /**
5972
- * LIT Action Types and Interfaces
6099
+ * Branded identifier types for PKP and Position IDs.
6100
+ *
6101
+ * These provide lightweight nominal typing so that internal helpers can
6102
+ * distinguish between generic strings and protocol identifiers, while
6103
+ * still being freely assignable to `string` where needed.
6104
+ */
6105
+ declare const __idBrand: unique symbol;
6106
+ /**
6107
+ * Position identifier (on-chain bytes32, represented as hex string in SDK).
6108
+ */
6109
+ type PositionId = string & {
6110
+ readonly [__idBrand]: "PositionId";
6111
+ };
6112
+ declare const PositionId: (value: string) => PositionId;
6113
+
6114
+ /**
6115
+ * Typed responses for critical Diamond Hands LIT Actions.
6116
+ *
6117
+ * These mirror the JSON payloads passed to `Lit.Actions.setResponse(...)`
6118
+ * in the lit-actions package and are intended to be used as the `TData`
6119
+ * parameter on `LitActionResult<TData>`.
6120
+ */
6121
+
6122
+ /**
6123
+ * Base shape for approval-style validator responses.
6124
+ */
6125
+ interface BaseValidatorResponse {
6126
+ approved: boolean;
6127
+ positionId?: PositionId | string;
6128
+ reason?: string;
6129
+ failedStep?: string;
6130
+ timestamp: number | string;
6131
+ /**
6132
+ * Optional low-level execution error from lit-ops / LIT runtime.
6133
+ */
6134
+ error?: string;
6135
+ /**
6136
+ * Some flows attach the raw signature JSON here (service wrappers).
6137
+ */
6138
+ signature?: string;
6139
+ }
6140
+ /**
6141
+ * UCD Mint Validator response (ucdMintValidator).
6142
+ * Source: lit-actions/src/ucd-mint-validator.ts
6143
+ */
6144
+ interface UcdMintValidatorResponse extends BaseValidatorResponse {
6145
+ approved: true;
6146
+ mintAmount: string;
6147
+ mintFee: string;
6148
+ newDebt: string;
6149
+ newCollateral: string;
6150
+ newCollateralRatioBps: number;
6151
+ btcPrice: string;
6152
+ authorizedSpendsHash: string;
6153
+ ucdDebtHash: string;
6154
+ contractBundleHash: string;
6155
+ signature: string;
6156
+ validatorPkp: string;
6157
+ /**
6158
+ * Optional: Exact parameter values used for signing.
6159
+ * If present, SDK should use these values instead of response values
6160
+ * to ensure contract receives identical parameters that were signed.
6161
+ */
6162
+ signingParams?: {
6163
+ positionId: string;
6164
+ actionHash: string;
6165
+ authorizedSpendsHash: string;
6166
+ ucdDebtHash: string;
6167
+ contractBundleHash: string;
6168
+ btcPrice: string;
6169
+ mintAmount: string;
6170
+ mintFee: string;
6171
+ newCollateral: string;
6172
+ newDebt: string;
6173
+ timestamp: string;
6174
+ };
6175
+ }
6176
+ interface UcdMintValidatorErrorResponse extends BaseValidatorResponse {
6177
+ approved: false;
6178
+ }
6179
+ type UcdMintValidatorResult = UcdMintValidatorResponse | UcdMintValidatorErrorResponse;
6180
+ /**
6181
+ * BTC Withdrawal Validator response (btcWithdrawal).
6182
+ * Source: lit-actions/src/btc-withdrawal.ts
6183
+ */
6184
+ interface BtcWithdrawalValidatorResponse extends BaseValidatorResponse {
6185
+ approved: true;
6186
+ actionHash: string;
6187
+ authorizedSpendsHash: string;
6188
+ ucdDebtHash: string;
6189
+ totalDeduction: string;
6190
+ remainingCollateral: string;
6191
+ newCollateralRatioBps?: number;
6192
+ destinationAddress: string;
6193
+ signature: string;
6194
+ btcPrice: string;
6195
+ /**
6196
+ * Optional UTXO fields used by enhanced BTC withdrawal flow.
6197
+ * These are populated by the LIT Action when BIP-143 validation is enabled.
6198
+ */
6199
+ utxoTxid?: string;
6200
+ utxoVout?: number;
6201
+ }
6202
+ interface BtcWithdrawalValidatorErrorResponse extends BaseValidatorResponse {
6203
+ approved: false;
6204
+ }
6205
+ type BtcWithdrawalValidatorResult = BtcWithdrawalValidatorResponse | BtcWithdrawalValidatorErrorResponse;
6206
+ /**
6207
+ * Liquidation Validator response (liquidationValidator).
6208
+ * Source: lit-actions/src/liquidation-validator.ts
6209
+ */
6210
+ interface LiquidationValidatorResponse extends BaseValidatorResponse {
6211
+ approved: true;
6212
+ btcPrice: string;
6213
+ btcAmountSats: string;
6214
+ signature: string;
6215
+ signatureBonus: string;
6216
+ validatorPkp: string;
6217
+ }
6218
+ interface LiquidationValidatorErrorResponse extends BaseValidatorResponse {
6219
+ approved: false;
6220
+ }
6221
+ type LiquidationValidatorResult = LiquidationValidatorResponse | LiquidationValidatorErrorResponse;
6222
+ /**
6223
+ * Extend Position Validator response (extendPositionValidator).
6224
+ * Source: lit-actions/src/extend-position-validator.ts
5973
6225
  */
5974
- interface ILitAction {
6226
+ interface ExtendPositionValidatorResponse extends BaseValidatorResponse {
6227
+ approved: true;
6228
+ selectedTerm: number;
6229
+ btcPrice: string;
6230
+ availableBTCBalance: string;
6231
+ extensionFee: string;
6232
+ newTotalDebt: string;
6233
+ newCollateralRatioBps: string;
6234
+ signature: string;
6235
+ timestamp: number;
6236
+ quantumTimestamp: number;
6237
+ validatorPkp: string;
6238
+ }
6239
+ interface ExtendPositionValidatorErrorResponse extends BaseValidatorResponse {
6240
+ approved: false;
6241
+ }
6242
+ type ExtendPositionValidatorResult = ExtendPositionValidatorResponse | ExtendPositionValidatorErrorResponse;
6243
+ /**
6244
+ * Process Payment Validator response (processPaymentValidator).
6245
+ * Source: lit-actions/src/process-payment-validator.ts
6246
+ */
6247
+ interface ProcessPaymentValidatorResponse extends BaseValidatorResponse {
6248
+ approved: true;
6249
+ paymentAmount: string;
6250
+ btcPrice: string;
6251
+ btcAmountSats: string;
6252
+ signature: string;
6253
+ timestamp: number;
6254
+ validatorPkp: string;
6255
+ }
6256
+ interface ProcessPaymentValidatorErrorResponse extends BaseValidatorResponse {
6257
+ approved: false;
6258
+ }
6259
+ type ProcessPaymentValidatorResult = ProcessPaymentValidatorResponse | ProcessPaymentValidatorErrorResponse;
6260
+ /**
6261
+ * Loan vault BTC balance / deposit validator response (loanVaultBtcBalance).
6262
+ * Source: lit-actions/src/loan-vault-btc-balance.ts
6263
+ */
6264
+ interface LoanVaultBtcBalanceValidatorResponse {
6265
+ vaultAddress: string;
6266
+ vaultBalance: string;
6267
+ positionId: PositionId | string;
6268
+ btcPrice: string;
6269
+ signature: string;
6270
+ timestamp: number;
6271
+ validatorPkp: string;
6272
+ }
6273
+ interface LoanVaultBtcBalanceValidatorErrorResponse {
6274
+ error: string;
6275
+ positionId: PositionId | string | null;
6276
+ timestamp: number;
6277
+ }
6278
+ type LoanVaultBtcBalanceValidatorResult = LoanVaultBtcBalanceValidatorResponse | LoanVaultBtcBalanceValidatorErrorResponse;
6279
+
6280
+ /**
6281
+ * LIT Action Types and Interfaces (SDK boundary)
6282
+ *
6283
+ * This file provides the strongly-typed SDK view of LIT Actions and
6284
+ * re-exports the action registry interfaces from the @gvnrdao/dh-lit-actions
6285
+ * package so that action names and configs stay in sync across packages.
6286
+ */
6287
+
6288
+ /**
6289
+ * Core LIT Action execution description.
6290
+ *
6291
+ * TParams describes the jsParams structure, TAuth describes the authSig shape.
6292
+ * Both default to safe, unknown-based records instead of `any`.
6293
+ */
6294
+ interface ILitAction<TParams extends Record<string, unknown> = Record<string, unknown>, TAuth = LitActionAuth> {
5975
6295
  code: string;
5976
6296
  ipfsId?: string;
5977
- jsParams: Record<string, any>;
5978
- authSig: any;
6297
+ jsParams: TParams;
6298
+ authSig: TAuth;
5979
6299
  }
5980
- interface LitActionParams {
6300
+ /**
6301
+ * Parameters passed to lit-node-client.executeJs.
6302
+ *
6303
+ * This mirrors ILitAction but is named for historic reasons.
6304
+ */
6305
+ interface LitActionParams<TParams extends Record<string, unknown> = Record<string, unknown>, TAuth = LitActionAuth> {
5981
6306
  code: string;
5982
- jsParams: Record<string, any>;
5983
- authSig: any;
6307
+ jsParams: TParams;
6308
+ authSig: TAuth;
5984
6309
  debug?: boolean;
5985
6310
  pkpId?: string;
5986
6311
  userAddress?: string;
6312
+ /**
6313
+ * Collateral amount used by some actions (e.g. mint flows).
6314
+ * Replaces legacy btcAmount naming.
6315
+ */
5987
6316
  collateralAmount?: string;
5988
6317
  }
5989
- interface LitActionResult {
6318
+ /**
6319
+ * Raw result returned from LIT Action execution.
6320
+ *
6321
+ * Callers are encouraged to wrap this in action-specific result
6322
+ * types instead of accessing the generic `data` bag directly.
6323
+ */
6324
+ interface LitActionResult<TData = unknown> {
5990
6325
  success: boolean;
5991
- signedData?: any;
5992
- decryptedData?: any;
6326
+ signedData?: unknown;
6327
+ decryptedData?: unknown;
5993
6328
  claimedKeyId?: string;
5994
- signatures?: any;
6329
+ signatures?: unknown;
6330
+ /**
6331
+ * Alias for signatures used by some helpers.
6332
+ */
5995
6333
  signature?: string;
5996
- decryptions?: any;
5997
- claims?: any;
6334
+ decryptions?: unknown;
6335
+ claims?: unknown;
5998
6336
  response?: string;
5999
6337
  logs?: string;
6000
- data?: any;
6338
+ /**
6339
+ * Action-specific payload. Prefer narrowing this via generics.
6340
+ */
6341
+ data?: TData;
6342
+ /**
6343
+ * Human-readable error (if any).
6344
+ */
6001
6345
  error?: string;
6002
6346
  }
6347
+ /**
6348
+ * Discriminated union of typed results for the core Diamond Hands actions.
6349
+ *
6350
+ * This can be used by higher-level SDK helpers to express that a given
6351
+ * execution is expected to return a particular validator payload.
6352
+ */
6353
+ type DiamondHandsLitActionResult = LitActionResult<UcdMintValidatorResult> | LitActionResult<BtcWithdrawalValidatorResult> | LitActionResult<LiquidationValidatorResult> | LitActionResult<ExtendPositionValidatorResult> | LitActionResult<ProcessPaymentValidatorResult> | LitActionResult<LoanVaultBtcBalanceValidatorResult>;
6354
+ /**
6355
+ * Standard EIP-191 style authorization signature used by LIT.
6356
+ */
6003
6357
  interface LitActionAuth {
6004
6358
  sig: string;
6005
6359
  derivedVia: string;
6006
6360
  signedMessage: string;
6007
6361
  address: string;
6008
6362
  }
6009
- interface LitActionValidationResult {
6363
+ /**
6364
+ * Generic validation result used by some helper actions.
6365
+ *
6366
+ * Callers should prefer action-specific result types where available.
6367
+ */
6368
+ interface LitActionValidationResult<TDetails = unknown> {
6010
6369
  valid: boolean;
6011
6370
  error?: string;
6012
- details?: any;
6371
+ details?: TDetails;
6013
6372
  }
6014
6373
 
6015
6374
  /**
@@ -6460,7 +6819,7 @@ interface LoanQueryConfig {
6460
6819
  bitcoinOperations: BitcoinOperations;
6461
6820
  /** Ethereum provider for PKP public key retrieval */
6462
6821
  provider?: providers.Provider;
6463
- /** Cache for loan query results */
6822
+ /** Cache for loan query results (keyed by PKP ID) */
6464
6823
  cache?: Cache<LoanData>;
6465
6824
  /** Enable debug logging */
6466
6825
  debug?: boolean;
@@ -6666,7 +7025,6 @@ interface NetworkConfig {
6666
7025
  liquidationManager?: string;
6667
7026
  ucdToken: string;
6668
7027
  ucdController?: string;
6669
- btcProofValidator: string;
6670
7028
  priceFeedConsumer: string;
6671
7029
  operationAuthorizationRegistry?: string;
6672
7030
  mockUsdcToken?: string;
@@ -6678,6 +7036,7 @@ interface NetworkConfig {
6678
7036
  tokenGvnrUrl?: string;
6679
7037
  };
6680
7038
  litNetwork: string;
7039
+ validatorVersion?: number;
6681
7040
  debug: boolean;
6682
7041
  }
6683
7042
  /**
@@ -6749,7 +7108,7 @@ declare function validateSDKEnvironment(requirements: {
6749
7108
  /**
6750
7109
  * Smart Contract ABIs
6751
7110
  */
6752
- declare const POSITION_MANAGER_ABI: readonly ["function createPosition(bytes32 pkpId, bytes calldata validatorSignature, address borrower, string calldata vaultAddress, uint256 selectedTermMonths) external returns (bool)", "function deletePosition(bytes32 positionId) external", "function getPositionDetails(bytes32 positionId) external view returns (tuple(bytes32 positionId, bytes32 pkpId, uint256 ucdDebt, string vaultAddress, address borrower, uint40 createdAt, uint40 lastUpdated, uint16 selectedTerm, uint40 expiryAt, uint8 status))", "function getUserPositions(address user) external view returns (bytes32[] memory)", "function calculateCollateralRatio(bytes32 positionId) external view returns (uint256)", "function hasRole(bytes32 role, address account) external view returns (bool)", "function ADMIN_ROLE() external view returns (bytes32)", "function paused() external view returns (bool)", "function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)", "function repayPosition(bytes32 positionId, uint256 repaymentAmount) external returns (bool)", "function makePartialPayment(bytes32 positionId, uint256 paymentAmount) external returns (bool)", "function withdrawBTC(bytes32 positionId, string withdrawalAddress, uint256 networkFee) external returns (bool)", "function extendPosition(bytes32 positionId, uint256 selectedTerm) external returns (bool)", "function liquidatePosition(bytes32 positionId) external returns (bool)", "function commitLiquidation(bytes32 positionId, bytes32 commitHash) external", "function revealAndLiquidate(bytes32 positionId, uint256 nonce, uint256 deadline) external returns (bool)", "function getExpiredLoanLiquidationThreshold(bytes32 positionId) external view returns (uint256)", "function isExpiredLoanLiquidatable(bytes32 positionId, uint256 collateralValue, uint256 debtAmount) external view returns (bool)", "event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)", "event UCDMinted(bytes32 indexed positionId, uint256 amount, bytes proof)", "event PositionLiquidated(bytes32 indexed positionId, address indexed liquidator, uint256 collateralRatio, uint256 liquidationBonus)", "event CollateralRatioUpdated(bytes32 indexed positionId, uint256 oldRatio, uint256 newRatio)", "event PositionUpdated(bytes32 indexed positionId, uint256 oldDebt, uint256 newDebt)"];
7111
+ declare const POSITION_MANAGER_ABI: readonly ["function createPosition(bytes32 pkpId, bytes calldata validatorSignature, address borrower, string calldata vaultAddress, uint256 selectedTermMonths) external returns (bool)", "function deletePosition(bytes32 positionId) external", "function getPositionById(bytes32 positionId) external view returns (tuple(bytes32 positionId, bytes32 pkpId, uint256 ucdDebt, string vaultAddress, address borrower, uint40 createdAt, uint40 lastUpdated, uint16 selectedTerm, uint40 expiryAt, uint8 status))", "function getUserPositions(address user) external view returns (bytes32[] memory)", "function calculateCollateralRatio(bytes32 positionId) external view returns (uint256)", "function hasRole(bytes32 role, address account) external view returns (bool)", "function ADMIN_ROLE() external view returns (bytes32)", "function paused() external view returns (bool)", "function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, bytes32 contractHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)", "function repayPosition(bytes32 positionId, uint256 repaymentAmount) external returns (bool)", "function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)", "function withdrawBTC(bytes32 positionId, string withdrawalAddress, uint256 networkFee) external returns (bool)", "function extendPosition(bytes32 positionId, uint256 selectedTerm) external returns (bool)", "function liquidatePosition(bytes32 positionId) external returns (bool)", "function commitLiquidation(bytes32 positionId, bytes32 commitHash) external", "function revealAndLiquidate(bytes32 positionId, uint256 nonce, uint256 deadline) external returns (bool)", "function getExpiredLoanLiquidationThreshold(bytes32 positionId) external view returns (uint256)", "function isExpiredLoanLiquidatable(bytes32 positionId, uint256 collateralValue, uint256 debtAmount) external view returns (bool)", "event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)", "event UCDMinted(bytes32 indexed positionId, uint256 amount, bytes proof)", "event PositionLiquidated(bytes32 indexed positionId, address indexed liquidator, uint256 collateralRatio, uint256 liquidationBonus)", "event CollateralRatioUpdated(bytes32 indexed positionId, uint256 oldRatio, uint256 newRatio)", "event PositionUpdated(bytes32 indexed positionId, uint256 oldDebt, uint256 newDebt)"];
6753
7112
  declare const UCD_TOKEN_ABI: readonly ["function balanceOf(address account) external view returns (uint256)", "function transfer(address to, uint256 amount) external returns (bool)", "function approve(address spender, uint256 amount) external returns (bool)", "function allowance(address owner, address spender) external view returns (uint256)", "function mint(address to, uint256 amount) external", "function burn(uint256 amount) external", "function burnFrom(address account, uint256 amount) external", "event Transfer(address indexed from, address indexed to, uint256 value)", "event Approval(address indexed owner, address indexed spender, uint256 value)"];
6754
7113
  declare const PRICE_FEED_CONSUMER_ABI: readonly ["function getCurrentPrice() external view returns (uint256)", "function isPriceStale() external view returns (bool)", "function updatePrice() external", "event PriceUpdated(uint256 indexed price, uint256 timestamp)"];
6755
7114
  declare const PSM_ABI: readonly ["function swap(address stablecoin, uint256 amountIn, uint256 minUcdOut) external returns (uint256 ucdAmount)", "function addSupportedStablecoin(address stablecoin, uint256 exchangeRate, uint256 entryFeeBps, uint256 exitFeeBps, uint8 decimals, uint256 minSwapAmount, uint256 minRedeemAmount) external", "function updateSupportedStablecoin(address stablecoin, uint256 exchangeRate, uint256 entryFeeBps, uint256 exitFeeBps, uint8 decimals, uint256 minSwapAmount, uint256 minRedeemAmount) external", "function removeSupportedStablecoin(address stablecoin) external", "function withdrawStablecoin(address stablecoin, uint256 amount) external", "function pause() external", "function unpause() external", "function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256 stablecoinAmount)", "function setExitFee(address stablecoin, uint256 fee) external", "function setEntryFee(address stablecoin, uint256 fee) external", "function setExchangeRate(address stablecoin, uint256 rate) external", "function setRedeemEnabled(bool enabled) external", "function addReserves(address stablecoin, uint256 amount) external", "function syncReserves(address stablecoin) external", "function forceSyncReserves(address stablecoin) external", "function getRedemptionQuote(address stablecoin, uint256 ucdAmount) external view returns (uint256 stablecoinOut, uint256 exitFee)", "function getAvailableReserves(address stablecoin) external view returns (uint256)", "function canRedeem(address stablecoin, uint256 ucdAmount) external view returns (bool)", "function version() external pure returns (string memory)", "function supportedStablecoins(address) external view returns (bool)", "function exchangeRates(address) external view returns (uint256)", "function fees(address) external view returns (uint256)", "function exitFees(address) external view returns (uint256)", "function reserves(address) external view returns (uint256)", "function redeemEnabled() external view returns (bool)", "function stablecoinDecimals(address) external view returns (uint8)", "function lastOperationBlock(address) external view returns (uint256)", "function operationCount(address) external view returns (uint256)", "function BASIS_POINTS() external view returns (uint256)", "function EXCHANGE_RATE_SCALE() external view returns (uint256)", "function MAX_EXIT_FEE() external view returns (uint256)", "function MAX_RESERVE_DRIFT() external view returns (uint256)", "event Swap(address indexed user, address indexed stablecoin, uint256 stablecoinAmount, uint256 ucdAmount, uint256 fee, uint256 timestamp)", "event Redeem(address indexed user, address indexed stablecoin, uint256 ucdAmount, uint256 stablecoinAmount, uint256 exitFee, uint256 timestamp)", "event StablecoinAdded(address indexed stablecoin, uint256 exchangeRate, uint256 fee)", "event StablecoinRemoved(address indexed stablecoin)", "event ReserveUpdated(address indexed stablecoin, uint256 oldReserve, uint256 newReserve)", "event ExitFeeUpdated(address indexed stablecoin, uint256 oldFee, uint256 newFee)", "event EntryFeeUpdated(address indexed stablecoin, uint256 oldFee, uint256 newFee)", "event ExchangeRateUpdated(address indexed stablecoin, uint256 oldRate, uint256 newRate)"];
@@ -6821,4 +7180,4 @@ declare const DEFAULT_BITCOIN_CONSENSUS_MODE: "majority";
6821
7180
  */
6822
7181
  declare const MIN_BITCOIN_PROVIDERS_FOR_CONSENSUS = 2;
6823
7182
 
6824
- export { AuditTrail, AuthParamsValidation, AuthorizationParams, AuthorizationRequest, AuthorizationResult, BPS, BPSConversions, BTCDepositRequest, BTCDepositResult, BTCProof, BTCTransaction, BTCWithdrawalResult, BasicNetworkConfig, BitcoinAddresses, BitcoinBalanceResult, BitcoinNetwork, BitcoinOperations, BitcoinOperationsConfig, BitcoinProviderConfig, BitcoinUTXO, BlockNumber, CacheConfig, CacheManager, CacheStats, ClosePositionAuthParams, ConfirmationResult, ContractAddresses, ContractCallOptions, ContractManager, ContractManagerConfig, ContractQueryOptions, ContractTransactionResult, CreateLoanAuthParams, CreateLoanRequest, CreateLoanResult, DEFAULT_BALANCE_CACHE_SIZE, DEFAULT_BALANCE_CACHE_TTL_MS, DEFAULT_BITCOIN_CONSENSUS_MODE, DEFAULT_CACHE_CLEANUP_INTERVAL_MS, DEFAULT_CONCURRENCY_LIMIT, DEFAULT_LIT_NETWORKS, DEFAULT_MAX_RETRIES, DEFAULT_NETWORKS, DEFAULT_NETWORK_CONFIG, DEFAULT_OPERATION_TIMEOUT_MS, DEFAULT_PAGINATION_ROWS, DEFAULT_PKP_CACHE_SIZE, DEFAULT_PKP_CACHE_TTL_MS, DebugInfo, DiamondHandsSDK, DiamondHandsSDKConfig, EnrichedBitcoinBalance, EnvironmentName, ErrorCategory, ErrorSeverity, EventFilter, EventHelpers, EventLog, ExtendTermAuthParams, Failure, FeeDistributionEvent, IBTCProof, ILitAction, IPKPManager, IUCDMinting, Cache as LRUCache, LiquidationEvent, LiquidationRequest, LitActionAuth, LitActionParams, LitActionResult, LitActionValidationResult, LoanCreationAudit, LoanCreator, LoanCreatorConfig, LoanData, LoanDataDetail, LoanEvents, LoanEventsFilter, LoanManagerConfig, LoanQuery, LoanQueryConfig, LoanQueryFilters, LoanStatus, LoansQuery, MAX_PAGINATION_ROWS, MIN_BITCOIN_PROVIDERS_FOR_CONSENSUS, ManagedContracts, MintUCDAuthParams, MintingParams, MintingResult, MockTokenManager, MockTokenManagerConfig, MockTokenTransactionResult, MonitoringOptions, NETWORK_CONFIGS, NetworkConfig, PKPCreationRequest, PKPCreationResult, PKPData, PKPIssuanceRequest, PKPManager, PKPManagerConfig, PKPSigningRequest, PKPSigningResult, PKPValidationData, PKPValidationRequest, PKPValidationResult, POSITION_MANAGER_ABI, PRICE_FEED_CONSUMER_ABI, PSM_ABI, PSM_MAX_OPERATIONS_PER_WINDOW, PSM_RATE_LIMIT_RESET_BLOCKS, PaginatedLoansResponse, PaginatedResult, Pagination, PaginationParams, PartialPaymentRequest, PartialPaymentResult, PaymentEvent, PaymentType, Position, PositionDetails, PositionQueryOptions, PositionQueryResult, PositionStatus, PositionWithBTCStatus, PriceProviderConfig, RepayDebtAuthParams, Result$1 as Result, RetryConfig, RewardDistribution, SDKConfig, SDKError, SDKInitOptions, SDKMode, SDK_DEFAULTS, SDK_ERROR_MESSAGES, Satoshis, SatoshisConversions, ServiceModeConfig, StandaloneModeConfig, StatusUpdateEvent, Success, THE_GRAPH_MAX_BATCH_SIZE, UCD, UCDConversions, UCDMintEvent, UCDMintRequest, UCDMintResult, UCD_TOKEN_ABI, UnixTimestamp, ValidationRequest, Wei, WeiConversions, WithdrawBTCAuthParams, andThen, collectFailures, collectSuccesses, combine, createBitcoinOperations, createCacheManager, createContractManager, createLoanCreator, createLoanQuery, createMockTokenManager, createPKPManager, DiamondHandsSDK as default, envLog, failure, firstSuccess, fromPromise, getAllNetworkConfigs, getCurrentEnvironment, getLitNetworkConfig, getNetworkConfig, getNetworkConfigByName, isClosePositionAuth, isCreateLoanAuth, isExtendTermAuth, isFailure, isMintUCDAuth, isNetworkSupported, isRepayDebtAuth, isServiceModeConfig, isStandaloneModeConfig, isSuccess, isValidPaymentType, isValidPositionStatus, isWithdrawBTCAuth, loadSDKConfig, map, mapError, match, numericToPositionStatus, success, toPromise, tryCatch, tryCatchAsync, unwrap, unwrapOr, validateSDKConfig, validateSDKEnvironment, validateServiceModeConfig, validateStandaloneModeConfig };
7183
+ export { AuditTrail, AuthParamsValidation, AuthorizationParams, AuthorizationRequest, AuthorizationResult, BPS, BPSConversions, BTCDepositRequest, BTCDepositResult, BTCProof, BTCTransaction, BTCWithdrawalResult, BasicNetworkConfig, BitcoinAddresses, BitcoinBalanceResult, BitcoinNetwork, BitcoinOperations, BitcoinOperationsConfig, BitcoinProviderConfig, BitcoinUTXO, BlockNumber, CacheConfig, CacheManager, CacheStats, ClosePositionAuthParams, ConfirmationResult, ContractAddresses, ContractCallOptions, ContractManager, ContractManagerConfig, ContractQueryOptions, ContractTransactionResult, CreateLoanAuthParams, CreateLoanRequest, CreateLoanResult, DEFAULT_BALANCE_CACHE_SIZE, DEFAULT_BALANCE_CACHE_TTL_MS, DEFAULT_BITCOIN_CONSENSUS_MODE, DEFAULT_CACHE_CLEANUP_INTERVAL_MS, DEFAULT_CONCURRENCY_LIMIT, DEFAULT_LIT_NETWORKS, DEFAULT_MAX_RETRIES, DEFAULT_NETWORKS, DEFAULT_NETWORK_CONFIG, DEFAULT_OPERATION_TIMEOUT_MS, DEFAULT_PAGINATION_ROWS, DEFAULT_PKP_CACHE_SIZE, DEFAULT_PKP_CACHE_TTL_MS, DebugInfo, DiamondHandsLitActionResult, DiamondHandsSDK, DiamondHandsSDKConfig, EnrichedBitcoinBalance, EnvironmentName, ErrorCategory, ErrorSeverity, EventFilter, EventHelpers, EventLog, ExtendTermAuthParams, Failure, FeeDistributionEvent, IBTCProof, ILitAction, IPKPManager, IUCDMinting, Cache as LRUCache, LiquidationEvent, LiquidationRequest, LitActionAuth, LitActionParams, LitActionResult, LitActionValidationResult, LoanCreationAudit, LoanCreator, LoanCreatorConfig, LoanData, LoanDataDetail, LoanEvents, LoanEventsFilter, LoanManagerConfig, LoanQuery, LoanQueryConfig, LoanQueryFilters, LoanStatus, LoansQuery, MAX_PAGINATION_ROWS, MIN_BITCOIN_PROVIDERS_FOR_CONSENSUS, ManagedContracts, MintUCDAuthParams, MintingParams, MintingResult, MockTokenManager, MockTokenManagerConfig, MockTokenTransactionResult, MonitoringOptions, NETWORK_CONFIGS, NetworkConfig, PKPCreationRequest, PKPCreationResult, PKPData, PKPIssuanceRequest, PKPManager, PKPManagerConfig, PKPSigningRequest, PKPSigningResult, PKPValidationData, PKPValidationRequest, PKPValidationResult, POSITION_MANAGER_ABI, PRICE_FEED_CONSUMER_ABI, PSM_ABI, PSM_MAX_OPERATIONS_PER_WINDOW, PSM_RATE_LIMIT_RESET_BLOCKS, PaginatedLoansResponse, PaginatedResult, Pagination, PaginationParams, PartialPaymentRequest, PartialPaymentResult, PaymentEvent, PaymentType, Position, PositionDetails, PositionQueryOptions, PositionQueryResult, PositionStatus, PositionWithBTCStatus, PriceProviderConfig, RepayDebtAuthParams, Result$1 as Result, RetryConfig, RewardDistribution, SDKConfig, SDKError, SDKInitOptions, SDKMode, SDK_DEFAULTS, SDK_ERROR_MESSAGES, Satoshis, SatoshisConversions, ServiceModeConfig, StandaloneModeConfig, StatusUpdateEvent, Success, THE_GRAPH_MAX_BATCH_SIZE, UCD, UCDConversions, UCDMintEvent, UCDMintRequest, UCDMintResult, UCD_TOKEN_ABI, UnixTimestamp, ValidationRequest, Wei, WeiConversions, WithdrawBTCAuthParams, andThen, collectFailures, collectSuccesses, combine, createBitcoinOperations, createCacheManager, createContractManager, createLoanCreator, createLoanQuery, createMockTokenManager, createPKPManager, DiamondHandsSDK as default, envLog, failure, firstSuccess, fromPromise, getAllNetworkConfigs, getCurrentEnvironment, getLitNetworkConfig, getNetworkConfig, getNetworkConfigByName, isClosePositionAuth, isCreateLoanAuth, isExtendTermAuth, isFailure, isMintUCDAuth, isNetworkSupported, isRepayDebtAuth, isServiceModeConfig, isStandaloneModeConfig, isSuccess, isValidPaymentType, isValidPositionStatus, isWithdrawBTCAuth, loadSDKConfig, map, mapError, match, numericToPositionStatus, success, toPromise, tryCatch, tryCatchAsync, unwrap, unwrapOr, validateSDKConfig, validateSDKEnvironment, validateServiceModeConfig, validateStandaloneModeConfig };