query

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountNameDefault  = "default"
	AccountNameWildcard = "*"
)
View Source
const (
	DefaultBatchExecutionDelay time.Duration = time.Hour
	DefaultBatchCapacity       model.Int     = 16
)
View Source
const (
	FlagCurencyAll = 0

	FlagCurencyDisable   = 0
	FlagCurencyAvailable = 1
)
View Source
const (
	AllChains = "*"
)
View Source
const (
	DefaultSwapValidity time.Duration = 24 * time.Hour
)
View Source
const (
	HistoryMaxOperationCount = 1000
)
View Source
const (
	MaxAssetIconDataLen = (256 << 10) - 1
)

Variables

View Source
var (
	ErrAccountExists   = errors.New("Account Exists")
	ErrAccountNotFound = errors.New("Account Not Found")
)
View Source
var (
	ErrAccountStateNotFound = errors.New("Account State Not Found")
	ErrInvalidAccountID     = errors.New("Invalid AccountID")
	ErrInvalidReferenceID   = errors.New("Invalid ReferenceID")
	ErrInvalidAccountState  = errors.New("Invalid Account State")
	ErrAccountIsDisabled    = errors.New("Account Is Disabled")
)
View Source
var (
	ErrInvalidAssetID   = errors.New("Invalid AssetID")
	ErrInvalidAssetHash = errors.New("Invalid AssetHash")
)
View Source
var (
	ErrInvalidAssetIcon = errors.New("Invalid AssetIcon")
	ErrAssetIconToLarge = errors.New("AssetIcon Too Large")
)
View Source
var (
	ErrInvalidBatchID        = errors.New("Invalid BatchID")
	ErrInvalidBatchWithdraws = errors.New("Invalid Withdraws")
	ErrInvalidNetwork        = errors.New("Invalid Network")
)
View Source
var (
	ErrInvalidBatchInfoID       = errors.New("Invalid BatchInfoID")
	ErrInvalidBatchStatus       = errors.New("Invalid BatchInfo Status")
	ErrInvalidBatchInfoDataType = errors.New("Invalid BatchInfo DataType")
)
View Source
var (
	ErrUserNotFound        = errors.New("User not found")
	ErrInvalidPasswordHash = errors.New("Invalid PasswordHash")
	ErrDatabaseError       = errors.New("Database Operation failed")
)
View Source
var (
	ErrInvalidChain           = errors.New("Invalid Chain")
	ErrInvalidPublicAddress   = errors.New("Invalid Public Address")
	ErrInvalidCryptoAddressID = errors.New("Invalid CryptoAddress ID")
)
View Source
var (
	ErrInvalidCurrencyName  = errors.New("Invalid Currency Name")
	ErrCurrencyNotFound     = errors.New("Currency Not found")
	ErrCurrencyNotAvailable = errors.New("Currency Not Available")
	ErrCurrencyNotCrypto    = errors.New("Currency Not Crypto")
)
View Source
var (
	ErrInvalidFeeID     = errors.New("Invalid FeeID")
	ErrInvalidFeeAmount = errors.New("Invalid Fee Amount")
)
View Source
var (
	ErrInvalidProvider   = errors.New("Invalid Provider")
	ErrInvalidProviderID = errors.New("Invalid ProviderID")
	ErrInvalidOAuthID    = errors.New("Invalid OAuthID")
	ErrInvalidOAuthData  = errors.New("Invalid OAuth Data")
)
View Source
var (
	ErrInvalidOperationInfoID          = errors.New("Invalid OperationInfo")
	ErrOperationInfoUpdateNotPermitted = errors.New("OperationInfo Update Not Permitted")
	ErrInvalidTransactionID            = errors.New("Invalid Transaction ID")
	ErrInvalidOperationAmount          = errors.New("Invalid Operation Amount")
)
View Source
var (
	ErrInvalidSsmAddressID     = errors.New("Invalid SsmAddressID")
	ErrInvalidSsmPublicAddress = errors.New("Invalid PublicAddress ID")
)
View Source
var (
	ErrInvalidSwapID     = errors.New("Invalid SwapID")
	ErrInvalidSwapType   = errors.New("Invalid Swap Type")
	ErrInvalidSwapAmount = errors.New("Invalid Amount")
)
View Source
var (
	ErrInvalidSwapInfoID  = errors.New("Invalid SwapInfoID")
	ErrInvalidSwapPayload = errors.New("Invalid Swap Payload")
)
View Source
var (
	ErrInvalidUserID    = errors.New("Invalid UserID")
	ErrInvalidUserName  = errors.New("Invalid User Name")
	ErrInvalidUserEmail = errors.New("Invalid User Email")
)
View Source
var (
	ErrInvalidWithdrawID              = errors.New("Invalid WithdrawID")
	ErrInvalidWithdrawAmount          = errors.New("Invalid Amount")
	ErrInvalidWithdrawAccount         = errors.New("Invalid Withdraw Account")
	ErrInvalidWithdrawAccountCurrency = errors.New("Invalid Withdraw Account Currency")
	ErrInvalidBatchMode               = errors.New("Invalid BatchMode")
)
View Source
var (
	ErrInvalidWithdrawInfoID   = errors.New("Invalid WithdrawInfoID")
	ErrInvalidWithdrawStatus   = errors.New("Invalid WithdrawInfo Status")
	ErrInvalidWithdrawInfoData = errors.New("Invalid WithdrawInfo Data")
)
View Source
var (
	ErrInvalidWithdrawTargetID   = errors.New("Invalid WithdrawTargetID")
	ErrInvalidWithdrawTargetData = errors.New("Invalid WithdrawTarget Data")
)
View Source
var (
	ErrFeeInfoInvalid = errors.New("Invalid FeeInfo")
)
View Source
var (
	ErrInvalidAccountOperation = errors.New("Invalid Account Operation")
)
View Source
var (
	ErrInvalidAssetInfo = errors.New("Invalid AssetInfo")
)
View Source
var (
	ErrInvalidBatchWithdrawID = errors.New("Invalid BatchWithdrawID")
)
View Source
var (
	ErrInvalidOperationStatus = errors.New("Invalid OperationStatus")
)
View Source
var (
	ErrInvalidRoleName = errors.New("Invalid RoleName")
)

