@gvnrdao/dh-sdk 0.0.248 → 0.0.252

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.mjs CHANGED
@@ -3626,6 +3626,397 @@ var require_websocket_server = __commonJS({
3626
3626
  }
3627
3627
  });
3628
3628
 
3629
+ // src/constants/chunks/deployment-addresses.ts
3630
+ var deployment_addresses_exports = {};
3631
+ __export(deployment_addresses_exports, {
3632
+ ALL_CONTRACTS: () => ALL_CONTRACTS,
3633
+ ALL_DEPLOYMENTS: () => ALL_DEPLOYMENTS,
3634
+ LOCALHOST_CONTRACTS: () => LOCALHOST_CONTRACTS,
3635
+ LOCALHOST_DEPLOYMENT: () => LOCALHOST_DEPLOYMENT,
3636
+ SEPOLIA_CONTRACTS: () => SEPOLIA_CONTRACTS,
3637
+ SEPOLIA_DEPLOYMENT: () => SEPOLIA_DEPLOYMENT,
3638
+ getContractsByNetwork: () => getContractsByNetwork,
3639
+ getDeploymentByNetwork: () => getDeploymentByNetwork
3640
+ });
3641
+ function getDeploymentByNetwork(network) {
3642
+ return ALL_DEPLOYMENTS[network] || null;
3643
+ }
3644
+ function getContractsByNetwork(network) {
3645
+ return ALL_CONTRACTS[network] || null;
3646
+ }
3647
+ var SEPOLIA_DEPLOYMENT, SEPOLIA_CONTRACTS, LOCALHOST_DEPLOYMENT, LOCALHOST_CONTRACTS, ALL_DEPLOYMENTS, ALL_CONTRACTS;
3648
+ var init_deployment_addresses = __esm({
3649
+ "src/constants/chunks/deployment-addresses.ts"() {
3650
+ "use strict";
3651
+ SEPOLIA_DEPLOYMENT = {
3652
+ network: "sepolia",
3653
+ chainId: 11155111,
3654
+ timestamp: "2026-03-13T20:04:15.417Z",
3655
+ deployer: "",
3656
+ contracts: {
3657
+ UpgradeValidator: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
3658
+ UCDToken: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
3659
+ UCDController: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
3660
+ PriceFeedConsumer: "0xb3Dc64501935a6f0334779126Ee37bE463cee318",
3661
+ PositionManagerCoreModule: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
3662
+ TermManagerModule: "0x94Adc6F9558368B1482197584f1fc7133Ecf835b",
3663
+ LoanOperationsManagerModule: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
3664
+ CollateralManagerModule: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
3665
+ LiquidationManagerModule: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
3666
+ CircuitBreakerModule: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
3667
+ AdminModule: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
3668
+ PositionManagerViews: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
3669
+ PositionManager: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
3670
+ OperationAuthorizationRegistry: "0x75f36E772df9616d40b02092642744D6fd702Df8",
3671
+ PKPValidation: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
3672
+ BTCSpendAuthorizer: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
3673
+ LITActionValidator: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
3674
+ SimplePSMV2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
3675
+ BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
3676
+ ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
3677
+ mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
3678
+ mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
3679
+ PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
3680
+ FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374"
3681
+ },
3682
+ upgraded: {
3683
+ PositionManager: {
3684
+ previousImplementation: "0x5492b2cE6138c1750BDD8DbB15Dc0ea00A5CF241",
3685
+ newImplementation: "0x623f3bDff8830d2161D3b5D42d38b39697c65eBE",
3686
+ upgradedAt: "2026-05-15T10:41:01.767Z",
3687
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3688
+ reason: "Shared upgrade script: PositionManager implementation update"
3689
+ },
3690
+ LoanOperationsManagerModule: {
3691
+ previousImplementation: "0x3C1d7887858f106e43aa48bBF0D86C6EBA979980",
3692
+ newImplementation: "0xdEf0A042670834369d456c5fbE73ad2126008bD2",
3693
+ upgradedAt: "2026-05-15T10:37:26.881Z",
3694
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3695
+ reason: "Shared upgrade script: LoanOperationsManagerModule v1.4.0 (M-3 Chainlink cross-check)"
3696
+ },
3697
+ UCDController: {
3698
+ previousImplementation: "0x0F7c669c891C6534Bfef222B0A6bc9B71c256C58",
3699
+ newImplementation: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
3700
+ upgradedAt: "2026-05-14T16:04:12.854Z",
3701
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3702
+ reason: "Shared upgrade script: UCDController implementation update"
3703
+ },
3704
+ TermManagerModule: {
3705
+ previousImplementation: "0x55d6c44162715802d912c4f2B9A7f4Bc06638804",
3706
+ newImplementation: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
3707
+ upgradedAt: "2026-05-14T16:08:36.848Z",
3708
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3709
+ reason: "Shared upgrade script: TermManagerModule implementation update"
3710
+ },
3711
+ CircuitBreakerModule: {
3712
+ previousImplementation: "0xd0B03c92854b9A260cBd2853f7CB0E29Edb78Ef8",
3713
+ newImplementation: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
3714
+ upgradedAt: "2026-05-14T16:14:25.887Z",
3715
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3716
+ reason: "Shared upgrade script: CircuitBreakerModule implementation update"
3717
+ },
3718
+ AdminModule: {
3719
+ previousImplementation: "0x79A7FBb522Ba6629236590958e7F2B07103c3871",
3720
+ newImplementation: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
3721
+ upgradedAt: "2026-05-14T16:16:37.959Z",
3722
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3723
+ reason: "Shared upgrade script: AdminModule implementation update"
3724
+ },
3725
+ PositionManagerViews: {
3726
+ previousImplementation: "0x92311E348730e30237cbF0a58FaD704F8f2B8101",
3727
+ newImplementation: "0xBd1F92F24E89cC55acFc422eCA0df00F68B99565",
3728
+ upgradedAt: "2026-05-14T18:42:37.153Z",
3729
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3730
+ reason: "Shared upgrade script: PositionManagerViews implementation update"
3731
+ },
3732
+ TestPositionManager: {
3733
+ previousImplementation: "0x0B46Ee1a9C6b42559758B7FF78294Cd867BB08f8",
3734
+ newImplementation: "0x0B46Ee1a9C6b42559758B7FF78294Cd867BB08f8",
3735
+ upgradedAt: "2026-03-17T15:18:07.382Z",
3736
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3737
+ reason: "Add setPositionExpiry() for expiry-liquidation E2E testing"
3738
+ },
3739
+ UCDToken: {
3740
+ previousImplementation: "0x9b6bD0220045010a7D5762f05A3C17982996cb96",
3741
+ newImplementation: "0x65c23B6fB5331ACeeC2d82328c6de7dB6b62bB65",
3742
+ upgradedAt: "2026-05-13T17:23:49.158Z",
3743
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3744
+ reason: "Shared upgrade script: UCDToken implementation update"
3745
+ },
3746
+ PositionManagerCoreModule: {
3747
+ previousImplementation: "0xE3B9747af371f459B4d68D30DE5e374040eb6339",
3748
+ newImplementation: "0x2e34353852d95f8D39aE648af817de9f750c84D6",
3749
+ upgradedAt: "2026-05-14T18:37:36.484Z",
3750
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3751
+ reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
3752
+ },
3753
+ CollateralManagerModule: {
3754
+ previousImplementation: "0x895E916EC5A056d03099631D193AffFd9Cc2B3DF",
3755
+ newImplementation: "0xC3DD73d669174ED7012579bf2dAAf77085AdD4Cf",
3756
+ upgradedAt: "2026-05-14T16:10:37.540Z",
3757
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3758
+ reason: "Shared upgrade script: CollateralManagerModule implementation update"
3759
+ },
3760
+ LiquidationManagerModule: {
3761
+ previousImplementation: "0x8E069E4A1deba9Ac021956F3cD771e9e65d756bb",
3762
+ newImplementation: "0x15864ea3ECBe7E9FFa0a52b49c4dc7f258FA6300",
3763
+ upgradedAt: "2026-05-15T10:43:13.136Z",
3764
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3765
+ reason: "Shared upgrade script: LiquidationManagerModule implementation update"
3766
+ },
3767
+ BTCSpendAuthorizer: {
3768
+ previousImplementation: "0xE9b5ECd4cca90a4BdB74b472876D7F60aCEc6314",
3769
+ newImplementation: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
3770
+ upgradedAt: "2026-05-14T16:18:26.340Z",
3771
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3772
+ reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
3773
+ },
3774
+ SimplePSMV2: {
3775
+ previousImplementation: "0x1aA5d2407B937B8f0F07932B8050ad23713873eC",
3776
+ newImplementation: "0x0728434d86532FD67A4a7227958654C029b333F6",
3777
+ upgradedAt: "2026-05-14T16:26:36.862Z",
3778
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3779
+ reason: "Shared upgrade script: SimplePSMV2 implementation update"
3780
+ },
3781
+ UpgradeValidator: {
3782
+ previousImplementation: "0xEFf189e5872bC7158191eD39d31E745aF2A6FDa7",
3783
+ newImplementation: "0x535c9d66F9CFa4f2337cF6074BFc8fdcBBb9cFC4",
3784
+ upgradedAt: "2026-05-14T16:28:13.597Z",
3785
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3786
+ reason: "Shared upgrade script: UpgradeValidator implementation update"
3787
+ },
3788
+ LITActionValidator: {
3789
+ previousImplementation: "0x4548bbF8e0798Aa883604F3ae44EDFc1BAc8278c",
3790
+ newImplementation: "0x7D2a754AaF41E135c626553000139d5039095E29",
3791
+ upgradedAt: "2026-04-22T11:46:48.503Z",
3792
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3793
+ reason: "Fresh UUPS proxy deployment (v2.1.0). Previous address was a plain implementation contract with _disableInitializers() \u2014 no proxy, no live state to migrate."
3794
+ },
3795
+ ContractVersionRegistry: {
3796
+ previousImplementation: "0x8F86F78a6902b2B9a092158fF03BCCe301FB3d6b",
3797
+ newImplementation: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
3798
+ upgradedAt: "2026-05-14T16:02:24.973Z",
3799
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3800
+ reason: "Shared upgrade script: ContractVersionRegistry implementation update"
3801
+ },
3802
+ PositionDelegateRegistry: {
3803
+ previousImplementation: "0x3852Cd9495AF48166229271B81ac4e925F451dee",
3804
+ newImplementation: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
3805
+ upgradedAt: "2026-05-14T16:30:13.519Z",
3806
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3807
+ reason: "Shared upgrade script: PositionDelegateRegistry implementation update"
3808
+ },
3809
+ OperationAuthorizationRegistry: {
3810
+ previousImplementation: "0x75f36E772df9616d40b02092642744D6fd702Df8",
3811
+ newImplementation: "0x9f8072d4672d643e39d8638478e900Fea1f2c81D",
3812
+ proxyAddress: "0x75f36E772df9616d40b02092642744D6fd702Df8",
3813
+ upgradedAt: "2026-05-15T13:34:44.806Z",
3814
+ upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3815
+ reason: "Fresh UUPS proxy deployment (UUPS conversion + H-2 dead-zone fix)"
3816
+ }
3817
+ },
3818
+ history: {
3819
+ LoanOperationsManagerModule: {
3820
+ previous: "0x48D46188e25452148A743f8f6599b0E66C178512",
3821
+ new: "0x1f70024444C5E89fFC232d2768C0359F7a13c6e7",
3822
+ reason: "Storage layout scrambled \u2014 fresh deploy with F20 admin",
3823
+ deployedAt: "2026-03-12T10:28:15.833Z",
3824
+ deployedBy: "0x2767441E044aCd9bbC21a759fB0517494875092d"
3825
+ },
3826
+ freshDeploy: {
3827
+ reason: "Full fresh deploy \u2014 F20 as admin, correct AdminModule on PM, no 0x276 dependency",
3828
+ deployedAt: "2026-03-12T11:07:45.335Z",
3829
+ deployedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3830
+ old: {
3831
+ UCDToken: "0x86060fa5b3e01e003b8afd9c1295f1f444a7dc60",
3832
+ UCDController: "0x703Ce9a94A8e42EC48499a79ef5c38a37664Fc5a",
3833
+ PositionManagerCoreModule: "0x3Ff6F2E40B0d7c0557Da8fd04F699198Bdcb1b4C",
3834
+ LiquidationManagerModule: "0xAC3886766Ac20d379b069BdFB97e401aBad6188C",
3835
+ LoanOperationsManagerModule: "0x1f70024444C5E89fFC232d2768C0359F7a13c6e7",
3836
+ CollateralManagerModule: "0x34E3DcA5d00570f323c62f09f46D8314674de723",
3837
+ PositionManagerViews: "0xAC32f1845ace22e012aF30760fe9296b9aEb8a45",
3838
+ PositionManager: "0x141D078A82F093F4Ea8345b9Bc9999C9008619Ae"
3839
+ },
3840
+ new: {
3841
+ UCDToken: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
3842
+ UCDController: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
3843
+ PositionManagerCoreModule: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
3844
+ LiquidationManagerModule: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
3845
+ LoanOperationsManagerModule: "0xD3ADCCe9b46287763f723dC9a3FCfa59ab74b8bB",
3846
+ CollateralManagerModule: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
3847
+ PositionManagerViews: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
3848
+ PositionManager: "0xc767484Cced727D3fC0c5C2872BA6549967d7517"
3849
+ }
3850
+ }
3851
+ },
3852
+ pkpValidationDeployed: {
3853
+ address: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
3854
+ deployedAt: "2026-04-21T09:27:25.783Z",
3855
+ deployedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3856
+ setPKPValidationRegistryTx: "0xddc776e0120bfee2eb53c33e058501fe0bd2cfb769083d2e37bc7064edda2c59",
3857
+ replacedAddress: "0xA95C81020713158a88616a6Db88d3d6293968CEB"
3858
+ },
3859
+ latestEnv: {
3860
+ UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
3861
+ UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
3862
+ POSITION_MANAGER: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
3863
+ PKP_VALIDATION_REGISTRY: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
3864
+ PKP_VALIDATION_CID_V1: "0x1220246b43f71828ed1cfdc455b6bd4fd9e7382251ea634589f8da9b12f61d40cd51",
3865
+ PKP_ETH_ADDRESS: "0x9624C46073E1d1F5AB975c67Fc899536d599bb57",
3866
+ OPERATION_AUTHORIZATION_REGISTRY: "0x75f36E772df9616d40b02092642744D6fd702Df8",
3867
+ UCD_MINT_VALIDATOR_ADDRESS: "0x4D9299055093938d0CD2F26C42A87260CB50adD8",
3868
+ UCD_MINT_VALIDATOR_VERSION: 1,
3869
+ BTC_WITHDRAWAL_VALIDATOR_ADDRESS: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2",
3870
+ BTC_WITHDRAWAL_VALIDATOR_VERSION: 1,
3871
+ UPDATE_BALANCE_VALIDATOR_ADDRESS: "0x8A40C22B03348bc10df9ae0dc54346b4AE8e909c",
3872
+ UPDATE_BALANCE_VALIDATOR_VERSION: 1,
3873
+ PROCESS_PAYMENT_VALIDATOR_ADDRESS: "0x2800E9e335e51730132f7CB9F4912bCc2ED0636C",
3874
+ PROCESS_PAYMENT_VALIDATOR_VERSION: 1,
3875
+ EXTEND_POSITION_VALIDATOR_ADDRESS: "0xa8031d1F4515Ef021A13357E8462340cE1b8711b",
3876
+ EXTEND_POSITION_VALIDATOR_VERSION: 1,
3877
+ LOAN_OPERATIONS_MANAGER_MODULE: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
3878
+ TERM_MANAGER_MODULE: "0x94Adc6F9558368B1482197584f1fc7133Ecf835b",
3879
+ COMMUNITY_MANAGER_MODULE: "0x7f8fC386fbD96ed690cdf6B1648d060d93Bf99d5",
3880
+ POSITION_MANAGER_VIEWS: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
3881
+ CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
3882
+ ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
3883
+ UCD_CONTROLLER_IMPL: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
3884
+ LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0xdEf0A042670834369d456c5fbE73ad2126008bD2",
3885
+ TERM_MANAGER_MODULE_IMPL: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
3886
+ CIRCUIT_BREAKER_MODULE_IMPL: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
3887
+ ADMIN_MODULE_IMPL: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
3888
+ POSITION_MANAGER_VIEWS_IMPL: "0x92311E348730e30237cbF0a58FaD704F8f2B8101",
3889
+ POSITION_MANAGER_IMPL: "0x623f3bDff8830d2161D3b5D42d38b39697c65eBE",
3890
+ SIMPLE_PSM_V2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
3891
+ SIMPLE_PSM_V2_IMPL: "0x0728434d86532FD67A4a7227958654C029b333F6",
3892
+ UCD_TOKEN_IMPL: "0x65c23B6fB5331ACeeC2d82328c6de7dB6b62bB65",
3893
+ POSITION_MANAGER_CORE_MODULE: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
3894
+ POSITION_MANAGER_CORE_MODULE_IMPL: "0xE3B9747af371f459B4d68D30DE5e374040eb6339",
3895
+ COLLATERAL_MANAGER_MODULE: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
3896
+ COLLATERAL_MANAGER_MODULE_IMPL: "0xC3DD73d669174ED7012579bf2dAAf77085AdD4Cf",
3897
+ LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
3898
+ LIQUIDATION_MANAGER_MODULE_IMPL: "0x8E069E4A1deba9Ac021956F3cD771e9e65d756bb",
3899
+ BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
3900
+ BTC_SPEND_AUTHORIZER_IMPL: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
3901
+ UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
3902
+ UPGRADE_VALIDATOR_IMPL: "0x535c9d66F9CFa4f2337cF6074BFc8fdcBBb9cFC4",
3903
+ BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
3904
+ BITCOIN_PROVIDER_REGISTRY_IMPL: "0x225309A4ae6D146ba93A3278A7b40224FfC81448",
3905
+ LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
3906
+ LIT_ACTION_VALIDATOR_IMPL: "0x7D2a754AaF41E135c626553000139d5039095E29",
3907
+ CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
3908
+ CONTRACT_VERSION_REGISTRY_IMPL: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
3909
+ MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
3910
+ MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
3911
+ POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
3912
+ POSITION_DELEGATE_REGISTRY_IMPL: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
3913
+ AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
3914
+ FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
3915
+ FEE_RECIPIENT_REGISTRY_IMPL: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459",
3916
+ OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x9f8072d4672d643e39d8638478e900Fea1f2c81D"
3917
+ }
3918
+ };
3919
+ SEPOLIA_CONTRACTS = {
3920
+ UpgradeValidator: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
3921
+ UCDToken: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
3922
+ UCDController: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
3923
+ PriceFeedConsumer: "0xb3Dc64501935a6f0334779126Ee37bE463cee318",
3924
+ PositionManagerCoreModule: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
3925
+ TermManagerModule: "0x94Adc6F9558368B1482197584f1fc7133Ecf835b",
3926
+ LoanOperationsManagerModule: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
3927
+ CollateralManagerModule: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
3928
+ LiquidationManagerModule: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
3929
+ CircuitBreakerModule: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
3930
+ AdminModule: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
3931
+ PositionManagerViews: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
3932
+ PositionManager: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
3933
+ OperationAuthorizationRegistry: "0x75f36E772df9616d40b02092642744D6fd702Df8",
3934
+ PKPValidation: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
3935
+ BTCSpendAuthorizer: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
3936
+ LITActionValidator: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
3937
+ SimplePSMV2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
3938
+ BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
3939
+ ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
3940
+ mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
3941
+ mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
3942
+ PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
3943
+ FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374"
3944
+ };
3945
+ LOCALHOST_DEPLOYMENT = {
3946
+ network: "localhost",
3947
+ chainId: 31337,
3948
+ timestamp: "2026-03-23T15:33:34.068Z",
3949
+ deployer: "",
3950
+ contracts: {
3951
+ MessageHashBuilder: "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E",
3952
+ UpgradeValidator: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
3953
+ UCDToken: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
3954
+ UCDController: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
3955
+ PositionManagerCoreModule: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
3956
+ TermManagerModule: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
3957
+ LoanOperationsManagerModule: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
3958
+ BTCSpendAuthorizer: "0x59b670e9fA9D0A427751Af201D676719a970857b",
3959
+ CollateralManagerModule: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
3960
+ LiquidationManagerModule: "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
3961
+ CircuitBreakerModule: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
3962
+ AdminModule: "0xc5a5C42992dECbae36851359345FE25997F5C42d",
3963
+ PositionManagerViews: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
3964
+ PositionManager: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
3965
+ OperationAuthorizationRegistry: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
3966
+ PKPValidation: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc"
3967
+ },
3968
+ latestEnv: {
3969
+ UCD_TOKEN: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
3970
+ UCD_CONTROLLER: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
3971
+ POSITION_MANAGER: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
3972
+ PKP_VALIDATION_REGISTRY: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc",
3973
+ PKP_VALIDATION_CID_V1: "QmfHJKA4RnW7RepsdLmrDwKjVTzPXB2K3qMTco3JNPDexm",
3974
+ PKP_ETH_ADDRESS: "0x9624C46073E1d1F5AB975c67Fc899536d599bb57",
3975
+ OPERATION_AUTHORIZATION_REGISTRY: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
3976
+ UCD_MINT_VALIDATOR_ADDRESS: "0x80f81afb9e6dF27afCD752ad46cD286e705e42be",
3977
+ UCD_MINT_VALIDATOR_VERSION: 1,
3978
+ BTC_WITHDRAWAL_VALIDATOR_ADDRESS: "0xa751ad81E1CAe61d6cF5Cf64839Fe8D28A1372Df",
3979
+ BTC_WITHDRAWAL_VALIDATOR_VERSION: 1,
3980
+ UPDATE_BALANCE_VALIDATOR_ADDRESS: "0x8A40C22B03348bc10df9ae0dc54346b4AE8e909c",
3981
+ UPDATE_BALANCE_VALIDATOR_VERSION: 1,
3982
+ PROCESS_PAYMENT_VALIDATOR_ADDRESS: "0x28f50E07532d3aF677b8E0bcF220422d159b0dd6",
3983
+ PROCESS_PAYMENT_VALIDATOR_VERSION: 1,
3984
+ EXTEND_POSITION_VALIDATOR_ADDRESS: "0xc7aC43F2F907123465449575e853f5D0229898e1",
3985
+ EXTEND_POSITION_VALIDATOR_VERSION: 1,
3986
+ POSITION_MANAGER_CORE_MODULE: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
3987
+ LOAN_OPERATIONS_MANAGER_MODULE: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
3988
+ TERM_MANAGER_MODULE: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
3989
+ }
3990
+ };
3991
+ LOCALHOST_CONTRACTS = {
3992
+ MessageHashBuilder: "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E",
3993
+ UpgradeValidator: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
3994
+ UCDToken: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
3995
+ UCDController: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
3996
+ PositionManagerCoreModule: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
3997
+ TermManagerModule: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
3998
+ LoanOperationsManagerModule: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
3999
+ BTCSpendAuthorizer: "0x59b670e9fA9D0A427751Af201D676719a970857b",
4000
+ CollateralManagerModule: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
4001
+ LiquidationManagerModule: "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
4002
+ CircuitBreakerModule: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
4003
+ AdminModule: "0xc5a5C42992dECbae36851359345FE25997F5C42d",
4004
+ PositionManagerViews: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
4005
+ PositionManager: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
4006
+ OperationAuthorizationRegistry: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
4007
+ PKPValidation: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc"
4008
+ };
4009
+ ALL_DEPLOYMENTS = {
4010
+ sepolia: SEPOLIA_DEPLOYMENT,
4011
+ localhost: LOCALHOST_DEPLOYMENT
4012
+ };
4013
+ ALL_CONTRACTS = {
4014
+ sepolia: SEPOLIA_CONTRACTS,
4015
+ localhost: LOCALHOST_CONTRACTS
4016
+ };
4017
+ }
4018
+ });
4019
+
3629
4020
  // node_modules/ethers/node_modules/tslib/tslib.es6.mjs
