mirror of
https://github.com/luxfi/ledger-sdk.git
synced 2026-10-30 16:21:18 +00:00
main
github.com held commits this host lacked, which refuses the mirror push
("fetch first") and stops github receiving anything at all. Merging rather
than overwriting, so the mirror is a fast-forward again and neither side's
work is dropped.
ledger-sdk
Golang SDK for Using the Lux Ledger App
Example
device, err := Connect()
if err != nil {
panic(err)
}
// Get version
version, commit, name, err := device.Version()
if err != nil {
panic(err)
}
fmt.Printf("version: %s commit: %s name: %s\n", version, commit, name)
// Get Fuji Address
address, err := device.Address("fuji", 0, 0)
if err != nil {
panic(err)
}
fmt.Printf("address: %s\n", address)
// Sign Hash
rawHash := hashing.ComputeHash256([]byte{0x1, 0x2, 0x3, 0x4})
suffixes := [][]uint32{{0, 1}, {0, 3}}
sigs, err := device.SignHash(rawHash, suffixes)
if err != nil {
panic(err)
}
TODO
- Add X-Chain Support (change indices)
- Add C-Chain Support
- Support Transaction Parsing (only sign hashes right now)
NOTE: THIS PROJECT IS ACTIVELY DEVELOPED AND MAY INCUR BREAKING CHANGES
Languages
Shell
53.5%
Go
46.5%