Functions

func AccountModel

func AccountModel() []database.Model

func AccountOperationModel

func AccountOperationModel() []database.Model

func AccountPage

func AccountPage(db database.Context, accountID model.AccountID, countByPage int) ([]model.Account, error)

func AccountPagingCount

func AccountPagingCount(db database.Context, countByPage int) (int, error)

func AccountStateModel

func AccountStateModel() []database.Model

func AccountsExists

func AccountsExists(db database.Context, userID model.UserID, currency model.CurrencyName, name model.AccountName) bool

AccountsExists

func AddAsset

func AddAsset(db database.Context, assetHash model.AssetHash, currencyName model.CurrencyName) (model.Asset, error)

func AddBatch

func AddBatch(db database.Context, network model.BatchNetwork, data model.BatchData, withdraws ...model.WithdrawID) (model.Batch, error)

func AddBatchInfo

func AddBatchInfo(db database.Context, batchID model.BatchID, status model.BatchStatus, dataType encoding.DataType, data model.BatchInfoData) (model.BatchInfo, error)

func AddFee

func AddFee(db database.Context, withdrawID model.WithdrawID, amount model.Float, data model.FeeData) (model.Fee, error)

func AddOperationInfo

func AddOperationInfo(db database.Context, operation model.OperationInfo) (model.OperationInfo, error)

AddOperationInfo

func AddOrUpdateAccountState

func AddOrUpdateAccountState(db database.Context, accountSate model.AccountState) (model.AccountState, error)

AddOrUpdateAccountState

func AddOrUpdateAssetIcon

func AddOrUpdateAssetIcon(db database.Context, entry model.AssetIcon) (model.AssetIcon, error)

AddOrUpdateAssetIcon

func AddOrUpdateAssetInfo

