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