chore: add maxFee to getRoute

This commit is contained in:
AP 2020-02-22 21:01:33 +01:00
parent 098f541a33
commit 6416a64cde
2 changed files with 3 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "thunderhub",
"version": "0.1.2",
"version": "0.1.3",
"description": "",
"main": "index.js",
"scripts": {

View file

@ -12,6 +12,7 @@ export const getRoutes = {
outgoing: { type: new GraphQLNonNull(GraphQLString) },
incoming: { type: new GraphQLNonNull(GraphQLString) },
tokens: { type: new GraphQLNonNull(GraphQLInt) },
maxFee: { type: GraphQLInt },
},
resolve: async (root: any, params: any, context: any) => {
await requestLimiter(context.ip, 'getRoutes');
@ -26,6 +27,7 @@ export const getRoutes = {
incoming_peer: params.incoming,
destination: public_key,
tokens: params.tokens,
...(params.maxFee && { max_fee: params.maxFee }),
}).catch((error: any) => {
params.logger && logger.error('Error getting routes: %o', error);
throw new Error(getErrorMsg(error));