func AddOrUpdateAssetInfo(db database.Context, entry model.AssetInfo) (model.AssetInfo, error)

AddOrUpdateAssetInfo

func AddOrUpdateCryptoAddress

func AddOrUpdateCryptoAddress(db database.Context, address model.CryptoAddress) (model.CryptoAddress, error)

AddOrUpdateCryptoAddress

func AddOrUpdateCurrency

func AddOrUpdateCurrency(db database.Context, currency model.Currency) (model.Currency, error)

AddOrUpdateCurrency

func AddOrUpdateFeeInfo

func AddOrUpdateFeeInfo(db database.Context, feeInfo model.FeeInfo) (model.FeeInfo, error)

AddOrUpdateFeeInfo

func AddOrUpdateOperationStatus

func AddOrUpdateOperationStatus(db database.Context, operation model.OperationStatus) (model.OperationStatus, error)

AddOrUpdateOperationStatus

func AddSsmAddress

func AddSsmAddress(db database.Context, address model.SsmAddress, info model.SsmAddressInfo) (model.SsmAddressID, error)

func AddSwap

func AddSwap(db database.Context, swapType model.SwapType, cryptoAddressID model.CryptoAddressID, debitAsset model.AssetID, debitAmount model.Float, creditAsset model.AssetID, creditAmount model.Float) (model.Swap, error)

func AddSwapInfo

func AddSwapInfo(db database.Context, swapID model.SwapID, status model.SwapStatus, payload model.Payload) (model.SwapInfo, error)

func AddWithdraw

func AddWithdraw(db database.Context, from, to model.AccountID, amount model.Float, batch model.BatchMode, data model.WithdrawData) (model.Withdraw, error)

func AddWithdrawInfo

func AddWithdrawInfo(db database.Context, withdrawID model.WithdrawID, status model.WithdrawStatus, data model.WithdrawInfoData) (model.WithdrawInfo, error)

func AddWithdrawToBatch

func AddWithdrawToBatch(db database.Context, batchID model.BatchID, withdraws ...model.WithdrawID) error

func AllAccountCryptoAddresses

func AllAccountCryptoAddresses(db database.Context, accountID model.AccountID) ([]model.CryptoAddress, error)

func AllMempoolCryptoAddresses

func AllMempoolCryptoAddresses(db database.Context, chain model.String) ([]model.CryptoAddress, error)

func AllUnconfirmedCryptoAddresses

func AllUnconfirmedCryptoAddresses(db database.Context, chain model.String, afterBlock model.BlockID) ([]model.CryptoAddress, error)

func AllUnusedAccountCryptoAddresses

func AllUnusedAccountCryptoAddresses(db database.Context, accountID model.AccountID) ([]model.CryptoAddress, error)

func AllUnusedCryptoAddresses

func AllUnusedCryptoAddresses(db database.Context, chain model.String) ([]model.CryptoAddress, error)

func AppendAccountOperation

func AppendAccountOperation(db database.Context, operation model.AccountOperation) (model.AccountOperation, error)

func AppendAccountOperationSlice

func AppendAccountOperationSlice(db database.Context, operations ...model.AccountOperation) ([]model.AccountOperation, error)

func AppendCurencyRates

func AppendCurencyRates(db database.Context, currencyRates []model.CurrencyRate) error

func AssetCount

func AssetCount(db database.Context) (int64, error)

func AssetHashExists

func AssetHashExists(db database.Context, assetHash model.AssetHash) bool

func AssetModel

func AssetModel() []database.Model

func BatchPage

func BatchPage(db database.Context, batchID model.BatchID, countByPage int) ([]model.BatchID, error)

func BatchPagingCount

func BatchPagingCount(db database.Context, countByPage int) (int, error)

func CheckCredential

func CheckCredential(ctx context.Context, db database.Context, login, password model.Base58) (model.UserID, bool, error)

func CountCurrencies

func CountCurrencies(db database.Context) int

CountCurrencies

func CountSsmAddress

func CountSsmAddress(db database.Context, chain model.SsmChain, fingerprint model.SsmFingerprint) (int, error)

