Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@berty/api

Package Overview
Dependencies
Maintainers
4
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@berty/api

Berty protobuf codegen

  • 2.420.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
222
increased by3600%
Maintainers
4
Weekly downloads
 
Created
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc