wallet

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 回复1000表示成功
	WalletResCodeSuccess = 1000
)

Variables

This section is empty.

Functions

func ApplyAddress

func ApplyAddress(symbol string) (string, string, error)

申请地址

func ApplyTransaction

func ApplyTransaction(param *ApplyTransactionParam) error

申请提币

func ValidateAddress

func ValidateAddress(symbol string, address string) bool

验证地址格式是否正确, 默认为true

Types

type AddressValidator

type AddressValidator interface {

	// 返回地址代币符号
	Symbol() string

	// 验证地址格式是否正确
	Validate(address string) bool
}

地址验证

type AddressValidatorBase

type AddressValidatorBase struct {
	// contains filtered or unexported fields
}

func (*AddressValidatorBase) Symbol

func (v *AddressValidatorBase) Symbol() string

func (*AddressValidatorBase) Validate

func (v *AddressValidatorBase) Validate(address string) bool

type ApplyTransactionParam

type ApplyTransactionParam struct {
	Symbol     string  `json:"symbol"`
	ContractId string  `json:"contractId"`
	Amount     float64 `json:"amount"`
	Usid       string  `json:"usid"`
	Memo       string  `json:"memo"`
	ToAddress  string  `json:"to"`
}

提币参数

type BTCAddressValidator

type BTCAddressValidator struct {
	AddressValidatorBase
}

BTC

func NewBTCAddressValidator

func NewBTCAddressValidator() *BTCAddressValidator

func (*BTCAddressValidator) Symbol

func (v *BTCAddressValidator) Symbol() string

func (*BTCAddressValidator) Validate

func (v *BTCAddressValidator) Validate(address string) bool

type ETHAddressValidator

type ETHAddressValidator struct {
	AddressValidatorBase
}

ETH

func NewETHAddressValidator

func NewETHAddressValidator() *ETHAddressValidator

func (*ETHAddressValidator) Symbol

func (v *ETHAddressValidator) Symbol() string

func (*ETHAddressValidator) Validate

func (v *ETHAddressValidator) Validate(address string) bool

type TRXAddressValidator

type TRXAddressValidator struct {
	AddressValidatorBase
}

TRX

func NewTRXAddressValidator

func NewTRXAddressValidator() *TRXAddressValidator

func (*TRXAddressValidator) Symbol

func (v *TRXAddressValidator) Symbol() string

func (*TRXAddressValidator) Validate

func (v *TRXAddressValidator) Validate(address string) bool

Jump to

Keyboard shortcuts

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