cmeone / chia-utils Goto Github PK
View Code? Open in Web Editor NEWA set of JavaScript utilities to facilitate conversions for the Chia network
License: GNU Affero General Public License v3.0
A set of JavaScript utilities to facilitate conversions for the Chia network
License: GNU Affero General Public License v3.0
var amount = 0.5994
var parent_coin_info = '0x5db7892bd03b7ddc6368646250d7bafeff19bf64517c1b901d32ce3bd8ce3e7d'
var puzzle_hash = '0xc2f1ff148e091196c8cf415db67f8381ab0d91b5b71ee7841a1bbd96b2923f44'
get_coin_info result is 0xc8fa5267c1cff10a860e715fedf0d423a6399cf4d7b1cfe398e9d737c66bb302, different from site:
the amountHex result is '8b8f062a00', but the right result is '008b8f062a00'
I use this code to fix
const fixPreLength = (num, len) => (Array(len).join(0) + num).slice(-len)
let amountHex = amount.toString(16)
const byte_count = (amount.toString(2).length + 8) >> 3
amountHex = fixPreLength(amountHex, byte_count * 2)
so, how the get_coin_info function to do with this bug?
I'm trying to use chia-utils in Vue 2 app, code looks like this in main.js:
import { puzzle_hash_to_address } from 'chia-utils'
The error message in browser (Firefox) is:
Uncaught TypeError: window.Buffer is undefined
chia-utils.js:9863
I guess it was because in Vue 2.x, window object only accessible after mounted, but chia-utils tried to access window.Buffer just inside import initialization code.
Any way to solve this?
Thank you.
TypeError: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "BooleanLiteral"
is there any lib can do this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.