sep6_client

package
v0.0.0-...-402fa4c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveSlashFromUrl

func RemoveSlashFromUrl(url string) string

func StellarPublicKeyToEd25519

func StellarPublicKeyToEd25519(stellarPublicKey string) ([]byte, error)

Types

type AssetDetails

type AssetDetails struct {
	Enabled                bool    `json:"enabled"`
	MinAmount              float64 `json:"min_amount"`
	MaxAmount              float64 `json:"max_amount"`
	FeeFixed               float64 `json:"fee_fixed,omitempty"`
	FeePercent             float64 `json:"fee_percent,omitempty"`
	AuthenticationRequired bool    `json:"authentication_required"`
}

type DepositResponse

type DepositResponse struct {
	How          string                           `json:"how"`
	Instructions map[string]FinancialAccountField `json:"instructions"`
	ID           string                           `json:"id"`
	ETA          int                              `json:"eta"`
	MinAmount    string                           `json:"min_amount"`
	MaxAmount    string                           `json:"max_amount"`
	FeeFixed     string                           `json:"fee_fixed"`
	FeePercent   float64                          `json:"fee_percent"`
	ExtraInfo    map[string]interface{}           `json:"extra_info"`
}

type ErrorResponse

type ErrorResponse struct {
	Status string `json:"status"`
	Error  string `json:"error"`
}

type ExchangeDetails

type ExchangeDetails struct {
	Enabled                bool `json:"enabled"`
	AuthenticationRequired bool `json:"authentication_required"`
}

type Features

type Features struct {
	AccountCreation   bool `json:"account_creation"`
	ClaimableBalances bool `json:"claimable_balances"`
}

type FeeDetails

type FeeDetails struct {
	Enabled                bool `json:"enabled"`
	AuthenticationRequired bool `json:"authentication_required"`
}

type FetchError

type FetchError struct {
	Field   string
	Message string
}

func (*FetchError) Error

func (e *FetchError) Error() string

type FieldDetails

type FieldDetails struct {
	Description string `json:"description"`
	Optional    bool   `json:"optional"`
}

type FinancialAccountField

type FinancialAccountField struct {
	Value       string `json:"value"`
	Description string `json:"description"`
}

type InfoResponse

type InfoResponse struct {
	Deposit          map[string]AssetDetails    `json:"deposit"`
	Withdraw         map[string]WithdrawDetails `json:"withdraw"`
	Transaction      TransactionDetails         `json:"transaction"`
	Transactions     TransactionsDetails        `json:"transactions"`
	Features         Features                   `json:"features"`
	Fee              FeeDetails                 `json:"fee"`
	DepositExchange  ExchangeDetails            `json:"deposit-exchange"`
	WithdrawExchange ExchangeDetails            `json:"withdraw-exchange"`
	Supply           map[string]SupplyDetails   `json:"supply"`
}

type Sep6Client

type Sep6Client struct {
	SecretKey     string
	AnchorUrl     string
	HorizonServer string
	Address       string

	HomeDomain string
	// contains filtered or unexported fields
}

func NewSep6Client

func NewSep6Client(
	secretKey string,
	anchorUrl string,
	horizonServer string,
	homeDomain string,
) (*Sep6Client, error)

func (*Sep6Client) CreateDeposit

func (c *Sep6Client) CreateDeposit(
	assetCode string,
	amount float32,
	memo int,
	account string,
	onChangeCallback *string,
) (*DepositResponse, error)

func (*Sep6Client) GetInfo

func (c *Sep6Client) GetInfo() (*InfoResponse, error)

func (*Sep6Client) GetTransaction

func (c *Sep6Client) GetTransaction(transactionID string) (*Transaction, error)

func (*Sep6Client) GetTransactions

func (c *Sep6Client) GetTransactions(account string, memo *int, assetCode string, limit *int, order *string) ([]Transaction, error)

func (*Sep6Client) RegisterCallbackRoute

func (c *Sep6Client) RegisterCallbackRoute(server *gin.Engine, path string, handler func(txUpdate Transaction)) error

type StellarToml

type StellarToml struct {
	SigningKey string `toml:"SIGNING_KEY"`
}

type SupplyComponents

type SupplyComponents struct {
	Amount                  float64 `json:"amount"`
	ClaimableBalancesAmount float64 `json:"claimable_balances_amount"`
	LiquidityPoolsAmount    float64 `json:"liquidity_pools_amount"`
}

type SupplyDetails

type SupplyDetails struct {
	CirculatingSupply           float64          `json:"circulating_supply"`
	CirculatingSupplyComponents SupplyComponents `json:"circulating_supply_components"`
	HotwalletReserves           float64          `json:"hotwallet_reserves"`
	ColdwalletReserves          float64          `json:"coldwallet_reserves"`
	TotalReserves               float64          `json:"total_reserves"`
}

type Transaction

type Transaction struct {
	ID           string  `json:"id"`
	Kind         string  `json:"kind"`
	Status       string  `json:"status"`
	MoreInfoURL  string  `json:"more_info_url,omitempty"`
	AmountIn     string  `json:"amount_in,omitempty"`
	AmountOut    string  `json:"amount_out,omitempty"`
	AmountFee    string  `json:"amount_fee,omitempty"`
	StartedAt    string  `json:"started_at,omitempty"`
	CompletedAt  *string `json:"completed_at,omitempty"`
	StellarTxID  *string `json:"stellar_transaction_id,omitempty"`
	ExternalTxID *string `json:"external_transaction_id,omitempty"`
}

type TransactionDetails

type TransactionDetails struct {
	Enabled                bool `json:"enabled"`
	AuthenticationRequired bool `json:"authentication_required"`
}

type TransactionResponse

type TransactionResponse struct {
	Transaction Transaction `json:"transaction"`
}

type TransactionsDetails

type TransactionsDetails TransactionDetails

TransactionsDetails mirrors the structure of TransactionDetails since their JSON structure is identical.

type TransactionsResponse

type TransactionsResponse struct {
	Transactions []Transaction `json:"transactions"`
}

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

type WithdrawDetails

type WithdrawDetails struct {
	AssetDetails
	Types map[string]WithdrawTypeDetails `json:"types"`
}

type WithdrawTypeDetails

type WithdrawTypeDetails struct {
	Fields map[string]FieldDetails `json:"fields"`
}

Jump to

Keyboard shortcuts

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