stellar1

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: BSD-3-Clause, BSD-3-Clause Imports: 7 Imported by: 110

Documentation

Index

Constants

View Source
const (
	KeybaseTransactionIDLen       = 16
	KeybaseTransactionIDSuffix    = 0x30
	KeybaseTransactionIDSuffixHex = "30"
)

Variables

View Source
var AccountModeMap = map[string]AccountMode{
	"NONE": 0,
	"USER": 1,
}
View Source
var AccountModeRevMap = map[AccountMode]string{
	0: "NONE",
	1: "USER",
}
View Source
var BundleVersionMap = map[string]BundleVersion{
	"V1": 1,
}
View Source
var BundleVersionRevMap = map[BundleVersion]string{
	1: "V1",
}
View Source
var TransactionStatusMap = map[string]TransactionStatus{
	"NONE":            0,
	"PENDING":         1,
	"SUCCESS":         2,
	"ERROR_TRANSIENT": 3,
	"ERROR_PERMANENT": 4,
}
View Source
var TransactionStatusRevMap = map[TransactionStatus]string{
	0: "NONE",
	1: "PENDING",
	2: "SUCCESS",
	3: "ERROR_TRANSIENT",
	4: "ERROR_PERMANENT",
}

Functions

func BundleProtocol added in v1.0.47

func BundleProtocol(i BundleInterface) rpc.Protocol

func CommonProtocol

func CommonProtocol(i CommonInterface) rpc.Protocol

func LocalProtocol

func LocalProtocol(i LocalInterface) rpc.Protocol

func RemoteProtocol

func RemoteProtocol(i RemoteInterface) rpc.Protocol

Types

type AccountID

type AccountID string

func (AccountID) DeepCopy

func (o AccountID) DeepCopy() AccountID

func (AccountID) Eq added in v1.0.47

func (a AccountID) Eq(b AccountID) bool

func (AccountID) String added in v1.0.47

func (a AccountID) String() string

type AccountMode added in v1.0.47

type AccountMode int
const (
	AccountMode_NONE AccountMode = 0
	AccountMode_USER AccountMode = 1
)

func (AccountMode) DeepCopy added in v1.0.47

func (o AccountMode) DeepCopy() AccountMode

func (AccountMode) String added in v1.0.47

func (e AccountMode) String() string

type Asset

type Asset struct {
	Type   string `codec:"type" json:"type"`
	Code   string `codec:"code" json:"code"`
	Issuer string `codec:"issuer" json:"issuer"`
}

func (Asset) DeepCopy

func (o Asset) DeepCopy() Asset

type Balance

type Balance struct {
	Asset  Asset  `codec:"asset" json:"asset"`
	Amount string `codec:"amount" json:"amount"`
	Limit  string `codec:"limit" json:"limit"`
}

func (Balance) DeepCopy

func (o Balance) DeepCopy() Balance

type BalancesArg

type BalancesArg struct {
	Uid       keybase1.UID `codec:"uid" json:"uid"`
	AccountID AccountID    `codec:"accountID" json:"accountID"`
}

type BalancesLocalArg

type BalancesLocalArg struct {
	AccountID AccountID `codec:"accountID" json:"accountID"`
}

type Bundle added in v1.0.47

type Bundle struct {
	Revision BundleRevision `codec:"revision" json:"revision"`
	Prev     Hash           `codec:"prev" json:"prev"`
	OwnHash  Hash           `codec:"ownHash" json:"ownHash"`
	Accounts []BundleEntry  `codec:"accounts" json:"accounts"`
}

func (Bundle) CheckInvariants added in v1.0.47

func (s Bundle) CheckInvariants() error

CheckInvariants checks that the bundle satisfies 1. No duplicate account IDs 2. At most one primary account

func (Bundle) DeepCopy added in v1.0.47

func (o Bundle) DeepCopy() Bundle

func (Bundle) PrimaryAccount added in v1.0.47

func (s Bundle) PrimaryAccount() (BundleEntry, error)

type BundleClient added in v1.0.47

type BundleClient struct {
	Cli rpc.GenericClient
}

type BundleEntry added in v1.0.47

type BundleEntry struct {
	AccountID AccountID   `codec:"accountID" json:"accountID"`
	Mode      AccountMode `codec:"mode" json:"mode"`
	IsPrimary bool        `codec:"isPrimary" json:"isPrimary"`
	Signers   []SecretKey `codec:"signers" json:"signers"`
	Name      string      `codec:"name" json:"name"`
}

func (BundleEntry) DeepCopy added in v1.0.47

func (o BundleEntry) DeepCopy() BundleEntry

type BundleInterface added in v1.0.47

type BundleInterface interface {
}

type BundleRevision added in v1.0.47

type BundleRevision uint64

