@gvnrdao/dh-sdk 0.0.304 → 0.0.305
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/browser/dist/browser.js +1 -1
- package/dist/deployments.js +6 -2
- package/dist/deployments.mjs +6 -2
- package/dist/index.js +39 -17
- package/dist/index.mjs +39 -17
- package/dist/interfaces/chunks/loan-operations.i.d.ts +10 -0
- package/package.json +3 -3
package/dist/deployments.js
CHANGED
|
@@ -413,9 +413,13 @@ var MAINNET_DEPLOYMENT = {
|
|
|
413
413
|
reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.0.0 -> 1.0.1"
|
|
414
414
|
},
|
|
415
415
|
UCDController: {
|
|
416
|
+
previousImplementation: "0x16f94AcC78cE87bEeBCfF90552091B3EfC071E48",
|
|
416
417
|
newImplementation: "0x28B8cAB89D89B3F83581FD2290de2Ce84535bd0A",
|
|
417
|
-
|
|
418
|
-
|
|
418
|
+
upgradedAt: "2026-07-06T10:41:59.000Z",
|
|
419
|
+
upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f in tx 0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7 (block 25472962)",
|
|
420
|
+
reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
|
|
421
|
+
executeTx: "0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7",
|
|
422
|
+
block: 25472962
|
|
419
423
|
},
|
|
420
424
|
PositionManagerCoreModule: {
|
|
421
425
|
previousImplementation: "0x6C8b0FB93F8d0239254aefaC24d4264cA2F8AAeB",
|
package/dist/deployments.mjs
CHANGED
|
@@ -380,9 +380,13 @@ var MAINNET_DEPLOYMENT = {
|
|
|
380
380
|
reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.0.0 -> 1.0.1"
|
|
381
381
|
},
|
|
382
382
|
UCDController: {
|
|
383
|
+
previousImplementation: "0x16f94AcC78cE87bEeBCfF90552091B3EfC071E48",
|
|
383
384
|
newImplementation: "0x28B8cAB89D89B3F83581FD2290de2Ce84535bd0A",
|
|
384
|
-
|
|
385
|
-
|
|
385
|
+
upgradedAt: "2026-07-06T10:41:59.000Z",
|
|
386
|
+
upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f in tx 0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7 (block 25472962)",
|
|
387
|
+
reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
|
|
388
|
+
executeTx: "0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7",
|
|
389
|
+
block: 25472962
|
|
386
390
|
},
|
|
387
391
|
PositionManagerCoreModule: {
|
|
388
392
|
previousImplementation: "0x6C8b0FB93F8d0239254aefaC24d4264cA2F8AAeB",
|
package/dist/index.js
CHANGED
|
@@ -438,9 +438,13 @@ var init_deployment_addresses = __esm({
|
|
|
438
438
|
reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.0.0 -> 1.0.1"
|
|
439
439
|
},
|
|
440
440
|
UCDController: {
|
|
441
|
+
previousImplementation: "0x16f94AcC78cE87bEeBCfF90552091B3EfC071E48",
|
|
441
442
|
newImplementation: "0x28B8cAB89D89B3F83581FD2290de2Ce84535bd0A",
|
|
442
|
-
|
|
443
|
-
|
|
443
|
+
upgradedAt: "2026-07-06T10:41:59.000Z",
|
|
444
|
+
upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f in tx 0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7 (block 25472962)",
|
|
445
|
+
reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
|
|
446
|
+
executeTx: "0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7",
|
|
447
|
+
block: 25472962
|
|
444
448
|
},
|
|
445
449
|
PositionManagerCoreModule: {
|
|
446
450
|
previousImplementation: "0x6C8b0FB93F8d0239254aefaC24d4264cA2F8AAeB",
|
|
@@ -1287,7 +1291,7 @@ var require_pkg_src = __commonJS({
|
|
|
1287
1291
|
description: "Production Pkp Validator",
|
|
1288
1292
|
version: "1.0.0",
|
|
1289
1293
|
deployed: true,
|
|
1290
|
-
deployedAt:
|
|
1294
|
+
deployedAt: 1784569687492,
|
|
1291
1295
|
size: 4140,
|
|
1292
1296
|
hash: "4c0d65bf1f33cdac22a78fd8c4764319cc3fe00650e0fe7fa8a6090d9a318a7b",
|
|
1293
1297
|
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
@@ -1364,17 +1368,17 @@ var require_pkg_src = __commonJS({
|
|
|
1364
1368
|
}
|
|
1365
1369
|
},
|
|
1366
1370
|
btcWithdrawal: {
|
|
1367
|
-
cid: "
|
|
1371
|
+
cid: "QmexvpfHPacjsVcqNHHLyJhSnnAPLgbWmWd9N3NDLDvYds",
|
|
1368
1372
|
authorizedCidHex: cidToHex(
|
|
1369
|
-
"
|
|
1373
|
+
"QmexvpfHPacjsVcqNHHLyJhSnnAPLgbWmWd9N3NDLDvYds"
|
|
1370
1374
|
),
|
|
1371
1375
|
name: "Btc Withdrawal",
|
|
1372
1376
|
description: "Production Btc Withdrawal",
|
|
1373
|
-
version: "1.2.
|
|
1377
|
+
version: "1.2.3",
|
|
1374
1378
|
deployed: true,
|
|
1375
|
-
deployedAt:
|
|
1376
|
-
size:
|
|
1377
|
-
hash: "
|
|
1379
|
+
deployedAt: 1784585746901,
|
|
1380
|
+
size: 92027,
|
|
1381
|
+
hash: "7b4f4eab1f0c08b8b5b1c9cdb1064dd403ec13f57765919f62dec67fb8ba3c69",
|
|
1378
1382
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
1379
1383
|
pkp: {
|
|
1380
1384
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -3746,12 +3750,23 @@ ${auth.clientId}`;
|
|
|
3746
3750
|
if (!data.vout || !Array.isArray(data.vout)) {
|
|
3747
3751
|
return null;
|
|
3748
3752
|
}
|
|
3749
|
-
return data.vout.map((output, index) =>
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3753
|
+
return data.vout.map((output, index) => {
|
|
3754
|
+
if (output.value === void 0) {
|
|
3755
|
+
throw new Error(
|
|
3756
|
+
`getTransactionOutputs(${txid}): output ${index} is missing its value \u2014 malformed provider response, refusing to return outputs that cannot be value-verified`
|
|
3757
|
+
);
|
|
3758
|
+
}
|
|
3759
|
+
assertSaneSatoshis(
|
|
3760
|
+
output.value,
|
|
3761
|
+
`getTransactionOutputs(${txid}) output ${index}`
|
|
3762
|
+
);
|
|
3763
|
+
return {
|
|
3764
|
+
index,
|
|
3765
|
+
scriptpubkey: output.scriptpubkey,
|
|
3766
|
+
scriptpubkey_address: output.scriptpubkey_address,
|
|
3767
|
+
value: output.value
|
|
3768
|
+
};
|
|
3769
|
+
});
|
|
3755
3770
|
} catch (error) {
|
|
3756
3771
|
clearTimeout(timeoutId);
|
|
3757
3772
|
if (isAbortError(error)) {
|
|
@@ -20754,7 +20769,9 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
20754
20769
|
gasUsed: receipt.gasUsed?.toString() || "unknown",
|
|
20755
20770
|
utxoTxid: validationResponse.utxoTxid,
|
|
20756
20771
|
utxoVout: validationResponse.utxoVout,
|
|
20757
|
-
utxoSatoshis: validationResponse.utxoSatoshis
|
|
20772
|
+
utxoSatoshis: validationResponse.utxoSatoshis,
|
|
20773
|
+
// Phase B: full consensus-validated spend set (absent on older actions).
|
|
20774
|
+
confirmedUtxos: validationResponse.confirmedUtxos
|
|
20758
20775
|
};
|
|
20759
20776
|
} catch (error) {
|
|
20760
20777
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
@@ -21437,7 +21454,12 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
21437
21454
|
log.info("\u{1F50D} Found vault UTXO for execution", { utxoIdentifier });
|
|
21438
21455
|
}
|
|
21439
21456
|
let executionUtxos;
|
|
21440
|
-
const gatheredUtxos =
|
|
21457
|
+
const gatheredUtxos = authResult.confirmedUtxos && authResult.confirmedUtxos.length > 0 ? authResult.confirmedUtxos.map((u) => ({
|
|
21458
|
+
txid: u.txid,
|
|
21459
|
+
vout: Number(u.vout),
|
|
21460
|
+
value: Number(u.value),
|
|
21461
|
+
confirmations: 0
|
|
21462
|
+
})) : await this.fetchConfirmedVaultUtxos(positionId);
|
|
21441
21463
|
if (gatheredUtxos.length > 0) {
|
|
21442
21464
|
const normTxid = (t) => String(t).toLowerCase().replace(/^0x/, "");
|
|
21443
21465
|
const byOutpoint = /* @__PURE__ */ new Map();
|
package/dist/index.mjs
CHANGED
|
@@ -444,9 +444,13 @@ var init_deployment_addresses = __esm({
|
|
|
444
444
|
reason: "Validator gas fix (#420): BitcoinAddressValidator packed-table lookups; VERSION 1.0.0 -> 1.0.1"
|
|
445
445
|
},
|
|
446
446
|
UCDController: {
|
|
447
|
+
previousImplementation: "0x16f94AcC78cE87bEeBCfF90552091B3EfC071E48",
|
|
447
448
|
newImplementation: "0x28B8cAB89D89B3F83581FD2290de2Ce84535bd0A",
|
|
448
|
-
|
|
449
|
-
|
|
449
|
+
upgradedAt: "2026-07-06T10:41:59.000Z",
|
|
450
|
+
upgradedBy: "AdminModule/Safe audit-batch upgradeToAndCall; executed by 0xEba7BfAeB35ee18408b424Ee0BB45AdDf776589f in tx 0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7 (block 25472962)",
|
|
451
|
+
reason: "Reconciled from chain \u2014 mainnet audit rollout batch (cross-ref onchain-auth/.safe-batches/mainnet-audit-execute.json)",
|
|
452
|
+
executeTx: "0xf6609d3fa43b460d953c85d8d7265b59bf177723042db79a6a700571bad777b7",
|
|
453
|
+
block: 25472962
|
|
450
454
|
},
|
|
451
455
|
PositionManagerCoreModule: {
|
|
452
456
|
previousImplementation: "0x6C8b0FB93F8d0239254aefaC24d4264cA2F8AAeB",
|
|
@@ -1293,7 +1297,7 @@ var require_pkg_src = __commonJS({
|
|
|
1293
1297
|
description: "Production Pkp Validator",
|
|
1294
1298
|
version: "1.0.0",
|
|
1295
1299
|
deployed: true,
|
|
1296
|
-
deployedAt:
|
|
1300
|
+
deployedAt: 1784569687492,
|
|
1297
1301
|
size: 4140,
|
|
1298
1302
|
hash: "4c0d65bf1f33cdac22a78fd8c4764319cc3fe00650e0fe7fa8a6090d9a318a7b",
|
|
1299
1303
|
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
@@ -1370,17 +1374,17 @@ var require_pkg_src = __commonJS({
|
|
|
1370
1374
|
}
|
|
1371
1375
|
},
|
|
1372
1376
|
btcWithdrawal: {
|
|
1373
|
-
cid: "
|
|
1377
|
+
cid: "QmexvpfHPacjsVcqNHHLyJhSnnAPLgbWmWd9N3NDLDvYds",
|
|
1374
1378
|
authorizedCidHex: cidToHex(
|
|
1375
|
-
"
|
|
1379
|
+
"QmexvpfHPacjsVcqNHHLyJhSnnAPLgbWmWd9N3NDLDvYds"
|
|
1376
1380
|
),
|
|
1377
1381
|
name: "Btc Withdrawal",
|
|
1378
1382
|
description: "Production Btc Withdrawal",
|
|
1379
|
-
version: "1.2.
|
|
1383
|
+
version: "1.2.3",
|
|
1380
1384
|
deployed: true,
|
|
1381
|
-
deployedAt:
|
|
1382
|
-
size:
|
|
1383
|
-
hash: "
|
|
1385
|
+
deployedAt: 1784585746901,
|
|
1386
|
+
size: 92027,
|
|
1387
|
+
hash: "7b4f4eab1f0c08b8b5b1c9cdb1064dd403ec13f57765919f62dec67fb8ba3c69",
|
|
1384
1388
|
validatorWalletAddress: "0x82DB9F515957aA380B596C6eA2Bd30CEF181f236",
|
|
1385
1389
|
pkp: {
|
|
1386
1390
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -3752,12 +3756,23 @@ ${auth.clientId}`;
|
|
|
3752
3756
|
if (!data.vout || !Array.isArray(data.vout)) {
|
|
3753
3757
|
return null;
|
|
3754
3758
|
}
|
|
3755
|
-
return data.vout.map((output, index) =>
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3759
|
+
return data.vout.map((output, index) => {
|
|
3760
|
+
if (output.value === void 0) {
|
|
3761
|
+
throw new Error(
|
|
3762
|
+
`getTransactionOutputs(${txid}): output ${index} is missing its value \u2014 malformed provider response, refusing to return outputs that cannot be value-verified`
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
assertSaneSatoshis(
|
|
3766
|
+
output.value,
|
|
3767
|
+
`getTransactionOutputs(${txid}) output ${index}`
|
|
3768
|
+
);
|
|
3769
|
+
return {
|
|
3770
|
+
index,
|
|
3771
|
+
scriptpubkey: output.scriptpubkey,
|
|
3772
|
+
scriptpubkey_address: output.scriptpubkey_address,
|
|
3773
|
+
value: output.value
|
|
3774
|
+
};
|
|
3775
|
+
});
|
|
3761
3776
|
} catch (error) {
|
|
3762
3777
|
clearTimeout(timeoutId);
|
|
3763
3778
|
if (isAbortError(error)) {
|
|
@@ -20682,7 +20697,9 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
20682
20697
|
gasUsed: receipt.gasUsed?.toString() || "unknown",
|
|
20683
20698
|
utxoTxid: validationResponse.utxoTxid,
|
|
20684
20699
|
utxoVout: validationResponse.utxoVout,
|
|
20685
|
-
utxoSatoshis: validationResponse.utxoSatoshis
|
|
20700
|
+
utxoSatoshis: validationResponse.utxoSatoshis,
|
|
20701
|
+
// Phase B: full consensus-validated spend set (absent on older actions).
|
|
20702
|
+
confirmedUtxos: validationResponse.confirmedUtxos
|
|
20686
20703
|
};
|
|
20687
20704
|
} catch (error) {
|
|
20688
20705
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
@@ -21365,7 +21382,12 @@ Message: ${causeMessage}${quantumContext}${mintDebtDiagnostics}`
|
|
|
21365
21382
|
log.info("\u{1F50D} Found vault UTXO for execution", { utxoIdentifier });
|
|
21366
21383
|
}
|
|
21367
21384
|
let executionUtxos;
|
|
21368
|
-
const gatheredUtxos =
|
|
21385
|
+
const gatheredUtxos = authResult.confirmedUtxos && authResult.confirmedUtxos.length > 0 ? authResult.confirmedUtxos.map((u) => ({
|
|
21386
|
+
txid: u.txid,
|
|
21387
|
+
vout: Number(u.vout),
|
|
21388
|
+
value: Number(u.value),
|
|
21389
|
+
confirmations: 0
|
|
21390
|
+
})) : await this.fetchConfirmedVaultUtxos(positionId);
|
|
21369
21391
|
if (gatheredUtxos.length > 0) {
|
|
21370
21392
|
const normTxid = (t) => String(t).toLowerCase().replace(/^0x/, "");
|
|
21371
21393
|
const byOutpoint = /* @__PURE__ */ new Map();
|
|
@@ -233,6 +233,16 @@ export interface BTCWithdrawalResult {
|
|
|
233
233
|
utxoVout?: number;
|
|
234
234
|
/** Full satoshi value of the authorized UTXO; needed by Phase 2 broadcast. */
|
|
235
235
|
utxoSatoshis?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Phase B: the FULL consensus-validated confirmed UTXO set the Lit Action
|
|
238
|
+
* spends, so a multi-UTXO consolidation withdrawal can sign the whole set
|
|
239
|
+
* without the temporary /vault-utxos endpoint. Absent on older Lit Actions.
|
|
240
|
+
*/
|
|
241
|
+
confirmedUtxos?: Array<{
|
|
242
|
+
txid: string;
|
|
243
|
+
vout: number;
|
|
244
|
+
value: string;
|
|
245
|
+
}>;
|
|
236
246
|
error?: string;
|
|
237
247
|
}
|
|
238
248
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.305",
|
|
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",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
},
|
|
83
83
|
"sideEffects": false,
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@gvnrdao/dh-lit-actions": "^0.0.
|
|
86
|
-
"@gvnrdao/dh-lit-ops": "^0.0.
|
|
85
|
+
"@gvnrdao/dh-lit-actions": "^0.0.315",
|
|
86
|
+
"@gvnrdao/dh-lit-ops": "^0.0.305",
|
|
87
87
|
"@noble/hashes": "^1.5.0",
|
|
88
88
|
"axios": "^1.17.0",
|
|
89
89
|
"bech32": "^2.0.0",
|