@gvnrdao/dh-sdk 0.0.277 → 0.0.278
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/index.js +92 -82
- package/dist/index.mjs +92 -82
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -31370,17 +31370,17 @@ var require_pkg_src = __commonJS({
|
|
|
31370
31370
|
hash: "d6eb8665fa4f1fe19b6a2bc81fbf729af68a1daf30117f40e37705381978a7ce"
|
|
31371
31371
|
},
|
|
31372
31372
|
pkpValidator: {
|
|
31373
|
-
cid: "
|
|
31373
|
+
cid: "QmRAueBjNG78qA79x4NL4ogfNg7e6j6DiEGenEN4S3BSGg",
|
|
31374
31374
|
authorizedCidHex: cidToHex(
|
|
31375
|
-
"
|
|
31375
|
+
"QmRAueBjNG78qA79x4NL4ogfNg7e6j6DiEGenEN4S3BSGg"
|
|
31376
31376
|
),
|
|
31377
31377
|
name: "Pkp Validator",
|
|
31378
31378
|
description: "Production Pkp Validator",
|
|
31379
31379
|
version: "1.0.0",
|
|
31380
31380
|
deployed: true,
|
|
31381
|
-
deployedAt:
|
|
31382
|
-
size:
|
|
31383
|
-
hash: "
|
|
31381
|
+
deployedAt: 1781116572961,
|
|
31382
|
+
size: 4110,
|
|
31383
|
+
hash: "c3b121afcdc0d7d7ed7ca3be5b185fc502ffad99bf83cdf166769bbfa5194687",
|
|
31384
31384
|
validatorWalletAddress: "0x9ee56687f7a984d5df7ab79330271a619ef56ddd",
|
|
31385
31385
|
pkp: {
|
|
31386
31386
|
publicKey: "0x04ec0e3acc40884e3f366ca469d08899eb640ad5259fa196b0238075086208a9f8732a3175704f35f0bcc28e07406cfb24c254efd1e7355640577330f0d2dd755f",
|
|
@@ -31388,120 +31388,120 @@ var require_pkg_src = __commonJS({
|
|
|
31388
31388
|
}
|
|
31389
31389
|
},
|
|
31390
31390
|
btcTransactionSigner: {
|
|
31391
|
-
cid: "
|
|
31391
|
+
cid: "QmTrtAnUFpAi6tpw74UPCiULqe9Z4SBE4b4neekY8evK5Y",
|
|
31392
31392
|
authorizedCidHex: cidToHex(
|
|
31393
|
-
"
|
|
31393
|
+
"QmTrtAnUFpAi6tpw74UPCiULqe9Z4SBE4b4neekY8evK5Y"
|
|
31394
31394
|
),
|
|
31395
31395
|
name: "Btc Transaction Signer",
|
|
31396
31396
|
description: "Production Btc Transaction Signer",
|
|
31397
31397
|
version: "1.0.0",
|
|
31398
31398
|
deployed: true,
|
|
31399
|
-
deployedAt:
|
|
31400
|
-
size:
|
|
31401
|
-
hash: "
|
|
31399
|
+
deployedAt: 1780976122896,
|
|
31400
|
+
size: 41048,
|
|
31401
|
+
hash: "93725b2020e1914e93f1e21bdcc75d9cb28bc0b6bc4ea9b470f112e1f068998f"
|
|
31402
31402
|
},
|
|
31403
31403
|
ucdMintValidator: {
|
|
31404
|
-
cid: "
|
|
31404
|
+
cid: "QmTWKgfSHfYWTosPJBzu2s4sM2U6qhvmA9pXbkUzDxdQTJ",
|
|
31405
31405
|
authorizedCidHex: cidToHex(
|
|
31406
|
-
"
|
|
31406
|
+
"QmTWKgfSHfYWTosPJBzu2s4sM2U6qhvmA9pXbkUzDxdQTJ"
|
|
31407
31407
|
),
|
|
31408
31408
|
name: "Ucd Mint Validator",
|
|
31409
31409
|
description: "Production Ucd Mint Validator",
|
|
31410
31410
|
version: "1.0.0",
|
|
31411
31411
|
deployed: true,
|
|
31412
|
-
deployedAt:
|
|
31413
|
-
size:
|
|
31414
|
-
hash: "
|
|
31415
|
-
validatorWalletAddress: "
|
|
31412
|
+
deployedAt: 1781116591564,
|
|
31413
|
+
size: 68521,
|
|
31414
|
+
hash: "5a955863b32c003314ab29c37b157e06d00a2f93c2d9085a02ca73b71838a72f",
|
|
31415
|
+
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
31416
31416
|
pkp: {
|
|
31417
31417
|
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
31418
|
-
ethAddress: "
|
|
31418
|
+
ethAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236"
|
|
31419
31419
|
}
|
|
31420
31420
|
},
|
|
31421
31421
|
processPaymentValidator: {
|
|
31422
|
-
cid: "
|
|
31422
|
+
cid: "QmVJ9UaUz8vfvHCEwVY584e9RTEcqy3f3T89UNtzzFSdcz",
|
|
31423
31423
|
authorizedCidHex: cidToHex(
|
|
31424
|
-
"
|
|
31424
|
+
"QmVJ9UaUz8vfvHCEwVY584e9RTEcqy3f3T89UNtzzFSdcz"
|
|
31425
31425
|
),
|
|
31426
31426
|
name: "Process Payment Validator",
|
|
31427
31427
|
description: "Production Process Payment Validator",
|
|
31428
31428
|
version: "1.0.0",
|
|
31429
31429
|
deployed: true,
|
|
31430
|
-
deployedAt:
|
|
31431
|
-
size:
|
|
31432
|
-
hash: "
|
|
31433
|
-
validatorWalletAddress: "
|
|
31430
|
+
deployedAt: 1780976120346,
|
|
31431
|
+
size: 64473,
|
|
31432
|
+
hash: "8cf2ea8e2bf39ab02c6ac1706d8bec2aa16aa1f04f4789b11fa8215e04ac2d7e",
|
|
31433
|
+
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
31434
31434
|
pkp: {
|
|
31435
31435
|
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
31436
|
-
ethAddress: "
|
|
31436
|
+
ethAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236"
|
|
31437
31437
|
}
|
|
31438
31438
|
},
|
|
31439
31439
|
extendPositionValidator: {
|
|
31440
|
-
cid: "
|
|
31440
|
+
cid: "QmW2zjWbsVzm8q4oMEHZ1SCeijygZFMvvi9zHqUQWm3jut",
|
|
31441
31441
|
authorizedCidHex: cidToHex(
|
|
31442
|
-
"
|
|
31442
|
+
"QmW2zjWbsVzm8q4oMEHZ1SCeijygZFMvvi9zHqUQWm3jut"
|
|
31443
31443
|
),
|
|
31444
31444
|
name: "Extend Position Validator",
|
|
31445
31445
|
description: "Production Extend Position Validator",
|
|
31446
31446
|
version: "1.0.1",
|
|
31447
31447
|
deployed: true,
|
|
31448
|
-
deployedAt:
|
|
31449
|
-
size:
|
|
31450
|
-
hash: "
|
|
31451
|
-
validatorWalletAddress: "
|
|
31448
|
+
deployedAt: 1781116610064,
|
|
31449
|
+
size: 63508,
|
|
31450
|
+
hash: "187c71046858bde0753fe479634bd2901e3d7f3689b5f39a82b3c5fa3a47b53d",
|
|
31451
|
+
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
31452
31452
|
pkp: {
|
|
31453
31453
|
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
31454
|
-
ethAddress: "
|
|
31454
|
+
ethAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236"
|
|
31455
31455
|
}
|
|
31456
31456
|
},
|
|
31457
31457
|
btcWithdrawal: {
|
|
31458
|
-
cid: "
|
|
31458
|
+
cid: "QmcxHLCcXpx5Jstd1hQmwjU2KPDzP2KYEdMgbZVn84nY6n",
|
|
31459
31459
|
authorizedCidHex: cidToHex(
|
|
31460
|
-
"
|
|
31460
|
+
"QmcxHLCcXpx5Jstd1hQmwjU2KPDzP2KYEdMgbZVn84nY6n"
|
|
31461
31461
|
),
|
|
31462
31462
|
name: "Btc Withdrawal",
|
|
31463
31463
|
description: "Production Btc Withdrawal",
|
|
31464
31464
|
version: "1.0.0",
|
|
31465
31465
|
deployed: true,
|
|
31466
|
-
deployedAt:
|
|
31467
|
-
size:
|
|
31468
|
-
hash: "
|
|
31469
|
-
validatorWalletAddress: "
|
|
31466
|
+
deployedAt: 1781116627244,
|
|
31467
|
+
size: 76218,
|
|
31468
|
+
hash: "1e686e517ab1b8163904a27d3e1962cecb2f49b3cc7ecdc8f2ff5e5847fe3762",
|
|
31469
|
+
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
31470
31470
|
pkp: {
|
|
31471
31471
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
31472
|
-
ethAddress: "
|
|
31472
|
+
ethAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236"
|
|
31473
31473
|
}
|
|
31474
31474
|
},
|
|
31475
31475
|
liquidationValidator: {
|
|
31476
|
-
cid: "
|
|
31476
|
+
cid: "QmZv8cRhvQqEGscWufU4rYPrKNt3ruAhQWK2ei3ohJBiZA",
|
|
31477
31477
|
authorizedCidHex: cidToHex(
|
|
31478
|
-
"
|
|
31478
|
+
"QmZv8cRhvQqEGscWufU4rYPrKNt3ruAhQWK2ei3ohJBiZA"
|
|
31479
31479
|
),
|
|
31480
31480
|
name: "Liquidation Validator",
|
|
31481
31481
|
description: "Production Liquidation Validator",
|
|
31482
31482
|
version: "1.0.0",
|
|
31483
31483
|
deployed: true,
|
|
31484
|
-
deployedAt:
|
|
31485
|
-
size:
|
|
31486
|
-
hash: "
|
|
31487
|
-
validatorWalletAddress: "
|
|
31484
|
+
deployedAt: 1781116646357,
|
|
31485
|
+
size: 54901,
|
|
31486
|
+
hash: "017ec04899089b98991a5aab6eeae5e3214c2cc9de7ef9b3fc0cd5ad85c3556c",
|
|
31487
|
+
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
31488
31488
|
pkp: {
|
|
31489
31489
|
publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
|
|
31490
|
-
ethAddress: "
|
|
31490
|
+
ethAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236"
|
|
31491
31491
|
}
|
|
31492
31492
|
},
|
|
31493
31493
|
priceOracle: {
|
|
31494
|
-
cid: "
|
|
31494
|
+
cid: "QmZwH2JzXpLPdtUiM52PLyfuCGphz82CCs54Y6fCbzxpri",
|
|
31495
31495
|
authorizedCidHex: cidToHex(
|
|
31496
|
-
"
|
|
31496
|
+
"QmZwH2JzXpLPdtUiM52PLyfuCGphz82CCs54Y6fCbzxpri"
|
|
31497
31497
|
),
|
|
31498
31498
|
name: "Price Oracle",
|
|
31499
31499
|
description: "Production Price Oracle (Chipotle main+getPrivateKey)",
|
|
31500
31500
|
version: "1.1.0",
|
|
31501
31501
|
deployed: true,
|
|
31502
|
-
deployedAt:
|
|
31503
|
-
size:
|
|
31504
|
-
hash: "
|
|
31502
|
+
deployedAt: 1781116663270,
|
|
31503
|
+
size: 8695,
|
|
31504
|
+
hash: "ba20ade60a7fa5acd80dadfafa179c507388cfe6ce48a22a672d70b317ffcc74",
|
|
31505
31505
|
validatorWalletAddress: "0x831ddf3048547b983efe3ccbbb35a45a53191651",
|
|
31506
31506
|
pkp: {
|
|
31507
31507
|
publicKey: "0x043beaa1da47875601a8d6f430b1438ee2d4732eefd06e5c63a474bbdaf9e7df1797b1b951e041b627c2bf839788164825324c9cbd1e2d6f740fdd4bff69b1900b",
|
|
@@ -31509,21 +31509,21 @@ var require_pkg_src = __commonJS({
|
|
|
31509
31509
|
}
|
|
31510
31510
|
},
|
|
31511
31511
|
loanVaultBtcBalance: {
|
|
31512
|
-
cid: "
|
|
31512
|
+
cid: "Qmd7ZAWQzxjbFXjk39HuyRCN18FDG1LDifXceaikNFYRbm",
|
|
31513
31513
|
authorizedCidHex: cidToHex(
|
|
31514
|
-
"
|
|
31514
|
+
"Qmd7ZAWQzxjbFXjk39HuyRCN18FDG1LDifXceaikNFYRbm"
|
|
31515
31515
|
),
|
|
31516
31516
|
name: "Loan Vault Btc Balance",
|
|
31517
31517
|
description: "Production Loan Vault Btc Balance",
|
|
31518
31518
|
version: "1.0.0",
|
|
31519
31519
|
deployed: true,
|
|
31520
|
-
deployedAt:
|
|
31521
|
-
size:
|
|
31522
|
-
hash: "
|
|
31523
|
-
validatorWalletAddress: "
|
|
31520
|
+
deployedAt: 1780976125009,
|
|
31521
|
+
size: 44634,
|
|
31522
|
+
hash: "f7ba0f8778a15f349122237c44391800bb082d2090a87cc1631f0a764439d029",
|
|
31523
|
+
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
31524
31524
|
pkp: {
|
|
31525
31525
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
31526
|
-
ethAddress: "
|
|
31526
|
+
ethAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236"
|
|
31527
31527
|
}
|
|
31528
31528
|
},
|
|
31529
31529
|
// btc-address-balance (Option B) — address-only signed total balance via
|
|
@@ -31533,17 +31533,17 @@ var require_pkg_src = __commonJS({
|
|
|
31533
31533
|
// Requires BitcoinProviderRegistry.addAllowedCid(chainId, keccak256(utf8(cid)))
|
|
31534
31534
|
// on each target chain (the action decrypts registry slots). No OAR entry.
|
|
31535
31535
|
btcAddressBalance: {
|
|
31536
|
-
cid: "
|
|
31536
|
+
cid: "QmVmF9CHFDhhV51bNX87tVyd95oQS56u78ThFYKzMwEbFS",
|
|
31537
31537
|
authorizedCidHex: cidToHex(
|
|
31538
|
-
"
|
|
31538
|
+
"QmVmF9CHFDhhV51bNX87tVyd95oQS56u78ThFYKzMwEbFS"
|
|
31539
31539
|
),
|
|
31540
31540
|
name: "Btc Address Balance",
|
|
31541
31541
|
description: "Address-only signed total BTC balance via registry consensus (no positionId, no price)",
|
|
31542
31542
|
version: "0.1.0",
|
|
31543
31543
|
deployed: true,
|
|
31544
|
-
deployedAt:
|
|
31545
|
-
size:
|
|
31546
|
-
hash: "
|
|
31544
|
+
deployedAt: 1781116681558,
|
|
31545
|
+
size: 21957,
|
|
31546
|
+
hash: "b17977304be6b117bcb29feafc3bb654113d72d5147ceeba92e91b4d7f5c0327",
|
|
31547
31547
|
validatorWalletAddress: "0xf0bf5e3f864b87283a05d1e4a85ee0fa40493fb5",
|
|
31548
31548
|
pkp: {
|
|
31549
31549
|
publicKey: "0x0498cbb31facfa26e3ec83ccdabfe4fe341ca0282e0c3cb81da7113723b9726e1e49efa92165cc3faa66ced4454cea56dbab12267852d6525a55d7c4f128b912cd",
|
|
@@ -31577,17 +31577,17 @@ var require_pkg_src = __commonJS({
|
|
|
31577
31577
|
hash: "03ee5be239c91c735d2c95db89a0d1b77e602cfc18af8eb64b3281fddcd90a72"
|
|
31578
31578
|
},
|
|
31579
31579
|
staleSpendRecoveryValidator: {
|
|
31580
|
-
cid: "
|
|
31580
|
+
cid: "QmRZuRrxzsbp3WejuMfJJgws1iteRk87p1nGna82Cgun2k",
|
|
31581
31581
|
authorizedCidHex: cidToHex(
|
|
31582
|
-
"
|
|
31582
|
+
"QmRZuRrxzsbp3WejuMfJJgws1iteRk87p1nGna82Cgun2k"
|
|
31583
31583
|
),
|
|
31584
31584
|
name: "Stale Spend Recovery Validator",
|
|
31585
31585
|
description: "Production Stale Spend Recovery Validator",
|
|
31586
31586
|
version: "1.0.0",
|
|
31587
31587
|
deployed: true,
|
|
31588
|
-
deployedAt:
|
|
31589
|
-
size:
|
|
31590
|
-
hash: "
|
|
31588
|
+
deployedAt: 1781116700324,
|
|
31589
|
+
size: 31148,
|
|
31590
|
+
hash: "c93591c7c7f51b519243499d78bd5ac0df1e368caa76c08d6a5d7aea9e3a49cc",
|
|
31591
31591
|
validatorWalletAddress: "0xa804bbb01d26f250fb3c53007fd32337b985602b",
|
|
31592
31592
|
pkp: {
|
|
31593
31593
|
publicKey: "0x046da0ad6da7dd4a0063cbeac6f2bdb6a9889c2178b23470833356a8ee5630f7f0eee0db348d9d9aaaadd23eccf0063c8f68ee5e446abe30b882bf1de4c932bc21",
|
|
@@ -33871,6 +33871,10 @@ ${errorReport}`);
|
|
|
33871
33871
|
static {
|
|
33872
33872
|
this.REQUIRED_PROVIDER_COUNT = 3;
|
|
33873
33873
|
}
|
|
33874
|
+
/** Distinct providers required for the active mode: 1 in hardhat dev, else 3. */
|
|
33875
|
+
requiredCount() {
|
|
33876
|
+
return this.devSingleProvider ? 1 : _PriceOracleModule.REQUIRED_PROVIDER_COUNT;
|
|
33877
|
+
}
|
|
33874
33878
|
/**
|
|
33875
33879
|
* @param priceProvidersOrConfig - REQUIRED in production flows. An array of
|
|
33876
33880
|
* exactly 3 `{name, apiKey}` entries, one per locked provider. Every entry
|
|
@@ -33882,7 +33886,8 @@ ${errorReport}`);
|
|
|
33882
33886
|
* The strict count is still enforced (exactly 3).
|
|
33883
33887
|
* @param _mode - Ignored. Retained for backward-compatible call sites.
|
|
33884
33888
|
*/
|
|
33885
|
-
constructor(priceProvidersOrConfig, legacySources, _mode) {
|
|
33889
|
+
constructor(priceProvidersOrConfig, legacySources, _mode, opts) {
|
|
33890
|
+
this.devSingleProvider = opts?.devSingleProvider === true;
|
|
33886
33891
|
if (legacySources && Array.isArray(legacySources)) {
|
|
33887
33892
|
this.sources = legacySources;
|
|
33888
33893
|
} else {
|
|
@@ -33901,9 +33906,9 @@ ${errorReport}`);
|
|
|
33901
33906
|
* path flagged as H-2 in the audit. There is no "≥3" or "3 of N" mode.
|
|
33902
33907
|
*/
|
|
33903
33908
|
validateProviderCount() {
|
|
33904
|
-
if (this.sources.length !==
|
|
33909
|
+
if (this.sources.length !== this.requiredCount()) {
|
|
33905
33910
|
throw new Error(
|
|
33906
|
-
`Price oracle requires exactly ${
|
|
33911
|
+
`Price oracle requires exactly ${this.requiredCount()} provider(s). Currently configured: ${this.sources.length} provider(s). ` + (this.devSingleProvider ? "(hardhat dev single-provider mode)" : `Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`)
|
|
33907
33912
|
);
|
|
33908
33913
|
}
|
|
33909
33914
|
}
|
|
@@ -33919,9 +33924,9 @@ ${errorReport}`);
|
|
|
33919
33924
|
* Throws as soon as any rule is violated.
|
|
33920
33925
|
*/
|
|
33921
33926
|
buildSources(priceProviders) {
|
|
33922
|
-
if (priceProviders.length !==
|
|
33927
|
+
if (priceProviders.length !== this.requiredCount()) {
|
|
33923
33928
|
throw new Error(
|
|
33924
|
-
`priceProviders must contain exactly ${
|
|
33929
|
+
`priceProviders must contain exactly ${this.requiredCount()} entr${this.requiredCount() === 1 ? "y" : "ies"}. Received: ${priceProviders.length}. ` + (this.devSingleProvider ? "(hardhat dev single-provider mode)" : `Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`)
|
|
33925
33930
|
);
|
|
33926
33931
|
}
|
|
33927
33932
|
const sources = [];
|
|
@@ -34117,9 +34122,9 @@ ${errorReport}`);
|
|
|
34117
34122
|
*/
|
|
34118
34123
|
async getBTCPrice() {
|
|
34119
34124
|
const startTime = Date.now();
|
|
34120
|
-
if (this.sources.length !==
|
|
34125
|
+
if (this.sources.length !== this.requiredCount()) {
|
|
34121
34126
|
throw new Error(
|
|
34122
|
-
`Price oracle requires exactly ${
|
|
34127
|
+
`Price oracle requires exactly ${this.requiredCount()} provider(s). Currently configured: ${this.sources.length}`
|
|
34123
34128
|
);
|
|
34124
34129
|
}
|
|
34125
34130
|
const GLOBAL_TIMEOUT_MS = 8e3;
|
|
@@ -34148,14 +34153,19 @@ ${errorReport}`);
|
|
|
34148
34153
|
);
|
|
34149
34154
|
const prices = await Promise.race([fetchAll, timeoutPromise]);
|
|
34150
34155
|
const sorted = [...prices].sort((a, b2) => a - b2);
|
|
34151
|
-
|
|
34152
|
-
|
|
34153
|
-
|
|
34154
|
-
|
|
34155
|
-
|
|
34156
|
-
|
|
34157
|
-
|
|
34158
|
-
|
|
34156
|
+
let median;
|
|
34157
|
+
if (this.devSingleProvider) {
|
|
34158
|
+
median = sorted[0];
|
|
34159
|
+
} else {
|
|
34160
|
+
median = sorted[1];
|
|
34161
|
+
const spread = (sorted[2] - sorted[0]) / sorted[0];
|
|
34162
|
+
if (spread > PRICE_ORACLE_TOLERANCE) {
|
|
34163
|
+
const names2 = this.sources.map((s) => s.name).join(", ");
|
|
34164
|
+
const formatted = sorted.map((p) => `$${p.toLocaleString()}`).join(", ");
|
|
34165
|
+
throw new Error(
|
|
34166
|
+
`Price consensus failed: prices not within ${PRICE_ORACLE_TOLERANCE * 100}% tolerance. Providers: [${names2}]. Prices: [${formatted}]`
|
|
34167
|
+
);
|
|
34168
|
+
}
|
|
34159
34169
|
}
|
|
34160
34170
|
const priceCents = Math.round(median * 100);
|
|
34161
34171
|
const priceWith8Decimals = BigInt(priceCents) * 1000000n;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.278",
|
|
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",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
},
|
|
82
82
|
"sideEffects": false,
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@gvnrdao/dh-lit-actions": "^0.0.
|
|
85
|
-
"@gvnrdao/dh-lit-ops": "^0.0.
|
|
84
|
+
"@gvnrdao/dh-lit-actions": "^0.0.308",
|
|
85
|
+
"@gvnrdao/dh-lit-ops": "^0.0.296",
|
|
86
86
|
"@noble/hashes": "^1.5.0",
|
|
87
87
|
"axios": "^1.17.0",
|
|
88
88
|
"bech32": "^2.0.0",
|