@gvnrdao/dh-sdk 0.0.338 → 0.0.340
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/graphs/diamond-hands.d.ts +14 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1138 -182
- package/dist/index.mjs +1073 -117
- package/dist/interfaces/chunks/loan-operations.i.d.ts +34 -0
- package/dist/modules/diamond-hands-sdk.d.ts +22 -5
- package/dist/modules/loan/loan-query.module.d.ts +12 -1
- package/dist/sign-guard.js +141 -2
- package/dist/sign-guard.mjs +135 -2
- package/dist/utils/address-conversion.utils.d.ts +15 -6
- package/dist/utils/agent-delegation.utils.d.ts +39 -0
- package/dist/utils/assert-provider-chain.d.ts +16 -0
- package/dist/utils/borrower-ucd-debt-summary.d.ts +44 -0
- package/dist/utils/concurrency-limiter.utils.d.ts +59 -0
- package/dist/utils/lit-action-chain-name.d.ts +14 -0
- package/dist/utils/loan-helpers.utils.d.ts +115 -0
- package/dist/utils/sign-guard/errors.d.ts +5 -1
- package/dist/utils/sign-guard/index.d.ts +1 -0
- package/dist/utils/sign-guard/psm-exchange.d.ts +122 -0
- package/package.json +3 -4
|
@@ -3,6 +3,7 @@ import type { LoanData } from "../interfaces";
|
|
|
3
3
|
import type { GraphPositionWithBorrowerDTO } from "../types/graph-dtos";
|
|
4
4
|
import type { LoanEvents, LoanEventsFilter } from "../types/event-types";
|
|
5
5
|
import type { BitcoinOperations, EnrichedBitcoinBalance } from "../modules/bitcoin/bitcoin-operations.module";
|
|
6
|
+
import { type BorrowerDebtRow } from "../utils/borrower-ucd-debt-summary";
|
|
6
7
|
export interface DiamondHandsGraphConfig {
|
|
7
8
|
endpoint: string;
|
|
8
9
|
requestTimeoutMs?: number;
|
|
@@ -321,6 +322,19 @@ export declare class DiamondHandsGraph {
|
|
|
321
322
|
* Get user positions from subgraph
|
|
322
323
|
*/
|
|
323
324
|
private getUserPositionsOnly;
|
|
325
|
+
/**
|
|
326
|
+
* Raw `{ id, status, ucdDebt }` for EVERY position of a borrower: one round trip per
|
|
327
|
+
* 1000 positions, no count walk, no vault RPCs, and no `LoanData` transform (which
|
|
328
|
+
* coerces wei to a float and leaves `status` a string cast to the numeric enum).
|
|
329
|
+
*
|
|
330
|
+
* Deliberately issues the `GetUserPositions` document rather than a leaner one: the
|
|
331
|
+
* lit-ops graph proxy only passes allowlisted documents (graph-document-policy.ts),
|
|
332
|
+
* and that one is already listed, so this needs no server change. The extra fields
|
|
333
|
+
* cost bytes, not round trips.
|
|
334
|
+
*
|
|
335
|
+
* Throws past `BORROWER_DEBT_ROWS_MAX_PAGES` — never a partial set.
|
|
336
|
+
*/
|
|
337
|
+
getBorrowerDebtRows(borrower: string): Promise<BorrowerDebtRow[]>;
|
|
324
338
|
/**
|
|
325
339
|
* Get user positions, plus an accurate total count.
|
|
326
340
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export type { DhServerLoginMessage, DhServerLoginPayload, } from './utils/eip712
|
|
|
41
41
|
export { DEFAULT_LIT_NETWORK, VALID_LIT_NETWORKS, SDK_DEFAULTS, } from './constants/chunks/sdk-config';
|
|
42
42
|
export { ALL_CONTRACTS, ALL_DEPLOYMENTS, getContractsByNetwork, getDeploymentByNetwork, LOCALHOST_CONTRACTS, SEPOLIA_CONTRACTS, } from './constants/chunks/deployment-addresses';
|
|
43
43
|
export type { DeploymentContracts, DeploymentData, DeploymentLatestEnv, } from './constants/chunks/deployment-addresses';
|
|
44
|
-
export type { CreateLoanRequest, CreateLoanResult, LoanData, LoanDataDetail, PaginatedLoansResponse, PKPValidationData, BitcoinAddresses, } from './interfaces/chunks/loan-operations.i';
|
|
44
|
+
export type { CreateLoanRequest, CreateLoanResult, LoanData, LoanDataDetail, PaginatedLoansResponse, BorrowerUcdDebtSummary, BorrowerUcdDebtStatusCount, PKPValidationData, BitcoinAddresses, } from './interfaces/chunks/loan-operations.i';
|
|
45
45
|
export type { DiamondHandsSDKConfig, SDKMode, ContractAddresses, BitcoinProviderConfig, } from './interfaces/chunks/config.i';
|
|
46
46
|
export type { PKPData, PKPCreationRequest, PKPCreationResult, PKPValidationResult, } from './interfaces/chunks/pkp-integration.i';
|
|
47
47
|
export type { AuthorizationRequest, AuthorizationResult, BTCDepositRequest, BTCDepositResult, } from './interfaces/chunks/requests.i';
|