3630
4021
  var tslib_es6_exports = {};
3631
4022
  __export(tslib_es6_exports, {
@@ -18805,7 +19196,7 @@ var require_wrappers = __commonJS({
18805
19196
  }
18806
19197
  };
18807
19198
  exports.ContractTransactionReceipt = ContractTransactionReceipt2;
18808
- var ContractTransactionResponse2 = class extends provider_js_1.TransactionResponse {
19199
+ var ContractTransactionResponse3 = class extends provider_js_1.TransactionResponse {
18809
19200
  #iface;
18810
19201
  /**
18811
19202
  * @_ignore:
@@ -18831,7 +19222,7 @@ var require_wrappers = __commonJS({
18831
19222
  return new ContractTransactionReceipt2(this.#iface, this.provider, receipt);
18832
19223
  }
18833
19224
  };
18834
- exports.ContractTransactionResponse = ContractTransactionResponse2;
19225
+ exports.ContractTransactionResponse = ContractTransactionResponse3;
18835
19226
  var ContractUnknownEventPayload2 = class extends index_js_1.EventPayload {
18836
19227
  /**
18837
19228
  * The log with no matching events.
@@ -31904,7 +32295,7 @@ ${errorReport}`);
31904
32295
  }
31905
32296
  init_debug_logger();
31906
32297
  init_session_signature_cache();
31907
- var import_ethers12 = require_lib2();
32298
+ var import_ethers13 = require_lib2();
31908
32299
  var ACTIVE_LOAN_LIQUIDATION_THRESHOLD_BPS = 13e3;
31909
32300
  var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
31910
32301
  var GRACE_PERIOD_DAYS = 30;
@@ -34221,12 +34612,12 @@ ${errorReport}`);
34221
34612
  }
34222
34613
  async function executeVaultSnapshot(params) {
34223
34614
  global.ethers = {
34224
- ...import_ethers12.ethers,
34615
+ ...import_ethers13.ethers,
34225
34616
  providers: {
34226
- StaticJsonRpcProvider: import_ethers12.ethers.JsonRpcProvider
34617
+ StaticJsonRpcProvider: import_ethers13.ethers.JsonRpcProvider
34227
34618
  },
34228
- Contract: import_ethers12.ethers.Contract,
34229
- utils: import_ethers12.ethers
34619
+ Contract: import_ethers13.ethers.Contract,
34620
+ utils: import_ethers13.ethers
34230
34621
  // v6 moved utils to top level
34231
34622
  };
34232
34623
  global.Lit = {
@@ -34373,388 +34764,6 @@ ${errorReport}`);
34373
34764
  }
34374
34765
  });
34375
34766
 
34376
- // src/constants/chunks/deployment-addresses.ts
34377
- var deployment_addresses_exports = {};
34378
- __export(deployment_addresses_exports, {
34379
- ALL_CONTRACTS: () => ALL_CONTRACTS,
34380
- ALL_DEPLOYMENTS: () => ALL_DEPLOYMENTS,
34381
- LOCALHOST_CONTRACTS: () => LOCALHOST_CONTRACTS,
34382
- LOCALHOST_DEPLOYMENT: () => LOCALHOST_DEPLOYMENT,
34383
- SEPOLIA_CONTRACTS: () => SEPOLIA_CONTRACTS,
34384
- SEPOLIA_DEPLOYMENT: () => SEPOLIA_DEPLOYMENT,
34385
- getContractsByNetwork: () => getContractsByNetwork,
34386
- getDeploymentByNetwork: () => getDeploymentByNetwork
34387
- });
34388
- function getDeploymentByNetwork(network) {
34389
- return ALL_DEPLOYMENTS[network] || null;
34390
- }
34391
- function getContractsByNetwork(network) {
34392
- return ALL_CONTRACTS[network] || null;
34393
- }
34394
- var SEPOLIA_DEPLOYMENT, SEPOLIA_CONTRACTS, LOCALHOST_DEPLOYMENT, LOCALHOST_CONTRACTS, ALL_DEPLOYMENTS, ALL_CONTRACTS;
34395
- var init_deployment_addresses = __esm({
34396
- "src/constants/chunks/deployment-addresses.ts"() {
34397
- "use strict";
34398
- SEPOLIA_DEPLOYMENT = {
34399
- network: "sepolia",
34400
- chainId: 11155111,
34401
- timestamp: "2026-03-13T20:04:15.417Z",
34402
- deployer: "",
34403
- contracts: {
34404
- UpgradeValidator: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
34405
- UCDToken: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
34406
- UCDController: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
34407
- PriceFeedConsumer: "0xb3Dc64501935a6f0334779126Ee37bE463cee318",
34408
- PositionManagerCoreModule: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
34409
- TermManagerModule: "0x94Adc6F9558368B1482197584f1fc7133Ecf835b",
34410
- LoanOperationsManagerModule: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
34411
- CollateralManagerModule: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
34412
- LiquidationManagerModule: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
34413
- CircuitBreakerModule: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
34414
- AdminModule: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
34415
- PositionManagerViews: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
34416
- PositionManager: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
34417
- OperationAuthorizationRegistry: "0xb295050EBCE12aD5f228bB2C4C31fCb24a79257C",
34418
- PKPValidation: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
34419
- BTCSpendAuthorizer: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
34420
- LITActionValidator: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
34421
- SimplePSMV2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
34422
- BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
34423
- ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
34424
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
34425
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
34426
- PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
34427
- FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374"
34428
- },
34429
- upgraded: {
34430
- PositionManager: {
34431
- previousImplementation: "0xc7Bc4ead66D24C0a4dCe088176F0fC8DF54579d4",
34432
- newImplementation: "0x5492b2cE6138c1750BDD8DbB15Dc0ea00A5CF241",
34433
- upgradedAt: "2026-05-14T18:44:37.112Z",
34434
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34435
- reason: "Shared upgrade script: PositionManager implementation update"
34436
- },
34437
- LoanOperationsManagerModule: {
34438
- previousImplementation: "0x1db353Dad5818e00F073e4F73f66B6028Ee71DDC",
34439
- newImplementation: "0x3C1d7887858f106e43aa48bBF0D86C6EBA979980",
34440
- upgradedAt: "2026-05-14T16:24:49.712Z",
34441
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34442
- reason: "Shared upgrade script: LoanOperationsManagerModule implementation update"
34443
- },
34444
- UCDController: {
34445
- previousImplementation: "0x0F7c669c891C6534Bfef222B0A6bc9B71c256C58",
34446
- newImplementation: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
34447
- upgradedAt: "2026-05-14T16:04:12.854Z",
34448
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34449
- reason: "Shared upgrade script: UCDController implementation update"
34450
- },
34451
- TermManagerModule: {
34452
- previousImplementation: "0x55d6c44162715802d912c4f2B9A7f4Bc06638804",
34453
- newImplementation: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
34454
- upgradedAt: "2026-05-14T16:08:36.848Z",
34455
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34456
- reason: "Shared upgrade script: TermManagerModule implementation update"
34457
- },
34458
- CircuitBreakerModule: {
34459
- previousImplementation: "0xd0B03c92854b9A260cBd2853f7CB0E29Edb78Ef8",
34460
- newImplementation: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
34461
- upgradedAt: "2026-05-14T16:14:25.887Z",
34462
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34463
- reason: "Shared upgrade script: CircuitBreakerModule implementation update"
34464
- },
34465
- AdminModule: {
34466
- previousImplementation: "0x79A7FBb522Ba6629236590958e7F2B07103c3871",
34467
- newImplementation: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
34468
- upgradedAt: "2026-05-14T16:16:37.959Z",
34469
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34470
- reason: "Shared upgrade script: AdminModule implementation update"
34471
- },
34472
- PositionManagerViews: {
34473
- previousImplementation: "0x92311E348730e30237cbF0a58FaD704F8f2B8101",
34474
- newImplementation: "0xBd1F92F24E89cC55acFc422eCA0df00F68B99565",
34475
- upgradedAt: "2026-05-14T18:42:37.153Z",
34476
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34477
- reason: "Shared upgrade script: PositionManagerViews implementation update"
34478
- },
34479
- TestPositionManager: {
34480
- previousImplementation: "0x0B46Ee1a9C6b42559758B7FF78294Cd867BB08f8",
34481
- newImplementation: "0x0B46Ee1a9C6b42559758B7FF78294Cd867BB08f8",
34482
- upgradedAt: "2026-03-17T15:18:07.382Z",
34483
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34484
- reason: "Add setPositionExpiry() for expiry-liquidation E2E testing"
34485
- },
34486
- UCDToken: {
34487
- previousImplementation: "0x9b6bD0220045010a7D5762f05A3C17982996cb96",
34488
- newImplementation: "0x65c23B6fB5331ACeeC2d82328c6de7dB6b62bB65",
34489
- upgradedAt: "2026-05-13T17:23:49.158Z",
34490
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34491
- reason: "Shared upgrade script: UCDToken implementation update"
34492
- },
34493
- PositionManagerCoreModule: {
34494
- previousImplementation: "0xE3B9747af371f459B4d68D30DE5e374040eb6339",
34495
- newImplementation: "0x2e34353852d95f8D39aE648af817de9f750c84D6",
34496
- upgradedAt: "2026-05-14T18:37:36.484Z",
34497
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34498
- reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
34499
- },
34500
- CollateralManagerModule: {
34501
- previousImplementation: "0x895E916EC5A056d03099631D193AffFd9Cc2B3DF",
34502
- newImplementation: "0xC3DD73d669174ED7012579bf2dAAf77085AdD4Cf",
34503
- upgradedAt: "2026-05-14T16:10:37.540Z",
34504
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34505
- reason: "Shared upgrade script: CollateralManagerModule implementation update"
34506
- },
34507
- LiquidationManagerModule: {
34508
- previousImplementation: "0x104a3bF95fC924f310a1e1C809fe2c8b71D08A1B",
34509
- newImplementation: "0x8E069E4A1deba9Ac021956F3cD771e9e65d756bb",
34510
- upgradedAt: "2026-05-14T16:12:24.858Z",
34511
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34512
- reason: "Shared upgrade script: LiquidationManagerModule implementation update"
34513
- },
34514
- BTCSpendAuthorizer: {
34515
- previousImplementation: "0xE9b5ECd4cca90a4BdB74b472876D7F60aCEc6314",
34516
- newImplementation: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
34517
- upgradedAt: "2026-05-14T16:18:26.340Z",
34518
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34519
- reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
34520
- },
34521
- SimplePSMV2: {
34522
- previousImplementation: "0x1aA5d2407B937B8f0F07932B8050ad23713873eC",
34523
- newImplementation: "0x0728434d86532FD67A4a7227958654C029b333F6",
34524
- upgradedAt: "2026-05-14T16:26:36.862Z",
34525
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34526
- reason: "Shared upgrade script: SimplePSMV2 implementation update"
34527
- },
34528
- UpgradeValidator: {
34529
- previousImplementation: "0xEFf189e5872bC7158191eD39d31E745aF2A6FDa7",
34530
- newImplementation: "0x535c9d66F9CFa4f2337cF6074BFc8fdcBBb9cFC4",
34531
- upgradedAt: "2026-05-14T16:28:13.597Z",
34532
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34533
- reason: "Shared upgrade script: UpgradeValidator implementation update"
34534
- },
34535
- LITActionValidator: {
34536
- previousImplementation: "0x4548bbF8e0798Aa883604F3ae44EDFc1BAc8278c",
34537
- newImplementation: "0x7D2a754AaF41E135c626553000139d5039095E29",
34538
- upgradedAt: "2026-04-22T11:46:48.503Z",
34539
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34540
- reason: "Fresh UUPS proxy deployment (v2.1.0). Previous address was a plain implementation contract with _disableInitializers() \u2014 no proxy, no live state to migrate."
34541
- },
34542
- ContractVersionRegistry: {
34543
- previousImplementation: "0x8F86F78a6902b2B9a092158fF03BCCe301FB3d6b",
34544
- newImplementation: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
34545
- upgradedAt: "2026-05-14T16:02:24.973Z",
34546
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34547
- reason: "Shared upgrade script: ContractVersionRegistry implementation update"
34548
- },
34549
- PositionDelegateRegistry: {
34550
- previousImplementation: "0x3852Cd9495AF48166229271B81ac4e925F451dee",
34551
- newImplementation: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
34552
- upgradedAt: "2026-05-14T16:30:13.519Z",
34553
- upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34554
- reason: "Shared upgrade script: PositionDelegateRegistry implementation update"
34555
- }
34556
- },
34557
- history: {
34558
- LoanOperationsManagerModule: {
34559
- previous: "0x48D46188e25452148A743f8f6599b0E66C178512",
34560
- new: "0x1f70024444C5E89fFC232d2768C0359F7a13c6e7",
34561
- reason: "Storage layout scrambled \u2014 fresh deploy with F20 admin",
34562
- deployedAt: "2026-03-12T10:28:15.833Z",
34563
- deployedBy: "0x2767441E044aCd9bbC21a759fB0517494875092d"
34564
- },
34565
- freshDeploy: {
34566
- reason: "Full fresh deploy \u2014 F20 as admin, correct AdminModule on PM, no 0x276 dependency",
34567
- deployedAt: "2026-03-12T11:07:45.335Z",
34568
- deployedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34569
- old: {
34570
- UCDToken: "0x86060fa5b3e01e003b8afd9c1295f1f444a7dc60",
34571
- UCDController: "0x703Ce9a94A8e42EC48499a79ef5c38a37664Fc5a",
34572
- PositionManagerCoreModule: "0x3Ff6F2E40B0d7c0557Da8fd04F699198Bdcb1b4C",
34573
- LiquidationManagerModule: "0xAC3886766Ac20d379b069BdFB97e401aBad6188C",
34574
- LoanOperationsManagerModule: "0x1f70024444C5E89fFC232d2768C0359F7a13c6e7",
34575
- CollateralManagerModule: "0x34E3DcA5d00570f323c62f09f46D8314674de723",
34576
- PositionManagerViews: "0xAC32f1845ace22e012aF30760fe9296b9aEb8a45",
34577
- PositionManager: "0x141D078A82F093F4Ea8345b9Bc9999C9008619Ae"
34578
- },
34579
- new: {
34580
- UCDToken: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
34581
- UCDController: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
34582
- PositionManagerCoreModule: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
34583
- LiquidationManagerModule: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
34584
- LoanOperationsManagerModule: "0xD3ADCCe9b46287763f723dC9a3FCfa59ab74b8bB",
34585
- CollateralManagerModule: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
34586
- PositionManagerViews: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
34587
- PositionManager: "0xc767484Cced727D3fC0c5C2872BA6549967d7517"
34588
- }
34589
- }
34590
- },
34591
- pkpValidationDeployed: {
34592
- address: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
34593
- deployedAt: "2026-04-21T09:27:25.783Z",
34594
- deployedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
34595
- setPKPValidationRegistryTx: "0xddc776e0120bfee2eb53c33e058501fe0bd2cfb769083d2e37bc7064edda2c59",
34596
- replacedAddress: "0xA95C81020713158a88616a6Db88d3d6293968CEB"
34597
- },
34598
- latestEnv: {
34599
- UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
34600
- UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
34601
- POSITION_MANAGER: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
34602
- PKP_VALIDATION_REGISTRY: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
34603
- PKP_VALIDATION_CID_V1: "0x1220246b43f71828ed1cfdc455b6bd4fd9e7382251ea634589f8da9b12f61d40cd51",
34604
- PKP_ETH_ADDRESS: "0x9624C46073E1d1F5AB975c67Fc899536d599bb57",
34605
- OPERATION_AUTHORIZATION_REGISTRY: "0xb295050EBCE12aD5f228bB2C4C31fCb24a79257C",
34606
- UCD_MINT_VALIDATOR_ADDRESS: "0x4D9299055093938d0CD2F26C42A87260CB50adD8",
34607
- UCD_MINT_VALIDATOR_VERSION: 1,
34608
- BTC_WITHDRAWAL_VALIDATOR_ADDRESS: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2",
34609
- BTC_WITHDRAWAL_VALIDATOR_VERSION: 1,
34610
- UPDATE_BALANCE_VALIDATOR_ADDRESS: "0x8A40C22B03348bc10df9ae0dc54346b4AE8e909c",
34611
- UPDATE_BALANCE_VALIDATOR_VERSION: 1,
34612
- PROCESS_PAYMENT_VALIDATOR_ADDRESS: "0x2800E9e335e51730132f7CB9F4912bCc2ED0636C",
34613
- PROCESS_PAYMENT_VALIDATOR_VERSION: 1,
34614
- EXTEND_POSITION_VALIDATOR_ADDRESS: "0xa8031d1F4515Ef021A13357E8462340cE1b8711b",
34615
- EXTEND_POSITION_VALIDATOR_VERSION: 1,
34616
- LOAN_OPERATIONS_MANAGER_MODULE: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
34617
- TERM_MANAGER_MODULE: "0x94Adc6F9558368B1482197584f1fc7133Ecf835b",
34618
- COMMUNITY_MANAGER_MODULE: "0x7f8fC386fbD96ed690cdf6B1648d060d93Bf99d5",
34619
- POSITION_MANAGER_VIEWS: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
34620
- CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
34621
- ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
34622
- UCD_CONTROLLER_IMPL: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
34623
- LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x3C1d7887858f106e43aa48bBF0D86C6EBA979980",
34624
- TERM_MANAGER_MODULE_IMPL: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
34625
- CIRCUIT_BREAKER_MODULE_IMPL: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
34626
- ADMIN_MODULE_IMPL: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
34627
- POSITION_MANAGER_VIEWS_IMPL: "0x92311E348730e30237cbF0a58FaD704F8f2B8101",
34628
- POSITION_MANAGER_IMPL: "0x5492b2cE6138c1750BDD8DbB15Dc0ea00A5CF241",
34629
- SIMPLE_PSM_V2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
34630
- SIMPLE_PSM_V2_IMPL: "0x0728434d86532FD67A4a7227958654C029b333F6",
34631
- UCD_TOKEN_IMPL: "0x65c23B6fB5331ACeeC2d82328c6de7dB6b62bB65",
34632
- POSITION_MANAGER_CORE_MODULE: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
34633
- POSITION_MANAGER_CORE_MODULE_IMPL: "0xE3B9747af371f459B4d68D30DE5e374040eb6339",
34634
- COLLATERAL_MANAGER_MODULE: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
34635
- COLLATERAL_MANAGER_MODULE_IMPL: "0xC3DD73d669174ED7012579bf2dAAf77085AdD4Cf",
34636
- LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
34637
- LIQUIDATION_MANAGER_MODULE_IMPL: "0x8E069E4A1deba9Ac021956F3cD771e9e65d756bb",
34638
- BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
34639
- BTC_SPEND_AUTHORIZER_IMPL: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
34640
- UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
34641
- UPGRADE_VALIDATOR_IMPL: "0x535c9d66F9CFa4f2337cF6074BFc8fdcBBb9cFC4",
34642
- BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
34643
- BITCOIN_PROVIDER_REGISTRY_IMPL: "0x225309A4ae6D146ba93A3278A7b40224FfC81448",
34644
- LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
34645
- LIT_ACTION_VALIDATOR_IMPL: "0x7D2a754AaF41E135c626553000139d5039095E29",
34646
- CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
34647
- CONTRACT_VERSION_REGISTRY_IMPL: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
34648
- MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
34649
- MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
34650
- POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
34651
- POSITION_DELEGATE_REGISTRY_IMPL: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
34652
- AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
34653
- FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
34654
- FEE_RECIPIENT_REGISTRY_IMPL: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459"
34655
- }
34656
- };
34657
- SEPOLIA_CONTRACTS = {
34658
- UpgradeValidator: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
34659
- UCDToken: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
34660
- UCDController: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
34661
- PriceFeedConsumer: "0xb3Dc64501935a6f0334779126Ee37bE463cee318",
34662
- PositionManagerCoreModule: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
34663
- TermManagerModule: "0x94Adc6F9558368B1482197584f1fc7133Ecf835b",
34664
- LoanOperationsManagerModule: "0x3e05e760a87715207b7F4e8fD35EF7559BcA72C0",
34665
- CollateralManagerModule: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
34666
- LiquidationManagerModule: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
34667
- CircuitBreakerModule: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
34668
- AdminModule: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
34669
- PositionManagerViews: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
34670
- PositionManager: "0x68e0507D982AEBF1D1C1Af8FBbd842327e2deeFF",
34671
- OperationAuthorizationRegistry: "0xb295050EBCE12aD5f228bB2C4C31fCb24a79257C",
34672
- PKPValidation: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4",
34673
- BTCSpendAuthorizer: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
34674
- LITActionValidator: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
34675
- SimplePSMV2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
34676
- BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
34677
- ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
34678
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
34679
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
34680
- PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
34681
- FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374"
34682
- };
34683
- LOCALHOST_DEPLOYMENT = {
34684
- network: "localhost",
34685
- chainId: 31337,
34686
- timestamp: "2026-03-23T15:33:34.068Z",
34687
- deployer: "",
34688
- contracts: {
34689
- MessageHashBuilder: "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E",
34690
- UpgradeValidator: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
34691
- UCDToken: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
34692
- UCDController: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
34693
- PositionManagerCoreModule: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
34694
- TermManagerModule: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
34695
- LoanOperationsManagerModule: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
34696
- BTCSpendAuthorizer: "0x59b670e9fA9D0A427751Af201D676719a970857b",
34697
- CollateralManagerModule: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
34698
- LiquidationManagerModule: "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
34699
- CircuitBreakerModule: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
34700
- AdminModule: "0xc5a5C42992dECbae36851359345FE25997F5C42d",
34701
- PositionManagerViews: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
34702
- PositionManager: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
34703
- OperationAuthorizationRegistry: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
34704
- PKPValidation: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc"
34705
- },
34706
- latestEnv: {
34707
- UCD_TOKEN: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
34708
- UCD_CONTROLLER: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
34709
- POSITION_MANAGER: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
34710
- PKP_VALIDATION_REGISTRY: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc",
34711
- PKP_VALIDATION_CID_V1: "QmfHJKA4RnW7RepsdLmrDwKjVTzPXB2K3qMTco3JNPDexm",
34712
- PKP_ETH_ADDRESS: "0x9624C46073E1d1F5AB975c67Fc899536d599bb57",
34713
- OPERATION_AUTHORIZATION_REGISTRY: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
34714
- UCD_MINT_VALIDATOR_ADDRESS: "0x80f81afb9e6dF27afCD752ad46cD286e705e42be",
34715
- UCD_MINT_VALIDATOR_VERSION: 1,
34716
- BTC_WITHDRAWAL_VALIDATOR_ADDRESS: "0xa751ad81E1CAe61d6cF5Cf64839Fe8D28A1372Df",
34717
- BTC_WITHDRAWAL_VALIDATOR_VERSION: 1,
34718
- UPDATE_BALANCE_VALIDATOR_ADDRESS: "0x8A40C22B03348bc10df9ae0dc54346b4AE8e909c",
34719
- UPDATE_BALANCE_VALIDATOR_VERSION: 1,
34720
- PROCESS_PAYMENT_VALIDATOR_ADDRESS: "0x28f50E07532d3aF677b8E0bcF220422d159b0dd6",
34721
- PROCESS_PAYMENT_VALIDATOR_VERSION: 1,
34722
- EXTEND_POSITION_VALIDATOR_ADDRESS: "0xc7aC43F2F907123465449575e853f5D0229898e1",
34723
- EXTEND_POSITION_VALIDATOR_VERSION: 1,
34724
- POSITION_MANAGER_CORE_MODULE: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
34725
- LOAN_OPERATIONS_MANAGER_MODULE: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
34726
- TERM_MANAGER_MODULE: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
34727
- }
34728
- };
34729
- LOCALHOST_CONTRACTS = {
34730
- MessageHashBuilder: "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E",
34731
- UpgradeValidator: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
34732
- UCDToken: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
34733
- UCDController: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
34734
- PositionManagerCoreModule: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
34735
- TermManagerModule: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
34736
- LoanOperationsManagerModule: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
34737
- BTCSpendAuthorizer: "0x59b670e9fA9D0A427751Af201D676719a970857b",
34738
- CollateralManagerModule: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
34739
- LiquidationManagerModule: "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
34740
- CircuitBreakerModule: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
34741
- AdminModule: "0xc5a5C42992dECbae36851359345FE25997F5C42d",
34742
- PositionManagerViews: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
34743
- PositionManager: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
34744
- OperationAuthorizationRegistry: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
34745
- PKPValidation: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc"
34746
- };
34747
- ALL_DEPLOYMENTS = {
34748
- sepolia: SEPOLIA_DEPLOYMENT,
34749
- localhost: LOCALHOST_DEPLOYMENT
34750
- };
34751
- ALL_CONTRACTS = {
34752
- sepolia: SEPOLIA_CONTRACTS,
34753
- localhost: LOCALHOST_CONTRACTS
34754
- };
34755
- }
34756
- });
34757
-
34758
34767
  // src/constants/chunks/network-configs.ts
34759
34768
  var network_configs_exports = {};
34760
34769
  __export(network_configs_exports, {
@@ -48467,6 +48476,109 @@ function _ContractBase() {
48467
48476
  var Contract = class extends _ContractBase() {
48468
48477
  };
48469
48478
 
48479
+ // node_modules/ethers/lib.esm/contract/factory.js
48480
+ var ContractFactory = class _ContractFactory {
48481
+ /**
48482
+ * The Contract Interface.
48483
+ */
48484
+ interface;
48485
+ /**
48486
+ * The Contract deployment bytecode. Often called the initcode.
48487
+ */
48488
+ bytecode;
48489
+ /**
48490
+ * The ContractRunner to deploy the Contract as.
48491
+ */
48492
+ runner;
48493
+ /**
48494
+ * Create a new **ContractFactory** with %%abi%% and %%bytecode%%,
48495
+ * optionally connected to %%runner%%.
48496
+ *
48497
+ * The %%bytecode%% may be the ``bytecode`` property within the
48498
+ * standard Solidity JSON output.
48499
+ */
48500
+ constructor(abi, bytecode, runner) {
48501
+ const iface = Interface.from(abi);
48502
+ if (bytecode instanceof Uint8Array) {
48503
+ bytecode = hexlify(getBytes(bytecode));
48504
+ } else {
48505
+ if (typeof bytecode === "object") {
48506
+ bytecode = bytecode.object;
48507
+ }
48508
+ if (!bytecode.startsWith("0x")) {
48509
+ bytecode = "0x" + bytecode;
48510
+ }
48511
+ bytecode = hexlify(getBytes(bytecode));
48512
+ }
48513
+ defineProperties(this, {
48514
+ bytecode,
48515
+ interface: iface,
48516
+ runner: runner || null
48517
+ });
48518
+ }
48519
+ attach(target) {
48520
+ return new BaseContract(target, this.interface, this.runner);
48521
+ }
48522
+ /**
48523
+ * Resolves to the transaction to deploy the contract, passing %%args%%
48524
+ * into the constructor.
48525
+ */
48526
+ async getDeployTransaction(...args) {
48527
+ let overrides = {};
48528
+ const fragment = this.interface.deploy;
48529
+ if (fragment.inputs.length + 1 === args.length) {
48530
+ overrides = await copyOverrides(args.pop());
48531
+ }
48532
+ if (fragment.inputs.length !== args.length) {
48533
+ throw new Error("incorrect number of arguments to constructor");
48534
+ }
48535
+ const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);
48536
+ const data = concat([this.bytecode, this.interface.encodeDeploy(resolvedArgs)]);
48537
+ return Object.assign({}, overrides, { data });
48538
+ }
48539
+ /**
48540
+ * Resolves to the Contract deployed by passing %%args%% into the
48541
+ * constructor.
48542
+ *
48543
+ * This will resolve to the Contract before it has been deployed to the
48544
+ * network, so the [[BaseContract-waitForDeployment]] should be used before
48545
+ * sending any transactions to it.
48546
+ */
48547
+ async deploy(...args) {
48548
+ const tx = await this.getDeployTransaction(...args);
48549
+ assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", {
48550
+ operation: "sendTransaction"
48551
+ });
48552
+ const sentTx = await this.runner.sendTransaction(tx);
48553
+ const address = getCreateAddress(sentTx);
48554
+ return new BaseContract(address, this.interface, this.runner, sentTx);
48555
+ }
48556
+ /**
48557
+ * Return a new **ContractFactory** with the same ABI and bytecode,
48558
+ * but connected to %%runner%%.
48559
+ */
48560
+ connect(runner) {
48561
+ return new _ContractFactory(this.interface, this.bytecode, runner);
48562
+ }
48563
+ /**
48564
+ * Create a new **ContractFactory** from the standard Solidity JSON output.
48565
+ */
48566
+ static fromSolidity(output, runner) {
48567
+ assertArgument(output != null, "bad compiler output", "output", output);
48568
+ if (typeof output === "string") {
48569
+ output = JSON.parse(output);
48570
+ }
48571
+ const abi = output.abi;
48572
+ let bytecode = "";
48573
+ if (output.bytecode) {
48574
+ bytecode = output.bytecode;
48575
+ } else if (output.evm && output.evm.bytecode) {
48576
+ bytecode = output.evm.bytecode;
48577
+ }
48578
+ return new this(abi, bytecode, runner);
48579
+ }
48580
+ };
48581
+
48470
48582
  // node_modules/ethers/lib.esm/providers/ens-resolver.js
