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

@arcblock/forge-proto

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/forge-proto - npm Package Compare versions

Comparing version 0.20.1 to 0.20.5

45

init.js

@@ -0,1 +1,6 @@

/**
* @fileOverview Contains all static generated javascript files from forge-abi and forge-core-protocols
* @module @arcblock/forge-proto
*/
const get = require('lodash.get');

@@ -113,3 +118,9 @@ const json = require('./lib/spec.json');

// Search for a type and its fields descriptor
//
/**
* Search for a type and its fields descriptor, then the result can be used to create a protobuf message
*
* @param {string} type - such as `Transaction`, or `TransferTx`
* @returns {object}
*/
function getMessageType(type) {

@@ -124,2 +135,12 @@ const { fields, oneofs } = get(spec, type) || get(spec, `abci_vendor.${type}`) || {};

/**
* Convert type name to typeUrl, return input when no match found
*
* ```javascript
* toTypeUrl('StakeTx') // 'fg:t:stake'
* ```
*
* @param {string} type
* @returns {string}
*/
function toTypeUrl(type) {

@@ -129,2 +150,12 @@ return get(typeUrls, type) || type;

/**
* Convert typeUrl string to type constructor name, return input when no match found
*
* ```javascript
* fromTypeUrl('fg:t:stake') // StakeTx
* ```
*
* @param {string} url
* @returns {string}
*/
function fromTypeUrl(url) {

@@ -140,4 +171,16 @@ const found = Object.entries(typeUrls).find(([, value]) => value === url);

return {
/**
* All enum types and its values (number format), can be accessed from width: enums.KEY_TYPE.ED25519
*
* @member
*/
enums,
/**
* All enum types and its values (human readable string format), can be accessed from width: messages.KEY_TYPE.ED25519
*
* @member
*/
messages,
transactions: enums.SupportedTxs,

@@ -144,0 +187,0 @@ stakes: enums.SupportedStakes,

4

package.json
{
"name": "@arcblock/forge-proto",
"description": "Static modules generated from forge-sdk protobuf files",
"version": "0.20.1",
"version": "0.20.5",
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",

@@ -62,3 +62,3 @@ "engines": {

},
"gitHead": "081809219385c09c6198bde48f9200eac107412b"
"gitHead": "b8526f942e8a04bcbeb47b0d6e1bd77570a29dd2"
}
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