@mempool/mempool.js
Advanced tools
Comparing version 2.2.5 to 2.2.6
import { WsInstance } from '../../interfaces/bitcoin/websockets'; | ||
export declare const useWebsocket: (hostname: string) => WsInstance; | ||
export declare const useWebsocket: (hostname: string, network: string) => WsInstance; |
@@ -9,4 +9,4 @@ "use strict"; | ||
var server_1 = __importDefault(require("../../services/ws/server")); | ||
var useWebsocket = function (hostname) { | ||
var wsEndpoint = "wss://" + hostname + "/api/v1/ws"; | ||
var useWebsocket = function (hostname, network) { | ||
var wsEndpoint = "wss://" + hostname + (network === 'main' ? '' : "/" + network) + "/api/v1/ws"; | ||
return { | ||
@@ -13,0 +13,0 @@ initClient: function (_a) { |
@@ -52,2 +52,13 @@ "use strict"; | ||
}); }; | ||
var getAssetIcon = function (params) { return __awaiter(void 0, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, api.get("/v1/asset/" + params.asset_id + "/icon")]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); }; | ||
var getAssetTxs = function (params) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -79,8 +90,21 @@ var paramsMempools, data; | ||
}); }; | ||
var getAssetsIcons = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, api.get("/v1/assets/icons")]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); }; | ||
return { | ||
getAsset: getAsset, | ||
getAssetIcon: getAssetIcon, | ||
getAssetTxs: getAssetTxs, | ||
getAssetSupply: getAssetSupply, | ||
getAssetsIcons: getAssetsIcons, | ||
}; | ||
}; | ||
exports.useAssets = useAssets; |
@@ -8,3 +8,3 @@ "use strict"; | ||
var markets_1 = require("./app/bisq/markets"); | ||
var hostnameEndpointDefault = 'mempool.space'; | ||
var hostnameEndpointDefault = 'bisq.market'; | ||
var networkEndpointDefault = 'bisq'; | ||
@@ -11,0 +11,0 @@ var mempool = function (_a) { |
@@ -10,3 +10,3 @@ "use strict"; | ||
var websocket_1 = require("./app/liquid/websocket"); | ||
var hostnameEndpointDefault = 'mempool.space'; | ||
var hostnameEndpointDefault = 'liquid.network'; | ||
var networkEndpointDefault = 'liquid'; | ||
@@ -13,0 +13,0 @@ var mempool = function (_a) { |
@@ -45,3 +45,3 @@ "use strict"; | ||
transactions: transactions_1.useTransactions(apiBitcoin), | ||
websocket: websocket_1.useWebsocket(hostname), | ||
websocket: websocket_1.useWebsocket(hostname, network), | ||
}, | ||
@@ -48,0 +48,0 @@ bisq: { |
@@ -19,2 +19,5 @@ export interface Asset { | ||
}) => Promise<Asset>; | ||
getAssetIcon: (params: { | ||
asset_id: string; | ||
}) => Promise<unknown>; | ||
getAssetTxs: (params: { | ||
@@ -28,3 +31,4 @@ asset_id: string; | ||
}) => Promise<Asset>; | ||
getAssetsIcons: () => Promise<string[]>; | ||
} | ||
export {}; |
{ | ||
"name": "@mempool/mempool.js", | ||
"version": "2.2.5", | ||
"version": "2.2.6", | ||
"description": "NPM package module for Mempool APIs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
173012
3787
0