New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vocdoni/client

Package Overview
Dependencies
Maintainers
6
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocdoni/client

JavaScript/TypeScript client package

1.16.8
latest
Source
npm
Version published
Weekly downloads
4
100%
Maintainers
6
Weekly downloads
 
Created
Source

@vocdoni/client

@vocdoni/client contains shared helpers, models and type definitions for the dvote-js library

Installation

Use npm to install @vocdoni/client.

npm install @vocdoni/client

Usage

Gateway discovery

import { GatewayDiscovery } from "@vocdoni/client"

const gateways = await GatewayDiscovery.run()

You can use any of the gateway objects to send requests to the Voting and Census service providers.

Eth Provider

import { ProviderUtil } from "@vocdoni/client"

const provider1 = ProviderUtil.fromUri
  "https://my-web3-endpoint/rpc",
  "mainnet",  // "homestead" | "mainnet" | "rinkeby" | "goerli" | "xdai" | "sokol" | "matic"
  "prod"  // "prod" | "stg" | "dev"
)

// In a web browser
const provider2 = ProviderUtil.fromInjectedWeb3()

File API

import { FileApi } from "@vocdoni/client"

const buffData = Buffer.from("hello world")
const result1 = await FileApi.add(buffData, "my-file.txt", myWallet, gw)
// result1 => "ipfs://12346789..."

ENS

import { getEnsTextRecord } from "@vocdoni/client"

const value = await getEnsTextRecord(gateway, "vnd.vocdoni.meta", { environment: "prod", networkId: "mainnet" })
// result1 => "ipfs://12346789..."

Testing

To execute library tests just run

npm run test

FAQs

Package last updated on 21 Jul 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