@gvnrdao/dh-sdk 0.0.334 → 0.0.336
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/README.md +13 -1
- package/browser/dist/browser.js +1 -1
- package/dist/constants/chunks/protocol-license.d.ts +48 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/deployments.js +11 -4
- package/dist/deployments.mjs +11 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +51 -6
- package/dist/index.mjs +48 -6
- package/dist/modules/diamond-hands-sdk.d.ts +18 -0
- package/dist/safe-delegation.js +11 -4
- package/dist/safe-delegation.mjs +11 -4
- package/dist/utils/withdrawal-reconciliation.utils.d.ts +5 -4
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol license data for Diamond Hands.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth: the repository `LICENSE` file (byte-identical in
|
|
5
|
+
* `sdk/LICENSE` and `contracts/LICENSE`). `ContractVersionRegistry` publishes
|
|
6
|
+
* the SPDX identifier and a CIDv1 (raw/sha2-256) URI of that same file:
|
|
7
|
+
*
|
|
8
|
+
* LICENSE = "UNLICENSED"
|
|
9
|
+
* LICENSE_URI = "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a"
|
|
10
|
+
*
|
|
11
|
+
* `getLicense()` returns the bundled text so callers do not depend on an IPFS
|
|
12
|
+
* gateway. Fetching the CID at runtime would be a second copy of these bytes
|
|
13
|
+
* plus a network failure mode. A unit test locks the file, the CID, and the
|
|
14
|
+
* on-chain constants together.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PROTOCOL_LICENSE_IDENTIFIER: "UNLICENSED";
|
|
17
|
+
export declare const PROTOCOL_LICENSE_URI: "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a";
|
|
18
|
+
export type ProtocolLicense = {
|
|
19
|
+
/** SPDX identifier published on-chain as `ContractVersionRegistry.LICENSE`. */
|
|
20
|
+
identifier: typeof PROTOCOL_LICENSE_IDENTIFIER;
|
|
21
|
+
/**
|
|
22
|
+
* Content-addressed IPFS URI published on-chain as
|
|
23
|
+
* `ContractVersionRegistry.LICENSE_URI`. The CID is CIDv1 / raw / sha2-256
|
|
24
|
+
* of `text`.
|
|
25
|
+
*/
|
|
26
|
+
uri: typeof PROTOCOL_LICENSE_URI;
|
|
27
|
+
/** Full proprietary license text (byte-identical to the CID payload). */
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Return the Diamond Hands protocol license.
|
|
32
|
+
*
|
|
33
|
+
* This is the package `LICENSE` file — the same bytes pinned at
|
|
34
|
+
* {@link PROTOCOL_LICENSE_URI} and advertised by `ContractVersionRegistry`.
|
|
35
|
+
*
|
|
36
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { getLicense } from "@gvnrdao/dh-sdk";
|
|
41
|
+
*
|
|
42
|
+
* const license = getLicense();
|
|
43
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
44
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
45
|
+
* console.log(license.text); // full GVNR DAO LLC reservation
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function getLicense(): ProtocolLicense;
|
package/dist/deployments.js
CHANGED
|
@@ -154,9 +154,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
154
154
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
155
155
|
},
|
|
156
156
|
BTCSpendAuthorizer: {
|
|
157
|
-
previousImplementation: "
|
|
158
|
-
newImplementation: "
|
|
159
|
-
upgradedAt: "2026-
|
|
157
|
+
previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
|
|
158
|
+
newImplementation: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
159
|
+
upgradedAt: "2026-09-06T15:03:13.627Z",
|
|
160
160
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
161
161
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
162
162
|
},
|
|
@@ -222,6 +222,13 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
222
222
|
upgradedAt: "2026-07-07T16:56:49.844Z",
|
|
223
223
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
224
224
|
reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
|
|
225
|
+
},
|
|
226
|
+
AgentDelegationRegistry: {
|
|
227
|
+
previousImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
228
|
+
newImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
229
|
+
upgradedAt: "2026-09-06T15:06:02.814Z",
|
|
230
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
231
|
+
reason: "Reconciled implementation from chain"
|
|
225
232
|
}
|
|
226
233
|
},
|
|
227
234
|
history: {
|
|
@@ -307,7 +314,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
307
314
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
308
315
|
LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
|
|
309
316
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
310
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
317
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
311
318
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
312
319
|
UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
|
|
313
320
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
package/dist/deployments.mjs
CHANGED
|
@@ -121,9 +121,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
121
121
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
122
122
|
},
|
|
123
123
|
BTCSpendAuthorizer: {
|
|
124
|
-
previousImplementation: "
|
|
125
|
-
newImplementation: "
|
|
126
|
-
upgradedAt: "2026-
|
|
124
|
+
previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
|
|
125
|
+
newImplementation: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
126
|
+
upgradedAt: "2026-09-06T15:03:13.627Z",
|
|
127
127
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
128
128
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
129
129
|
},
|
|
@@ -189,6 +189,13 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
189
189
|
upgradedAt: "2026-07-07T16:56:49.844Z",
|
|
190
190
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
191
191
|
reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
|
|
192
|
+
},
|
|
193
|
+
AgentDelegationRegistry: {
|
|
194
|
+
previousImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
195
|
+
newImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
196
|
+
upgradedAt: "2026-09-06T15:06:02.814Z",
|
|
197
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
198
|
+
reason: "Reconciled implementation from chain"
|
|
192
199
|
}
|
|
193
200
|
},
|
|
194
201
|
history: {
|
|
@@ -274,7 +281,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
274
281
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
275
282
|
LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
|
|
276
283
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
277
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
284
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
278
285
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
279
286
|
UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
|
|
280
287
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export { LoanStatus } from './types/loanStatus';
|
|
|
49
49
|
export type { LoanEvents, LoanEventsFilter, PositionCreatedEvent, PaymentEvent, StatusUpdateEvent, LiquidationEvent, UCDMintEvent, WithdrawalEvent, RenewalEvent, OperationFailureEvent, MintRequestEvent, BurnRequestEvent, CollateralContractEvent, } from './types/event-types';
|
|
50
50
|
export { PaymentType, PositionStatus, isValidPositionStatus, isValidPaymentType, numericToPositionStatus, EventHelpers, } from './types/event-types';
|
|
51
51
|
export type { ProtocolEvent, ProtocolEventsFilter, ProtocolEventsResult, } from './types/protocol-event-types';
|
|
52
|
+
export { getLicense, PROTOCOL_LICENSE_IDENTIFIER, PROTOCOL_LICENSE_URI, } from './constants/chunks/protocol-license';
|
|
53
|
+
export type { ProtocolLicense } from './constants/chunks/protocol-license';
|
|
52
54
|
export { fetchProtocolPauseStatus, assertProtocolNotPaused, } from './protocol/protocol-pause';
|
|
53
55
|
export type { ProtocolPauseStatus, ProtocolPauseKey, } from './protocol/protocol-pause';
|
|
54
56
|
export { SDKError, ErrorCategory, ErrorSeverity } from './utils/error-handler';
|
package/dist/index.js
CHANGED
|
@@ -179,9 +179,9 @@ var init_deployment_addresses = __esm({
|
|
|
179
179
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
180
180
|
},
|
|
181
181
|
BTCSpendAuthorizer: {
|
|
182
|
-
previousImplementation: "
|
|
183
|
-
newImplementation: "
|
|
184
|
-
upgradedAt: "2026-
|
|
182
|
+
previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
|
|
183
|
+
newImplementation: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
184
|
+
upgradedAt: "2026-09-06T15:03:13.627Z",
|
|
185
185
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
186
186
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
187
187
|
},
|
|
@@ -247,6 +247,13 @@ var init_deployment_addresses = __esm({
|
|
|
247
247
|
upgradedAt: "2026-07-07T16:56:49.844Z",
|
|
248
248
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
249
249
|
reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
|
|
250
|
+
},
|
|
251
|
+
AgentDelegationRegistry: {
|
|
252
|
+
previousImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
253
|
+
newImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
254
|
+
upgradedAt: "2026-09-06T15:06:02.814Z",
|
|
255
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
256
|
+
reason: "Reconciled implementation from chain"
|
|
250
257
|
}
|
|
251
258
|
},
|
|
252
259
|
history: {
|
|
@@ -332,7 +339,7 @@ var init_deployment_addresses = __esm({
|
|
|
332
339
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
333
340
|
LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
|
|
334
341
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
335
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
342
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
336
343
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
337
344
|
UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
|
|
338
345
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
@@ -5771,6 +5778,8 @@ __export(src_exports, {
|
|
|
5771
5778
|
LoanQuery: () => LoanQuery,
|
|
5772
5779
|
LoanStatus: () => LoanStatus,
|
|
5773
5780
|
PKPManager: () => PKPManager,
|
|
5781
|
+
PROTOCOL_LICENSE_IDENTIFIER: () => PROTOCOL_LICENSE_IDENTIFIER,
|
|
5782
|
+
PROTOCOL_LICENSE_URI: () => PROTOCOL_LICENSE_URI,
|
|
5774
5783
|
PaymentType: () => PaymentType,
|
|
5775
5784
|
PositionStatus: () => PositionStatus,
|
|
5776
5785
|
RECOVERY_INVALIDATE_ACTION: () => RECOVERY_INVALIDATE_ACTION,
|
|
@@ -5809,6 +5818,7 @@ __export(src_exports, {
|
|
|
5809
5818
|
getContractsByNetwork: () => getContractsByNetwork,
|
|
5810
5819
|
getDelegateStatus: () => getDelegateStatus,
|
|
5811
5820
|
getDeploymentByNetwork: () => getDeploymentByNetwork,
|
|
5821
|
+
getLicense: () => getLicense,
|
|
5812
5822
|
getPositionDelegate: () => getPositionDelegate,
|
|
5813
5823
|
getSafeAgentDelegation: () => getSafeAgentDelegation,
|
|
5814
5824
|
isClosePositionAuth: () => isClosePositionAuth,
|
|
@@ -6335,6 +6345,19 @@ var SDK_DEFAULTS = {
|
|
|
6335
6345
|
DEBUG: false
|
|
6336
6346
|
};
|
|
6337
6347
|
|
|
6348
|
+
// src/constants/chunks/protocol-license.ts
|
|
6349
|
+
var PROTOCOL_LICENSE_IDENTIFIER = "UNLICENSED";
|
|
6350
|
+
var PROTOCOL_LICENSE_URI = "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a";
|
|
6351
|
+
var PROTOCOL_LICENSE_TEXT = '(c) GVNR DAO LLC, 2026\n\nExcept as otherwise provided in the header of a specific source code\nfile in this repository: (a) all intellectual property (including all\nsource code, designs and protocols) contained in this repository has been\npublished for informational purposes only; (b) no license, right of\nreproduction or distribution or other right with respect thereto is\ngranted or implied; and (c) all moral, intellectual property and other\nrights are hereby reserved by the copyright holder.\n\nTHE SOFTWARE AND INTELLECTUAL PROPERTY INCLUDED IN THIS REPOSITORY\nIS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS," AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE OR\nINTELLECTUAL PROPERTY (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION), HOWEVER CAUSED OR CLAIMED (WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), EVEN IF\nSUCH DAMAGES WERE REASONABLY FORESEEABLE OR THE COPYRIGHT HOLDERS WERE\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.';
|
|
6352
|
+
var PROTOCOL_LICENSE = Object.freeze({
|
|
6353
|
+
identifier: PROTOCOL_LICENSE_IDENTIFIER,
|
|
6354
|
+
uri: PROTOCOL_LICENSE_URI,
|
|
6355
|
+
text: PROTOCOL_LICENSE_TEXT
|
|
6356
|
+
});
|
|
6357
|
+
function getLicense() {
|
|
6358
|
+
return PROTOCOL_LICENSE;
|
|
6359
|
+
}
|
|
6360
|
+
|
|
6338
6361
|
// src/utils/service-endpoint-policy.ts
|
|
6339
6362
|
function assertSafeServiceEndpoint(endpoint) {
|
|
6340
6363
|
let url;
|
|
@@ -7670,12 +7693,12 @@ async function reconcileAuthorizedSpend(spend, esploraBaseUrl, httpGetJson = def
|
|
|
7670
7693
|
{ txid: spend.txid, vout: spend.vout }
|
|
7671
7694
|
);
|
|
7672
7695
|
}
|
|
7673
|
-
if (spend.targetAmount
|
|
7696
|
+
if (spend.targetAmount > spend.satoshis) {
|
|
7674
7697
|
return {
|
|
7675
7698
|
spend,
|
|
7676
7699
|
status: "CORRUPT",
|
|
7677
7700
|
onChainOutputValue,
|
|
7678
|
-
reason: `Authorized targetAmount ${spend.targetAmount} sats
|
|
7701
|
+
reason: `Authorized targetAmount ${spend.targetAmount} sats exceeds the ${spend.satoshis}-sat aggregate input value \u2014 the contract could never have authorized this`
|
|
7679
7702
|
};
|
|
7680
7703
|
}
|
|
7681
7704
|
const outspendRes = await httpGetJson(
|
|
@@ -26655,6 +26678,25 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
26655
26678
|
getConfig() {
|
|
26656
26679
|
return this.config;
|
|
26657
26680
|
}
|
|
26681
|
+
/**
|
|
26682
|
+
* Return the Diamond Hands protocol license.
|
|
26683
|
+
*
|
|
26684
|
+
* Same data as the standalone `getLicense()` export: the package `LICENSE`
|
|
26685
|
+
* file, which is the CIDv1 payload of `ContractVersionRegistry.LICENSE_URI`.
|
|
26686
|
+
* Does not fetch IPFS.
|
|
26687
|
+
*
|
|
26688
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
26689
|
+
*
|
|
26690
|
+
* @example
|
|
26691
|
+
* ```ts
|
|
26692
|
+
* const license = sdk.getLicense();
|
|
26693
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
26694
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
26695
|
+
* ```
|
|
26696
|
+
*/
|
|
26697
|
+
getLicense() {
|
|
26698
|
+
return getLicense();
|
|
26699
|
+
}
|
|
26658
26700
|
/**
|
|
26659
26701
|
* Clear all caches
|
|
26660
26702
|
*/
|
|
@@ -27621,6 +27663,8 @@ async function getSafeAgentDelegation(params) {
|
|
|
27621
27663
|
LoanQuery,
|
|
27622
27664
|
LoanStatus,
|
|
27623
27665
|
PKPManager,
|
|
27666
|
+
PROTOCOL_LICENSE_IDENTIFIER,
|
|
27667
|
+
PROTOCOL_LICENSE_URI,
|
|
27624
27668
|
PaymentType,
|
|
27625
27669
|
PositionStatus,
|
|
27626
27670
|
RECOVERY_INVALIDATE_ACTION,
|
|
@@ -27658,6 +27702,7 @@ async function getSafeAgentDelegation(params) {
|
|
|
27658
27702
|
getContractsByNetwork,
|
|
27659
27703
|
getDelegateStatus,
|
|
27660
27704
|
getDeploymentByNetwork,
|
|
27705
|
+
getLicense,
|
|
27661
27706
|
getPositionDelegate,
|
|
27662
27707
|
getSafeAgentDelegation,
|
|
27663
27708
|
isClosePositionAuth,
|
package/dist/index.mjs
CHANGED
|
@@ -185,9 +185,9 @@ var init_deployment_addresses = __esm({
|
|
|
185
185
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
186
186
|
},
|
|
187
187
|
BTCSpendAuthorizer: {
|
|
188
|
-
previousImplementation: "
|
|
189
|
-
newImplementation: "
|
|
190
|
-
upgradedAt: "2026-
|
|
188
|
+
previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
|
|
189
|
+
newImplementation: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
190
|
+
upgradedAt: "2026-09-06T15:03:13.627Z",
|
|
191
191
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
192
192
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
193
193
|
},
|
|
@@ -253,6 +253,13 @@ var init_deployment_addresses = __esm({
|
|
|
253
253
|
upgradedAt: "2026-07-07T16:56:49.844Z",
|
|
254
254
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
255
255
|
reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
|
|
256
|
+
},
|
|
257
|
+
AgentDelegationRegistry: {
|
|
258
|
+
previousImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
259
|
+
newImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
260
|
+
upgradedAt: "2026-09-06T15:06:02.814Z",
|
|
261
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
262
|
+
reason: "Reconciled implementation from chain"
|
|
256
263
|
}
|
|
257
264
|
},
|
|
258
265
|
history: {
|
|
@@ -338,7 +345,7 @@ var init_deployment_addresses = __esm({
|
|
|
338
345
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
339
346
|
LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
|
|
340
347
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
341
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
348
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
342
349
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
343
350
|
UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
|
|
344
351
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
@@ -6250,6 +6257,19 @@ var SDK_DEFAULTS = {
|
|
|
6250
6257
|
DEBUG: false
|
|
6251
6258
|
};
|
|
6252
6259
|
|
|
6260
|
+
// src/constants/chunks/protocol-license.ts
|
|
6261
|
+
var PROTOCOL_LICENSE_IDENTIFIER = "UNLICENSED";
|
|
6262
|
+
var PROTOCOL_LICENSE_URI = "ipfs://bafkreigunb4phugonefe66by524nhnrgrpol4233ytg7e7eg7qomhy3s3a";
|
|
6263
|
+
var PROTOCOL_LICENSE_TEXT = '(c) GVNR DAO LLC, 2026\n\nExcept as otherwise provided in the header of a specific source code\nfile in this repository: (a) all intellectual property (including all\nsource code, designs and protocols) contained in this repository has been\npublished for informational purposes only; (b) no license, right of\nreproduction or distribution or other right with respect thereto is\ngranted or implied; and (c) all moral, intellectual property and other\nrights are hereby reserved by the copyright holder.\n\nTHE SOFTWARE AND INTELLECTUAL PROPERTY INCLUDED IN THIS REPOSITORY\nIS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS," AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE OR\nINTELLECTUAL PROPERTY (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION), HOWEVER CAUSED OR CLAIMED (WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), EVEN IF\nSUCH DAMAGES WERE REASONABLY FORESEEABLE OR THE COPYRIGHT HOLDERS WERE\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.';
|
|
6264
|
+
var PROTOCOL_LICENSE = Object.freeze({
|
|
6265
|
+
identifier: PROTOCOL_LICENSE_IDENTIFIER,
|
|
6266
|
+
uri: PROTOCOL_LICENSE_URI,
|
|
6267
|
+
text: PROTOCOL_LICENSE_TEXT
|
|
6268
|
+
});
|
|
6269
|
+
function getLicense() {
|
|
6270
|
+
return PROTOCOL_LICENSE;
|
|
6271
|
+
}
|
|
6272
|
+
|
|
6253
6273
|
// src/utils/service-endpoint-policy.ts
|
|
6254
6274
|
function assertSafeServiceEndpoint(endpoint) {
|
|
6255
6275
|
let url;
|
|
@@ -7585,12 +7605,12 @@ async function reconcileAuthorizedSpend(spend, esploraBaseUrl, httpGetJson = def
|
|
|
7585
7605
|
{ txid: spend.txid, vout: spend.vout }
|
|
7586
7606
|
);
|
|
7587
7607
|
}
|
|
7588
|
-
if (spend.targetAmount
|
|
7608
|
+
if (spend.targetAmount > spend.satoshis) {
|
|
7589
7609
|
return {
|
|
7590
7610
|
spend,
|
|
7591
7611
|
status: "CORRUPT",
|
|
7592
7612
|
onChainOutputValue,
|
|
7593
|
-
reason: `Authorized targetAmount ${spend.targetAmount} sats
|
|
7613
|
+
reason: `Authorized targetAmount ${spend.targetAmount} sats exceeds the ${spend.satoshis}-sat aggregate input value \u2014 the contract could never have authorized this`
|
|
7594
7614
|
};
|
|
7595
7615
|
}
|
|
7596
7616
|
const outspendRes = await httpGetJson(
|
|
@@ -26584,6 +26604,25 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
26584
26604
|
getConfig() {
|
|
26585
26605
|
return this.config;
|
|
26586
26606
|
}
|
|
26607
|
+
/**
|
|
26608
|
+
* Return the Diamond Hands protocol license.
|
|
26609
|
+
*
|
|
26610
|
+
* Same data as the standalone `getLicense()` export: the package `LICENSE`
|
|
26611
|
+
* file, which is the CIDv1 payload of `ContractVersionRegistry.LICENSE_URI`.
|
|
26612
|
+
* Does not fetch IPFS.
|
|
26613
|
+
*
|
|
26614
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
26615
|
+
*
|
|
26616
|
+
* @example
|
|
26617
|
+
* ```ts
|
|
26618
|
+
* const license = sdk.getLicense();
|
|
26619
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
26620
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
26621
|
+
* ```
|
|
26622
|
+
*/
|
|
26623
|
+
getLicense() {
|
|
26624
|
+
return getLicense();
|
|
26625
|
+
}
|
|
26587
26626
|
/**
|
|
26588
26627
|
* Clear all caches
|
|
26589
26628
|
*/
|
|
@@ -27549,6 +27588,8 @@ export {
|
|
|
27549
27588
|
LoanQuery,
|
|
27550
27589
|
LoanStatus,
|
|
27551
27590
|
PKPManager,
|
|
27591
|
+
PROTOCOL_LICENSE_IDENTIFIER,
|
|
27592
|
+
PROTOCOL_LICENSE_URI,
|
|
27552
27593
|
PaymentType,
|
|
27553
27594
|
PositionStatus,
|
|
27554
27595
|
RECOVERY_INVALIDATE_ACTION,
|
|
@@ -27587,6 +27628,7 @@ export {
|
|
|
27587
27628
|
getContractsByNetwork,
|
|
27588
27629
|
getDelegateStatus,
|
|
27589
27630
|
getDeploymentByNetwork,
|
|
27631
|
+
getLicense,
|
|
27590
27632
|
getPositionDelegate,
|
|
27591
27633
|
getSafeAgentDelegation,
|
|
27592
27634
|
isClosePositionAuth,
|
|
@@ -17,6 +17,7 @@ import { Satoshis } from "../types/branded/domain-values";
|
|
|
17
17
|
import { SDKError } from "../utils/error-handler";
|
|
18
18
|
import type { CreateLoanRequest, CreateLoanResult, LoanDataDetail, UCDMintRequest, UCDMintResult, PartialPaymentRequest, PartialPaymentResult, BTCWithdrawalResult, RenewPositionRequest, RenewPositionResult, LiquidationRequest, LiquidationResult, ConfirmBalanceRequest, ConfirmBalanceResult, TermsWithFeesResult } from "../interfaces/chunks/loan-operations.i";
|
|
19
19
|
import type { DiamondHandsSDKConfig } from "../interfaces/chunks/config.i";
|
|
20
|
+
import { type ProtocolLicense } from "../constants/chunks/protocol-license";
|
|
20
21
|
import type { PKPData } from "../interfaces/chunks/pkp-integration.i";
|
|
21
22
|
import { type AuthorizationProvider } from "../utils/authorization-provider.utils";
|
|
22
23
|
import type { DhServerLoginPayload } from "../utils/eip712-login";
|
|
@@ -1375,6 +1376,23 @@ export declare class DiamondHandsSDK {
|
|
|
1375
1376
|
* Get SDK configuration
|
|
1376
1377
|
*/
|
|
1377
1378
|
getConfig(): DiamondHandsSDKConfig;
|
|
1379
|
+
/**
|
|
1380
|
+
* Return the Diamond Hands protocol license.
|
|
1381
|
+
*
|
|
1382
|
+
* Same data as the standalone `getLicense()` export: the package `LICENSE`
|
|
1383
|
+
* file, which is the CIDv1 payload of `ContractVersionRegistry.LICENSE_URI`.
|
|
1384
|
+
* Does not fetch IPFS.
|
|
1385
|
+
*
|
|
1386
|
+
* @returns Identifier (`UNLICENSED`), IPFS URI, and full license text.
|
|
1387
|
+
*
|
|
1388
|
+
* @example
|
|
1389
|
+
* ```ts
|
|
1390
|
+
* const license = sdk.getLicense();
|
|
1391
|
+
* console.log(license.identifier); // "UNLICENSED"
|
|
1392
|
+
* console.log(license.uri); // "ipfs://bafkrei…"
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
1395
|
+
getLicense(): ProtocolLicense;
|
|
1378
1396
|
/**
|
|
1379
1397
|
* Clear all caches
|
|
1380
1398
|
*/
|
package/dist/safe-delegation.js
CHANGED
|
@@ -151,9 +151,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
151
151
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
152
152
|
},
|
|
153
153
|
BTCSpendAuthorizer: {
|
|
154
|
-
previousImplementation: "
|
|
155
|
-
newImplementation: "
|
|
156
|
-
upgradedAt: "2026-
|
|
154
|
+
previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
|
|
155
|
+
newImplementation: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
156
|
+
upgradedAt: "2026-09-06T15:03:13.627Z",
|
|
157
157
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
158
158
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
159
159
|
},
|
|
@@ -219,6 +219,13 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
219
219
|
upgradedAt: "2026-07-07T16:56:49.844Z",
|
|
220
220
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
221
221
|
reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
|
|
222
|
+
},
|
|
223
|
+
AgentDelegationRegistry: {
|
|
224
|
+
previousImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
225
|
+
newImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
226
|
+
upgradedAt: "2026-09-06T15:06:02.814Z",
|
|
227
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
228
|
+
reason: "Reconciled implementation from chain"
|
|
222
229
|
}
|
|
223
230
|
},
|
|
224
231
|
history: {
|
|
@@ -304,7 +311,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
304
311
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
305
312
|
LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
|
|
306
313
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
307
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
314
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
308
315
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
309
316
|
UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
|
|
310
317
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
package/dist/safe-delegation.mjs
CHANGED
|
@@ -124,9 +124,9 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
124
124
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
125
125
|
},
|
|
126
126
|
BTCSpendAuthorizer: {
|
|
127
|
-
previousImplementation: "
|
|
128
|
-
newImplementation: "
|
|
129
|
-
upgradedAt: "2026-
|
|
127
|
+
previousImplementation: "0xdd3DFaEc50d6214d57eA64e8b76ff318b501607b",
|
|
128
|
+
newImplementation: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
129
|
+
upgradedAt: "2026-09-06T15:03:13.627Z",
|
|
130
130
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
131
131
|
reason: "Shared upgrade script: BTCSpendAuthorizer implementation update"
|
|
132
132
|
},
|
|
@@ -192,6 +192,13 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
192
192
|
upgradedAt: "2026-07-07T16:56:49.844Z",
|
|
193
193
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
194
194
|
reason: "Shared upgrade script: BitcoinWithdrawalAddressRegistry implementation update"
|
|
195
|
+
},
|
|
196
|
+
AgentDelegationRegistry: {
|
|
197
|
+
previousImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
198
|
+
newImplementation: "0xE931E4b9ceF2A48Ac7D57192da4B523756cFC310",
|
|
199
|
+
upgradedAt: "2026-09-06T15:06:02.814Z",
|
|
200
|
+
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
201
|
+
reason: "Reconciled implementation from chain"
|
|
195
202
|
}
|
|
196
203
|
},
|
|
197
204
|
history: {
|
|
@@ -277,7 +284,7 @@ var SEPOLIA_DEPLOYMENT = {
|
|
|
277
284
|
LIQUIDATION_MANAGER_MODULE: "0xC4AB00f39e7ceD812F5C67058C9fa44e15d40e76",
|
|
278
285
|
LIQUIDATION_MANAGER_MODULE_IMPL: "0xCe7587C47094BBb3dCa13D7a2299Ec9beA6cd759",
|
|
279
286
|
BTC_SPEND_AUTHORIZER: "0xd7E9Eb5eE53f1d9ee55Dc162bBC7486bE437B6bD",
|
|
280
|
-
BTC_SPEND_AUTHORIZER_IMPL: "
|
|
287
|
+
BTC_SPEND_AUTHORIZER_IMPL: "0xf3282B5A1AE6428ee1b08cfaAF4EB4e198877484",
|
|
281
288
|
UPGRADE_VALIDATOR: "0x592e650edD9bA26ecc407989fdd6F9cdcDeC27A6",
|
|
282
289
|
UPGRADE_VALIDATOR_IMPL: "0x9E70e1D07AB11ac9dD37B67AA091Efe97d7Ed84b",
|
|
283
290
|
BITCOIN_PROVIDER_REGISTRY: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* the TOTAL input value the consolidation will consume across the vault's
|
|
8
8
|
* confirmed UTXO set (btc-withdrawal.ts signs `vaultSatoshis = newCollateral +
|
|
9
9
|
* totalDeduction`), while `(txid, vout)` pins ONE representative outpoint.
|
|
10
|
-
* `BTCSpendAuthorizer.sol` enforces `targetAmount
|
|
11
|
-
* (
|
|
10
|
+
* `BTCSpendAuthorizer.sol` enforces `targetAmount <= satoshis`
|
|
11
|
+
* (TargetExceedsInputValue; equality is a full sweep with no change output,
|
|
12
|
+
* allowed since 1.7.0) — a withdrawal near the vault's full balance could
|
|
12
13
|
* never be authorized against a single small outpoint's value, so the
|
|
13
14
|
* aggregate is structurally required. NEVER compare `satoshis` to the
|
|
14
15
|
* representative outpoint's own value: for any vault holding more than one
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
* - the output at `vout` pays the VAULT address, when the caller supplies it
|
|
22
23
|
* (else CORRUPT — this is the real 2026-07-20 (vout, satoshis)-decoupling
|
|
23
24
|
* bug class: a vout pointing at an output the vault does not own);
|
|
24
|
-
* - `targetAmount
|
|
25
|
+
* - `targetAmount <= satoshis`, mirroring the contract invariant (else CORRUPT);
|
|
25
26
|
* - the outpoint's spend state (EXECUTED / SPENT_MISMATCH / EXECUTABLE).
|
|
26
27
|
*
|
|
27
28
|
* Statuses:
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
* - SPENT_MISMATCH — outpoint spent but the spending tx pays the target
|
|
32
33
|
* nothing → unexecutable; recoverStaleSpend clears it.
|
|
33
34
|
* - CORRUPT — authorization contradicts the chain (vout out of range,
|
|
34
|
-
* output not owned by the vault, or targetAmount
|
|
35
|
+
* output not owned by the vault, or targetAmount >
|
|
35
36
|
* satoshis) → operator recovery (admin clearing path);
|
|
36
37
|
* never Execute.
|
|
37
38
|
* - UNFUNDED — funding tx unknown/unconfirmed → wait; no Execute yet.
|
package/package.json
CHANGED