48471
48583
  function getIpfsLink(link) {
48472
48584
  if (link.match(/^ipfs:\/\/ipfs\//i)) {
@@ -53773,6 +53885,7 @@ function extractOptionalLitSignature(raw) {
53773
53885
  }
53774
53886
 
53775
53887
  // src/modules/contract/contract-manager.module.ts
53888
+ init_deployment_addresses();
53776
53889
  var POSITION_MANAGER_ABI = [
53777
53890
  "function createPosition(bytes32 pkpId, bytes calldata validatorSignature, string mainnetVaultAddress, string regtestVaultAddress, uint256 selectedTermMonths, uint256 validatorVersion, bytes calldata pkpPublicKey) external returns (bytes32 positionId)",
53778
53891
  "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)",
@@ -54044,6 +54157,15 @@ var ContractManager = class {
54044
54157
  getContractAddresses() {
54045
54158
  return this.config.contractAddresses;
54046
54159
  }
54160
+ /**
54161
+ * Get the full deployment map for the configured network.
54162
+ * Returns all deployed contracts (including admin-surface ones not needed at runtime),
54163
+ * keyed by PascalCase contract name matching the deployment JSON.
54164
+ * Returns null if the network name is unknown.
54165
+ */
54166
+ getDeploymentAddresses() {
54167
+ return this.config.networkName ? getContractsByNetwork(this.config.networkName) : null;
54168
+ }
54047
54169
  /**
54048
54170
  * Get the network chain ID from the provider
54049
54171
  */
@@ -56065,7 +56187,8 @@ var LoanQuery = class {
56065
56187
  statusUpdates: events.statusUpdates.length,
56066
56188
  liquidated: !!events.liquidation,
56067
56189
  mints: events.mints.length,
56068
- feeDistributions: events.feeDistributions.length
56190
+ renewals: events.renewals.length,
56191
+ withdrawals: events.withdrawals.length
56069
56192
  });
56070
56193
  }
56071
56194
  return events;
@@ -58185,6 +58308,7 @@ var DiamondHandsGraph = class {
58185
58308
  orderDirection = "desc"
58186
58309
  } = filter || {};
58187
58310
  const shouldQuery = {
58311
+ positionCreated: !eventTypes || eventTypes.includes("positionCreated"),
58188
58312
  payment: !eventTypes || eventTypes.includes("payment"),
58189
58313
  status: !eventTypes || eventTypes.includes("status"),
58190
58314
  liquidation: !eventTypes || eventTypes.includes("liquidation"),
@@ -58194,13 +58318,7 @@ var DiamondHandsGraph = class {
58194
58318
  operationFailure: !eventTypes || eventTypes.includes("operationFailure"),
58195
58319
  mintRequest: !eventTypes || eventTypes.includes("mintRequest"),
58196
58320
  burnRequest: !eventTypes || eventTypes.includes("burnRequest"),
58197
- collateralEvent: !eventTypes || eventTypes.includes("collateralEvent"),
58198
- circuitBreaker: !eventTypes || eventTypes.includes("circuitBreaker"),
58199
- termFeeUpdate: !eventTypes || eventTypes.includes("termFeeUpdate"),
58200
- loanProtocolParamUpdate: !eventTypes || eventTypes.includes("loanProtocolParamUpdate"),
58201
- maxLoanValueUpdate: !eventTypes || eventTypes.includes("maxLoanValueUpdate"),
58202
- btcPriceBoundsUpdate: !eventTypes || eventTypes.includes("btcPriceBoundsUpdate"),
58203
- perUserMintLimitUpdate: !eventTypes || eventTypes.includes("perUserMintLimitUpdate")
58321
+ collateralEvent: !eventTypes || eventTypes.includes("collateralEvent")
58204
58322
  };
58205
58323
  const buildPositionWhereClause = () => {
58206
58324
  const conditions = [`position: "${positionId.toLowerCase()}"`];
@@ -58214,18 +58332,6 @@ var DiamondHandsGraph = class {
58214
58332
  conditions.push(`blockNumber_lte: "${toBlock}"`);
58215
58333
  return `where: { ${conditions.join(", ")} }`;
58216
58334
  };
58217
- const buildProtocolWhereClause = () => {
58218
- const conditions = [];
58219
- if (fromTimestamp)
58220
- conditions.push(`timestamp_gte: "${fromTimestamp}"`);
58221
- if (toTimestamp)
58222
- conditions.push(`timestamp_lte: "${toTimestamp}"`);
58223
- if (fromBlock)
58224
- conditions.push(`blockNumber_gte: "${fromBlock}"`);
58225
- if (toBlock)
58226
- conditions.push(`blockNumber_lte: "${toBlock}"`);
58227
- return conditions.length > 0 ? `where: { ${conditions.join(", ")} }` : "";
58228
- };
58229
58335
  const query = `
58230
58336
  query GetLoanEvents($positionId: Bytes!, $limit: Int!, $orderDirection: OrderDirection!) {
58231
58337
  position(id: $positionId) {
@@ -58235,7 +58341,6 @@ var DiamondHandsGraph = class {
58235
58341
  first: $limit,
58236
58342
  orderBy: timestamp,
58237
58343
  orderDirection: $orderDirection
58238
- ${buildProtocolWhereClause()}
58239
58344
  ) {
58240
58345
  id
58241
58346
  payer { id }
@@ -58247,15 +58352,13 @@ var DiamondHandsGraph = class {
58247
58352
  logIndex
58248
58353
  newDebt
58249
58354
  newCollateralRatio
58250
- }
58251
- ` : ""}
58355
+ }` : ""}
58252
58356
 
58253
58357
  ${shouldQuery.status ? `
58254
58358
  statusUpdates(
58255
58359
  first: $limit,
58256
58360
  orderBy: timestamp,
58257
58361
  orderDirection: $orderDirection
58258
- ${buildProtocolWhereClause()}
58259
58362
  ) {
58260
58363
  id
58261
58364
  oldStatus
@@ -58264,8 +58367,7 @@ var DiamondHandsGraph = class {
58264
58367
  timestamp
58265
58368
  blockNumber
58266
58369
  transactionHash
58267
- }
58268
- ` : ""}
58370
+ }` : ""}
58269
58371
 
58270
58372
  ${shouldQuery.liquidation ? `
58271
58373
  liquidation {
@@ -58279,8 +58381,7 @@ var DiamondHandsGraph = class {
58279
58381
  commitHash
58280
58382
  commitTimestamp
58281
58383
  revealDelay
58282
- }
58283
- ` : ""}
58384
+ }` : ""}
58284
58385
 
58285
58386
  ${shouldQuery.withdrawal ? `
58286
58387
  withdrawals(
@@ -58296,8 +58397,7 @@ var DiamondHandsGraph = class {
58296
58397
  blockNumber
58297
58398
  transactionHash
58298
58399
  logIndex
58299
- }
58300
- ` : ""}
58400
+ }` : ""}
58301
58401
 
58302
58402
  ${shouldQuery.renewal ? `
58303
58403
  renewals(
@@ -58313,8 +58413,7 @@ var DiamondHandsGraph = class {
58313
58413
  blockNumber
58314
58414
  transactionHash
58315
58415
  logIndex
58316
- }
58317
- ` : ""}
58416
+ }` : ""}
58318
58417
 
58319
58418
  ${shouldQuery.operationFailure ? `
58320
58419
  operationFailures(
@@ -58331,8 +58430,7 @@ var DiamondHandsGraph = class {
58331
58430
  blockNumber
58332
58431
  transactionHash
58333
58432
  logIndex
58334
- }
58335
- ` : ""}
58433
+ }` : ""}
58336
58434
 
58337
58435
  ${shouldQuery.mintRequest ? `
58338
58436
  mintRequests(
@@ -58354,8 +58452,7 @@ var DiamondHandsGraph = class {
58354
58452
  blockNumber
58355
58453
  transactionHash
58356
58454
  logIndex
58357
- }
58358
- ` : ""}
58455
+ }` : ""}
58359
58456
 
58360
58457
  ${shouldQuery.burnRequest ? `
58361
58458
  burnRequests(
@@ -58374,10 +58471,27 @@ var DiamondHandsGraph = class {
58374
58471
  blockNumber
58375
58472
  transactionHash
58376
58473
  logIndex
58377
- }
58378
- ` : ""}
58474
+ }` : ""}
58379
58475
  }
58380
58476
 
58477
+ ${shouldQuery.positionCreated ? `
58478
+ positionCreatedEvents(
58479
+ ${buildPositionWhereClause()}
58480
+ first: 1,
58481
+ orderBy: timestamp,
58482
+ orderDirection: asc
58483
+ ) {
58484
+ id
58485
+ pkpId
58486
+ borrower { id }
58487
+ requestedCollateralRatio
58488
+ selectedTerm
58489
+ expiryAt
58490
+ timestamp
58491
+ blockNumber
58492
+ transactionHash
58493
+ }` : ""}
58494
+
58381
58495
  ${shouldQuery.mint ? `
58382
58496
  ucdmintEvents(
58383
58497
  ${buildPositionWhereClause()}
@@ -58393,8 +58507,7 @@ var DiamondHandsGraph = class {
58393
58507
  timestamp
58394
58508
  blockNumber
58395
58509
  transactionHash
58396
- }
58397
- ` : ""}
58510
+ }` : ""}
58398
58511
 
58399
58512
  ${shouldQuery.collateralEvent ? `
58400
58513
  collateralEvents(
@@ -58412,116 +58525,7 @@ var DiamondHandsGraph = class {
58412
58525
  blockNumber
58413
58526
  transactionHash
58414
58527
  logIndex
58415
- }
58416
- ` : ""}
58417
-
58418
- ${shouldQuery.circuitBreaker ? `
58419
- circuitBreakerEvents(
58420
- ${buildProtocolWhereClause()}
58421
- first: $limit,
58422
- orderBy: timestamp,
58423
- orderDirection: $orderDirection
58424
- ) {
58425
- id
58426
- isActivated
58427
- admin
58428
- reason
58429
- timestamp
58430
- blockNumber
58431
- transactionHash
58432
- }
58433
- ` : ""}
58434
-
58435
- ${shouldQuery.termFeeUpdate ? `
58436
- termFeeUpdates(
58437
- ${buildProtocolWhereClause()}
58438
- first: $limit,
58439
- orderBy: timestamp,
58440
- orderDirection: $orderDirection
58441
- ) {
58442
- id
58443
- term { id }
58444
- oldOriginationFee
58445
- newOriginationFee
58446
- oldExtensionFee
58447
- newExtensionFee
58448
- timestamp
58449
- blockNumber
58450
- transactionHash
58451
- }
58452
- ` : ""}
58453
-
58454
- ${shouldQuery.loanProtocolParamUpdate ? `
58455
- loanProtocolParamUpdates(
58456
- ${buildProtocolWhereClause()}
58457
- first: $limit,
58458
- orderBy: timestamp,
58459
- orderDirection: $orderDirection
58460
- ) {
58461
- id
58462
- oldLiquidationThreshold
58463
- newLiquidationThreshold
58464
- oldMinimumLoanValueUcd
58465
- newMinimumLoanValueUcd
58466
- caller
58467
- timestamp
58468
- blockNumber
58469
- transactionHash
58470
- }
58471
- ` : ""}
58472
-
58473
- ${shouldQuery.maxLoanValueUpdate ? `
58474
- maxLoanValueUpdates(
58475
- ${buildProtocolWhereClause()}
58476
- first: $limit,
58477
- orderBy: timestamp,
58478
- orderDirection: $orderDirection
58479
- ) {
58480
- id
58481
- oldValueUcd
58482
- newValueUcd
58483
- caller
58484
- timestamp
58485
- blockNumber
58486
- transactionHash
58487
- }
58488
- ` : ""}
58489
-
58490
- ${shouldQuery.btcPriceBoundsUpdate ? `
58491
- btcPriceBoundsUpdates(
58492
- ${buildProtocolWhereClause()}
58493
- first: $limit,
58494
- orderBy: timestamp,
58495
- orderDirection: $orderDirection
58496
- ) {
58497
- id
58498
- oldMinBound
58499
- newMinBound
58500
- oldMaxBound
58501
- newMaxBound
58502
- caller
58503
- timestamp
58504
- blockNumber
58505
- transactionHash
58506
- }
58507
- ` : ""}
58508
-
58509
- ${shouldQuery.perUserMintLimitUpdate ? `
58510
- perUserDailyMintLimitUpdates(
58511
- ${buildProtocolWhereClause()}
58512
- first: $limit,
58513
- orderBy: timestamp,
58514
- orderDirection: $orderDirection
58515
- ) {
58516
- id
58517
- oldLimit
58518
- newLimit
58519
- updatedBy
58520
- timestamp
58521
- blockNumber
58522
- transactionHash
58523
- }
58524
- ` : ""}
58528
+ }` : ""}
58525
58529
  }