func CountSsmAddressByState

func CountSsmAddressByState(db database.Context, chain model.SsmChain, fingerprint model.SsmFingerprint, state model.SsmAddressStatus) (int, error)

func CreateAccount

func CreateAccount(db database.Context, account model.Account) (model.Account, error)

func CreateOrUpdateOAuthData

func CreateOrUpdateOAuthData(db database.Context, oauthData model.OAuthData) (model.OAuthData, error)

CreateOrUpdateOAuthData

func CreateOrUpdatedCredential

func CreateOrUpdatedCredential(ctx context.Context, db database.Context, credential model.Credential) (model.Credential, error)

func CryptoAddressModel

func CryptoAddressModel() []database.Model

func CurrencyExists

func CurrencyExists(db database.Context, name model.CurrencyName) bool

CurrencyExists

func CurrencyModel

func CurrencyModel() []database.Model

func DepositPage

func DepositPage(db database.Context, operationInfoID model.OperationInfoID, countByPage int) ([]model.OperationInfoID, error)

func DepositPagingCount

func DepositPagingCount(db database.Context, countByPage int) (int, error)

func FeeInfoExists

func FeeInfoExists(db database.Context, currency model.CurrencyName) bool

FeeInfoExists

func FeeModel

func FeeModel() []database.Model

func FetchBatchByLastStatus

func FetchBatchByLastStatus(db database.Context, status model.BatchStatus) ([]model.Batch, error)

func FetchBatchReady

func FetchBatchReady(db database.Context) ([]model.Batch, error)

func FindAccountOperationByReference

func FindAccountOperationByReference(db database.Context, synchroneousType model.SynchroneousType, operationType model.OperationType, referenceID model.RefID) (model.AccountOperation, error)

func FindActiveOperationInfo

func FindActiveOperationInfo(db database.Context) ([]model.OperationInfo, error)

func FindActiveOperationStatus

func FindActiveOperationStatus(db database.Context) ([]model.OperationStatus, error)

func FindCryptoAddressesByOperationInfoState

func FindCryptoAddressesByOperationInfoState(db database.Context, chain model.String, states ...model.String) ([]model.CryptoAddress, error)

func FindCryptoAddressesNotInOperationInfo

func FindCryptoAddressesNotInOperationInfo(db database.Context, chain model.String) ([]model.CryptoAddress, error)

func FindOrCreateOAuth

func FindOrCreateOAuth(db database.Context, oauth model.OAuth) (model.OAuth, error)

FindOrCreateOAuth

func FindOrCreateUser

func FindOrCreateUser(db database.Context, user model.User) (model.User, error)

func FindUserByEmail

func FindUserByEmail(db database.Context, email model.UserEmail) (model.User, error)

func FindUserById

func FindUserById(db database.Context, userID model.UserID) (model.User, error)

func FindWithdrawByCurrencyNameAndStatus

func FindWithdrawByCurrencyNameAndStatus(db database.Context, currency model.CurrencyName, status model.WithdrawStatus) ([]model.Withdraw, error)

func FindWithdrawByUser

func FindWithdrawByUser(db database.Context, userID model.UserID) ([]model.Withdraw, error)

func GeAccountHistory

func GeAccountHistory(db database.Context, accountID model.AccountID) ([]model.AccountOperation, error)

func GeAccountHistoryRange

func GeAccountHistoryRange(db database.Context, accountID model.AccountID, from, to time.Time) ([]model.AccountOperation, error)

func GetAccountByID

func GetAccountByID(db database.Context, accountID model.AccountID) (model.Account, error)

func GetAccountStatusByAccountID

func GetAccountStatusByAccountID(db database.Context, accountID model.AccountID) (model.AccountState, error)

func GetAccountsByUserAndCurrencyAndName

func GetAccountsByUserAndCurrencyAndName(db database.Context, userID model.UserID, currency model.CurrencyName, name model.AccountName) ([]model.Account, error)

GetAccountsByNameAndCurrency

func GetAsset

