Skip to content
uPort tx funding service
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci circleci with node8 Feb 13, 2019
build/contracts redeploy to rinkeby Mar 18, 2019
contracts pending tx Mar 18, 2019
migrations add operator on rinkeby Mar 20, 2019
sql callback handling Mar 25, 2019
src better logs and parallel checks Apr 5, 2019
test SensuiVault contract Feb 28, 2019
.gitignore SensuiVault contract Feb 28, 2019
.solcover.js solcov Feb 28, 2019
LICENSE Initial commit Oct 16, 2017
README.md codecov 100 Feb 20, 2019
SECRETS.md
kms-secrets.develop.us-west-2.yml wip Mar 11, 2019
kms-secrets.master.us-west-2.yml wip Mar 11, 2019
package-lock.json alarms for lambda Mar 28, 2019
package.json better logs and parallel checks Apr 5, 2019
serverless.yml 1000ms duration alarm threshold Apr 5, 2019
truffle-config.js wip Mar 11, 2019

README.md

lambda-sensui

uPort Funding Service

CircleCI

codecov

API Description

RPC endpoint

This endpoints tries to send funds to the address on the from field of the transaction. The from field needs to match with the deviceKey in the Authorization token.

Sensui, does some limit check before actually sending the funds. If sensui funds an attempt to abuse a 429 Too many connections is returned

The endpoint is private, only valid tokens from nisaba are allowed.

Endpoints

Fund

POST /fund

Header

Authorization: Bearer <jwt token>

The authorization header needs a JWT token that is signed by the nisaba service (a build that very much resembles this one, in that it also uses the serverless framework and AWS lambda. The JWT token is generated from the following control flow (for uPort):

  1. User is signing up on uPort, which requests the users phone number and/or that the user complete a captcha challenge
  2. The user submits their phone number and recieves a text with a secret code and/or completes captcha challenge
  3. Upon successful completion, a JWT token is created and then signed by the nisaba service (becoming a 'nisaba token' as referenced in the comments in the code
  4. This token is associated with the user and allows them to use the methods of the API and make calls

Body

{
  tx: <signedTx>,
  blockchain: <blockchain name>
}

Response

Status Message
200 Ok. address funded
400 Bad request No JSON or paramter missing
401 Forbidden Fuel token not granted by nisaba
403 Forbidden JWT token missing or invalid
429 Abuse Abusing gasPrice or funds not needed
500 Internal Error Internal error

Response data

{
  txHash: <tx hash>
}

Relay

POST /relay

Header

Authorization: Bearer <jwt token>

Body

{
  metaSignedTx: <metaSignedTx>,
  blockchain: <blockchain name>
}

Response

Status Message
200 Ok. address funded
400 Bad request No JSON or paramter missing
401 Forbidden Fuel token not granted by nisaba
403 Forbidden Invalid metaTx signature
500 Internal Error Internal error

Response data

{
  txHash: <tx hash>
}
You can’t perform that action at this time.