@waves/provider-seed
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

ProviderSeed

Overview

ProviderSeed implements a Signature Provider for Signer protocol library. ProviderSeed creates user account from SEED.

Getting Started

1. Library installation

To install Signer and ProviderSeed libraries use

npm i @waves/signer @waves/provider-seed @waves/waves-transactions

2. Library initialization

Add library initialization to your app.

  • For Testnet:

    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:

    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.

const user = await signer.login();
const [transfer] = await signer
  .transfer({
    amount: 1,
    recipient: 'alias:T:merry',
  })
  .sign();

For more information see Signer documentation.

/@waves/provider-seed/

    Package Sidebar

    Install

    npm i @waves/provider-seed

    Weekly Downloads

    4

    Version

    0.3.2

    License

    none

    Unpacked Size

    594 kB

    Total Files

    7

    Last publish

    Collaborators

    • enichegovskiy
    • xrtm000
    • bodrych
    • msmolyakov-waves
    • vsuharnikov
    • gakhramanov
    • tsigel
    • ebceu4
    • vba2000
    • wavesadmin
    • dvshur
    • jlewka
    • kozhevnikov.peter
    • axepuff
    • okanishcheva
    • vladislav.petushkov