From d41cd218ff1ebab07f2bf8e84ffa0ca7deeb1a04 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 12 Feb 2018 19:35:34 -0800 Subject: generate lightning deposit address on user create --- mutations.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mutations.js') diff --git a/mutations.js b/mutations.js index 795c885a..57332b7d 100644 --- a/mutations.js +++ b/mutations.js @@ -10,7 +10,7 @@ import { GraphQLList } from 'graphql' -module.exports = (db, gqltypes) => { +module.exports = (db, gqltypes, lnrpc) => { const UserInputType = new GraphQLInputObjectType({ name: 'UserInput', desc: 'UserInput', @@ -30,6 +30,7 @@ module.exports = (db, gqltypes) => { } }, resolve: async (root, { user }) => { + user.address = (await lnrpc.newAddress({ type: 1 }, lnrpc.meta)).address return db['User'].create(user) } }, -- cgit v1.2.3