@gvnrdao/dh-sdk 0.0.252 → 0.0.254
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 +19 -12
- package/dist/deployments.mjs +19 -12
- package/dist/index.js +99 -12
- package/dist/index.mjs +99 -12
- package/dist/interfaces/chunks/config.i.d.ts +1 -0
- package/dist/modules/diamond-hands-sdk.d.ts +19 -0
- package/package.json +2 -2
package/dist/deployments.js
CHANGED
|
@@ -72,9 +72,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
72
72
|
reason: "Shared upgrade script: PositionManager implementation update"
|
|
73
73
|
},
|
|
74
74
|
LoanOperationsManagerModule: {
|
|
75
|
-
previousImplementation: "
|
|
76
|
-
newImplementation: "
|
|
77
|
-
upgradedAt: "2026-05-
|
|
75
|
+
previousImplementation: "0xdEf0A042670834369d456c5fbE73ad2126008bD2",
|
|
76
|
+
newImplementation: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
77
|
+
upgradedAt: "2026-05-15T17:48:01.380Z",
|
|
78
78
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
79
79
|
reason: "Shared upgrade script: LoanOperationsManagerModule v1.4.0 (M-3 Chainlink cross-check)"
|
|
80
80
|
},
|
|
@@ -149,9 +149,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
149
149
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
150
150
|
},
|
|
151
151
|
BTCSpendAuthorizer: {
|
|
152
|
-
previousImplementation: "
|
|
153
|
-
newImplementation: "
|
|
154
|
-
upgradedAt: "2026-05-
|
|
152
|
+
previousImplementation: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
|
|
153
|
+
newImplementation: "0x8021588673Abf0396c1756EdD16F9B9b6d09fcaC",
|
|
154
|
+
upgradedAt: "2026-05-15T17:44:01.314Z",
|
|
155
155
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
156
156
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
157
157
|
},
|
|
@@ -177,9 +177,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
177
177
|
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."
|
|
178
178
|
},
|
|
179
179
|
ContractVersionRegistry: {
|
|
180
|
-
previousImplementation: "
|
|
181
|
-
newImplementation: "
|
|
182
|
-
upgradedAt: "2026-05-
|
|
180
|
+
previousImplementation: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
|
|
181
|
+
newImplementation: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
182
|
+
upgradedAt: "2026-05-15T17:50:00.701Z",
|
|
183
183
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
184
184
|
reason: "Shared upgrade script: ContractVersionRegistry implementation update"
|
|
185
185
|
},
|
|
@@ -197,6 +197,13 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
197
197
|
upgradedAt: "2026-05-15T13:34:44.806Z",
|
|
198
198
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
199
199
|
reason: "Fresh UUPS proxy deployment (UUPS conversion + H-2 dead-zone fix)"
|
|
200
|
+
},
|
|
201
|
+
FeeRecipientRegistry: {
|
|
202
|
+
previousImplementation: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459",
|
|
203
|
+
newImplementation: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
204
|
+
upgradedAt: "2026-05-15T17:52:37.448Z",
|
|
205
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
206
|
+
reason: "Shared upgrade script: FeeRecipientRegistry v1.1.0 \u2014 _authorizeUpgrade gated by onlyAdminModule + AccessControlEnumerable base"
|
|
200
207
|
}
|
|
201
208
|
},
|
|
202
209
|
history: {
|
|
@@ -265,7 +272,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
265
272
|
CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
|
|
266
273
|
ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
|
|
267
274
|
UCD_CONTROLLER_IMPL: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
|
|
268
|
-
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "
|
|
275
|
+
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
269
276
|
TERM_MANAGER_MODULE_IMPL: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
|
|
270
277
|
CIRCUIT_BREAKER_MODULE_IMPL: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
|
|
271
278
|
ADMIN_MODULE_IMPL: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
|
|
@@ -289,14 +296,14 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
289
296
|
LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
|
|
290
297
|
LIT_ACTION_VALIDATOR_IMPL: "0x7D2a754AaF41E135c626553000139d5039095E29",
|
|
291
298
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
292
|
-
CONTRACT_VERSION_REGISTRY_IMPL: "
|
|
299
|
+
CONTRACT_VERSION_REGISTRY_IMPL: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
293
300
|
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
294
301
|
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
295
302
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
296
303
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
|
|
297
304
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
298
305
|
FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
299
|
-
FEE_RECIPIENT_REGISTRY_IMPL: "
|
|
306
|
+
FEE_RECIPIENT_REGISTRY_IMPL: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
300
307
|
OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x9f8072d4672d643e39d8638478e900Fea1f2c81D"
|
|
301
308
|
}
|
|
302
309
|
};
|
package/dist/deployments.mjs
CHANGED
|
@@ -39,9 +39,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
39
39
|
reason: "Shared upgrade script: PositionManager implementation update"
|
|
40
40
|
},
|
|
41
41
|
LoanOperationsManagerModule: {
|
|
42
|
-
previousImplementation: "
|
|
43
|
-
newImplementation: "
|
|
44
|
-
upgradedAt: "2026-05-
|
|
42
|
+
previousImplementation: "0xdEf0A042670834369d456c5fbE73ad2126008bD2",
|
|
43
|
+
newImplementation: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
44
|
+
upgradedAt: "2026-05-15T17:48:01.380Z",
|
|
45
45
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
46
46
|
reason: "Shared upgrade script: LoanOperationsManagerModule v1.4.0 (M-3 Chainlink cross-check)"
|
|
47
47
|
},
|
|
@@ -116,9 +116,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
116
116
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
117
117
|
},
|
|
118
118
|
BTCSpendAuthorizer: {
|
|
119
|
-
previousImplementation: "
|
|
120
|
-
newImplementation: "
|
|
121
|
-
upgradedAt: "2026-05-
|
|
119
|
+
previousImplementation: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
|
|
120
|
+
newImplementation: "0x8021588673Abf0396c1756EdD16F9B9b6d09fcaC",
|
|
121
|
+
upgradedAt: "2026-05-15T17:44:01.314Z",
|
|
122
122
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
123
123
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
124
124
|
},
|
|
@@ -144,9 +144,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
144
144
|
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."
|
|
145
145
|
},
|
|
146
146
|
ContractVersionRegistry: {
|
|
147
|
-
previousImplementation: "
|
|
148
|
-
newImplementation: "
|
|
149
|
-
upgradedAt: "2026-05-
|
|
147
|
+
previousImplementation: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
|
|
148
|
+
newImplementation: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
149
|
+
upgradedAt: "2026-05-15T17:50:00.701Z",
|
|
150
150
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
151
151
|
reason: "Shared upgrade script: ContractVersionRegistry implementation update"
|
|
152
152
|
},
|
|
@@ -164,6 +164,13 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
164
164
|
upgradedAt: "2026-05-15T13:34:44.806Z",
|
|
165
165
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
166
166
|
reason: "Fresh UUPS proxy deployment (UUPS conversion + H-2 dead-zone fix)"
|
|
167
|
+
},
|
|
168
|
+
FeeRecipientRegistry: {
|
|
169
|
+
previousImplementation: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459",
|
|
170
|
+
newImplementation: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
171
|
+
upgradedAt: "2026-05-15T17:52:37.448Z",
|
|
172
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
173
|
+
reason: "Shared upgrade script: FeeRecipientRegistry v1.1.0 \u2014 _authorizeUpgrade gated by onlyAdminModule + AccessControlEnumerable base"
|
|
167
174
|
}
|
|
168
175
|
},
|
|
169
176
|
history: {
|
|
@@ -232,7 +239,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
232
239
|
CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
|
|
233
240
|
ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
|
|
234
241
|
UCD_CONTROLLER_IMPL: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
|
|
235
|
-
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "
|
|
242
|
+
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
236
243
|
TERM_MANAGER_MODULE_IMPL: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
|
|
237
244
|
CIRCUIT_BREAKER_MODULE_IMPL: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
|
|
238
245
|
ADMIN_MODULE_IMPL: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
|
|
@@ -256,14 +263,14 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
256
263
|
LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
|
|
257
264
|
LIT_ACTION_VALIDATOR_IMPL: "0x7D2a754AaF41E135c626553000139d5039095E29",
|
|
258
265
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
259
|
-
CONTRACT_VERSION_REGISTRY_IMPL: "
|
|
266
|
+
CONTRACT_VERSION_REGISTRY_IMPL: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
260
267
|
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
261
268
|
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
262
269
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
263
270
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
|
|
264
271
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
265
272
|
FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
266
|
-
FEE_RECIPIENT_REGISTRY_IMPL: "
|
|
273
|
+
FEE_RECIPIENT_REGISTRY_IMPL: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
267
274
|
OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x9f8072d4672d643e39d8638478e900Fea1f2c81D"
|
|
268
275
|
}
|
|
269
276
|
};
|
package/dist/index.js
CHANGED
|
@@ -3682,9 +3682,9 @@ var init_deployment_addresses = __esm({
|
|
|
3682
3682
|
reason: "Shared upgrade script: PositionManager implementation update"
|
|
3683
3683
|
},
|
|
3684
3684
|
LoanOperationsManagerModule: {
|
|
3685
|
-
previousImplementation: "
|
|
3686
|
-
newImplementation: "
|
|
3687
|
-
upgradedAt: "2026-05-
|
|
3685
|
+
previousImplementation: "0xdEf0A042670834369d456c5fbE73ad2126008bD2",
|
|
3686
|
+
newImplementation: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
3687
|
+
upgradedAt: "2026-05-15T17:48:01.380Z",
|
|
3688
3688
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3689
3689
|
reason: "Shared upgrade script: LoanOperationsManagerModule v1.4.0 (M-3 Chainlink cross-check)"
|
|
3690
3690
|
},
|
|
@@ -3759,9 +3759,9 @@ var init_deployment_addresses = __esm({
|
|
|
3759
3759
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
3760
3760
|
},
|
|
3761
3761
|
BTCSpendAuthorizer: {
|
|
3762
|
-
previousImplementation: "
|
|
3763
|
-
newImplementation: "
|
|
3764
|
-
upgradedAt: "2026-05-
|
|
3762
|
+
previousImplementation: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
|
|
3763
|
+
newImplementation: "0x8021588673Abf0396c1756EdD16F9B9b6d09fcaC",
|
|
3764
|
+
upgradedAt: "2026-05-15T17:44:01.314Z",
|
|
3765
3765
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3766
3766
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
3767
3767
|
},
|
|
@@ -3787,9 +3787,9 @@ var init_deployment_addresses = __esm({
|
|
|
3787
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
3788
|
},
|
|
3789
3789
|
ContractVersionRegistry: {
|
|
3790
|
-
previousImplementation: "
|
|
3791
|
-
newImplementation: "
|
|
3792
|
-
upgradedAt: "2026-05-
|
|
3790
|
+
previousImplementation: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
|
|
3791
|
+
newImplementation: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
3792
|
+
upgradedAt: "2026-05-15T17:50:00.701Z",
|
|
3793
3793
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3794
3794
|
reason: "Shared upgrade script: ContractVersionRegistry implementation update"
|
|
3795
3795
|
},
|
|
@@ -3807,6 +3807,13 @@ var init_deployment_addresses = __esm({
|
|
|
3807
3807
|
upgradedAt: "2026-05-15T13:34:44.806Z",
|
|
3808
3808
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3809
3809
|
reason: "Fresh UUPS proxy deployment (UUPS conversion + H-2 dead-zone fix)"
|
|
3810
|
+
},
|
|
3811
|
+
FeeRecipientRegistry: {
|
|
3812
|
+
previousImplementation: "0x974a0f64d572a4F4e1395aaeB22d1c2685D22459",
|
|
3813
|
+
newImplementation: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
3814
|
+
upgradedAt: "2026-05-15T17:52:37.448Z",
|
|
3815
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3816
|
+
reason: "Shared upgrade script: FeeRecipientRegistry v1.1.0 \u2014 _authorizeUpgrade gated by onlyAdminModule + AccessControlEnumerable base"
|
|
3810
3817
|
}
|
|
3811
3818
|
},
|
|
3812
3819
|
history: {
|
|
@@ -3875,7 +3882,7 @@ var init_deployment_addresses = __esm({
|
|
|
3875
3882
|
CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
|
|
3876
3883
|
ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
|
|
3877
3884
|
UCD_CONTROLLER_IMPL: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
|
|
3878
|
-
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "
|
|
3885
|
+
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
3879
3886
|
TERM_MANAGER_MODULE_IMPL: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
|
|
3880
3887
|
CIRCUIT_BREAKER_MODULE_IMPL: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
|
|
3881
3888
|
ADMIN_MODULE_IMPL: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
|
|
@@ -3899,14 +3906,14 @@ var init_deployment_addresses = __esm({
|
|
|
3899
3906
|
LIT_ACTION_VALIDATOR: "0x54eECd7C90F8A8fac27749Ba30BbE8AFBAccc856",
|
|
3900
3907
|
LIT_ACTION_VALIDATOR_IMPL: "0x7D2a754AaF41E135c626553000139d5039095E29",
|
|
3901
3908
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
3902
|
-
CONTRACT_VERSION_REGISTRY_IMPL: "
|
|
3909
|
+
CONTRACT_VERSION_REGISTRY_IMPL: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
3903
3910
|
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
3904
3911
|
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
3905
3912
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
3906
3913
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
|
|
3907
3914
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
3908
3915
|
FEE_RECIPIENT_REGISTRY: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
3909
|
-
FEE_RECIPIENT_REGISTRY_IMPL: "
|
|
3916
|
+
FEE_RECIPIENT_REGISTRY_IMPL: "0xd08513a7cB2dd354B26cDDf549616F12054c34c9",
|
|
3910
3917
|
OPERATION_AUTHORIZATION_REGISTRY_IMPL: "0x9f8072d4672d643e39d8638478e900Fea1f2c81D"
|
|
3911
3918
|
}
|
|
3912
3919
|
};
|
|
@@ -66474,6 +66481,55 @@ Error data: ${errorData || "none"}`
|
|
|
66474
66481
|
};
|
|
66475
66482
|
}
|
|
66476
66483
|
}
|
|
66484
|
+
/**
|
|
66485
|
+
* Mark an authorized spend as consumed after a verified Bitcoin broadcast.
|
|
66486
|
+
*
|
|
66487
|
+
* Calls LoanOperationsManager.markSpentByOwner which delegates to
|
|
66488
|
+
* BTCSpendAuthorizer.markSpent. The on-chain position balance was already
|
|
66489
|
+
* debited during Phase 1 (withdrawBTC) — this is bookkeeping so the entry
|
|
66490
|
+
* stops appearing in getPendingWithdrawals().
|
|
66491
|
+
*
|
|
66492
|
+
* @param positionId - Position identifier
|
|
66493
|
+
* @param txid - Source UTXO transaction ID (the one that was authorized in Phase 1)
|
|
66494
|
+
* @param vout - Source UTXO output index
|
|
66495
|
+
* @param broadcastTxid - Bitcoin txid of the broadcast that consumed this UTXO
|
|
66496
|
+
* @returns Transaction hash of the mark-spent EVM transaction
|
|
66497
|
+
*/
|
|
66498
|
+
async markSpentByOwner(positionId, txid, vout, broadcastTxid) {
|
|
66499
|
+
this.ensureInitialized();
|
|
66500
|
+
try {
|
|
66501
|
+
const signer = this.getSignerOrThrow();
|
|
66502
|
+
const contractAddresses = this.getContractAddressesOrThrow();
|
|
66503
|
+
const loanOperationsManagerAddress = contractAddresses.loanOperationsManager;
|
|
66504
|
+
if (!loanOperationsManagerAddress) {
|
|
66505
|
+
return { success: false, error: "LoanOperationsManager address not configured" };
|
|
66506
|
+
}
|
|
66507
|
+
const utxoKey = solidityPackedKeccak256(
|
|
66508
|
+
["string", "uint32"],
|
|
66509
|
+
[txid, vout]
|
|
66510
|
+
);
|
|
66511
|
+
const loanOperationsManager = new Contract(
|
|
66512
|
+
loanOperationsManagerAddress,
|
|
66513
|
+
[
|
|
66514
|
+
"function markSpentByOwner(bytes32 positionId, bytes32 utxoKey, string calldata broadcastTxid) external"
|
|
66515
|
+
],
|
|
66516
|
+
signer
|
|
66517
|
+
);
|
|
66518
|
+
const positionIdBytes32 = this.toBytes32(positionId);
|
|
66519
|
+
const tx = await loanOperationsManager["markSpentByOwner"](
|
|
66520
|
+
positionIdBytes32,
|
|
66521
|
+
utxoKey,
|
|
66522
|
+
broadcastTxid
|
|
66523
|
+
);
|
|
66524
|
+
const receipt = await tx.wait();
|
|
66525
|
+
return { success: true, transactionHash: receipt.hash };
|
|
66526
|
+
} catch (error) {
|
|
66527
|
+
return {
|
|
66528
|
+
success: false,
|
|
66529
|
+
error: error instanceof Error ? error.message : String(error)
|
|
66530
|
+
};
|
|
66531
|
+
}
|
|
66532
|
+
}
|
|
66477
66533
|
/**
|
|
66478
66534
|
* Withdraw BTC and execute transfer (Complete Flow)
|
|
66479
66535
|
*
|
|
@@ -66610,6 +66666,35 @@ Error data: ${errorData || "none"}`
|
|
|
66610
66666
|
txid: executionResult.txid
|
|
66611
66667
|
});
|
|
66612
66668
|
}
|
|
66669
|
+
if (executionResult.success && executionResult.txid) {
|
|
66670
|
+
try {
|
|
66671
|
+
const markResult = await this.markSpentByOwner(
|
|
66672
|
+
positionId,
|
|
66673
|
+
authResult.utxoTxid,
|
|
66674
|
+
Number(authResult.utxoVout),
|
|
66675
|
+
executionResult.txid
|
|
66676
|
+
);
|
|
66677
|
+
if (markResult.success) {
|
|
66678
|
+
if (this.config.debug) {
|
|
66679
|
+
log.info("\u2705 Phase 3 complete: authorization marked as consumed", {
|
|
66680
|
+
txHash: markResult.transactionHash
|
|
66681
|
+
});
|
|
66682
|
+
}
|
|
66683
|
+
} else if (this.config.debug) {
|
|
66684
|
+
log.warn(
|
|
66685
|
+
"\u26A0\uFE0F Phase 3 markSpent failed (non-fatal); pending record persists until cancelPendingWithdrawal()",
|
|
66686
|
+
{ error: markResult.error }
|
|
66687
|
+
);
|
|
66688
|
+
}
|
|
66689
|
+
} catch (markError) {
|
|
66690
|
+
if (this.config.debug) {
|
|
66691
|
+
log.warn(
|
|
66692
|
+
"\u26A0\uFE0F Phase 3 markSpent threw (non-fatal); pending record persists until cancelPendingWithdrawal()",
|
|
66693
|
+
{ error: markError instanceof Error ? markError.message : String(markError) }
|
|
66694
|
+
);
|
|
66695
|
+
}
|
|
66696
|
+
}
|
|
66697
|
+
}
|
|
66613
66698
|
try {
|
|
66614
66699
|
const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
|
|
66615
66700
|
const message = executionResult.success ? formatBTCWithdrawalSuccessMessage(
|
|
@@ -67149,6 +67234,8 @@ Error data: ${errorData || "none"}`
|
|
|
67149
67234
|
* is derived purely from `this.config.chain`.
|
|
67150
67235
|
*/
|
|
67151
67236
|
getBitcoinNetwork() {
|
|
67237
|
+
if (this.config.bitcoinNetwork)
|
|
67238
|
+
return this.config.bitcoinNetwork;
|
|
67152
67239
|
const chain = this.config.chain?.toLowerCase() || "";
|
|
67153
67240
|
if (chain.includes("mainnet") || chain === "ethereum") {
|
|
67154
67241
|
return "mainnet";
|
package/dist/index.mjs
CHANGED
|
@@ -3688,9 +3688,9 @@ var init_deployment_addresses = __esm({
|
|
|
3688
3688
|
reason: "Shared upgrade script: PositionManager implementation update"
|
|
3689
3689
|
},
|
|
3690
3690
|
LoanOperationsManagerModule: {
|
|
3691
|
-
previousImplementation: "
|
|
3692
|
-
newImplementation: "
|
|
3693
|
-
upgradedAt: "2026-05-
|
|
3691
|
+
previousImplementation: "0xdEf0A042670834369d456c5fbE73ad2126008bD2",
|
|
3692
|
+
newImplementation: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
3693
|
+
upgradedAt: "2026-05-15T17:48:01.380Z",
|
|
3694
3694
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3695
3695
|
reason: "Shared upgrade script: LoanOperationsManagerModule v1.4.0 (M-3 Chainlink cross-check)"
|
|
3696
3696
|
},
|
|
@@ -3765,9 +3765,9 @@ var init_deployment_addresses = __esm({
|
|
|
3765
3765
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
3766
3766
|
},
|
|
3767
3767
|
BTCSpendAuthorizer: {
|
|
3768
|
-
previousImplementation: "
|
|
3769
|
-
newImplementation: "
|
|
3770
|
-
upgradedAt: "2026-05-
|
|
3768
|
+
previousImplementation: "0xC86d27513EEA597db2903b702334417AfB9b0B69",
|
|
3769
|
+
newImplementation: "0x8021588673Abf0396c1756EdD16F9B9b6d09fcaC",
|
|
3770
|
+
upgradedAt: "2026-05-15T17:44:01.314Z",
|
|
3771
3771
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3772
3772
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
3773
3773
|
},
|
|
@@ -3793,9 +3793,9 @@ 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: "0x13bA3e63c5ADE2E8565dEaa1f38CAe0Bf4e15CAf",
|
|
3797
|
+
newImplementation: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
3798
|
+
upgradedAt: "2026-05-15T17:50:00.701Z",
|
|
3799
3799
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3800
3800
|
reason: "Shared upgrade script: ContractVersionRegistry implementation update"
|
|
3801
3801
|
},
|
|
@@ -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: {
|
|
@@ -3881,7 +3888,7 @@ var init_deployment_addresses = __esm({
|
|
|
3881
3888
|
CIRCUIT_BREAKER_MODULE: "0x3D0B2cAE481821E57BA9CC3807bCC0d0D7F18bd8",
|
|
3882
3889
|
ADMIN_MODULE: "0xAcd1f07915b17CA3727e7fE89BdF618A1545a1ed",
|
|
3883
3890
|
UCD_CONTROLLER_IMPL: "0x9AFE20da679EA9877893c4A991c8087caE5F7e4C",
|
|
3884
|
-
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "
|
|
3891
|
+
LOAN_OPERATIONS_MANAGER_MODULE_IMPL: "0xFE48026f88706Bb0AA5CD47E4cBCf0BeD2bE9D6b",
|
|
3885
3892
|
TERM_MANAGER_MODULE_IMPL: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
|
|
3886
3893
|
CIRCUIT_BREAKER_MODULE_IMPL: "0x24C345841360EEe81C944c00e0E5c8f6CCc53C00",
|
|
3887
3894
|
ADMIN_MODULE_IMPL: "0x70a500896A26E4e7CDb56886b9e6438e39DB5ae4",
|
|
@@ -3905,14 +3912,14 @@ var init_deployment_addresses = __esm({
|
|
|
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: "0x2cDba7a3440399Ef276fa18edAE7D90168382D09",
|
|
3909
3916
|
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
3910
3917
|
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
3911
3918
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
3912
3919
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xAE227De03D5aeDC870d6e096D9C6652E001a92aF",
|
|
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
|
};
|
|
@@ -66400,6 +66407,55 @@ Error data: ${errorData || "none"}`
|
|
|
66400
66407
|
};
|
|
66401
66408
|
}
|
|
66402
66409
|
}
|
|
66410
|
+
/**
|
|
66411
|
+
* Mark an authorized spend as consumed after a verified Bitcoin broadcast.
|
|
66412
|
+
*
|
|
66413
|
+
* Calls LoanOperationsManager.markSpentByOwner which delegates to
|
|
66414
|
+
* BTCSpendAuthorizer.markSpent. The on-chain position balance was already
|
|
66415
|
+
* debited during Phase 1 (withdrawBTC) — this is bookkeeping so the entry
|
|
66416
|
+
* stops appearing in getPendingWithdrawals().
|
|
66417
|
+
*
|
|
66418
|
+
* @param positionId - Position identifier
|
|
66419
|
+
* @param txid - Source UTXO transaction ID (the one that was authorized in Phase 1)
|
|
66420
|
+
* @param vout - Source UTXO output index
|
|
66421
|
+
* @param broadcastTxid - Bitcoin txid of the broadcast that consumed this UTXO
|
|
66422
|
+
* @returns Transaction hash of the mark-spent EVM transaction
|
|
66423
|
+
*/
|
|
66424
|
+
async markSpentByOwner(positionId, txid, vout, broadcastTxid) {
|
|
66425
|
+
this.ensureInitialized();
|
|
66426
|
+
try {
|
|
66427
|
+
const signer = this.getSignerOrThrow();
|
|
66428
|
+
const contractAddresses = this.getContractAddressesOrThrow();
|
|
66429
|
+
const loanOperationsManagerAddress = contractAddresses.loanOperationsManager;
|
|
66430
|
+
if (!loanOperationsManagerAddress) {
|
|
66431
|
+
return { success: false, error: "LoanOperationsManager address not configured" };
|
|
66432
|
+
}
|
|
66433
|
+
const utxoKey = solidityPackedKeccak256(
|
|
66434
|
+
["string", "uint32"],
|
|
66435
|
+
[txid, vout]
|
|
66436
|
+
);
|
|
66437
|
+
const loanOperationsManager = new Contract(
|
|
66438
|
+
loanOperationsManagerAddress,
|
|
66439
|
+
[
|
|
66440
|
+
"function markSpentByOwner(bytes32 positionId, bytes32 utxoKey, string calldata broadcastTxid) external"
|
|
66441
|
+
],
|
|
66442
|
+
signer
|
|
66443
|
+
);
|
|
66444
|
+
const positionIdBytes32 = this.toBytes32(positionId);
|
|
66445
|
+
const tx = await loanOperationsManager["markSpentByOwner"](
|
|
66446
|
+
positionIdBytes32,
|
|
66447
|
+
utxoKey,
|
|
66448
|
+
broadcastTxid
|
|
66449
|
+
);
|
|
66450
|
+
const receipt = await tx.wait();
|
|
66451
|
+
return { success: true, transactionHash: receipt.hash };
|
|
66452
|
+
} catch (error) {
|
|
66453
|
+
return {
|
|
66454
|
+
success: false,
|
|
66455
|
+
error: error instanceof Error ? error.message : String(error)
|
|
66456
|
+
};
|
|
66457
|
+
}
|
|
66458
|
+
}
|
|
66403
66459
|
/**
|
|
66404
66460
|
* Withdraw BTC and execute transfer (Complete Flow)
|
|
66405
66461
|
*
|
|
@@ -66536,6 +66592,35 @@ Error data: ${errorData || "none"}`
|
|
|
66536
66592
|
txid: executionResult.txid
|
|
66537
66593
|
});
|
|
66538
66594
|
}
|
|
66595
|
+
if (executionResult.success && executionResult.txid) {
|
|
66596
|
+
try {
|
|
66597
|
+
const markResult = await this.markSpentByOwner(
|
|
66598
|
+
positionId,
|
|
66599
|
+
authResult.utxoTxid,
|
|
66600
|
+
Number(authResult.utxoVout),
|
|
66601
|
+
executionResult.txid
|
|
66602
|
+
);
|
|
66603
|
+
if (markResult.success) {
|
|
66604
|
+
if (this.config.debug) {
|
|
66605
|
+
log.info("\u2705 Phase 3 complete: authorization marked as consumed", {
|
|
66606
|
+
txHash: markResult.transactionHash
|
|
66607
|
+
});
|
|
66608
|
+
}
|
|
66609
|
+
} else if (this.config.debug) {
|
|
66610
|
+
log.warn(
|
|
66611
|
+
"\u26A0\uFE0F Phase 3 markSpent failed (non-fatal); pending record persists until cancelPendingWithdrawal()",
|
|
66612
|
+
{ error: markResult.error }
|
|
66613
|
+
);
|
|
66614
|
+
}
|
|
66615
|
+
} catch (markError) {
|
|
66616
|
+
if (this.config.debug) {
|
|
66617
|
+
log.warn(
|
|
66618
|
+
"\u26A0\uFE0F Phase 3 markSpent threw (non-fatal); pending record persists until cancelPendingWithdrawal()",
|
|
66619
|
+
{ error: markError instanceof Error ? markError.message : String(markError) }
|
|
66620
|
+
);
|
|
66621
|
+
}
|
|
66622
|
+
}
|
|
66623
|
+
}
|
|
66539
66624
|
try {
|
|
66540
66625
|
const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
|
|
66541
66626
|
const message = executionResult.success ? formatBTCWithdrawalSuccessMessage(
|
|
@@ -67075,6 +67160,8 @@ Error data: ${errorData || "none"}`
|
|
|
67075
67160
|
* is derived purely from `this.config.chain`.
|
|
67076
67161
|
*/
|
|
67077
67162
|
getBitcoinNetwork() {
|
|
67163
|
+
if (this.config.bitcoinNetwork)
|
|
67164
|
+
return this.config.bitcoinNetwork;
|
|
67078
67165
|
const chain = this.config.chain?.toLowerCase() || "";
|
|
67079
67166
|
if (chain.includes("mainnet") || chain === "ethereum") {
|
|
67080
67167
|
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.254",
|
|
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",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"sideEffects": false,
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@gvnrdao/dh-lit-actions": "^0.0.295",
|
|
79
|
-
"@gvnrdao/dh-lit-ops": "^0.0.
|
|
79
|
+
"@gvnrdao/dh-lit-ops": "^0.0.280",
|
|
80
80
|
"@noble/hashes": "^1.5.0",
|
|
81
81
|
"axios": "^1.15.2",
|
|
82
82
|
"bech32": "^2.0.0",
|