models

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmlRiskLevelNone      = "none"
	AmlRiskLevelLow       = "low"
	AmlRiskLevelMedium    = "medium"
	AmlRiskLevelHigh      = "high"
	AmlRiskLevelCritical  = "critical"
	AmlRiskLevelUndefined = "undefined"
)
View Source
const (
	CurrencyCodeUSD   string = "USD"
	CurrencyCodeUSDT  string = "USDT"
	CurrencyCodeUSDC  string = "USDC"
	CurrencyCodeDAI   string = "DAI"
	CurrencyCodeUSDD  string = "USDD"
	CurrencyCodeUSDE  string = "USDE"
	CurrencyCodeUSD1  string = "USD1"
	CurrencyCodePYUSD string = "PYUSD"
)

Variables

View Source
var BlockchainSortOrder = map[Blockchain]int{
	BlockchainTron:              0,
	BlockchainEthereum:          1,
	BlockchainBinanceSmartChain: 2,
	BlockchainPolygon:           3,
	BlockchainBitcoin:           4,
	BlockchainLitecoin:          5,
	BlockchainBitcoinCash:       6,
	BlockchainDogecoin:          7,
	BlockchainArbitrum:          8,
}

Functions

func CurrencyCodeStableList

func CurrencyCodeStableList() []string

func CurrencyCodeStableSet

func CurrencyCodeStableSet() map[string]struct{}

Types

type AMLCheckStatus

type AMLCheckStatus string
const (
	AmlCheckStatusPending AMLCheckStatus = "pending"
	AmlCheckStatusSuccess AMLCheckStatus = "success"
	AmlCheckStatusFailed  AMLCheckStatus = "failed"
)

func (AMLCheckStatus) String

func (s AMLCheckStatus) String() string

type AMLSlug

type AMLSlug string
const (
	AMLSlugAMLBot AMLSlug = "aml_bot"
	AMLSlugBitOK  AMLSlug = "bit_ok"
)

func (AMLSlug) String

func (s AMLSlug) String() string

func (AMLSlug) Valid

func (s AMLSlug) Valid() bool

type AccountBalanceDTO

type AccountBalanceDTO struct {
	Currency  string          `json:"currency"`
	Type      string          `json:"type"`
	Amount    decimal.Decimal `json:"amount"`
	AmountUSD decimal.Decimal `json:"amount_usd"`
}

type AddressBookType

type AddressBookType string
const (
	AddressBookTypeSimple    AddressBookType = "simple"
	AddressBookTypeUniversal AddressBookType = "universal"
	AddressBookTypeEVM       AddressBookType = "evm"
)

func (AddressBookType) String

func (o AddressBookType) String() string

type AddressType

type AddressType string
const (
	DepositAddress  AddressType = "deposit"
	WithdrawAddress AddressType = "withdraw"
)

func (AddressType) String

func (a AddressType) String() string

type AmlCheck

