lib

package
v0.0.0-...-f886bfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerivePrivateKey

func DerivePrivateKey(seed []byte, path string, isDev bool) (*btcec.PrivateKey, error)

DerivePrivateKey derives the private key of the derivation path.

func GenerateMnemonic

func GenerateMnemonic() (string, error)

GenerateMnemonic will return a string consisting of the mnemonic words for the default entropy = 256. If the provide entropy is invalid, an error will be returned.

func IsMnemonicValid

func IsMnemonicValid(mnemonic string) bool

IsMnemonicValid attempts to verify that the provided mnemonic is valid. Validity is determined by both the number of words being appropriate, and that all the words in the mnemonic are present in the word list.

func MnemonicFromEntropy

func MnemonicFromEntropy(entropyLength int) (string, error)

MnemonicFromEntropy will return a string consisting of the mnemonic words for the given entropy.

func SeedFromMnemonic

func SeedFromMnemonic(mnemonic, passphrase string) ([]byte, error)

SeedFromMnemonic creates a hashed seed output given a provided string and password. No checking is performed to validate that the string provided is a valid mnemonic.

Types

type BitcoinRawTx

type BitcoinRawTx struct {
	Inputs []struct {
		Txhash string `json:"txhash"`
		Vout   uint32 `json:"vout"`
	} `json:"inputs"`
	Outputs []struct {
		Address string `json:"address"`
		Amount  int64  `json:"amount"`
	} `json:"outputs"`
	IRawTx
}

BitcoinRawTx stores bitcoin based raw transaction payloads stores input UTXO's and output Addresses implements IRawTx

type BitsharesRawTx

type BitsharesRawTx struct {
	TransactionDigest string `json:"transactionDigest"`
	IRawTx
}

BitsharesRawTx Ethereum raw transaction implements IRawTx to store raw Bitshares JSON payload Bitshares' Payload will only have a hex encoded string that would represent the transaction digest.

type EthereumRawTx

type EthereumRawTx struct {
	Nonce    uint64   `json:"nonce"`
	Value    *big.Int `json:"value"`
	GasLimit uint64   `json:"gasLimit"`
	GasPrice *big.Int `json:"gasPrice"`
	To       string   `json:"to"`
	Data     string   `json:"data"`
	ChainID  *big.Int `json:"chainId"`
	IRawTx
}

EthereumRawTx Ethereum raw transaction implements IRawTx to store raw Ethereum JSON payload

type IRawTx

type IRawTx interface{}

IRawTx Raw transaction interface to enable decoding of all variants of raw transactions (JSON)

func DecodeRawTransaction

func DecodeRawTransaction(coinType uint16, payload string) (IRawTx, error)

DecodeRawTransaction decodes input payload into suitable raw transaction depending on cointype provided returns error if no supported coin type found TODO: improve this

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL