adapter

package
v0.0.0-...-9232201 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAdapter

func GetAdapter(coinType uint16, seed []byte, derivationPath string) (baseadapter.IBlockchainAdapter, error)

GetAdapter returns suitable adapter depending on coin type

Types

type BitcoinAdapter

type BitcoinAdapter struct {
	baseadapter.BitcoinBaseAdapter
}

func NewBitcoinAdapter

func NewBitcoinAdapter(seed []byte, derivationPath string, isDev bool) *BitcoinAdapter

type BitsharesAdapter

type BitsharesAdapter struct {
	baseadapter.BlockchainAdapter
	// contains filtered or unexported fields
}

BitsharesAdapter - Ethereum blockchain transaction adapter

func NewBitsharesAdapter

func NewBitsharesAdapter(seed []byte, derivationPath string, isDev bool) *BitsharesAdapter

NewBitsharesAdapter constructor function for BitsharesAdapter sets seed, derivation path as internal data

func (*BitsharesAdapter) CreateSignedTransaction

func (e *BitsharesAdapter) CreateSignedTransaction(payload string, backendLogger log.Logger) (string, error)

CreateSignedTransaction creates and signs raw transaction from transaction digest + private key

func (*BitsharesAdapter) DeriveAddress

func (e *BitsharesAdapter) DeriveAddress(logger log.Logger) (string, error)

DeriveAddress Address in Bitsahres can be avoided for most cases by using account names instead. However it is needed for "nathan"

func (*BitsharesAdapter) DerivePrivateKey

func (e *BitsharesAdapter) DerivePrivateKey(backendLogger log.Logger) (string, error)

DerivePrivateKey Derives Private Key from mnemonic coressponding to a hard coded derivation path i.e "m/44'/69'/69'/69/69" for bitshares, to obtain private key and checks for errors.

func (*BitsharesAdapter) DerivePublicKey

func (e *BitsharesAdapter) DerivePublicKey(logger log.Logger) (string, error)

DerivePublicKey returns the public key for BTS format.

func (*BitsharesAdapter) GetBlockchainNetwork

func (e *BitsharesAdapter) GetBlockchainNetwork() string

GetBlockchainNetwork returns network config. Default isDev=false i.e. Mainnet for Bitshares as it is not needed for BTS.

type EthereumAdapter

type EthereumAdapter struct {
	baseadapter.BlockchainAdapter
	// contains filtered or unexported fields
}

EthereumAdapter - Ethereum blockchain transaction adapter

func NewEthereumAdapter

func NewEthereumAdapter(seed []byte, derivationPath string, isDev bool) *EthereumAdapter

NewEthereumAdapter constructor function for EthereumAdapter sets seed, derivation path as internal data

func (*EthereumAdapter) CreateSignature

func (e *EthereumAdapter) CreateSignature(payload string, backendLogger log.Logger) (string, error)

CreateSignature creates and signs hex message from payload data + private key

func (*EthereumAdapter) CreateSignedTransaction

func (e *EthereumAdapter) CreateSignedTransaction(payload string, backendLogger log.Logger) (string, error)

CreateSignedTransaction creates and signs raw transaction from payload data + private key

func (*EthereumAdapter) DeriveAddress

func (e *EthereumAdapter) DeriveAddress(logger log.Logger) (string, error)

func (*EthereumAdapter) DerivePrivateKey

func (e *EthereumAdapter) DerivePrivateKey(backendLogger log.Logger) (string, error)

DerivePrivateKey Derives derivation path to obtain private key checks for errors

func (*EthereumAdapter) DerivePublicKey

func (e *EthereumAdapter) DerivePublicKey(logger log.Logger) (string, error)

func (*EthereumAdapter) GetBlockchainNetwork

func (e *EthereumAdapter) GetBlockchainNetwork() string

GetBlockchainNetwork returns network config default isDev=false i.e. Mainnet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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