@gvnrdao/dh-sdk 0.0.289 → 0.0.291

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
@@ -34916,26 +34916,31 @@ function getSepoliaConfig() {
34916
34916
  };
34917
34917
  }
34918
34918
  function getMainnetConfig() {
34919
- const deployment = loadDeploymentData("mainnet");
34920
- const contracts = deployment?.contracts || {};
34921
34919
  return {
34922
34920
  mode: "service",
34923
- serviceEndpoint: "https://emerald.gvnr.xyz",
34921
+ serviceEndpoint: "https://ops.gvnr.xyz",
34924
34922
  chainId: 1,
34925
34923
  name: "mainnet",
34926
34924
  rpcUrls: ["https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"],
34927
34925
  contractAddresses: {
34928
- positionManager: contracts.PositionManager || "",
34929
- positionManagerCore: contracts.PositionManagerCoreModule || "",
34930
- positionManagerViews: contracts.PositionManagerViews || "",
34931
- simplePsmV2: contracts.SimplePSMV2 || "",
34932
- loanOperationsManager: contracts.LoanOperationsManagerModule || "",
34933
- termManager: contracts.TermManagerModule || "",
34934
- circuitBreaker: contracts.CircuitBreakerModule || "",
34935
- liquidationManager: contracts.LiquidationManagerModule || "",
34936
- ucdToken: contracts.UCDToken || "",
34937
- priceFeedConsumer: contracts.PriceFeedConsumer || "",
34938
- operationAuthorizationRegistry: contracts.OperationAuthorizationRegistry || ""
34926
+ positionManager: MAINNET_CONTRACTS.PositionManager || "",
34927
+ positionManagerCore: MAINNET_CONTRACTS.PositionManagerCoreModule || "",
34928
+ positionManagerViews: MAINNET_CONTRACTS.PositionManagerViews || "",
34929
+ simplePsmV2: MAINNET_CONTRACTS.SimplePSMV2 || "",
34930
+ loanOperationsManager: MAINNET_CONTRACTS.LoanOperationsManagerModule || "",
34931
+ termManager: MAINNET_CONTRACTS.TermManagerModule || "",
34932
+ circuitBreaker: MAINNET_CONTRACTS.CircuitBreakerModule || "",
34933
+ liquidationManager: MAINNET_CONTRACTS.LiquidationManagerModule || "",
34934
+ ucdToken: MAINNET_CONTRACTS.UCDToken || "",
34935
+ ucdController: MAINNET_CONTRACTS.UCDController || "",
34936
+ priceFeedConsumer: MAINNET_CONTRACTS.PriceFeedConsumer || "",
34937
+ operationAuthorizationRegistry: MAINNET_CONTRACTS.OperationAuthorizationRegistry || "",
34938
+ btcSpendAuthorizer: MAINNET_CONTRACTS.BTCSpendAuthorizer || "",
34939
+ bitcoinProviderRegistry: MAINNET_CONTRACTS.BitcoinProviderRegistry || "",
34940
+ contractVersionRegistry: MAINNET_CONTRACTS.ContractVersionRegistry || "",
34941
+ feeRecipientRegistry: MAINNET_CONTRACTS.FeeRecipientRegistry || "",
34942
+ positionDelegateRegistry: MAINNET_CONTRACTS.PositionDelegateRegistry || "",
34943
+ bitcoinWithdrawalAddressRegistry: MAINNET_CONTRACTS.BitcoinWithdrawalAddressRegistry || ""
34939
34944
  },
34940
34945
  subgraphs: {
34941
34946
  diamondHandsUrl: "https://gateway-arbitrum.network.thegraph.com/api/subgraphs/id/CCTPsdYqco2jChDLLBQTbdJWwoukVoMt1cXeR9ti6r9A"
@@ -123916,13 +123921,12 @@ Error data: ${errorData || "none"}`
123916
123921
  const response = await fetch(url, {
123917
123922
  headers: await this.getAuthHeader()
123918
123923
  });
123919
- const json = await response.json().catch(() => null);
123920
- if (!response.ok || !json?.success) {
123921
- const serverError = json?.error?.trim();
123922
- throw new Error(
123923
- serverError ? `Address balance request failed: ${serverError}` : `Address balance request failed: ${response.status} ${response.statusText}`.trimEnd()
123924
- );
123924
+ if (!response.ok) {
123925
+ throw new Error(`Address balance request failed: ${response.status} ${response.statusText}`);
123925
123926
  }
123927
+ const json = await response.json();
123928
+ if (!json.success)
123929
+ throw new Error(json.error ?? "Address balance request failed");
123926
123930
  return success(json.data);
123927
123931
  } catch (error2) {
123928
123932
  return failure(new SDKError({
package/dist/index.mjs CHANGED
@@ -34922,26 +34922,31 @@ function getSepoliaConfig() {
34922
34922
  };
34923
34923
  }
34924
34924
  function getMainnetConfig() {
34925
- const deployment = loadDeploymentData("mainnet");
34926
- const contracts = deployment?.contracts || {};
34927
34925
  return {
34928
34926
  mode: "service",
34929
- serviceEndpoint: "https://emerald.gvnr.xyz",
34927
+ serviceEndpoint: "https://ops.gvnr.xyz",
34930
34928
  chainId: 1,
34931
34929
  name: "mainnet",
34932
34930
  rpcUrls: ["https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"],
34933
34931
  contractAddresses: {
34934
- positionManager: contracts.PositionManager || "",
34935
- positionManagerCore: contracts.PositionManagerCoreModule || "",
34936
- positionManagerViews: contracts.PositionManagerViews || "",
34937
- simplePsmV2: contracts.SimplePSMV2 || "",
34938
- loanOperationsManager: contracts.LoanOperationsManagerModule || "",
34939
- termManager: contracts.TermManagerModule || "",
34940
- circuitBreaker: contracts.CircuitBreakerModule || "",
34941
- liquidationManager: contracts.LiquidationManagerModule || "",
34942
- ucdToken: contracts.UCDToken || "",
34943
- priceFeedConsumer: contracts.PriceFeedConsumer || "",
34944
- operationAuthorizationRegistry: contracts.OperationAuthorizationRegistry || ""
34932
+ positionManager: MAINNET_CONTRACTS.PositionManager || "",
34933
+ positionManagerCore: MAINNET_CONTRACTS.PositionManagerCoreModule || "",
34934
+ positionManagerViews: MAINNET_CONTRACTS.PositionManagerViews || "",
34935
+ simplePsmV2: MAINNET_CONTRACTS.SimplePSMV2 || "",
34936
+ loanOperationsManager: MAINNET_CONTRACTS.LoanOperationsManagerModule || "",
34937
+ termManager: MAINNET_CONTRACTS.TermManagerModule || "",
34938
+ circuitBreaker: MAINNET_CONTRACTS.CircuitBreakerModule || "",
34939
+ liquidationManager: MAINNET_CONTRACTS.LiquidationManagerModule || "",
34940
+ ucdToken: MAINNET_CONTRACTS.UCDToken || "",
34941
+ ucdController: MAINNET_CONTRACTS.UCDController || "",
34942
+ priceFeedConsumer: MAINNET_CONTRACTS.PriceFeedConsumer || "",
34943
+ operationAuthorizationRegistry: MAINNET_CONTRACTS.OperationAuthorizationRegistry || "",
34944
+ btcSpendAuthorizer: MAINNET_CONTRACTS.BTCSpendAuthorizer || "",
34945
+ bitcoinProviderRegistry: MAINNET_CONTRACTS.BitcoinProviderRegistry || "",
34946
+ contractVersionRegistry: MAINNET_CONTRACTS.ContractVersionRegistry || "",
34947
+ feeRecipientRegistry: MAINNET_CONTRACTS.FeeRecipientRegistry || "",
34948
+ positionDelegateRegistry: MAINNET_CONTRACTS.PositionDelegateRegistry || "",
34949
+ bitcoinWithdrawalAddressRegistry: MAINNET_CONTRACTS.BitcoinWithdrawalAddressRegistry || ""
34945
34950
  },
34946
34951
  subgraphs: {
34947
34952
  diamondHandsUrl: "https://gateway-arbitrum.network.thegraph.com/api/subgraphs/id/CCTPsdYqco2jChDLLBQTbdJWwoukVoMt1cXeR9ti6r9A"
@@ -123838,13 +123843,12 @@ Error data: ${errorData || "none"}`
123838
123843
  const response = await fetch(url, {
123839
123844
  headers: await this.getAuthHeader()
123840
123845
  });
123841
- const json = await response.json().catch(() => null);
123842
- if (!response.ok || !json?.success) {
123843
- const serverError = json?.error?.trim();
123844
- throw new Error(
123845
- serverError ? `Address balance request failed: ${serverError}` : `Address balance request failed: ${response.status} ${response.statusText}`.trimEnd()
123846
- );
123846
+ if (!response.ok) {
123847
+ throw new Error(`Address balance request failed: ${response.status} ${response.statusText}`);
123847
123848
  }
123849
+ const json = await response.json();
123850
+ if (!json.success)
123851
+ throw new Error(json.error ?? "Address balance request failed");
123848
123852
  return success(json.data);
123849
123853
  } catch (error2) {
123850
123854
  return failure(new SDKError({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gvnrdao/dh-sdk",
3
- "version": "0.0.289",
3
+ "version": "0.0.291",
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",