Documentation ¶
Index ¶
- type Connection
- func (c *Connection) CreateExternalWithdrawals(ctx context.Context, tasks []core.ExternalWithdrawalTask, extMsgUuid uuid.UUID, ...) error
- func (c *Connection) GetExternalWithdrawalStatus(ctx context.Context, id int64) (core.WithdrawalData, error)
- func (c *Connection) GetExternalWithdrawalTasks(ctx context.Context, limit int) ([]core.ExternalWithdrawalTask, error)
- func (c *Connection) GetIncome(ctx context.Context, userID string, isDepositSide bool) ([]core.TotalIncome, error)
- func (c *Connection) GetIncomeByTx(ctx context.Context, txHash []byte) (*core.ExternalIncome, string, error)
- func (c *Connection) GetIncomeHistory(ctx context.Context, userID string, currency string, limit int, offset int, ...) ([]core.ExternalIncome, error)
- func (c *Connection) GetJettonInternalWithdrawalTasks(ctx context.Context, forbiddenAddresses []core.Address, limit int) ([]core.InternalWithdrawalTask, error)
- func (c *Connection) GetJettonOwnersAddresses(ctx context.Context, userID string, types []core.WalletType) ([]core.OwnerWallet, error)
- func (c *Connection) GetJettonWallet(ctx context.Context, address core.Address) (*core.WalletData, bool, error)
- func (c *Connection) GetLastSavedBlockID(ctx context.Context) (*ton.BlockIDExt, error)
- func (c *Connection) GetLastSubwalletID(ctx context.Context) (uint32, error)
- func (c *Connection) GetOwner(address core.Address) *core.Address
- func (c *Connection) GetServiceDepositWithdrawalTasks(ctx context.Context, limit int) ([]core.ServiceWithdrawalTask, error)
- func (c *Connection) GetServiceHotWithdrawalTasks(ctx context.Context, limit int) ([]core.ServiceWithdrawalTask, error)
- func (c *Connection) GetTonHotWalletAddress(ctx context.Context) (core.Address, error)
- func (c *Connection) GetTonInternalWithdrawalTasks(ctx context.Context, limit int) ([]core.InternalWithdrawalTask, error)
- func (c *Connection) GetTonWalletsAddresses(ctx context.Context, userID string, types []core.WalletType) ([]core.Address, error)
- func (c *Connection) GetTotalWithdrawalAmounts(ctx context.Context, currency string) (*core.TotalWithdrawalsAmount, error)
- func (c *Connection) GetUserID(address core.Address) (string, bool)
- func (c *Connection) GetWalletType(address core.Address) (core.WalletType, bool)
- func (c *Connection) GetWalletTypeByTonutilsAddress(address *address.Address) (core.WalletType, bool)
- func (c *Connection) IsActualBlockData(ctx context.Context) (bool, int64, error)
- func (c *Connection) IsInProgressInternalWithdrawalRequest(ctx context.Context, dest core.Address, currency string) (bool, error)
- func (c *Connection) IsWithdrawalRequestUnique(ctx context.Context, w core.WithdrawalRequest) (bool, error)
- func (c *Connection) LoadAddressBook(ctx context.Context) error
- func (c *Connection) SaveInternalWithdrawalTask(ctx context.Context, task core.InternalWithdrawalTask, expiredAt time.Time, ...) error
- func (c *Connection) SaveJettonWallet(ctx context.Context, ownerAddress core.Address, walletData core.WalletData, ...) error
- func (c *Connection) SaveParsedBlockData(ctx context.Context, events core.BlockEvents) error
- func (c *Connection) SaveServiceWithdrawalRequest(ctx context.Context, w core.ServiceWithdrawalRequest) (uuid.UUID, error)
- func (c *Connection) SaveTonWallet(ctx context.Context, walletData core.WalletData) error
- func (c *Connection) SaveWithdrawalRequest(ctx context.Context, w core.WithdrawalRequest) (int64, error)
- func (c *Connection) SetExpired(ctx context.Context) error
- func (c *Connection) UpdateServiceWithdrawalRequest(ctx context.Context, t core.ServiceWithdrawalTask, tonAmount core.Coins, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(URI string) (*Connection, error)
func (*Connection) CreateExternalWithdrawals ¶
func (c *Connection) CreateExternalWithdrawals( ctx context.Context, tasks []core.ExternalWithdrawalTask, extMsgUuid uuid.UUID, expiredAt time.Time, ) error
func (*Connection) GetExternalWithdrawalStatus ¶
func (c *Connection) GetExternalWithdrawalStatus(ctx context.Context, id int64) (core.WithdrawalData, error)
GetExternalWithdrawalStatus returns status and hash of transaction for external withdrawal
func (*Connection) GetExternalWithdrawalTasks ¶
func (c *Connection) GetExternalWithdrawalTasks(ctx context.Context, limit int) ([]core.ExternalWithdrawalTask, error)
func (*Connection) GetIncome ¶
func (c *Connection) GetIncome( ctx context.Context, userID string, isDepositSide bool, ) ( []core.TotalIncome, error, )
GetIncome returns list of incomes by user_id
func (*Connection) GetIncomeByTx ¶ added in v0.5.0
func (c *Connection) GetIncomeByTx( ctx context.Context, txHash []byte, ) ( *core.ExternalIncome, string, error, )
GetIncomeByTx returns external income and currency for deposit side by transaction hash
func (*Connection) GetIncomeHistory ¶
func (c *Connection) GetIncomeHistory( ctx context.Context, userID string, currency string, limit int, offset int, ascOrder bool, ) ( []core.ExternalIncome, error, )
GetIncomeHistory returns list of external incomes for deposit side by user_id and currency
func (*Connection) GetJettonInternalWithdrawalTasks ¶
func (c *Connection) GetJettonInternalWithdrawalTasks( ctx context.Context, forbiddenAddresses []core.Address, limit int, ) ( []core.InternalWithdrawalTask, error, )
func (*Connection) GetJettonOwnersAddresses ¶
func (c *Connection) GetJettonOwnersAddresses( ctx context.Context, userID string, types []core.WalletType, ) ( []core.OwnerWallet, error, )
func (*Connection) GetJettonWallet ¶
func (c *Connection) GetJettonWallet(ctx context.Context, address core.Address) (*core.WalletData, bool, error)
func (*Connection) GetLastSavedBlockID ¶
func (c *Connection) GetLastSavedBlockID(ctx context.Context) (*ton.BlockIDExt, error)
func (*Connection) GetLastSubwalletID ¶
func (c *Connection) GetLastSubwalletID(ctx context.Context) (uint32, error)
GetLastSubwalletID returns last (greatest) used subwallet_id from DB numeration starts from wallet.DefaultSubwallet (this number reserved for main hot wallet) returns wallet.DefaultSubwallet if table is empty
func (*Connection) GetOwner ¶
func (c *Connection) GetOwner(address core.Address) *core.Address
GetOwner returns owner for jetton deposit from address book and nil for other types
func (*Connection) GetServiceDepositWithdrawalTasks ¶
func (c *Connection) GetServiceDepositWithdrawalTasks(ctx context.Context, limit int) ([]core.ServiceWithdrawalTask, error)
GetServiceDepositWithdrawalTasks return tasks for TON deposit wallets
func (*Connection) GetServiceHotWithdrawalTasks ¶
func (c *Connection) GetServiceHotWithdrawalTasks(ctx context.Context, limit int) ([]core.ServiceWithdrawalTask, error)
GetServiceHotWithdrawalTasks return tasks for Hot wallet withdrawals
func (*Connection) GetTonHotWalletAddress ¶
func (*Connection) GetTonInternalWithdrawalTasks ¶
func (c *Connection) GetTonInternalWithdrawalTasks(ctx context.Context, limit int) ([]core.InternalWithdrawalTask, error)
func (*Connection) GetTonWalletsAddresses ¶
func (c *Connection) GetTonWalletsAddresses( ctx context.Context, userID string, types []core.WalletType, ) ( []core.Address, error, )
func (*Connection) GetTotalWithdrawalAmounts ¶ added in v0.5.0
func (c *Connection) GetTotalWithdrawalAmounts(ctx context.Context, currency string) (*core.TotalWithdrawalsAmount, error)
func (*Connection) GetUserID ¶ added in v0.4.0
func (c *Connection) GetUserID(address core.Address) (string, bool)
func (*Connection) GetWalletType ¶
func (c *Connection) GetWalletType(address core.Address) (core.WalletType, bool)
func (*Connection) GetWalletTypeByTonutilsAddress ¶
func (c *Connection) GetWalletTypeByTonutilsAddress(address *address.Address) (core.WalletType, bool)
func (*Connection) IsActualBlockData ¶
func (*Connection) IsInProgressInternalWithdrawalRequest ¶
func (*Connection) IsWithdrawalRequestUnique ¶
func (c *Connection) IsWithdrawalRequestUnique(ctx context.Context, w core.WithdrawalRequest) (bool, error)
func (*Connection) LoadAddressBook ¶
func (c *Connection) LoadAddressBook(ctx context.Context) error
func (*Connection) SaveInternalWithdrawalTask ¶
func (c *Connection) SaveInternalWithdrawalTask( ctx context.Context, task core.InternalWithdrawalTask, expiredAt time.Time, memo uuid.UUID, ) error
func (*Connection) SaveJettonWallet ¶
func (c *Connection) SaveJettonWallet( ctx context.Context, ownerAddress core.Address, walletData core.WalletData, notSaveOwner bool, ) error
func (*Connection) SaveParsedBlockData ¶
func (c *Connection) SaveParsedBlockData(ctx context.Context, events core.BlockEvents) error
func (*Connection) SaveServiceWithdrawalRequest ¶
func (c *Connection) SaveServiceWithdrawalRequest(ctx context.Context, w core.ServiceWithdrawalRequest) ( uuid.UUID, error, )
func (*Connection) SaveTonWallet ¶
func (c *Connection) SaveTonWallet(ctx context.Context, walletData core.WalletData) error
func (*Connection) SaveWithdrawalRequest ¶
func (c *Connection) SaveWithdrawalRequest(ctx context.Context, w core.WithdrawalRequest) (int64, error)
func (*Connection) SetExpired ¶
func (c *Connection) SetExpired(ctx context.Context) error
SetExpired TODO: maybe add block related expiration