func GetAsset(db database.Context, assetID model.AssetID) (model.Asset, error)

func GetAssetByCurrencyName

func GetAssetByCurrencyName(db database.Context, currencyName model.CurrencyName) (model.Asset, error)

func GetAssetByHash

func GetAssetByHash(db database.Context, assetHash model.AssetHash) (model.Asset, error)

func GetAssetIcon

func GetAssetIcon(db database.Context, assetID model.AssetID) (model.AssetIcon, error)

GetAssetIcon

func GetAssetInfo

func GetAssetInfo(db database.Context, assetID model.AssetID) (model.AssetInfo, error)

GetAssetInfo

func GetBatch

func GetBatch(db database.Context, ID model.BatchID) (model.Batch, error)

func GetBatchHistory

func GetBatchHistory(db database.Context, batchID model.BatchID) ([]model.BatchInfo, error)

func GetBatchInfo

func GetBatchInfo(db database.Context, ID model.BatchInfoID) (model.BatchInfo, error)

func GetBatchInfoByStatusAndType

func GetBatchInfoByStatusAndType(db database.Context, status model.BatchStatus, dataType encoding.DataType) ([]model.BatchInfo, error)

func GetBatchWithdraws

func GetBatchWithdraws(db database.Context, batchID model.BatchID) ([]model.WithdrawID, error)

func GetCryptoAddressWithPublicAddress

func GetCryptoAddressWithPublicAddress(db database.Context, publicAddress model.String) (model.CryptoAddress, error)

func GetCryptoAddressWithUnconfidential

func GetCryptoAddressWithUnconfidential(db database.Context, unconfidential model.String) (model.CryptoAddress, error)

func GetCurrencyByName

func GetCurrencyByName(db database.Context, name model.CurrencyName) (model.Currency, error)

GetCurrencyByName

func GetFee

func GetFee(db database.Context, ID model.FeeID) (model.Fee, error)

func GetFeeByWithdrawID

func GetFeeByWithdrawID(db database.Context, withdrawID model.WithdrawID) (model.Fee, error)

func GetFeeInfo

func GetFeeInfo(db database.Context, currency model.CurrencyName) (model.FeeInfo, error)

GetFeeInfo

func GetLastAccountOperation

func GetLastAccountOperation(db database.Context, accountID model.AccountID) (model.AccountOperation, error)

func GetLastBatchInfo

func GetLastBatchInfo(db database.Context, batchID model.BatchID) (model.BatchInfo, error)

func GetLastBatchInfoByStatusAndNetwork

func GetLastBatchInfoByStatusAndNetwork(db database.Context, status model.BatchStatus, network model.BatchNetwork) ([]model.BatchInfo, error)

func GetLastCurencyRates

func GetLastCurencyRates(db database.Context) ([]model.CurrencyRate, error)

func GetLastWithdrawInfo

func GetLastWithdrawInfo(db database.Context, withdrawID model.WithdrawID) (model.WithdrawInfo, error)

func GetLastWithdrawTargetByStatus

func GetLastWithdrawTargetByStatus(db database.Context, status model.WithdrawStatus) ([]model.WithdrawTarget, error)

func GetNextAccountOperation

func GetNextAccountOperation(db database.Context, accountID model.AccountID, operationID model.AccountOperationID) (model.AccountOperation, error)

func GetOperationInfo

func GetOperationInfo(db database.Context, operationID model.OperationInfoID) (model.OperationInfo, error)

GetOperationInfo

func GetOperationInfoByCryptoAddress

func GetOperationInfoByCryptoAddress(db database.Context, cryptoAddressID model.CryptoAddressID) ([]model.OperationInfo, error)

GetOperationInfoByCryptoAddress

func GetOperationInfoByTxId

func GetOperationInfoByTxId(db database.Context, txID model.TxID) (model.OperationInfo, error)

GetOperationInfoByTxId

func GetOperationStatus

func GetOperationStatus(db database.Context, operationInfoID model.OperationInfoID) (model.OperationStatus, error)

GetOperationStatus

func GetPreviousAccountOperation

