wallet

package
v0.0.0-...-73eed44 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTransactionRequest

type CreateTransactionRequest struct {
	CryptoCode  string
	Destination string
	Amount      decimal.Decimal
	SubtractFee bool
}

type CreateTransactionResponse

type CreateTransactionResponse struct {
	TransactionHash string          `json:"transactionHash"`
	Comment         string          `json:"comment"`
	Amount          decimal.Decimal `json:"amount"`
	BlockHash       string          `json:"blockHash"`
	BlockHeight     string          `json:"blockHeight"`
	Confirmations   string          `json:"confirmations"`
	Timestamp       int64           `json:"timestamp"`
	Status          string          `json:"status"`
}

type CreateWalletTransactionRequest

type CreateWalletTransactionRequest struct {
	Destinations []TransactionDestination `json:"destinations"`
}

type CreateWalletTransactionResponse

type CreateWalletTransactionResponse struct {
	TransactionHash string          `json:"transactionHash"`
	Comment         string          `json:"comment"`
	Amount          decimal.Decimal `json:"amount"`
	BlockHash       string          `json:"blockHash"`
	BlockHeight     string          `json:"blockHeight"`
	Confirmations   string          `json:"confirmations"`
	Timestamp       int64           `json:"timestamp"`
	Status          string          `json:"status"`
}

type GetWalletAddressResponse

type GetWalletAddressResponse struct {
	Address     string
	KeyPath     string
	PaymentLink string
}

type GetWalletFeeRateResponse

type GetWalletFeeRateResponse struct {
	FeeRate decimal.Decimal
}

type GetWalletOverviewResponse

type GetWalletOverviewResponse struct {
	UnconfirmedBalance decimal.Decimal
	ConfirmedBalance   decimal.Decimal
	// contains filtered or unexported fields
}

type GetWalletRequest

type GetWalletRequest struct {
	CryptoCode string
}

type GetWalletsResponse

type GetWalletsResponse struct {
	Id         string
	CryptoCode string
	Symbol     string
	Name       string
	Balance    decimal.Decimal
}

type IWalletHelper

type IWalletHelper interface {
	GetWalletOverview(cryptoCode string) (*GetWalletOverviewResponse, error)
	GetWalletFeeRate(cryptoCode string) (*GetWalletFeeRateResponse, error)
	GetWalletAddress(cryptoCode string) (*GetWalletAddressResponse, error)
	GetWalletTransactions(cryptoCode string, skip int64, limit int64) (*[]WalletTransaction, error)
	CreateWalletTransaction(cryptoCode string, cwtr *CreateWalletTransactionRequest) (*CreateWalletTransactionResponse, error)
}

type IWalletRepository

type IWalletRepository interface {
	CreateWallet(wallet *Wallet) (*Wallet, error)
	GetWallet(id string) (*Wallet, error)
	GetWallets(filter interface{}, options *options.FindOptions) (*[]Wallet, error)
	UpdateWallet(wallet *Wallet) (*Wallet, error)
}

type TransactionDestination

type TransactionDestination struct {
	Destination        string          `json:"destination"`
	Amount             decimal.Decimal `json:"amount"`
	SubtractFromAmount bool            `json:"subtractFromAmount"`
}

type Wallet

type Wallet struct {
	Id      primitive.ObjectID `bson:"_id"`
	Name    string
	Symbol  string
	Balance primitive.Decimal128
}

type WalletController

type WalletController struct {
	// contains filtered or unexported fields
}

func (WalletController) CreateTransaction

func (wc WalletController) CreateTransaction(c *gin.Context)

func (WalletController) GetWalletAddress

func (wc WalletController) GetWalletAddress(c *gin.Context)

func (WalletController) GetWalletOverview

func (wc WalletController) GetWalletOverview(c *gin.Context)

func (WalletController) GetWallets

func (wc WalletController) GetWallets(c *gin.Context)

type WalletHelper

type WalletHelper struct {
	Client  resty.Client
	StoreId string
	Token   string
}

func NewWalletHelper

func NewWalletHelper(token string, hostname string, storeId string, client resty.Client) WalletHelper

func (WalletHelper) CreateWalletTransaction

func (wh WalletHelper) CreateWalletTransaction(cryptoCode string, cwtr *CreateWalletTransactionRequest) (*CreateWalletTransactionResponse, error)

func (WalletHelper) GetWalletAddress

func (wh WalletHelper) GetWalletAddress(cryptoCode string) (*GetWalletAddressResponse, error)

func (WalletHelper) GetWalletFeeRate

func (wh WalletHelper) GetWalletFeeRate(cryptoCode string) (*GetWalletFeeRateResponse, error)

func (WalletHelper) GetWalletOverview

func (wh WalletHelper) GetWalletOverview(cryptoCode string) (*GetWalletOverviewResponse, error)

func (WalletHelper) GetWalletTransactions

func (wh WalletHelper) GetWalletTransactions(cryptoCode string, skip int64, limit int64) (*[]WalletTransaction, error)

type WalletRepository

type WalletRepository struct {
	Client *mongo.Client
}

func NewWalletRepository

func NewWalletRepository(client *mongo.Client) WalletRepository

func (WalletRepository) CreateWallet

func (wr WalletRepository) CreateWallet(wallet *Wallet) (*Wallet, error)

func (WalletRepository) GetWallet

func (wr WalletRepository) GetWallet(id string) (*Wallet, error)

func (WalletRepository) GetWallets

func (wr WalletRepository) GetWallets(filter interface{}, options *options.FindOptions) (*[]Wallet, error)

func (WalletRepository) UpdateWallet

func (wr WalletRepository) UpdateWallet(wallet *Wallet) (*Wallet, error)

type WalletTransaction

type WalletTransaction struct {
	TransactionHash string          `json:"transactionHash"`
	Comment         string          `json:"comment"`
	Amount          decimal.Decimal `json:"amount"`
	BlockHash       string          `json:"blockHash"`
	BlockHeight     string          `json:"blockHeight"`
	Confirmations   string          `json:"confirmations"`
	Timestamp       int             `json:"timestamp"`
	Status          string          `json:"status"`
}

Jump to

Keyboard shortcuts

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