client

package
v0.0.0-...-76c1feb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersion

type APIVersion string

APIVersion is used to define which server side API version would be used when making http requests to the server

const (
	// APIVersionV1 suggests that the RestClient would use v1 calls whenever it's available for the given request.
	APIVersionV1 APIVersion = "v1"
)

type KMDClient

type KMDClient struct {
	// contains filtered or unexported fields
}

KMDClient is the client used to interact with the kmd API over its socket

func MakeKMDClient

func MakeKMDClient(address string, apiToken string) (KMDClient, error)

MakeKMDClient instantiates a KMDClient for the given sockFile and apiToken

func (KMDClient) CreateWallet

func (kcl KMDClient) CreateWallet(walletName []byte, walletDriverName string, walletPassword []byte, walletMDK crypto.MasterDerivationKey) (resp kmdapi.APIV1POSTWalletResponse, err error)

CreateWallet wraps kmdapi.APIV1POSTWalletRequest

func (KMDClient) DeleteKey

func (kcl KMDClient) DeleteKey(walletHandle []byte, pw []byte, addr string) (resp kmdapi.APIV1DELETEKeyResponse, err error)

DeleteKey wraps kmdapi.APIV1DELETEKeyRequest

func (KMDClient) DeleteMultisigAddr

func (kcl KMDClient) DeleteMultisigAddr(walletHandle []byte, pw []byte, addr string) (resp kmdapi.APIV1DELETEMultisigResponse, err error)

DeleteMultisigAddr wraps kmdapi.APIV1DELETEMultisigRequest

func (KMDClient) DoV1Request

func (kcl KMDClient) DoV1Request(req kmdapi.APIV1Request, resp kmdapi.APIV1Response) error

DoV1Request accepts a request from kmdapi/requests and

func (KMDClient) ExportMasterDerivationKey

func (kcl KMDClient) ExportMasterDerivationKey(walletHandle []byte, walletPassword []byte) (resp kmdapi.APIV1POSTMasterKeyExportResponse, err error)

ExportMasterDerivationKey wraps kmdapi.APIV1POSTMasterKeyExportRequest

func (KMDClient) ExportMultisigAddr

func (kcl KMDClient) ExportMultisigAddr(walletHandle []byte, addr string) (resp kmdapi.APIV1POSTMultisigExportResponse, err error)

ExportMultisigAddr wraps kmdapi.APIV1POSTMultisigExportRequest

func (KMDClient) GenerateKey

func (kcl KMDClient) GenerateKey(walletHandle []byte) (resp kmdapi.APIV1POSTKeyResponse, err error)

GenerateKey wraps kmdapi.APIV1POSTKeyRequest

func (KMDClient) ImportKey

func (kcl KMDClient) ImportKey(walletHandle []byte, secretKey crypto.PrivateKey) (resp kmdapi.APIV1POSTKeyImportResponse, err error)

ImportKey wraps kmdapi.APIV1POSTKeyImportRequest

func (KMDClient) ImportMultisigAddr

func (kcl KMDClient) ImportMultisigAddr(walletHandle []byte, version, threshold uint8, pks []crypto.PublicKey) (resp kmdapi.APIV1POSTMultisigImportResponse, err error)

ImportMultisigAddr wraps kmdapi.APIV1POSTMultisigImportRequest

func (KMDClient) InitWallet

func (kcl KMDClient) InitWallet(walletID []byte, walletPassword []byte) (resp kmdapi.APIV1POSTWalletInitResponse, err error)

InitWallet wraps kmdapi.APIV1POSTWalletInitRequest

func (KMDClient) ListKeys

func (kcl KMDClient) ListKeys(walletHandle []byte) (resp kmdapi.APIV1POSTKeyListResponse, err error)

ListKeys wraps kmdapi.APIV1POSTKeyListRequest

func (KMDClient) ListMultisigAddrs

func (kcl KMDClient) ListMultisigAddrs(walletHandle []byte) (resp kmdapi.APIV1POSTMultisigListResponse, err error)

ListMultisigAddrs wraps kmdapi.APIV1POSTMultisigListRequest

func (KMDClient) ListWallets

func (kcl KMDClient) ListWallets() (resp kmdapi.APIV1GETWalletsResponse, err error)

ListWallets wraps kmdapi.APIV1GETWalletsRequest

func (KMDClient) MultisigSignProgram

func (kcl KMDClient) MultisigSignProgram(walletHandle, pw []byte, addr string, data []byte, pk crypto.PublicKey, partial crypto.MultisigSig) (resp kmdapi.APIV1POSTMultisigProgramSignResponse, err error)

MultisigSignProgram wraps kmdapi.APIV1POSTMultisigProgramSignRequest

func (KMDClient) MultisigSignTransaction

func (kcl KMDClient) MultisigSignTransaction(walletHandle, pw []byte, tx []byte, pk crypto.PublicKey, partial crypto.MultisigSig, msigSigner crypto.Digest) (resp kmdapi.APIV1POSTMultisigTransactionSignResponse, err error)

MultisigSignTransaction wraps kmdapi.APIV1POSTMultisigTransactionSignRequest

func (KMDClient) ReleaseWalletHandle

func (kcl KMDClient) ReleaseWalletHandle(walletHandle []byte) (resp kmdapi.APIV1POSTWalletReleaseResponse, err error)

ReleaseWalletHandle wraps kmdapi.APIV1POSTWalletReleaseRequest

func (KMDClient) RenewWalletHandle

func (kcl KMDClient) RenewWalletHandle(walletHandle []byte) (resp kmdapi.APIV1POSTWalletRenewResponse, err error)

RenewWalletHandle wraps kmdapi.APIV1POSTKeyListRequest

func (KMDClient) SignProgram

func (kcl KMDClient) SignProgram(walletHandle, pw []byte, addr string, data []byte) (resp kmdapi.APIV1POSTProgramSignResponse, err error)

SignProgram wraps kmdapi.APIV1POSTProgramSignRequest

func (KMDClient) SignTransaction

func (kcl KMDClient) SignTransaction(walletHandle, pw []byte, pk crypto.PublicKey, tx transactions.Transaction) (resp kmdapi.APIV1POSTTransactionSignResponse, err error)

SignTransaction wraps kmdapi.APIV1POSTTransactionSignRequest

func (KMDClient) Version

func (kcl KMDClient) Version() (resp kmdapi.VersionsResponse, err error)

Version wraps kmdapi.VersionsRequest

Jump to

Keyboard shortcuts

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