func (BundleRevision) DeepCopy added in v1.0.47

func (o BundleRevision) DeepCopy() BundleRevision

type BundleSecretEntry added in v1.0.47

type BundleSecretEntry struct {
	AccountID AccountID   `codec:"accountID" json:"accountID"`
	Signers   []SecretKey `codec:"signers" json:"signers"`
	Name      string      `codec:"name" json:"name"`
}

func (BundleSecretEntry) DeepCopy added in v1.0.47

func (o BundleSecretEntry) DeepCopy() BundleSecretEntry

type BundleSecretV1 added in v1.0.47

type BundleSecretV1 struct {
	VisibleHash Hash                `codec:"visibleHash" json:"visibleHash"`
	Accounts    []BundleSecretEntry `codec:"accounts" json:"accounts"`
}

func (BundleSecretV1) DeepCopy added in v1.0.47

func (o BundleSecretV1) DeepCopy() BundleSecretV1

type BundleSecretVersioned added in v1.0.47

type BundleSecretVersioned struct {
	Version__ BundleVersion   `codec:"version" json:"version"`
	V1__      *BundleSecretV1 `codec:"v1,omitempty" json:"v1,omitempty"`
}

func NewBundleSecretVersionedWithV1 added in v1.0.47

func NewBundleSecretVersionedWithV1(v BundleSecretV1) BundleSecretVersioned

func (BundleSecretVersioned) DeepCopy added in v1.0.47

func (BundleSecretVersioned) V1 added in v1.0.47

func (*BundleSecretVersioned) Version added in v1.0.47

func (o *BundleSecretVersioned) Version() (ret BundleVersion, err error)

type BundleVersion added in v1.0.47

type BundleVersion int
const (
	BundleVersion_V1 BundleVersion = 1
)

func (BundleVersion) DeepCopy added in v1.0.47

func (o BundleVersion) DeepCopy() BundleVersion

func (BundleVersion) String added in v1.0.47

func (e BundleVersion) String() string

type BundleVisibleEntry added in v1.0.47

type BundleVisibleEntry struct {
	AccountID AccountID   `codec:"accountID" json:"accountID"`
	Mode      AccountMode `codec:"mode" json:"mode"`
	IsPrimary bool        `codec:"isPrimary" json:"isPrimary"`
}

func (BundleVisibleEntry) DeepCopy added in v1.0.47

type BundleVisibleV1 added in v1.0.47

type BundleVisibleV1 struct {
	Revision BundleRevision       `codec:"revision" json:"revision"`
	Prev     Hash                 `codec:"prev" json:"prev"`
	Accounts []BundleVisibleEntry `codec:"accounts" json:"accounts"`
}

func (BundleVisibleV1) DeepCopy added in v1.0.47

func (o BundleVisibleV1) DeepCopy() BundleVisibleV1

type CommonClient

type CommonClient struct {
	Cli rpc.GenericClient
}

type CommonInterface

type CommonInterface interface {
}

type EncryptedBundle added in v1.0.47

type EncryptedBundle struct {
	V   int                           `codec:"v" json:"v"`
	E   []byte                        `codec:"e" json:"e"`
	N   keybase1.BoxNonce             `codec:"n" json:"n"`
	Gen keybase1.PerUserKeyGeneration `codec:"gen" json:"gen"`
}

func (EncryptedBundle) DeepCopy added in v1.0.47

func (o EncryptedBundle) DeepCopy() EncryptedBundle

type EncryptedNote

type EncryptedNote struct {
	V   int          `codec:"v" json:"v"`
	E   []byte       `codec:"e" json:"e"`
	N   []byte       `codec:"n" json:"n"`
	KID keybase1.KID `codec:"KID" json:"KID"`
}

func (EncryptedNote) DeepCopy

func (o EncryptedNote) DeepCopy() EncryptedNote

type Hash added in v1.0.47

type Hash []byte

func (Hash) DeepCopy added in v1.0.47

func (o Hash) DeepCopy() Hash

type ImportSecretKeyLocalArg added in v1.0.47

type ImportSecretKeyLocalArg struct {
	SecretKey   SecretKey `codec:"secretKey" json:"secretKey"`
	MakePrimary bool      `codec:"makePrimary" json:"makePrimary"`
}

type KeybaseTransactionID

type KeybaseTransactionID string

func KeybaseTransactionIDFromString

func KeybaseTransactionIDFromString(s string) (KeybaseTransactionID, error)

func (KeybaseTransactionID) DeepCopy

func (KeybaseTransactionID) String

func (k KeybaseTransactionID) String() string

type LocalClient

type LocalClient struct {
	Cli rpc.GenericClient
}

func (LocalClient) BalancesLocal

func (c LocalClient) BalancesLocal(ctx context.Context, accountID AccountID) (res []Balance, err error)