func GetPreviousAccountOperation(db database.Context, accountID model.AccountID, operationID model.AccountOperationID) (model.AccountOperation, error)

func GetSsmAddress

func GetSsmAddress(db database.Context, addressID model.SsmAddressID) (model.SsmAddress, error)

func GetSsmAddressByPublicAddress

func GetSsmAddressByPublicAddress(db database.Context, publicAddress model.SsmPublicAddress) (model.SsmAddress, error)

func GetSsmAddressInfo

func GetSsmAddressInfo(db database.Context, addressID model.SsmAddressID) (model.SsmAddressInfo, error)

func GetSsmAddressState

func GetSsmAddressState(db database.Context, addressID model.SsmAddressID) (model.SsmAddressState, error)

func GetSwap

func GetSwap(db database.Context, swapID model.SwapID) (model.Swap, error)

func GetSwapByCryptoAddressID

func GetSwapByCryptoAddressID(db database.Context, cryptoAddressID model.CryptoAddressID) (model.Swap, error)

func GetSwapInfo

func GetSwapInfo(db database.Context, swapInfoID model.SwapInfoID) (model.SwapInfo, error)

func GetSwapInfoBySwapID

func GetSwapInfoBySwapID(db database.Context, swapID model.SwapID) (model.SwapInfo, error)

func GetUserAccounts

func GetUserAccounts(db database.Context, userID model.UserID) ([]model.AccountID, error)

func GetWithdraw

func GetWithdraw(db database.Context, ID model.WithdrawID) (model.Withdraw, error)

func GetWithdrawHistory

func GetWithdrawHistory(db database.Context, withdrawID model.WithdrawID) ([]model.WithdrawInfo, error)

func GetWithdrawTargetByWithdrawID

func GetWithdrawTargetByWithdrawID(db database.Context, withdrawID model.WithdrawID) (model.WithdrawTarget, error)

func HashEntry

func HashEntry(entry model.Base58) model.Base58

func LastAccountCryptoAddress

func LastAccountCryptoAddress(db database.Context, accountID model.AccountID) (model.CryptoAddress, error)

func ListAllCurrency

func ListAllCurrency(db database.Context) ([]model.Currency, error)

ListAllCurrency

func ListAvailableCurrency

func ListAvailableCurrency(db database.Context) ([]model.Currency, error)

ListAvailableCurrency

func ListBatchNetworksByStatus

func ListBatchNetworksByStatus(db database.Context, status model.BatchStatus) ([]model.BatchNetwork, error)

func ListCancelingWithdrawsAccountOperations

func ListCancelingWithdrawsAccountOperations(db database.Context) ([]model.AccountOperation, error)

func NextSsmAddressID

func NextSsmAddressID(db database.Context, chain model.SsmChain, fingerprint model.SsmFingerprint) (model.SsmAddressID, error)

func OperationInfoModel

func OperationInfoModel() []database.Model

func QueryAccountList

func QueryAccountList(db database.Context, userID model.UserID, currency model.CurrencyName, name model.AccountName) ([]model.Account, error)

QueryAccountList

func QueryCurrencyList

func QueryCurrencyList(db database.Context, name model.CurrencyName, available int) ([]model.Currency, error)

QueryCurrencyList

func ScopeAccountCurrencyName

func ScopeAccountCurrencyName(name model.CurrencyName) func(db *gorm.DB) *gorm.DB

ScopeCurencyName

func ScopeAccountID

func ScopeAccountID(accountID model.AccountID) func(db *gorm.DB) *gorm.DB

ScopeAccountID

func ScopeAccountName

func ScopeAccountName(name model.AccountName) func(db *gorm.DB) *gorm.DB

ScopeAccountName

func ScopeCurencyAvailable

func ScopeCurencyAvailable(available int) func(db *gorm.DB) *gorm.DB

ScopeCurencyAvailable

func ScopeCurencyName

func ScopeCurencyName(name model.CurrencyName) func(db *gorm.DB) *gorm.DB

ScopeCurencyName

func ScopeFirstBefore

