github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/stellar/remote/remote_net.go (about) 1 package remote 2 3 import ( 4 "context" 5 6 "github.com/keybase/client/go/libkb" 7 "github.com/keybase/client/go/protocol/stellar1" 8 ) 9 10 // RemoteNet is the real implementation of Remoter that talks to servers. 11 type RemoteNet struct { 12 libkb.Contextified 13 } 14 15 var _ Remoter = (*RemoteNet)(nil) 16 17 func NewRemoteNet(g *libkb.GlobalContext) *RemoteNet { 18 return &RemoteNet{Contextified: libkb.NewContextified(g)} 19 } 20 21 func (r *RemoteNet) AccountSeqno(ctx context.Context, accountID stellar1.AccountID) (uint64, error) { 22 return AccountSeqno(ctx, r.G(), accountID) 23 } 24 25 func (r *RemoteNet) Balances(ctx context.Context, accountID stellar1.AccountID) ([]stellar1.Balance, error) { 26 return Balances(ctx, r.G(), accountID) 27 } 28 29 func (r *RemoteNet) Details(ctx context.Context, accountID stellar1.AccountID) (stellar1.AccountDetails, error) { 30 return Details(ctx, r.G(), accountID) 31 } 32 33 func (r *RemoteNet) SubmitPayment(ctx context.Context, post stellar1.PaymentDirectPost) (stellar1.PaymentResult, error) { 34 return SubmitPayment(ctx, r.G(), post) 35 } 36 37 func (r *RemoteNet) SubmitRelayPayment(ctx context.Context, post stellar1.PaymentRelayPost) (stellar1.PaymentResult, error) { 38 return SubmitRelayPayment(ctx, r.G(), post) 39 } 40 41 func (r *RemoteNet) SubmitPathPayment(mctx libkb.MetaContext, post stellar1.PathPaymentPost) (stellar1.PaymentResult, error) { 42 return SubmitPathPayment(mctx, post) 43 } 44 45 func (r *RemoteNet) SubmitMultiPayment(ctx context.Context, post stellar1.PaymentMultiPost) (stellar1.SubmitMultiRes, error) { 46 return SubmitMultiPayment(ctx, r.G(), post) 47 } 48 49 func (r *RemoteNet) SubmitRelayClaim(ctx context.Context, post stellar1.RelayClaimPost) (stellar1.RelayClaimResult, error) { 50 return SubmitRelayClaim(ctx, r.G(), post) 51 } 52 53 func (r *RemoteNet) AcquireAutoClaimLock(ctx context.Context) (string, error) { 54 return AcquireAutoClaimLock(ctx, r.G()) 55 } 56 57 func (r *RemoteNet) ReleaseAutoClaimLock(ctx context.Context, token string) error { 58 return ReleaseAutoClaimLock(ctx, r.G(), token) 59 } 60 61 func (r *RemoteNet) NextAutoClaim(ctx context.Context) (*stellar1.AutoClaim, error) { 62 return NextAutoClaim(ctx, r.G()) 63 } 64 65 func (r *RemoteNet) RecentPayments(ctx context.Context, arg RecentPaymentsArg) (stellar1.PaymentsPage, error) { 66 return RecentPayments(ctx, r.G(), arg) 67 } 68 69 func (r *RemoteNet) PendingPayments(ctx context.Context, accountID stellar1.AccountID, limit int) ([]stellar1.PaymentSummary, error) { 70 return PendingPayments(ctx, r.G(), accountID, limit) 71 } 72 73 func (r *RemoteNet) PaymentDetails(ctx context.Context, accountID stellar1.AccountID, txID string) (res stellar1.PaymentDetails, err error) { 74 return PaymentDetails(ctx, r.G(), accountID, txID) 75 } 76 77 func (r *RemoteNet) PaymentDetailsGeneric(ctx context.Context, txID string) (res stellar1.PaymentDetails, err error) { 78 return PaymentDetailsGeneric(ctx, r.G(), txID) 79 } 80 81 func (r *RemoteNet) GetAccountDisplayCurrency(ctx context.Context, accountID stellar1.AccountID) (string, error) { 82 return GetAccountDisplayCurrency(ctx, r.G(), accountID) 83 } 84 85 func (r *RemoteNet) ExchangeRate(ctx context.Context, currency string) (stellar1.OutsideExchangeRate, error) { 86 return ExchangeRate(ctx, r.G(), currency) 87 } 88 89 func (r *RemoteNet) SubmitRequest(ctx context.Context, post stellar1.RequestPost) (stellar1.KeybaseRequestID, error) { 90 return SubmitRequest(ctx, r.G(), post) 91 } 92 93 func (r *RemoteNet) RequestDetails(ctx context.Context, requestID stellar1.KeybaseRequestID) (stellar1.RequestDetails, error) { 94 return RequestDetails(ctx, r.G(), requestID) 95 } 96 97 func (r *RemoteNet) CancelRequest(ctx context.Context, requestID stellar1.KeybaseRequestID) error { 98 return CancelRequest(ctx, r.G(), requestID) 99 } 100 101 func (r *RemoteNet) MarkAsRead(ctx context.Context, accountID stellar1.AccountID, mostRecentID stellar1.TransactionID) error { 102 return MarkAsRead(ctx, r.G(), accountID, mostRecentID) 103 } 104 105 func (r *RemoteNet) IsAccountMobileOnly(ctx context.Context, accountID stellar1.AccountID) (bool, error) { 106 return IsAccountMobileOnly(ctx, r.G(), accountID) 107 } 108 109 func (r *RemoteNet) SetAccountMobileOnly(ctx context.Context, accountID stellar1.AccountID) error { 110 return SetAccountMobileOnly(ctx, r.G(), accountID) 111 } 112 113 func (r *RemoteNet) MakeAccountAllDevices(ctx context.Context, accountID stellar1.AccountID) error { 114 return MakeAccountAllDevices(ctx, r.G(), accountID) 115 } 116 117 func (r *RemoteNet) ServerTimeboundsRecommendation(ctx context.Context) (stellar1.TimeboundsRecommendation, error) { 118 return ServerTimeboundsRecommendation(ctx, r.G()) 119 } 120 121 func (r *RemoteNet) SetInflationDestination(ctx context.Context, signedTx string) error { 122 return SetInflationDestination(ctx, r.G(), signedTx) 123 } 124 125 func (r *RemoteNet) GetInflationDestinations(ctx context.Context) (ret []stellar1.PredefinedInflationDestination, err error) { 126 return GetInflationDestinations(ctx, r.G()) 127 } 128 129 func (r *RemoteNet) NetworkOptions(ctx context.Context) (stellar1.NetworkOptions, error) { 130 return NetworkOptions(ctx, r.G()) 131 } 132 133 func (r *RemoteNet) DetailsPlusPayments(ctx context.Context, accountID stellar1.AccountID) (stellar1.DetailsPlusPayments, error) { 134 return DetailsPlusPayments(ctx, r.G(), accountID) 135 } 136 func (r *RemoteNet) AllDetailsPlusPayments(mctx libkb.MetaContext) ([]stellar1.DetailsPlusPayments, error) { 137 return AllDetailsPlusPayments(mctx) 138 } 139 140 func (r *RemoteNet) ChangeTrustline(ctx context.Context, signedTx string) error { 141 return ChangeTrustline(ctx, r.G(), signedTx) 142 } 143 144 func (r *RemoteNet) FindPaymentPath(mctx libkb.MetaContext, query stellar1.PaymentPathQuery) (stellar1.PaymentPath, error) { 145 return FindPaymentPath(mctx, query) 146 } 147 148 func (r *RemoteNet) PostAnyTransaction(mctx libkb.MetaContext, signedTx string) error { 149 return PostAnyTransaction(mctx, signedTx) 150 } 151 152 func (r *RemoteNet) FuzzyAssetSearch(mctx libkb.MetaContext, arg stellar1.FuzzyAssetSearchArg) ([]stellar1.Asset, error) { 153 return FuzzyAssetSearch(mctx, arg) 154 } 155 156 func (r *RemoteNet) ListPopularAssets(mctx libkb.MetaContext, arg stellar1.ListPopularAssetsArg) (stellar1.AssetListResult, error) { 157 return ListPopularAssets(mctx, arg) 158 }