Documentation ¶
Index ¶
- func ConvertLocalToXLM(localAmount string, rate stellar1.OutsideExchangeRate) (XLMAmount string, err error)
- func ConvertXLMToOutside(XLMAmount string, rate stellar1.OutsideExchangeRate) (localAmount string, err error)
- func CreateWallet(ctx context.Context, g *libkb.GlobalContext) (created bool, err error)
- func CreateWalletGated(ctx context.Context, g *libkb.GlobalContext) (created bool, err error)
- func CreateWalletSoft(ctx context.Context, g *libkb.GlobalContext)
- func DecryptRelaySecretB64(boxB64 string, key keybase1.TeamApplicationKey) (res stellar1.RelayContents, err error)
- func ExportSecretKey(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) (res stellar1.SecretKey, err error)
- func GetOwnPrimaryAccountID(ctx context.Context, g *libkb.GlobalContext) (res stellar1.AccountID, err error)
- func ImportSecretKey(ctx context.Context, g *libkb.GlobalContext, secretKey stellar1.SecretKey, ...) (err error)
- func LookupSenderPrimary(ctx context.Context, g *libkb.GlobalContext) (stellar1.BundleEntry, error)
- func NoteDecryptB64(ctx context.Context, g *libkb.GlobalContext, noteB64 string) (res stellar1.NoteContents, err error)
- func NoteEncryptB64(ctx context.Context, g *libkb.GlobalContext, note stellar1.NoteContents, ...) (noteB64 string, err error)
- func OwnAccount(ctx context.Context, g *libkb.GlobalContext, accountID stellar1.AccountID) (bool, error)
- func PaymentDetailCLILocal(ctx context.Context, g *libkb.GlobalContext, remoter remote.Remoter, ...) (res stellar1.PaymentCLILocal, err error)
- func RecentPaymentsCLILocal(ctx context.Context, g *libkb.GlobalContext, remoter remote.Remoter, ...) (res []stellar1.PaymentCLILocal, err error)
- func RelayTransferKey(ctx context.Context, g *libkb.GlobalContext, recipient Recipient) (key keybase1.TeamApplicationKey, teamID keybase1.TeamID, err error)
- func RelayTransferKeyForDecryption(ctx context.Context, g *libkb.GlobalContext, teamID keybase1.TeamID, ...) (res keybase1.TeamApplicationKey, err error)
- func SendPayment(ctx context.Context, g *libkb.GlobalContext, remoter remote.Remoter, ...) (stellar1.PaymentResult, error)
- func ServiceInit(g *libkb.GlobalContext)
- func Upkeep(ctx context.Context, g *libkb.GlobalContext) (err error)
- type Recipient
- type RecipientInput
- type RelayPaymentInput
- type RelayPaymentOutput
- type SeqnoProvider
- type Stellar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertLocalToXLM ¶ added in v1.0.48
func ConvertLocalToXLM(localAmount string, rate stellar1.OutsideExchangeRate) (XLMAmount string, err error)
func ConvertXLMToOutside ¶ added in v1.0.48
func ConvertXLMToOutside(XLMAmount string, rate stellar1.OutsideExchangeRate) (localAmount string, err error)
func CreateWallet ¶
CreateWallet creates and posts an initial stellar bundle for a user. Only succeeds if they do not already have one. Safe to call even if the user has a bundle already.
func CreateWalletGated ¶
func CreateWalletSoft ¶ added in v1.0.48
func CreateWalletSoft(ctx context.Context, g *libkb.GlobalContext)
CreateWalletSoft creates a user's initial wallet if they don't already have one. Does not get in the way of intentional user actions.
func DecryptRelaySecretB64 ¶ added in v1.0.48
func DecryptRelaySecretB64(boxB64 string, key keybase1.TeamApplicationKey) (res stellar1.RelayContents, err error)
TODO CORE-7718 make this private `box` should be a stellar1.EncryptedRelaySecret
func ExportSecretKey ¶ added in v1.0.48
func GetOwnPrimaryAccountID ¶ added in v1.0.48
func ImportSecretKey ¶ added in v1.0.47
func LookupSenderPrimary ¶ added in v1.0.48
func LookupSenderPrimary(ctx context.Context, g *libkb.GlobalContext) (stellar1.BundleEntry, error)
func NoteDecryptB64 ¶ added in v1.0.48
func NoteDecryptB64(ctx context.Context, g *libkb.GlobalContext, noteB64 string) (res stellar1.NoteContents, err error)
func NoteEncryptB64 ¶ added in v1.0.48
func NoteEncryptB64(ctx context.Context, g *libkb.GlobalContext, note stellar1.NoteContents, other *keybase1.UserVersion) (noteB64 string, err error)
func OwnAccount ¶ added in v1.0.48
func PaymentDetailCLILocal ¶ added in v1.0.48
func PaymentDetailCLILocal(ctx context.Context, g *libkb.GlobalContext, remoter remote.Remoter, txID string) (res stellar1.PaymentCLILocal, err error)
func RecentPaymentsCLILocal ¶ added in v1.0.48
func RelayTransferKey ¶ added in v1.0.48
func RelayTransferKey(ctx context.Context, g *libkb.GlobalContext, recipient Recipient) (key keybase1.TeamApplicationKey, teamID keybase1.TeamID, err error)
Get the key used to encrypt the key for a relay transfer A key from the implicit team betwen the logged-in user and `to`. If `generation` is nil, gets the latest key. TODO CORE-7718 make this private
func RelayTransferKeyForDecryption ¶ added in v1.0.48
func RelayTransferKeyForDecryption(ctx context.Context, g *libkb.GlobalContext, teamID keybase1.TeamID, generation keybase1.PerTeamKeyGeneration) (res keybase1.TeamApplicationKey, err error)
func SendPayment ¶ added in v1.0.48
func SendPayment(ctx context.Context, g *libkb.GlobalContext, remoter remote.Remoter, to RecipientInput, amount string, note string) (stellar1.PaymentResult, error)
SendPayment sends XLM `note` is optional. An empty string will not attach a note. Recipient: Stellar address : Standard payment User with wallet ready : Standard payment User without a wallet : Relay payment Unresolved assertion : Relay payment
func ServiceInit ¶ added in v1.0.48
func ServiceInit(g *libkb.GlobalContext)
Types ¶
type Recipient ¶ added in v1.0.48
type Recipient struct { Input RecipientInput // These 3 fields are nullable. User *libkb.User Assertion *keybase1.SocialAssertion // Recipient may not have a stellar wallet ready to receive AccountID *stellarnet.AddressStr // User entered G... OR target has receiving address }
func LookupRecipient ¶ added in v1.0.48
func LookupRecipient(ctx context.Context, g *libkb.GlobalContext, to RecipientInput) (Recipient, error)
TODO: handle stellar federation address rebecca*keybase.io (or rebecca*anything.wow)
type RecipientInput ¶ added in v1.0.48
type RecipientInput string
type RelayPaymentInput ¶ added in v1.0.48
type RelayPaymentInput struct { From stellar1.SecretKey AmountXLM string Note string // Implicit-team key to encrypt for EncryptFor keybase1.TeamApplicationKey SeqnoProvider build.SequenceProvider }
TODO CORE-7718 make this private
type RelayPaymentOutput ¶ added in v1.0.48
type RelayPaymentOutput struct { // Account ID of the shared account. RelayAccountID stellar1.AccountID // Encrypted box containing the secret key to the account. EncryptedB64 string FundTx stellarnet.SignResult }
TODO CORE-7718 make this private
func CreateRelayTransfer ¶ added in v1.0.48
func CreateRelayTransfer(in RelayPaymentInput) (res RelayPaymentOutput, err error)
createRelayTransfer generates a stellar account, encrypts its key, and signs a transaction funding it. TODO CORE-7718 make this private
type SeqnoProvider ¶ added in v1.0.48
type SeqnoProvider struct {
// contains filtered or unexported fields
}
SeqnoProvider implements build.SequenceProvider. It is intended as a one-shot wrapper and shouldn't be reused after the transaction is built.
func NewSeqnoProvider ¶ added in v1.0.48
func NewSeqnoProvider(ctx context.Context, remoter remote.Remoter) *SeqnoProvider
NewSeqnoProvider creates a SeqnoProvider.
func (*SeqnoProvider) SequenceForAccount ¶ added in v1.0.48
func (s *SeqnoProvider) SequenceForAccount(aid string) (xdr.SequenceNumber, error)
SequenceForAccount implements build.SequenceProvider.
type Stellar ¶ added in v1.0.48
type Stellar struct {
libkb.Contextified
}
func NewStellar ¶ added in v1.0.48
func NewStellar(g *libkb.GlobalContext) *Stellar