Stellar Auth server library
Server side library for Stellar SEP 0010 implementation.
Installation
Install the package with:
npm install stellar-auth-server --save
Usage
Initialization
const StellarAuth = ;const serverKeyPair = StellarSdkKeypair;// optional paramconst options =challengeExpiresIn: 300 // 5 minutesinvalidSequence: '0'anchorName: 'Anchor server'const stellarAuth = serverKeyPair options;
- serverKeyPair
Server Keypair object.
Required: true - options
Object with optional params .
Required: false- challengeExpiresIn
time in seconds in which the challenge expires.
Default value:300
(5 minutes)
Required: false - invalidSequence
Invalid sequence for stellar transaction.
Default value:'0'
Required: false - anchorName
Default anchor name.
Default value:'Anchor server'
Required: false
- challengeExpiresIn
Challenge
const clientPublicKey = 'GBF...3UZ';const txBase64 = stellarAuth;return transaction: txBase64 ;
Verify
stellarAuth
Development
Run all tests:
$ npm install$ npm test
Run a single test suite:
$ npm run mocha -- test/lib/challenge.spec.js
Run a single test (case sensitive):
$ npm run mocha -- test/lib/challenge.spec.js --grep 'Should have valid timebounds'
Library based on Stellar SEP-0010 implementation