Socket
Socket
Sign inDemoInstall

@berty/api

Package Overview
Dependencies
64
Maintainers
4
Versions
109
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @berty/api

Berty protobuf codegen


Version published
Maintainers
4
Install size
17.5 MB
Created

Readme

Source

@berty/api

Berty protobuf codegen

Setup

Yarn

yarn add @berty/api

NPM

npm install @berty/api

Usage

NodeJS

const beapi = require("@berty/api")

const accountInterface = { displayName: "Alice" }

console.log("as interface:", accountInterface)

const accountBytes = beapi.messenger.Account.encode(accountInterface).finish()

console.log("as bytes:", accountBytes)

const accountObject = beapi.messenger.Account.decode(accountBytes)

console.log("as decoded object:", accountObject)

Output

❯ node .
as interface: { displayName: 'Alice' }
as bytes: <Buffer 12 05 41 6c 69 63 65>
as decoded object: Account { serviceTokens: [], displayName: 'Alice' }

FAQs

Last updated on 15 Jul 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc