2.0.9 • Published 9 months ago

@waves/provider-keeper v2.0.9

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

ProviderKeeper

npm "" "" "" ""

Overview

ProviderKeeper implements a Signature Provider for Signer protocol library.

Getting Started

Library installation

Install using npm:

npm install @waves/signer @waves/provider-keeper

or yarn

yarn add @waves/signer @waves/provider-keeper

Library initialization

Add library initialization to your app.

  • For Testnet:

    import { Signer } from '@waves/signer';
    import { ProviderKeeper } from '@waves/provider-keeper';
    
    const signer = new Signer({
      // Specify URL of the node on Testnet
      NODE_URL: 'https://nodes-testnet.wavesnodes.com',
    });
    const keeper = new ProviderKeeper();
    signer.setProvider(keeper);
  • For Mainnet:

    import { Signer } from '@waves/signer';
    import { ProviderKeeper } from '@waves/provider-keeper';
    
    const signer = new Signer();
    const keeper = new ProviderKeeper();
    signer.setProvider(keeper);

You can also check if the Keeper Wallet is installed.

import { isKeeperInstalled } from '@waves/provider-keeper';

const isInstalled = await isKeeperInstalled();

if (!isInstalled) {
  // Some logic in case KeeperWallet is not installed
}

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({
    recipient: '3Myqjf1D44wR8Vko4Tr5CwSzRNo2Vg9S7u7',
    amount: 100000, // equals to 0.001 WAVES
    assetId: null, // equals to WAVES
  })
  .broadcast();

Or invoke some dApp:

const [invoke] = await signer
  .invoke({
    dApp: '3Fb641A9hWy63K18KsBJwns64McmdEATgJd',
    fee: 1000000,
    payment: [
      {
        assetId: '73pu8pHFNpj9tmWuYjqnZ962tXzJvLGX86dxjZxGYhoK',
        amount: 7,
      },
    ],
    call: {
      function: 'foo',
      args: [
        { type: 'integer', value: 1 },
        { type: 'binary', value: 'base64:AAA=' },
        { type: 'string', value: 'foo' },
      ],
    },
  })
  .broadcast();

For more examples see Signer documentation.

2.0.9

9 months ago

2.0.8

9 months ago

2.0.8-beta.1

10 months ago

2.0.7

11 months ago

2.0.6

11 months ago

2.0.5

1 year ago

2.0.4

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.5

2 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago