New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@decentralchain/provider-cubensis

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@decentralchain/provider-cubensis

ProviderCubensis for Signer

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
2
Created
Source

ProviderCubensis

  • Overview
  • Getting Started

Overview

ProviderCubensis implements a Signature Provider for Signer protocol library.

Getting Started

Library installation

To install Signer and ProviderCubensis libraries use

npm i @decentralchain/signer @decentralchain/provider-cubensis

Library initialization

Add library initialization to your app.

  • For Testnet:

    import { Signer } from '@decentralchain/signer';
    import { ProviderCubensis } from '@decentralchain/provider-cubensis';
    
    const signer = new Signer({
      // Specify URL of the node on Testnet
      NODE_URL: 'https://testnet-node.decentralchain.io',
    });
    const cubensis = new ProviderCubensis();
    signer.setProvider(cubensis);
    
  • For Mainnet:

    import { Signer } from '@decentralchain/signer';
    import { ProviderCubensis } from '@decentralchain/provider-cubensis';
    
    const signer = new Signer();
    const cubensis = new ProviderCubensis();
    signer.setProvider(cubensis);
    

Basic example

Now your application is ready to work with DCC 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 DCC
    assetId: null, // equals to DCC
  })
  .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.

How to build

npm ci
npm run build

Keywords

signer

FAQs

Package last updated on 24 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts