services

package
v0.5.0-app-build Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BucketAdi              = []byte("adi")
	BucketMnemonic         = []byte("mnemonic")
	BucketKeyCounter       = []byte("keycounter")
	BucketTransactionCache = []byte("TransactionCache")
)
View Source
var ErrNotEnoughData = errors.BadRequest.With("not enough data")
View Source
var ErrOverflow = errors.BadRequest.With("overflow")

Functions

func LabelForLiteIdentity

func LabelForLiteIdentity(label string) (string, bool)

LabelForLiteIdentity returns the label of the LiteIdentity if label is a valid LiteIdentity account URL. Otherwise, LabelForLiteIdentity returns the original value.

func LabelForLiteTokenAccount

func LabelForLiteTokenAccount(label string) (string, bool)

LabelForLiteTokenAccount returns the identity of the token account if label is a valid token account URL. Otherwise, LabelForLiteTokenAccount returns the original value.

func LabelIsLite

func LabelIsLite(label string) bool

func LabelIsValid

func LabelIsValid(label string) error

func RestoreAccounts

func RestoreAccounts(wallet db.Encrypted) (out string, err error)

Types

type AccountService

type AccountService struct {
	Vaults WalletManager
}

func (*AccountService) AdiList

func (*AccountService) ListAccounts

func (*AccountService) RegisterADI

func (*AccountService) RegisterBook

func (m *AccountService) RegisterBook(ctx context.Context, req *api.RegisterBookRequest) (_ *api.RegisterBookResponse, err error)

func (*AccountService) RegisterTokenAccount

func (*AccountService) UnregisterBook

func (m *AccountService) UnregisterBook(ctx context.Context, req *api.UnregisterBookRequest) (_ *api.UnregisterBookResponse, err error)

type GeneralService

type GeneralService struct{}

func (*GeneralService) Decode

func (*GeneralService) Encode

func (*GeneralService) GenerateMnemonic

func (*GeneralService) Version

type Key

type Key struct {
	api.Key
	Hash []byte
	// contains filtered or unexported fields
}

func (*Key) GetPrivateKey

func (k *Key) GetPrivateKey() ([]byte, bool)

func (*Key) GetPublicKey

func (k *Key) GetPublicKey() ([]byte, bool)

func (*Key) GetPublicKeyHash

func (k *Key) GetPublicKeyHash() ([]byte, bool)

func (*Key) GetType

func (k *Key) GetType() protocol.SignatureType

func (*Key) InitializeFromSeed

func (k *Key) InitializeFromSeed(seed []byte, signatureType protocol.SignatureType, hdPath string) error

func (*Key) NativeAddress

func (k *Key) NativeAddress() (address string, err error)

func (*Key) PublicKeyHash

func (k *Key) PublicKeyHash() []byte

func (*Key) String

func (k *Key) String() string

type KeyService

type KeyService struct {
	Vaults WalletManager
}

func (*KeyService) FindSigner

func (*KeyService) GenerateAddress

func (*KeyService) ImportKey

func (*KeyService) KeyAssign

func (*KeyService) KeyList

func (*KeyService) KeyRemove

func (*KeyService) KeyRename

func (*KeyService) ResolveKey

type LedgerManager

type LedgerManager interface {
	Wallets() ([]*api.LedgerWalletInfo, error)
	Derive(id *url.URL, path bip44.Derivation, pin, display bool, labels ...string) (address.Address, error)
	Sign(id *url.URL, path bip44.Derivation, txn *protocol.Transaction, sig protocol.Signature) (protocol.Signature, error)
}

type LedgerService

type LedgerService struct {
	Vaults WalletManager
	Ledger LedgerManager
}

func (*LedgerService) LedgerGenerateKey

func (s *LedgerService) LedgerGenerateKey(_ context.Context, req *api.GenerateLedgerKeyRequest) (*api.Key, error)

func (*LedgerService) LedgerQueryWallets

func (s *LedgerService) LedgerQueryWallets(_ context.Context) (*api.LedgerWalletResponse, error)

type SigningService

type SigningService struct {
	Vaults WalletManager
	Ledger LedgerManager
}

func (*SigningService) ResetLastUsedOn

func (*SigningService) Sign

func (s *SigningService) Sign(_ context.Context, req *api.SignRequest) (_ *api.SignResponse, err error)

func (*SigningService) SignMessage

func (s *SigningService) SignMessage(_ context.Context, req *api.SignMessageRequest) (_ *api.SignResponse, err error)

func (*SigningService) SignTransaction

func (s *SigningService) SignTransaction(_ context.Context, req *api.SignTransactionRequest) (_ *api.SignResponse, err error)

type TransactionService

type TransactionService struct {
	Vaults WalletManager
}

func (*TransactionService) AddMemoToTransaction

func (*TransactionService) AddSendTokensOutput

func (*TransactionService) CreateEnvelope

func (*TransactionService) CreateTransaction

func (*TransactionService) DeleteTransaction

func (*TransactionService) GetTransaction

func (*TransactionService) ListTransactions

func (*TransactionService) WriteDataTransaction

func (m *TransactionService) WriteDataTransaction(_ context.Context, req *api.WriteDataRequest) (*api.TransactionResponse, error)

type VaultService

type VaultService struct {
	Vaults WalletManager
}

func (*VaultService) AdoptVault

func (m *VaultService) AdoptVault(ctx context.Context, req *api.AdoptVaultRequest) (_ *api.AdoptVaultResponse, err error)

func (*VaultService) ConvertWallet

func (*VaultService) CreateVault

func (m *VaultService) CreateVault(ctx context.Context, req *api.CreateVaultRequest) (_ *api.CreateVaultResponse, err error)

func (*VaultService) CreateWallet

func (*VaultService) EncryptVault

func (*VaultService) ExportVault

func (*VaultService) ImportMnemonic

func (*VaultService) ImportVault

func (*VaultService) ListVaults

func (*VaultService) LockVault

func (*VaultService) OpenVault

func (*VaultService) Set1PasswordRef

func (*VaultService) Status

func (*VaultService) UnlockVault

type WalletManager

type WalletManager interface {
	UseMemDB() bool
	Each(fn func(*vault.Wallet) error) error
	GetWallet(walletDir string) *vault.Wallet
	Get(wallet, vault string, passphrase []byte) (*vault.Vault, error)
	GetModel(wallet, vault string, passphrase []byte) (*model.Model, error)
}

Jump to

Keyboard shortcuts

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