@synonymdev/blocktank-client
Advanced tools
Comparing version 0.0.50 to 0.0.51
@@ -10,2 +10,3 @@ import { IBuyChannelRequest, IBuyChannelResponse, IExchangeRatesResponse, IFinalizeChannelRequest, IFinalizeChannelResponse, IGetInfoResponse, IGetOrderResponse } from '../types'; | ||
finalizeChannel(req: IFinalizeChannelRequest): Promise<IFinalizeChannelResponse>; | ||
getOrders(orderIds: Array<string>): Promise<Array<IGetOrderResponse>>; | ||
getOrder(orderId: string): Promise<IGetOrderResponse>; | ||
@@ -12,0 +13,0 @@ getRates(): Promise<IExchangeRatesResponse>; |
@@ -121,2 +121,23 @@ "use strict"; | ||
}; | ||
PublicAPI.prototype.getOrders = function (orderIds) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var res; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.call("v1/channel/order?order_id=" + orderIds.join(), 'GET')]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res.map(function (res) { | ||
res.amount_received = res.amount_received ? Number(res.amount_received) : 0; | ||
res.onchain_payments.forEach(function (payment, index) { | ||
res.onchain_payments[index] = __assign(__assign({}, payment), { amount_base: Number(payment.amount_base), fee_base: Number(payment.fee_base) }); | ||
}); | ||
res.total_amount = Number(res.total_amount); | ||
res.stateMessage = client_1.default.getStateMessage(res.state); | ||
return res; | ||
})]; | ||
} | ||
}); | ||
}); | ||
}; | ||
PublicAPI.prototype.getOrder = function (orderId) { | ||
@@ -123,0 +144,0 @@ return __awaiter(this, void 0, void 0, function () { |
{ | ||
"name": "@synonymdev/blocktank-client", | ||
"version": "0.0.50", | ||
"version": "0.0.51", | ||
"description": "LSP client library", | ||
@@ -5,0 +5,0 @@ "main": "./dist/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
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
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
35020
727
1