@multiversx/sdk-network-providers
Advanced tools
Comparing version 2.7.0 to 2.7.1
@@ -6,2 +6,3 @@ import { AccountOnNetwork, GuardianData } from "./accounts"; | ||
import { NetworkGeneralStatistics } from "./networkGeneralStatistics"; | ||
import { NetworkProviderConfig } from "./networkProviderConfig"; | ||
import { NetworkStake } from "./networkStake"; | ||
@@ -14,3 +15,2 @@ import { NetworkStatus } from "./networkStatus"; | ||
import { TransactionStatus } from "./transactionStatus"; | ||
import { NetworkProviderConfig } from "./networkProviderConfig"; | ||
export declare class ApiNetworkProvider implements INetworkProvider { | ||
@@ -17,0 +17,0 @@ private url; |
@@ -19,2 +19,3 @@ "use strict"; | ||
const config_1 = require("./config"); | ||
const constants_1 = require("./constants"); | ||
const contractQueryRequest_1 = require("./contractQueryRequest"); | ||
@@ -33,3 +34,2 @@ const contractQueryResponse_1 = require("./contractQueryResponse"); | ||
const userAgent_1 = require("./userAgent"); | ||
const constants_1 = require("./constants"); | ||
// TODO: Find & remove duplicate code between "ProxyNetworkProvider" and "ApiNetworkProvider". | ||
@@ -46,3 +46,3 @@ class ApiNetworkProvider { | ||
getProxyConfig(config) { | ||
let proxyConfig = JSON.parse(JSON.stringify(config)); | ||
let proxyConfig = JSON.parse(JSON.stringify(config || {})); | ||
proxyConfig = Object.assign(Object.assign({}, config_1.defaultAxiosConfig), proxyConfig); | ||
@@ -49,0 +49,0 @@ return proxyConfig; |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const axios_1 = require("axios"); | ||
const chai_1 = require("chai"); | ||
@@ -19,3 +20,2 @@ const apiNetworkProvider_1 = require("./apiNetworkProvider"); | ||
const transactionEvents_1 = require("./transactionEvents"); | ||
const axios_1 = require("axios"); | ||
describe("test network providers on devnet: Proxy and API", function () { | ||
@@ -28,2 +28,12 @@ let alice = new primitives_1.Address("erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"); | ||
let proxyProvider = new proxyNetworkProvider_1.ProxyNetworkProvider("https://devnet-gateway.multiversx.com", { timeout: 10000, clientName: 'test' }); | ||
it("should create providers without configuration", function () { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const apiProviderWithoutConfig = new apiNetworkProvider_1.ApiNetworkProvider("https://devnet-api.multiversx.com"); | ||
const proxyProviderWithoutConfig = new proxyNetworkProvider_1.ProxyNetworkProvider("https://devnet-gateway.multiversx.com"); | ||
const apiResponse = yield apiProviderWithoutConfig.getNetworkConfig(); | ||
const proxyResponse = yield proxyProviderWithoutConfig.getNetworkConfig(); | ||
chai_1.assert.equal(apiResponse.ChainID, "D"); | ||
chai_1.assert.equal(proxyResponse.ChainID, "D"); | ||
}); | ||
}); | ||
it("should have same response for getNetworkConfig()", function () { | ||
@@ -30,0 +40,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@multiversx/sdk-network-providers", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"lockfileVersion": 2, | ||
@@ -5,0 +5,0 @@ "requires": true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201162
2900