remote

package
v5.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: BSD-3-Clause, BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccountIDMissing = errors.New("account id parameter missing")

Functions

func AccountSeqno added in v1.0.48

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 AirdropDetails

func AirdropDetails(mctx libkb.MetaContext) (bool, string, string, error)

func AirdropRegister

func AirdropRegister(mctx libkb.MetaContext, register bool) error

func AllDetailsPlusPayments

func AllDetailsPlusPayments(mctx libkb.MetaContext) ([]stellar1.DetailsPlusPayments, error)

func Balances added in v1.0.48

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 ChangeTrustline

func ChangeTrustline(ctx context.Context, g *libkb.GlobalContext, signedTx string) (err error)

func ExchangeRate added in v1.0.48

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

func FetchAccountBundle

func FetchAccountBundle(mctx libkb.MetaContext, accountID stellar1.AccountID) (bundle *stellar1.Bundle, err error)

FetchAccountBundle gets a bundle from the server with all of the accounts in it, but it will only have the secrets for the specified accountID. This method will bubble up an error if it's called by a Desktop device for an account that is mobile only. If you don't need the secrets, use FetchSecretlessBundle instead.

func FetchBundleWithGens

func FetchBundleWithGens(mctx libkb.MetaContext) (b *stellar1.Bundle, pukGen keybase1.PerUserKeyGeneration, accountGens bundle.AccountPukGens, err error)

FetchBundleWithGens gets a bundle with all of the secrets in it to which this device has access, i.e. if there are no mobile-only accounts, then this bundle will have all of the secrets. Also returned is a map of accountID->pukGen. Entries are only in the map for accounts with secrets in the bundle. Inaccessible accounts will be in the visible part of the parent bundle but not in the AccountBundle secrets nor in the AccountPukGens map. FetchBundleWithGens is only for very specific usecases. FetchAccountBundle and FetchSecretlessBundle are the preferred ways to pull a bundle.

func FetchSecretlessBundle

func FetchSecretlessBundle(mctx libkb.MetaContext) (bundle *stellar1.Bundle, err error)

FetchSecretlessBundle gets an account bundle from the server and decrypts it but without any specified AccountID and therefore no secrets (signers). This method is safe to be called by any of a user's devices even if one or more of the accounts is marked as mobile only.

func FuzzyAssetSearch

func FuzzyAssetSearch(mctx libkb.MetaContext, arg stellar1.FuzzyAssetSearchArg) ([]stellar1.Asset, error)

func GetAcceptedDisclaimer

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

func GetAccountDisplayCurrency added in v1.0.48

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 MakeAccountAllDevices

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

MakeAccountAllDevices will fetch the account bundle and flip the mobile-only switch to off (so that any device can get the account secret keys) then send the new account bundle to the server.

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, accountID stellar1.AccountID, txID string) (res stellar1.PaymentDetails, err error)

func PaymentDetailsGeneric

func PaymentDetailsGeneric(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(mctx libkb.MetaContext, clearBundle stellar1.Bundle) (err error)

Post a bundle to the server.

func PostAnyTransaction

func PostAnyTransaction(mctx libkb.MetaContext, signedTx string) (err error)
func PostWithChainlink(mctx libkb.MetaContext, clearBundle stellar1.Bundle) (err error)

Post a bundle to the server with a chainlink.

func RecentPayments added in v1.0.48

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 ServerTimeboundsRecommendation

func ServerTimeboundsRecommendation(ctx context.Context, g *libkb.GlobalContext) (ret stellar1.TimeboundsRecommendation, err error)

func SetAcceptedDisclaimer

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

func SetAccountDefaultCurrency added in v1.0.48

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

SetAccountMobileOnly will fetch the account bundle and flip the mobile-only switch, then send the new account bundle revision to the server.

func SetInflationDestination

func SetInflationDestination(ctx context.Context, g *libkb.GlobalContext, signedTx string) (err error)

func SubmitPayment added in v1.0.48

func SubmitRelayPayment added in v1.0.48

Types

type AirConfig

type AirConfig struct {
	MinActiveDevices        int    `json:"min_active_devices"`
	MinActiveDevicesTitle   string `json:"min_active_devices_title"`
	AccountCreationTitle    string `json:"account_creation_title"`
	AccountCreationSubtitle string `json:"account_creation_subtitle"`
	AccountUsed             string `json:"account_used"`
}

type AirQualifications

type AirQualifications struct {
	QualifiesOverall bool              `json:"qualifies_overall"`
	HasEnoughDevices bool              `json:"has_enough_devices"`
	ServiceChecks    map[string]AirSvc `json:"service_checks"`
}

type AirSvc

type AirSvc struct {
	Qualifies     bool   `json:"qualifies"`
	IsOldEnough   bool   `json:"is_old_enough"`
	IsUsedAlready bool   `json:"is_used_already"`
	Username      string `json:"service_username"`
}

type AirdropStatusAPI

type AirdropStatusAPI struct {
	libkb.AppStatusEmbed
	AlreadyRegistered bool              `json:"already_registered"`
	Qualifications    AirQualifications `json:"qualifications"`
	AirdropConfig     AirConfig         `json:"airdrop_cfg"`
}

func AirdropStatus

func AirdropStatus(mctx libkb.MetaContext) (AirdropStatusAPI, error)

type RecentPaymentsArg

type RecentPaymentsArg struct {
	AccountID       stellar1.AccountID
	Cursor          *stellar1.PageCursor
	Limit           int
	SkipPending     bool
	IncludeAdvanced bool
}

type RemoteNet added in v1.0.48

type RemoteNet struct {
	libkb.Contextified
}

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

func NewRemoteNet added in v1.0.48

func NewRemoteNet(g *libkb.GlobalContext) *RemoteNet

func (*RemoteNet) AccountSeqno added in v1.0.48

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) AllDetailsPlusPayments

