@gvnrdao/dh-sdk 0.0.251 → 0.0.252
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/dist/deployments.js +417 -0
- package/dist/deployments.mjs +383 -0
- package/dist/index.js +412 -397
- package/dist/index.mjs +412 -397
- package/dist/modules/contract/contract-manager.module.d.ts +10 -0
- package/dist/modules/loan/loan-creator.module.d.ts +0 -11
- package/dist/modules/pkp/pkp-manager.module.d.ts +1 -1
- package/dist/utils/mint-authorization.utils.d.ts +3 -3
- package/package.json +6 -1
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { type Provider, type Signer } from "ethers";
|
|
14
14
|
import type { ContractAddresses } from "../../interfaces/chunks/config.i";
|
|
15
|
+
import { type DeploymentContracts } from "../../constants/chunks/deployment-addresses";
|
|
15
16
|
import { Result } from "../../types/result";
|
|
16
17
|
import { SDKError } from "../../utils/error-handler";
|
|
17
18
|
import type { PositionManager, ILoanOperationsManager, IUCDController, IPriceFeedConsumer, ITermManager, CircuitBreakerModule, ILiquidationManager } from "../../interfaces/chunks/contract-types.i";
|
|
@@ -41,6 +42,8 @@ export interface ContractManagerConfig {
|
|
|
41
42
|
mode?: "service" | "standalone";
|
|
42
43
|
/** Enable debug logging */
|
|
43
44
|
debug?: boolean;
|
|
45
|
+
/** Network name (e.g. "sepolia", "localhost") for deployment address lookup */
|
|
46
|
+
networkName?: string;
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* Managed contract instances with proper typing
|
|
@@ -121,6 +124,13 @@ export declare class ContractManager {
|
|
|
121
124
|
* Get contract addresses
|
|
122
125
|
*/
|
|
123
126
|
getContractAddresses(): ContractAddresses;
|
|
127
|
+
/**
|
|
128
|
+
* Get the full deployment map for the configured network.
|
|
129
|
+
* Returns all deployed contracts (including admin-surface ones not needed at runtime),
|
|
130
|
+
* keyed by PascalCase contract name matching the deployment JSON.
|
|
131
|
+
* Returns null if the network name is unknown.
|
|
132
|
+
*/
|
|
133
|
+
getDeploymentAddresses(): DeploymentContracts | null;
|
|
124
134
|
/**
|
|
125
135
|
* Get the network chain ID from the provider
|
|
126
136
|
*/
|
|
@@ -52,17 +52,6 @@ export interface LoanCreatorConfig {
|
|
|
52
52
|
ethRpcUrl?: string;
|
|
53
53
|
/** Security testing: Temper signatures to test contract validation */
|
|
54
54
|
temperSignaturesTest?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Optional: Custom PKP creator.
|
|
57
|
-
* When provided, bypasses the default LitOps PKP flow and creates the PKP using
|
|
58
|
-
* this function.
|
|
59
|
-
*/
|
|
60
|
-
nagaLoanPkpCreator?: () => Promise<{
|
|
61
|
-
tokenId: string;
|
|
62
|
-
publicKey: string;
|
|
63
|
-
ethAddress: string;
|
|
64
|
-
validatorSignature: string;
|
|
65
|
-
}>;
|
|
66
55
|
}
|
|
67
56
|
/**
|
|
68
57
|
* Loan creation audit trail
|
|
@@ -23,7 +23,7 @@ import type { SDKMode } from "../../interfaces/chunks/config.i";
|
|
|
23
23
|
export interface PKPManagerConfig {
|
|
24
24
|
/** Operation mode: service (via lit-ops-server) or direct (LIT Protocol) */
|
|
25
25
|
mode: SDKMode;
|
|
26
|
-
/** LIT network (
|
|
26
|
+
/** LIT network (e.g. chipotle) */
|
|
27
27
|
litNetwork: string;
|
|
28
28
|
/** Service mode: endpoint for lit-ops-server */
|
|
29
29
|
serviceEndpoint?: string;
|
|
@@ -152,7 +152,7 @@ export interface ChipotleServiceFallback {
|
|
|
152
152
|
/**
|
|
153
153
|
* Get PKP public key from PKP token ID.
|
|
154
154
|
*
|
|
155
|
-
* For
|
|
155
|
+
* For legacy PKPs minted as NFTs on Chronicle Yellowstone: looks up
|
|
156
156
|
* via `getPubkey(tokenId)` on the supplied PKP NFT contract.
|
|
157
157
|
*
|
|
158
158
|
* For Chipotle PKPs (ABI-encoded ETH address): there is no on-chain lookup, so
|
|
@@ -161,8 +161,8 @@ export interface ChipotleServiceFallback {
|
|
|
161
161
|
* throws with a clear diagnostic.
|
|
162
162
|
*
|
|
163
163
|
* @param pkpTokenId - PKP token ID (bytes32 hex string)
|
|
164
|
-
* @param provider - Ethereum provider connected to the PKP NFT chain (
|
|
165
|
-
* @param pkpNftContractAddress - PKP NFT contract address on that chain (
|
|
164
|
+
* @param provider - Ethereum provider connected to the PKP NFT chain (legacy PKPs only)
|
|
165
|
+
* @param pkpNftContractAddress - PKP NFT contract address on that chain (legacy PKPs only)
|
|
166
166
|
* @param chipotleFallback - Service-mode fallback used when pkpTokenId is a Chipotle id
|
|
167
167
|
* @returns PKP public key as hex string with '0x' prefix
|
|
168
168
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.252",
|
|
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",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"types": "./dist/server.d.ts",
|
|
17
17
|
"import": "./dist/server.mjs",
|
|
18
18
|
"require": "./dist/server.js"
|
|
19
|
+
},
|
|
20
|
+
"./deployments": {
|
|
21
|
+
"types": "./dist/deployments.d.ts",
|
|
22
|
+
"import": "./dist/deployments.mjs",
|
|
23
|
+
"require": "./dist/deployments.js"
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
26
|
"files": [
|