Versions in this module Expand all Collapse all v0 v0.2.3 Dec 6, 2022 Changes in this version + const ERC1155AssetType + const ERC20AssetType + const Other + var ErrActionTypeNotSupport = errors.New("not support action type") + var ErrAssetTypeNotSupport = errors.New("not support current asset type") + var ErrCannotFindERC20Wallet = errors.New("cannot find erc20 wallet") + var ErrIncorrectAssetType = errors.New("incorrect asset type in command") + var ErrIncorrectCheckSign = errors.New("check sign is invalid") + var ErrIncorrectERC1155Param = errors.New("incorrect erc1155 parameters") + var ErrNoEnoughBalanceForFee = errors.New("insufficient balance for fee") + var ErrNoEnoughERC20Balance = errors.New("insufficient balance") + var ErrNoEnoughNFT = errors.New("insufficient nft balance") + type AssetType int + type CommandSourceType int + const BSC + const BSCTestnet + const Ethereum + const GoerliTestnet + const InGame + func (s CommandSourceType) String() string + type ERC1155Command struct + Ids []uint64 + Values []uint64 + type ERC1155TokenWallet struct + AccountId uint64 + Ids string + Values string + type ERC1155WalletLog struct + AccountId uint64 + ActionType string + BusinessModule string + Fees erc20TokenCollection + Ids string + OriginalWallet Wallet + SettledWallet Wallet + Source string + Status string + Values string + type ERC20Command struct + Decimal uint64 + Token ERC20TokenEnum + Value float64 + type ERC20Token struct + Decimal uint64 + Index uint64 + Symbol string + type ERC20TokenEnum int + const BNB + const BUSD + const ETH + const FISHX + const NAMIX + const USDC + const USDT + func (t ERC20TokenEnum) String() string + type ERC20TokenWallet struct + AccountId uint64 + Balance float64 + Decimal uint64 + Token string + TotalDeposit float64 + TotalFee float64 + TotalIncome float64 + TotalSpend float64 + TotalWithdraw float64 + type ERC20WalletLog struct + AccountId uint64 + ActionType string + BusinessModule string + Fees erc20TokenCollection + OriginalWallet Wallet + SettledWallet Wallet + Source string + Status string + Tokens erc20TokenCollection + type Number interface + type Wallet struct + AccountId uint64 + CheckSign string + ERC1155TokenData ERC1155TokenWallet + ERC20TokenData []ERC20TokenWallet + func (w *Wallet) Scan(input interface{}) error + func (w Wallet) Value() (driver.Value, error) + type WalletActionType int + const ChargeFee + const Deposit + const Income + const Initialize + const Spend + const Withdraw + func (t WalletActionType) String() string + type WalletCommand struct + AccountId uint64 + ActionType WalletActionType + AssetType AssetType + BusinessModule string + CommandSource CommandSourceType + ERC1155Command ERC1155Command + ERC20Commands []ERC20Command + FeeCommands []ERC20Command + func NewERC1155WalletCommand(accountId uint64, actionType WalletActionType, businessModule string, ...) WalletCommand + func NewERC20WalletCommand(accountId uint64, actionType WalletActionType, businessModule string, ...) WalletCommand + func NewInitWalletCommand(accountId uint64) WalletCommand + type WalletLogStatus int + const Done + const Failed + const Pending + func (s WalletLogStatus) String() string + type Walleter struct + func New(db *gorm.DB, chargerAccountId uint64) *Walleter + func (s *Walleter) GetWalletByAccountId(accountId uint64) (Wallet, error) + func (s *Walleter) HandleWalletCommand(db *gorm.DB, command WalletCommand) (Wallet, error)