Documentation ¶
Index ¶
- Constants
- type ContractConfig
- type RedPacketAction
- func NewRedPacketActionClose(tokenAddress string, packetId int64, creator string, _ string) (*RedPacketAction, error)
- func NewRedPacketActionCreate(tokenAddress string, count int, amount string) (*RedPacketAction, error)
- func NewRedPacketActionOpen(tokenAddress string, packetId int64, addresses []string, amounts []string) (*RedPacketAction, error)
- func NewSuiRedPacketActionClose(tokenAddress string, packetObjectId string, creator string, _ string) (*RedPacketAction, error)
- func NewSuiRedpacketActionOpen(tokenAddress string, packetObjectId string, addresses []string, ...) (*RedPacketAction, error)
- type RedPacketCloseParams
- type RedPacketContract
- func NewAptosRedPacketContract(chain aptos.IChain, contractAddress string) RedPacketContract
- func NewEthRedPacketContract(chain eth.IChain, contractAddress string) RedPacketContract
- func NewRedPacketContract(chainType string, chain base.Chain, contractAddress string, ...) (RedPacketContract, error)
- func NewSuiRedPacketContract(chain *sui.Chain, contractAddress string, config *ContractConfig) (RedPacketContract, error)
- type RedPacketCreateParams
- type RedPacketDataError
- type RedPacketDetail
- type RedPacketOpenParams
Constants ¶
View Source
const ( RPAMethodCreate = "create" RPAMethodOpen = "open" RPAMethodClose = "close" )
View Source
const ( AptosName = aptos.AptosName AptosSymbol = aptos.AptosSymbol AptosDecimal = 8 )
View Source
const ( ChainTypeEth = "eth" ChainTypeAptos = "aptos" ChainTypeSui = "sui" )
View Source
const RedPacketABI = `` /* 4896-byte string literal not displayed */
View Source
const (
SuiDecimal = 9
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractConfig ¶ added in v0.0.4
type ContractConfig struct {
SuiConfigAddress string
}
type RedPacketAction ¶
type RedPacketAction struct { Method string CreateParams *RedPacketCreateParams OpenParams *RedPacketOpenParams CloseParams *RedPacketCloseParams }
func NewRedPacketActionClose ¶
func NewRedPacketActionClose(tokenAddress string, packetId int64, creator string, _ string) (*RedPacketAction, error)
NewRedPacketActionClose close red packet add empty arg to distinct with NewRedPacketActionCreate signature when build jar
func NewRedPacketActionCreate ¶
func NewRedPacketActionCreate(tokenAddress string, count int, amount string) (*RedPacketAction, error)
用户发红包 的操作
func NewRedPacketActionOpen ¶
func NewRedPacketActionOpen(tokenAddress string, packetId int64, addresses []string, amounts []string) (*RedPacketAction, error)
批量打开红包 的操作
func NewSuiRedPacketActionClose ¶ added in v0.0.4
func NewSuiRedpacketActionOpen ¶ added in v0.0.4
type RedPacketCloseParams ¶
type RedPacketContract ¶
type RedPacketContract interface { SendTransaction(base.Account, *RedPacketAction) (string, error) FetchRedPacketCreationDetail(hash string) (*RedPacketDetail, error) EstimateFee(*RedPacketAction) (string, error) // create red packet fee EstimateGasFee(base.Account, *RedPacketAction) (string, error) // gas fee = gasPrice * gasLimit }
func NewAptosRedPacketContract ¶
func NewAptosRedPacketContract(chain aptos.IChain, contractAddress string) RedPacketContract
func NewEthRedPacketContract ¶
func NewEthRedPacketContract(chain eth.IChain, contractAddress string) RedPacketContract
func NewRedPacketContract ¶
func NewRedPacketContract(chainType string, chain base.Chain, contractAddress string, config *ContractConfig) (RedPacketContract, error)
func NewSuiRedPacketContract ¶ added in v0.0.4
func NewSuiRedPacketContract(chain *sui.Chain, contractAddress string, config *ContractConfig) (RedPacketContract, error)
type RedPacketCreateParams ¶
type RedPacketDataError ¶
type RedPacketDataError struct {
// contains filtered or unexported fields
}
func (*RedPacketDataError) Error ¶
func (e *RedPacketDataError) Error() string
type RedPacketDetail ¶
type RedPacketDetail struct { *base.TransactionDetail AmountName string AmountDecimal int16 RedPacketAmount string // 最后加入到红包里的 Amount,也即用户能够抢的那部分的 Amount ChainName string }
func NewRedPacketDetail ¶
func NewRedPacketDetail() *RedPacketDetail
func NewRedPacketDetailWithJsonString ¶
func NewRedPacketDetailWithJsonString(s string) (*RedPacketDetail, error)
func (*RedPacketDetail) JsonString ¶
func (d *RedPacketDetail) JsonString() string
Click to show internal directories.
Click to hide internal directories.