58526
58530
  `;
58527
58531
  const variables = {
@@ -58530,6 +58534,19 @@ var DiamondHandsGraph = class {
58530
58534
  orderDirection
58531
58535
  };
58532
58536
  const result = await this.client.execute(query, variables);
58537
+ const rawCreated = result.positionCreatedEvents?.[0];
58538
+ const positionCreated = rawCreated ? {
58539
+ id: rawCreated.id,
58540
+ positionId,
58541
+ pkpId: rawCreated.pkpId,
58542
+ borrower: rawCreated.borrower.id,
58543
+ requestedCollateralRatio: rawCreated.requestedCollateralRatio,
58544
+ selectedTerm: rawCreated.selectedTerm,
58545
+ expiryAt: rawCreated.expiryAt,
58546
+ timestamp: rawCreated.timestamp,
58547
+ blockNumber: rawCreated.blockNumber,
58548
+ transactionHash: rawCreated.transactionHash
58549
+ } : void 0;
58533
58550
  const payments = (result.position?.payments || []).map(
58534
58551
  (p) => ({
58535
58552
  id: p.id,
@@ -58590,17 +58607,19 @@ var DiamondHandsGraph = class {
58590
58607
  transactionHash: w.transactionHash,
58591
58608
  logIndex: w.logIndex
58592
58609
  }));
58593
- const renewals = (result.position?.renewals || []).map((r) => ({
58594
- id: r.id,
58595
- positionId,
58596
- extensionTerm: r.extensionTerm,
58597
- extensionFee: r.extensionFee,
58598
- newExpiryDate: r.newExpiryDate,
58599
- timestamp: r.timestamp,
58600
- blockNumber: r.blockNumber,
58601
- transactionHash: r.transactionHash,
58602
- logIndex: r.logIndex
58603
- }));
58610
+ const renewals = (result.position?.renewals || []).map(
58611
+ (r) => ({
58612
+ id: r.id,
58613
+ positionId,
58614
+ extensionTerm: r.extensionTerm,
58615
+ extensionFee: r.extensionFee,
58616
+ newExpiryDate: r.newExpiryDate,
58617
+ timestamp: r.timestamp,
58618
+ blockNumber: r.blockNumber,
58619
+ transactionHash: r.transactionHash,
58620
+ logIndex: r.logIndex
58621
+ })
58622
+ );
58604
58623
  const operationFailures = (result.position?.operationFailures || []).map((o) => ({
58605
58624
  id: o.id,
58606
58625
  positionId,
@@ -58656,69 +58675,10 @@ var DiamondHandsGraph = class {
58656
58675
  transactionHash: c.transactionHash,
58657
58676
  logIndex: c.logIndex
58658
58677
  }));
58659
- const circuitBreakerEvents = (result.circuitBreakerEvents || []).map((cb) => ({
58660
- id: cb.id,
58661
- isActivated: cb.isActivated,
58662
- admin: cb.admin,
58663
- reason: cb.reason,
58664
- timestamp: cb.timestamp,
58665
- blockNumber: cb.blockNumber,
58666
- transactionHash: cb.transactionHash
58667
- }));
58668
- const termFeeUpdates = (result.termFeeUpdates || []).map((t) => ({
58669
- id: t.id,
58670
- termMonths: t.term.id,
58671
- oldOriginationFee: t.oldOriginationFee,
58672
- newOriginationFee: t.newOriginationFee,
58673
- oldExtensionFee: t.oldExtensionFee,
58674
- newExtensionFee: t.newExtensionFee,
58675
- timestamp: t.timestamp,
58676
- blockNumber: t.blockNumber,
58677
- transactionHash: t.transactionHash
58678
- }));
58679
- const loanProtocolParamUpdates = (result.loanProtocolParamUpdates || []).map((p) => ({
58680
- id: p.id,
58681
- oldLiquidationThreshold: p.oldLiquidationThreshold,
58682
- newLiquidationThreshold: p.newLiquidationThreshold,
58683
- oldMinimumLoanValueUcd: p.oldMinimumLoanValueUcd,
58684
- newMinimumLoanValueUcd: p.newMinimumLoanValueUcd,
58685
- caller: p.caller,
58686
- timestamp: p.timestamp,
58687
- blockNumber: p.blockNumber,
58688
- transactionHash: p.transactionHash
58689
- }));
58690
- const maxLoanValueUpdates = (result.maxLoanValueUpdates || []).map((m) => ({
58691
- id: m.id,
58692
- oldValueUcd: m.oldValueUcd,
58693
- newValueUcd: m.newValueUcd,
58694
- caller: m.caller,
58695
- timestamp: m.timestamp,
58696
- blockNumber: m.blockNumber,
58697
- transactionHash: m.transactionHash
58698
- }));
58699
- const btcPriceBoundsUpdates = (result.btcPriceBoundsUpdates || []).map((b2) => ({
58700
- id: b2.id,
58701
- oldMinBound: b2.oldMinBound,
58702
- newMinBound: b2.newMinBound,
58703
- oldMaxBound: b2.oldMaxBound,
58704
- newMaxBound: b2.newMaxBound,
58705
- caller: b2.caller,
58706
- timestamp: b2.timestamp,
58707
- blockNumber: b2.blockNumber,
58708
- transactionHash: b2.transactionHash
58709
- }));
58710
- const perUserMintLimitUpdates = (result.perUserDailyMintLimitUpdates || []).map((p) => ({
58711
- id: p.id,
58712
- oldLimit: p.oldLimit,
58713
- newLimit: p.newLimit,
58714
- updatedBy: p.updatedBy,
58715
- timestamp: p.timestamp,
58716
- blockNumber: p.blockNumber,
58717
- transactionHash: p.transactionHash
58718
- }));
58719
- const totalEvents = payments.length + statusUpdates.length + (liquidation ? 1 : 0) + mints.length + withdrawals.length + renewals.length + operationFailures.length + mintRequests.length + burnRequests.length + collateralEvents.length + circuitBreakerEvents.length + termFeeUpdates.length + loanProtocolParamUpdates.length + maxLoanValueUpdates.length + btcPriceBoundsUpdates.length + perUserMintLimitUpdates.length;
58678
+ const totalEvents = (positionCreated ? 1 : 0) + payments.length + statusUpdates.length + (liquidation ? 1 : 0) + mints.length + withdrawals.length + renewals.length + operationFailures.length + mintRequests.length + burnRequests.length + collateralEvents.length;
58720
58679
  return {
58721
58680
  positionId,
58681
+ positionCreated,
58722
58682
  payments,
58723
58683
  statusUpdates,
58724
58684
  liquidation,
@@ -58729,185 +58689,2376 @@ var DiamondHandsGraph = class {
58729
58689
  mintRequests,
58730
58690
  burnRequests,
58731
58691
  collateralEvents,
58732
- circuitBreakerEvents,
58733
- termFeeUpdates,
58734
- loanProtocolParamUpdates,
58735
- maxLoanValueUpdates,
58736
- btcPriceBoundsUpdates,
58737
- perUserMintLimitUpdates,
58738
- feeDistributions: [],
58739
58692
  totalEvents
58740
58693
  };
58741
58694
  }
58742
- };
58743
-
58744
- // src/modules/mock/mock-token-manager.module.ts
58745
- var MockTokenManager = class {
58746
- config;
58747
- constructor(config) {
58748
- this.config = config;
58749
- if (this.isProductionNetwork()) {
58750
- log.warn("\u26A0\uFE0F MockTokenManager initialized on production network", {
58751
- network: config.network
58752
- });
58753
- }
58754
- }
58695
+ // ============================================================================
58696
+ // Protocol-wide Events
58697
+ // ============================================================================
58755
58698
  /**
58756
- * Mint mock BTC tokens
58699
+ * Retrieve events across the full protocol, optionally narrowed to a position.
58700
+ * Returns a merged, sorted discriminated-union timeline suitable for explorers.
58757
58701
  *
58758
- * @param amount - Amount to mint in satoshis
58759
- * @param recipient - Recipient address
58760
- * @returns Transaction result
58702
+ * Protocol-global admin events (circuit breaker, term fees, etc.) are included
58703
+ * by default; pass `kinds` to restrict.
58761
58704
  */
58762
- async mintMockBTC(amount, recipient) {
58763
- if (this.config.debug) {
58764
- log.info("\u{1FA99} Minting mock BTC", {
58765
- amount: amount.toString(),
58766
- recipient
58767
- });
58705
+ async getAllEvents(filter) {
58706
+ const {
58707
+ positionId,
58708
+ kinds,
58709
+ fromTimestamp,
58710
+ toTimestamp,
58711
+ fromBlock,
58712
+ toBlock,
58713
+ limit = 1e3,
58714
+ orderDirection = "desc"
58715
+ } = filter || {};
58716
+ const includeKind = (k) => !kinds || kinds.includes(k);
58717
+ const buildTimeWhereClause = (extra = []) => {
58718
+ const conditions = [...extra];
58719
+ if (fromTimestamp)
58720
+ conditions.push(`timestamp_gte: "${fromTimestamp}"`);
58721
+ if (toTimestamp)
58722
+ conditions.push(`timestamp_lte: "${toTimestamp}"`);
58723
+ if (fromBlock)
58724
+ conditions.push(`blockNumber_gte: "${fromBlock}"`);
58725
+ if (toBlock)
58726
+ conditions.push(`blockNumber_lte: "${toBlock}"`);
58727
+ return conditions.length > 0 ? `where: { ${conditions.join(", ")} }` : "";
58728
+ };
58729
+ const positionFilter = positionId ? [`position: "${positionId.toLowerCase()}"`] : [];
58730
+ const query = `
58731
+ query GetAllEvents($limit: Int!, $orderDirection: OrderDirection!) {
58732
+
58733
+ ${includeKind("position") ? `
58734
+ positionCreatedEvents(
58735
+ ${buildTimeWhereClause(positionFilter)}
58736
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58737
+ ) {
58738
+ id
58739
+ position { id }
58740
+ pkpId
58741
+ borrower { id }
58742
+ requestedCollateralRatio
58743
+ selectedTerm
58744
+ expiryAt
58745
+ timestamp
58746
+ blockNumber
58747
+ transactionHash
58748
+ }
58749
+ positionStatusUpdates: positionStatusUpdates(
58750
+ ${buildTimeWhereClause(positionFilter)}
58751
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58752
+ ) {
58753
+ id
58754
+ position { id }
58755
+ oldStatus
58756
+ newStatus
58757
+ timestamp
58758
+ blockNumber
58759
+ transactionHash
58760
+ }
58761
+ renewalEvents: renewalEvents(
58762
+ ${buildTimeWhereClause(positionFilter)}
58763
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58764
+ ) {
58765
+ id
58766
+ position { id }
58767
+ extensionTerm
58768
+ extensionFee
58769
+ newExpiryDate
58770
+ timestamp
58771
+ blockNumber
58772
+ transactionHash
58773
+ }` : ""}
58774
+
58775
+ ${includeKind("payment") ? `
58776
+ payments(
58777
+ ${buildTimeWhereClause(positionFilter)}
58778
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58779
+ ) {
58780
+ id
58781
+ position { id }
58782
+ payer { id }
58783
+ amount
58784
+ type
58785
+ newDebt
58786
+ newCollateralRatio
58787
+ timestamp
58788
+ blockNumber
58789
+ transactionHash
58790
+ }` : ""}
58791
+
58792
+ ${includeKind("liquidation") ? `
58793
+ liquidations(
58794
+ ${buildTimeWhereClause(positionFilter)}
58795
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58796
+ ) {
58797
+ id
58798
+ position { id }
58799
+ liquidator
58800
+ liquidatedAmount
58801
+ collateralSeized
58802
+ timestamp
58803
+ blockNumber
58804
+ transactionHash
58805
+ }` : ""}
58806
+
58807
+ ${includeKind("collateral") ? `
58808
+ collateralEvents(
58809
+ ${buildTimeWhereClause(positionFilter)}
58810
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58811
+ ) {
58812
+ id
58813
+ position { id }
58814
+ eventType
58815
+ networkFee
58816
+ remainingCollateral
58817
+ timestamp
58818
+ blockNumber
58819
+ transactionHash
58820
+ }` : ""}
58821
+
58822
+ ${includeKind("mint") ? `
58823
+ ucdmintEvents(
58824
+ ${buildTimeWhereClause(positionFilter)}
58825
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58826
+ ) {
58827
+ id
58828
+ position { id }
58829
+ amount
58830
+ minter { id }
58831
+ isCommunityMint
58832
+ timestamp
58833
+ blockNumber
58834
+ transactionHash
58835
+ }` : ""}
58836
+
58837
+ ${includeKind("withdrawal") ? `
58838
+ withdrawalEvents: withdrawalEvents(
58839
+ ${buildTimeWhereClause(positionFilter)}
58840
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58841
+ ) {
58842
+ id
58843
+ position { id }
58844
+ withdrawalAmount
58845
+ withdrawalAddress
58846
+ timestamp
58847
+ blockNumber
58848
+ transactionHash
58849
+ }` : ""}
58850
+
58851
+ ${includeKind("psm") ? `
58852
+ psmTransactions(
58853
+ ${buildTimeWhereClause()}
58854
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58855
+ ) {
58856
+ id
58857
+ type
58858
+ user
58859
+ stablecoinAmount
58860
+ ucdAmount
58861
+ timestamp
58862
+ blockNumber
58863
+ transactionHash
58864
+ }` : ""}
58865
+
58866
+ ${includeKind("admin") ? `
58867
+ circuitBreakerEvents(
58868
+ ${buildTimeWhereClause()}
58869
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58870
+ ) {
58871
+ id
58872
+ isActivated
58873
+ admin
58874
+ timestamp
58875
+ blockNumber
58876
+ transactionHash
58877
+ }
58878
+ termFeeUpdates(
58879
+ ${buildTimeWhereClause()}
58880
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58881
+ ) {
58882
+ id
58883
+ term { id }
58884
+ oldOriginationFee
58885
+ newOriginationFee
58886
+ timestamp
58887
+ blockNumber
58888
+ transactionHash
58889
+ }
58890
+ loanProtocolParamUpdates(
58891
+ ${buildTimeWhereClause()}
58892
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58893
+ ) {
58894
+ id
58895
+ newLiquidationThreshold
58896
+ newMinimumLoanValueUcd
58897
+ caller
58898
+ timestamp
58899
+ blockNumber
58900
+ transactionHash
58901
+ }
58902
+ maxLoanValueUpdates(
58903
+ ${buildTimeWhereClause()}
58904
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58905
+ ) {
58906
+ id
58907
+ newValueUcd
58908
+ caller
58909
+ timestamp
58910
+ blockNumber
58911
+ transactionHash
58912
+ }
58913
+ btcPriceBoundsUpdates(
58914
+ ${buildTimeWhereClause()}
58915
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58916
+ ) {
58917
+ id
58918
+ newMinBound
58919
+ newMaxBound
58920
+ caller
58921
+ timestamp
58922
+ blockNumber
58923
+ transactionHash
58924
+ }
58925
+ perUserDailyMintLimitUpdates(
58926
+ ${buildTimeWhereClause()}
58927
+ first: $limit, orderBy: timestamp, orderDirection: $orderDirection
58928
+ ) {
58929
+ id
58930
+ newLimit
58931
+ updatedBy
58932
+ timestamp
58933
+ blockNumber
58934
+ transactionHash
58935
+ }` : ""}
58936
+ }
58937
+ `;
58938
+ const result = await this.client.execute(query, {
58939
+ limit,
58940
+ orderDirection
58941
+ });
58942
+ const events = [];
58943
+ for (const e of result.positionCreatedEvents || []) {
58944
+ events.push({ kind: "position", subkind: "created", positionId: e.position.id, ...e });
58768
58945
  }
58769
- if (this.isProductionNetwork()) {
58770
- return failure(
58771
- new SDKError({
58772
- message: "Cannot mint mock tokens on production network",
58773
- category: "CONFIGURATION" /* CONFIGURATION */,
58774
- severity: "HIGH" /* HIGH */,
58775
- originalError: new Error("Production network detected")
58776
- })
58777
- );
58946
+ for (const e of result.positionStatusUpdates || []) {
58947
+ events.push({ kind: "position", subkind: "status", positionId: e.position.id, ...e });
58778
58948
  }
58779
- return tryCatchAsync(
58780
- async () => {
58781
- const signerResult = this.config.contractManager.getSigner();
58782
- if (!signerResult.success) {
58783
- throw signerResult.error;
58784
- }
58785
- throw new Error("Mock BTC contract not yet integrated");
58786
- },
58787
- (error) => new SDKError({
58788
- message: "Failed to mint mock BTC",
58789
- category: "CONTRACT" /* CONTRACT */,
58790
- severity: "MEDIUM" /* MEDIUM */,
58791
- originalError: error instanceof Error ? error : new Error(String(error)),
58792
- context: { amount: amount.toString(), recipient }
58793
- })
58794
- );
58795
- }
58796
- /**
58797
- * Approve mock BTC spending
58798
- *
58799
- * @param spender - Spender address
58800
- * @param amount - Amount to approve in satoshis
58801
- * @returns Transaction result
58802
- */
58803
- async approveMockBTC(spender, amount) {
58804
- if (this.config.debug) {
58805
- log.info("\u2705 Approving mock BTC spending", {
58806
- spender,
58807
- amount: amount.toString()
58808
- });
58949
+ for (const e of result.renewalEvents || []) {
58950
+ events.push({ kind: "position", subkind: "renewed", positionId: e.position.id, ...e });
58809
58951
  }
58810
- if (this.isProductionNetwork()) {
58811
- return failure(
58812
- new SDKError({
58813
- message: "Cannot approve mock tokens on production network",
58814
- category: "CONFIGURATION" /* CONFIGURATION */,
58815
- severity: "HIGH" /* HIGH */,
58816
- originalError: new Error("Production network detected")
58817
- })
58818
- );
58952
+ for (const e of result.payments || []) {
58953
+ events.push({ kind: "payment", positionId: e.position.id, ...e });
58819
58954
  }
58820
- return tryCatchAsync(
58821
- async () => {
58822
- const signerResult = this.config.contractManager.getSigner();
58823
- if (!signerResult.success) {
58824
- throw signerResult.error;
58825
- }
58826
- throw new Error("Mock BTC contract not yet integrated");
58827
- },
58828
- (error) => new SDKError({
58829
- message: "Failed to approve mock BTC",
58830
- category: "CONTRACT" /* CONTRACT */,
58831
- severity: "MEDIUM" /* MEDIUM */,
58832
- originalError: error instanceof Error ? error : new Error(String(error)),
58833
- context: { spender, amount: amount.toString() }
58834
- })
58835
- );
58836
- }
58837
- /**
58838
- * Get mock BTC balance
58839
- *
58840
- * @param address - Address to query
58841
- * @returns Balance in satoshis
58842
- */
58843
- async getMockBTCBalance(address) {
58844
- if (this.config.debug) {
58845
- log.info("\u{1F50D} Querying mock BTC balance", { address });
58955
+ for (const e of result.liquidations || []) {
58956
+ events.push({ kind: "liquidation", positionId: e.position.id, ...e });
58846
58957
  }
58847
- return tryCatchAsync(
58848
- async () => {
58849
- throw new Error("Mock BTC contract not yet integrated");
58850
- },
58851
- (error) => new SDKError({
58852
- message: "Failed to get mock BTC balance",
58853
- category: "CONTRACT" /* CONTRACT */,
58854
- severity: "MEDIUM" /* MEDIUM */,
58855
- originalError: error instanceof Error ? error : new Error(String(error)),
58856
- context: { address }
58857
- })
58858
- );
58859
- }
58860
- /**
58861
- * Check if current network is production (mainnet)
58862
- */
58863
- isProductionNetwork() {
58864
- return this.config.network.toLowerCase().includes("mainnet");
58958
+ for (const e of result.collateralEvents || []) {
58959
+ events.push({ kind: "collateral", positionId: e.position.id, ...e });
58960
+ }
58961
+ for (const e of result.ucdmintEvents || []) {
58962
+ events.push({ kind: "mint", positionId: e.position.id, ...e });
58963
+ }
58964
+ for (const e of result.withdrawalEvents || []) {
58965
+ events.push({ kind: "withdrawal", positionId: e.position.id, ...e });
58966
+ }
58967
+ for (const e of result.psmTransactions || []) {
58968
+ const subkind = e.type === "SWAP" ? "swap" : "redeem";
58969
+ events.push({ kind: "psm", subkind, ...e });
58970
+ }
58971
+ for (const e of result.circuitBreakerEvents || []) {
58972
+ events.push({ kind: "admin", subkind: "circuitBreaker", ...e });
58973
+ }
58974
+ for (const e of result.termFeeUpdates || []) {
58975
+ events.push({ kind: "admin", subkind: "termFee", ...e });
58976
+ }
58977
+ for (const e of result.loanProtocolParamUpdates || []) {
58978
+ events.push({ kind: "admin", subkind: "loanParams", ...e });
58979
+ }
58980
+ for (const e of result.maxLoanValueUpdates || []) {
58981
+ events.push({ kind: "admin", subkind: "maxLoanValue", ...e });
58982
+ }
58983
+ for (const e of result.btcPriceBoundsUpdates || []) {
58984
+ events.push({ kind: "admin", subkind: "btcBounds", ...e });
58985
+ }
58986
+ for (const e of result.perUserDailyMintLimitUpdates || []) {
58987
+ events.push({ kind: "admin", subkind: "mintLimit", ...e });
58988
+ }
58989
+ events.sort((a, b2) => {
58990
+ const diff = BigInt(a.timestamp) - BigInt(b2.timestamp);
58991
+ return orderDirection === "asc" ? Number(diff) : -Number(diff);
58992
+ });
58993
+ const byKind = {};
58994
+ for (const e of events) {
58995
+ byKind[e.kind] = (byKind[e.kind] ?? 0) + 1;
58996
+ }
58997
+ return { events, totalEvents: events.length, byKind };
58865
58998
  }
58866
58999
  };
58867
- function createMockTokenManager(config) {
58868
- try {
58869
- const manager = new MockTokenManager(config);
58870
- return success(manager);
58871
- } catch (error) {
58872
- return failure(
58873
- new SDKError({
58874
- message: "Failed to create MockTokenManager",
58875
- category: "INITIALIZATION" /* INITIALIZATION */,
58876
- severity: "HIGH" /* HIGH */,
58877
- originalError: error instanceof Error ? error : new Error(String(error))
58878
- })
58879
- );
58880
- }
58881
- }
58882
-
58883
- // src/modules/diamond-hands-sdk.ts
58884
- var import_dh_lit_actions2 = __toESM(require_pkg_src());
58885
- import { LitOps } from "@gvnrdao/dh-lit-ops";
58886
59000
 
58887
- // src/utils/telegram-messaging.utils.ts
58888
- var TelegramBot = null;
58889
- try {
58890
- if (typeof window === "undefined" && typeof global !== "undefined") {
58891
- TelegramBot = __require("node-telegram-bot-api");
58892
- }
58893
- } catch (error) {
58894
- console.warn("Telegram bot API not available:", error instanceof Error ? error.message : String(error));
58895
- }
58896
- function formatMintMessage(mintAmount, loanId, txHash) {
58897
- return `\u2705 DH SDK: ${mintAmount} UCD was minted for loan id: ${loanId} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
58898
- }
58899
- function formatPartialPaymentMessage(paymentAmount, loanId, txHash) {
58900
- return `\u2705 DH SDK: ${paymentAmount} UCD was repaid for loan id: ${loanId} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
58901
- }
58902
- function formatPartialPaymentFailureMessage(paymentAmount, loanId, txHash) {
58903
- const baseMessage = `\u274C DH SDK: FAILED to repay ${paymentAmount} UCD for loan id: ${loanId}`;
58904
- if (txHash) {
58905
- return `${baseMessage} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
58906
- }
58907
- return baseMessage;
58908
- }
58909
- function formatLoanCreationMessage(positionId, pkpId, vaultAddress) {
58910
- const vault = vaultAddress || "unknown";
59001
+ // src/contracts/typechain-contracts/factories/src/psm/SimplePSMV2__factory.ts
59002
+ var _abi = [
59003
+ {
59004
+ inputs: [],
59005
+ stateMutability: "nonpayable",
59006
+ type: "constructor"
59007
+ },
59008
+ {
59009
+ inputs: [
59010
+ {
59011
+ internalType: "uint256",
59012
+ name: "amount",
59013
+ type: "uint256"
59014
+ },
59015
+ {
59016
+ internalType: "uint256",
59017
+ name: "maximum",
59018
+ type: "uint256"
59019
+ }
59020
+ ],
59021
+ name: "AboveMaxRedeem",
59022
+ type: "error"
59023
+ },
59024
+ {
59025
+ inputs: [
59026
+ {
59027
+ internalType: "uint256",
59028
+ name: "amount",
59029
+ type: "uint256"
59030
+ },
59031
+ {
59032
+ internalType: "uint256",
59033
+ name: "maximum",
59034
+ type: "uint256"
59035
+ }
59036
+ ],
59037
+ name: "AboveMaxSwap",
59038
+ type: "error"
59039
+ },
59040
+ {
59041
+ inputs: [],
59042
+ name: "AccessControlBadConfirmation",
59043
+ type: "error"
59044
+ },
59045
+ {
59046
+ inputs: [
59047
+ {
59048
+ internalType: "address",
59049
+ name: "account",
59050
+ type: "address"
59051
+ },
59052
+ {
59053
+ internalType: "bytes32",
59054
+ name: "neededRole",
59055
+ type: "bytes32"
59056
+ }
59057
+ ],
59058
+ name: "AccessControlUnauthorizedAccount",
59059
+ type: "error"
59060
+ },
59061
+ {
59062
+ inputs: [
59063
+ {
59064
+ internalType: "address",
59065
+ name: "target",
59066
+ type: "address"
59067
+ }
59068
+ ],
59069
+ name: "AddressEmptyCode",
59070
+ type: "error"
59071
+ },
59072
+ {
59073
+ inputs: [],
59074
+ name: "ArrayLengthMismatch",
59075
+ type: "error"
59076
+ },
59077
+ {
59078
+ inputs: [
59079
+ {
59080
+ internalType: "uint256",
59081
+ name: "amount",
59082
+ type: "uint256"
59083
+ },
59084
+ {
59085
+ internalType: "uint256",
59086
+ name: "minimum",
59087
+ type: "uint256"
59088
+ }
59089
+ ],
59090
+ name: "BelowMinRedeem",
59091
+ type: "error"
59092
+ },
59093
+ {
59094
+ inputs: [
59095
+ {
59096
+ internalType: "uint256",
59097
+ name: "amount",
59098
+ type: "uint256"
59099
+ },
59100
+ {
59101
+ internalType: "uint256",
59102
+ name: "minimum",
59103
+ type: "uint256"
59104
+ }
59105
+ ],
59106
+ name: "BelowMinSwap",
59107
+ type: "error"
59108
+ },
59109
+ {
59110
+ inputs: [
59111
+ {
59112
+ internalType: "uint8",
59113
+ name: "provided",
59114
+ type: "uint8"
59115
+ },
59116
+ {
59117
+ internalType: "uint8",
59118
+ name: "actual",
59119
+ type: "uint8"
59120
+ }
59121
+ ],
59122
+ name: "DecimalsMismatch",
59123
+ type: "error"
59124
+ },
59125
+ {
59126
+ inputs: [],
59127
+ name: "DecimalsQueryFailed",
59128
+ type: "error"
59129
+ },
59130
+ {
59131
+ inputs: [
59132
+ {
59133
+ internalType: "address",
59134
+ name: "implementation",
59135
+ type: "address"
59136
+ }
59137
+ ],
59138
+ name: "ERC1967InvalidImplementation",
59139
+ type: "error"
59140
+ },
59141
+ {
59142
+ inputs: [],
59143
+ name: "ERC1967NonPayable",
59144
+ type: "error"
59145
+ },
59146
+ {
59147
+ inputs: [],
59148
+ name: "EnforcedPause",
59149
+ type: "error"
59150
+ },
59151
+ {
59152
+ inputs: [
59153
+ {
59154
+ internalType: "uint256",
59155
+ name: "fee",
59156
+ type: "uint256"
59157
+ },
59158
+ {
59159
+ internalType: "uint256",
59160
+ name: "max",
59161
+ type: "uint256"
59162
+ }
59163
+ ],
59164
+ name: "EntryFeeTooHigh",
59165
+ type: "error"
59166
+ },
59167
+ {
59168
+ inputs: [
59169
+ {
59170
+ internalType: "uint256",
59171
+ name: "fee",
59172
+ type: "uint256"
59173
+ },
59174
+ {
59175
+ internalType: "uint256",
59176
+ name: "max",
59177
+ type: "uint256"
59178
+ }
59179
+ ],
59180
+ name: "ExitFeeTooHigh",
59181
+ type: "error"
59182
+ },
59183
+ {
59184
+ inputs: [],
59185
+ name: "ExpectedPause",
59186
+ type: "error"
59187
+ },
59188
+ {
59189
+ inputs: [],
59190
+ name: "FailedCall",
59191
+ type: "error"
59192
+ },
59193
+ {
59194
+ inputs: [],
59195
+ name: "FailedToGetStablecoinDecimals",
59196
+ type: "error"
59197
+ },
59198
+ {
59199
+ inputs: [],
59200
+ name: "FailedToGetUCDDecimals",
59201
+ type: "error"
59202
+ },
59203
+ {
59204
+ inputs: [],
59205
+ name: "InitialBalanceTooLarge",
59206
+ type: "error"
59207
+ },
59208
+ {
59209
+ inputs: [
59210
+ {
59211
+ internalType: "uint256",
59212
+ name: "available",
59213
+ type: "uint256"
59214
+ },
59215
+ {
59216
+ internalType: "uint256",
59217
+ name: "required",
59218
+ type: "uint256"
59219
+ }
59220
+ ],
59221
+ name: "InsufficientReserves",
59222
+ type: "error"
59223
+ },
59224
+ {
59225
+ inputs: [],
59226
+ name: "InvalidAddress",
59227
+ type: "error"
59228
+ },
59229
+ {
59230
+ inputs: [],
59231
+ name: "InvalidAdmin",
59232
+ type: "error"
59233
+ },
59234
+ {
59235
+ inputs: [],
59236
+ name: "InvalidAmount",
59237
+ type: "error"
59238
+ },
59239
+ {
59240
+ inputs: [],
59241
+ name: "InvalidController",
59242
+ type: "error"
59243
+ },
59244
+ {
59245
+ inputs: [
59246
+ {
59247
+ internalType: "uint8",
59248
+ name: "decimals",
59249
+ type: "uint8"
59250
+ }
59251
+ ],
59252
+ name: "InvalidDecimals",
59253
+ type: "error"
59254
+ },
59255
+ {
59256
+ inputs: [],
59257
+ name: "InvalidExchangeRate",
59258
+ type: "error"
59259
+ },
59260
+ {
59261
+ inputs: [],
59262
+ name: "InvalidInitialization",
59263
+ type: "error"
59264
+ },
59265
+ {
59266
+ inputs: [],
59267
+ name: "InvalidStablecoinAddress",
59268
+ type: "error"
59269
+ },
59270
+ {
59271
+ inputs: [],
59272
+ name: "InvalidToken",
59273
+ type: "error"
59274
+ },
59275
+ {
59276
+ inputs: [
59277
+ {
59278
+ internalType: "uint8",
59279
+ name: "decimals",
59280
+ type: "uint8"
59281
+ }
59282
+ ],
59283
+ name: "InvalidUCDDecimals",
59284
+ type: "error"
59285
+ },
59286
+ {
59287
+ inputs: [
59288
+ {
59289
+ internalType: "uint256",
59290
+ name: "maximum",
59291
+ type: "uint256"
59292
+ },
59293
+ {
59294
+ internalType: "uint256",
59295
+ name: "minimum",
59296
+ type: "uint256"
59297
+ }
59298
+ ],
59299
+ name: "MaxRedeemBelowMin",
59300
+ type: "error"
59301
+ },
59302
+ {
59303
+ inputs: [],
59304
+ name: "MaxRedeemCapDisabled",
59305
+ type: "error"
59306
+ },
59307
+ {
59308
+ inputs: [
59309
+ {
59310
+ internalType: "uint256",
59311
+ name: "maximum",
59312
+ type: "uint256"
59313
+ },
59314
+ {
59315
+ internalType: "uint256",
59316
+ name: "minimum",
59317
+ type: "uint256"
59318
+ }
59319
+ ],
59320
+ name: "MaxSwapBelowMin",
59321
+ type: "error"
59322
+ },
59323
+ {
59324
+ inputs: [],
59325
+ name: "MaxSwapCapDisabled",
59326
+ type: "error"
59327
+ },
59328
+ {
59329
+ inputs: [],
59330
+ name: "NormalizationOverflow",
59331
+ type: "error"
59332
+ },
59333
+ {
59334
+ inputs: [],
59335
+ name: "NotContract",
59336
+ type: "error"
59337
+ },
59338
+ {
59339
+ inputs: [],
59340
+ name: "NotInitializing",
59341
+ type: "error"
59342
+ },
59343
+ {
59344
+ inputs: [],
59345
+ name: "RateLimitExceeded",
59346
+ type: "error"
59347
+ },
59348
+ {
59349
+ inputs: [],
59350
+ name: "RedemptionsPaused",
59351
+ type: "error"
59352
+ },
59353
+ {
59354
+ inputs: [],
59355
+ name: "ReentrancyGuardReentrantCall",
59356
+ type: "error"
59357
+ },
59358
+ {
59359
+ inputs: [],
59360
+ name: "ReserveOverflow",
59361
+ type: "error"
59362
+ },
59363
+ {
59364
+ inputs: [],
59365
+ name: "ReserveTooLarge",
59366
+ type: "error"
59367
+ },
59368
+ {
59369
+ inputs: [],
59370
+ name: "ReserveUnderflow",
59371
+ type: "error"
59372
+ },
59373
+ {
59374
+ inputs: [
59375
+ {
59376
+ internalType: "address",
59377
+ name: "token",
59378
+ type: "address"
59379
+ }
59380
+ ],
59381
+ name: "SafeERC20FailedOperation",
59382
+ type: "error"
59383
+ },
59384
+ {
59385
+ inputs: [
59386
+ {
59387
+ internalType: "uint256",
59388
+ name: "got",
59389
+ type: "uint256"
59390
+ },
59391
+ {
59392
+ internalType: "uint256",
59393
+ name: "minimum",
59394
+ type: "uint256"
59395
+ }
59396
+ ],
59397
+ name: "SlippageExceeded",
59398
+ type: "error"
59399
+ },
59400
+ {
59401
+ inputs: [],
59402
+ name: "SlippageProtectionRequired",
59403
+ type: "error"
59404
+ },
59405
+ {
59406
+ inputs: [
59407
+ {
59408
+ internalType: "address",
59409
+ name: "stablecoin",
59410
+ type: "address"
59411
+ }
59412
+ ],
59413
+ name: "StablecoinAlreadySupported",
59414
+ type: "error"
59415
+ },
59416
+ {
59417
+ inputs: [
59418
+ {
59419
+ internalType: "address",
59420
+ name: "stablecoin",
59421
+ type: "address"
59422
+ }
59423
+ ],
59424
+ name: "StablecoinNotContract",
59425
+ type: "error"
59426
+ },
59427
+ {
59428
+ inputs: [
59429
+ {
59430
+ internalType: "address",
59431
+ name: "stablecoin",
59432
+ type: "address"
59433
+ }
59434
+ ],
59435
+ name: "StablecoinNotSupported",
59436
+ type: "error"
59437
+ },
59438
+ {
59439
+ inputs: [
59440
+ {
59441
+ internalType: "address",
59442
+ name: "stablecoin",
59443
+ type: "address"
59444
+ }
59445
+ ],
59446
+ name: "StablecoinNotSupportedInV1",
59447
+ type: "error"
59448
+ },
59449
+ {
59450
+ inputs: [],
59451
+ name: "SyncDriftTooLarge",
59452
+ type: "error"
59453
+ },
59454
+ {
59455
+ inputs: [],
59456
+ name: "UUPSUnauthorizedCallContext",
59457
+ type: "error"
59458
+ },
59459
+ {
59460
+ inputs: [
59461
+ {
59462
+ internalType: "bytes32",
59463
+ name: "slot",
59464
+ type: "bytes32"
59465
+ }
59466
+ ],
59467
+ name: "UUPSUnsupportedProxiableUUID",
59468
+ type: "error"
59469
+ },
59470
+ {
59471
+ inputs: [],
59472
+ name: "UnexpectedRoleGrantFailure",
59473
+ type: "error"
59474
+ },
59475
+ {
59476
+ inputs: [],
59477
+ name: "V2AlreadyInitialized",
59478
+ type: "error"
59479
+ },
59480
+ {
59481
+ inputs: [
59482
+ {
59483
+ internalType: "uint256",
59484
+ name: "amount",
59485
+ type: "uint256"
59486
+ },
59487
+ {
59488
+ internalType: "uint256",
59489
+ name: "reserves",
59490
+ type: "uint256"
59491
+ }
59492
+ ],
59493
+ name: "WithdrawalExceedsReserves",
59494
+ type: "error"
59495
+ },
59496
+ {
59497
+ anonymous: false,
59498
+ inputs: [
59499
+ {
59500
+ indexed: true,
59501
+ internalType: "address",
59502
+ name: "stablecoin",
59503
+ type: "address"
59504
+ },
59505
+ {
59506
+ indexed: false,
59507
+ internalType: "uint256",
59508
+ name: "oldFee",
59509
+ type: "uint256"
59510
+ },
59511
+ {
59512
+ indexed: false,
59513
+ internalType: "uint256",
59514
+ name: "newFee",
59515
+ type: "uint256"
59516
+ }
59517
+ ],
59518
+ name: "EntryFeeUpdated",
59519
+ type: "event"
59520
+ },
59521
+ {
59522
+ anonymous: false,
59523
+ inputs: [
59524
+ {
59525
+ indexed: true,
59526
+ internalType: "address",
59527
+ name: "stablecoin",
59528
+ type: "address"
59529
+ },
59530
+ {
59531
+ indexed: false,
59532
+ internalType: "uint256",
59533
+ name: "oldRate",
59534
+ type: "uint256"
59535
+ },
59536
+ {
59537
+ indexed: false,
59538
+ internalType: "uint256",
59539
+ name: "newRate",
59540
+ type: "uint256"
59541
+ }
59542
+ ],
59543
+ name: "ExchangeRateUpdated",
59544
+ type: "event"
59545
+ },
59546
+ {
59547
+ anonymous: false,
59548
+ inputs: [
59549
+ {
59550
+ indexed: true,
59551
+ internalType: "address",
59552
+ name: "stablecoin",
59553
+ type: "address"
59554
+ },
59555
+ {
59556
+ indexed: false,
59557
+ internalType: "uint256",
59558
+ name: "oldFee",
59559
+ type: "uint256"
59560
+ },
59561
+ {
59562
+ indexed: false,
59563
+ internalType: "uint256",
59564
+ name: "newFee",
59565
+ type: "uint256"
59566
+ }
59567
+ ],
59568
+ name: "ExitFeeUpdated",
59569
+ type: "event"
59570
+ },
59571
+ {
59572
+ anonymous: false,
59573
+ inputs: [
59574
+ {
59575
+ indexed: false,
59576
+ internalType: "uint64",
59577
+ name: "version",
59578
+ type: "uint64"
59579
+ }
59580
+ ],
59581
+ name: "Initialized",
59582
+ type: "event"
59583
+ },
59584
+ {
59585
+ anonymous: false,
59586
+ inputs: [
59587
+ {
59588
+ indexed: false,
59589
+ internalType: "address",
59590
+ name: "account",
59591
+ type: "address"
59592
+ }
59593
+ ],
59594
+ name: "Paused",
59595
+ type: "event"
59596
+ },
59597
+ {
59598
+ anonymous: false,
59599
+ inputs: [
59600
+ {
59601
+ indexed: true,
59602
+ internalType: "address",
59603
+ name: "user",
59604
+ type: "address"
59605
+ },
59606
+ {
59607
+ indexed: true,
59608
+ internalType: "address",
59609
+ name: "stablecoin",
59610
+ type: "address"
59611
+ },
59612
+ {
59613
+ indexed: false,
59614
+ internalType: "uint256",
59615
+ name: "ucdAmount",
59616
+ type: "uint256"
59617
+ },
59618
+ {
59619
+ indexed: false,
59620
+ internalType: "uint256",
59621
+ name: "stablecoinAmount",
59622
+ type: "uint256"
59623
+ },
59624
+ {
59625
+ indexed: false,
59626
+ internalType: "uint256",
59627
+ name: "exitFee",
59628
+ type: "uint256"
59629
+ },
59630
+ {
59631
+ indexed: false,
59632
+ internalType: "uint256",
59633
+ name: "timestamp",
59634
+ type: "uint256"
59635
+ }
59636
+ ],
59637
+ name: "Redeem",
59638
+ type: "event"
59639
+ },
59640
+ {
59641
+ anonymous: false,
59642
+ inputs: [
59643
+ {
59644
+ indexed: false,
59645
+ internalType: "bool",
59646
+ name: "enabled",
59647
+ type: "bool"
59648
+ }
59649
+ ],
59650
+ name: "RedemptionStatusChanged",
59651
+ type: "event"
59652
+ },
59653
+ {
59654
+ anonymous: false,
59655
+ inputs: [
59656
+ {
59657
+ indexed: true,
59658
+ internalType: "address",
59659
+ name: "stablecoin",
59660
+ type: "address"
59661
+ },
59662
+ {
59663
+ indexed: false,
59664
+ internalType: "uint256",
59665
+ name: "oldReserve",
59666
+ type: "uint256"
59667
+ },
59668
+ {
59669
+ indexed: false,
59670
+ internalType: "uint256",
59671
+ name: "newReserve",
59672
+ type: "uint256"
59673
+ }
59674
+ ],
59675
+ name: "ReserveUpdated",
59676
+ type: "event"
59677
+ },
59678
+ {
59679
+ anonymous: false,
59680
+ inputs: [
59681
+ {
59682
+ indexed: true,
59683
+ internalType: "bytes32",
59684
+ name: "role",
59685
+ type: "bytes32"
59686
+ },
59687
+ {
59688
+ indexed: true,
59689
+ internalType: "bytes32",
59690
+ name: "previousAdminRole",
59691
+ type: "bytes32"
59692
+ },
59693
+ {
59694
+ indexed: true,
59695
+ internalType: "bytes32",
59696
+ name: "newAdminRole",
59697
+ type: "bytes32"
59698
+ }
59699
+ ],
59700
+ name: "RoleAdminChanged",
59701
+ type: "event"
59702
+ },
59703
+ {
59704
+ anonymous: false,
59705
+ inputs: [
59706
+ {
59707
+ indexed: true,
59708
+ internalType: "bytes32",
59709
+ name: "role",
59710
+ type: "bytes32"
59711
+ },
59712
+ {
59713
+ indexed: true,
59714
+ internalType: "address",
59715
+ name: "account",
59716
+ type: "address"
59717
+ },
59718
+ {
59719
+ indexed: true,
59720
+ internalType: "address",
59721
+ name: "sender",
59722
+ type: "address"
59723
+ }
59724
+ ],
59725
+ name: "RoleGranted",
59726
+ type: "event"
59727
+ },
59728
+ {
59729
+ anonymous: false,
59730
+ inputs: [
59731
+ {
59732
+ indexed: true,
59733
+ internalType: "bytes32",
59734
+ name: "role",
59735
+ type: "bytes32"
59736
+ },
59737
+ {
59738
+ indexed: true,
59739
+ internalType: "address",
59740
+ name: "account",
59741
+ type: "address"
59742
+ },
59743
+ {
59744
+ indexed: true,
59745
+ internalType: "address",
59746
+ name: "sender",
59747
+ type: "address"
59748
+ }
59749
+ ],
59750
+ name: "RoleRevoked",
59751
+ type: "event"
59752
+ },
59753
+ {
59754
+ anonymous: false,
59755
+ inputs: [
59756
+ {
59757
+ indexed: true,
59758
+ internalType: "address",
59759
+ name: "stablecoin",
59760
+ type: "address"
59761
+ },
59762
+ {
59763
+ indexed: false,
59764
+ internalType: "uint256",
59765
+ name: "exchangeRate",
59766
+ type: "uint256"
59767
+ },
59768
+ {
59769
+ indexed: false,
59770
+ internalType: "uint256",
59771
+ name: "fee",
59772
+ type: "uint256"
59773
+ }
59774
+ ],
59775
+ name: "StablecoinAdded",
59776
+ type: "event"
59777
+ },
59778
+ {
59779
+ anonymous: false,
59780
+ inputs: [
59781
+ {
59782
+ indexed: true,
59783
+ internalType: "address",
59784
+ name: "stablecoin",
59785
+ type: "address"
59786
+ }
59787
+ ],
59788
+ name: "StablecoinRemoved",
59789
+ type: "event"
59790
+ },
59791
+ {
59792
+ anonymous: false,
59793
+ inputs: [
59794
+ {
59795
+ indexed: true,
59796
+ internalType: "address",
59797
+ name: "stablecoin",
59798
+ type: "address"
59799
+ },
59800
+ {
59801
+ indexed: false,
59802
+ internalType: "uint256",
59803
+ name: "exchangeRate",
59804
+ type: "uint256"
59805
+ },
59806
+ {
59807
+ indexed: false,
59808
+ internalType: "uint256",
59809
+ name: "entryFeeBps",
59810
+ type: "uint256"
59811
+ },
59812
+ {
59813
+ indexed: false,
59814
+ internalType: "uint256",
59815
+ name: "exitFeeBps",
59816
+ type: "uint256"
59817
+ },
59818
+ {
59819
+ indexed: false,
59820
+ internalType: "uint8",
59821
+ name: "decimals",
59822
+ type: "uint8"
59823
+ },
59824
+ {
59825
+ indexed: false,
59826
+ internalType: "uint256",
59827
+ name: "minSwapAmount",
59828
+ type: "uint256"
59829
+ },
59830
+ {
59831
+ indexed: false,
59832
+ internalType: "uint256",
59833
+ name: "minRedeemAmount",
59834
+ type: "uint256"
59835
+ },
59836
+ {
59837
+ indexed: false,
59838
+ internalType: "uint256",
59839
+ name: "maxSwapAmount",
59840
+ type: "uint256"
59841
+ },
59842
+ {
59843
+ indexed: false,
59844
+ internalType: "uint256",
59845
+ name: "maxRedeemAmount",
59846
+ type: "uint256"
59847
+ }
59848
+ ],
59849
+ name: "StablecoinUpdated",
59850
+ type: "event"
59851
+ },
59852
+ {
59853
+ anonymous: false,
59854
+ inputs: [
59855
+ {
59856
+ indexed: true,
59857
+ internalType: "address",
59858
+ name: "user",
59859
+ type: "address"
59860
+ },
59861
+ {
59862
+ indexed: true,
59863
+ internalType: "address",
59864
+ name: "stablecoin",
59865
+ type: "address"
59866
+ },
59867
+ {
59868
+ indexed: false,
59869
+ internalType: "uint256",
59870
+ name: "stablecoinAmount",
59871
+ type: "uint256"
59872
+ },
59873
+ {
59874
+ indexed: false,
59875
+ internalType: "uint256",
59876
+ name: "ucdAmount",
59877
+ type: "uint256"
59878
+ },
59879
+ {
59880
+ indexed: false,
59881
+ internalType: "uint256",
59882
+ name: "fee",
59883
+ type: "uint256"
59884
+ },
59885
+ {
59886
+ indexed: false,
59887
+ internalType: "uint256",
59888
+ name: "timestamp",
59889
+ type: "uint256"
59890
+ }
59891
+ ],
59892
+ name: "Swap",
59893
+ type: "event"
59894
+ },
59895
+ {
59896
+ anonymous: false,
59897
+ inputs: [
59898
+ {
59899
+ indexed: false,
59900
+ internalType: "address",
59901
+ name: "account",
59902
+ type: "address"
59903
+ }
59904
+ ],
59905
+ name: "Unpaused",
59906
+ type: "event"
59907
+ },
59908
+ {
59909
+ anonymous: false,
59910
+ inputs: [
59911
+ {
59912
+ indexed: true,
59913
+ internalType: "address",
59914
+ name: "implementation",
59915
+ type: "address"
59916
+ }
59917
+ ],
59918
+ name: "Upgraded",
59919
+ type: "event"
59920
+ },
59921
+ {
59922
+ inputs: [],
59923
+ name: "BASIS_POINTS",
59924
+ outputs: [
59925
+ {
59926
+ internalType: "uint256",
59927
+ name: "",
59928
+ type: "uint256"
59929
+ }
59930
+ ],
59931
+ stateMutability: "view",
59932
+ type: "function"
59933
+ },
59934
+ {
59935
+ inputs: [],
59936
+ name: "DEFAULT_ADMIN_ROLE",
59937
+ outputs: [
59938
+ {
59939
+ internalType: "bytes32",
59940
+ name: "",
59941
+ type: "bytes32"
59942
+ }
59943
+ ],
59944
+ stateMutability: "view",
59945
+ type: "function"
59946
+ },
59947
+ {
59948
+ inputs: [],
59949
+ name: "EXCHANGE_RATE_SCALE",
59950
+ outputs: [
59951
+ {
59952
+ internalType: "uint256",
59953
+ name: "",
59954
+ type: "uint256"
59955
+ }
59956
+ ],
59957
+ stateMutability: "view",
59958
+ type: "function"
59959
+ },
59960
+ {
59961
+ inputs: [],
59962
+ name: "MAX_EXIT_FEE",
59963
+ outputs: [
59964
+ {
59965
+ internalType: "uint256",
59966
+ name: "",
59967
+ type: "uint256"
59968
+ }
59969
+ ],
59970
+ stateMutability: "view",
59971
+ type: "function"
59972
+ },
59973
+ {
59974
+ inputs: [],
59975
+ name: "MAX_RESERVE_DRIFT",
59976
+ outputs: [
59977
+ {
59978
+ internalType: "uint256",
59979
+ name: "",
59980
+ type: "uint256"
59981
+ }
59982
+ ],
59983
+ stateMutability: "view",
59984
+ type: "function"
59985
+ },
59986
+ {
59987
+ inputs: [],
59988
+ name: "UPGRADE_INTERFACE_VERSION",
59989
+ outputs: [
59990
+ {
59991
+ internalType: "string",
59992
+ name: "",
59993
+ type: "string"
59994
+ }
59995
+ ],
59996
+ stateMutability: "view",
59997
+ type: "function"
59998
+ },
59999
+ {
60000
+ inputs: [
60001
+ {
60002
+ internalType: "address",
60003
+ name: "stablecoin",
60004
+ type: "address"
60005
+ },
60006
+ {
60007
+ internalType: "uint256",
60008
+ name: "amount",
60009
+ type: "uint256"
60010
+ }
60011
+ ],
60012
+ name: "addReserves",
60013
+ outputs: [],
60014
+ stateMutability: "nonpayable",
60015
+ type: "function"
60016
+ },
60017
+ {
60018
+ inputs: [
60019
+ {
60020
+ internalType: "address",
60021
+ name: "stablecoin",
60022
+ type: "address"
60023
+ },
60024
+ {
60025
+ internalType: "uint256",
60026
+ name: "exchangeRate",
60027
+ type: "uint256"
60028
+ },
60029
+ {
60030
+ internalType: "uint256",
60031
+ name: "entryFeeBps",
60032
+ type: "uint256"
60033
+ },
60034
+ {
60035
+ internalType: "uint256",
60036
+ name: "exitFeeBps",
60037
+ type: "uint256"
60038
+ },
60039
+ {
60040
+ internalType: "uint8",
60041
+ name: "decimals",
60042
+ type: "uint8"
60043
+ },
60044
+ {
60045
+ internalType: "uint256",
60046
+ name: "minSwapAmount",
60047
+ type: "uint256"
60048
+ },
60049
+ {
60050
+ internalType: "uint256",
60051
+ name: "minRedeemAmount",
60052
+ type: "uint256"
60053
+ },
60054
+ {
60055
+ internalType: "uint256",
60056
+ name: "maxSwapAmount",
60057
+ type: "uint256"
60058
+ },
60059
+ {
60060
+ internalType: "uint256",
60061
+ name: "maxRedeemAmount",
60062
+ type: "uint256"
60063
+ }
60064
+ ],
60065
+ name: "addSupportedStablecoin",
60066
+ outputs: [],
60067
+ stateMutability: "nonpayable",
60068
+ type: "function"
60069
+ },
60070
+ {
60071
+ inputs: [
60072
+ {
60073
+ internalType: "address",
60074
+ name: "stablecoin",
60075
+ type: "address"
60076
+ },
60077
+ {
60078
+ internalType: "uint256",
60079
+ name: "ucdAmount",
60080
+ type: "uint256"
60081
+ }
60082
+ ],
60083
+ name: "canRedeem",
60084
+ outputs: [
60085
+ {
60086
+ internalType: "bool",
60087
+ name: "",
60088
+ type: "bool"
60089
+ }
60090
+ ],
60091
+ stateMutability: "view",
60092
+ type: "function"
60093
+ },
60094
+ {
60095
+ inputs: [],
60096
+ name: "controller",
60097
+ outputs: [
60098
+ {
60099
+ internalType: "contract IUCDController",
60100
+ name: "",
60101
+ type: "address"
60102
+ }
60103
+ ],
60104
+ stateMutability: "view",
60105
+ type: "function"
60106
+ },
60107
+ {
60108
+ inputs: [
60109
+ {
60110
+ internalType: "address",
60111
+ name: "",
60112
+ type: "address"
60113
+ }
60114
+ ],
60115
+ name: "exchangeRates",
60116
+ outputs: [
60117
+ {
60118
+ internalType: "uint256",
60119
+ name: "",
60120
+ type: "uint256"
60121
+ }
60122
+ ],
60123
+ stateMutability: "view",
60124
+ type: "function"
60125
+ },
60126
+ {
60127
+ inputs: [
60128
+ {
60129
+ internalType: "address",
60130
+ name: "",
60131
+ type: "address"
60132
+ }
60133
+ ],
60134
+ name: "exitFees",
60135
+ outputs: [
60136
+ {
60137
+ internalType: "uint256",
60138
+ name: "",
60139
+ type: "uint256"
60140
+ }
60141
+ ],
60142
+ stateMutability: "view",
60143
+ type: "function"
60144
+ },
60145
+ {
60146
+ inputs: [
60147
+ {
60148
+ internalType: "address",
60149
+ name: "",
60150
+ type: "address"
60151
+ }
60152
+ ],
60153
+ name: "fees",
60154
+ outputs: [
60155
+ {
60156
+ internalType: "uint256",
60157
+ name: "",
60158
+ type: "uint256"
60159
+ }
60160
+ ],
60161
+ stateMutability: "view",
60162
+ type: "function"
60163
+ },
60164
+ {
60165
+ inputs: [
60166
+ {
60167
+ internalType: "address",
60168
+ name: "stablecoin",
60169
+ type: "address"
60170
+ }
60171
+ ],
60172
+ name: "forceSyncReserves",
60173
+ outputs: [],
60174
+ stateMutability: "nonpayable",
60175
+ type: "function"
60176
+ },
60177
+ {
60178
+ inputs: [
60179
+ {
60180
+ internalType: "address",
60181
+ name: "stablecoin",
60182
+ type: "address"
60183
+ }
60184
+ ],
60185
+ name: "getAvailableReserves",
60186
+ outputs: [
60187
+ {
60188
+ internalType: "uint256",
60189
+ name: "",
60190
+ type: "uint256"
60191
+ }
60192
+ ],
60193
+ stateMutability: "view",
60194
+ type: "function"
60195
+ },
60196
+ {
60197
+ inputs: [
60198
+ {
60199
+ internalType: "address",
60200
+ name: "stablecoin",
60201
+ type: "address"
60202
+ },
60203
+ {
60204
+ internalType: "uint256",
60205
+ name: "ucdAmount",
60206
+ type: "uint256"
60207
+ }
60208
+ ],
60209
+ name: "getRedemptionQuote",
60210
+ outputs: [
60211
+ {
60212
+ internalType: "uint256",
60213
+ name: "stablecoinOut",
60214
+ type: "uint256"
60215
+ },
60216
+ {
60217
+ internalType: "uint256",
60218
+ name: "exitFee",
60219
+ type: "uint256"
60220
+ }
60221
+ ],
60222
+ stateMutability: "view",
60223
+ type: "function"
60224
+ },
60225
+ {
60226
+ inputs: [
60227
+ {
60228
+ internalType: "bytes32",
60229
+ name: "role",
60230
+ type: "bytes32"
60231
+ }
60232
+ ],
60233
+ name: "getRoleAdmin",
60234
+ outputs: [
60235
+ {
60236
+ internalType: "bytes32",
60237
+ name: "",
60238
+ type: "bytes32"
60239
+ }
60240
+ ],
60241
+ stateMutability: "view",
60242
+ type: "function"
60243
+ },
60244
+ {
60245
+ inputs: [
60246
+ {
60247
+ internalType: "address",
60248
+ name: "stablecoin",
60249
+ type: "address"
60250
+ },
60251
+ {
60252
+ internalType: "uint256",
60253
+ name: "amountIn",
60254
+ type: "uint256"
60255
+ }
60256
+ ],
60257
+ name: "getSwapQuote",
60258
+ outputs: [
60259
+ {
60260
+ internalType: "uint256",
60261
+ name: "ucdOut",
60262
+ type: "uint256"
60263
+ },
60264
+ {
60265
+ internalType: "uint256",
60266
+ name: "fee",
60267
+ type: "uint256"
60268
+ }
60269
+ ],
60270
+ stateMutability: "view",
60271
+ type: "function"
60272
+ },
60273
+ {
60274
+ inputs: [
60275
+ {
60276
+ internalType: "bytes32",
60277
+ name: "role",
60278
+ type: "bytes32"
60279
+ },
60280
+ {
60281
+ internalType: "address",
60282
+ name: "account",
60283
+ type: "address"
60284
+ }
60285
+ ],
60286
+ name: "grantRole",
60287
+ outputs: [],
60288
+ stateMutability: "nonpayable",
60289
+ type: "function"
60290
+ },
60291
+ {
60292
+ inputs: [
60293
+ {
60294
+ internalType: "bytes32",
60295
+ name: "role",
60296
+ type: "bytes32"
60297
+ },
60298
+ {
60299
+ internalType: "address",
60300
+ name: "account",
60301
+ type: "address"
60302
+ }
60303
+ ],
60304
+ name: "hasRole",
60305
+ outputs: [
60306
+ {
60307
+ internalType: "bool",
60308
+ name: "",
60309
+ type: "bool"
60310
+ }
60311
+ ],
60312
+ stateMutability: "view",
60313
+ type: "function"
60314
+ },
60315
+ {
60316
+ inputs: [
60317
+ {
60318
+ internalType: "address",
60319
+ name: "_controller",
60320
+ type: "address"
60321
+ },
60322
+ {
60323
+ internalType: "address",
60324
+ name: "_ucdToken",
60325
+ type: "address"
60326
+ },
60327
+ {
60328
+ internalType: "address",
60329
+ name: "_admin",
60330
+ type: "address"
60331
+ }
60332
+ ],
60333
+ name: "initialize",
60334
+ outputs: [],
60335
+ stateMutability: "nonpayable",
60336
+ type: "function"
60337
+ },
60338
+ {
60339
+ inputs: [
60340
+ {
60341
+ internalType: "bool",
60342
+ name: "_redeemEnabled",
60343
+ type: "bool"
60344
+ },
60345
+ {
60346
+ internalType: "address[]",
60347
+ name: "stablecoins",
60348
+ type: "address[]"
60349
+ },
60350
+ {
60351
+ internalType: "uint256[]",
60352
+ name: "initialExitFees",
60353
+ type: "uint256[]"
60354
+ }
60355
+ ],
60356
+ name: "initializeV2",
60357
+ outputs: [],
60358
+ stateMutability: "nonpayable",
60359
+ type: "function"
60360
+ },
60361
+ {
60362
+ inputs: [
60363
+ {
60364
+ internalType: "address",
60365
+ name: "",
60366
+ type: "address"
60367
+ }
60368
+ ],
60369
+ name: "lastOperationBlock",
60370
+ outputs: [
60371
+ {
60372
+ internalType: "uint256",
60373
+ name: "",
60374
+ type: "uint256"
60375
+ }
60376
+ ],
60377
+ stateMutability: "view",
60378
+ type: "function"
60379
+ },
60380
+ {
60381
+ inputs: [
60382
+ {
60383
+ internalType: "address",
60384
+ name: "",
60385
+ type: "address"
60386
+ }
60387
+ ],
60388
+ name: "maxRedeemAmounts",
60389
+ outputs: [
60390
+ {
60391
+ internalType: "uint256",
60392
+ name: "",
60393
+ type: "uint256"
60394
+ }
60395
+ ],
60396
+ stateMutability: "view",
60397
+ type: "function"
60398
+ },
60399
+ {
60400
+ inputs: [
60401
+ {
60402
+ internalType: "address",
60403
+ name: "",
60404
+ type: "address"
60405
+ }
60406
+ ],
60407
+ name: "maxSwapAmounts",
60408
+ outputs: [
60409
+ {
60410
+ internalType: "uint256",
60411
+ name: "",
60412
+ type: "uint256"
60413
+ }
60414
+ ],
60415
+ stateMutability: "view",
60416
+ type: "function"
60417
+ },
60418
+ {
60419
+ inputs: [
60420
+ {
60421
+ internalType: "address",
60422
+ name: "",
60423
+ type: "address"
60424
+ }
60425
+ ],
60426
+ name: "minRedeemAmounts",
60427
+ outputs: [
60428
+ {
60429
+ internalType: "uint256",
60430
+ name: "",
60431
+ type: "uint256"
60432
+ }
60433
+ ],
60434
+ stateMutability: "view",
60435
+ type: "function"
60436
+ },
60437
+ {
60438
+ inputs: [
60439
+ {
60440
+ internalType: "address",
60441
+ name: "",
60442
+ type: "address"
60443
+ }
60444
+ ],
60445
+ name: "minSwapAmounts",
60446
+ outputs: [
60447
+ {
60448
+ internalType: "uint256",
60449
+ name: "",
60450
+ type: "uint256"
60451
+ }
60452
+ ],
60453
+ stateMutability: "view",
60454
+ type: "function"
60455
+ },
60456
+ {
60457
+ inputs: [
60458
+ {
60459
+ internalType: "address",
60460
+ name: "",
60461
+ type: "address"
60462
+ }
60463
+ ],
60464
+ name: "operationCount",
60465
+ outputs: [
60466
+ {
60467
+ internalType: "uint256",
60468
+ name: "",
60469
+ type: "uint256"
60470
+ }
60471
+ ],
60472
+ stateMutability: "view",
60473
+ type: "function"
60474
+ },
60475
+ {
60476
+ inputs: [],
60477
+ name: "pause",
60478
+ outputs: [],
60479
+ stateMutability: "nonpayable",
60480
+ type: "function"
60481
+ },
60482
+ {
60483
+ inputs: [],
60484
+ name: "paused",
60485
+ outputs: [
60486
+ {
60487
+ internalType: "bool",
60488
+ name: "",
60489
+ type: "bool"
60490
+ }
60491
+ ],
60492
+ stateMutability: "view",
60493
+ type: "function"
60494
+ },
60495
+ {
60496
+ inputs: [],
60497
+ name: "proxiableUUID",
60498
+ outputs: [
60499
+ {
60500
+ internalType: "bytes32",
60501
+ name: "",
60502
+ type: "bytes32"
60503
+ }
60504
+ ],
60505
+ stateMutability: "view",
60506
+ type: "function"
60507
+ },
60508
+ {
60509
+ inputs: [
60510
+ {
60511
+ internalType: "address",
60512
+ name: "stablecoin",
60513
+ type: "address"
60514
+ },
60515
+ {
60516
+ internalType: "uint256",
60517
+ name: "ucdAmount",
60518
+ type: "uint256"
60519
+ },
60520
+ {
60521
+ internalType: "uint256",
60522
+ name: "minStablecoinOut",
60523
+ type: "uint256"
60524
+ }
60525
+ ],
60526
+ name: "redeem",
60527
+ outputs: [
60528
+ {
60529
+ internalType: "uint256",
60530
+ name: "stablecoinAmount",
60531
+ type: "uint256"
60532
+ }
60533
+ ],
60534
+ stateMutability: "nonpayable",
60535
+ type: "function"
60536
+ },
60537
+ {
60538
+ inputs: [],
60539
+ name: "redeemEnabled",
60540
+ outputs: [
60541
+ {
60542
+ internalType: "bool",
60543
+ name: "",
60544
+ type: "bool"
60545
+ }
60546
+ ],
60547
+ stateMutability: "view",
60548
+ type: "function"
60549
+ },
60550
+ {
60551
+ inputs: [
60552
+ {
60553
+ internalType: "address",
60554
+ name: "stablecoin",
60555
+ type: "address"
60556
+ }
60557
+ ],
60558
+ name: "removeSupportedStablecoin",
60559
+ outputs: [],
60560
+ stateMutability: "nonpayable",
60561
+ type: "function"
60562
+ },
60563
+ {
60564
+ inputs: [
60565
+ {
60566
+ internalType: "bytes32",
60567
+ name: "role",
60568
+ type: "bytes32"
60569
+ },
60570
+ {
60571
+ internalType: "address",
60572
+ name: "callerConfirmation",
60573
+ type: "address"
60574
+ }
60575
+ ],
60576
+ name: "renounceRole",
60577
+ outputs: [],
60578
+ stateMutability: "nonpayable",
60579
+ type: "function"
60580
+ },
60581
+ {
60582
+ inputs: [
60583
+ {
60584
+ internalType: "address",
60585
+ name: "",
60586
+ type: "address"
60587
+ }
60588
+ ],
60589
+ name: "reserves",
60590
+ outputs: [
60591
+ {
60592
+ internalType: "uint256",
60593
+ name: "",
60594
+ type: "uint256"
60595
+ }
60596
+ ],
60597
+ stateMutability: "view",
60598
+ type: "function"
60599
+ },
60600
+ {
60601
+ inputs: [
60602
+ {
60603
+ internalType: "bytes32",
60604
+ name: "role",
60605
+ type: "bytes32"
60606
+ },
60607
+ {
60608
+ internalType: "address",
60609
+ name: "account",
60610
+ type: "address"
60611
+ }
60612
+ ],
60613
+ name: "revokeRole",
60614
+ outputs: [],
60615
+ stateMutability: "nonpayable",
60616
+ type: "function"
60617
+ },
60618
+ {
60619
+ inputs: [
60620
+ {
60621
+ internalType: "bool",
60622
+ name: "enabled",
60623
+ type: "bool"
60624
+ }
60625
+ ],
60626
+ name: "setRedeemEnabled",
60627
+ outputs: [],
60628
+ stateMutability: "nonpayable",
60629
+ type: "function"
60630
+ },
60631
+ {
60632
+ inputs: [
60633
+ {
60634
+ internalType: "address",
60635
+ name: "",
60636
+ type: "address"
60637
+ }
60638
+ ],
60639
+ name: "stablecoinDecimals",
60640
+ outputs: [
60641
+ {
60642
+ internalType: "uint8",
60643
+ name: "",
60644
+ type: "uint8"
60645
+ }
60646
+ ],
60647
+ stateMutability: "view",
60648
+ type: "function"
60649
+ },
60650
+ {
60651
+ inputs: [
60652
+ {
60653
+ internalType: "address",
60654
+ name: "",
60655
+ type: "address"
60656
+ }
60657
+ ],
60658
+ name: "supportedStablecoins",
60659
+ outputs: [
60660
+ {
60661
+ internalType: "bool",
60662
+ name: "",
60663
+ type: "bool"
60664
+ }
60665
+ ],
60666
+ stateMutability: "view",
60667
+ type: "function"
60668
+ },
60669
+ {
60670
+ inputs: [
60671
+ {
60672
+ internalType: "bytes4",
60673
+ name: "interfaceId",
60674
+ type: "bytes4"
60675
+ }
60676
+ ],
60677
+ name: "supportsInterface",
60678
+ outputs: [
60679
+ {
60680
+ internalType: "bool",
60681
+ name: "",
60682
+ type: "bool"
60683
+ }
60684
+ ],
60685
+ stateMutability: "view",
60686
+ type: "function"
60687
+ },
60688
+ {
60689
+ inputs: [
60690
+ {
60691
+ internalType: "address",
60692
+ name: "stablecoin",
60693
+ type: "address"
60694
+ },
60695
+ {
60696
+ internalType: "uint256",
60697
+ name: "amountIn",
60698
+ type: "uint256"
60699
+ },
60700
+ {
60701
+ internalType: "uint256",
60702
+ name: "minUcdOut",
60703
+ type: "uint256"
60704
+ }
60705
+ ],
60706
+ name: "swap",
60707
+ outputs: [
60708
+ {
60709
+ internalType: "uint256",
60710
+ name: "ucdAmount",
60711
+ type: "uint256"
60712
+ }
60713
+ ],
60714
+ stateMutability: "nonpayable",
60715
+ type: "function"
60716
+ },
60717
+ {
60718
+ inputs: [
60719
+ {
60720
+ internalType: "address",
60721
+ name: "stablecoin",
60722
+ type: "address"
60723
+ }
60724
+ ],
60725
+ name: "syncReserves",
60726
+ outputs: [],
60727
+ stateMutability: "nonpayable",
60728
+ type: "function"
60729
+ },
60730
+ {
60731
+ inputs: [],
60732
+ name: "ucdDecimals",
60733
+ outputs: [
60734
+ {
60735
+ internalType: "uint8",
60736
+ name: "",
60737
+ type: "uint8"
60738
+ }
60739
+ ],
60740
+ stateMutability: "view",
60741
+ type: "function"
60742
+ },
60743
+ {
60744
+ inputs: [],
60745
+ name: "ucdToken",
60746
+ outputs: [
60747
+ {
60748
+ internalType: "address",
60749
+ name: "",
60750
+ type: "address"
60751
+ }
60752
+ ],
60753
+ stateMutability: "view",
60754
+ type: "function"
60755
+ },
60756
+ {
60757
+ inputs: [],
60758
+ name: "unpause",
60759
+ outputs: [],
60760
+ stateMutability: "nonpayable",
60761
+ type: "function"
60762
+ },
60763
+ {
60764
+ inputs: [
60765
+ {
60766
+ internalType: "address",
60767
+ name: "stablecoin",
60768
+ type: "address"
60769
+ },
60770
+ {
60771
+ internalType: "uint256",
60772
+ name: "exchangeRate",
60773
+ type: "uint256"
60774
+ },
60775
+ {
60776
+ internalType: "uint256",
60777
+ name: "entryFeeBps",
60778
+ type: "uint256"
60779
+ },
60780
+ {
60781
+ internalType: "uint256",
60782
+ name: "exitFeeBps",
60783
+ type: "uint256"
60784
+ },
60785
+ {
60786
+ internalType: "uint8",
60787
+ name: "decimals",
60788
+ type: "uint8"
60789
+ },
60790
+ {
60791
+ internalType: "uint256",
60792
+ name: "minSwapAmount",
60793
+ type: "uint256"
60794
+ },
60795
+ {
60796
+ internalType: "uint256",
60797
+ name: "minRedeemAmount",
60798
+ type: "uint256"
60799
+ },
60800
+ {
60801
+ internalType: "uint256",
60802
+ name: "maxSwapAmount",
60803
+ type: "uint256"
60804
+ },
60805
+ {
60806
+ internalType: "uint256",
60807
+ name: "maxRedeemAmount",
60808
+ type: "uint256"
60809
+ }
60810
+ ],
60811
+ name: "updateSupportedStablecoin",
60812
+ outputs: [],
60813
+ stateMutability: "nonpayable",
60814
+ type: "function"
60815
+ },
60816
+ {
60817
+ inputs: [
60818
+ {
60819
+ internalType: "address",
60820
+ name: "newImplementation",
60821
+ type: "address"
60822
+ },
60823
+ {
60824
+ internalType: "bytes",
60825
+ name: "data",
60826
+ type: "bytes"
60827
+ }
60828
+ ],
60829
+ name: "upgradeToAndCall",
60830
+ outputs: [],
60831
+ stateMutability: "payable",
60832
+ type: "function"
60833
+ },
60834
+ {
60835
+ inputs: [],
60836
+ name: "version",
60837
+ outputs: [
60838
+ {
60839
+ internalType: "string",
60840
+ name: "",
60841
+ type: "string"
60842
+ }
60843
+ ],
60844
+ stateMutability: "pure",
60845
+ type: "function"
60846
+ },
60847
+ {
60848
+ inputs: [
60849
+ {
60850
+ internalType: "address",
60851
+ name: "stablecoin",
60852
+ type: "address"
60853
+ },
60854
+ {
60855
+ internalType: "uint256",
60856
+ name: "amount",
60857
+ type: "uint256"
60858
+ }
60859
+ ],
60860
+ name: "withdrawStablecoin",
60861
+ outputs: [],
60862
+ stateMutability: "nonpayable",
60863
+ type: "function"
60864
+ }
60865
+ ];
60866
+ var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161347190816100f0823960805181818161195b0152611a2b0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce9146126e357806301ffc9a71461268c578063021d28931461263e5780630871b20614612605578063114249d2146105ab57806311d954f8146125dc57806313da3166146125a35780631f77bf651461256a578063248a9ca3146125435780632b83cccd1461211d5780632f2ff15d146120eb57806334e18125146120b257806336568abe1461206d5780633f4ba83a14611feb5780634451e89b14611ca25780634ebd25a514611c695780634f1ef286146119b057806352d1902d1461194857806354fd4d50146119095780635c975abb146118d95780638456cb591461186457806385c15d9a1461182b5780638bff608e146117f257806390ad8b40146117d657806391d148541461177d5780639baf58d2146117605780639f1d0f5914611315578063a217fddf146112f9578063ad3cb1cc146112b6578063b121cf7e14610fc2578063b492fc6914610ec8578063b9f637af14610cdd578063bf7d911914610c9e578063c0c53b8b146109b6578063c4c5f6241461090e578063c55f15ea146108eb578063cc1f8ffa146108b9578063cf46075e146107b9578063d21a74ff1461077c578063d2f8253614610759578063d547741f1461071e578063d5d3f78b146105e4578063d66bd524146105ab578063e1f1c4a71461058e578063ec2f96fe1461056a578063f385116d14610531578063f77c47911461050a578063faaebd21146104d1578063facdfb5e1461033b5763fc99bd9a1461024257600080fd5b346103385760403660031901126103385761025b6127ea565b9060243591610268612c82565b6001600160a01b03168082526002602052604082205490929060ff16156103255780156103165782825260076020526040822054926102a78285612b3d565b848110610307576001600160ff1b0381116102f857600080516020613445833981519152604085968493846102f59852600760205280838a205582519182526020820152a2309033906130c9565b80f35b630700fcb360e11b8452600484fd5b63446c8cc960e01b8452600484fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b80fd5b5034610338576020366003190112610338576103556127ea565b61035d612d68565b610365612c82565b6001600160a01b03168082526002602052604082205460ff16156104bf57808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104b457849161047d575b508181111561046e576103cd82826129b3565b8215908115610419575b5050600080516020613445833981519152916040918486526007602052808387205582519182526020820152a260016000805160206133e58339815191525580f35b612710810290808204612710149015171561045a576064840291848304606414171561045a571161044b5738806103d7565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b61047881836129b3565b6103cd565b90506020813d6020116104ac575b816104986020938361287f565b810103126104a75751386103ba565b600080fd5b3d915061048b565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b5034610338576020366003190112610338576020906040906001600160a01b036104f96127ea565b168152600483522054604051908152f35b5034610338578060031936011261033857546040516001600160a01b039091168152602090f35b5034610338576020366003190112610338576020906040906001600160a01b036105596127ea565b168152600a83522054604051908152f35b5034610338578060031936011261033857602060ff60015460a01c16604051908152f35b503461033857806003193601126103385760206040516127108152f35b5034610338576020366003190112610338576020906040906001600160a01b036105d36127ea565b168152600783522054604051908152f35b5034610338576020366003190112610338576105fe6127ea565b610606612c82565b6001600160a01b03168082526002602052604082205460ff16156104bf5780825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806106fb578380f35b816040916000805160206134458339815191529352846020820152a23880808380f35b50346103385760403660031901126103385761075560043561073e612800565b9061075061074b82612a58565b612d1e565b613029565b5080f35b5034610338578060031936011261033857602060ff600854166040519015158152f35b50346103385760203660031901126103385760209060ff906040906001600160a01b036107a76127ea565b16815260058452205416604051908152f35b5034610338576020366003190112610338576107d36127ea565b6107db612d68565b6107e3612c82565b6001600160a01b03168082526002602052604082205460ff16156104bf57808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104b4578491610879575b50600080516020613445833981519152916040918486526007602052808387205582519182526020820152a260016000805160206133e58339815191525580f35b90506020813d6020116108b1575b816108946020938361287f565b810103126104a75751600080516020613445833981519152610838565b3d9150610887565b50346103385760403660031901126103385760206108e16108d86127ea565b60243590612b83565b6040519015158152f35b50346103385780600319360112610338576020604051670de0b6b3a76400008152f35b5034610338576040366003190112610338576109286127ea565b9060243591610935612c82565b6001600160a01b031680825260076020526040822054929081841061099f5780600080516020613445833981519152604086610975866102f598996129b3565b84895260076020528289205583885260076020528188205482519182526020820152a23390612dce565b5091604492633cb8e07360e01b8352600452602452fd5b5034610338576060366003190112610338576109d06127ea565b6109d8612800565b604435906001600160a01b03821690818303610c9a5760008051602061342583398151915254604081901c60ff161594906001600160401b031680159081610c92575b6001149081610c88575b159081610c7f575b50610c705760008051602061342583398151915280546001600160401b031916600117905584610c4b575b6001600160a01b0316908115610c3c576001600160a01b0316918215610c2d5715610c1e57610a856131f5565b610a8d6131f5565b610a956131f5565b60016000805160206133e583398151915255610aaf6131f5565b610ab76131f5565b84546001600160a01b0319908116919091178555600180549182168317905560405163313ce56760e01b8152909190602081600481855afa869181610bed575b50610b0b57633a24e95b60e11b8652600486fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff16600681141580610be2575b610bd05750610b4781612e0a565b15610bc157610b5581612e86565b15610bc157610b6390612f0c565b15610bb257610b6f5780f35b60ff60401b19600080516020613425833981519152541660008051602061342583398151915255600080516020613305833981519152602060405160018152a180f35b63cf5a8e3360e01b8252600482fd5b63cf5a8e3360e01b8352600483fd5b63167738cf60e21b8452600452602483fd5b506012811415610b39565b610c1091925060203d602011610c17575b610c08818361287f565b810190612a88565b9038610af7565b503d610bfe565b630b5eba9f60e41b8552600485fd5b63c1ab6dc160e01b8652600486fd5b6336abb4df60e11b8652600486fd5b600080516020613425833981519152805460ff60401b1916600160401b179055610a58565b63f92ee8a960e01b8652600486fd5b90501538610a2d565b303b159150610a25565b869150610a1b565b8480fd5b50346103385760203660031901126103385760209060ff906040906001600160a01b03610cc96127ea565b168152600284522054166040519015158152f35b503461033857610cec3661291c565b98979694610cfe949194939293612c82565b6001600160a01b038816808a52600260205260408a205490989060ff1615610eb4578615610ea5576127108811610e8b576103e88211610e715760ff831690601282118015610e67575b610e535783610d569161310d565b85151580610e4a575b610e33578a151580610e2a575b610e1357926000805160206132c583398151915297969592828c95610e0d979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889612b4a565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10610d6c565b60448a8588637449915760e01b8352600452602452fd5b50838610610d5f565b63ca95039160e01b8b52600482905260248bfd5b5060068210610d48565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b503461033857604036600319011261033857610ee26127ea565b6001600160a01b0316808252600260205260408220546024359060ff1615610fae578015610f9f57612710610f64604085670de0b6b3a7640000610f53610f6c9688859a52600560205260ff858520541690809160128110610f79575b50508884526003602052848420549061296a565b04958152600460205220548461296a565b0480926129b3565b9082519182526020820152f35b610f98925060ff610f8c610f92926129c0565b166129d1565b9061296a565b3880610f3f565b63162908e360e11b8352600483fd5b6374ed46ad60e01b83526004829052602483fd5b503461033857610fd13661291c565b93610fe3999899979597939193612c82565b6001600160a01b038a16808a52600260205260408a205490989060ff166112a2578815611293578615610ea5576127108811610e8b576103e8811161127b5760ff82169a60128c118015611271575b61125d57803b1561124957826110479161310d565b84151580611240575b6112295785151580611220575b611209576040516370a0823160e01b8152306004820152999a98999860208a6024818e5afa998a156111fe578c9a6111ca575b506001600160ff1b038a116111bb57926000805160206132c583398151915297959261118b95928b60408f8f9d9b988e8083526002602052838320600160ff1982541617905580835260036020528c8484205580835260046020528d8484205580835260066020528584842055825260056020528282209060ff198254161790558d8152600c60205285828220558d8152600d60205286828220558d8152600e60205287828220558d8152600f60205288828220558d8152600760205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf666604080518b81528c6020820152a260405198899889612b4a565b0390a280611197578280f35b6040600080516020613445833981519152918151908582526020820152a238808280f35b63556e7a8160e01b8c5260048cfd5b9099506020813d6020116111f6575b816111e66020938361287f565b810103126104a757519838611090565b3d91506111d9565b6040513d8e823e3d90fd5b60448a858863dd85772b60e01b8352600452602452fd5b5083861061105d565b60448a8487637449915760e01b8352600452602452fd5b50828510611050565b63377e3f9960e21b8b5260048a905260248bfd5b63ca95039160e01b8b5260048c905260248bfd5b5060068c10611032565b631051834f60e11b8a526004526103e8602452604489fd5b63df407ac560e01b8a5260048afd5b6317f4215b60e21b8a52600489905260248afd5b50346103385780600319360112610338576112f560408051906112d9818361287f565b60058252640352e302e360dc1b602083015251918291826128d3565b0390f35b5034610338578060031936011261033857602090604051908152f35b50346103385761132436612825565b91611330939193612d68565b611338612da4565b33825260096020526040822054430361173e57338252600a60205260036040832054101561172f57338252600a602052604082206113768154612a79565b90555b6001600160a01b03168082526002602052604082205490919060ff16611692575b818152600260205260ff6040822054161561168057831561167157821561166257818152600c6020526040812054841061163e57818152600e6020526040812054801561162f578085116116175750818152600760205260408120546114008582612b3d565b818110611608576001600160ff1b0381116115f95760408492600080516020613445833981519152928486526007602052808387205582519182526020820152a261144d843033856130c9565b818152600560205260ff604082205416849060128110611598575b50611489670de0b6b3a764000091848452600360205260408420549061296a565b049082815260046020526114af6127106114a760408420548561296a565b0480936129b3565b93808510611580575080546001600160a01b0316803b1561157c5781809160846040518094819363ae494fa160e01b83523360048401528a60248401528960448401528b60648401525af180156115715761155c575b50507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b61153f602095604051918291339588429285612abc565b0390a360016000805160206133e583398151915255604051908152f35b61156782809261287f565b6103385780611505565b6040513d84823e3d90fd5b5080fd5b6371c4efed60e01b8252600485905260245260449150fd5b6115a89150610f8c60ff916129c0565b80156115e557806000190485116115d6576114896115cf670de0b6b3a7640000928761296a565b9150611468565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b631d7f2ac360e01b8252600485905260245260449150fd5b633b5db2f360e11b8252600482fd5b908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8152600490fd5b63162908e360e11b8152600490fd5b6024916374ed46ad60e01b8252600452fd5b919060405163313ce56760e01b8152602081600481855afa84918161170e575b506116c65763105482c760e21b8452600484fd5b92909192828252600560205260ff8060408420541691169081036116ea575061139a565b6044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b61172891925060203d602011610c1757610c08818361287f565b90386116b2565b63a74c1c5f60e01b8252600482fd5b3382526009602052436040832055338252600a60205260016040832055611379565b503461033857806003193601126103385760206040516103e88152f35b5034610338576040366003190112610338576040611799612800565b9160043581526000805160206133a5833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b5034610338578060031936011261033857602060405160648152f35b5034610338576020366003190112610338576020906040906001600160a01b0361181a6127ea565b168152600983522054604051908152f35b5034610338576020366003190112610338576020906040906001600160a01b036118536127ea565b168152600383522054604051908152f35b503461033857806003193601126103385761187d612cd0565b611885612da4565b600160ff196000805160206133c58339815191525416176000805160206133c5833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b5034610338578060031936011261033857602060ff6000805160206133c583398151915254166040519015158152f35b50346103385780600319360112610338576112f5604080519061192c818361287f565b60058252640322e302e360dc1b602083015251918291826128d3565b50346103385780600319360112610338577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036119a15760206040516000805160206133458339815191528152f35b63703e46dd60e11b8152600490fd5b506040366003190112610338576119c56127ea565b602435906001600160401b038211611c655736602383011215611c6557816004013590836119f2836128b8565b93611a00604051958661287f565b83855260208501933660248284010111611c6557806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115611c42575b50611c33578380526000805160206133a583398151915260209081526040808620336000908152925290205460ff1615611c1b576001600160a01b038116928315611c0c57813b15611bfd576040516352d1902d60e01b8152602081600481885afa869181611bc5575b50611ad957634c9c8ce360e01b86526004859052602486fd5b9384600080516020613345833981519152879603611bb35750823b15611ba15760008051602061334583398151915280546001600160a01b031916821790558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a2805115611b86576107559382915190845af43d15611b7e573d91611b62836128b8565b92611b70604051948561287f565b83523d85602085013e613223565b606091613223565b5050505034611b925780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b8552600452602484fd5b632a87526960e21b8652600452602485fd5b9091506020813d602011611bf5575b81611be16020938361287f565b81010312611bf157519038611ac0565b8680fd5b3d9150611bd4565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b63e2517d3f60e01b8452336004526024849052604484fd5b63703e46dd60e11b8452600484fd5b600080516020613345833981519152546001600160a01b03161415905038611a56565b8280fd5b5034610338576020366003190112610338576020906040906001600160a01b03611c916127ea565b168152600e83522054604051908152f35b503461033857606036600319011261033857611cbc612816565b6024356001600160401b038111611c6557611cdb90369060040161284f565b916044356001600160401b038111610c9a57611cfb90369060040161284f565b6000805160206134258339815191529291925460ff8160401c16908115611fd3575b50610c705760008051602061342583398151915280546001600160481b0319166002600160401b01179055611d50612c82565b600b549160ff8316611fc457818603611fb557611d6c86612ad8565b92611d7a604051948561287f565b868452601f19611d8988612ad8565b01366020860137875b878110611ec0575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110611e1d57876000805160206132a5833981519152602089604051908152a160ff60401b19600080516020613425833981519152541660008051602061342583398151915255600080516020613305833981519152602060405160028152a180f35b80886000805160206134458339815191526040611e45611e40600196888d612aef565b612b15565b611e5085898c612aef565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783611e7d888d612b29565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201611db9565b611ece611e40828a8a612aef565b611ed9828689612aef565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615611fa1576103e88111611f895750906020602492604051938480926370a0823160e01b82523060048301525afa8015611f7e578a90611f48575b60019250611f418288612b29565b5201611d92565b509060203d8111611f77575b611f5e818361287f565b6020826000928101031261033857509060019151611f33565b503d611f54565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b60026001600160401b03919091161015905038611d1d565b5034610338578060031936011261033857612004612cd0565b6000805160206133c58339815191525460ff81161561205e5760ff19166000805160206133c5833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b638dfc202b60e01b8252600482fd5b503461033857604036600319011261033857612087612800565b336001600160a01b038216036120a35761075590600435613029565b63334bd91960e11b8252600482fd5b5034610338576020366003190112610338576020906040906001600160a01b036120da6127ea565b168152600c83522054604051908152f35b50346103385760403660031901126103385761075560043561210b612800565b9061211861074b82612a58565b612f92565b50346103385761212c36612825565b91612135612d68565b61213d612da4565b33845260096020526040842054430361252157338452600a60205260036040852054101561251257338452600a6020526040842061217b8154612a79565b90555b6001600160a01b03168084526002602052604084205490919060ff1661247a575b818452600260205260ff604085205416156124665760ff600854161561245757801561244857821561243957818452600d60205260408420548082106124215750818452600f60205260408420548015612412578082116123fb5750670de0b6b3a76400008102818104670de0b6b3a7640000036123e7578285526003602052604085205461222d91612993565b90828552600660205261224a6127106114a760408820548561296a565b93838652600560205260ff604087205416601281106123bc575b508085106123a557508285526007602052836040862054106123815782855260076020526040852054848110612372576000805160206134458339815191526040826122b18888956129b3565b848a52600760205280838b205582519182526020820152a284546001600160a01b0316803b1561236e578560405180926306888c6760e11b82528183816122fc883360048401612aa1565b03925af18015612363579160209661153f927f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf94612353575b5050612342863387612dce565b604051918291339588429285612abc565b8161235d9161287f565b38612335565b6040513d88823e3d90fd5b8580fd5b6308aed4ef60e31b8652600486fd5b82855260076020526040852054635960d22160e01b86526004526024849052604485fd5b6371c4efed60e01b86526004859052602452604485fd5b946123da6123d360ff610f8c6123e09597996129c0565b8092612993565b95612993565b9138612264565b634e487b7160e01b85526011600452602485fd5b625502a360e91b8552600491909152602452604483fd5b636c6ff70d60e11b8552600485fd5b6361767b8560e01b8552600491909152602452604483fd5b632cd84af360e01b8452600484fd5b63162908e360e11b8452600484fd5b630df65d9f60e01b8452600484fd5b6374ed46ad60e01b84526004829052602484fd5b60405163313ce56760e01b8152602081600481865afa8591816124f1575b506124ac5763105482c760e21b8552600485fd5b828552600560205260ff8060408720541691169081036124cc575061219f565b82855260056020526040852054631e43476360e11b865260ff16600452602452604484fd5b61250b91925060203d602011610c1757610c08818361287f565b9038612498565b63a74c1c5f60e01b8452600484fd5b3384526009602052436040852055338452600a6020526001604085205561217e565b5034610338576020366003190112610338576020612562600435612a58565b604051908152f35b5034610338576020366003190112610338576020906040906001600160a01b036125926127ea565b168152600f83522054604051908152f35b5034610338576020366003190112610338576020906040906001600160a01b036125cb6127ea565b168152600683522054604051908152f35b50346103385780600319360112610338576001546040516001600160a01b039091168152602090f35b5034610338576020366003190112610338576020906040906001600160a01b0361262d6127ea565b168152600d83522054604051908152f35b5034610338576020366003190112610338576000805160206132a58339815191526020612669612816565b612671612c82565b151560ff196008541660ff821617600855604051908152a180f35b50346103385760203660031901126103385760043563ffffffff60e01b811680910361157c57602090637965db0b60e01b81149081156126d2575b506040519015158152f35b6301ffc9a760e01b149050826126c7565b5034610338576040366003190112610338576126fd6127ea565b6001600160a01b03168082526002602052604082205460243592919060ff16156127d757670de0b6b3a7640000830292808404670de0b6b3a764000014901517156127c35760ff604061275d819584865260036020528286205490612993565b938381526006602052612781612710612779848420548861296a565b0480966129b3565b938152600560205220541660128110156127bc57906127aa6123d360ff610f8c6127b0956129c0565b92612993565b82519182526020820152f35b50906127b0565b634e487b7160e01b82526011600452602482fd5b6374ed46ad60e01b825260045260249150fd5b600435906001600160a01b03821682036104a757565b602435906001600160a01b03821682036104a757565b6004359081151582036104a757565b60609060031901126104a7576004356001600160a01b03811681036104a757906024359060443590565b9181601f840112156104a7578235916001600160401b0383116104a7576020808501948460051b0101116104a757565b601f909101601f19168101906001600160401b038211908210176128a257604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116128a257601f01601f191660200190565b91909160208152825180602083015260005b818110612906575060409293506000838284010152601f8019910116010190565b80602080928701015160408286010152016128e5565b6101209060031901126104a7576004356001600160a01b03811681036104a7579060243590604435906064359060843560ff811681036104a7579060a4359060c4359060e435906101043590565b8181029291811591840414171561297d57565b634e487b7160e01b600052601160045260246000fd5b811561299d570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161297d57565b60ff166012039060ff821161297d57565b8015612a525760009060208110600116604e821060011617612a4a57600a916001915b60018111612a21575082600019048211612a0d57500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116127c35760018416612a41575b80029260011c6129f4565b80920291612a36565b9050600a0a90565b50600190565b6000526000805160206133a583398151915260205260016040600020015490565b600019811461297d5760010190565b908160209103126104a7575160ff811681036104a75790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b0381116128a25760051b60200190565b9190811015612aff5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036104a75790565b8051821015612aff5760209160051b010190565b9190820180921161297d57565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015612c75575b8015612c6d575b612c5b5781600052600f6020526040600020548015908115612c63575b50612c5b57612bf3926040918251948592839262f7fce960e01b845260048401612aa1565b0381305afa918215612c4f57600092612c1b575b506000526007602052604060002054101590565b9091506040813d604011612c47575b81612c376040938361287f565b810103126104a757519038612c07565b3d9150612c2a565b6040513d6000823e3d90fd5b505050600090565b9050831138612bce565b508215612bb1565b5060ff6008541615612baa565b3360009081526000805160206132e5833981519152602052604090205460ff1615612ca957565b63e2517d3f60e01b6000523360045260008051602061340583398151915260245260446000fd5b336000908152600080516020613365833981519152602052604090205460ff1615612cf757565b63e2517d3f60e01b6000523360045260008051602061338583398151915260245260446000fd5b60008181526000805160206133a58339815191526020908152604080832033845290915290205460ff1615612d505750565b63e2517d3f60e01b6000523360045260245260446000fd5b60026000805160206133e58339815191525414612d935760026000805160206133e583398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206133c58339815191525416612dbd57565b63d93c066560e01b60005260046000fd5b612e03612e089392612df560405194859263a9059cbb60e01b602085015260248401612aa1565b03601f19810184528361287f565b61319a565b565b6001600160a01b0381166000908152600080516020613325833981519152602052604090205460ff16612e80576001600160a01b0316600081815260008051602061332583398151915260205260408120805460ff191660011790553391906000805160206132858339815191528180a4600190565b50600090565b6001600160a01b03811660009081526000805160206132e5833981519152602052604090205460ff16612e80576001600160a01b031660008181526000805160206132e583398151915260205260408120805460ff19166001179055339190600080516020613405833981519152906000805160206132858339815191529080a4600190565b6001600160a01b0381166000908152600080516020613365833981519152602052604090205460ff16612e80576001600160a01b0316600081815260008051602061336583398151915260205260408120805460ff19166001179055339190600080516020613385833981519152906000805160206132858339815191529080a4600190565b60008181526000805160206133a5833981519152602090815260408083206001600160a01b038616845290915290205460ff166130225760008181526000805160206133a5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291906000805160206132858339815191529080a4600190565b5050600090565b60008181526000805160206133a5833981519152602090815260408083206001600160a01b038616845290915290205460ff16156130225760008181526000805160206133a5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152612e0891612e0360848361287f565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281613179575b5061315057631eecbb6560e01b60005260046000fd5b60ff9182169116808203613162575050565b631e43476360e11b60005260045260245260446000fd5b61319391935060203d602011610c1757610c08818361287f565b913861313a565b906000602091828151910182855af115612c4f576000513d6131ec57506001600160a01b0381163b155b6131cb5750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156131c4565b60ff6000805160206134258339815191525460401c161561321257565b631afcd79f60e31b60005260046000fd5b90613249575080511561323857602081519101fd5b63d6bda27560e01b60005260046000fd5b8151158061327b575b61325a575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561325256fe2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629b16e88c42fd4e48df2dd6a2eabd6bc9aec654ec170056b470819f8892cc6431cc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2b7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc75442b0a96088b5456bc4ed01394c96a4feec0f883c9494257d76b96ab1c9b6b65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
60867
+ var isSuperArgs = (xs) => xs.length > 1;
60868
+ var SimplePSMV2__factory = class extends ContractFactory {
60869
+ constructor(...args) {
60870
+ if (isSuperArgs(args)) {
60871
+ super(...args);
60872
+ } else {
60873
+ super(_abi, _bytecode, args[0]);
60874
+ }
60875
+ }
60876
+ getDeployTransaction(overrides) {
60877
+ return super.getDeployTransaction(overrides || {});
60878
+ }
60879
+ deploy(overrides) {
60880
+ return super.deploy(overrides || {});
60881
+ }
60882
+ connect(runner) {
60883
+ return super.connect(runner);
60884
+ }
60885
+ static bytecode = _bytecode;
60886
+ static abi = _abi;
60887
+ static createInterface() {
60888
+ return new Interface(_abi);
60889
+ }
60890
+ static connect(address, runner) {
60891
+ return new Contract(address, _abi, runner);
60892
+ }
60893
+ };
60894
+
60895
+ // src/modules/mock/mock-token-manager.module.ts
60896
+ var MockTokenManager = class {
60897
+ config;
60898
+ constructor(config) {
60899
+ this.config = config;
60900
+ if (this.isProductionNetwork()) {
60901
+ log.warn("\u26A0\uFE0F MockTokenManager initialized on production network", {
60902
+ network: config.network
60903
+ });
60904
+ }
60905
+ }
60906
+ /**
60907
+ * Mint mock BTC tokens
60908
+ *
60909
+ * @param amount - Amount to mint in satoshis
60910
+ * @param recipient - Recipient address
60911
+ * @returns Transaction result
60912
+ */
60913
+ async mintMockBTC(amount, recipient) {
60914
+ if (this.config.debug) {
60915
+ log.info("\u{1FA99} Minting mock BTC", {
60916
+ amount: amount.toString(),
60917
+ recipient
60918
+ });
60919
+ }
60920
+ if (this.isProductionNetwork()) {
60921
+ return failure(
60922
+ new SDKError({
60923
+ message: "Cannot mint mock tokens on production network",
60924
+ category: "CONFIGURATION" /* CONFIGURATION */,
60925
+ severity: "HIGH" /* HIGH */,
60926
+ originalError: new Error("Production network detected")
60927
+ })
60928
+ );
60929
+ }
60930
+ return tryCatchAsync(
60931
+ async () => {
60932
+ const signerResult = this.config.contractManager.getSigner();
60933
+ if (!signerResult.success) {
60934
+ throw signerResult.error;
60935
+ }
60936
+ throw new Error("Mock BTC contract not yet integrated");
60937
+ },
60938
+ (error) => new SDKError({
60939
+ message: "Failed to mint mock BTC",
60940
+ category: "CONTRACT" /* CONTRACT */,
60941
+ severity: "MEDIUM" /* MEDIUM */,
60942
+ originalError: error instanceof Error ? error : new Error(String(error)),
60943
+ context: { amount: amount.toString(), recipient }
60944
+ })
60945
+ );
60946
+ }
60947
+ /**
60948
+ * Approve mock BTC spending
60949
+ *
60950
+ * @param spender - Spender address
60951
+ * @param amount - Amount to approve in satoshis
60952
+ * @returns Transaction result
60953
+ */
60954
+ async approveMockBTC(spender, amount) {
60955
+ if (this.config.debug) {
60956
+ log.info("\u2705 Approving mock BTC spending", {
60957
+ spender,
60958
+ amount: amount.toString()
60959
+ });
60960
+ }
60961
+ if (this.isProductionNetwork()) {
60962
+ return failure(
60963
+ new SDKError({
60964
+ message: "Cannot approve mock tokens on production network",
60965
+ category: "CONFIGURATION" /* CONFIGURATION */,
60966
+ severity: "HIGH" /* HIGH */,
60967
+ originalError: new Error("Production network detected")
60968
+ })
60969
+ );
60970
+ }
60971
+ return tryCatchAsync(
60972
+ async () => {
60973
+ const signerResult = this.config.contractManager.getSigner();
60974
+ if (!signerResult.success) {
60975
+ throw signerResult.error;
60976
+ }
60977
+ throw new Error("Mock BTC contract not yet integrated");
60978
+ },
60979
+ (error) => new SDKError({
60980
+ message: "Failed to approve mock BTC",
60981
+ category: "CONTRACT" /* CONTRACT */,
60982
+ severity: "MEDIUM" /* MEDIUM */,
60983
+ originalError: error instanceof Error ? error : new Error(String(error)),
60984
+ context: { spender, amount: amount.toString() }
60985
+ })
60986
+ );
60987
+ }
60988
+ /**
60989
+ * Get mock BTC balance
60990
+ *
60991
+ * @param address - Address to query
60992
+ * @returns Balance in satoshis
60993
+ */
60994
+ async getMockBTCBalance(address) {
60995
+ if (this.config.debug) {
60996
+ log.info("\u{1F50D} Querying mock BTC balance", { address });
60997
+ }
60998
+ return tryCatchAsync(
60999
+ async () => {
61000
+ throw new Error("Mock BTC contract not yet integrated");
61001
+ },
61002
+ (error) => new SDKError({
61003
+ message: "Failed to get mock BTC balance",
61004
+ category: "CONTRACT" /* CONTRACT */,
61005
+ severity: "MEDIUM" /* MEDIUM */,
61006
+ originalError: error instanceof Error ? error : new Error(String(error)),
61007
+ context: { address }
61008
+ })
61009
+ );
61010
+ }
61011
+ /**
61012
+ * Check if current network is production (mainnet)
61013
+ */
61014
+ isProductionNetwork() {
61015
+ return this.config.network.toLowerCase().includes("mainnet");
61016
+ }
61017
+ };
61018
+ function createMockTokenManager(config) {
61019
+ try {
61020
+ const manager = new MockTokenManager(config);
61021
+ return success(manager);
61022
+ } catch (error) {
61023
+ return failure(
61024
+ new SDKError({
61025
+ message: "Failed to create MockTokenManager",
61026
+ category: "INITIALIZATION" /* INITIALIZATION */,
61027
+ severity: "HIGH" /* HIGH */,
61028
+ originalError: error instanceof Error ? error : new Error(String(error))
61029
+ })
61030
+ );
61031
+ }
61032
+ }
61033
+
61034
+ // src/modules/diamond-hands-sdk.ts
61035
+ var import_dh_lit_actions2 = __toESM(require_pkg_src());
61036
+ import { LitOps } from "@gvnrdao/dh-lit-ops";
61037
+
61038
+ // src/utils/telegram-messaging.utils.ts
61039
+ var TelegramBot = null;
61040
+ try {
61041
+ if (typeof window === "undefined" && typeof global !== "undefined") {
61042
+ TelegramBot = __require("node-telegram-bot-api");
61043
+ }
61044
+ } catch (error) {
61045
+ console.warn("Telegram bot API not available:", error instanceof Error ? error.message : String(error));
61046
+ }
61047
+ function formatMintMessage(mintAmount, loanId, txHash) {
61048
+ return `\u2705 DH SDK: ${mintAmount} UCD was minted for loan id: ${loanId} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
61049
+ }
61050
+ function formatPartialPaymentMessage(paymentAmount, loanId, txHash) {
61051
+ return `\u2705 DH SDK: ${paymentAmount} UCD was repaid for loan id: ${loanId} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
61052
+ }
61053
+ function formatPartialPaymentFailureMessage(paymentAmount, loanId, txHash) {
61054
+ const baseMessage = `\u274C DH SDK: FAILED to repay ${paymentAmount} UCD for loan id: ${loanId}`;
61055
+ if (txHash) {
61056
+ return `${baseMessage} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
61057
+ }
61058
+ return baseMessage;
61059
+ }
61060
+ function formatLoanCreationMessage(positionId, pkpId, vaultAddress) {
61061
+ const vault = vaultAddress || "unknown";
58911
61062
  return `\u2705 DH SDK: A new loan was created Id: ${positionId} Pkp: ${pkpId} Regtest BTC vault: ${vault}`;
58912
61063
  }
58913
61064
  function formatBTCWithdrawalFailureMessage(withdrawalAmount, btcVault, btcDestinationAddress, loanId) {
@@ -59035,7 +61186,8 @@ function normalizeTransactionReceipt(receipt) {
59035
61186
  transactionIndex: receiptObj.transactionIndex,
59036
61187
  gasUsed: receiptObj.gasUsed ? normalizeBigNumberish(receiptObj.gasUsed) : void 0,
59037
61188
  blockHash: receiptObj.blockHash,
59038
- transactionHash: receiptObj.transactionHash,
61189
+ transactionHash: receiptObj.transactionHash ?? receiptObj.hash,
61190
+ hash: receiptObj.hash ?? receiptObj.transactionHash,
59039
61191
  blockNumber: receiptObj.blockNumber,
59040
61192
  confirmations: receiptObj.confirmations,
59041
61193
  cumulativeGasUsed: receiptObj.cumulativeGasUsed ? normalizeBigNumberish(receiptObj.cumulativeGasUsed) : void 0,
@@ -59336,7 +61488,8 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
59336
61488
  provider: config.provider,
59337
61489
  signer: config.contractSigner,
59338
61490
  contractAddresses: config.contractAddresses,
59339
- debug: config.debug
61491
+ debug: config.debug,
61492
+ networkName: config.chain
59340
61493
  });
59341
61494
  if (!contractManagerResult.success) {
59342
61495
  throw new Error(
@@ -59613,6 +61766,9 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
59613
61766
  if (config.chainId === void 0 && typeof chainId === "number") {
59614
61767
  enrichedConfig.chainId = chainId;
59615
61768
  }
61769
+ if (!enrichedConfig.chain && networkConfig.name) {
61770
+ enrichedConfig.chain = networkConfig.name;
61771
+ }
59616
61772
  if (!userProvidedServiceEndpoint && networkConfig.serviceEndpoint && config.mode === "service") {
59617
61773
  enrichedConfig.serviceEndpoint = networkConfig.serviceEndpoint;
59618
61774
  if (config.debug) {
@@ -60161,11 +62317,11 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
60161
62317
  }
60162
62318
  } else {
60163
62319
  try {
60164
- const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
62320
+ const pkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
60165
62321
  pkpPublicKey = await getPKPPublicKeyFromTokenId(
60166
62322
  position2.pkpId,
60167
62323
  this.getProviderOrThrow(),
60168
- nagaPkpNftAddress,
62324
+ pkpNftAddress,
60169
62325
  this.getChipotlePublicKeyFallback()
60170
62326
  );
60171
62327
  pkpEthAddress = computeAddress(pkpPublicKey);
@@ -61266,11 +63422,11 @@ Error data: ${errorData || "none"}`
61266
63422
  wasLiquidated: false
61267
63423
  };
61268
63424
  }
61269
- const nagaPkpNftAddressLiq = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
63425
+ const pkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
61270
63426
  const pkpPublicKey = await getPKPPublicKeyFromTokenId(
61271
63427
  position.pkpId,
61272
63428
  this.getProviderOrThrow(),
61273
- nagaPkpNftAddressLiq,
63429
+ pkpNftAddress,
61274
63430
  this.getChipotlePublicKeyFallback()
61275
63431
  );
61276
63432
  const pkpEthAddress = computeAddress(pkpPublicKey);
@@ -63384,11 +65540,11 @@ Error data: ${errorData || "none"}`
63384
65540
  }
63385
65541
  } else {
63386
65542
  try {
63387
- const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
65543
+ const pkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
63388
65544
  pkpPublicKey = await getPKPPublicKeyFromTokenId(
63389
65545
  position.pkpId,
63390
65546
  this.getProviderOrThrow(),
63391
- nagaPkpNftAddress,
65547
+ pkpNftAddress,
63392
65548
  this.getChipotlePublicKeyFallback()
63393
65549
  );
63394
65550
  pkpEthAddress = computeAddress(pkpPublicKey);
@@ -64513,6 +66669,45 @@ Error data: ${errorData || "none"}`
64513
66669
  async getLoanEvents(positionId, filter) {
64514
66670
  return this.loanQuery.getLoanEvents(positionId, filter);
64515
66671
  }
66672
+ /**
66673
+ * Get protocol-wide events across all indexed entity types.
66674
+ * Returns a merged, sorted discriminated-union timeline.
66675
+ * Narrow to a position with filter.positionId, or restrict event kinds with filter.kinds.
66676
+ */
66677
+ async getAllEvents(filter) {
66678
+ return this.graphClient.getAllEvents(filter);
66679
+ }
66680
+ // ============================================================================
66681
+ // HIGH-LEVEL API - PSM (Peg Stability Module)
66682
+ // ============================================================================
66683
+ /**
66684
+ * Return PSM-supported stablecoins from the subgraph, including indexed reserves,
66685
+ * fees, exchange rate, and volume stats.
66686
+ *
66687
+ * @param onlySupported - When true (default) filters to currently-supported coins only.
66688
+ */
66689
+ async getPSMStablecoins(onlySupported = true) {
66690
+ return this.graphClient.getSupportedStablecoins(onlySupported);
66691
+ }
66692
+ /**
66693
+ * Return the live on-chain available reserve balance for a single stablecoin in the PSM.
66694
+ * Prefer this over the subgraph `reserves` field when freshness matters (e.g. pre-swap validation).
66695
+ *
66696
+ * @param stablecoinAddress - EVM address of the stablecoin to query.
66697
+ */
66698
+ async getPSMAvailableReserves(stablecoinAddress) {
66699
+ const psmAddress = this.config.contractAddresses?.simplePsmV2;
66700
+ if (!psmAddress) {
66701
+ throw new Error(
66702
+ "SimplePSMV2 address not configured \u2014 provide contractAddresses.simplePsmV2"
66703
+ );
66704
+ }
66705
+ const psm = SimplePSMV2__factory.connect(
66706
+ psmAddress,
66707
+ this.getProviderOrThrow()
66708
+ );
66709
+ return psm.getAvailableReserves(stablecoinAddress);
66710
+ }
64516
66711
  /**
64517
66712
  * Wait for the subgraph to index up to (and including) the given block number.
64518
66713
  * Call after on-chain actions (createLoan, mintUCD, etc.) before querying the subgraph.
@@ -65507,8 +67702,10 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
65507
67702
  })(PaymentType || {});
65508
67703
  var PositionStatus = /* @__PURE__ */ ((PositionStatus2) => {
65509
67704
  PositionStatus2["PENDING_DEPOSIT"] = "PENDING_DEPOSIT";
67705
+ PositionStatus2["PENDING_MINT"] = "PENDING_MINT";
65510
67706
  PositionStatus2["ACTIVE"] = "ACTIVE";
65511
67707
  PositionStatus2["EXPIRED"] = "EXPIRED";
67708
+ PositionStatus2["LIQUIDATABLE"] = "LIQUIDATABLE";
65512
67709
  PositionStatus2["LIQUIDATED"] = "LIQUIDATED";
65513
67710
  PositionStatus2["REPAID"] = "REPAID";
65514
67711
  PositionStatus2["CLOSED"] = "CLOSED";
@@ -65525,32 +67722,30 @@ function numericToPositionStatus(status) {
65525
67722
  case 0:
65526
67723
  return "PENDING_DEPOSIT" /* PENDING_DEPOSIT */;
65527
67724
  case 1:
65528
- return "ACTIVE" /* ACTIVE */;
67725
+ return "PENDING_MINT" /* PENDING_MINT */;
65529
67726
  case 2:
65530
- return "EXPIRED" /* EXPIRED */;
67727
+ return "ACTIVE" /* ACTIVE */;
65531
67728
  case 3:
65532
- return "LIQUIDATED" /* LIQUIDATED */;
67729
+ return "EXPIRED" /* EXPIRED */;
65533
67730
  case 4:
65534
- return "REPAID" /* REPAID */;
67731
+ return "LIQUIDATABLE" /* LIQUIDATABLE */;
65535
67732
  case 5:
67733
+ return "LIQUIDATED" /* LIQUIDATED */;
67734
+ case 6:
67735
+ return "REPAID" /* REPAID */;
67736
+ case 7:
65536
67737
  return "CLOSED" /* CLOSED */;
65537
67738
  default:
65538
67739
  throw new Error(`Invalid position status: ${status}`);
65539
67740
  }
65540
67741
  }
65541
67742
  var EventHelpers = {
65542
- /**
65543
- * Sort events by timestamp (descending by default)
65544
- */
65545
67743
  sortByTimestamp(events, direction = "desc") {
65546
67744
  return [...events].sort((a, b2) => {
65547
67745
  const diff = BigInt(a.timestamp) - BigInt(b2.timestamp);
65548
67746
  return direction === "asc" ? Number(diff) : -Number(diff);
65549
67747
  });
65550
67748
  },
65551
- /**
65552
- * Filter events by timestamp range
65553
- */
65554
67749
  filterByTimestamp(events, fromTimestamp, toTimestamp) {
65555
67750
  return events.filter((event) => {
65556
67751
  const ts = BigInt(event.timestamp);
@@ -65561,9 +67756,6 @@ var EventHelpers = {
65561
67756
  return true;
65562
67757
  });
65563
67758
  },
65564
- /**
65565
- * Filter events by block range
65566
- */
65567
67759
  filterByBlock(events, fromBlock, toBlock) {
65568
67760
  return events.filter((event) => {
65569
67761
  const block = BigInt(event.blockNumber);
@@ -65574,17 +67766,12 @@ var EventHelpers = {
65574
67766
  return true;
65575
67767
  });
65576
67768
  },
65577
- /**
65578
- * Get total count of all events
65579
- */
65580
67769
  getTotalCount(events) {
65581
- return events.payments.length + events.statusUpdates.length + (events.liquidation ? 1 : 0) + events.mints.length + events.withdrawals.length + events.renewals.length + events.operationFailures.length + events.mintRequests.length + events.burnRequests.length + events.collateralEvents.length + events.circuitBreakerEvents.length + events.termFeeUpdates.length + events.loanProtocolParamUpdates.length + events.maxLoanValueUpdates.length + events.btcPriceBoundsUpdates.length + events.perUserMintLimitUpdates.length;
67770
+ return (events.positionCreated ? 1 : 0) + events.payments.length + events.statusUpdates.length + (events.liquidation ? 1 : 0) + events.mints.length + events.withdrawals.length + events.renewals.length + events.operationFailures.length + events.mintRequests.length + events.burnRequests.length + events.collateralEvents.length;
65582
67771
  },
65583
- /**
65584
- * Merge and sort all events by timestamp
65585
- */
65586
67772
  getAllEventsSorted(events, direction = "desc") {
65587
67773
  const allEvents = [
67774
+ ...events.positionCreated ? [{ ...events.positionCreated, eventType: "positionCreated" }] : [],
65588
67775
  ...events.payments.map((e) => ({ ...e, eventType: "payment" })),
65589
67776
  ...events.statusUpdates.map((e) => ({ ...e, eventType: "status" })),
65590
67777
  ...events.liquidation ? [{ ...events.liquidation, eventType: "liquidation" }] : [],
@@ -65594,13 +67781,7 @@ var EventHelpers = {
65594
67781
  ...events.operationFailures.map((e) => ({ ...e, eventType: "operationFailure" })),
65595
67782
  ...events.mintRequests.map((e) => ({ ...e, eventType: "mintRequest" })),
65596
67783
  ...events.burnRequests.map((e) => ({ ...e, eventType: "burnRequest" })),
65597
- ...events.collateralEvents.map((e) => ({ ...e, eventType: "collateralEvent" })),
65598
- ...events.circuitBreakerEvents.map((e) => ({ ...e, eventType: "circuitBreaker" })),
65599
- ...events.termFeeUpdates.map((e) => ({ ...e, eventType: "termFeeUpdate" })),
65600
- ...events.loanProtocolParamUpdates.map((e) => ({ ...e, eventType: "loanProtocolParamUpdate" })),
65601
- ...events.maxLoanValueUpdates.map((e) => ({ ...e, eventType: "maxLoanValueUpdate" })),
65602
- ...events.btcPriceBoundsUpdates.map((e) => ({ ...e, eventType: "btcPriceBoundsUpdate" })),
65603
- ...events.perUserMintLimitUpdates.map((e) => ({ ...e, eventType: "perUserMintLimitUpdate" }))
67784
+ ...events.collateralEvents.map((e) => ({ ...e, eventType: "collateralEvent" }))
65604
67785
  ];
65605
67786
  return allEvents.sort((a, b2) => {
65606
67787
  const diff = BigInt(a.timestamp) - BigInt(b2.timestamp);