Documentation
¶
Index ¶
Constants ¶
const ( AddrHK4E = "https://hk4e-sdk.mihoyo.com" AddrTakumi = "https://api-takumi.mihoyo.com" AddrPassport = "https://passport-api.mihoyo.com" )
const ( QRCodeStatInit = "Init" QRCodeStatScanned = "Scanned" QRCodeStatConfirmed = "Confirmed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenQRCodeData ¶
func GenQRCode ¶
func GenQRCode(account config.Account) (*GenQRCodeData, error)
GenQRCode generate to login sr (app_id = 8) to get game token https://github.com/UIGF-org/mihoyo-api-collect/blob/3a9116ea538941cfead749572df1f364cb9f9c8d/hoyolab/login/qrcode_hk4e.md#%E7%94%9F%E6%88%90%E4%BA%8C%E7%BB%B4%E7%A0%81
type GetCTokenBySTokenData ¶
type GetCTokenBySTokenData struct { Uid string `json:"uid"` CookieToken string `json:"cookie_token"` }
func GetCTokenBySToken ¶
func GetCTokenBySToken(account config.Account) (*GetCTokenBySTokenData, error)
GetCTokenBySToken get cookie token by stoken v2 https://github.com/UIGF-org/mihoyo-api-collect/blob/3a9116ea538941cfead749572df1f364cb9f9c8d/hoyolab/user/token.md#%E9%80%9A%E8%BF%87stoken%E8%8E%B7%E5%8F%96cookie-token
type GetLTokenBySTokenData ¶
type GetLTokenBySTokenData struct {
LToken string `json:"ltoken"`
}
func GetLTokenBySToken ¶
func GetLTokenBySToken(account config.Account) (*GetLTokenBySTokenData, error)
GetLTokenBySToken get ltoken v1 by stoken v2 https://github.com/UIGF-org/mihoyo-api-collect/blob/3a9116ea538941cfead749572df1f364cb9f9c8d/hoyolab/user/token.md#%E9%80%9A%E8%BF%87stoken%E8%8E%B7%E5%8F%96ltokenv1
type GetSTokenByGTokenData ¶
type GetSTokenByGTokenData struct { Token *TokenInfo `json:"token"` UserInfo *UserInfo `json:"user_info"` }
func GetSTokenByGToken ¶
func GetSTokenByGToken(account config.Account) (*GetSTokenByGTokenData, error)
GetSTokenByGToken get stoken v2 by game token https://github.com/UIGF-org/mihoyo-api-collect/blob/3a9116ea538941cfead749572df1f364cb9f9c8d/hoyolab/user/token.md#%E9%80%9A%E8%BF%87game-token%E8%8E%B7%E5%8F%96stokenv1
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 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)