@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/browser/dist/browser.js +1 -1
- package/dist/index.js +24 -20
- package/dist/index.mjs +24 -20
- package/package.json +1 -1
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://
|
|
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:
|
|
34929
|
-
positionManagerCore:
|
|
34930
|
-
positionManagerViews:
|
|
34931
|
-
simplePsmV2:
|
|
34932
|
-
loanOperationsManager:
|
|
34933
|
-
termManager:
|
|
34934
|
-
circuitBreaker:
|
|
34935
|
-
liquidationManager:
|
|
34936
|
-
ucdToken:
|
|
34937
|
-
|
|
34938
|
-
|
|
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
|
-
|
|
123920
|
-
|
|
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://
|
|
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:
|
|
34935
|
-
positionManagerCore:
|
|
34936
|
-
positionManagerViews:
|
|
34937
|
-
simplePsmV2:
|
|
34938
|
-
loanOperationsManager:
|
|
34939
|
-
termManager:
|
|
34940
|
-
circuitBreaker:
|
|
34941
|
-
liquidationManager:
|
|
34942
|
-
ucdToken:
|
|
34943
|
-
|
|
34944
|
-
|
|
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
|
-
|
|
123842
|
-
|
|
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