Documentation ¶
Index ¶
- Variables
- func LabelForLiteIdentity(label string) (string, bool)
- func LabelForLiteTokenAccount(label string) (string, bool)
- func LabelIsLite(label string) bool
- func LabelIsValid(label string) error
- func RestoreAccounts(wallet db.DB) (out string, err error)
- func SanitizedCopy(dst, src db.DB) error
- type AccountService
- func (m *AccountService) AdiList(_ context.Context, req *api.AdiListRequest) (*api.AdiListResponse, error)
- func (m *AccountService) ListAccounts(_ context.Context, req *api.ListAccountsRequest) (*api.ListAccountsResponse, error)
- func (m *AccountService) RegisterADI(_ context.Context, req *api.RegisterADIRequest) (*api.RegisterADIResponse, error)
- func (m *AccountService) RegisterBook(ctx context.Context, req *api.RegisterBookRequest) (_ *api.RegisterBookResponse, err error)
- func (m *AccountService) RegisterTokenAccount(ctx context.Context, req *api.RegisterTokenAccountRequest) (*api.RegisterTokenAccountResponse, error)
- func (m *AccountService) UnregisterBook(ctx context.Context, req *api.UnregisterBookRequest) (_ *api.UnregisterBookResponse, err error)
- func (m *AccountService) UnregisterTokenAccount(_ context.Context, req *api.UnregisterTokenAccountRequest) (*api.UnregisterTokenAccountResponse, error)
- type GeneralService
- func (*GeneralService) Decode(_ context.Context, req *api.DecodeRequest) (*api.DecodeResponse, error)
- func (*GeneralService) Encode(_ context.Context, req *api.EncodeRequest) (*api.EncodeResponse, error)
- func (*GeneralService) GenerateMnemonic(_ context.Context, req *api.GenerateMnemonicRequest) (*api.GenerateMnemonicResponse, error)
- func (g *GeneralService) RefreshToken(_ context.Context, req *api.RefreshTokenRequest) (*api.RefreshTokenResponse, error)
- func (*GeneralService) Version(_ context.Context) (*api.VersionResponse, error)
- type Key
- func (k *Key) GetPrivateKey() ([]byte, bool)
- func (k *Key) GetPublicKey() ([]byte, bool)
- func (k *Key) GetPublicKeyHash() ([]byte, bool)
- func (k *Key) GetType() protocol.SignatureType
- func (k *Key) InitializeFromSeed(seed []byte, signatureType protocol.SignatureType, hdPath string) error
- func (k *Key) NativeAddress() (address string, err error)
- func (k *Key) PublicKeyHash() []byte
- func (k *Key) String() string
- type KeyService
- func (m *KeyService) FindSigner(_ context.Context, req *api.FindSignerRequest) (*api.FindSignerResponse, error)
- func (s *KeyService) GenerateAddress(_ context.Context, req *api.GenerateAddressRequest) (*api.GenerateAddressResponse, error)
- func (s *KeyService) ImportKey(ctx context.Context, req *api.ImportKeyRequest) (*api.ResolveKeyResponse, error)
- func (m *KeyService) KeyAssign(_ context.Context, req *api.KeyRotateRequest) (*api.KeyRotateResponse, error)
- func (m *KeyService) KeyList(_ context.Context, req *api.KeyListRequest) (*api.KeyListResponse, error)
- func (m *KeyService) KeyRemove(_ context.Context, req *api.KeyRotateRequest) (*api.KeyRotateResponse, error)
- func (m *KeyService) KeyRename(_ context.Context, req *api.KeyRotateRequest) (*api.KeyRotateResponse, error)
- func (s *KeyService) ResolveKey(_ context.Context, req *api.ResolveKeyRequest) (*api.ResolveKeyResponse, error)
- func (s *KeyService) RestoreKeyCounters(ctx context.Context, req *api.RestoreKeyCountersRequest) (*api.RestoreKeyCountersResponse, error)
- type KeyStore
- type LedgerManager
- type LedgerService
- type SigningService
- func (s *SigningService) ResetLastUsedOn(_ context.Context, req *api.ResetLastUsedOnRequest) (*api.ResetLastUsedOnResponse, error)
- func (s *SigningService) Sign(_ context.Context, req *api.SignRequest) (_ *api.SignResponse, err error)
- func (s *SigningService) SignMessage(_ context.Context, req *api.SignMessageRequest) (_ *api.SignResponse, err error)
- func (s *SigningService) SignTransaction(_ context.Context, req *api.SignTransactionRequest) (_ *api.SignResponse, err error)
- type SimpleDaemon
- type TokenKeyStore
- func (s *TokenKeyStore) DeleteKey(v Vault, token []byte) error
- func (s *TokenKeyStore) GetKey(v Vault, token []byte) (*memguard.Enclave, error)
- func (s *TokenKeyStore) PutKey(v Vault, token []byte, ttl time.Duration, key *memguard.Enclave) (*time.Time, error)
- func (s *TokenKeyStore) PutPassphrase(v Vault, token []byte, ttl time.Duration, passphrase *memguard.Enclave) (*time.Time, error)
- func (s *TokenKeyStore) RefreshToken(oldToken, newToken []byte, ttl time.Duration) (*time.Time, error)
- type TransactionService
- func (m *TransactionService) AddMemoToTransaction(_ context.Context, req *api.AddMemoToTransactionRequest) (*api.TransactionResponse, error)
- func (m *TransactionService) AddSendTokensOutput(_ context.Context, req *api.AddSendTokensOutputRequest) (*api.TransactionResponse, error)
- func (m *TransactionService) CreateEnvelope(_ context.Context, req *api.CreateEnvelopeRequest) (*api.CreateEnvelopeResponse, error)
- func (m *TransactionService) CreateTransaction(_ context.Context, req *api.CreateTransactionRequest) (*api.TransactionResponse, error)
- func (m *TransactionService) DeleteTransaction(_ context.Context, req *api.DeleteTransactionRequest) (*api.TransactionResponse, error)
- func (m *TransactionService) GetTransaction(_ context.Context, req *api.GetTransactionRequest) (*api.TransactionResponse, error)
- func (m *TransactionService) ListTransactions(_ context.Context, req *api.ListTransactionsRequest) (*api.ListTransactionsResponse, error)
- func (m *TransactionService) WriteDataTransaction(_ context.Context, req *api.WriteDataRequest) (*api.TransactionResponse, error)
- type Vault
- type VaultService
- func (m *VaultService) AdoptVault(ctx context.Context, req *api.AdoptVaultRequest) (_ *api.AdoptVaultResponse, err error)
- func (m *VaultService) ConvertWallet(ctx context.Context, req *api.ConvertWalletRequest) (*api.ConvertWalletResponse, error)
- func (m *VaultService) CopyVaultSanitized(ctx context.Context, req *api.CopyVaultSanitizedRequest) (*api.CopyVaultSanitizedResponse, error)
- func (m *VaultService) CreateVault(ctx context.Context, req *api.CreateVaultRequest) (_ *api.CreateVaultResponse, err error)
- func (m *VaultService) CreateWallet(ctx context.Context, req *api.CreateWalletRequest) (*api.CreateWalletResponse, error)
- func (m *VaultService) EncryptVault(ctx context.Context, req *api.EncryptVaultRequest) (*api.EncryptVaultResponse, error)
- func (m *VaultService) ExportVault(_ context.Context, req *api.ExportVaultRequest) (*api.ExportVaultResponse, error)
- func (m *VaultService) ImportMnemonic(_ context.Context, req *api.ImportMnemonicRequest) (*api.ImportMnemonicResponse, error)
- func (m *VaultService) ImportVault(ctx context.Context, req *api.ImportVaultRequest) (*api.ImportVaultResponse, error)
- func (m *VaultService) ListVaults(ctx context.Context, req *api.ListVaultsRequest) (*api.ListVaultsResponse, error)
- func (m *VaultService) LockVault(_ context.Context, req *api.LockVaultRequest) (*api.LockVaultResponse, error)
- func (m *VaultService) OpenVault(ctx context.Context, req *api.OpenVaultRequest) (*api.OpenVaultResponse, error)
- func (m *VaultService) Set1PasswordRef(ctx context.Context, req *api.Set1PasswordRefRequest) (*api.Set1PasswordRefResponse, error)
- func (m *VaultService) Status(ctx context.Context, req *api.StatusRequest) (*api.StatusResponse, error)
- func (m *VaultService) UnlockVault(_ context.Context, req *api.UnlockVaultRequest) (*api.UnlockVaultResponse, error)
- type VaultWithKeys
- func (v *VaultWithKeys) Create(token []byte) (*model.Model, error)
- func (v *VaultWithKeys) Open(token []byte) (*model.Model, error)
- func (v *VaultWithKeys) OpenRaw(token []byte) (*model.Model, error)
- func (v *VaultWithKeys) Status(token []byte) (*api.VaultStatus, error)
- func (v *VaultWithKeys) Unwrap() *vault.Vault
- func (v *VaultWithKeys) With(token []byte, fn func(*model.Model) error) error
- type Wallet
- type WalletManager
- type WalletManagerWithKeys
- type WalletWithKeys
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 ¶
LabelForLiteIdentity returns the label of the LiteIdentity if label is a valid LiteIdentity account URL. Otherwise, LabelForLiteIdentity returns the original value.
func LabelForLiteTokenAccount ¶
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 LabelIsValid ¶
func SanitizedCopy ¶ added in v0.6.3
Types ¶
type AccountService ¶
type AccountService struct {
Vaults WalletManager
}
func (*AccountService) AdiList ¶
func (m *AccountService) AdiList(_ context.Context, req *api.AdiListRequest) (*api.AdiListResponse, error)
func (*AccountService) ListAccounts ¶
func (m *AccountService) ListAccounts(_ context.Context, req *api.ListAccountsRequest) (*api.ListAccountsResponse, error)
func (*AccountService) RegisterADI ¶
func (m *AccountService) RegisterADI(_ context.Context, req *api.RegisterADIRequest) (*api.RegisterADIResponse, error)
func (*AccountService) RegisterBook ¶
func (m *AccountService) RegisterBook(ctx context.Context, req *api.RegisterBookRequest) (_ *api.RegisterBookResponse, err error)
func (*AccountService) RegisterTokenAccount ¶
func (m *AccountService) RegisterTokenAccount(ctx context.Context, req *api.RegisterTokenAccountRequest) (*api.RegisterTokenAccountResponse, error)
func (*AccountService) UnregisterBook ¶
func (m *AccountService) UnregisterBook(ctx context.Context, req *api.UnregisterBookRequest) (_ *api.UnregisterBookResponse, err error)
func (*AccountService) UnregisterTokenAccount ¶
func (m *AccountService) UnregisterTokenAccount(_ context.Context, req *api.UnregisterTokenAccountRequest) (*api.UnregisterTokenAccountResponse, error)
type GeneralService ¶
func (*GeneralService) Decode ¶
func (*GeneralService) Decode(_ context.Context, req *api.DecodeRequest) (*api.DecodeResponse, error)
func (*GeneralService) Encode ¶
func (*GeneralService) Encode(_ context.Context, req *api.EncodeRequest) (*api.EncodeResponse, error)
func (*GeneralService) GenerateMnemonic ¶
func (*GeneralService) GenerateMnemonic(_ context.Context, req *api.GenerateMnemonicRequest) (*api.GenerateMnemonicResponse, error)
func (*GeneralService) RefreshToken ¶ added in v0.6.0
func (g *GeneralService) RefreshToken(_ context.Context, req *api.RefreshTokenRequest) (*api.RefreshTokenResponse, error)
func (*GeneralService) Version ¶
func (*GeneralService) Version(_ context.Context) (*api.VersionResponse, error)
type Key ¶
func (*Key) GetPrivateKey ¶
func (*Key) GetPublicKey ¶
func (*Key) GetPublicKeyHash ¶
func (*Key) GetType ¶
func (k *Key) GetType() protocol.SignatureType
func (*Key) InitializeFromSeed ¶
func (*Key) NativeAddress ¶
func (*Key) PublicKeyHash ¶
type KeyService ¶
type KeyService struct {
Vaults WalletManager
}
func (*KeyService) FindSigner ¶
func (m *KeyService) FindSigner(_ context.Context, req *api.FindSignerRequest) (*api.FindSignerResponse, error)
func (*KeyService) GenerateAddress ¶
func (s *KeyService) GenerateAddress(_ context.Context, req *api.GenerateAddressRequest) (*api.GenerateAddressResponse, error)
func (*KeyService) ImportKey ¶
func (s *KeyService) ImportKey(ctx context.Context, req *api.ImportKeyRequest) (*api.ResolveKeyResponse, error)
func (*KeyService) KeyAssign ¶
func (m *KeyService) KeyAssign(_ context.Context, req *api.KeyRotateRequest) (*api.KeyRotateResponse, error)
func (*KeyService) KeyList ¶
func (m *KeyService) KeyList(_ context.Context, req *api.KeyListRequest) (*api.KeyListResponse, error)
func (*KeyService) KeyRemove ¶
func (m *KeyService) KeyRemove(_ context.Context, req *api.KeyRotateRequest) (*api.KeyRotateResponse, error)
func (*KeyService) KeyRename ¶
func (m *KeyService) KeyRename(_ context.Context, req *api.KeyRotateRequest) (*api.KeyRotateResponse, error)
func (*KeyService) ResolveKey ¶
func (s *KeyService) ResolveKey(_ context.Context, req *api.ResolveKeyRequest) (*api.ResolveKeyResponse, error)
func (*KeyService) RestoreKeyCounters ¶ added in v0.6.0
func (s *KeyService) RestoreKeyCounters(ctx context.Context, req *api.RestoreKeyCountersRequest) (*api.RestoreKeyCountersResponse, error)
type KeyStore ¶ added in v0.6.0
type KeyStore interface { GetKey(v Vault, token []byte) (*memguard.Enclave, error) PutKey(v Vault, token []byte, ttl time.Duration, key *memguard.Enclave) (*time.Time, error) PutPassphrase(v Vault, token []byte, ttl time.Duration, passphrase *memguard.Enclave) (*time.Time, error) DeleteKey(v Vault, token []byte) error RefreshToken(oldToken, newToken []byte, ttl time.Duration) (*time.Time, error) }
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 (s *SigningService) ResetLastUsedOn(_ context.Context, req *api.ResetLastUsedOnRequest) (*api.ResetLastUsedOnResponse, error)
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 SimpleDaemon ¶
type SimpleDaemon struct { daemon.GeneralService daemon.VaultService daemon.TransactionService daemon.SigningService daemon.KeyService daemon.LedgerService daemon.AccountService }
func NewSimpleDaemon ¶
func NewSimpleDaemon(wallets WalletManager, keys KeyStore, ledger LedgerManager) *SimpleDaemon
type TokenKeyStore ¶ added in v0.6.0
type TokenKeyStore struct {
// contains filtered or unexported fields
}
func (*TokenKeyStore) DeleteKey ¶ added in v0.6.0
func (s *TokenKeyStore) DeleteKey(v Vault, token []byte) error
func (*TokenKeyStore) PutPassphrase ¶ added in v0.6.0
func (*TokenKeyStore) RefreshToken ¶ added in v0.6.0
type TransactionService ¶
type TransactionService struct {
Vaults WalletManager
}
func (*TransactionService) AddMemoToTransaction ¶
func (m *TransactionService) AddMemoToTransaction(_ context.Context, req *api.AddMemoToTransactionRequest) (*api.TransactionResponse, error)
func (*TransactionService) AddSendTokensOutput ¶
func (m *TransactionService) AddSendTokensOutput(_ context.Context, req *api.AddSendTokensOutputRequest) (*api.TransactionResponse, error)
func (*TransactionService) CreateEnvelope ¶
func (m *TransactionService) CreateEnvelope(_ context.Context, req *api.CreateEnvelopeRequest) (*api.CreateEnvelopeResponse, error)
func (*TransactionService) CreateTransaction ¶
func (m *TransactionService) CreateTransaction(_ context.Context, req *api.CreateTransactionRequest) (*api.TransactionResponse, error)
func (*TransactionService) DeleteTransaction ¶
func (m *TransactionService) DeleteTransaction(_ context.Context, req *api.DeleteTransactionRequest) (*api.TransactionResponse, error)
func (*TransactionService) GetTransaction ¶
func (m *TransactionService) GetTransaction(_ context.Context, req *api.GetTransactionRequest) (*api.TransactionResponse, error)
func (*TransactionService) ListTransactions ¶
func (m *TransactionService) ListTransactions(_ context.Context, req *api.ListTransactionsRequest) (*api.ListTransactionsResponse, error)
func (*TransactionService) WriteDataTransaction ¶
func (m *TransactionService) WriteDataTransaction(_ context.Context, req *api.WriteDataRequest) (*api.TransactionResponse, error)
type VaultService ¶
type VaultService struct { MaxTTL time.Duration Keys KeyStore Vaults WalletManager }
func (*VaultService) AdoptVault ¶
func (m *VaultService) AdoptVault(ctx context.Context, req *api.AdoptVaultRequest) (_ *api.AdoptVaultResponse, err error)
func (*VaultService) ConvertWallet ¶
func (m *VaultService) ConvertWallet(ctx context.Context, req *api.ConvertWalletRequest) (*api.ConvertWalletResponse, error)
func (*VaultService) CopyVaultSanitized ¶ added in v0.6.3
func (m *VaultService) CopyVaultSanitized(ctx context.Context, req *api.CopyVaultSanitizedRequest) (*api.CopyVaultSanitizedResponse, error)
func (*VaultService) CreateVault ¶
func (m *VaultService) CreateVault(ctx context.Context, req *api.CreateVaultRequest) (_ *api.CreateVaultResponse, err error)
func (*VaultService) CreateWallet ¶
func (m *VaultService) CreateWallet(ctx context.Context, req *api.CreateWalletRequest) (*api.CreateWalletResponse, error)
func (*VaultService) EncryptVault ¶
func (m *VaultService) EncryptVault(ctx context.Context, req *api.EncryptVaultRequest) (*api.EncryptVaultResponse, error)
func (*VaultService) ExportVault ¶
func (m *VaultService) ExportVault(_ context.Context, req *api.ExportVaultRequest) (*api.ExportVaultResponse, error)
func (*VaultService) ImportMnemonic ¶
func (m *VaultService) ImportMnemonic(_ context.Context, req *api.ImportMnemonicRequest) (*api.ImportMnemonicResponse, error)
func (*VaultService) ImportVault ¶
func (m *VaultService) ImportVault(ctx context.Context, req *api.ImportVaultRequest) (*api.ImportVaultResponse, error)
func (*VaultService) ListVaults ¶
func (m *VaultService) ListVaults(ctx context.Context, req *api.ListVaultsRequest) (*api.ListVaultsResponse, error)
func (*VaultService) LockVault ¶
func (m *VaultService) LockVault(_ context.Context, req *api.LockVaultRequest) (*api.LockVaultResponse, error)
func (*VaultService) OpenVault ¶
func (m *VaultService) OpenVault(ctx context.Context, req *api.OpenVaultRequest) (*api.OpenVaultResponse, error)
func (*VaultService) Set1PasswordRef ¶
func (m *VaultService) Set1PasswordRef(ctx context.Context, req *api.Set1PasswordRefRequest) (*api.Set1PasswordRefResponse, error)
func (*VaultService) Status ¶
func (m *VaultService) Status(ctx context.Context, req *api.StatusRequest) (*api.StatusResponse, error)
func (*VaultService) UnlockVault ¶
func (m *VaultService) UnlockVault(_ context.Context, req *api.UnlockVaultRequest) (*api.UnlockVaultResponse, error)
type VaultWithKeys ¶ added in v0.6.0
func (*VaultWithKeys) Create ¶ added in v0.6.0
func (v *VaultWithKeys) Create(token []byte) (*model.Model, error)
func (*VaultWithKeys) Open ¶ added in v0.6.0
func (v *VaultWithKeys) Open(token []byte) (*model.Model, error)
func (*VaultWithKeys) OpenRaw ¶ added in v0.6.0
func (v *VaultWithKeys) OpenRaw(token []byte) (*model.Model, error)
func (*VaultWithKeys) Status ¶ added in v0.6.0
func (v *VaultWithKeys) Status(token []byte) (*api.VaultStatus, error)
func (*VaultWithKeys) Unwrap ¶ added in v0.6.0
func (v *VaultWithKeys) Unwrap() *vault.Vault
type WalletManager ¶
type WalletManagerWithKeys ¶ added in v0.6.0
type WalletManagerWithKeys struct { InMemory bool Keys KeyStore // contains filtered or unexported fields }
func (*WalletManagerWithKeys) Each ¶ added in v0.6.0
func (m *WalletManagerWithKeys) Each(fn func(Wallet) error) error
func (*WalletManagerWithKeys) UseMemDB ¶ added in v0.6.0
func (m *WalletManagerWithKeys) UseMemDB() bool
func (*WalletManagerWithKeys) Wallet ¶ added in v0.6.0
func (m *WalletManagerWithKeys) Wallet(walletDir string) Wallet
type WalletWithKeys ¶ added in v0.6.0
func (*WalletWithKeys) Directory ¶ added in v0.6.0
func (w *WalletWithKeys) Directory() string
func (*WalletWithKeys) Each ¶ added in v0.6.0
func (w *WalletWithKeys) Each(fn func(Vault) error) error
func (*WalletWithKeys) Index ¶ added in v0.6.0
func (w *WalletWithKeys) Index() Vault
func (*WalletWithKeys) Vault ¶ added in v0.6.0
func (w *WalletWithKeys) Vault(name string) Vault
Click to show internal directories.
Click to hide internal directories.