diff options
| author | Adam Soltys <[email protected]> | 2018-02-12 19:35:34 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2018-02-12 19:35:34 -0800 |
| commit | d41cd218ff1ebab07f2bf8e84ffa0ca7deeb1a04 (patch) | |
| tree | a4de7e44acd90bd0f55a856917008aff4793473d /mutations.js | |
| parent | cbf91f53e6c97cdb76c293c46813fbc9a74f47e5 (diff) | |
| download | coinos-server-d41cd218ff1ebab07f2bf8e84ffa0ca7deeb1a04.tar.gz coinos-server-d41cd218ff1ebab07f2bf8e84ffa0ca7deeb1a04.zip | |
generate lightning deposit address on user create
Diffstat (limited to 'mutations.js')
| -rw-r--r-- | mutations.js | 3 |
1 files changed, 2 insertions, 1 deletions
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) } }, |
