https://github.com/wavesplatform/provider-seed
https://github.com/wavesplatform/provider-seed
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wavesplatform/provider-seed
- Owner: wavesplatform
- Created: 2019-12-26T08:51:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T02:23:57.000Z (about 3 years ago)
- Last Synced: 2025-04-07T19:44:35.397Z (about 1 year ago)
- Language: JavaScript
- Size: 2.71 MB
- Stars: 1
- Watchers: 7
- Forks: 6
- Open Issues: 20
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ProviderSeed
* [Overview](#overview)
* [Getting Started](#getting-started)
ProviderSeed implements a Signature Provider for [Signer](https://github.com/wavesplatform/signer) protocol library. ProviderSeed creates user account from SEED.
### 1. Library installation
To install Signer and ProviderSeed libraries use
```bash
npm i @waves/signer @waves/provider-seed @waves/waves-transactions
```
### 2. Library initialization
Add library initialization to your app.
* For Testnet:
```js
import { Signer } from '@waves/signer';
import { ProviderSeed } from '@waves/provider-seed';
import { libs } from '@waves/waves-transactions';
const seed = libs.crypto.randomSeed();
const signer = new Signer({
// Specify URL of the node on Testnet
NODE_URL: 'https://nodes-testnet.wavesnodes.com'
});
const provider = new ProviderSeed(seed);
signer.setProvider(provider);
```
* For Mainnet:
```js
import { Signer } from '@waves/signer';
import { ProviderSeed } from '@waves/provider-seed';
import { libs } from '@waves/waves-transactions';
const seed = libs.crypto.randomSeed();
const signer = new Signer();
const provider = new ProviderSeed(seed);
signer.setProvider(provider);
```
### 3. Basic example
Now your application is ready to work with Waves Platform. Let's test it by implementing basic functionality. For example, we could try to authenticate user and transfer funds.
```js
const user = await signer.login();
const [transfer] = await signer
.transfer({
amount: 1,
recipient: 'alias:T:merry',
})
.sign();
```
For more information see [Signer documentation](https://github.com/wavesplatform/signer/blob/master/README.md).