@gvnrdao/dh-sdk 0.0.209 → 0.0.211

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.
@@ -184,11 +184,11 @@ export declare class BitcoinOperations {
184
184
  /**
185
185
  * Get balance cache statistics
186
186
  */
187
- getBalanceCacheStats(): import("../..").CacheStats | null;
187
+ getBalanceCacheStats(): import("../cache/cache-manager.module").CacheStats | null;
188
188
  /**
189
189
  * Get address cache statistics
190
190
  */
191
- getAddressCacheStats(): import("../..").CacheStats | null;
191
+ getAddressCacheStats(): import("../cache/cache-manager.module").CacheStats | null;
192
192
  /**
193
193
  * Get current network configuration
194
194
  */
@@ -428,7 +428,7 @@ export declare class DiamondHandsSDK {
428
428
  getLoansByBorrower(borrower: string, pagination?: {
429
429
  page: number;
430
430
  pageSize: number;
431
- }): Promise<Result<import("..").PaginatedLoansResponse, SDKError>>;
431
+ }): Promise<Result<import("../interfaces/chunks/loan-operations.i").PaginatedLoansResponse, SDKError>>;
432
432
  /**
433
433
  * Get all active loans
434
434
  *
@@ -438,7 +438,7 @@ export declare class DiamondHandsSDK {
438
438
  getActiveLoans(pagination?: {
439
439
  page: number;
440
440
  pageSize: number;
441
- }): Promise<Result<import("..").PaginatedLoansResponse, SDKError>>;
441
+ }): Promise<Result<import("../interfaces/chunks/loan-operations.i").PaginatedLoansResponse, SDKError>>;
442
442
  /**
443
443
  * Get loans by state/status
444
444
  *
@@ -449,7 +449,7 @@ export declare class DiamondHandsSDK {
449
449
  getLoansByState(state: string, pagination?: {
450
450
  page: number;
451
451
  pageSize: number;
452
- }): Promise<Result<import("..").PaginatedLoansResponse, SDKError>>;
452
+ }): Promise<Result<import("../interfaces/chunks/loan-operations.i").PaginatedLoansResponse, SDKError>>;
453
453
  /**
454
454
  * Get all loans with pagination
455
455
  *
@@ -463,11 +463,11 @@ export declare class DiamondHandsSDK {
463
463
  maxRows?: number;
464
464
  orderBy?: "createdAt" | "lastUpdatedAt" | "ucdDebt";
465
465
  orderDirection?: "asc" | "desc";
466
- }, source?: "subgraph" | "contract"): Promise<Result<import("..").PaginatedLoansResponse, SDKError>>;
466
+ }, source?: "subgraph" | "contract"): Promise<Result<import("../interfaces/chunks/loan-operations.i").PaginatedLoansResponse, SDKError>>;
467
467
  /**
468
468
  * Get all events for a loan position from the subgraph
469
469
  */
470
- getLoanEvents(positionId: string, filter?: import("../types/event-types").LoanEventsFilter): Promise<Result<import("..").LoanEvents, SDKError>>;
470
+ getLoanEvents(positionId: string, filter?: import("../types/event-types").LoanEventsFilter): Promise<Result<import("../types/event-types").LoanEvents, SDKError>>;
471
471
  /**
472
472
  * Wait for the subgraph to index up to (and including) the given block number.
473
473
  * Call after on-chain actions (createLoan, mintUCD, etc.) before querying the subgraph.
@@ -482,7 +482,7 @@ export declare class DiamondHandsSDK {
482
482
  * @param address - Bitcoin address
483
483
  * @returns Balance in satoshis
484
484
  */
485
- getBitcoinBalance(address: string): Promise<Result<import("..").EnrichedBitcoinBalance, SDKError>>;
485
+ getBitcoinBalance(address: string): Promise<Result<import("./bitcoin/bitcoin-operations.module").EnrichedBitcoinBalance, SDKError>>;
486
486
  /**
487
487
  * Get the current Bitcoin price
488
488
  *
@@ -502,7 +502,7 @@ export declare class DiamondHandsSDK {
502
502
  * @param publicKey - PKP public key
503
503
  * @returns Bitcoin addresses for all networks
504
504
  */
505
- deriveBitcoinAddresses(publicKey: string): Promise<Result<import("..").BitcoinAddresses, SDKError>>;
505
+ deriveBitcoinAddresses(publicKey: string): Promise<Result<import("../interfaces/chunks/loan-operations.i").BitcoinAddresses, SDKError>>;
506
506
  /**
507
507
  * Get PKP data by token ID
508
508
  *
@@ -543,7 +543,7 @@ export declare class DiamondHandsSDK {
543
543
  * @param recipient - Recipient address
544
544
  * @returns Transaction result
545
545
  */
546
- mintMockBTC(amount: Satoshis, recipient: string): Promise<Result<import("..").MockTokenTransactionResult, SDKError>>;
546
+ mintMockBTC(amount: Satoshis, recipient: string): Promise<Result<import("./mock/mock-token-manager.module").MockTokenTransactionResult, SDKError>>;
547
547
  /**
548
548
  * Approve mock BTC spending (test networks only)
549
549
  *
@@ -551,7 +551,7 @@ export declare class DiamondHandsSDK {
551
551
  * @param amount - Amount in satoshis
552
552
  * @returns Transaction result
553
553
  */
554
- approveMockBTC(spender: string, amount: Satoshis): Promise<Result<import("..").MockTokenTransactionResult, SDKError>>;
554
+ approveMockBTC(spender: string, amount: Satoshis): Promise<Result<import("./mock/mock-token-manager.module").MockTokenTransactionResult, SDKError>>;
555
555
  /**
556
556
  * Get SDK configuration
557
557
  */
