@gvnrdao/dh-sdk 0.0.252 → 0.0.255
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/deployments.js +73 -66
- package/dist/deployments.mjs +73 -66
- package/dist/index.js +202 -108
- package/dist/index.mjs +202 -108
- package/dist/interfaces/chunks/config.i.d.ts +1 -0
- package/dist/modules/diamond-hands-sdk.d.ts +19 -0
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3681,51 +3681,51 @@ var init_deployment_addresses = __esm({
|
|
|
3681
3681
|
},
|
|
3682
3682
|
upgraded: {
|
|
3683
3683
|
PositionManager: {
|
|
3684
|
-
previousImplementation: "
|
|
3685
|
-
newImplementation: "
|
|
3686
|
-
upgradedAt: "2026-05-
|
|
3684
|
+
previousImplementation: "0x623f3bDff8830d2161D3b5D42d38b39697c65eBE",
|
|
3685
|
+
newImplementation: "0xa89b9DA4C2C4715d83EF08daC080a39545367467",
|
|
3686
|
+
upgradedAt: "2026-05-17T15:53:13.068Z",
|
|
3687
3687
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3688
3688
|
reason: "Shared upgrade script: PositionManager implementation update"
|
|
3689
3689
|
},
|
|
3690
3690
|
LoanOperationsManagerModule: {
|
|
3691
|
-
previousImplementation: "
|
|
3692
|
-
newImplementation: "
|
|
3693
|
-
upgradedAt: "2026-05-
|
|
3691
|
+
previousImplementation: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
3692
|
+
newImplementation: "0x07f4710B7A5FF0d532b362c4Ba7a1DC5e4B9D187",
|
|
3693
|
+
upgradedAt: "2026-05-17T15:55:00.789Z",
|
|
3694
3694
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3695
|
-
reason: "Shared upgrade script: LoanOperationsManagerModule
|
|
3695
|
+
reason: "Shared upgrade script: LoanOperationsManagerModule implementation update"
|
|
3696
3696
|
},
|
|
3697
3697
|
UCDController: {
|
|
3698
|
-
previousImplementation: "
|
|
3699
|
-
newImplementation: "
|
|
3700
|
-
upgradedAt: "2026-05-
|
|
3698
|
+
previousImplementation: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
|
|
3699
|
+
newImplementation: "0x397dE5069270d90c1A62679e0496029D856Cb0ff",
|
|
3700
|
+
upgradedAt: "2026-05-17T15:28:37.792Z",
|
|
3701
3701
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3702
3702
|
reason: "Shared upgrade script: UCDController implementation update"
|
|
3703
3703
|
},
|
|
3704
3704
|
TermManagerModule: {
|
|
3705
|
-
previousImplementation: "
|
|
3706
|
-
newImplementation: "
|
|
3707
|
-
upgradedAt: "2026-05-
|
|
3705
|
+
previousImplementation: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
|
|
3706
|
+
newImplementation: "0x358d6A7A864853beAA3E157fEB83dCEb1628E8eB",
|
|
3707
|
+
upgradedAt: "2026-05-17T15:35:37.627Z",
|
|
3708
3708
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3709
3709
|
reason: "Shared upgrade script: TermManagerModule implementation update"
|
|
3710
3710
|
},
|
|
3711
3711
|
CircuitBreakerModule: {
|
|
3712
|
-
previousImplementation: "
|
|
3713
|
-
newImplementation: "
|
|
3714
|
-
upgradedAt: "2026-05-
|
|
3712
|
+
previousImplementation: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
|
|
3713
|
+
newImplementation: "0xA5b11b895fB5a49731ab81BF9FC807b9029c8C98",
|
|
3714
|
+
upgradedAt: "2026-05-17T15:41:49.053Z",
|
|
3715
3715
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3716
3716
|
reason: "Shared upgrade script: CircuitBreakerModule implementation update"
|
|
3717
3717
|
},
|
|
3718
3718
|
AdminModule: {
|
|
3719
|
-
previousImplementation: "
|
|
3720
|
-
newImplementation: "
|
|
3721
|
-
upgradedAt: "2026-05-
|
|
3719
|
+
previousImplementation: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
|
|
3720
|
+
newImplementation: "0x6ec85cb3F377d8D778F7830eA69C578C75cD7488",
|
|
3721
|
+
upgradedAt: "2026-05-17T15:43:53.074Z",
|
|
3722
3722
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3723
3723
|
reason: "Shared upgrade script: AdminModule implementation update"
|
|
3724
3724
|
},
|
|
3725
3725
|
PositionManagerViews: {
|
|
3726
|
-
previousImplementation: "
|
|
3727
|
-
newImplementation: "
|
|
3728
|
-
upgradedAt: "2026-05-
|
|
3726
|
+
previousImplementation: "0xBd1F92F24E89cC55acFc422eCA0df00F68B99565",
|
|
3727
|
+
newImplementation: "0x3ae633b330Ea80F92c27479639F7ff14351A63Bb",
|
|
3728
|
+
upgradedAt: "2026-05-17T15:49:48.840Z",
|
|
3729
3729
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3730
3730
|
reason: "Shared upgrade script: PositionManagerViews implementation update"
|
|
3731
3731
|
},
|
|
@@ -3737,51 +3737,51 @@ var init_deployment_addresses = __esm({
|
|
|
3737
3737
|
reason: "Add setPositionExpiry() for expiry-liquidation E2E testing"
|
|
3738
3738
|
},
|
|
3739
3739
|
UCDToken: {
|
|
3740
|
-
previousImplementation: "
|
|
3741
|
-
newImplementation: "
|
|
3742
|
-
upgradedAt: "2026-05-
|
|
3740
|
+
previousImplementation: "0x65c23B6fB5331ACeeC2d82328c6de7dB6b62bB65",
|
|
3741
|
+
newImplementation: "0xC587a2cb7e828A44d8C6190eDA6c47b08BA07115",
|
|
3742
|
+
upgradedAt: "2026-05-17T15:30:48.963Z",
|
|
3743
3743
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3744
3744
|
reason: "Shared upgrade script: UCDToken implementation update"
|
|
3745
3745
|
},
|
|
3746
3746
|
PositionManagerCoreModule: {
|
|
3747
|
-
previousImplementation: "
|
|
3748
|
-
newImplementation: "
|
|
3749
|
-
upgradedAt: "2026-05-
|
|
3747
|
+
previousImplementation: "0x2e34353852d95f8D39aE648af817de9f750c84D6",
|
|
3748
|
+
newImplementation: "0xBf62F7568B6847C08E943548dC727fCAFaa1e6Df",
|
|
3749
|
+
upgradedAt: "2026-05-17T15:32:48.894Z",
|
|
3750
3750
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3751
3751
|
reason: "Shared upgrade script: PositionManagerCoreModule implementation update"
|
|
3752
3752
|
},
|
|
3753
3753
|
CollateralManagerModule: {
|
|
3754
|
-
previousImplementation: "
|
|
3755
|
-
newImplementation: "
|
|
3756
|
-
upgradedAt: "2026-05-
|
|
3754
|
+
previousImplementation: "0xC3DD73d669174ED7012579bf2dAAf77085AdD4Cf",
|
|
3755
|
+
newImplementation: "0x428982fCC9A0455c56881B8e21C96B220CC1506B",
|
|
3756
|
+
upgradedAt: "2026-05-17T15:37:25.129Z",
|
|
3757
3757
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3758
3758
|
reason: "Shared upgrade script: CollateralManagerModule implementation update"
|
|
3759
3759
|
},
|
|
3760
3760
|
LiquidationManagerModule: {
|
|
3761
|
-
previousImplementation: "
|
|
3762
|
-
newImplementation: "
|
|
3763
|
-
upgradedAt: "2026-05-
|
|
3761
|
+
previousImplementation: "0x15864ea3ECBe7E9FFa0a52b49c4dc7f258FA6300",
|
|
3762
|
+
newImplementation: "0x52e2231f26E8410881BF929e881d295175e078Be",
|
|
3763
|
+
upgradedAt: "2026-05-17T15:39:25.668Z",
|
|
3764
3764
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3765
3765
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
3766
3766
|
},
|
|
3767
3767
|
BTCSpendAuthorizer: {
|
|
3768
|
-
previousImplementation: "
|
|
3769
|
-
newImplementation: "
|
|
3770
|
-
upgradedAt: "2026-05-
|
|
3768
|
+
previousImplementation: "0x8021588673Abf0396c1756EdD16F9B9b6d09fcaC",
|
|
3769
|
+
newImplementation: "0x4614F3aAEB53AE8d8FB2F44d28011bD717764F8f",
|
|
3770
|
+
upgradedAt: "2026-05-17T15:45:37.882Z",
|
|
3771
3771
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3772
3772
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
3773
3773
|
},
|
|
3774
3774
|
SimplePSMV2: {
|
|
3775
|
-
previousImplementation: "
|
|
3776
|
-
newImplementation: "
|
|
3777
|
-
upgradedAt: "2026-05-
|
|
3775
|
+
previousImplementation: "0x0728434d86532FD67A4a7227958654C029b333F6",
|
|
3776
|
+
newImplementation: "0x6C36fc51D81601db681217B3083A9D3148c352D8",
|
|
3777
|
+
upgradedAt: "2026-05-17T15:57:01.116Z",
|
|
3778
3778
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3779
3779
|
reason: "Shared upgrade script: SimplePSMV2 implementation update"
|
|
3780
3780
|
},
|
|
3781
3781
|
UpgradeValidator: {
|
|
3782
|
-
previousImplementation: "
|
|
3783
|
-
newImplementation: "
|
|
3784
|
-
upgradedAt: "2026-05-
|
|
3782
|
+
previousImplementation: "0x535c9d66F9CFa4f2337cF6074BFc8fdcBBb9cFC4",
|
|
3783
|
+
newImplementation: "0x2Dd375041Be067E7d12bAB2106911Ce209EbD12f",
|
|
3784
|
+
upgradedAt: "2026-05-17T15:58:37.805Z",
|
|
3785
3785
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3786
3786
|
reason: "Shared upgrade script: UpgradeValidator implementation update"
|
|
3787
3787
|
},
|
|
@@ -3793,16 +3793,16 @@ var init_deployment_addresses = __esm({
|
|
|
3793
3793
|
reason: "Fresh UUPS proxy deployment (v2.1.0). Previous address was a plain implementation contract with _disableInitializers() \u2014 no proxy, no live state to migrate."
|
|
3794
3794
|
},
|
|
3795
3795
|
ContractVersionRegistry: {
|
|
3796
|
-
previousImplementation: "
|
|
3797
|
-
newImplementation: "
|
|
3798
|
-
upgradedAt: "2026-05-
|
|
3796
|
+
previousImplementation: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
3797
|
+
newImplementation: "0x327Ced106C2804283994F0C0e2436E4B76AA7dAD",
|
|
3798
|
+
upgradedAt: "2026-05-17T15:26:25.349Z",
|
|
3799
3799
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3800
3800
|
reason: "Shared upgrade script: ContractVersionRegistry implementation update"
|
|
3801
3801
|
},
|
|
3802
3802
|
PositionDelegateRegistry: {
|
|
3803
|
-
previousImplementation: "
|
|
3804
|
-
newImplementation: "
|
|
3805
|
-
upgradedAt: "2026-05-
|
|
3803
|
+
previousImplementation: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
|
|
3804
|
+
newImplementation: "0x301fa9AA527016D033e151b982C64cD8670a39E3",
|
|
3805
|
+
upgradedAt: "2026-05-17T16:00:25.211Z",
|
|
3806
3806
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3807
3807
|
reason: "Shared upgrade script: PositionDelegateRegistry implementation update"
|
|
3808
3808
|
},
|
|
@@ -3813,6 +3813,13 @@ var init_deployment_addresses = __esm({
|
|
|
3813
3813
|
upgradedAt: "2026-05-15T13:34:44.806Z",
|
|
3814
3814
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3815
3815
|
reason: "Fresh UUPS proxy deployment (UUPS conversion + H-2 dead-zone fix)"
|
|
3816
|
+
},
|
|
3817
|
+
FeeRecipientRegistry: {
|
|
3818
|
+
previousImplementation: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459",
|
|
3819
|
+
newImplementation: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
3820
|
+
upgradedAt: "2026-05-15T17:52:37.448Z",
|
|
3821
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3822
|
+
reason: "Shared upgrade script: FeeRecipientRegistry v1.1.0 \u2014 _authorizeUpgrade gated by onlyAdminModule + AccessControlEnumerable base"
|
|
3816
3823
|
}
|
|
3817
3824
|
},
|
|
3818
3825
|
history: {
|
|
@@ -3880,39 +3887,39 @@ var init_deployment_addresses = __esm({
|
|
|
3880
3887
|
POSITION_MANAGER_VIEWS: "0x3b970E41a0668508B4B2ACb83653b2A402F745AE",
|
|
3881
3888
|
CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
|
|
3882
3889
|
ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
|
|
3883
|
-
UCD_CONTROLLER_IMPL: "
|
|
3884
|
-
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "
|
|
3885
|
-
TERM_MANAGER_MODULE_IMPL: "
|
|
3886
|
-
CIRCUIT_BREAKER_MODULE_IMPL: "
|
|
3887
|
-
ADMIN_MODULE_IMPL: "
|
|
3888
|
-
POSITION_MANAGER_VIEWS_IMPL: "
|
|
3889
|
-
POSITION_MANAGER_IMPL: "
|
|
3890
|
+
UCD_CONTROLLER_IMPL: "0x397dE5069270d90c1A62679e0496029D856Cb0ff",
|
|
3891
|
+
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0x07f4710B7A5FF0d532b362c4Ba7a1DC5e4B9D187",
|
|
3892
|
+
TERM_MANAGER_MODULE_IMPL: "0x358d6A7A864853beAA3E157fEB83dCEb1628E8eB",
|
|
3893
|
+
CIRCUIT_BREAKER_MODULE_IMPL: "0xA5b11b895fB5a49731ab81BF9FC807b9029c8C98",
|
|
3894
|
+
ADMIN_MODULE_IMPL: "0x6ec85cb3F377d8D778F7830eA69C578C75cD7488",
|
|
3895
|
+
POSITION_MANAGER_VIEWS_IMPL: "0x3ae633b330Ea80F92c27479639F7ff14351A63Bb",
|
|
3896
|
+
POSITION_MANAGER_IMPL: "0xa89b9DA4C2C4715d83EF08daC080a39545367467",
|
|
3890
3897
|
SIMPLE_PSM_V2: "0x19EcF7BA26e054fd4Ff06009A03070103dbBB058",
|
|
3891
|
-
SIMPLE_PSM_V2_IMPL: "
|
|
3892
|
-
UCD_TOKEN_IMPL: "
|
|
3898
|
+
SIMPLE_PSM_V2_IMPL: "0x6C36fc51D81601db681217B3083A9D3148c352D8",
|
|
3899
|
+
UCD_TOKEN_IMPL: "0xC587a2cb7e828A44d8C6190eDA6c47b08BA07115",
|
|
3893
3900
|
POSITION_MANAGER_CORE_MODULE: "0xfFAA39a08887FeFB697eBC8691A8630CbCC33391",
|
|
3894
|
-
POSITION_MANAGER_CORE_MODULE_IMPL: "
|
|
3901
|
+
POSITION_MANAGER_CORE_MODULE_IMPL: "0xBf62F7568B6847C08E943548dC727fCAFaa1e6Df",
|
|
3895
3902
|
COLLATERAL_MANAGER_MODULE: "0x967E92c976Fc0fa8268D37D4d6B7245d912aA7dB",
|
|
3896
|
-
COLLATERAL_MANAGER_MODULE_IMPL: "
|
|
3903
|
+
COLLATERAL_MANAGER_MODULE_IMPL: "0x428982fCC9A0455c56881B8e21C96B220CC1506B",
|
|
3897
3904
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
3898
|
-
LIQUIDATION_MANAGER_MODULE_IMPL: "
|
|
3905
|
+
LIQUIDATION_MANAGER_MODULE_IMPL: "0x52e2231f26E8410881BF929e881d295175e078Be",
|
|
3899
3906
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
3900
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
3907
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0x4614F3aAEB53AE8d8FB2F44d28011bD717764F8f",
|
|
3901
3908
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
3902
|
-
UPGRADE_VALIDATOR_IMPL: "
|
|
3909
|
+
UPGRADE_VALIDATOR_IMPL: "0x2Dd375041Be067E7d12bAB2106911Ce209EbD12f",
|
|
3903
3910
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
3904
3911
|
BITCOIN_PROVIDER_REGISTRY_IMPL: "0x225309A4ae6D146ba93A3278A7b40224FfC81448",
|
|
3905
3912
|
LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
|
|
3906
3913
|
LIT_ACTION_VALIDATOR_IMPL: "0x7D2a754AaF41E135c626553000139d5039095E29",
|
|
3907
3914
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
3908
|
-
CONTRACT_VERSION_REGISTRY_IMPL: "
|
|
3915
|
+
CONTRACT_VERSION_REGISTRY_IMPL: "0x327Ced106C2804283994F0C0e2436E4B76AA7dAD",
|
|
3909
3916
|
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
3910
3917
|
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
3911
3918
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
3912
|
-
POSITION_DELEGATE_REGISTRY_IMPL: "
|
|
3919
|
+
POSITION_DELEGATE_REGISTRY_IMPL: "0x301fa9AA527016D033e151b982C64cD8670a39E3",
|
|
3913
3920
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
3914
3921
|
FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
3915
|
-
FEE_RECIPIENT_REGISTRY_IMPL: "
|
|
3922
|
+
FEE_RECIPIENT_REGISTRY_IMPL: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
3916
3923
|
OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x9f8072d4672d643e39d8638478e900Fea1f2c81D"
|
|
3917
3924
|
}
|
|
3918
3925
|
};
|
|
@@ -31369,30 +31376,30 @@ var require_pkg_src = __commonJS({
|
|
|
31369
31376
|
}
|
|
31370
31377
|
},
|
|
31371
31378
|
btcTransactionSigner: {
|
|
31372
|
-
cid: "
|
|
31379
|
+
cid: "QmVXZ17E8gnpjzhyYZmkWiYUbkw8e5iXQvkhFoXdbzosUS",
|
|
31373
31380
|
authorizedCidHex: cidToHex(
|
|
31374
|
-
"
|
|
31381
|
+
"QmVXZ17E8gnpjzhyYZmkWiYUbkw8e5iXQvkhFoXdbzosUS"
|
|
31375
31382
|
),
|
|
31376
31383
|
name: "Btc Transaction Signer",
|
|
31377
31384
|
description: "Production Btc Transaction Signer",
|
|
31378
31385
|
version: "1.0.0",
|
|
31379
31386
|
deployed: true,
|
|
31380
|
-
deployedAt:
|
|
31381
|
-
size:
|
|
31382
|
-
hash: "
|
|
31387
|
+
deployedAt: 1779030344609,
|
|
31388
|
+
size: 27837,
|
|
31389
|
+
hash: "c39e858e92e796a95b8ad8e36fed7a14bb987a31894f645b32cb9a82e8b01921"
|
|
31383
31390
|
},
|
|
31384
31391
|
ucdMintValidator: {
|
|
31385
|
-
cid: "
|
|
31392
|
+
cid: "QmYax1YNGsULXbUUeooPBHXXi4gfkBvyy8NvdNrPqE3EbY",
|
|
31386
31393
|
authorizedCidHex: cidToHex(
|
|
31387
|
-
"
|
|
31394
|
+
"QmYax1YNGsULXbUUeooPBHXXi4gfkBvyy8NvdNrPqE3EbY"
|
|
31388
31395
|
),
|
|
31389
31396
|
name: "Ucd Mint Validator",
|
|
31390
31397
|
description: "Production Ucd Mint Validator",
|
|
31391
31398
|
version: "1.0.0",
|
|
31392
31399
|
deployed: true,
|
|
31393
|
-
deployedAt:
|
|
31394
|
-
size:
|
|
31395
|
-
hash: "
|
|
31400
|
+
deployedAt: 1779030353537,
|
|
31401
|
+
size: 67008,
|
|
31402
|
+
hash: "a9877e4b3cf53ec5e8b8847dd306e93d485bde8f320a24003b1d00512189b2a0",
|
|
31396
31403
|
validatorWalletAddress: "0x36f3dd61c4c08a56d29ed2fd6d5f111b67b6a7a1",
|
|
31397
31404
|
pkp: {
|
|
31398
31405
|
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
@@ -31400,17 +31407,17 @@ var require_pkg_src = __commonJS({
|
|
|
31400
31407
|
}
|
|
31401
31408
|
},
|
|
31402
31409
|
processPaymentValidator: {
|
|
31403
|
-
cid: "
|
|
31410
|
+
cid: "QmQkYidKVwbE2Brt1ZgUV5JmonUj21TGVRF9C24TBhLhCP",
|
|
31404
31411
|
authorizedCidHex: cidToHex(
|
|
31405
|
-
"
|
|
31412
|
+
"QmQkYidKVwbE2Brt1ZgUV5JmonUj21TGVRF9C24TBhLhCP"
|
|
31406
31413
|
),
|
|
31407
31414
|
name: "Process Payment Validator",
|
|
31408
31415
|
description: "Production Process Payment Validator",
|
|
31409
31416
|
version: "1.0.0",
|
|
31410
31417
|
deployed: true,
|
|
31411
|
-
deployedAt:
|
|
31412
|
-
size:
|
|
31413
|
-
hash: "
|
|
31418
|
+
deployedAt: 1779030360481,
|
|
31419
|
+
size: 62963,
|
|
31420
|
+
hash: "c7bb36da46ef78e5f756d85a76123f53759e94b484e73c7a38fc88de797fc1e3",
|
|
31414
31421
|
validatorWalletAddress: "0xc2ed5a59bd81eb4d1a19a0147b86ab69aa4c28ba",
|
|
31415
31422
|
pkp: {
|
|
31416
31423
|
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
@@ -31418,17 +31425,17 @@ var require_pkg_src = __commonJS({
|
|
|
31418
31425
|
}
|
|
31419
31426
|
},
|
|
31420
31427
|
extendPositionValidator: {
|
|
31421
|
-
cid: "
|
|
31428
|
+
cid: "QmdSydNAFg6uFgJii7ycEXsVVdPVK9wwkfYE4tb6sKA3b6",
|
|
31422
31429
|
authorizedCidHex: cidToHex(
|
|
31423
|
-
"
|
|
31430
|
+
"QmdSydNAFg6uFgJii7ycEXsVVdPVK9wwkfYE4tb6sKA3b6"
|
|
31424
31431
|
),
|
|
31425
31432
|
name: "Extend Position Validator",
|
|
31426
31433
|
description: "Production Extend Position Validator",
|
|
31427
31434
|
version: "1.0.0",
|
|
31428
31435
|
deployed: true,
|
|
31429
|
-
deployedAt:
|
|
31430
|
-
size:
|
|
31431
|
-
hash: "
|
|
31436
|
+
deployedAt: 1779030367397,
|
|
31437
|
+
size: 62172,
|
|
31438
|
+
hash: "fe3b945671e0c155e4f6d960faa5b4ef093df300e4a32319cea2ff32cd71c434",
|
|
31432
31439
|
validatorWalletAddress: "0xb3f4271c475887a86a2f21446f0968c30cc74c97",
|
|
31433
31440
|
pkp: {
|
|
31434
31441
|
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
@@ -31436,17 +31443,17 @@ var require_pkg_src = __commonJS({
|
|
|
31436
31443
|
}
|
|
31437
31444
|
},
|
|
31438
31445
|
btcWithdrawal: {
|
|
31439
|
-
cid: "
|
|
31446
|
+
cid: "QmZZuKGL2aHtiaLcyxNceVg1fTm7H6RyMG3JpbRNEzcpW8",
|
|
31440
31447
|
authorizedCidHex: cidToHex(
|
|
31441
|
-
"
|
|
31448
|
+
"QmZZuKGL2aHtiaLcyxNceVg1fTm7H6RyMG3JpbRNEzcpW8"
|
|
31442
31449
|
),
|
|
31443
31450
|
name: "Btc Withdrawal",
|
|
31444
31451
|
description: "Production Btc Withdrawal",
|
|
31445
31452
|
version: "1.0.0",
|
|
31446
31453
|
deployed: true,
|
|
31447
|
-
deployedAt:
|
|
31448
|
-
size:
|
|
31449
|
-
hash: "
|
|
31454
|
+
deployedAt: 1779030374336,
|
|
31455
|
+
size: 73808,
|
|
31456
|
+
hash: "033e698b572f62f49bc34be94f4355957e3fe46d98001744805b44e74655b9ac",
|
|
31450
31457
|
validatorWalletAddress: "0xbb137fbda353199e9419b698c57a742124d4987d",
|
|
31451
31458
|
pkp: {
|
|
31452
31459
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -31454,17 +31461,17 @@ var require_pkg_src = __commonJS({
|
|
|
31454
31461
|
}
|
|
31455
31462
|
},
|
|
31456
31463
|
liquidationValidator: {
|
|
31457
|
-
cid: "
|
|
31464
|
+
cid: "QmRq9FV1dhqgxCVLYa3LfuPDAs8vBvQAcnCtY8NGsVNJfG",
|
|
31458
31465
|
authorizedCidHex: cidToHex(
|
|
31459
|
-
"
|
|
31466
|
+
"QmRq9FV1dhqgxCVLYa3LfuPDAs8vBvQAcnCtY8NGsVNJfG"
|
|
31460
31467
|
),
|
|
31461
31468
|
name: "Liquidation Validator",
|
|
31462
31469
|
description: "Production Liquidation Validator",
|
|
31463
31470
|
version: "1.0.0",
|
|
31464
31471
|
deployed: true,
|
|
31465
|
-
deployedAt:
|
|
31466
|
-
size:
|
|
31467
|
-
hash: "
|
|
31472
|
+
deployedAt: 1779030381480,
|
|
31473
|
+
size: 54874,
|
|
31474
|
+
hash: "ce6d12425d3828abc002bdb3bcca36af642fd1c84a00ee1f2c9c4f57778c4af4",
|
|
31468
31475
|
validatorWalletAddress: "0x1542f863ee0340f6a067573e80ae66dd9b3838fa",
|
|
31469
31476
|
pkp: {
|
|
31470
31477
|
publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
|
|
@@ -31490,17 +31497,17 @@ var require_pkg_src = __commonJS({
|
|
|
31490
31497
|
}
|
|
31491
31498
|
},
|
|
31492
31499
|
loanVaultBtcBalance: {
|
|
31493
|
-
cid: "
|
|
31500
|
+
cid: "QmXwEPuyxW9brUi2EwhdV11zM7cf1ggtxLxWPsomppQByk",
|
|
31494
31501
|
authorizedCidHex: cidToHex(
|
|
31495
|
-
"
|
|
31502
|
+
"QmXwEPuyxW9brUi2EwhdV11zM7cf1ggtxLxWPsomppQByk"
|
|
31496
31503
|
),
|
|
31497
31504
|
name: "Loan Vault Btc Balance",
|
|
31498
31505
|
description: "Production Loan Vault Btc Balance",
|
|
31499
31506
|
version: "1.0.0",
|
|
31500
31507
|
deployed: true,
|
|
31501
|
-
deployedAt:
|
|
31502
|
-
size:
|
|
31503
|
-
hash: "
|
|
31508
|
+
deployedAt: 1779030388270,
|
|
31509
|
+
size: 44649,
|
|
31510
|
+
hash: "41cd78901cfdff6bdb6040ccaa2c27798d633507b8df7ace7c27b9ef390dc629",
|
|
31504
31511
|
validatorWalletAddress: "0x47feea74c8739d24b44faa67217f2f99970e15e7",
|
|
31505
31512
|
pkp: {
|
|
31506
31513
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -31508,17 +31515,17 @@ var require_pkg_src = __commonJS({
|
|
|
31508
31515
|
}
|
|
31509
31516
|
},
|
|
31510
31517
|
adminLiquidationValidator: {
|
|
31511
|
-
cid: "
|
|
31518
|
+
cid: "Qmb1P9mbThaw39UjHQhgWF3b5QfbLpDLibDjYcyUEJDdHH",
|
|
31512
31519
|
authorizedCidHex: cidToHex(
|
|
31513
|
-
"
|
|
31520
|
+
"Qmb1P9mbThaw39UjHQhgWF3b5QfbLpDLibDjYcyUEJDdHH"
|
|
31514
31521
|
),
|
|
31515
31522
|
name: "Admin Liquidation Validator",
|
|
31516
31523
|
description: "Production Admin Liquidation Validator",
|
|
31517
31524
|
version: "1.0.0",
|
|
31518
31525
|
deployed: true,
|
|
31519
|
-
deployedAt:
|
|
31520
|
-
size:
|
|
31521
|
-
hash: "
|
|
31526
|
+
deployedAt: 1779030395440,
|
|
31527
|
+
size: 51581,
|
|
31528
|
+
hash: "f094270339baa232a5b7caedd9538ec5a68e7735d632c30dfb8de73faa4b30b5",
|
|
31522
31529
|
validatorWalletAddress: "0x2a83b78842d75358877deb8854ccc5bbbaa5012e",
|
|
31523
31530
|
pkp: {
|
|
31524
31531
|
publicKey: "0x04ee4316afb8538280ede6c56def9cbe791f18f96ccba97768b28e2966d9c46a9493a6b81f4571495c3ce56c2d0b33fe8cf63726cd12d395832ea54162b5c67801",
|
|
@@ -32706,6 +32713,8 @@ ${errorReport}`);
|
|
|
32706
32713
|
// expiryAt before last renewal; 0 if never renewed
|
|
32707
32714
|
totalTerm: positionState.totalTerm,
|
|
32708
32715
|
// total accumulated loan months; 0 before first renewal
|
|
32716
|
+
lastRenewedAt: positionState.lastRenewedAt,
|
|
32717
|
+
// timestamp of most recent renewal; createdAt at origination; 0 for pre-H-5 positions
|
|
32709
32718
|
// Bitcoin state
|
|
32710
32719
|
totalBTCSats: balanceResult.totalBalance,
|
|
32711
32720
|
totalUTXOs: balanceResult.totalUTXOs,
|
|
@@ -32810,6 +32819,8 @@ ${errorReport}`);
|
|
|
32810
32819
|
// expiryAt before last renewal; 0 if never renewed
|
|
32811
32820
|
totalTerm: positionState.totalTerm,
|
|
32812
32821
|
// total accumulated loan months; 0 before first renewal
|
|
32822
|
+
lastRenewedAt: positionState.lastRenewedAt,
|
|
32823
|
+
// timestamp of most recent renewal; createdAt at origination; 0 for pre-H-5 positions
|
|
32813
32824
|
// Bitcoin state
|
|
32814
32825
|
totalBTCSats: balanceResult.totalBalance,
|
|
32815
32826
|
totalUTXOs: balanceResult.totalUTXOs,
|
|
@@ -32928,7 +32939,8 @@ ${errorReport}`);
|
|
|
32928
32939
|
type: "uint8"
|
|
32929
32940
|
},
|
|
32930
32941
|
{ internalType: "uint40", name: "previousExpiryAt", type: "uint40" },
|
|
32931
|
-
{ internalType: "uint16", name: "totalTerm", type: "uint16" }
|
|
32942
|
+
{ internalType: "uint16", name: "totalTerm", type: "uint16" },
|
|
32943
|
+
{ internalType: "uint40", name: "lastRenewedAt", type: "uint40" }
|
|
32932
32944
|
],
|
|
32933
32945
|
internalType: "struct IPositionManagerCore.Position",
|
|
32934
32946
|
name: "",
|
|
@@ -32962,6 +32974,7 @@ ${errorReport}`);
|
|
|
32962
32974
|
const selectedTermMonths = Number(position.selectedTerm);
|
|
32963
32975
|
const totalTermMonths = Number(position.totalTerm);
|
|
32964
32976
|
const previousExpiryAt = Number(position.previousExpiryAt);
|
|
32977
|
+
const lastRenewedAt = Number(position.lastRenewedAt);
|
|
32965
32978
|
const termStartTimestamp = calculateTermStartFromExpiry(
|
|
32966
32979
|
expiryAt,
|
|
32967
32980
|
selectedTermMonths
|
|
@@ -32980,7 +32993,8 @@ ${errorReport}`);
|
|
|
32980
32993
|
status: statusNum,
|
|
32981
32994
|
expiryAt,
|
|
32982
32995
|
previousExpiryAt,
|
|
32983
|
-
totalTerm: totalTermMonths
|
|
32996
|
+
totalTerm: totalTermMonths,
|
|
32997
|
+
lastRenewedAt
|
|
32984
32998
|
};
|
|
32985
32999
|
}
|
|
32986
33000
|
/**
|
|
@@ -66400,6 +66414,55 @@ Error data: ${errorData || "none"}`
|
|
|
66400
66414
|
};
|
|
66401
66415
|
}
|
|
66402
66416
|
}
|
|
66417
|
+
/**
|
|
66418
|
+
* Mark an authorized spend as consumed after a verified Bitcoin broadcast.
|
|
66419
|
+
*
|
|
66420
|
+
* Calls LoanOperationsManager.markSpentByOwner which delegates to
|
|
66421
|
+
* BTCSpendAuthorizer.markSpent. The on-chain position balance was already
|
|
66422
|
+
* debited during Phase 1 (withdrawBTC) — this is bookkeeping so the entry
|
|
66423
|
+
* stops appearing in getPendingWithdrawals().
|
|
66424
|
+
*
|
|
66425
|
+
* @param positionId - Position identifier
|
|
66426
|
+
* @param txid - Source UTXO transaction ID (the one that was authorized in Phase 1)
|
|
66427
|
+
* @param vout - Source UTXO output index
|
|
66428
|
+
* @param broadcastTxid - Bitcoin txid of the broadcast that consumed this UTXO
|
|
66429
|
+
* @returns Transaction hash of the mark-spent EVM transaction
|
|
66430
|
+
*/
|
|
66431
|
+
async markSpentByOwner(positionId, txid, vout, broadcastTxid) {
|
|
66432
|
+
this.ensureInitialized();
|
|
66433
|
+
try {
|
|
66434
|
+
const signer = this.getSignerOrThrow();
|
|
66435
|
+
const contractAddresses = this.getContractAddressesOrThrow();
|
|
66436
|
+
const loanOperationsManagerAddress = contractAddresses.loanOperationsManager;
|
|
66437
|
+
if (!loanOperationsManagerAddress) {
|
|
66438
|
+
return { success: false, error: "LoanOperationsManager address not configured" };
|
|
66439
|
+
}
|
|
66440
|
+
const utxoKey = solidityPackedKeccak256(
|
|
66441
|
+
["string", "uint32"],
|
|
66442
|
+
[txid, vout]
|
|
66443
|
+
);
|
|
66444
|
+
const loanOperationsManager = new Contract(
|
|
66445
|
+
loanOperationsManagerAddress,
|
|
66446
|
+
[
|
|
66447
|
+
"function markSpentByOwner(bytes32 positionId, bytes32 utxoKey, string calldata broadcastTxid) external"
|
|
66448
|
+
],
|
|
66449
|
+
signer
|
|
66450
|
+
);
|
|
66451
|
+
const positionIdBytes32 = this.toBytes32(positionId);
|
|
66452
|
+
const tx = await loanOperationsManager["markSpentByOwner"](
|
|
66453
|
+
positionIdBytes32,
|
|
66454
|
+
utxoKey,
|
|
66455
|
+
broadcastTxid
|
|
66456
|
+
);
|
|
66457
|
+
const receipt = await tx.wait();
|
|
66458
|
+
return { success: true, transactionHash: receipt.hash };
|
|
66459
|
+
} catch (error) {
|
|
66460
|
+
return {
|
|
66461
|
+
success: false,
|
|
66462
|
+
error: error instanceof Error ? error.message : String(error)
|
|
66463
|
+
};
|
|
66464
|
+
}
|
|
66465
|
+
}
|
|
66403
66466
|
/**
|
|
66404
66467
|
* Withdraw BTC and execute transfer (Complete Flow)
|
|
66405
66468
|
*
|
|
@@ -66536,6 +66599,35 @@ Error data: ${errorData || "none"}`
|
|
|
66536
66599
|
txid: executionResult.txid
|
|
66537
66600
|
});
|
|
66538
66601
|
}
|
|
66602
|
+
if (executionResult.success && executionResult.txid) {
|
|
66603
|
+
try {
|
|
66604
|
+
const markResult = await this.markSpentByOwner(
|
|
66605
|
+
positionId,
|
|
66606
|
+
authResult.utxoTxid,
|
|
66607
|
+
Number(authResult.utxoVout),
|
|
66608
|
+
executionResult.txid
|
|
66609
|
+
);
|
|
66610
|
+
if (markResult.success) {
|
|
66611
|
+
if (this.config.debug) {
|
|
66612
|
+
log.info("\u2705 Phase 3 complete: authorization marked as consumed", {
|
|
66613
|
+
txHash: markResult.transactionHash
|
|
66614
|
+
});
|
|
66615
|
+
}
|
|
66616
|
+
} else if (this.config.debug) {
|
|
66617
|
+
log.warn(
|
|
66618
|
+
"\u26A0\uFE0F Phase 3 markSpent failed (non-fatal); pending record persists until cancelPendingWithdrawal()",
|
|
66619
|
+
{ error: markResult.error }
|
|
66620
|
+
);
|
|
66621
|
+
}
|
|
66622
|
+
} catch (markError) {
|
|
66623
|
+
if (this.config.debug) {
|
|
66624
|
+
log.warn(
|
|
66625
|
+
"\u26A0\uFE0F Phase 3 markSpent threw (non-fatal); pending record persists until cancelPendingWithdrawal()",
|
|
66626
|
+
{ error: markError instanceof Error ? markError.message : String(markError) }
|
|
66627
|
+
);
|
|
66628
|
+
}
|
|
66629
|
+
}
|
|
66630
|
+
}
|
|
66539
66631
|
try {
|
|
66540
66632
|
const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
|
|
66541
66633
|
const message = executionResult.success ? formatBTCWithdrawalSuccessMessage(
|
|
@@ -67075,6 +67167,8 @@ Error data: ${errorData || "none"}`
|
|
|
67075
67167
|
* is derived purely from `this.config.chain`.
|
|
67076
67168
|
*/
|
|
67077
67169
|
getBitcoinNetwork() {
|
|
67170
|
+
if (this.config.bitcoinNetwork)
|
|
67171
|
+
return this.config.bitcoinNetwork;
|
|
67078
67172
|
const chain = this.config.chain?.toLowerCase() || "";
|
|
67079
67173
|
if (chain.includes("mainnet") || chain === "ethereum") {
|
|
67080
67174
|
return "mainnet";
|
|
@@ -478,6 +478,25 @@ export declare class DiamondHandsSDK {
|
|
|
478
478
|
transactionHash?: string;
|
|
479
479
|
error?: string;
|
|
480
480
|
}>;
|
|
481
|
+
/**
|
|
482
|
+
* Mark an authorized spend as consumed after a verified Bitcoin broadcast.
|
|
483
|
+
*
|
|
484
|
+
* Calls LoanOperationsManager.markSpentByOwner which delegates to
|
|
485
|
+
* BTCSpendAuthorizer.markSpent. The on-chain position balance was already
|
|
486
|
+
* debited during Phase 1 (withdrawBTC) — this is bookkeeping so the entry
|
|
487
|
+
* stops appearing in getPendingWithdrawals().
|
|
488
|
+
*
|
|
489
|
+
* @param positionId - Position identifier
|
|
490
|
+
* @param txid - Source UTXO transaction ID (the one that was authorized in Phase 1)
|
|
491
|
+
* @param vout - Source UTXO output index
|
|
492
|
+
* @param broadcastTxid - Bitcoin txid of the broadcast that consumed this UTXO
|
|
493
|
+
* @returns Transaction hash of the mark-spent EVM transaction
|
|
494
|
+
*/
|
|
495
|
+
markSpentByOwner(positionId: string, txid: string, vout: number, broadcastTxid: string): Promise<{
|
|
496
|
+
success: boolean;
|
|
497
|
+
transactionHash?: string;
|
|
498
|
+
error?: string;
|
|
499
|
+
}>;
|
|
481
500
|
/**
|
|
482
501
|
* Withdraw BTC and execute transfer (Complete Flow)
|
|
483
502
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.255",
|
|
4
4
|
"description": "TypeScript SDK for Diamond Hands Protocol - Bitcoin-backed lending with LIT Protocol PKPs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
},
|
|
76
76
|
"sideEffects": false,
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@gvnrdao/dh-lit-actions": "
|
|
79
|
-
"@gvnrdao/dh-lit-ops": "
|
|
78
|
+
"@gvnrdao/dh-lit-actions": "file:../lit-actions/gvnrdao-dh-lit-actions-0.0.296.tgz",
|
|
79
|
+
"@gvnrdao/dh-lit-ops": "file:../lit-ops/gvnrdao-dh-lit-ops-0.0.281.tgz",
|
|
80
80
|
"@noble/hashes": "^1.5.0",
|
|
81
81
|
"axios": "^1.15.2",
|
|
82
82
|
"bech32": "^2.0.0",
|