@gvnrdao/dh-sdk 0.0.268 → 0.0.270
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/browser/dist/browser.js.LICENSE.txt +5 -10
- package/dist/constants/chunks/environment.browser.d.ts +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +58501 -3054
- package/dist/index.mjs +58526 -3080
- package/dist/interfaces/chunks/config.i.d.ts +0 -3
- package/dist/modules/diamond-hands-sdk.d.ts +13 -0
- package/dist/utils/server-session.d.ts +6 -0
- package/dist/utils/service-endpoint-policy.d.ts +7 -0
- package/package.json +12 -6
|
@@ -217,9 +217,6 @@ export declare function isServiceModeConfig(config: DiamondHandsSDKConfig): conf
|
|
|
217
217
|
* Type guard to check if config is StandaloneModeConfig
|
|
218
218
|
*/
|
|
219
219
|
export declare function isStandaloneModeConfig(config: DiamondHandsSDKConfig): config is StandaloneModeConfig;
|
|
220
|
-
/**
|
|
221
|
-
* Validates that ServiceModeConfig has required fields
|
|
222
|
-
*/
|
|
223
220
|
export declare function validateServiceModeConfig(config: ServiceModeConfig): string | null;
|
|
224
221
|
/**
|
|
225
222
|
* Validates that StandaloneModeConfig has required fields
|
|
@@ -630,6 +630,19 @@ export declare class DiamondHandsSDK {
|
|
|
630
630
|
* @param onlySupported - When true (default) filters to currently-supported coins only.
|
|
631
631
|
*/
|
|
632
632
|
getPSMStablecoins(onlySupported?: boolean): Promise<SupportedStablecoinData[]>;
|
|
633
|
+
/**
|
|
634
|
+
* Return the live on-chain swap and redeem limits for a single stablecoin in the PSM.
|
|
635
|
+
* All amounts are returned as bigint in the token's native decimals (stablecoin decimals
|
|
636
|
+
* for swap limits, 18 decimals for redeem limits which are denominated in UCD).
|
|
637
|
+
*
|
|
638
|
+
* @param stablecoinAddress - EVM address of the stablecoin to query.
|
|
639
|
+
*/
|
|
640
|
+
getPSMLimits(stablecoinAddress: string): Promise<{
|
|
641
|
+
minSwapAmount: bigint;
|
|
642
|
+
maxSwapAmount: bigint;
|
|
643
|
+
minRedeemAmount: bigint;
|
|
644
|
+
maxRedeemAmount: bigint;
|
|
645
|
+
}>;
|
|
633
646
|
/**
|
|
634
647
|
* Return the live on-chain available reserve balance for a single stablecoin in the PSM.
|
|
635
648
|
* Prefer this over the subgraph `reserves` field when freshness matters (e.g. pre-swap validation).
|
|
@@ -40,5 +40,11 @@ export declare class ServerSession {
|
|
|
40
40
|
getAuthHeader(): Promise<Record<string, string>>;
|
|
41
41
|
/** Drop the cached token (e.g. on 401 from server). Next call re-logs in. */
|
|
42
42
|
clear(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Revoke the current session JWT on lit-ops-server (`POST /api/auth/logout`).
|
|
45
|
+
* Clears the local cache regardless of server response so the client stops
|
|
46
|
+
* presenting the token.
|
|
47
|
+
*/
|
|
48
|
+
logout(): Promise<void>;
|
|
43
49
|
private getOrRefresh;
|
|
44
50
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refuses to send session JWTs or signed auth payloads over plaintext HTTP
|
|
3
|
+
* unless the endpoint is loopback. https://* is always allowed; http://localhost,
|
|
4
|
+
* http://127.0.0.1, http://[::1], and *.localhost (with optional port/path) are
|
|
5
|
+
* allowed for local development; everything else throws.
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertSafeServiceEndpoint(endpoint: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.270",
|
|
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",
|
|
@@ -8,10 +8,15 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"browser": "./dist/
|
|
11
|
+
"browser": "./browser/dist/browser.js",
|
|
12
12
|
"import": "./dist/index.mjs",
|
|
13
13
|
"require": "./dist/index.js"
|
|
14
14
|
},
|
|
15
|
+
"./browser": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./browser/dist/browser.js",
|
|
18
|
+
"default": "./browser/dist/browser.js"
|
|
19
|
+
},
|
|
15
20
|
"./server": {
|
|
16
21
|
"types": "./dist/server.d.ts",
|
|
17
22
|
"import": "./dist/server.mjs",
|
|
@@ -42,7 +47,8 @@
|
|
|
42
47
|
"typecheck": "tsc --noEmit",
|
|
43
48
|
"typecheck:strict": "tsc --noEmit -p tsconfig.strict.json",
|
|
44
49
|
"test:types": "tsc --noEmit -p tsconfig.types.json",
|
|
45
|
-
"prepublishOnly": "npm run sync:deployments && npm run validate:contracts && npm run build:
|
|
50
|
+
"prepublishOnly": "npm run sync:deployments && npm run validate:contracts && npm run build:all",
|
|
51
|
+
"postbuild:browser": "grep -qE 'require\\(\"http\"\\)|require\\(\"https\"\\)|require\\(\"fs\"\\)' browser/dist/browser.js && echo 'ERROR: Node built-ins found in browser bundle' && exit 1 || true",
|
|
46
52
|
"test": "jest",
|
|
47
53
|
"test:unit": "jest tests/shared/unit",
|
|
48
54
|
"test:integration": "jest tests/shared/integration",
|
|
@@ -76,7 +82,7 @@
|
|
|
76
82
|
"sideEffects": false,
|
|
77
83
|
"dependencies": {
|
|
78
84
|
"@gvnrdao/dh-lit-actions": "^0.0.303",
|
|
79
|
-
"@gvnrdao/dh-lit-ops": "^0.0.
|
|
85
|
+
"@gvnrdao/dh-lit-ops": "^0.0.290",
|
|
80
86
|
"@noble/hashes": "^1.5.0",
|
|
81
87
|
"axios": "^1.15.2",
|
|
82
88
|
"bech32": "^2.0.0",
|
|
@@ -87,7 +93,6 @@
|
|
|
87
93
|
"crypto-js": "^4.2.0",
|
|
88
94
|
"dotenv": "^17.4.2",
|
|
89
95
|
"ethers": "^6.16.0",
|
|
90
|
-
"node-telegram-bot-api": "^0.67.0",
|
|
91
96
|
"process": "^0.11.10",
|
|
92
97
|
"valibot": "^1.1.0",
|
|
93
98
|
"viem": "^2.48.4"
|
|
@@ -124,6 +129,7 @@
|
|
|
124
129
|
"homepage": "https://diamond-hands-protocol.com",
|
|
125
130
|
"optionalDependencies": {
|
|
126
131
|
"@esbuild/darwin-arm64": "^0.27.2",
|
|
127
|
-
"esbuild": "^0.27.0"
|
|
132
|
+
"esbuild": "^0.27.0",
|
|
133
|
+
"node-telegram-bot-api": "^0.67.0"
|
|
128
134
|
}
|
|
129
135
|
}
|