@@ -563,7 +563,7 @@ export declare class DiamondHandsSDK {
563
563
  /**
564
564
  * Get cache statistics
565
565
  */
566
- getCacheStats(): Record<string, import("..").CacheStats>;
566
+ getCacheStats(): Record<string, import("./cache/cache-manager.module").CacheStats>;
567
567
  /**
568
568
  * Get contract manager (for advanced usage)
569
569
  */
@@ -196,7 +196,7 @@ export declare class LoanQuery {
196
196
  /**
197
197
  * Get cache statistics
198
198
  */
199
- getCacheStats(): import("../..").CacheStats | null;
199
+ getCacheStats(): import("../cache/cache-manager.module").CacheStats | null;
200
200
  }
201
201
  /**
202
202
  * Factory function to create a LoanQuery instance
@@ -124,7 +124,7 @@ export declare class PKPManager {
124
124
  /**
125
125
  * Get cache statistics
126
126
  */
127
- getCacheStats(): import("../..").CacheStats | null;
127
+ getCacheStats(): import("../cache/cache-manager.module").CacheStats | null;
128
128
  }
129
129
  /**
130
130
  * Factory function to create a PKPManager instance
@@ -121,6 +121,52 @@ export interface UCDMintEvent {
121
121
  /** Transaction hash */
122
122
  transactionHash: string;
123
123
  }
124
+ /**
125
+ * BTC withdrawal event - tracks collateral withdrawals
126
+ */
127
+ export interface WithdrawalEvent {
128
+ /** Unique event ID (transaction hash + log index) */
129
+ id: string;
130
+ /** Position ID */
131
+ positionId: string;
132
+ /** Amount withdrawn in satoshis */
133
+ withdrawalAmount: string;
134
+ /** Bitcoin destination address */
135
+ withdrawalAddress: string;
136
+ /** Network fee deducted (satoshis, optional) */
137
+ networkFee?: string;
138
+ /** Block timestamp */
139
+ timestamp: string;
140
+ /** Block number */
141
+ blockNumber: string;
142
+ /** Transaction hash */
143
+ transactionHash: string;
144
+ /** Log index in the transaction */
145
+ logIndex: string;
146
+ }
147
+ /**
148
+ * Position renewal/extension event
149
+ */
150
+ export interface RenewalEvent {
151
+ /** Unique event ID (transaction hash + log index) */
152
+ id: string;
153
+ /** Position ID */
154
+ positionId: string;
155
+ /** Additional term in months */
156
+ extensionTerm: string;
157
+ /** Extension fee paid (UCD wei) */
158
+ extensionFee: string;
159
+ /** New expiry timestamp after extension */
160
+ newExpiryDate: string;
161
+ /** Block timestamp */
162
+ timestamp: string;
163
+ /** Block number */
164
+ blockNumber: string;
165
+ /** Transaction hash */
166
+ transactionHash: string;
167
+ /** Log index in the transaction */
168
+ logIndex: string;
169
+ }
124
170
  /**
125
171
  * Community fee distribution event
126
172
  */
@@ -156,6 +202,10 @@ export interface LoanEvents {
156
202
  liquidation?: LiquidationEvent;
157
203
  /** All UCD mint events */
158
204
  mints: UCDMintEvent[];
205
+ /** All BTC withdrawal events */
206
+ withdrawals: WithdrawalEvent[];
207
+ /** All position renewal/extension events */
208
+ renewals: RenewalEvent[];
159
209
  /** All community fee distribution events */
160
210
  feeDistributions: FeeDistributionEvent[];
161
211
  /** Total number of events */
@@ -166,7 +216,7 @@ export interface LoanEvents {
166
216
  */
167
217
  export interface LoanEventsFilter {
168
218
  /** Filter by event types */
169
- eventTypes?: Array<'payment' | 'status' | 'liquidation' | 'mint' | 'fee'>;
219
+ eventTypes?: Array<'payment' | 'status' | 'liquidation' | 'mint' | 'withdrawal' | 'renewal'>;
170
220
  /** Filter by minimum timestamp */
171
221
  fromTimestamp?: string;
172
222
  /** Filter by maximum timestamp */
@@ -229,7 +279,9 @@ export declare const EventHelpers: {
229
279
  eventType: "liquidation";
230
280
  }) | (UCDMintEvent & {
231
281
  eventType: "mint";
232
- }) | (FeeDistributionEvent & {
233
- eventType: "fee";
282
+ }) | (WithdrawalEvent & {
283
+ eventType: "withdrawal";
284
+ }) | (RenewalEvent & {
285
+ eventType: "renewal";
234
286
  })>;
235
287
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gvnrdao/dh-sdk",
3
- "version": "0.0.209",
3
+ "version": "0.0.211",
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/sdk/src/index.d.ts",
@@ -8,6 +8,7 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/sdk/src/index.d.ts",
11
+ "browser": "./dist/index.mjs",
11
12
  "import": "./dist/index.mjs",
12
13
  "require": "./dist/index.js"
13
14
  },
@@ -69,8 +70,8 @@
69
70
  },
70
71
  "sideEffects": false,
71
72
  "dependencies": {
72
- "@gvnrdao/dh-lit-actions": "0.0.281",
73
- "@gvnrdao/dh-lit-ops": "0.0.253",
73
+ "@gvnrdao/dh-lit-actions": "^0.0.281",
74
+ "@gvnrdao/dh-lit-ops": "^0.0.253",
74
75
  "@noble/hashes": "^1.5.0",
75
76
  "axios": "^1.15.2",
76
77
  "bech32": "^2.0.0",