@gvnrdao/dh-sdk 0.0.270 → 0.0.271

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.
@@ -40,7 +40,8 @@ export interface BitcoinOperationsConfig {
40
40
  signer?: any;
41
41
  /** Optional PKP Ethereum address for signed price oracle (Lit jsParams pkpId) */
42
42
  priceOraclePkpId?: string;
43
- /** Price feed API credentials passed to the price-oracle Lit Action (needs 3 sources for getBTCPrice) */
43
+ /** Price feed API credentials passed to the price-oracle Lit Action. Must be exactly
44
+ * 3 entries from the locked set: cryptocompare, coinmarketcap, coingecko. */
44
45
  priceProviders?: PriceProviderConfig[];
45
46
  /** Enable debug logging */
46
47
  debug?: boolean;
@@ -235,16 +236,17 @@ export declare class BitcoinOperations {
235
236
  confirmed?: boolean;
236
237
  }>;
237
238
  /**
238
- * Get current BTC price using LIT Protocol price oracle
239
+ * Get current BTC price using LIT Protocol price oracle.
239
240
  *
240
- * Queries the decentralized price oracle via LIT Actions.
241
- * Supports fast mode (single source) and full mode (consensus).
241
+ * Strict 3-of-3: all three configured providers must respond within 1% of
242
+ * each other, and the median is returned. The previous `mode: "fast" | "full"`
243
+ * parameter (with single-source and lenient-consensus variants) was removed
244
+ * in the H-2 audit fix — there is only one strict path now.
242
245
  *
243
- * @param mode - Price fetch mode: "fast" (single source) or "full" (consensus)
244
246
  * @param sign - Whether to request PKP signature on the price
245
247
  * @returns BTC price result with timestamp and source
246
248
  */
247
- getPrice(mode?: "fast" | "full", sign?: boolean): Promise<Result<BTCPriceResult, SDKError>>;
249
+ getPrice(sign?: boolean): Promise<Result<BTCPriceResult, SDKError>>;
248
250
  }
249
251
  /**
250
252
  * Factory function to create a BitcoinOperations instance
package/dist/server.js CHANGED
@@ -254,7 +254,7 @@ function loadEncryptedProviderRegistry(registryPath = DEFAULT_REGISTRY_PATH) {
254
254
  const raw = fs.readFileSync(registryPath, "utf8");
255
255
  return parseRegistry(raw, registryPath);
256
256
  }
257
- function getEncryptedPriceProviders(providerNames = ["coinbase", "coinmarketcap", "binance"], registryPath = DEFAULT_REGISTRY_PATH) {
257
+ function getEncryptedPriceProviders(providerNames = ["cryptocompare", "coinmarketcap", "coingecko"], registryPath = DEFAULT_REGISTRY_PATH) {
258
258
  const registry = loadEncryptedProviderRegistry(registryPath);
259
259
  const desiredNames = providerNames.map((name) => name.trim().toLowerCase());
260
260
  const selected = desiredNames.map((name) => {
package/dist/server.mjs CHANGED
@@ -212,7 +212,7 @@ function loadEncryptedProviderRegistry(registryPath = DEFAULT_REGISTRY_PATH) {
212
212
  const raw = fs.readFileSync(registryPath, "utf8");
213
213
  return parseRegistry(raw, registryPath);
214
214
  }
215
- function getEncryptedPriceProviders(providerNames = ["coinbase", "coinmarketcap", "binance"], registryPath = DEFAULT_REGISTRY_PATH) {
215
+ function getEncryptedPriceProviders(providerNames = ["cryptocompare", "coinmarketcap", "coingecko"], registryPath = DEFAULT_REGISTRY_PATH) {
216
216
  const registry = loadEncryptedProviderRegistry(registryPath);
217
217
  const desiredNames = providerNames.map((name) => name.trim().toLowerCase());
218
218
  const selected = desiredNames.map((name) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gvnrdao/dh-sdk",
3
- "version": "0.0.270",
3
+ "version": "0.0.271",
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.303",
85
- "@gvnrdao/dh-lit-ops": "^0.0.290",
84
+ "@gvnrdao/dh-lit-actions": "^0.0.304",
85
+ "@gvnrdao/dh-lit-ops": "^0.0.291",
86
86
  "@noble/hashes": "^1.5.0",
87
87
  "axios": "^1.15.2",
88
88
  "bech32": "^2.0.0",