remote

package
v0.0.0-...-483990c Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: BSD-3-Clause, BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountSeqno

func AccountSeqno(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) (uint64, error)

func AcquireAutoClaimLock

func AcquireAutoClaimLock(ctx context.Context, g *libkb.GlobalContext) (string, error)

func Balances

func Balances(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) ([]stellar1.Balance, error)

func CancelRequest

func CancelRequest(ctx context.Context, g *libkb.GlobalContext, requestID stellar1.KeybaseRequestID) (err error)

func ExchangeRate

func ExchangeRate(ctx context.Context, g *libkb.GlobalContext, currency string) (stellar1.OutsideExchangeRate, error)

func Fetch

Fetch and unbox the latest bundle from the server.

func GetAcceptedDisclaimer

func GetAcceptedDisclaimer(ctx context.Context, g *libkb.GlobalContext) (ret bool, err error)

func GetAccountDisplayCurrency

func GetAccountDisplayCurrency(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) (string, error)

func IsAccountMobileOnly

func IsAccountMobileOnly(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) (bool, error)

func LookupUnverified

func LookupUnverified(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) (ret []keybase1.UserVersion, err error)

func MarkAsRead

func MarkAsRead(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID, mostRecentID stellar1.TransactionID) error

func NextAutoClaim

func NextAutoClaim(ctx context.Context, g *libkb.GlobalContext) (*stellar1.AutoClaim, error)

func PaymentDetails

func PaymentDetails(ctx context.Context, g *libkb.GlobalContext, txID string) (res stellar1.PaymentDetails, err error)

func PendingPayments

func PendingPayments(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID, limit int) ([]stellar1.PaymentSummary, error)

func Post

func Post(ctx context.Context, g *libkb.GlobalContext, clearBundle stellar1.Bundle) (err error)

Post a bundle to the server.

func PostWithChainlink(ctx context.Context, g *libkb.GlobalContext, clearBundle stellar1.Bundle) (err error)

Post a bundle to the server with a chainlink.

func RecentPayments

func RecentPayments(ctx context.Context, g *libkb.GlobalContext,
	accountID stellar1.AccountID, cursor *stellar1.PageCursor, limit int, skipPending bool) (stellar1.PaymentsPage, error)

func ReleaseAutoClaimLock

func ReleaseAutoClaimLock(ctx context.Context, g *libkb.GlobalContext, token string) error

func RequestDetails

func RequestDetails(ctx context.Context, g *libkb.GlobalContext, requestID stellar1.KeybaseRequestID) (ret stellar1.RequestDetails, err error)

func SetAcceptedDisclaimer

func SetAcceptedDisclaimer(ctx context.Context, g *libkb.GlobalContext) error

func SetAccountDefaultCurrency

func SetAccountDefaultCurrency(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID,
	currency string) error

func SetAccountMobileOnly

func SetAccountMobileOnly(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) error

func ShouldCreate

func ShouldCreate(ctx context.Context, g *libkb.GlobalContext) (shouldCreate, hasWallet bool, err error)

ShouldCreate asks the server whether to create this user's initial wallet.

Types

type RemoteNet

type RemoteNet struct {
	libkb.Contextified
}

RemoteNet is the real implementation of Remoter that talks to servers.

func NewRemoteNet

func NewRemoteNet(g *libkb.GlobalContext) *RemoteNet

func (*RemoteNet) AccountSeqno

func (r *RemoteNet) AccountSeqno(ctx context.Context, accountID stellar1.AccountID) (uint64, error)

func (*RemoteNet) AcquireAutoClaimLock

func (r *RemoteNet) AcquireAutoClaimLock(ctx context.Context) (string, error)

func (*RemoteNet) Balances

func (r *RemoteNet) Balances(ctx context.Context, accountID stellar1.AccountID) ([]stellar1.Balance, error)

func (*RemoteNet) CancelRequest

func (r *RemoteNet) CancelRequest(ctx context.Context, requestID stellar1.KeybaseRequestID) error

func (*RemoteNet) Details

func (r *RemoteNet) Details(ctx context.Context, accountID stellar1.AccountID) (stellar1.AccountDetails, error)

func (*RemoteNet) ExchangeRate

func (r *RemoteNet) ExchangeRate(ctx context.Context, currency string) (stellar1.OutsideExchangeRate, error)

func (*RemoteNet) GetAccountDisplayCurrency

func (r *RemoteNet) GetAccountDisplayCurrency(ctx context.Context, accountID stellar1.AccountID) (string, error)

func (*RemoteNet) IsAccountMobileOnly

func (r *RemoteNet) IsAccountMobileOnly(ctx context.Context, accountID stellar1.AccountID) (bool, error)

