Documentation ¶
Index ¶
- Constants
- Variables
- func BuildJettonProxyWithdrawalMessage(proxy JettonProxy, jettonWallet, tonWallet *address.Address, ...) *wallet.Message
- func BuildJettonWithdrawalMessage(t ExternalWithdrawalTask, highloadWallet *wallet.Wallet, ...) *wallet.Message
- func BuildTonWithdrawalMessage(t ExternalWithdrawalTask) *wallet.Message
- func LoadComment(cell *cell.Cell) string
- func MakeJettonTransferMessage(destination, responseDest *address.Address, amount *big.Int, ...) *cell.Cell
- func TonutilsAddressToUserFormat(addr *address.Address) string
- func WithdrawJettons(ctx context.Context, from, to *wallet.Wallet, jettonWallet *address.Address, ...) error
- func WithdrawTONs(ctx context.Context, from, to *wallet.Wallet, comment string) error
- type Address
- type AddressInfo
- type BlockEvents
- type BlockScanner
- type Coins
- type EventName
- type Events
- type ExternalIncome
- type ExternalWithdrawal
- type ExternalWithdrawalTask
- type HighLoadWalletExtMsgInfo
- type IncomeSide
- type InternalIncome
- type InternalWithdrawal
- type InternalWithdrawalTask
- type JettonProxy
- type JettonTransferMsg
- type JettonWallet
- type JettonWithdrawalConfirmation
- type Notificator
- type OwnerWallet
- type SendingConfirmation
- type ServiceWithdrawalRequest
- type ServiceWithdrawalTask
- type ShardBlockHeader
- type TotalIncome
- type TotalWithdrawalsAmount
- type WalletData
- type WalletType
- type Wallets
- type WithdrawalData
- type WithdrawalRequest
- type WithdrawalStatus
- type WithdrawalsProcessor
Constants ¶
const ( TonSymbol = "TON" DefaultWorkchain = 0 // use only 0 workchain )
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrTimeoutExceeded = errors.New("timeout exceeded") )
Functions ¶
func BuildTonWithdrawalMessage ¶
func BuildTonWithdrawalMessage(t ExternalWithdrawalTask) *wallet.Message
func LoadComment ¶
func WithdrawJettons ¶
Types ¶
type Address ¶
type Address [32]byte // supports only MsgAddressInt addr_std$10 without anycast and 0 workchain
func AddressFromBytes ¶
func (Address) ToTonutilsAddressStd ¶
ToTonutilsAddressStd implements converter to ton-utils std Address type for default workchain !
func (Address) ToUserFormat ¶
ToUserFormat converts to user-friendly text format with testnet and bounce flags
type AddressInfo ¶
type AddressInfo struct { Type WalletType Owner *Address UserID string }
type BlockEvents ¶
type BlockEvents struct { Events Block ShardBlockHeader }
type BlockScanner ¶
type BlockScanner struct {
// contains filtered or unexported fields
}
func NewBlockScanner ¶
func NewBlockScanner( wg *sync.WaitGroup, db storage, blockchain blockchain, shard byte, tracker blocksTracker, notificators []Notificator, ) *BlockScanner
func (*BlockScanner) Start ¶
func (s *BlockScanner) Start()
func (*BlockScanner) Stop ¶
func (s *BlockScanner) Stop()
type Events ¶
type Events struct { ExternalIncomes []ExternalIncome InternalIncomes []InternalIncome SendingConfirmations []SendingConfirmation InternalWithdrawals []InternalWithdrawal ExternalWithdrawals []ExternalWithdrawal WithdrawalConfirmations []JettonWithdrawalConfirmation }
type ExternalIncome ¶
type ExternalWithdrawal ¶
type ExternalWithdrawalTask ¶
type IncomeSide ¶
type IncomeSide = string
const ( SideHotWallet IncomeSide = "hot_wallet" SideDeposit IncomeSide = "deposit" )
type InternalIncome ¶
type InternalWithdrawal ¶
type InternalWithdrawalTask ¶
type JettonProxy ¶
type JettonProxy struct { Owner *address.Address SubwalletID uint32 // contains filtered or unexported fields }
JettonProxy is a special contract wrapper that allow to control jetton wallet from TON wallet. It is possible create few jetton proxies for single TON wallet (as owner) and control multiple jetton wallets. Read about JettonProxy smart contract at README.md and https://github.com/gobicycle/ton-proxy-contract
func NewJettonProxy ¶
func NewJettonProxy(subwalletId uint32, owner *address.Address) (*JettonProxy, error)
func (*JettonProxy) Address ¶
func (p *JettonProxy) Address() *address.Address
Address returns address of jetton proxy contract
func (*JettonProxy) BuildMessage ¶
func (p *JettonProxy) BuildMessage(destination *address.Address, body *cell.Cell) *tlb.InternalMessage
BuildMessage wraps custom body payload to resend by proxy contract
func (*JettonProxy) StateInit ¶
func (p *JettonProxy) StateInit() *tlb.StateInit
StateInit returns state init structure of jetton proxy contract
type JettonTransferMsg ¶
func DecodeJettonTransfer ¶
func DecodeJettonTransfer(msg *tlb.InternalMessage) (JettonTransferMsg, error)
type JettonWallet ¶
type JettonWithdrawalConfirmation ¶
type JettonWithdrawalConfirmation struct {
QueryId uint64
}
type Notificator ¶
type OwnerWallet ¶
type SendingConfirmation ¶
type ServiceWithdrawalTask ¶
type ServiceWithdrawalTask struct { ServiceWithdrawalRequest JettonAmount Coins Memo uuid.UUID SubwalletID uint32 }
type ShardBlockHeader ¶
type ShardBlockHeader struct { *ton.BlockIDExt NotMaster bool GenUtime uint32 StartLt uint64 EndLt uint64 Parent *ton.BlockIDExt }
ShardBlockHeader Block header for a specific shard mask attribute. Has only one parent.
type TotalIncome ¶
type TotalWithdrawalsAmount ¶ added in v0.5.0
type WalletData ¶
type WalletData struct { SubwalletID uint32 UserID string Currency string Type WalletType Address Address }
type WalletType ¶
type WalletType string
const ( TonHotWallet WalletType = "ton_hot" JettonHotWallet WalletType = "jetton_hot" TonDepositWallet WalletType = "ton_deposit" JettonDepositWallet WalletType = "jetton_deposit" JettonOwner WalletType = "owner" )
type Wallets ¶
type Wallets struct { Shard byte TonHotWallet *wallet.Wallet TonBasicWallet *wallet.Wallet // basic V3 wallet to make other wallets with different subwallet_id JettonHotWallets map[string]JettonWallet }
func InitWallets ¶
func InitWallets( ctx context.Context, db storage, bc blockchain, seed string, jettons map[string]config.Jetton, ) (Wallets, error)
InitWallets Generates highload hot-wallet and map[currency]JettonWallet Jetton wallets, and saves to DB TON highload hot-wallet (for seed and default subwallet_id) must be already active for success initialization.
type WithdrawalData ¶ added in v0.4.4
type WithdrawalData struct { QueryID string UserID string Status WithdrawalStatus TxHash []byte }
type WithdrawalRequest ¶
type WithdrawalStatus ¶
type WithdrawalStatus string
const ( PendingStatus WithdrawalStatus = "pending" ProcessingStatus WithdrawalStatus = "processing" ProcessedStatus WithdrawalStatus = "processed" FailedStatus WithdrawalStatus = "failed" )
type WithdrawalsProcessor ¶
type WithdrawalsProcessor struct {
// contains filtered or unexported fields
}
func NewWithdrawalsProcessor ¶
func (*WithdrawalsProcessor) Start ¶
func (p *WithdrawalsProcessor) Start()
func (*WithdrawalsProcessor) Stop ¶
func (p *WithdrawalsProcessor) Stop()