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

@greymass/eosio

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@greymass/eosio - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

6

lib/eosio-core.d.ts
/**
* EOSIO Core v0.1.5
* EOSIO Core v0.1.6
* https://github.com/greymass/eosio-core

@@ -111,2 +111,6 @@ *

static from(value: AssetType): Asset;
static from(value: number, symbol: Asset.SymbolType): Asset;
static fromString(value: string): Asset;
static fromFloat(value: number, symbol: Asset.SymbolType): Asset;
static fromUnits(value: Int64Type, symbol: Asset.SymbolType): Asset;
static fromABI(decoder: ABIDecoder): Asset;

@@ -113,0 +117,0 @@ constructor(units: Int64, symbol: Asset.Symbol);

2

package.json
{
"name": "@greymass/eosio",
"description": "Library for working with EOSIO blockchains",
"version": "0.1.5",
"version": "0.1.6",
"homepage": "https://github.com/greymass/eosio-core",

@@ -6,0 +6,0 @@ "license": "BSD-3-Clause",

import BN from 'bn.js'
import {ABISerializableObject} from '../serializer/serializable'
import {Int64, UInt64} from './integer'
import {Int64, Int64Type, UInt64} from './integer'
import {ABIEncoder} from '../serializer/encoder'

@@ -18,6 +18,22 @@ import {ABIDecoder} from '../serializer/decoder'

static from(value: AssetType) {
static from(value: AssetType): Asset
static from(value: number, symbol: Asset.SymbolType): Asset
static from(value: AssetType | number, symbol?: Asset.SymbolType) {
if (isInstanceOf(value, Asset)) {
return value
}
switch (typeof value) {
case 'number':
if (!symbol) {
throw new Error('Symbol is required when creating Asset from number')
}
return this.fromFloat(value, symbol)
case 'string':
return this.fromString(value)
default:
throw new Error('Invalid asset')
}
}
static fromString(value: string) {
const parts = (typeof value === 'string' ? value : '').split(' ')

@@ -33,2 +49,11 @@ if (parts.length !== 2) {

static fromFloat(value: number, symbol: Asset.SymbolType) {
const s = Asset.Symbol.from(symbol)
return new Asset(s.convertFloat(value), s)
}
static fromUnits(value: Int64Type, symbol: Asset.SymbolType) {
return new Asset(Int64.from(value), Asset.Symbol.from(symbol))
}
static fromABI(decoder: ABIDecoder): Asset {

@@ -35,0 +60,0 @@ const units = Int64.fromABI(decoder)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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