mihoyo

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrHK4E     = "https://hk4e-sdk.mihoyo.com"
	AddrTakumi   = "https://api-takumi.mihoyo.com"
	AddrPassport = "https://passport-api.mihoyo.com"
)
View Source
const (
	QRCodeStatInit      = "Init"
	QRCodeStatScanned   = "Scanned"
	QRCodeStatConfirmed = "Confirmed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GenQRCodeData

type GenQRCodeData struct {
	Url    string `json:"url"`
	Ticket string `json:"ticket"`
}

type GetCTokenBySTokenData

type GetCTokenBySTokenData struct {
	Uid         string `json:"uid"`
	CookieToken string `json:"cookie_token"`
}

type GetSTokenByGTokenData

type GetSTokenByGTokenData struct {
	Token    *TokenInfo `json:"token"`
	UserInfo *UserInfo  `json:"user_info"`
}

type LoginByPhoneCodeData added in v1.4.0

type LoginByPhoneCodeData struct {
	Token       *TokenInfo `json:"token"`
	UserInfo    *UserInfo  `json:"user_info"`
	LoginTicket string     `json:"login_ticket"`
}

func LoginByPhoneCode added in v1.4.0

func LoginByPhoneCode(code string, account config.Account) (*LoginByPhoneCodeData, error)

type QRCodeStat

type QRCodeStat string

func (QRCodeStat) IsConfirmed

func (s QRCodeStat) IsConfirmed() bool

func (QRCodeStat) IsInit

func (s QRCodeStat) IsInit() bool

func (QRCodeStat) IsScanned

func (s QRCodeStat) IsScanned() bool

type QueryQRCodeData

type QueryQRCodeData struct {
	Stat    QRCodeStat          `json:"stat"`
	Payload *QueryQRCodePayload `json:"payload"`
}

func QueryQRCode

func QueryQRCode(ticket string, account config.Account) (*QueryQRCodeData, error)

type QueryQRCodePayload

type QueryQRCodePayload struct {
	Proto string `json:"proto"`
	Raw   string `json:"raw,omitempty"`
	Uid   string `json:"uid,omitempty"`
	Token string `json:"token,omitempty"`
}

type SendPhoneCodeData added in v1.4.0

type SendPhoneCodeData struct {
	SentNew    bool   `json:"sent_new"`
	Countdown  int    `json:"countdown"`
	ActionType string `json:"action_type"`
}

func SendPhoneCode added in v1.4.0

func SendPhoneCode(aigis string, account config.Account) (*SendPhoneCodeData, error)

type TokenInfo

type TokenInfo struct {
	TokenType int    `json:"token_type"`
	Token     string `json:"token"`
}

type UserInfo

type UserInfo struct {
	Aid string `json:"aid"`
	Mid string `json:"mid"`
}

Jump to

Keyboard shortcuts

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