Smart Vault JS SDK
Javascript Software Development Kit
Last updated
Was this helpful?
Javascript Software Development Kit
Last updated
Was this helpful?
The Lightstreams Javascript SDK provides is a library the provides modules for account management and interacting with a Lightstreams node.
The Github repository.
Node >= 10
Lightstreams node.
Install node module
Install lightstreams-js-sdk
as part of your project dependencies:
Learn more about
How to create a random new wallet
How to create a wallet from seed phrase
How to generate a random seed phrase
How to create a new account
Public account object API
lock():void
: Lock wallet account
unlock(password):void
: Unlock wallet account
isLocked():boolean
: Return false is the account is unlock
sign(txParams):string
: Return a signed transaction. Wallet must be unlocked
export():object
: Returns encrypted privatekey in json format
seedPhrase():array
: Return account seed phrase. Wallet must be unlocked
In this repository you can find a customize web3 provider which uses a local keystorage to sign transactions. In addition other ethereum public API methods such as eth_lockAccount
, eth_unlockAccount
and eth_newAccount
are being overwritten to use the key local storage.
How to initialize a LS web3 provider
Using this web3 provider you could create a new account and unlock it as you would regularly do web3 engine api methods, such as:
How to import a wallet
How to register new tld
Sample usage
Once LightstreamsSDK
is initialized you interact with it as follow:
Available Methods
/acl/revoke -> gateway.acl.revoke(acl, owner, password, to)
Learn more about it in .
How to use ENS official sdk Read docs
Gateway SDK interface is made to match, one to one, every available .
-> gateway.user.signUp(password)
-> gateway.user.signIn(account, password)
-> gateway.wallet.balance(account)
-> gateway.wallet.transfer(from, password, to, amountWei)
-> gateway.storage.add(owner, password, file)
-> gateway.storage.fetch(meta, token, stream)
-> gateway.acl.grant(acl, owner, password, to, permission)
-> gateway.acl.grantPublic(acl, owner, password)
-> gateway.acl.revokePublic(acl, owner, password)
-> gateway.shop.create(from, password)
-> gateway.shop.sell(shop, from, password, acl, priceWei)
-> gateway.shop.buy(shop, from, password, acl)
-> gateway.erc20.balance(erc20_address, account)
-> gateway.erc20.transfer(erc20_address, from, password, to, amount)
-> gateway.erc20.purchase(erc20_address, account, password, amount_wei)