cpacia / bchutil Goto Github PK
View Code? Open in Web Editor NEWBitcoin Cash Utilities
License: MIT License
Bitcoin Cash Utilities
License: MIT License
Is this normal:
hash160, _, err := base58.CheckDecode("1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX")
a, b := bchutil.NewBitpayAddressPubKeyHash(hash160, &chaincfg.MainNetParams)
if b != nil {
fmt.Println("%v", err)
os.Exit(1)
}
fmt.Println(a.EncodeAddress())
prints
CWUmjdL9q4G1Rz6o2MDGoMExivHgEnCgDx
hash160, _, err := base58.CheckDecode("1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX")
a, b := bchutil.NewCashAddressPubKeyHash(hash160, &chaincfg.MainNetParams)
if b != nil {
fmt.Println("%v", err)
os.Exit(1)
}
fmt.Println(a.EncodeAddress())
prints
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/cpacia/bchutil.Encode(0x11494c8, 0xb, 0xc420014760, 0x15, 0x20, 0xc420014760, 0x1)
/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:248 +0x23a
github.com/cpacia/bchutil.CheckEncode(0xc420403f48, 0x14, 0x14, 0x11494c8, 0xb, 0x0, 0xc420014740, 0x0)
/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:342 +0xc9
github.com/cpacia/bchutil.encodeAddress(0xc420403f48, 0x14, 0x14, 0x11494c8, 0xb, 0x0, 0xc420096120, 0xc420014740)
/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:366 +0x62
github.com/cpacia/bchutil.(*CashAddressPubKeyHash).EncodeAddress(0xc420403f48, 0xc420014740, 0x14)
/Users/j/go/src/github.com/cpacia/bchutil/cashaddr.go:440 +0x58
main.main()
/Users/j/go/src/github.com/DesWurstes/Cashaddr/main.go:44 +0x188
Let's say one wants to use github.com/btcsuite/btcd/rpcclient
, rpcclient.SignRawTransaction(unsignedtransaction)
. How to do that using this tool so that it'd be compatible with BCC?
First off, thanks for sharing this.
I'm trying to figure out how to use it exactly, any help hugely appreciated if you have time
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.