func (LocalClient) ImportSecretKeyLocal added in v1.0.47

func (c LocalClient) ImportSecretKeyLocal(ctx context.Context, __arg ImportSecretKeyLocalArg) (err error)

func (LocalClient) OwnAccountLocal added in v1.0.47

func (c LocalClient) OwnAccountLocal(ctx context.Context, accountID AccountID) (res bool, err error)

func (LocalClient) SendLocal added in v1.0.47

func (c LocalClient) SendLocal(ctx context.Context, __arg SendLocalArg) (res PaymentResult, err error)

func (LocalClient) WalletDumpLocal added in v1.0.47

func (c LocalClient) WalletDumpLocal(ctx context.Context) (res Bundle, err error)

func (LocalClient) WalletInitLocal added in v1.0.47

func (c LocalClient) WalletInitLocal(ctx context.Context) (err error)

type LocalInterface

type LocalInterface interface {
	BalancesLocal(context.Context, AccountID) ([]Balance, error)
	SendLocal(context.Context, SendLocalArg) (PaymentResult, error)
	WalletInitLocal(context.Context) error
	WalletDumpLocal(context.Context) (Bundle, error)
	OwnAccountLocal(context.Context, AccountID) (bool, error)
	ImportSecretKeyLocal(context.Context, ImportSecretKeyLocalArg) error
}

type Members

type Members struct {
	FromStellar  AccountID         `codec:"fromStellar" json:"fromStellar"`
	FromKeybase  string            `codec:"fromKeybase" json:"fromKeybase"`
	FromUID      keybase1.UID      `codec:"fromUID" json:"fromUID"`
	FromDeviceID keybase1.DeviceID `codec:"fromDeviceID" json:"fromDeviceID"`
	ToStellar    AccountID         `codec:"toStellar" json:"toStellar"`
	ToKeybase    string            `codec:"toKeybase" json:"toKeybase"`
	ToUID        keybase1.UID      `codec:"toUID" json:"toUID"`
}

func (Members) DeepCopy

func (o Members) DeepCopy() Members

type Operation

type Operation struct {
	ID              string `codec:"ID" json:"ID"`
	OpType          string `codec:"opType" json:"opType"`
	CreatedAt       int    `codec:"createdAt" json:"createdAt"`
	TransactionHash string `codec:"TransactionHash" json:"TransactionHash"`
	Asset           Asset  `codec:"asset" json:"asset"`
	Amount          string `codec:"amount" json:"amount"`
}

func (Operation) DeepCopy

func (o Operation) DeepCopy() Operation

type OwnAccountLocalArg added in v1.0.47

type OwnAccountLocalArg struct {
	AccountID AccountID `codec:"accountID" json:"accountID"`
}

type PaymentPost

type PaymentPost struct {
	StellarAccountSeqno uint64        `codec:"stellarAccountSeqno" json:"stellarAccountSeqno"`
	Members             Members       `codec:"members" json:"members"`
	DisplayAmount       string        `codec:"displayAmount" json:"displayAmount"`
	DisplayCurrency     string        `codec:"displayCurrency" json:"displayCurrency"`
	Note                EncryptedNote `codec:"note" json:"note"`
	SignedTransaction   string        `codec:"signedTransaction" json:"signedTransaction"`
}

func (PaymentPost) DeepCopy

func (o PaymentPost) DeepCopy() PaymentPost

type PaymentResult

type PaymentResult struct {
	StellarID TransactionID        `codec:"stellarID" json:"stellarID"`
	KeybaseID KeybaseTransactionID `codec:"keybaseID" json:"keybaseID"`
	Ledger    int                  `codec:"Ledger" json:"Ledger"`
}

func (PaymentResult) DeepCopy

func (o PaymentResult) DeepCopy() PaymentResult

type RecentTransactionsArg

type RecentTransactionsArg struct {
	Uid       keybase1.UID `codec:"uid" json:"uid"`
	AccountID AccountID    `codec:"accountID" json:"accountID"`
	Count     int          `codec:"count" json:"count"`
}

type RemoteClient

type RemoteClient struct {
	Cli rpc.GenericClient
}

func (RemoteClient) Balances

func (c RemoteClient) Balances(ctx context.Context, __arg BalancesArg) (res []Balance, err error)

func (RemoteClient) RecentTransactions

func (c RemoteClient) RecentTransactions(ctx context.Context, __arg RecentTransactionsArg) (res []TransactionSummary, err error)

func (RemoteClient) SubmitPayment

func (c RemoteClient) SubmitPayment(ctx context.Context, __arg SubmitPaymentArg) (res PaymentResult, err error)

func (RemoteClient) Transaction

func (c RemoteClient) Transaction(ctx context.Context, __arg TransactionArg) (res TransactionDetails, err error)