func ScopeFirstBefore(blockID model.BlockID) func(db *gorm.DB) *gorm.DB

ScopeFirstBefore

func ScopeFirstBlockIDAfter

func ScopeFirstBlockIDAfter(blockID model.BlockID) func(db *gorm.DB) *gorm.DB

ScopeFirstBlockIDAfter

func ScopeFirstBlockIDExact

func ScopeFirstBlockIDExact(blockID model.BlockID) func(db *gorm.DB) *gorm.DB

ScopeFirstBlockIDExact

func ScopeUserID

func ScopeUserID(userID model.UserID) func(db *gorm.DB) *gorm.DB

ScopeUserID

func SsmAddressModel

func SsmAddressModel() []database.Model

func SwapModel

func SwapModel() []database.Model

func SwapPage

func SwapPage(db database.Context, swapID model.SwapID, countByPage int) ([]model.SwapID, error)

func SwapPagingCount

func SwapPagingCount(db database.Context, countByPage int) (int, error)

func TxAppendAccountOperation

func TxAppendAccountOperation(db database.Context, operation model.AccountOperation) (model.AccountOperation, error)

func TxAppendAccountOperationSlice

func TxAppendAccountOperationSlice(db database.Context, operations ...model.AccountOperation) ([]model.AccountOperation, error)

func UpdateSsmAddressState

func UpdateSsmAddressState(db database.Context, addressID model.SsmAddressID, status model.SsmAddressStatus) (model.SsmAddressState, error)

func UserCount

func UserCount(db database.Context) (int, error)

func UserExists

func UserExists(db database.Context, userID model.UserID) bool

func UserHasRole

func UserHasRole(db database.Context, userID model.UserID, role model.RoleName) (bool, error)

func UserModel

func UserModel() []database.Model

func UserPage

func UserPage(db database.Context, userID model.UserID, countByPage int) ([]model.User, error)

func UserPagingCount

func UserPagingCount(db database.Context, countByPage int) (int, error)

func UserRoles

func UserRoles(db database.Context, userID model.UserID) ([]model.RoleName, error)

func WithdrawModel

func WithdrawModel() []database.Model

func WithdrawPage

func WithdrawPage(db database.Context, withdrawID model.WithdrawID, countByPage int) ([]model.WithdrawID, error)

func WithdrawPagingCount

func WithdrawPagingCount(db database.Context, countByPage int) (int, error)

Types

type AccountInfo

type AccountInfo struct {
	Account  model.Account
	Currency model.Currency
	State    model.AccountState
	Last     model.AccountOperation
}

type AccountInfos

type AccountInfos struct {
	Count    int
	Active   int
	Accounts []AccountSummary
}

func AccountsInfos

func AccountsInfos(db database.Context) (AccountInfos, error)

func AccountsInfosByUser

func AccountsInfosByUser(db database.Context, userID model.UserID) (AccountInfos, error)

type AccountOperationPrevNext

type AccountOperationPrevNext struct {
	model.AccountOperation
	Previous model.AccountOperationID
	Next     model.AccountOperationID
}

func GeAccountHistoryWithPrevNext

func GeAccountHistoryWithPrevNext(db database.Context, accountID model.AccountID) ([]AccountOperationPrevNext, error)

type AccountSummary

type AccountSummary struct {
	CurrencyName string
	Balance      float64
	TotalLocked  float64
}

type BatchInfos

type BatchInfos struct {
	Count  int
	Active int
}

func BatchsInfos

func BatchsInfos(db database.Context) (BatchInfos, error)

type DepositInfos

type DepositInfos struct {
	Count  int
	Active int
}

func DepositsInfos

func DepositsInfos(db database.Context) (DepositInfos, error)

type SwapInfos

type SwapInfos struct {
	Count  int
	Active int
}

func SwapssInfos

func SwapssInfos(db database.Context) (SwapInfos, error)

type WithdrawInfos

type WithdrawInfos struct {
	Count  int
	Active int
}

func WithdrawsInfos

func WithdrawsInfos(db database.Context) (WithdrawInfos, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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