github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/stellar1/common.go (about)

     1  // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler)
     2  //   Input file: avdl/stellar1/common.avdl
     3  
     4  package stellar1
     5  
     6  import (
     7  	"fmt"
     8  	keybase1 "github.com/keybase/client/go/protocol/keybase1"
     9  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
    10  )
    11  
    12  type AccountID string
    13  
    14  func (o AccountID) DeepCopy() AccountID {
    15  	return o
    16  }
    17  
    18  type SecretKey string
    19  
    20  func (o SecretKey) DeepCopy() SecretKey {
    21  	return o
    22  }
    23  
    24  type TransactionID string
    25  
    26  func (o TransactionID) DeepCopy() TransactionID {
    27  	return o
    28  }
    29  
    30  type PaymentID string
    31  
    32  func (o PaymentID) DeepCopy() PaymentID {
    33  	return o
    34  }
    35  
    36  type KeybaseTransactionID string
    37  
    38  func (o KeybaseTransactionID) DeepCopy() KeybaseTransactionID {
    39  	return o
    40  }
    41  
    42  type TimeMs int64
    43  
    44  func (o TimeMs) DeepCopy() TimeMs {
    45  	return o
    46  }
    47  
    48  type Hash []byte
    49  
    50  func (o Hash) DeepCopy() Hash {
    51  	return (func(x []byte) []byte {
    52  		if x == nil {
    53  			return nil
    54  		}
    55  		return append([]byte{}, x...)
    56  	})(o)
    57  }
    58  
    59  type KeybaseRequestID string
    60  
    61  func (o KeybaseRequestID) DeepCopy() KeybaseRequestID {
    62  	return o
    63  }
    64  
    65  type AssetCode string
    66  
    67  func (o AssetCode) DeepCopy() AssetCode {
    68  	return o
    69  }
    70  
    71  type Asset struct {
    72  	Type               string `codec:"type" json:"type"`
    73  	Code               string `codec:"code" json:"code"`
    74  	Issuer             string `codec:"issuer" json:"issuer"`
    75  	VerifiedDomain     string `codec:"verifiedDomain" json:"verifiedDomain"`
    76  	IssuerName         string `codec:"issuerName" json:"issuerName"`
    77  	Desc               string `codec:"desc" json:"desc"`
    78  	InfoUrl            string `codec:"infoUrl" json:"infoUrl"`
    79  	InfoUrlText        string `codec:"infoUrlText" json:"infoUrlText"`
    80  	ShowDepositButton  bool   `codec:"showDepositButton" json:"showDepositButton"`
    81  	DepositButtonText  string `codec:"depositButtonText" json:"depositButtonText"`
    82  	ShowWithdrawButton bool   `codec:"showWithdrawButton" json:"showWithdrawButton"`
    83  	WithdrawButtonText string `codec:"withdrawButtonText" json:"withdrawButtonText"`
    84  	WithdrawType       string `codec:"withdrawType" json:"withdrawType"`
    85  	TransferServer     string `codec:"transferServer" json:"transferServer"`
    86  	AuthEndpoint       string `codec:"authEndpoint" json:"authEndpoint"`
    87  	DepositReqAuth     bool   `codec:"depositReqAuth" json:"depositReqAuth"`
    88  	WithdrawReqAuth    bool   `codec:"withdrawReqAuth" json:"withdrawReqAuth"`
    89  	UseSep24           bool   `codec:"useSep24" json:"useSep24"`
    90  }
    91  
    92  func (o Asset) DeepCopy() Asset {
    93  	return Asset{
    94  		Type:               o.Type,
    95  		Code:               o.Code,
    96  		Issuer:             o.Issuer,
    97  		VerifiedDomain:     o.VerifiedDomain,
    98  		IssuerName:         o.IssuerName,
    99  		Desc:               o.Desc,
   100  		InfoUrl:            o.InfoUrl,
   101  		InfoUrlText:        o.InfoUrlText,
   102  		ShowDepositButton:  o.ShowDepositButton,
   103  		DepositButtonText:  o.DepositButtonText,
   104  		ShowWithdrawButton: o.ShowWithdrawButton,
   105  		WithdrawButtonText: o.WithdrawButtonText,
   106  		WithdrawType:       o.WithdrawType,
   107  		TransferServer:     o.TransferServer,
   108  		AuthEndpoint:       o.AuthEndpoint,
   109  		DepositReqAuth:     o.DepositReqAuth,
   110  		WithdrawReqAuth:    o.WithdrawReqAuth,
   111  		UseSep24:           o.UseSep24,
   112  	}
   113  }
   114  
   115  type AssetListResult struct {
   116  	Assets     []Asset `codec:"assets" json:"assets"`
   117  	TotalCount int     `codec:"totalCount" json:"totalCount"`
   118  }
   119  
   120  func (o AssetListResult) DeepCopy() AssetListResult {
   121  	return AssetListResult{
   122  		Assets: (func(x []Asset) []Asset {
   123  			if x == nil {
   124  				return nil
   125  			}
   126  			ret := make([]Asset, len(x))
   127  			for i, v := range x {
   128  				vCopy := v.DeepCopy()
   129  				ret[i] = vCopy
   130  			}
   131  			return ret
   132  		})(o.Assets),
   133  		TotalCount: o.TotalCount,
   134  	}
   135  }
   136  
   137  type Balance struct {
   138  	Asset        Asset  `codec:"asset" json:"asset"`
   139  	Amount       string `codec:"amount" json:"amount"`
   140  	Limit        string `codec:"limit" json:"limit"`
   141  	IsAuthorized bool   `codec:"isAuthorized" json:"isAuthorized"`
   142  }
   143  
   144  func (o Balance) DeepCopy() Balance {
   145  	return Balance{
   146  		Asset:        o.Asset.DeepCopy(),
   147  		Amount:       o.Amount,
   148  		Limit:        o.Limit,
   149  		IsAuthorized: o.IsAuthorized,
   150  	}
   151  }
   152  
   153  type AccountReserve struct {
   154  	Amount      string `codec:"amount" json:"amount"`
   155  	Description string `codec:"description" json:"description"`
   156  }
   157  
   158  func (o AccountReserve) DeepCopy() AccountReserve {
   159  	return AccountReserve{
   160  		Amount:      o.Amount,
   161  		Description: o.Description,
   162  	}
   163  }
   164  
   165  type TransactionStatus int
   166  
   167  const (
   168  	TransactionStatus_NONE            TransactionStatus = 0
   169  	TransactionStatus_PENDING         TransactionStatus = 1
   170  	TransactionStatus_SUCCESS         TransactionStatus = 2
   171  	TransactionStatus_ERROR_TRANSIENT TransactionStatus = 3
   172  	TransactionStatus_ERROR_PERMANENT TransactionStatus = 4
   173  )
   174  
   175  func (o TransactionStatus) DeepCopy() TransactionStatus { return o }
   176  
   177  var TransactionStatusMap = map[string]TransactionStatus{
   178  	"NONE":            0,
   179  	"PENDING":         1,
   180  	"SUCCESS":         2,
   181  	"ERROR_TRANSIENT": 3,
   182  	"ERROR_PERMANENT": 4,
   183  }
   184  
   185  var TransactionStatusRevMap = map[TransactionStatus]string{
   186  	0: "NONE",
   187  	1: "PENDING",
   188  	2: "SUCCESS",
   189  	3: "ERROR_TRANSIENT",
   190  	4: "ERROR_PERMANENT",
   191  }
   192  
   193  func (e TransactionStatus) String() string {
   194  	if v, ok := TransactionStatusRevMap[e]; ok {
   195  		return v
   196  	}
   197  	return fmt.Sprintf("%v", int(e))
   198  }
   199  
   200  type RequestStatus int
   201  
   202  const (
   203  	RequestStatus_OK       RequestStatus = 0
   204  	RequestStatus_CANCELED RequestStatus = 1
   205  	RequestStatus_DONE     RequestStatus = 2
   206  )
   207  
   208  func (o RequestStatus) DeepCopy() RequestStatus { return o }
   209  
   210  var RequestStatusMap = map[string]RequestStatus{
   211  	"OK":       0,
   212  	"CANCELED": 1,
   213  	"DONE":     2,
   214  }
   215  
   216  var RequestStatusRevMap = map[RequestStatus]string{
   217  	0: "OK",
   218  	1: "CANCELED",
   219  	2: "DONE",
   220  }
   221  
   222  func (e RequestStatus) String() string {
   223  	if v, ok := RequestStatusRevMap[e]; ok {
   224  		return v
   225  	}
   226  	return fmt.Sprintf("%v", int(e))
   227  }
   228  
   229  type PaymentStrategy int
   230  
   231  const (
   232  	PaymentStrategy_NONE   PaymentStrategy = 0
   233  	PaymentStrategy_DIRECT PaymentStrategy = 1
   234  	PaymentStrategy_RELAY  PaymentStrategy = 2
   235  )
   236  
   237  func (o PaymentStrategy) DeepCopy() PaymentStrategy { return o }
   238  
   239  var PaymentStrategyMap = map[string]PaymentStrategy{
   240  	"NONE":   0,
   241  	"DIRECT": 1,
   242  	"RELAY":  2,
   243  }
   244  
   245  var PaymentStrategyRevMap = map[PaymentStrategy]string{
   246  	0: "NONE",
   247  	1: "DIRECT",
   248  	2: "RELAY",
   249  }
   250  
   251  func (e PaymentStrategy) String() string {
   252  	if v, ok := PaymentStrategyRevMap[e]; ok {
   253  		return v
   254  	}
   255  	return fmt.Sprintf("%v", int(e))
   256  }
   257  
   258  type RelayDirection int
   259  
   260  const (
   261  	RelayDirection_CLAIM RelayDirection = 0
   262  	RelayDirection_YANK  RelayDirection = 1
   263  )
   264  
   265  func (o RelayDirection) DeepCopy() RelayDirection { return o }
   266  
   267  var RelayDirectionMap = map[string]RelayDirection{
   268  	"CLAIM": 0,
   269  	"YANK":  1,
   270  }
   271  
   272  var RelayDirectionRevMap = map[RelayDirection]string{
   273  	0: "CLAIM",
   274  	1: "YANK",
   275  }
   276  
   277  func (e RelayDirection) String() string {
   278  	if v, ok := RelayDirectionRevMap[e]; ok {
   279  		return v
   280  	}
   281  	return fmt.Sprintf("%v", int(e))
   282  }
   283  
   284  type PaymentResult struct {
   285  	SenderAccountID AccountID            `codec:"senderAccountID" json:"senderAccountID"`
   286  	KeybaseID       KeybaseTransactionID `codec:"keybaseID" json:"keybaseID"`
   287  	StellarID       TransactionID        `codec:"stellarID" json:"stellarID"`
   288  	Pending         bool                 `codec:"pending" json:"pending"`
   289  }
   290  
   291  func (o PaymentResult) DeepCopy() PaymentResult {
   292  	return PaymentResult{
   293  		SenderAccountID: o.SenderAccountID.DeepCopy(),
   294  		KeybaseID:       o.KeybaseID.DeepCopy(),
   295  		StellarID:       o.StellarID.DeepCopy(),
   296  		Pending:         o.Pending,
   297  	}
   298  }
   299  
   300  type RelayClaimResult struct {
   301  	ClaimStellarID TransactionID `codec:"claimStellarID" json:"claimStellarID"`
   302  }
   303  
   304  func (o RelayClaimResult) DeepCopy() RelayClaimResult {
   305  	return RelayClaimResult{
   306  		ClaimStellarID: o.ClaimStellarID.DeepCopy(),
   307  	}
   308  }
   309  
   310  type EncryptedNote struct {
   311  	V         int               `codec:"v" json:"v"`
   312  	E         []byte            `codec:"e" json:"e"`
   313  	N         keybase1.BoxNonce `codec:"n" json:"n"`
   314  	Sender    NoteRecipient     `codec:"sender" json:"sender"`
   315  	Recipient *NoteRecipient    `codec:"recipient,omitempty" json:"recipient,omitempty"`
   316  }
   317  
   318  func (o EncryptedNote) DeepCopy() EncryptedNote {
   319  	return EncryptedNote{
   320  		V: o.V,
   321  		E: (func(x []byte) []byte {
   322  			if x == nil {
   323  				return nil
   324  			}
   325  			return append([]byte{}, x...)
   326  		})(o.E),
   327  		N:      o.N.DeepCopy(),
   328  		Sender: o.Sender.DeepCopy(),
   329  		Recipient: (func(x *NoteRecipient) *NoteRecipient {
   330  			if x == nil {
   331  				return nil
   332  			}
   333  			tmp := (*x).DeepCopy()
   334  			return &tmp
   335  		})(o.Recipient),
   336  	}
   337  }
   338  
   339  type NoteRecipient struct {
   340  	User   keybase1.UserVersion          `codec:"user" json:"user"`
   341  	PukGen keybase1.PerUserKeyGeneration `codec:"pukGen" json:"pukGen"`
   342  }
   343  
   344  func (o NoteRecipient) DeepCopy() NoteRecipient {
   345  	return NoteRecipient{
   346  		User:   o.User.DeepCopy(),
   347  		PukGen: o.PukGen.DeepCopy(),
   348  	}
   349  }
   350  
   351  type NoteContents struct {
   352  	Note      string        `codec:"note" json:"note"`
   353  	StellarID TransactionID `codec:"stellarID" json:"stellarID"`
   354  }
   355  
   356  func (o NoteContents) DeepCopy() NoteContents {
   357  	return NoteContents{
   358  		Note:      o.Note,
   359  		StellarID: o.StellarID.DeepCopy(),
   360  	}
   361  }
   362  
   363  type EncryptedRelaySecret struct {
   364  	V   int                           `codec:"v" json:"v"`
   365  	E   []byte                        `codec:"e" json:"e"`
   366  	N   keybase1.BoxNonce             `codec:"n" json:"n"`
   367  	Gen keybase1.PerTeamKeyGeneration `codec:"gen" json:"gen"`
   368  }
   369  
   370  func (o EncryptedRelaySecret) DeepCopy() EncryptedRelaySecret {
   371  	return EncryptedRelaySecret{
   372  		V: o.V,
   373  		E: (func(x []byte) []byte {
   374  			if x == nil {
   375  				return nil
   376  			}
   377  			return append([]byte{}, x...)
   378  		})(o.E),
   379  		N:   o.N.DeepCopy(),
   380  		Gen: o.Gen.DeepCopy(),
   381  	}
   382  }
   383  
   384  type RelayContents struct {
   385  	StellarID TransactionID `codec:"stellarID" json:"stellarID"`
   386  	Sk        SecretKey     `codec:"sk" json:"sk"`
   387  	Note      string        `codec:"note" json:"note"`
   388  }
   389  
   390  func (o RelayContents) DeepCopy() RelayContents {
   391  	return RelayContents{
   392  		StellarID: o.StellarID.DeepCopy(),
   393  		Sk:        o.Sk.DeepCopy(),
   394  		Note:      o.Note,
   395  	}
   396  }
   397  
   398  type OutsideCurrencyCode string
   399  
   400  func (o OutsideCurrencyCode) DeepCopy() OutsideCurrencyCode {
   401  	return o
   402  }
   403  
   404  type OutsideExchangeRate struct {
   405  	Currency OutsideCurrencyCode `codec:"currency" json:"currency"`
   406  	Rate     string              `codec:"rate" json:"rate"`
   407  }
   408  
   409  func (o OutsideExchangeRate) DeepCopy() OutsideExchangeRate {
   410  	return OutsideExchangeRate{
   411  		Currency: o.Currency.DeepCopy(),
   412  		Rate:     o.Rate,
   413  	}
   414  }
   415  
   416  type CurrencySymbol struct {
   417  	Symbol    string `codec:"symbol" json:"str"`
   418  	Ambigious bool   `codec:"ambigious" json:"ambigious"`
   419  	Postfix   bool   `codec:"postfix" json:"postfix"`
   420  }
   421  
   422  func (o CurrencySymbol) DeepCopy() CurrencySymbol {
   423  	return CurrencySymbol{
   424  		Symbol:    o.Symbol,
   425  		Ambigious: o.Ambigious,
   426  		Postfix:   o.Postfix,
   427  	}
   428  }
   429  
   430  type OutsideCurrencyDefinition struct {
   431  	Name   string         `codec:"name" json:"name"`
   432  	Symbol CurrencySymbol `codec:"symbol" json:"symbol"`
   433  }
   434  
   435  func (o OutsideCurrencyDefinition) DeepCopy() OutsideCurrencyDefinition {
   436  	return OutsideCurrencyDefinition{
   437  		Name:   o.Name,
   438  		Symbol: o.Symbol.DeepCopy(),
   439  	}
   440  }
   441  
   442  type StellarServerDefinitions struct {
   443  	Revision   int                                               `codec:"revision" json:"revision"`
   444  	Currencies map[OutsideCurrencyCode]OutsideCurrencyDefinition `codec:"currencies" json:"currencies"`
   445  }
   446  
   447  func (o StellarServerDefinitions) DeepCopy() StellarServerDefinitions {
   448  	return StellarServerDefinitions{
   449  		Revision: o.Revision,
   450  		Currencies: (func(x map[OutsideCurrencyCode]OutsideCurrencyDefinition) map[OutsideCurrencyCode]OutsideCurrencyDefinition {
   451  			if x == nil {
   452  				return nil
   453  			}
   454  			ret := make(map[OutsideCurrencyCode]OutsideCurrencyDefinition, len(x))
   455  			for k, v := range x {
   456  				kCopy := k.DeepCopy()
   457  				vCopy := v.DeepCopy()
   458  				ret[kCopy] = vCopy
   459  			}
   460  			return ret
   461  		})(o.Currencies),
   462  	}
   463  }
   464  
   465  type PageCursor struct {
   466  	HorizonCursor string `codec:"horizonCursor" json:"horizonCursor"`
   467  	DirectCursor  string `codec:"directCursor" json:"directCursor"`
   468  	RelayCursor   string `codec:"relayCursor" json:"relayCursor"`
   469  }
   470  
   471  func (o PageCursor) DeepCopy() PageCursor {
   472  	return PageCursor{
   473  		HorizonCursor: o.HorizonCursor,
   474  		DirectCursor:  o.DirectCursor,
   475  		RelayCursor:   o.RelayCursor,
   476  	}
   477  }
   478  
   479  type AccountMode int
   480  
   481  const (
   482  	AccountMode_NONE   AccountMode = 0
   483  	AccountMode_USER   AccountMode = 1
   484  	AccountMode_MOBILE AccountMode = 2
   485  )
   486  
   487  func (o AccountMode) DeepCopy() AccountMode { return o }
   488  
   489  var AccountModeMap = map[string]AccountMode{
   490  	"NONE":   0,
   491  	"USER":   1,
   492  	"MOBILE": 2,
   493  }
   494  
   495  var AccountModeRevMap = map[AccountMode]string{
   496  	0: "NONE",
   497  	1: "USER",
   498  	2: "MOBILE",
   499  }
   500  
   501  func (e AccountMode) String() string {
   502  	if v, ok := AccountModeRevMap[e]; ok {
   503  		return v
   504  	}
   505  	return fmt.Sprintf("%v", int(e))
   506  }
   507  
   508  type Trustline struct {
   509  	AssetCode AssetCode `codec:"assetCode" json:"assetCode"`
   510  	Issuer    AccountID `codec:"issuer" json:"issuer"`
   511  }
   512  
   513  func (o Trustline) DeepCopy() Trustline {
   514  	return Trustline{
   515  		AssetCode: o.AssetCode.DeepCopy(),
   516  		Issuer:    o.Issuer.DeepCopy(),
   517  	}
   518  }
   519  
   520  type PaymentPath struct {
   521  	SourceAmount              string  `codec:"sourceAmount" json:"sourceAmount"`
   522  	SourceAmountMax           string  `codec:"sourceAmountMax" json:"sourceAmountMax"`
   523  	SourceAsset               Asset   `codec:"sourceAsset" json:"sourceAsset"`
   524  	Path                      []Asset `codec:"path" json:"path"`
   525  	DestinationAmount         string  `codec:"destinationAmount" json:"destinationAmount"`
   526  	DestinationAsset          Asset   `codec:"destinationAsset" json:"destinationAsset"`
   527  	SourceInsufficientBalance string  `codec:"sourceInsufficientBalance" json:"sourceInsufficientBalance"`
   528  }
   529  
   530  func (o PaymentPath) DeepCopy() PaymentPath {
   531  	return PaymentPath{
   532  		SourceAmount:    o.SourceAmount,
   533  		SourceAmountMax: o.SourceAmountMax,
   534  		SourceAsset:     o.SourceAsset.DeepCopy(),
   535  		Path: (func(x []Asset) []Asset {
   536  			if x == nil {
   537  				return nil
   538  			}
   539  			ret := make([]Asset, len(x))
   540  			for i, v := range x {
   541  				vCopy := v.DeepCopy()
   542  				ret[i] = vCopy
   543  			}
   544  			return ret
   545  		})(o.Path),
   546  		DestinationAmount:         o.DestinationAmount,
   547  		DestinationAsset:          o.DestinationAsset.DeepCopy(),
   548  		SourceInsufficientBalance: o.SourceInsufficientBalance,
   549  	}
   550  }
   551  
   552  type CommonInterface interface {
   553  }
   554  
   555  func CommonProtocol(i CommonInterface) rpc.Protocol {
   556  	return rpc.Protocol{
   557  		Name:    "stellar.1.common",
   558  		Methods: map[string]rpc.ServeHandlerDescription{},
   559  	}
   560  }
   561  
   562  type CommonClient struct {
   563  	Cli rpc.GenericClient
   564  }