Giter Club home page Giter Club logo

chia-utils's Introduction

chia-utils's People

Contributors

cmeone avatar dkackman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chia-utils's Issues

get_coin_info bug

var amount = 0.5994
var parent_coin_info = '0x5db7892bd03b7ddc6368646250d7bafeff19bf64517c1b901d32ce3bd8ce3e7d'
var puzzle_hash = '0xc2f1ff148e091196c8cf415db67f8381ab0d91b5b71ee7841a1bbd96b2923f44'

get_coin_info result is 0xc8fa5267c1cff10a860e715fedf0d423a6399cf4d7b1cfe398e9d737c66bb302, different from site:

https://www.chiaexplorer.com/blockchain/coin/0x226bee197e358e60c25d907d5ad2db0c4508861a1d66b8438602bb31ac43aa0c

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?

Can't import properly in Vue 2.x app

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.