Socket
Book a DemoInstallSign in
Socket

@vegaprotocol/protos

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vegaprotocol/protos

Protocol Buffer messages for Vega in Javascript

0.26.0
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

@vegaprotocol/protos

Protocol Buffer messages for Vega in Javascript

Example

import * as InputData from '@vegaprotocol/protos/vega/commands/v1/InputData/encode'
import * as Transaction from '@vegaprotocol/protos/vega/commands/v1/Transaction/encode'
import * as AccountType from '@vegaprotocol/protos/vega/AccountType'

const inputData = InputData.encode({
  nonce: 10,
  command: {
    transfer: {
      fromAccountType: AccountType.ACCOUNT_TYPE_GENERAL,
      to: 'abcdefg',
      toAccountType: AccountType.ACCOUNT_TYPE_GENERAL,
      asset: 'BTC',
      amount: '1'
    }
  }
})

const tx = Transaction.encode({
  inputData: inputData,
  version: 3,
  from: {
    pubKey: 'foo'// new Uint8Array(86)
  },
  signature: {
    version: 2,
    algo: 'vega/ed25519',
    value: 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
  },
  proofOfWork: {
    hashFunction: 'sha3_24_rounds',
    tid: 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
  }
})

Install

npm install @vegaprotocol/protos

Contributing

Building the Javascript bindings requires protoc and make to be installed on the system. After cloning run npm install and then make dist to generate the bindings.

vega is added as a git submodule. The goal is to release a new version to npm, tracking the vega versions. To update the tracked tag, cd vega and checkout the desired commitish, and commit this version in the this repository.

License

MIT

FAQs

Package last updated on 12 Nov 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.