type RemoteInterface

type RemoteInterface interface {
	Balances(context.Context, BalancesArg) ([]Balance, error)
	RecentTransactions(context.Context, RecentTransactionsArg) ([]TransactionSummary, error)
	Transaction(context.Context, TransactionArg) (TransactionDetails, error)
	SubmitPayment(context.Context, SubmitPaymentArg) (PaymentResult, error)
}

type SecretKey added in v1.0.47

type SecretKey string

func (SecretKey) DeepCopy added in v1.0.47

func (o SecretKey) DeepCopy() SecretKey

func (SecretKey) SecureNoLogString added in v1.0.47

func (s SecretKey) SecureNoLogString() string

func (SecretKey) String added in v1.0.47

func (s SecretKey) String() string

type SendLocalArg added in v1.0.47

type SendLocalArg struct {
	Recipient string `codec:"recipient" json:"recipient"`
	Amount    string `codec:"amount" json:"amount"`
	Asset     Asset  `codec:"asset" json:"asset"`
	Note      string `codec:"note" json:"note"`
}

type SubmitPaymentArg

type SubmitPaymentArg struct {
	Uid     keybase1.UID `codec:"uid" json:"uid"`
	Payment PaymentPost  `codec:"payment" json:"payment"`
}

type TimeMs

type TimeMs int64

func ToTimeMs

func ToTimeMs(t time.Time) TimeMs

func (TimeMs) DeepCopy

func (o TimeMs) DeepCopy() TimeMs

type TransactionArg

type TransactionArg struct {
	Uid keybase1.UID  `codec:"uid" json:"uid"`
	Id  TransactionID `codec:"id" json:"id"`
}

type TransactionDetails

type TransactionDetails struct {
	StellarID             TransactionID        `codec:"stellarID" json:"stellarID"`
	KeybaseID             KeybaseTransactionID `codec:"keybaseID" json:"keybaseID"`
	Hash                  string               `codec:"Hash" json:"Hash"`
	Ledger                int                  `codec:"ledger" json:"ledger"`
	LedgerCloseTime       int                  `codec:"ledgerCloseTime" json:"ledgerCloseTime"`
	SourceAccount         AccountID            `codec:"sourceAccount" json:"sourceAccount"`
	SourceAccountSequence string               `codec:"sourceAccountSequence" json:"sourceAccountSequence"`
	FeePaid               int                  `codec:"feePaid" json:"feePaid"`
	Members               Members              `codec:"members" json:"members"`
	Note                  EncryptedNote        `codec:"note" json:"note"`
	Signatures            []string             `codec:"signatures" json:"signatures"`
	Operations            []Operation          `codec:"operations" json:"operations"`
	Ctime                 TimeMs               `codec:"ctime" json:"ctime"`
}

func (TransactionDetails) DeepCopy

type TransactionID

type TransactionID string

func (TransactionID) DeepCopy

func (o TransactionID) DeepCopy() TransactionID

type TransactionStatus

type TransactionStatus int
const (
	TransactionStatus_NONE            TransactionStatus = 0
	TransactionStatus_PENDING         TransactionStatus = 1
	TransactionStatus_SUCCESS         TransactionStatus = 2
	TransactionStatus_ERROR_TRANSIENT TransactionStatus = 3
	TransactionStatus_ERROR_PERMANENT TransactionStatus = 4
)

func (TransactionStatus) DeepCopy

func (o TransactionStatus) DeepCopy() TransactionStatus

func (TransactionStatus) String

func (e TransactionStatus) String() string

type TransactionSummary

type TransactionSummary struct {
	StellarID       TransactionID        `codec:"stellarID" json:"stellarID"`
	KeybaseID       KeybaseTransactionID `codec:"keybaseID" json:"keybaseID"`
	Status          TransactionStatus    `codec:"status" json:"status"`
	ErrMsg          string               `codec:"errMsg" json:"errMsg"`
	Note            EncryptedNote        `codec:"note" json:"note"`
	Asset           Asset                `codec:"asset" json:"asset"`
	Amount          string               `codec:"amount" json:"amount"`
	DisplayAmount   string               `codec:"displayAmount" json:"displayAmount"`
	DisplayCurrency string               `codec:"displayCurrency" json:"displayCurrency"`
	Members         Members              `codec:"members" json:"members"`
	Ctime           TimeMs               `codec:"ctime" json:"ctime"`
	Rtime           TimeMs               `codec:"rtime" json:"rtime"`
}

func (TransactionSummary) DeepCopy

type WalletDumpLocalArg added in v1.0.47

type WalletDumpLocalArg struct {
}

type WalletInitLocalArg added in v1.0.47

type WalletInitLocalArg struct {
}

Jump to

Keyboard shortcuts

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