axieinfinity

package
v0.0.0-...-4430d46 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api interface {
	Claim(address simpleCommon.PrivateAddress) (*ClaimResponse, error)
	GetClaimableSlp(address axieCommon.RoninAddress) (*ClaimableResponse, error)
	GetClaimableBatchSlp(addresses []axieCommon.RoninAddress) (*ClaimableBatchResponse, error)
	MakePayment(manager axieCommon.RoninAddress, token string, scholarPaymentData *ScholarPaymentData) (*PaymentResponse, error)
	GetQR(address simpleCommon.PrivateAddress) (*QrResponse, error)
	GetBalance(address axieCommon.RoninAddress, token string) (*BalanceResponse, error)
}

func NewApiImplementation

func NewApiImplementation(client *ethclient.Client) Api

func SafeNewApiImplementation

func SafeNewApiImplementation(client *ethclient.Client) (Api, error)

type BalanceResponse

type BalanceResponse struct {
	Address axieCommon.RoninAddress `json:"address"`
	Token   string                  `json:"token"`
	Balance *big.Int                `json:"quantity"`
}

type ClaimResponse

type ClaimResponse struct{}

type ClaimableBatchResponse

type ClaimableBatchResponse struct {
	Processed []*ClaimableResponse `json:"processed"`
	Errors    []error              `json:"errors"`
	Total     int                  `json:"total"`
}

type ClaimableResponse

type ClaimableResponse struct {
	Quantity int                     `json:"quantity"`
	Address  axieCommon.RoninAddress `json:"address"`
}

type MockApi

type MockApi struct {
	mock.Mock
}

func (*MockApi) Claim

func (api *MockApi) Claim(address simpleCommon.PrivateAddress) (
	resp *ClaimResponse, err error,
)

func (*MockApi) GetBalance

func (api *MockApi) GetBalance(address axieCommon.RoninAddress, token string) (
	resp *BalanceResponse, err error,
)

func (*MockApi) GetClaimableBatchSlp

func (api *MockApi) GetClaimableBatchSlp(addresses []axieCommon.RoninAddress) (
	resp *ClaimableBatchResponse, err error,
)

func (*MockApi) GetClaimableSlp

func (api *MockApi) GetClaimableSlp(address axieCommon.RoninAddress) (
	resp *ClaimableResponse, err error,
)

func (*MockApi) GetQR

func (api *MockApi) GetQR(address simpleCommon.PrivateAddress) (
	resp *QrResponse, err error,
)

func (*MockApi) MakePayment

func (api *MockApi) MakePayment(
	address axieCommon.RoninAddress,
	token string,
	scholarPaymentData *ScholarPaymentData,
) (
	resp *PaymentResponse,
	err error,
)

type PaymentData

type PaymentData struct {
	ManagerAddress axieCommon.RoninAddress `json:"managerAddress"`
	Scholars       []*ScholarPaymentData   `json:"scholars"`
}

type PaymentResponse

type PaymentResponse struct {
	Results map[axieCommon.RoninAddress]*PaymentResponseResult `json:"results"`
}

type PaymentResponseResult

type PaymentResponseResult struct {
	Error       error              `json:"error"`
	Transaction *types.Transaction `json:"transaction"`
}

type QrResponse

type QrResponse struct {
	QrCode []byte `json:"qrCode"`
}

type Resources

type Resources struct {
	API Api
}

type ScholarPaymentData

type ScholarPaymentData struct {
	TeamAddress    simpleCommon.PrivateAddress `json:"teamAddress"`
	ScholarAddress axieCommon.RoninAddress     `json:"scholarAddress"`
	ScholarPercent *big.Int                    `json:"scholarPercent"`
	ScholarPayout  []int64                     `json:"scholarPayout"`
}

type Service

type Service interface {
	Claim(address simpleCommon.PrivateAddress) (*ClaimResponse, error)
	GetClaimableSlp(address axieCommon.RoninAddress) (*ClaimableResponse, error)
	GetClaimableBatchSlp(addresses []axieCommon.RoninAddress) (*ClaimableBatchResponse, error)
	MakePayment(manager axieCommon.RoninAddress, token string, scholar *ScholarPaymentData) (*PaymentResponse, error)
	GetQR(address simpleCommon.PrivateAddress) (*QrResponse, error)
	GetBalance(address axieCommon.RoninAddress, token string) (*BalanceResponse, error)
}

func NewService

func NewService(res *Resources) Service

Jump to

Keyboard shortcuts

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