npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wavesenterprise/voting-contract-api

v2.8.2

Published

Обертка над voting-blockchain-tools для взаимодействия с voting контрактом.

Downloads

19

Readme

Voting contract api

Обертка над voting-blockchain-tools для взаимодействия с voting контрактом.

Опции

{
  ransactionBroadcaster: TransactionBroadcaster,# transaction broadcastes from voting-blockchain-tools
  keyPair: IKeyPair, # public and private key to sign transaction
  nodeAddress: string, # address to node
  axiosInstance?: AxiosInstance, # authorized axios with "Authorization" header
  isWaitTransactionMining?: boolean, # wheter to resolve right after sending or wait mining. Default: true
  statusResponseTimeout?: number, # wait mining max time. Default: 100000
  maxMiningAttempts?: number | null, # max mining errors from nodes to stop mining. Default: 3
  feeAssetId?: string | null, # asset id to pay commission fee. Default: null
}

Примеры

Примеры использования библиотеки можно найти в папке examples

Отправка dkgComplaint из примера

  1. Создать .env файл в корне проекта с содержимым:
# node address
NODE_ADDRESS=https://voting-tokens.welocal.dev/nodeAddress

# auth service address
AUTH_SERVICE_ADDRESS=https://voting-tokens.welocal.dev/authServiceAddress
AUTH_SERVICE_SECRET_KEY=secret

# Ключ отправителя транзакции
PRIVATE_KEY=HCRkL2jKLGSazfBEhjDux7g9Y7nT4qPKWzT2zT7DBEVw
PUBLIC_KEY=8NUTYg7E7wSpNY7r6ejjWmTjscifPCb5wTfCWz33hT5d

# Как в настройках decrypt-service. Можно также не указывать или оставить "WAVES" для дефолта.
TRANSACTION_FEE_ASSET_ID = D3doMhGtJb4kwcUEqFh6fN5Gjkmbv3XiGEHWpqtnUx5S

# txid контракта
CONTRACT_ID=5sVurMjFjsfiXfYc5HsbzSby6JrbphQRnM48HJPh9yt8
# транзакция dkgShadows, которую нужно отклонить
DECRYPT_SERVER_TO_BAN=CEtQvUjD5xNLpoPWVGZumaTpNnLReXAreLfhMfdvzmQ5
# текущий раунд DKG
ROUND=1
  1. Настроить .env. Не забыть поменять AUTH_SERVICE_SECRET_KEY
  2. Установить зависимости через npm i
  3. Запустить команду ts-node examples/sendWeDkgComplaint.ts

Изменение contractImage запущенного голосования

  1. Создать .env файл в корне проекта с содержимым:
# node address
NODE_ADDRESS=https://voting-volgograd.welocal.dev/nodeAddress

# auth service address
AUTH_SERVICE_ADDRESS=https://voting-volgograd.welocal.dev/authServiceAddress
AUTH_SERVICE_SECRET_KEY=secret

# Ключ отправителя транзакции
PRIVATE_KEY=7GGyPVkdZe1P6XmiCwwEVqtsjMCYqTxvawQL4eeaH7JY
PUBLIC_KEY=9d5PyQqUnqTTETDBzejT4AAaSC5A6dMa1n7ShRxtne8TsfGxefD4WfZajX5LBA76eNAQbDQsa1RX8Z6M53nphFj

# Как в настройках decrypt-service. Можно также не указывать или оставить "WAVES" для дефолта.
TRANSACTION_FEE_ASSET_ID = WAVES

# txid контракта
CONTRACT_ID=Hc8tcraetYFqTYJJ4iVk1a8SWK1SNbVM8VUNheNB9HF9

CONTRACT_IMAGE=registry.vostokservices.com/voting/voting-contract:cumulative-voting-0.2
CONTRACT_IMAGE_HASH=1f24e814e598114c5f0000373a43bc358beb7ea42b4d05064b1f1694248ddca2
  1. Настроить .env. Не забыть поменять AUTH_SERVICE_SECRET_KEY
  2. Установить зависимости через npm i
  3. Запустить команду npx ts-node examples/updateContractImage.ts
  4. Проверть, что операция прошла успешно, можно через свагер ноды https://voting-volgograd.welocal.dev/node-0/api-docs/index.html#/contracts/getContractInfo