Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
match py-walletconnect-bridge version
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrouid committed Dec 12, 2018
1 parent a60c923 commit 8f64345
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-walletconnect-bridge",
"version": "0.7.0",
"version": "0.7.11",
"description": "Bridge server for walletconnect standard",
"private": true,
"scripts": {
Expand Down
22 changes: 17 additions & 5 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import axios from 'axios'
import config from './config'
import * as keystore from './keystore'
import { getExpirationTime } from './time'
import pkg from '../package.json'

//
// Send push notification
Expand Down Expand Up @@ -37,7 +38,16 @@ const router = Router()

// Add hello route
router.get('/hello', async(req, res) => {
return res.send('Hello World, this is WalletConnect')
return res.send(`Hello World, this is WalletConnect v${pkg.version}`)
})

// Add info route
router.get('/info', async(req, res) => {
return res.send({
name: 'WalletConnect Brdige Server',
repository: pkg.name,
version: pkg.version
})
})

//
Expand Down Expand Up @@ -70,10 +80,12 @@ sessionRouter.put('/:sessionId', async(req, res) => {
const { push, encryptionPayload } = req.body
const { sessionId } = req.params
try {
// unencrypted details
await keystore.setSessionDetails(sessionId, {
push
})
if (push && typeof push === 'object') {
// unencrypted details
await keystore.setSessionDetails(sessionId, {
push
})
}

// encrypted data
await keystore.setSessionData(sessionId, encryptionPayload)
Expand Down
2 changes: 1 addition & 1 deletion src/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
10
),
callExpiration: parseInt(
process.env.WALLETCONNECT_TX_EXPIRATION || 60 * 60, // 24 hours
process.env.WALLETCONNECT_CALL_EXPIRATION || 60 * 60, // 24 hours
10
)
}
Expand Down

0 comments on commit 8f64345

Please sign in to comment.