@synonymdev/blocktank-client
Advanced tools
Comparing version 0.0.36 to 0.0.39
@@ -1,2 +0,2 @@ | ||
import { IAdminOrderResponse, IAdminManualCreditRequest, IAdminManualCreditResponse, IAdminLoginRequest, IAdminLoginResponse } from '../types'; | ||
import { IAdminOrderResponse, IAdminManualCreditRequest, IAdminActionResponse, IAdminLoginRequest, IAdminLoginResponse, IAdminRefundRequest, IAdminRefundResponse, IAdminChannelCloseRequest } from '../types'; | ||
import Client from './client'; | ||
@@ -12,4 +12,6 @@ /** | ||
getOrders(): Promise<IAdminOrderResponse[]>; | ||
manualCredit(req: IAdminManualCreditRequest): Promise<IAdminManualCreditResponse>; | ||
manualCredit(req: IAdminManualCreditRequest): Promise<IAdminActionResponse>; | ||
refund(req: IAdminRefundRequest): Promise<IAdminRefundResponse>; | ||
close(req: IAdminChannelCloseRequest): Promise<IAdminActionResponse>; | ||
} | ||
export default AdminAPI; |
@@ -124,3 +124,3 @@ "use strict"; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.call('v1/channel/manual_credit', 'POST', req)]; | ||
case 0: return [4 /*yield*/, this.call('admin/v1/channel/manual_credit', 'POST', req)]; | ||
case 1: | ||
@@ -133,4 +133,30 @@ res = _a.sent(); | ||
}; | ||
AdminAPI.prototype.refund = function (req) { | ||
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('admin/v1/channel/refund', 'POST', req)]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res]; | ||
} | ||
}); | ||
}); | ||
}; | ||
AdminAPI.prototype.close = function (req) { | ||
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('admin/v1/channel/close', 'POST', req)]; | ||
case 1: | ||
res = _a.sent(); | ||
return [2 /*return*/, res]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return AdminAPI; | ||
}(client_1.default)); | ||
exports.default = AdminAPI; |
@@ -140,2 +140,5 @@ export interface IService { | ||
} | ||
export interface IAdminActionResponse { | ||
success: boolean; | ||
} | ||
export interface IAdminManualCreditRequest { | ||
@@ -145,4 +148,12 @@ tx_id: string; | ||
} | ||
export interface IAdminManualCreditResponse { | ||
export interface IAdminRefundRequest { | ||
order_id: string; | ||
refund_tx: string; | ||
} | ||
export interface IAdminRefundResponse { | ||
success: boolean; | ||
} | ||
export interface IAdminChannelCloseRequest { | ||
order_id: string; | ||
} | ||
export {}; |
{ | ||
"name": "@synonymdev/blocktank-client", | ||
"version": "0.0.36", | ||
"version": "0.0.39", | ||
"description": "LSP client library", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
30829
688