client

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AXIE_INFINITY_GRAPHQL_GATEWAY = "https://graphql-gateway.axieinfinity.com/graphql"
	HOUR_PER_DAY                  = 24
	DAYS_BETWEEN_CLAIM            = 14
	DURATION_BETWEEN_CLAIMS       = time.Hour * HOUR_PER_DAY * DAYS_BETWEEN_CLAIM
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AxieClient

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

func (*AxieClient) BreedAxie

func (c *AxieClient) BreedAxie(ctx context.Context, privateKey string, dadAxieId, momAxieId int) (string, error)

TODO: Test

func (*AxieClient) ClaimSlp

func (c *AxieClient) ClaimSlp(
	ctx context.Context, address, privateKeyStr string) (string, error)

func (*AxieClient) CreateAccessToken added in v0.1.7

func (c *AxieClient) CreateAccessToken(address, privateKeyStr string) (string, error)

func (*AxieClient) GetClaimPayload added in v0.1.4

func (c *AxieClient) GetClaimPayload(ctx context.Context, address, privateKeyStr string) (*ClaimableResponse, error)

func (*AxieClient) GetClaimableAmount

func (c *AxieClient) GetClaimableAmount(ctx context.Context, address string) (*ClaimableResponse, error)

func (*AxieClient) GetRoninWalletBalance

func (c *AxieClient) GetRoninWalletBalance(ctx context.Context, tokenTypeAddress, address string) (float64, error)

func (*AxieClient) GetTransactionReceipt

func (c *AxieClient) GetTransactionReceipt(ctx context.Context, txHash string) (*types.Receipt, error)

func (*AxieClient) GetWalletTransactionHistory

func (c *AxieClient) GetWalletTransactionHistory(address string) (*pkgTypes.WalletTransactionHistory, error)

func (*AxieClient) TransferAxie

func (c *AxieClient) TransferAxie(ctx context.Context, privateKey, to string, axieId int) (string, error)

func (*AxieClient) TransferSlp

func (c *AxieClient) TransferSlp(ctx context.Context, privateKey, to string, amount int) (string, error)

type ClaimableResponse

type ClaimableResponse struct {
	ClientID          string `json:"clientID"`
	ItemID            int    `json:"itemID"`
	Name              string `json:"name"`
	Description       string `json:"description"`
	ImageUrl          string `json:"imageUrl"`
	Total             int    `json:"total"`
	BlockchainRelated struct {
		Signature struct {
			Signature string `json:"signature"`
			Amount    int    `json:"amount"`
			Timestamp int    `json:"timestamp"`
		} `json:"signature"`
		Balance     int `json:"balance"`
		Checkpoint  int `json:"checkpoint"`
		BlockNumber int `json:"blockNumber"`
	} `json:"blockchainRelated"`
	ClaimableTotal    int `json:"claimableTotal"`
	LastClaimedItemAt int `json:"lastClaimedItemAt"`
	RawTotal          int `json:"rawTotal"`
	RawClaimableTotal int `json:"rawClaimableTotal"`
}

func (ClaimableResponse) CanClaim

func (c ClaimableResponse) CanClaim() bool

func (ClaimableResponse) GetClaimableAmount

func (c ClaimableResponse) GetClaimableAmount() int

The following functions are so funny, it makes me think im not sure whats going on OR the devs suck amount that can be claimed as of today if CanClaim is true

func (ClaimableResponse) HoursToNextClaim

func (c ClaimableResponse) HoursToNextClaim() float64

type Client

type Client interface {
	TransferSlp(ctx context.Context, privateKey, to string, amount int) (string, error)
	TransferAxie(ctx context.Context, privateKey, to string, axieId int) (string, error)
	GetTransactionReceipt(ctx context.Context, txHash string) (*types.Receipt, error)
	GetRoninWalletBalance(ctx context.Context, tokenTypeAddress, address string) (float64, error)
	GetClaimableAmount(ctx context.Context, address string) (*ClaimableResponse, error)
	ClaimSlp(ctx context.Context, address, privateKeyStr string) (string, error)
	GetWalletTransactionHistory(address string) (*pkgTypes.WalletTransactionHistory, error)
	GetClaimPayload(ctx context.Context, address, privateKeyStr string) (*ClaimableResponse, error)
	CreateAccessToken(address, privateKeyStr string) (string, error)
}

func New

func New() (Client, error)

type GraphqlRequest

type GraphqlRequest struct {
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
	Query         string                 `json:"query"`
}

type T

type T struct {
}

Jump to

Keyboard shortcuts

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