@gvnrdao/dh-sdk 0.0.284 → 0.0.285

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/index.js CHANGED
@@ -118078,7 +118078,11 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
118078
118078
  }
118079
118079
  this.pkpManager = pkpManagerResult.value;
118080
118080
  const serviceMode = isServiceModeConfig(config);
118081
- const graphEndpoint = serviceMode ? `${config.serviceEndpoint}/api/lit/graph/query` : config.subgraphs?.diamondHandsUrl;
118081
+ let graphEndpoint = serviceMode ? `${config.serviceEndpoint}/api/lit/graph/query` : config.subgraphs?.diamondHandsUrl;
118082
+ const ETHEREUM_MAINNET_CHAIN_ID = 1;
118083
+ if (serviceMode && graphEndpoint && typeof config.chainId === "number" && config.chainId !== ETHEREUM_MAINNET_CHAIN_ID) {
118084
+ graphEndpoint += `?chainId=${config.chainId}`;
118085
+ }
118082
118086
  if (!graphEndpoint) {
118083
118087
  throw new Error(
118084
118088
  "Diamond Hands subgraph URL is required. Please provide config.subgraphs.diamondHandsUrl"
package/dist/index.mjs CHANGED
@@ -118000,7 +118000,11 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
118000
118000
  }
118001
118001
  this.pkpManager = pkpManagerResult.value;
118002
118002
  const serviceMode = isServiceModeConfig(config);
118003
- const graphEndpoint = serviceMode ? `${config.serviceEndpoint}/api/lit/graph/query` : config.subgraphs?.diamondHandsUrl;
118003
+ let graphEndpoint = serviceMode ? `${config.serviceEndpoint}/api/lit/graph/query` : config.subgraphs?.diamondHandsUrl;
118004
+ const ETHEREUM_MAINNET_CHAIN_ID = 1;
118005
+ if (serviceMode && graphEndpoint && typeof config.chainId === "number" && config.chainId !== ETHEREUM_MAINNET_CHAIN_ID) {
118006
+ graphEndpoint += `?chainId=${config.chainId}`;
118007
+ }
118004
118008
  if (!graphEndpoint) {
118005
118009
  throw new Error(
118006
118010
  "Diamond Hands subgraph URL is required. Please provide config.subgraphs.diamondHandsUrl"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gvnrdao/dh-sdk",
3
- "version": "0.0.284",
3
+ "version": "0.0.285",
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",