func (*RemoteNet) MarkAsRead

func (r *RemoteNet) MarkAsRead(ctx context.Context, accountID stellar1.AccountID, mostRecentID stellar1.TransactionID) error

func (*RemoteNet) NextAutoClaim

func (r *RemoteNet) NextAutoClaim(ctx context.Context) (*stellar1.AutoClaim, error)

func (*RemoteNet) PaymentDetails

func (r *RemoteNet) PaymentDetails(ctx context.Context, txID string) (res stellar1.PaymentDetails, err error)

func (*RemoteNet) PendingPayments

func (r *RemoteNet) PendingPayments(ctx context.Context, accountID stellar1.AccountID, limit int) ([]stellar1.PaymentSummary, error)

func (*RemoteNet) RecentPayments

func (r *RemoteNet) RecentPayments(ctx context.Context, accountID stellar1.AccountID, cursor *stellar1.PageCursor, limit int, skipPending bool) (stellar1.PaymentsPage, error)

func (*RemoteNet) ReleaseAutoClaimLock

func (r *RemoteNet) ReleaseAutoClaimLock(ctx context.Context, token string) error

func (*RemoteNet) RequestDetails

func (r *RemoteNet) RequestDetails(ctx context.Context, requestID stellar1.KeybaseRequestID) (stellar1.RequestDetails, error)

func (*RemoteNet) SetAccountMobileOnly

func (r *RemoteNet) SetAccountMobileOnly(ctx context.Context, accountID stellar1.AccountID) error

func (*RemoteNet) SubmitPayment

func (*RemoteNet) SubmitRelayClaim

func (r *RemoteNet) SubmitRelayClaim(ctx context.Context, post stellar1.RelayClaimPost) (stellar1.RelayClaimResult, error)

func (*RemoteNet) SubmitRelayPayment

func (r *RemoteNet) SubmitRelayPayment(ctx context.Context, post stellar1.PaymentRelayPost) (stellar1.PaymentResult, error)

func (*RemoteNet) SubmitRequest

type Remoter

type Remoter interface {
	AccountSeqno(ctx context.Context, accountID stellar1.AccountID) (uint64, error)
	Balances(ctx context.Context, accountID stellar1.AccountID) ([]stellar1.Balance, error)
	Details(ctx context.Context, accountID stellar1.AccountID) (stellar1.AccountDetails, error)
	SubmitPayment(ctx context.Context, post stellar1.PaymentDirectPost) (stellar1.PaymentResult, error)
	SubmitRelayPayment(ctx context.Context, post stellar1.PaymentRelayPost) (stellar1.PaymentResult, error)
	SubmitRelayClaim(context.Context, stellar1.RelayClaimPost) (stellar1.RelayClaimResult, error)
	AcquireAutoClaimLock(context.Context) (string, error)
	ReleaseAutoClaimLock(context.Context, string) error
	NextAutoClaim(context.Context) (*stellar1.AutoClaim, error)
	RecentPayments(ctx context.Context, accountID stellar1.AccountID, cursor *stellar1.PageCursor, limit int, skipPending bool) (stellar1.PaymentsPage, error)
	PendingPayments(ctx context.Context, accountID stellar1.AccountID, limit int) ([]stellar1.PaymentSummary, error)
	PaymentDetails(ctx context.Context, txID string) (res stellar1.PaymentDetails, err error)
	// GetAccountDisplayCurrency is not used as a mock now - since this
	// setting only lives in database table on the server, we can do full
	// integration testing here. Otherwise, all what ChangeDisplayCurrency
	// test would do is testing a mock.
	GetAccountDisplayCurrency(ctx context.Context, accountID stellar1.AccountID) (string, error)
	ExchangeRate(ctx context.Context, currency string) (stellar1.OutsideExchangeRate, error)
	SubmitRequest(ctx context.Context, post stellar1.RequestPost) (stellar1.KeybaseRequestID, error)
	RequestDetails(ctx context.Context, requestID stellar1.KeybaseRequestID) (stellar1.RequestDetails, error)
	CancelRequest(ctx context.Context, requestID stellar1.KeybaseRequestID) error
	MarkAsRead(ctx context.Context, accountID stellar1.AccountID, mostRecentID stellar1.TransactionID) error
	IsAccountMobileOnly(ctx context.Context, accountID stellar1.AccountID) (bool, error)
	SetAccountMobileOnly(ctx context.Context, accountID stellar1.AccountID) error
}

type UserHasNoAccountsError

type UserHasNoAccountsError struct{}

func (UserHasNoAccountsError) Error

func (e UserHasNoAccountsError) Error() string

Jump to

Keyboard shortcuts

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