type AmlCheck struct {
	ID         uuid.UUID        `db:"id" json:"id"`
	UserID     uuid.UUID        `db:"user_id" json:"user_id"`
	ServiceID  uuid.UUID        `db:"service_id" json:"service_id"`
	ExternalID string           `db:"external_id" json:"external_id"`
	Status     AMLCheckStatus   `db:"status" json:"status"`
	Score      decimal.Decimal  `db:"score" json:"score"`
	RiskLevel  *AmlRiskLevel    `db:"risk_level" json:"risk_level"`
	CreatedAt  pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type AmlCheckHistory

type AmlCheckHistory struct {
	ID              uuid.UUID        `db:"id" json:"id"`
	AmlCheckID      uuid.UUID        `db:"aml_check_id" json:"aml_check_id"`
	RequestPayload  []byte           `db:"request_payload" json:"request_payload"`
	ServiceResponse []byte           `db:"service_response" json:"service_response"`
	ErrorMsg        pgtype.Text      `db:"error_msg" json:"error_msg"`
	AttemptNumber   int32            `db:"attempt_number" json:"attempt_number"`
	CreatedAt       pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt       pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type AmlCheckQueue

type AmlCheckQueue struct {
	ID         uuid.UUID        `db:"id" json:"id"`
	UserID     uuid.UUID        `db:"user_id" json:"user_id"`
	AmlCheckID uuid.UUID        `db:"aml_check_id" json:"aml_check_id"`
	Attempts   int32            `db:"attempts" json:"attempts"`
	CreatedAt  pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type AmlKeyType

type AmlKeyType string
const (
	AmlKeyTypeAccessKeyID AmlKeyType = "access_key_id"
	AmlKeyTypeSecret      AmlKeyType = "secret_key"
	AmlKeyTypeAccessKey   AmlKeyType = "access_key"
	AmlKeyTypeAccessID    AmlKeyType = "access_id"
)

type AmlRiskLevel

type AmlRiskLevel string

type AmlService

type AmlService struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	Slug      AMLSlug          `db:"slug" json:"slug"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type AmlServiceKey

type AmlServiceKey struct {
	ID          uuid.UUID        `db:"id" json:"id"`
	ServiceID   uuid.UUID        `db:"service_id" json:"service_id"`
	Name        AmlKeyType       `db:"name" json:"name"`
	Description string           `db:"description" json:"description"`
	CreatedAt   pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt   pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type AmlSupportedAsset

type AmlSupportedAsset struct {
	ServiceSlug    AMLSlug `db:"service_slug" json:"service_slug"`
	CurrencyID     string  `db:"currency_id" json:"currency_id"`
	AssetIdentity  string  `db:"asset_identity" json:"asset_identity"`
	BlockchainName string  `db:"blockchain_name" json:"blockchain_name"`
}

type AmlUserKey

type AmlUserKey struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	KeyID     uuid.UUID        `db:"key_id" json:"key_id"`
	UserID    uuid.UUID        `db:"user_id" json:"user_id"`
	Value     string           `db:"value" json:"value"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type AppProfile

type AppProfile string
const (
	AppProfileDev  AppProfile = "dev"
	AppProfileProd AppProfile = "prod"
	AppProfileDemo AppProfile = "demo"
)

type Blockchain

type Blockchain string // @name Blockchain
const (
	BlockchainArbitrum          Blockchain = "arbitrum"
	BlockchainBitcoin           Blockchain = "bitcoin"
	BlockchainBitcoinCash       Blockchain = "bitcoincash"
	BlockchainBinanceSmartChain Blockchain = "bsc"
	BlockchainDogecoin          Blockchain = "dogecoin"
	BlockchainEthereum          Blockchain = "ethereum"
	BlockchainLitecoin          Blockchain = "litecoin"
	BlockchainPolygon           Blockchain = "polygon"
	BlockchainTron              Blockchain = "tron"
)

func AllBlockchain

func AllBlockchain() []Blockchain

func ConvertToModel

func ConvertToModel(blockchain commonv1.Blockchain) Blockchain

func (Blockchain) ConfirmationBlockCount added in v0.9.11

func (b Blockchain) ConfirmationBlockCount() uint64

func (Blockchain) IsBitcoinLike

func (b Blockchain) IsBitcoinLike() bool

func (Blockchain) IsEVMLike

func (b Blockchain) IsEVMLike() bool

func (Blockchain) KindWithdrawalRequired

func (b Blockchain) KindWithdrawalRequired() bool

func (Blockchain) NativeCurrency

func (o Blockchain) NativeCurrency() (string, error)

func (Blockchain) RecalculateNativeBalance

func (b Blockchain) RecalculateNativeBalance() bool

func (Blockchain) ShowProcessingWallets

func (b Blockchain) ShowProcessingWallets() bool

func (Blockchain) String

func (o Blockchain) String() string

func (Blockchain) ToEPb

func (b Blockchain) ToEPb() (commonv2.Blockchain, error)

func (Blockchain) ToPb

func (b Blockchain) ToPb() (commonv1.Blockchain, error)

func (Blockchain) Tokens

func (o Blockchain) Tokens() ([]string, error)

func (Blockchain) Valid

func (o Blockchain) Valid() error

type CreateWithdrawalOrderParams

type CreateWithdrawalOrderParams struct {
	RecordID            *uuid.UUID
	Currency            string
	Chain               string
	NativeAmount        decimal.Decimal
	FiatAmount          decimal.Decimal
	Address             string
	Fee                 decimal.Decimal
	WithdrawalPrecision int
	MinWithdrawal       decimal.Decimal
}

type Currency

type Currency struct {
	ID                   string           `db:"id" json:"id"`
	Code                 string           `db:"code" json:"code"`
	Name                 string           `db:"name" json:"name"`
	Precision            int16            `db:"precision" json:"precision"`
	IsFiat               bool             `db:"is_fiat" json:"is_fiat"`
	Blockchain           *Blockchain      `db:"blockchain" json:"blockchain"`
	ContractAddress      pgtype.Text      `db:"contract_address" json:"contract_address"`
	WithdrawalMinBalance *decimal.Decimal `db:"withdrawal_min_balance" json:"withdrawal_min_balance"`
	HasBalance           bool             `db:"has_balance" json:"has_balance"`
	Status               bool             `db:"status" json:"status"`
	SortOrder            int16            `db:"sort_order" json:"sort_order"`
	MinConfirmation      pgtype.Int2      `db:"min_confirmation" json:"min_confirmation"`
	CreatedAt            pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	IsStablecoin         bool             `db:"is_stablecoin" json:"is_stablecoin"`
	CurrencyLabel        pgtype.Text      `db:"currency_label" json:"currency_label"`
	TokenLabel           pgtype.Text      `db:"token_label" json:"token_label"`
	IsNative             bool             `db:"is_native" json:"is_native"`
	IsNewStoreDefault    bool             `db:"is_new_store_default" json:"is_new_store_default"`
}

type CurrencyShort

type CurrencyShort struct {
	ID            string      `db:"id" json:"id"`
	Code          string      `db:"code" json:"code"`
	Precision     int16       `db:"precision" json:"precision"`
	Name          string      `db:"name" json:"name"`
	Blockchain    *Blockchain `db:"blockchain" json:"blockchain"`
	IsBitcoinLike bool        `db:"is_bitcoin_like" json:"is_bitcoin_like"`
	IsEVMLike     bool        `db:"is_evm_like" json:"is_evm_like"`
	IsStableCoin  bool        `db:"is_stable_coin" json:"is_stable_coin"`

} //	@name	CurrencyShort

type CurrencyType

type CurrencyType string
const (
	CurrencyTypeFiat   CurrencyType = "fiat"
	CurrencyTypeCrypto CurrencyType = "crypto"
)

func (CurrencyType) String

func (o CurrencyType) String() string

func (CurrencyType) Valid

func (o CurrencyType) Valid() bool

type DeliveryChannel

type DeliveryChannel string //	@name	DeliveryChannel
const (
	EmailDeliveryChannel    DeliveryChannel = "email"
	TelegramDeliveryChannel DeliveryChannel = "telegram"
)

func (DeliveryChannel) String

func (o DeliveryChannel) String() string

func (DeliveryChannel) Valid

func (o DeliveryChannel) Valid() bool

type DepositAddressDTO

type DepositAddressDTO struct {
	Address          string      `json:"address"`
	Currency         string      `json:"currency"`
	InternalCurrency string      `json:"internal_currency"`
	Chain            string      `json:"chain"`
	AddressType      AddressType `json:"address_type"`
	PaymentTag       string      `json:"payment_tag,omitempty"`
}

type Dictionary

type Dictionary struct {
	AvailableCurrencies []*CurrencyShort `json:"available_currencies"`

} //	@name	Dictionary

type Exchange

type Exchange struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	Slug      ExchangeSlug     `db:"slug" json:"slug"`
	Name      string           `db:"name" json:"name"`
	IsActive  bool             `db:"is_active" json:"is_active"`
	Url       string           `db:"url" json:"url"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type ExchangeAddress

type ExchangeAddress struct {
	ID          uuid.UUID        `db:"id" json:"id"`
	Address     string           `db:"address" json:"address"`
	Chain       string           `db:"chain" json:"chain"`
	Currency    string           `db:"currency" json:"currency"`
	AddressType string           `db:"address_type" json:"address_type"`
	UserID      uuid.UUID        `db:"user_id" json:"user_id"`
	CreateType  string           `db:"create_type" json:"create_type"`
	CreatedAt   pgtype.Timestamp `db:"created_at" json:"created_at"`
	ExchangeID  uuid.UUID        `db:"exchange_id" json:"exchange_id"`
}

type ExchangeChain

type ExchangeChain struct {
	ID         uuid.UUID    `db:"id" json:"id"`
	Slug       ExchangeSlug `db:"slug" json:"slug"`
	CurrencyID string       `db:"currency_id" json:"currency_id"`
	Ticker     string       `db:"ticker" json:"ticker"`
	Chain      string       `db:"chain" json:"chain"`
}

type ExchangeChainShort

type ExchangeChainShort struct {
	CurrencyID  string `json:"currency_id"`
	Ticker      string `json:"ticker"`
	TickerLabel string `json:"ticker_label"`
	Chain       string `json:"chain"`
	ChainLabel  string `json:"chain_label"`

} //	@name	ExchangeChain

type ExchangeGroup

type ExchangeGroup struct {
	Slug      string              `json:"slug"`
	Name      string              `json:"name"`
	Addresses []DepositAddressDTO `json:"addresses"`
}

type ExchangeKey

type ExchangeKey struct {
	ID         uuid.UUID        `db:"id" json:"id"`
	ExchangeID uuid.UUID        `db:"exchange_id" json:"exchange_id"`
	Name       ExchangeKeyName  `db:"name" json:"name"`
	Title      string           `db:"title" json:"title"`
	CreatedAt  pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type ExchangeKeyName

type ExchangeKeyName string
const (
	ExchangeKeyNameAccessKey  ExchangeKeyName = "access_key"
	ExchangeKeyNameSecretKey  ExchangeKeyName = "secret_key"
	ExchangeKeyNamePassPhrase ExchangeKeyName = "pass_phrase"
	ExchangeKeyNameAPIKey     ExchangeKeyName = "api_key"
)

func (ExchangeKeyName) String

func (ekn ExchangeKeyName) String() string

func (ExchangeKeyName) Valid

func (ekn ExchangeKeyName) Valid() bool

type ExchangeOrder

type ExchangeOrder struct {
	ID                     uuid.UUID           `db:"id" json:"id"`
	ExchangeID             uuid.UUID           `db:"exchange_id" json:"exchange_id"`
	ExchangeOrderID        pgtype.Text         `db:"exchange_order_id" json:"exchange_order_id"`
	ClientOrderID          pgtype.Text         `db:"client_order_id" json:"client_order_id"`
	Symbol                 string              `db:"symbol" json:"symbol"`
	Side                   OrderSide           `db:"side" json:"side"`
	Amount                 decimal.Decimal     `db:"amount" json:"amount"`
	OrderCreatedAt         pgtype.Timestamp    `db:"order_created_at" json:"order_created_at"`
	CreatedAt              pgtype.Timestamp    `db:"created_at" json:"created_at"`
	UpdatedAt              pgtype.Timestamp    `db:"updated_at" json:"updated_at"`
	FailReason             pgtype.Text         `db:"fail_reason" json:"fail_reason"`
	Status                 ExchangeOrderStatus `db:"status" json:"status"`
	UserID                 uuid.UUID           `db:"user_id" json:"user_id"`
	AmountUsd              decimal.NullDecimal `db:"amount_usd" json:"amount_usd"`
	ExchangeConnectionHash pgtype.Text         `db:"exchange_connection_hash" json:"exchange_connection_hash"`
}

type ExchangeOrderDTO

type ExchangeOrderDTO struct {
	ClientOrderID   string          `json:"client_order_id"`
	ExchangeOrderID string          `json:"exchange_order_id"`
	Amount          decimal.Decimal `json:"amount"`
}

type ExchangeOrderStatus

type ExchangeOrderStatus string
const (
	ExchangeOrderStatusNew        ExchangeOrderStatus = "new"
	ExchangeOrderStatusInProgress ExchangeOrderStatus = "in_progress"
	ExchangeOrderStatusCompleted  ExchangeOrderStatus = "completed"
	ExchangeOrderStatusFailed     ExchangeOrderStatus = "failed"
)

func (ExchangeOrderStatus) String

func (o ExchangeOrderStatus) String() string

type ExchangeRate

type ExchangeRate struct {
	Source string `json:"source"`
	From   string `json:"from"`
	To     string `json:"to"`
	Value  string `json:"value"`

} //	@name	ExchangeRate

type ExchangeSlug

type ExchangeSlug string //	@name	ExchangeSlug
const (
	ExchangeSlugHtx     ExchangeSlug = "htx"
	ExchangeSlugOkx     ExchangeSlug = "okx"
	ExchangeSlugBinance ExchangeSlug = "binance"
	ExchangeSlugBitget  ExchangeSlug = "bitget"
	ExchangeSlugKucoin  ExchangeSlug = "kucoin"
	ExchangeSlugBybit   ExchangeSlug = "bybit"
	ExchangeSlugGateio  ExchangeSlug = "gate"
)

func (ExchangeSlug) String

func (o ExchangeSlug) String() string

func (ExchangeSlug) Valid

func (o ExchangeSlug) Valid() bool

type ExchangeSwapState

type ExchangeSwapState string
const (
	ExchangeSwapStateDisabled ExchangeSwapState = "disabled"
	ExchangeSwapStateEnabled  ExchangeSwapState = "enabled"
)

func (ExchangeSwapState) Invert

func (ExchangeSwapState) String

func (o ExchangeSwapState) String() string

type ExchangeSymbolDTO

type ExchangeSymbolDTO struct {
	Symbol      string `json:"symbol"`
	DisplayName string `json:"display_name"`
	BaseSymbol  string `json:"base_symbol"`
	QuoteSymbol string `json:"quote_symbol"`
	Type        string `json:"type"`
}

type ExchangeUserKey

type ExchangeUserKey struct {
	ID            uuid.UUID        `db:"id" json:"id"`
	UserID        uuid.UUID        `db:"user_id" json:"user_id"`
	ExchangeKeyID uuid.UUID        `db:"exchange_key_id" json:"exchange_key_id"`
	Value         string           `db:"value" json:"value"`
	CreatedAt     pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt     pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type ExchangeWithdrawalDTO

type ExchangeWithdrawalDTO struct {
	ExternalOrderID string `json:"external_order_id"`
	InternalOrderID string `json:"internal_order_id"`
	RetryReason     string `json:"retry_reason"`
}

type ExchangeWithdrawalHistory

type ExchangeWithdrawalHistory struct {
	ID                     uuid.UUID               `db:"id" json:"id"`
	UserID                 uuid.UUID               `db:"user_id" json:"user_id"`
	ExchangeID             uuid.UUID               `db:"exchange_id" json:"exchange_id"`
	ExchangeOrderID        pgtype.Text             `db:"exchange_order_id" json:"exchange_order_id"`
	Address                string                  `db:"address" json:"address"`
	NativeAmount           decimal.NullDecimal     `db:"native_amount" json:"native_amount"`
	FiatAmount             decimal.NullDecimal     `db:"fiat_amount" json:"fiat_amount"`
	Currency               string                  `db:"currency" json:"currency"`
	Chain                  string                  `db:"chain" json:"chain"`
	Status                 WithdrawalHistoryStatus `db:"status" json:"status"`
	Txid                   pgtype.Text             `db:"txid" json:"txid"`
	CreatedAt              pgtype.Timestamp        `db:"created_at" json:"created_at"`
	UpdatedAt              pgtype.Timestamp        `db:"updated_at" json:"updated_at"`
	FailReason             pgtype.Text             `db:"fail_reason" json:"fail_reason"`
	ExchangeConnectionHash pgtype.Text             `db:"exchange_connection_hash" json:"exchange_connection_hash"`
}

type ExchangeWithdrawalHistoryDTO

type ExchangeWithdrawalHistoryDTO struct {
	ID              uuid.UUID               `db:"id" json:"id"`
	UserID          uuid.UUID               `db:"user_id" json:"user_id"`
	ExchangeID      uuid.UUID               `db:"exchange_id" json:"exchange_id"`
	ExchangeOrderID pgtype.Text             `db:"exchange_order_id" json:"exchange_order_id"`
	Address         string                  `db:"address" json:"address"`
	MinAmount       decimal.Decimal         `db:"min_amount" json:"min_amount"`
	NativeAmount    decimal.NullDecimal     `db:"native_amount" json:"native_amount"`
	FiatAmount      decimal.NullDecimal     `db:"fiat_amount" json:"fiat_amount"`
	Currency        string                  `db:"currency" json:"currency"`
	Chain           string                  `db:"chain" json:"chain"`
	Status          WithdrawalHistoryStatus `db:"status" json:"status"`
	Txid            pgtype.Text             `db:"txid" json:"txid"`
	CreatedAt       pgtype.Timestamp        `db:"created_at" json:"created_at"`
	UpdatedAt       pgtype.Timestamp        `db:"updated_at" json:"updated_at"`
	Slug            ExchangeSlug            `db:"slug" json:"slug"`
	FailReason      pgtype.Text             `db:"fail_reason" json:"fail_reason"`
}

type ExchangeWithdrawalSetting

type ExchangeWithdrawalSetting struct {
	ID         uuid.UUID        `db:"id" json:"id"`
	UserID     uuid.UUID        `db:"user_id" json:"user_id"`
	ExchangeID uuid.UUID        `db:"exchange_id" json:"exchange_id"`
	Currency   string           `db:"currency" json:"currency"`
	Chain      string           `db:"chain" json:"chain"`
	Address    string           `db:"address" json:"address"`
	MinAmount  decimal.Decimal  `db:"min_amount" json:"min_amount"`
	CreatedAt  pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	IsEnabled  bool             `db:"is_enabled" json:"is_enabled"`
}

type ExchangeWithdrawalState

type ExchangeWithdrawalState string
const (
	ExchangeWithdrawalStateDisabled ExchangeWithdrawalState = "disabled"
	ExchangeWithdrawalStateEnabled  ExchangeWithdrawalState = "enabled"
)

func (ExchangeWithdrawalState) Invert

func (ExchangeWithdrawalState) String

func (o ExchangeWithdrawalState) String() string

type GetOrderByIDParams

type GetOrderByIDParams struct {
	InstrumentID    *string
	ExternalOrderID *string
	ClientOrderID   *string
	OrderSide       string
	InternalOrder   *ExchangeOrder
}

type GetWithdrawalByIDParams

type GetWithdrawalByIDParams struct {
	ExternalOrderID *string
	ClientOrderID   *string
}

type ITransaction

type ITransaction interface {
	GetID() uuid.UUID
	GetTxHash() string
	GetBcUniqKey() *string
	GetType() TransactionsType
	GetCreatedAt() pgtype.Timestamp
	GetNetworkCreatedAt() pgtype.Timestamp
	GetAmount() decimal.Decimal
	GetAmountUsd() decimal.Decimal
	GetWalletID() uuid.NullUUID
	GetStoreID() uuid.UUID
	GetCurrencyID() string
	IsConfirmed() bool
	GetReceiptID() uuid.NullUUID
	GetFee() decimal.Decimal
}

type Log

type Log struct {
	ID          uuid.UUID        `db:"id" json:"id"`
	LogTypeSlug string           `db:"log_type_slug" json:"log_type_slug"`
	ProcessID   uuid.UUID        `db:"process_id" json:"process_id"`
	Level       string           `db:"level" json:"level"`
	Status      string           `db:"status" json:"status"`
	Message     string           `db:"message" json:"message"`
	CreatedAt   pgtype.Timestamp `db:"created_at" json:"created_at"`
}

type LogType

type LogType struct {
	ID                    int32            `db:"id" json:"id"`
	Slug                  string           `db:"slug" json:"slug"`
	Title                 string           `db:"title" json:"title"`
	ErrorCount            int32            `db:"error_count" json:"error_count"`
	ErrorCountNotifyLimit int32            `db:"error_count_notify_limit" json:"error_count_notify_limit"`
	StartParams           []byte           `db:"start_params" json:"start_params"`
	NotifyParams          []byte           `db:"notify_params" json:"notify_params"`
	CreatedAt             pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt             pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type MessageLogLevel

type MessageLogLevel string
const (
	MessageLogLevelInfo    MessageLogLevel = "info"
	MessageLogLevelError   MessageLogLevel = "error"
	MessageLogLevelNotice  MessageLogLevel = "notice"
	MessageLogLevelWarning MessageLogLevel = "warning"
	MessageLogLevelSuccess MessageLogLevel = "success"
)

type MultiWithdrawalMode

type MultiWithdrawalMode string
const (
	MultiWithdrawalModeRandom     MultiWithdrawalMode = "random"
	MultiWithdrawalModeDisabled   MultiWithdrawalMode = "disabled"
	MultiWithdrawalModeProcessing MultiWithdrawalMode = "processing"
	MultiWithdrawalModeManual     MultiWithdrawalMode = "manual"
)

func (MultiWithdrawalMode) IsValidByCurrency

func (w MultiWithdrawalMode) IsValidByCurrency(curr Currency) bool

func (MultiWithdrawalMode) String

func (w MultiWithdrawalMode) String() string

type MultiWithdrawalRule

type MultiWithdrawalRule struct {
	ID                 uuid.UUID           `db:"id" json:"id"`
	WithdrawalWalletID uuid.UUID           `db:"withdrawal_wallet_id" json:"withdrawal_wallet_id"`
	Mode               MultiWithdrawalMode `db:"mode" json:"mode"`
	ManualAddress      pgtype.Text         `db:"manual_address" json:"manual_address"`
	CreatedAt          pgtype.Timestamp    `db:"created_at" json:"created_at"`
	UpdatedAt          pgtype.Timestamp    `db:"updated_at" json:"updated_at"`
}

type Notification

type Notification struct {
	ID       uuid.UUID             `db:"id" json:"id"`
	Category *NotificationCategory `db:"category" json:"category"`
	Type     NotificationType      `db:"type" json:"type"`
}

type NotificationArgs

type NotificationArgs struct {
	UserID  *uuid.UUID `json:"user_id,omitempty"`
	StoreID *uuid.UUID `json:"store_id,omitempty"`
}

type NotificationCategory

type NotificationCategory string
const (
	NotificationCategorySystem NotificationCategory = "system"
	NotificationCategoryEvent  NotificationCategory = "event"
	NotificationCategoryReport NotificationCategory = "report"
)

func (*NotificationCategory) IsFullDisableAllowed

func (nc *NotificationCategory) IsFullDisableAllowed() bool

func (*NotificationCategory) String

func (nc *NotificationCategory) String() string

type NotificationSendHistory

type NotificationSendHistory struct {
	ID                      uuid.UUID        `db:"id" json:"id"`
	Destination             string           `db:"destination" json:"destination"`
	MessageText             pgtype.Text      `db:"message_text" json:"message_text"`
	Sender                  string           `db:"sender" json:"sender"`
	CreatedAt               pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt               pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	SentAt                  pgtype.Timestamp `db:"sent_at" json:"sent_at"`
	Type                    NotificationType `db:"type" json:"type"`
	Channel                 DeliveryChannel  `db:"channel" json:"channel"`
	NotificationSendQueueID uuid.UUID        `db:"notification_send_queue_id" json:"notification_send_queue_id"`
	StoreID                 uuid.NullUUID    `db:"store_id" json:"store_id"`
	UserID                  uuid.NullUUID    `db:"user_id" json:"user_id"`
}

type NotificationSendQueue

type NotificationSendQueue struct {
	ID          uuid.UUID         `db:"id" json:"id"`
	Destination string            `db:"destination" json:"destination"`
	Type        NotificationType  `db:"type" json:"type"`
	Parameters  []byte            `db:"parameters" json:"parameters"`
	Channel     DeliveryChannel   `db:"channel" json:"channel"`
	Attempts    int32             `db:"attempts" json:"attempts"`
	CreatedAt   pgtype.Timestamp  `db:"created_at" json:"created_at"`
	UpdatedAt   pgtype.Timestamp  `db:"updated_at" json:"updated_at"`
	Args        *NotificationArgs `db:"args" json:"args"`
}

type NotificationType

type NotificationType string //	@name	NotificationType
const (
	NotificationTypeUserVerification               NotificationType = "user_verification"
	NotificationTypeUserRegistration               NotificationType = "user_registration"
	NotificationTypeUserPasswordChanged            NotificationType = "user_password_reset"
	NotificationTypeUserForgotPassword             NotificationType = "user_forgot_password"
	NotificationTypeTwoFactorAuthentication        NotificationType = "two_factor_authentication"
	NotificationTypeExternalWalletRequested        NotificationType = "external_wallet_requested"
	NotificationTypeUserInvite                     NotificationType = "user_invite"
	NotificationTypeUserEmailReset                 NotificationType = "user_email_reset"
	NotificationTypeUserEmailChange                NotificationType = "user_change_email"
	NotificationTypeUserAccessKeyChanged           NotificationType = "user_access_key_changed"
	NotificationTypeUserAuthorizationFromNewDevice NotificationType = "user_authorization_from_new_device"
	NotificationTypeUserRemindVerification         NotificationType = "user_remind_verification"
	NotificationTypeUserUpdateSetting              NotificationType = "user_update_setting_verification"
	NotificationTypeUserTestEmail                  NotificationType = "user_test_email"
	NotificationTypeUserCryptoReceipt              NotificationType = "user_crypto_receipt"
)

func (NotificationType) Label

func (o NotificationType) Label() string

func (NotificationType) String

func (o NotificationType) String() string

func (NotificationType) Valid

func (o NotificationType) Valid() bool

type OrderDetailsDTO

type OrderDetailsDTO struct {
	State      ExchangeOrderStatus `json:"state,omitempty"`
	Amount     decimal.Decimal     `json:"amount"`
	AmountUSD  decimal.Decimal     `json:"amount_usd"`
	FailReason string              `json:"fail_reason,omitempty"`
}

type OrderRulesDTO

type OrderRulesDTO struct {
	Symbol                   string `json:"symbol,omitempty"`
	State                    string `json:"state,omitempty"`
	BaseCurrency             string `json:"base_currency,omitempty"`
	QuoteCurrency            string `json:"quote_currency,omitempty"`
	PricePrecision           int    `json:"price_precision,omitempty"`
	AmountPrecision          int    `json:"amount_precision,omitempty"`
	ValuePrecision           int    `json:"value_precision,omitempty"`
	MinOrderAmount           string `json:"min_order_amount,omitempty"`
	MaxOrderAmount           string `json:"max_order_amount,omitempty"`
	MinOrderValue            string `json:"min_order_value,omitempty"`
	SellMarketMinOrderAmount string `json:"sell_market_min_order_amount,omitempty"`
	SellMarketMaxOrderAmount string `json:"sell_market_max_order_amount,omitempty"`
	BuyMarketMaxOrderValue   string `json:"buy_market_max_order_value,omitempty"`
}

type OrderSide

type OrderSide string
const (
	OrderSideBuy  OrderSide = "buy"
	OrderSideSell OrderSide = "sell"
)

func (OrderSide) String

func (o OrderSide) String() string

type OrderType

type OrderType string
const (
	OrderTypeMarket OrderType = ""
	OrderTypeLimit  OrderType = ""
)

func (OrderType) String

func (o OrderType) String() string

type PersonalAccessToken

type PersonalAccessToken struct {
	ID            uuid.UUID        `db:"id" json:"id"`
	TokenableType string           `db:"tokenable_type" json:"tokenable_type"`
	TokenableID   uuid.UUID        `db:"tokenable_id" json:"tokenable_id"`
	Name          string           `db:"name" json:"name"`
	Token         string           `db:"token" json:"token"`
	LastUsedAt    pgtype.Timestamp `db:"last_used_at" json:"last_used_at"`
	ExpiresAt     *time.Time       `db:"expires_at" json:"expires_at"`
	CreatedAt     pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt     pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type PrefetchWithdrawAddressInfo

type PrefetchWithdrawAddressInfo struct {
	Currency    CurrencyShort   `json:"currency"`
	Amount      decimal.Decimal `json:"amount"`
	AmountUsd   decimal.Decimal `json:"amount_usd"`
	Type        TransferKind    `json:"type"`
	AddressFrom []string        `json:"address_from"`
	AddressTo   []string        `json:"address_to"`

} //	@name	PrefetchWithdrawAddressInfo

type RateSource

type RateSource string
const (
	RateSourceOKX     RateSource = "okx"
	RateSourceHTX     RateSource = "htx"
	RateSourceBinance RateSource = "binance"
	RateSourceBitGet  RateSource = "bitget"
	RateSourceKucoin  RateSource = "kucoin"
	RateSourceBybit   RateSource = "bybit"
	RateSourceGateio  RateSource = "gate"
)

func (RateSource) String

func (rs RateSource) String() string

func (RateSource) Valid

func (rs RateSource) Valid() bool

type Receipt

type Receipt struct {
	ID         uuid.UUID        `db:"id" json:"id"`
	Status     ReceiptStatus    `db:"status" json:"status"`
	StoreID    uuid.UUID        `db:"store_id" json:"store_id"`
	CurrencyID string           `db:"currency_id" json:"currency_id"`
	Amount     decimal.Decimal  `db:"amount" json:"amount"`
	WalletID   uuid.NullUUID    `db:"wallet_id" json:"wallet_id"`
	CreatedAt  pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type ReceiptStatus

type ReceiptStatus string //	@name	ReceiptStatus
const (
	ReceiptStatusPaid     ReceiptStatus = "paid"
	ReceiptStatusCanceled ReceiptStatus = "canceled"
)

type Setting

type Setting struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	ModelID   uuid.NullUUID    `db:"model_id" json:"model_id"`
	ModelType *string          `db:"model_type" json:"model_type"`
	Name      string           `db:"name" json:"name"`
	Value     string           `db:"value" json:"value"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	IsMutable bool             `db:"is_mutable" json:"is_mutable"`
}

type SettingModelName

type SettingModelName string
const (
	SettingModelNameUser  SettingModelName = "User"
	SettingModelNameStore SettingModelName = "Store"
)

type Store

type Store struct {
	ID                       uuid.UUID        `db:"id" json:"id"`
	UserID                   uuid.UUID        `db:"user_id" json:"user_id"`
	Name                     string           `db:"name" json:"name"`
	Site                     *string          `db:"site" json:"site"`
	CurrencyID               string           `db:"currency_id" json:"currency_id"`
	RateSource               RateSource       `db:"rate_source" json:"rate_source"`
	ReturnUrl                *string          `db:"return_url" json:"return_url"`
	SuccessUrl               *string          `db:"success_url" json:"success_url"`
	RateScale                decimal.Decimal  `db:"rate_scale" json:"rate_scale"`
	Status                   bool             `db:"status" json:"status"`
	MinimalPayment           decimal.Decimal  `db:"minimal_payment" json:"minimal_payment"`
	CreatedAt                pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt                pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt                pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
	PublicPaymentFormEnabled bool             `db:"public_payment_form_enabled" json:"public_payment_form_enabled"`
}

func (*Store) ModelID added in v0.9.6

func (s *Store) ModelID() uuid.NullUUID

func (*Store) ModelName added in v0.9.6

func (s *Store) ModelName() *string

type StoreApiKey

type StoreApiKey struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	StoreID   uuid.UUID        `db:"store_id" json:"store_id"`
	Key       string           `db:"key" json:"key"`
	Enabled   bool             `db:"enabled" json:"enabled"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type StoreCurrency

type StoreCurrency struct {
	CurrencyID string    `db:"currency_id" json:"currency_id"`
	StoreID    uuid.UUID `db:"store_id" json:"store_id"`
}

type StoreSecret

type StoreSecret struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	StoreID   uuid.UUID        `db:"store_id" json:"store_id"`
	Secret    string           `db:"secret" json:"secret"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type StoreWebhook

type StoreWebhook struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	StoreID   uuid.UUID        `db:"store_id" json:"store_id"`
	Url       string           `db:"url" json:"url"`
	Enabled   bool             `db:"enabled" json:"enabled"`
	Events    []*WebhookEvent  `db:"events" json:"events"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type StoreWhitelist

type StoreWhitelist struct {
	Ip      string    `db:"ip" json:"ip"`
	StoreID uuid.UUID `db:"store_id" json:"store_id"`
}

type SystemInfo

type SystemInfo struct {
	AppProfile         AppProfile `json:"app_profile"`
	Initialized        bool       `json:"initialized"`
	RootUserExists     bool       `json:"root_user_exists"`
	RegistrationState  string     `json:"registration_state"`
	IsTurnstileEnabled bool       `json:"is_turnstile_enabled"`
	TurnstileSiteKey   string     `json:"turnstile_site_key"`

} //	@name	SystemInfo

type Transaction

type Transaction struct {
	ID                 uuid.UUID           `db:"id" json:"id"`
	UserID             uuid.UUID           `db:"user_id" json:"user_id"`
	StoreID            uuid.NullUUID       `db:"store_id" json:"store_id"`
	ReceiptID          uuid.NullUUID       `db:"receipt_id" json:"receipt_id"`
	WalletID           uuid.NullUUID       `db:"wallet_id" json:"wallet_id"`
	CurrencyID         string              `db:"currency_id" json:"currency_id"`
	Blockchain         Blockchain          `db:"blockchain" json:"blockchain"`
	TxHash             string              `db:"tx_hash" json:"tx_hash"`
	BcUniqKey          *string             `db:"bc_uniq_key" json:"bc_uniq_key"`
	Type               TransactionsType    `db:"type" json:"type"`
	FromAddress        string              `db:"from_address" json:"from_address"`
	ToAddress          string              `db:"to_address" json:"to_address"`
	Amount             decimal.Decimal     `db:"amount" json:"amount"`
	AmountUsd          decimal.NullDecimal `db:"amount_usd" json:"amount_usd"`
	Fee                decimal.Decimal     `db:"fee" json:"fee"`
	WithdrawalIsManual bool                `db:"withdrawal_is_manual" json:"withdrawal_is_manual"`
	NetworkCreatedAt   pgtype.Timestamp    `db:"network_created_at" json:"network_created_at"`
	CreatedAt          pgtype.Timestamp    `db:"created_at" json:"created_at"`
	UpdatedAt          pgtype.Timestamp    `db:"updated_at" json:"updated_at"`
	CreatedAtIndex     pgtype.Int8         `db:"created_at_index" json:"created_at_index"`
	IsSystem           bool                `db:"is_system" json:"is_system"`
}

func (Transaction) GetAmount

func (tx Transaction) GetAmount() decimal.Decimal

func (Transaction) GetAmountUsd

func (tx Transaction) GetAmountUsd() decimal.Decimal

func (Transaction) GetBcUniqKey

func (tx Transaction) GetBcUniqKey() *string

func (Transaction) GetCreatedAt

func (tx Transaction) GetCreatedAt() pgtype.Timestamp

func (Transaction) GetCurrencyID

func (tx Transaction) GetCurrencyID() string

func (Transaction) GetFee

func (tx Transaction) GetFee() decimal.Decimal

func (Transaction) GetID

func (tx Transaction) GetID() uuid.UUID

func (Transaction) GetNetworkCreatedAt

func (tx Transaction) GetNetworkCreatedAt() pgtype.Timestamp

func (Transaction) GetReceiptID

func (tx Transaction) GetReceiptID() uuid.NullUUID

func (Transaction) GetStoreID

func (tx Transaction) GetStoreID() uuid.UUID

func (Transaction) GetTxHash

func (tx Transaction) GetTxHash() string

func (Transaction) GetType

func (tx Transaction) GetType() TransactionsType

func (Transaction) GetWalletID

func (tx Transaction) GetWalletID() uuid.NullUUID

func (Transaction) IsConfirmed

func (tx Transaction) IsConfirmed() bool

type TransactionStatus

type TransactionStatus string //	@name	TransactionStatus
const (
	TransactionStatusWaitingConfirmations TransactionStatus = "waiting_confirmations"
	TransactionStatusInMempool            TransactionStatus = "in_mempool"
	TransactionStatusCompleted            TransactionStatus = "completed"
	TransactionStatusFailed               TransactionStatus = "failed"
)

func (TransactionStatus) String

func (o TransactionStatus) String() string

type TransactionsType

type TransactionsType string //	@name	TransactionsType
const (
	TransactionsTypeTransfer                 TransactionsType = "transfer"
	TransactionsTypeDeposit                  TransactionsType = "deposit"
	TransactionsTypeWithdrawalFromProcessing TransactionsType = "withdrawal_from_processing"
)

func (TransactionsType) RequiresWebhookToStore

func (t TransactionsType) RequiresWebhookToStore() bool

func (TransactionsType) String

func (t TransactionsType) String() string

type Transfer

type Transfer struct {
	ID            uuid.UUID        `db:"id" json:"id"`
	Number        int64            `db:"number" json:"number"`
	UserID        uuid.UUID        `db:"user_id" json:"user_id"`
	Kind          TransferKind     `db:"kind" json:"kind"`
	CurrencyID    string           `db:"currency_id" json:"currency_id"`
	Status        TransferStatus   `db:"status" json:"status"`
	Stage         TransferStage    `db:"stage" json:"stage"`
	Amount        decimal.Decimal  `db:"amount" json:"amount"`
	AmountUsd     decimal.Decimal  `db:"amount_usd" json:"amount_usd"`
	Message       *string          `db:"message" json:"message"`
	CreatedAt     pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt     pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	Blockchain    Blockchain       `db:"blockchain" json:"blockchain"`
	FromAddresses []string         `db:"from_addresses" json:"from_addresses"`
	ToAddresses   []string         `db:"to_addresses" json:"to_addresses"`
	Step          *string          `db:"step" json:"step"`
	TxHash        *string          `db:"tx_hash" json:"tx_hash"`
}

type TransferKind

type TransferKind string //	@name	TransferKind
const (
	TransferKindFromAddress    TransferKind = "from_address"
	TransferKindFromProcessing TransferKind = "from_processing"
)

func (TransferKind) String

func (o TransferKind) String() string

type TransferStage

type TransferStage string //	@name	TransferStage
const (
	TransferStageInProgress TransferStage = "in_progress"
	TransferStageFailed     TransferStage = "failed"
	TransferStageCompleted  TransferStage = "completed"
)

func ResolveTransferStageByStatus

func ResolveTransferStageByStatus(status TransferStatus) TransferStage

func (TransferStage) String

func (t TransferStage) String() string

type TransferStatus

type TransferStatus string //	@name	TransferStatus
const (
	TransferStatusNew         TransferStatus = "new"
	TransferStatusPending     TransferStatus = "pending"
	TransferStatusProcessing  TransferStatus = "processing"
	TransferStatusInMempool   TransferStatus = "in_mempool"
	TransferStatusUnconfirmed TransferStatus = "unconfirmed"
	TransferStatusCompleted   TransferStatus = "completed"
	TransferStatusFailed      TransferStatus = "failed"
	TransferStatusFrozen      TransferStatus = "frozen"
)

func (TransferStatus) String

func (t TransferStatus) String() string

type TransferTransaction

type TransferTransaction struct {
	ID                uuid.UUID                  `db:"id" json:"id"`
	TransferID        uuid.UUID                  `db:"transfer_id" json:"transfer_id"`
	TxHash            string                     `db:"tx_hash" json:"tx_hash"`
	BandwidthAmount   decimal.Decimal            `db:"bandwidth_amount" json:"bandwidth_amount"`
	EnergyAmount      decimal.Decimal            `db:"energy_amount" json:"energy_amount"`
	NativeTokenAmount decimal.Decimal            `db:"native_token_amount" json:"native_token_amount"`
	NativeTokenFee    decimal.Decimal            `db:"native_token_fee" json:"native_token_fee"`
	TxType            TransferTransactionType    `db:"tx_type" json:"tx_type"`
	Status            TransferTransactionsStatus `db:"status" json:"status"`
	Step              string                     `db:"step" json:"step"`
	CreatedAt         pgtype.Timestamptz         `db:"created_at" json:"created_at"`
	UpdatedAt         pgtype.Timestamptz         `db:"updated_at" json:"updated_at"`
}

type TransferTransactionType

type TransferTransactionType string
const (
	TransferTransactionTypeDelegateResources TransferTransactionType = "resource_delegation"
	TransferTransactionTypeReclaimResources  TransferTransactionType = "resource_reclaim"
	TransferTransactionTypeSendBurnBaseAsset TransferTransactionType = "send_burn_base_asset"
	TransferTransactionTypeAccountActivation TransferTransactionType = "account_activation"
	TransferTransactionTypeTransfer          TransferTransactionType = "transfer"
)

func (TransferTransactionType) String

func (t TransferTransactionType) String() string

type TransferTransactionsStatus

type TransferTransactionsStatus string
const (
	TransferTransactionsStatusPending     TransferTransactionsStatus = "pending"
	TransferTransactionsStatusUnconfirmed TransferTransactionsStatus = "unconfirmed"
	TransferTransactionsStatusConfirmed   TransferTransactionsStatus = "confirmed"
	TransferTransactionsStatusFailed      TransferTransactionsStatus = "failed"
)

func (TransferTransactionsStatus) String

func (tts TransferTransactionsStatus) String() string

type TronWalletBalanceStatistic

type TronWalletBalanceStatistic struct {
	ID                 uuid.UUID          `db:"id" json:"id"`
	ProcessingOwnerID  uuid.UUID          `db:"processing_owner_id" json:"processing_owner_id"`
	Address            string             `db:"address" json:"address"`
	StakedBandwidth    decimal.Decimal    `db:"staked_bandwidth" json:"staked_bandwidth"`
	StakedEnergy       decimal.Decimal    `db:"staked_energy" json:"staked_energy"`
	DelegatedEnergy    decimal.Decimal    `db:"delegated_energy" json:"delegated_energy"`
	DelegatedBandwidth decimal.Decimal    `db:"delegated_bandwidth" json:"delegated_bandwidth"`
	AvailableBandwidth decimal.Decimal    `db:"available_bandwidth" json:"available_bandwidth"`
	AvailableEnergy    decimal.Decimal    `db:"available_energy" json:"available_energy"`
	CreatedAt          pgtype.Timestamptz `db:"created_at" json:"created_at"`
}

type UnconfirmedTransaction

type UnconfirmedTransaction struct {
	ID               uuid.UUID           `db:"id" json:"id"`
	UserID           uuid.UUID           `db:"user_id" json:"user_id"`
	StoreID          uuid.NullUUID       `db:"store_id" json:"store_id"`
	WalletID         uuid.NullUUID       `db:"wallet_id" json:"wallet_id"`
	CurrencyID       string              `db:"currency_id" json:"currency_id"`
	TxHash           string              `db:"tx_hash" json:"tx_hash"`
	BcUniqKey        *string             `db:"bc_uniq_key" json:"bc_uniq_key"`
	Type             TransactionsType    `db:"type" json:"type"`
	FromAddress      string              `db:"from_address" json:"from_address"`
	ToAddress        string              `db:"to_address" json:"to_address"`
	Amount           decimal.Decimal     `db:"amount" json:"amount"`
	AmountUsd        decimal.NullDecimal `db:"amount_usd" json:"amount_usd"`
	NetworkCreatedAt pgtype.Timestamp    `db:"network_created_at" json:"network_created_at"`
	CreatedAt        pgtype.Timestamp    `db:"created_at" json:"created_at"`
	UpdatedAt        pgtype.Timestamp    `db:"updated_at" json:"updated_at"`
	Blockchain       Blockchain          `db:"blockchain" json:"blockchain"`
}

func (UnconfirmedTransaction) GetAmount

func (utx UnconfirmedTransaction) GetAmount() decimal.Decimal

func (UnconfirmedTransaction) GetAmountUsd

func (utx UnconfirmedTransaction) GetAmountUsd() decimal.Decimal

func (UnconfirmedTransaction) GetBcUniqKey

func (utx UnconfirmedTransaction) GetBcUniqKey() *string

func (UnconfirmedTransaction) GetCreatedAt

func (utx UnconfirmedTransaction) GetCreatedAt() pgtype.Timestamp

func (UnconfirmedTransaction) GetCurrencyID

func (utx UnconfirmedTransaction) GetCurrencyID() string

func (UnconfirmedTransaction) GetFee

func (utx UnconfirmedTransaction) GetFee() decimal.Decimal

func (UnconfirmedTransaction) GetID

func (utx UnconfirmedTransaction) GetID() uuid.UUID

func (UnconfirmedTransaction) GetNetworkCreatedAt

func (utx UnconfirmedTransaction) GetNetworkCreatedAt() pgtype.Timestamp

func (UnconfirmedTransaction) GetReceiptID

func (utx UnconfirmedTransaction) GetReceiptID() uuid.NullUUID

func (UnconfirmedTransaction) GetStoreID

func (utx UnconfirmedTransaction) GetStoreID() uuid.UUID

func (UnconfirmedTransaction) GetTxHash

func (utx UnconfirmedTransaction) GetTxHash() string

func (UnconfirmedTransaction) GetType

func (UnconfirmedTransaction) GetWalletID

func (utx UnconfirmedTransaction) GetWalletID() uuid.NullUUID

func (UnconfirmedTransaction) IsConfirmed

func (utx UnconfirmedTransaction) IsConfirmed() bool

type UpdateBalanceQueue

type UpdateBalanceQueue struct {
	ID                       uuid.UUID        `db:"id" json:"id"`
	CurrencyID               string           `db:"currency_id" json:"currency_id"`
	Address                  string           `db:"address" json:"address"`
	NativeTokenBalanceUpdate bool             `db:"native_token_balance_update" json:"native_token_balance_update"`
	CreatedAt                pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt                pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type User

type User struct {
	ID                uuid.UUID        `db:"id" json:"id"`
	Email             string           `db:"email" json:"email" validate:"required,email"`
	EmailVerifiedAt   pgtype.Timestamp `db:"email_verified_at" json:"email_verified_at"`
	Password          string           `db:"password" json:"password" validate:"required,min=8,max=32"`
	RememberToken     pgtype.Text      `db:"remember_token" json:"remember_token"`
	ProcessingOwnerID uuid.NullUUID    `db:"processing_owner_id" json:"processing_owner_id"`
	Location          string           `db:"location" json:"location" validate:"required,timezone"`
	Language          string           `db:"language" json:"language"`
	RateSource        RateSource       `db:"rate_source" json:"rate_source"`
	CreatedAt         pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt         pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt         pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
	Banned            pgtype.Bool      `db:"banned" json:"banned"`
	ExchangeSlug      *ExchangeSlug    `db:"exchange_slug" json:"exchange_slug"`
	RateScale         decimal.Decimal  `db:"rate_scale" json:"rate_scale"`
	DvnetToken        pgtype.Text      `db:"dvnet_token" json:"dvnet_token"`
}

func (*User) ModelID

func (u *User) ModelID() uuid.NullUUID

func (*User) ModelName

func (u *User) ModelName() *string

type UserAddressBook

type UserAddressBook struct {
	ID          uuid.UUID        `db:"id" json:"id"`
	UserID      uuid.UUID        `db:"user_id" json:"user_id"`
	Address     string           `db:"address" json:"address"`
	CurrencyID  string           `db:"currency_id" json:"currency_id"`
	Name        pgtype.Text      `db:"name" json:"name"`
	Tag         pgtype.Text      `db:"tag" json:"tag"`
	Blockchain  *Blockchain      `db:"blockchain" json:"blockchain"`
	Type        AddressBookType  `db:"type" json:"type"`
	SubmittedAt pgtype.Timestamp `db:"submitted_at" json:"submitted_at"`
	CreatedAt   pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt   pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt   pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
}

type UserExchange

type UserExchange struct {
	ID              uuid.UUID               `db:"id" json:"id"`
	ExchangeID      uuid.UUID               `db:"exchange_id" json:"exchange_id"`
	UserID          uuid.UUID               `db:"user_id" json:"user_id"`
	WithdrawalState ExchangeWithdrawalState `db:"withdrawal_state" json:"withdrawal_state"`
	SwapState       ExchangeSwapState       `db:"swap_state" json:"swap_state"`
}

type UserExchangePair

type UserExchangePair struct {
	ID           uuid.UUID `db:"id" json:"id"`
	ExchangeID   uuid.UUID `db:"exchange_id" json:"exchange_id"`
	UserID       uuid.UUID `db:"user_id" json:"user_id"`
	CurrencyFrom string    `db:"currency_from" json:"currency_from"`
	CurrencyTo   string    `db:"currency_to" json:"currency_to"`
	Symbol       string    `db:"symbol" json:"symbol"`
	Type         OrderSide `db:"type" json:"type"`
}

type UserInfo

type UserInfo struct {
	ID                uuid.UUID        `db:"id" json:"id"`
	Email             string           `db:"email" json:"email" validate:"required,email"`
	EmailVerifiedAt   pgtype.Timestamp `db:"email_verified_at" json:"email_verified_at"`
	Location          string           `db:"location" json:"location" validate:"required,timezone"`
	Language          string           `db:"language" json:"language"`
	RateSource        string           `db:"rate_source" json:"rate_source"`
	ProcessingOwnerID uuid.NullUUID    `db:"processing_owner_id" json:"processing_owner_id"`
	CreatedAt         pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt         pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type UserNotification

type UserNotification struct {
	ID             uuid.UUID        `db:"id" json:"id"`
	UserID         uuid.UUID        `db:"user_id" json:"user_id"`
	NotificationID uuid.UUID        `db:"notification_id" json:"notification_id"`
	EmailEnabled   bool             `db:"email_enabled" json:"email_enabled"`
	TgEnabled      bool             `db:"tg_enabled" json:"tg_enabled"`
	CreatedAt      pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt      pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type UserRole

type UserRole string //	@name	UserRole
const (
	UserRoleDefault        UserRole = "user"
	UserRoleRoot           UserRole = "root"
	UserRoleSupport        UserRole = "support"
	UserRoleFinanceManager UserRole = "finance_manager"
)

func (UserRole) String

func (o UserRole) String() string

func (UserRole) Valid

func (o UserRole) Valid() bool

type UserStore

type UserStore struct {
	ID        uuid.UUID        `db:"id" json:"id"`
	UserID    uuid.UUID        `db:"user_id" json:"user_id"`
	StoreID   uuid.UUID        `db:"store_id" json:"store_id"`
	CreatedAt pgtype.Timestamp `db:"created_at" json:"created_at"`
}

type Wallet

type Wallet struct {
	ID              uuid.UUID        `db:"id" json:"id"`
	StoreID         uuid.UUID        `db:"store_id" json:"store_id"`
	StoreExternalID string           `db:"store_external_id" json:"store_external_id"`
	CreatedAt       pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt       pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt       pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
	Email           pgtype.Text      `db:"email" json:"email"`
	IpAddress       pgtype.Text      `db:"ip_address" json:"ip_address"`
	UntrustedEmail  pgtype.Text      `db:"untrusted_email" json:"untrusted_email"`
	Locale          string           `db:"locale" json:"locale"`
}

type WalletAddress

type WalletAddress struct {
	ID         uuid.UUID        `db:"id" json:"id"`
	WalletID   uuid.UUID        `db:"wallet_id" json:"wallet_id"`
	UserID     uuid.UUID        `db:"user_id" json:"user_id"`
	CurrencyID string           `db:"currency_id" json:"currency_id"`
	Blockchain Blockchain       `db:"blockchain" json:"blockchain"`
	Address    string           `db:"address" json:"address"`
	Amount     decimal.Decimal  `db:"amount" json:"amount"`
	CreatedAt  pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt  pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt  pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
	Dirty      bool             `db:"dirty" json:"dirty"`
}

type WalletAddressesActivityLog

type WalletAddressesActivityLog struct {
	ID                uuid.UUID        `db:"id" json:"id"`
	WalletAddressesID uuid.UUID        `db:"wallet_addresses_id" json:"wallet_addresses_id"`
	Text              string           `db:"text" json:"text"`
	TextVariables     []byte           `db:"text_variables" json:"text_variables"`
	CreatedAt         pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt         pgtype.Timestamp `db:"updated_at" json:"updated_at"`
}

type WalletType

type WalletType string
const (
	WalletTypeCold       WalletType = "cold"
	WalletTypeHot        WalletType = "hot"
	WalletTypeProcessing WalletType = "processing"
)

func (*WalletType) String

func (t *WalletType) String() string

type WalletWithUSDBalance

type WalletWithUSDBalance struct {
	WalletAddressID uuid.UUID       `json:"wallet_address_id"`
	CurrencyID      string          `json:"currency_id"`
	Address         string          `json:"address"`
	Blockchain      Blockchain      `json:"blockchain"`
	Amount          decimal.Decimal `json:"amount"`
	AmountUSD       decimal.Decimal `json:"amount_usd"`
	Dirty           bool            `json:"dirty"`

} //	@name	WalletWithUSDBalance

type WebhookEvent

type WebhookEvent string //	@name	WebhookEvent
const (
	WebhookEventPaymentReceived                  WebhookEvent = "PaymentReceived"
	WebhookEventPaymentNotConfirmed              WebhookEvent = "PaymentNotConfirmed"
	WebhookEventWithdrawalFromProcessingReceived WebhookEvent = "WithdrawalFromProcessingReceived"
)

func (WebhookEvent) String

func (s WebhookEvent) String() string

type WebhookKind

type WebhookKind string //	@name	WebhookKind
const (
	WebhookKindTransfer       WebhookKind = "transfer"
	WebhookKindDeposit        WebhookKind = "deposit"
	WebhookKindTransferStatus WebhookKind = "transfer_status"
)

type WebhookSendHistory

type WebhookSendHistory struct {
	ID                 uuid.UUID        `db:"id" json:"id"`
	TxID               uuid.UUID        `db:"tx_id" json:"tx_id"`
	SendQueueJobID     uuid.NullUUID    `db:"send_queue_job_id" json:"send_queue_job_id"`
	Type               string           `db:"type" json:"type"`
	Url                string           `db:"url" json:"url"`
	Status             string           `db:"status" json:"status"`
	Request            []byte           `db:"request" json:"request"`
	Response           *string          `db:"response" json:"response"`
	ResponseStatusCode int              `db:"response_status_code" json:"response_status_code"`
	CreatedAt          pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt          pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	IsManual           pgtype.Bool      `db:"is_manual" json:"is_manual"`
	StoreID            uuid.NullUUID    `db:"store_id" json:"store_id"`
}

type WebhookSendQueue

type WebhookSendQueue struct {
	ID            uuid.UUID        `db:"id" json:"id"`
	WebhookID     uuid.UUID        `db:"webhook_id" json:"webhook_id"`
	SecondsDelay  int16            `db:"seconds_delay" json:"seconds_delay"`
	TransactionID uuid.UUID        `db:"transaction_id" json:"transaction_id"`
	Payload       []byte           `db:"payload" json:"payload"`
	Signature     string           `db:"signature" json:"signature"`
	Event         string           `db:"event" json:"event"`
	LastSentAt    pgtype.Timestamp `db:"last_sent_at" json:"last_sent_at"`
	CreatedAt     pgtype.Timestamp `db:"created_at" json:"created_at"`
}

type WithdrawalAddressDTO

type WithdrawalAddressDTO struct {
	Address  string `json:"address"`
	Currency string `json:"currency"`
}

type WithdrawalFeeType

type WithdrawalFeeType string
const (
	WithdrawalFeeTypeFixed WithdrawalFeeType = "fixed"
)

func (WithdrawalFeeType) MarshalBinary

func (o WithdrawalFeeType) MarshalBinary() (data []byte, err error)

func (WithdrawalFeeType) String

func (o WithdrawalFeeType) String() string

type WithdrawalFromProcessingWallet

type WithdrawalFromProcessingWallet struct {
	ID          uuid.UUID        `db:"id" json:"id"`
	CurrencyID  string           `db:"currency_id" json:"currency_id"`
	StoreID     uuid.UUID        `db:"store_id" json:"store_id"`
	TransferID  uuid.NullUUID    `db:"transfer_id" json:"transfer_id"`
	AddressFrom string           `db:"address_from" json:"address_from"`
	AddressTo   string           `db:"address_to" json:"address_to"`
	Amount      decimal.Decimal  `db:"amount" json:"amount"`
	AmountUsd   decimal.Decimal  `db:"amount_usd" json:"amount_usd"`
	CreatedAt   pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt   pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	RequestID   *string          `db:"request_id" json:"request_id"`
}

type WithdrawalHistoryStatus

type WithdrawalHistoryStatus string
const (
	WithdrawalHistoryStatusNew        WithdrawalHistoryStatus = "new"
	WithdrawalHistoryStatusFailed     WithdrawalHistoryStatus = "failed"
	WithdrawalHistoryStatusInProgress WithdrawalHistoryStatus = "in_progress"
	WithdrawalHistoryStatusCompleted  WithdrawalHistoryStatus = "completed"
	WithdrawalHistoryStatusCanceled   WithdrawalHistoryStatus = "canceled"
	WithdrawalHistoryStatusRecovery   WithdrawalHistoryStatus = "recovery"
)

func (WithdrawalHistoryStatus) String

func (o WithdrawalHistoryStatus) String() string

type WithdrawalInterval

type WithdrawalInterval string //	@name	WithdrawalInterval
const (
	WithdrawalIntervalNever        WithdrawalInterval = "never"
	WithdrawalIntervalEveryOneMin  WithdrawalInterval = "every-one-min"
	WithdrawalIntervalEvery12hours WithdrawalInterval = "every-12hours"
	WithdrawalIntervalEveryDay     WithdrawalInterval = "every-day"
	WithdrawalIntervalEvery3Days   WithdrawalInterval = "every-3days"
	WithdrawalIntervalEveryWeek    WithdrawalInterval = "every-week"
)

func (WithdrawalInterval) IsValid

func (wi WithdrawalInterval) IsValid() bool

IsValid checks if the WithdrawalInterval is valid.

func (WithdrawalInterval) String

func (wi WithdrawalInterval) String() string

type WithdrawalRulesDTO

type WithdrawalRulesDTO struct {
	Currency            string            `json:"currency" structs:"currency"`
	Chain               string            `json:"chain" structs:"chain"`
	MinDepositAmount    string            `json:"min_deposit_amount" structs:"min_deposit_amount"`
	MinWithdrawAmount   string            `json:"min_withdraw_amount" structs:"min_withdraw_amount"`
	MaxWithdrawAmount   string            `json:"max_withdraw_amount" structs:"max_withdraw_amount"`
	NumOfConfirmations  string            `json:"num_of_confirmations" structs:"num_of_confirmations"`
	WithdrawFeeType     WithdrawalFeeType `json:"withdraw_fee_type" structs:"withdraw_fee_type"`
	WithdrawPrecision   string            `json:"withdraw_precision" structs:"withdraw_precision"`
	WithdrawQuotaPerDay string            `json:"withdraw_quota_per_day" structs:"withdraw_quota_per_day"`
	Fee                 string            `json:"fee" structs:"fee"`
}

type WithdrawalStatus

type WithdrawalStatus string //	@name	WithdrawalStatus
const (
	WithdrawalStatusEnabled  WithdrawalStatus = "enabled"
	WithdrawalStatusDisabled WithdrawalStatus = "disabled"
)

func (WithdrawalStatus) IsValid

func (o WithdrawalStatus) IsValid() bool

func (WithdrawalStatus) String

func (o WithdrawalStatus) String() string

type WithdrawalStatusDTO

type WithdrawalStatusDTO struct {
	ID           string          `json:"id"`
	Status       string          `json:"status"`
	TxHash       string          `json:"tx_hash"`
	NativeAmount decimal.Decimal `json:"native_amount"`
	ErrorMessage string          `json:"error_message,omitempty"`
}

type WithdrawalWallet

type WithdrawalWallet struct {
	ID                      uuid.UUID           `db:"id" json:"id"`
	UserID                  uuid.UUID           `db:"user_id" json:"user_id"`
	Blockchain              Blockchain          `db:"blockchain" json:"blockchain"`
	CurrencyID              string              `db:"currency_id" json:"currency_id"`
	WithdrawalMinBalance    decimal.NullDecimal `db:"withdrawal_min_balance" json:"withdrawal_min_balance"`
	WithdrawalInterval      string              `db:"withdrawal_interval" json:"withdrawal_interval"`
	CreatedAt               pgtype.Timestamp    `db:"created_at" json:"created_at"`
	DeletedAt               pgtype.Timestamp    `db:"deleted_at" json:"deleted_at"`
	UpdatedAt               pgtype.Timestamp    `db:"updated_at" json:"updated_at"`
	WithdrawalEnabled       string              `db:"withdrawal_enabled" json:"withdrawal_enabled"`
	WithdrawalMinBalanceUsd decimal.NullDecimal `db:"withdrawal_min_balance_usd" json:"withdrawal_min_balance_usd"`
}

type WithdrawalWalletAddress

type WithdrawalWalletAddress struct {
	ID                 uuid.UUID        `db:"id" json:"id"`
	WithdrawalWalletID uuid.UUID        `db:"withdrawal_wallet_id" json:"withdrawal_wallet_id"`
	Name               *string          `db:"name" json:"name"`
	Address            string           `db:"address" json:"address"`
	CreatedAt          pgtype.Timestamp `db:"created_at" json:"created_at"`
	UpdatedAt          pgtype.Timestamp `db:"updated_at" json:"updated_at"`
	DeletedAt          pgtype.Timestamp `db:"deleted_at" json:"deleted_at"`
}

type WithdrawalWalletType

type WithdrawalWalletType string //	@name	WithdrawalWalletType
const (
	WithdrawalTypeBalanceLimit     WithdrawalWalletType = "balance"
	WithdrawalTypeInterval         WithdrawalWalletType = "interval"
	WithdrawalTypeManual           WithdrawalWalletType = "manual"
	WithdrawalTypeDeposit          WithdrawalWalletType = "deposit"
	WithdrawalTypeLimitAndInterval WithdrawalWalletType = "limit_and_balance"
)

Jump to

Keyboard shortcuts

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