func (r *RemoteNet) AllDetailsPlusPayments(mctx libkb.MetaContext) ([]stellar1.DetailsPlusPayments, error)

func (*RemoteNet) Balances added in v1.0.48

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) ChangeTrustline

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

func (*RemoteNet) Details

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

func (*RemoteNet) DetailsPlusPayments

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

func (*RemoteNet) ExchangeRate

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

func (*RemoteNet) FindPaymentPath

func (r *RemoteNet) FindPaymentPath(mctx libkb.MetaContext, query stellar1.PaymentPathQuery) (stellar1.PaymentPath, error)

func (*RemoteNet) FuzzyAssetSearch

func (r *RemoteNet) FuzzyAssetSearch(mctx libkb.MetaContext, arg stellar1.FuzzyAssetSearchArg) ([]stellar1.Asset, error)

func (*RemoteNet) GetAccountDisplayCurrency

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

func (*RemoteNet) GetInflationDestinations

func (r *RemoteNet) GetInflationDestinations(ctx context.Context) (ret []stellar1.PredefinedInflationDestination, err error)

func (*RemoteNet) IsAccountMobileOnly

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

func (*RemoteNet) ListPopularAssets

func (*RemoteNet) MakeAccountAllDevices

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

func (*RemoteNet) MarkAsRead

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

func (*RemoteNet) NetworkOptions

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

func (*RemoteNet) NextAutoClaim

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

func (*RemoteNet) PaymentDetails

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

func (*RemoteNet) PaymentDetailsGeneric

func (r *RemoteNet) PaymentDetailsGeneric(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) PostAnyTransaction

func (r *RemoteNet) PostAnyTransaction(mctx libkb.MetaContext, signedTx string) error

func (*RemoteNet) RecentPayments added in v1.0.48

func (r *RemoteNet) RecentPayments(ctx context.Context, arg RecentPaymentsArg) (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) ServerTimeboundsRecommendation

func (r *RemoteNet) ServerTimeboundsRecommendation(ctx context.Context) (stellar1.TimeboundsRecommendation, error)

func (*RemoteNet) SetAccountMobileOnly

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

func (*RemoteNet) SetInflationDestination

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

func (*RemoteNet) SubmitMultiPayment

func (r *RemoteNet) SubmitMultiPayment(ctx context.Context, post stellar1.PaymentMultiPost) (stellar1.SubmitMultiRes, error)

func (*RemoteNet) SubmitPathPayment

func (r *RemoteNet) SubmitPathPayment(mctx libkb.MetaContext, post stellar1.PathPaymentPost) (stellar1.PaymentResult, error)

func (*RemoteNet) SubmitPayment added in v1.0.48

func (*RemoteNet) SubmitRelayClaim

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

func (*RemoteNet) SubmitRelayPayment added in v1.0.48

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

func (*RemoteNet) SubmitRequest

type Remoter added in v1.0.48

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)
	SubmitPathPayment(mctx libkb.MetaContext, post stellar1.PathPaymentPost) (stellar1.PaymentResult, error)
	SubmitMultiPayment(ctx context.Context, post stellar1.PaymentMultiPost) (stellar1.SubmitMultiRes, error)
	AcquireAutoClaimLock(context.Context) (string, error)
	ReleaseAutoClaimLock(context.Context, string) error
	NextAutoClaim(context.Context) (*stellar1.AutoClaim, error)
	RecentPayments(ctx context.Context, arg RecentPaymentsArg) (stellar1.PaymentsPage, error)
	PendingPayments(ctx context.Context, accountID stellar1.AccountID, limit int) ([]stellar1.PaymentSummary, error)
	PaymentDetails(ctx context.Context, accountID stellar1.AccountID, txID string) (res stellar1.PaymentDetails, err error)
	PaymentDetailsGeneric(ctx context.Context, txID string) (res stellar1.PaymentDetails, err error)
	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
	MakeAccountAllDevices(ctx context.Context, accountID stellar1.AccountID) error
	ServerTimeboundsRecommendation(ctx context.Context) (stellar1.TimeboundsRecommendation, error)
	SetInflationDestination(ctx context.Context, signedTx string) error
	GetInflationDestinations(ctx context.Context) (ret []stellar1.PredefinedInflationDestination, err error)
	NetworkOptions(ctx context.Context) (stellar1.NetworkOptions, error)
	DetailsPlusPayments(ctx context.Context, accountID stellar1.AccountID) (stellar1.DetailsPlusPayments, error)
	AllDetailsPlusPayments(mctx libkb.MetaContext) ([]stellar1.DetailsPlusPayments, error)
	ChangeTrustline(ctx context.Context, signedTx string) error
	FindPaymentPath(mctx libkb.MetaContext, query stellar1.PaymentPathQuery) (stellar1.PaymentPath, error)
	PostAnyTransaction(mctx libkb.MetaContext, signedTx string) error
	FuzzyAssetSearch(mctx libkb.MetaContext, arg stellar1.FuzzyAssetSearchArg) ([]stellar1.Asset, error)
	ListPopularAssets(mctx libkb.MetaContext, arg stellar1.ListPopularAssetsArg) (stellar1.AssetListResult, error)
}

type ShouldCreateResult

type ShouldCreateResult struct {
	ShouldCreate       bool `json:"shouldcreate"`
	HasWallet          bool `json:"haswallet"`
	AcceptedDisclaimer bool `json:"accepteddisclaimer"`
}

func ShouldCreate

func ShouldCreate(ctx context.Context, g *libkb.GlobalContext) (res ShouldCreateResult, err error)

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

Jump to

Keyboard shortcuts

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