tft

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MatchListURL = "/tft/match/v1/matches/by-puuid/%s/ids"
	MatchByIDURL = "/tft/match/v1/matches/%s"

	LeagueRatedLaddersURL      = "/tft/league/v1/rated-ladders/%s/top "
	LeagueEntriesURL           = "/tft/league/v1/entries/%s/%s"
	LeagueEntriesBySummonerURL = "/tft/league/v1/entries/by-summoner/%s"
	LeagueByIDURL              = "/tft/league/v1/leagues/%s"
	LeagueChallengerURL        = "/tft/league/v1/challenger"
	LeagueGrandmasterURL       = "/tft/league/v1/grandmaster"
	LeagueMasterURL            = "/tft/league/v1/master"

	SummonerByIDURL          = "/tft/summoner/v1/summoners/%s"
	SummonerByNameURL        = "/tft/summoner/v1/summoners/by-name/%s"
	SummonerByPUUIDURL       = "/tft/summoner/v1/summoners/by-puuid/%s"
	SummonerByAccountIDURL   = "/tft/summoner/v1/summoners/by-account/%s"
	SummonerByAccessTokenURL = "/tft/summoner/v1/summoners/me"
)

Teamfight Tactics endpoints

Variables

This section is empty.

Functions

This section is empty.

Types

type CompanionDTO

type CompanionDTO struct {
	ContentID string `json:"content_ID"`
	SkinID    int    `json:"skin_ID"`
	Species   string `json:"species"`
}

type InfoDTO

type InfoDTO struct {
	// Unix timestamp.
	GameDatetime int64 `json:"game_datetime"`
	// Game length in seconds.
	GameLength float64 `json:"game_length"`
	// Game variation key. Game variations documented in TFT static data.
	GameVariation string `json:"game_variation"`
	// Game client version.
	GameVersion  string            `json:"game_version"`
	Participants []ParticipantsDTO `json:"participants"`
	// Please refer to the League of Legends documentation.
	QueueID     int    `json:"queue_id"`
	TFTGameType string `json:"tft_game_type,omitempty"`
	// Teamfight Tactics set number.
	TFTSetNumber int `json:"tft_set_number"`
}

type LeagueEndpoint

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

func (*LeagueEndpoint) ByID

func (l *LeagueEndpoint) ByID(region lol.Region, leagueID string) (*LeagueListDTO, error)

Get league with given ID, including inactive entries.

func (*LeagueEndpoint) Challenger

func (l *LeagueEndpoint) Challenger(region lol.Region) (*LeagueListDTO, error)

Get the challenger league.

func (*LeagueEndpoint) Entries

func (l *LeagueEndpoint) Entries(region lol.Region, tier lol.Tier, division api.Division, page int) (*[]LeagueEntryDTO, error)

Get all the league entries.

Page defaults to 1.

func (*LeagueEndpoint) Grandmaster

func (l *LeagueEndpoint) Grandmaster(region lol.Region) (*LeagueListDTO, error)

Get the grandmaster league.

func (*LeagueEndpoint) Master

func (l *LeagueEndpoint) Master(region lol.Region) (*LeagueListDTO, error)

Get the master league.

func (*LeagueEndpoint) SummonerEntries

func (l *LeagueEndpoint) SummonerEntries(region lol.Region, summonerID string) (*[]LeagueEntryDTO, error)

Get league entries in all queues for a given summoner ID.

func (*LeagueEndpoint) TopRatedLadder

func (l *LeagueEndpoint) TopRatedLadder(region lol.Region, queue QueueType) (*[]TopRatedLadderEntryDTO, error)

Get the top rated ladder for given queue.

type LeagueEntryDTO

type LeagueEntryDTO struct {
	LeagueID  string    `json:"leagueId"`
	QueueType QueueType `json:"queueType"`
	Tier      lol.Tier  `json:"tier"`
	// Only included for the RANKED_TFT_TURBO queueType.
	RatedTier RatedTier `json:"ratedTier"`
	// Only included for the RANKED_TFT_TURBO queueType.
	RatedRating string       `json:"ratedRating"`
	Rank        api.Division `json:"rank"`
	// Player's encrypted summonerId.
	SummonerID   string `json:"summonerId"`
	SummonerName string `json:"summonerName"`
	LeaguePoints int    `json:"leaguePoints"`
	// First placement.
	Wins int `json:"wins"`
	// Second through eighth placement.
	Losses     int           `json:"losses"`
	Veteran    bool          `json:"veteran"`
	Inactive   bool          `json:"inactive"`
	FreshBlood bool          `json:"freshBlood"`
	HotStreak  bool          `json:"hotStreak"`
	MiniSeries MiniSeriesDTO `json:"miniSeries,omitempty"`
}

type LeagueListDTO

type LeagueListDTO struct {
	Tier     string           `json:"tier"`
	LeagueID string           `json:"leagueId"`
	Queue    string           `json:"queue"`
	Name     string           `json:"name"`
	Entries  []LeagueEntryDTO `json:"entries"`
}

type MatchDTO

type MatchDTO struct {
	// Match metadata.
	Metadata Metadata `json:"metadata"`
	// Match info.
	Info InfoDTO `json:"info"`
}

type MatchEndpoint

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

func (*MatchEndpoint) ByID

func (m *MatchEndpoint) ByID(matchID string) (*MatchDTO, error)

Get a match by match ID.

func (*MatchEndpoint) List

func (m *MatchEndpoint) List(PUUID string, count int) ([]string, error)

Get a list of match IDs by PUUID.

Count defaults to 20.

type Metadata

type Metadata struct {
	// Match data version.
	DataVersion string `json:"data_version"`
	// Match ID.
	MatchID string `json:"match_id"`
	// A list of participant PUUIDs.
	Participants []string `json:"participants"`
}

type MiniSeriesDTO

type MiniSeriesDTO struct {
	Progress string `json:"progress"`
	Losses   int    `json:"losses"`
	Target   int    `json:"target"`
	Wins     int    `json:"wins"`
}

type ParticipantsDTO

type ParticipantsDTO struct {
	Augments []string `json:"augments"`
	// Participant's companion.
	Companion CompanionDTO `json:"companion"`
	// Gold left after participant was eliminated.
	GoldLeft int `json:"gold_left"`
	// The round the participant was eliminated in. Note: If the player was eliminated in stage 2-1 their last_round would be 5.
	LastRound int `json:"last_round"`
	// Participant Little Legend level. Note: This is not the number of active units.
	Level int `json:"level"`
	// Participant placement upon elimination.
	Placement int `json:"placement"`
	// Number of players the participant eliminated.
	PlayersEliminated int    `json:"players_eliminated"`
	PUUID             string `json:"puuid"`
	// The number of seconds before the participant was eliminated.
	TimeEliminated float64 `json:"time_eliminated"`
	// Damage the participant dealt to other players.
	TotalDamageToPlayers int `json:"total_damage_to_players"`
	// A complete list of traits for the participant's active units.
	Traits []TraitsDTO `json:"traits"`
	// A list of active units for the participant.
	Units []UnitsDTO `json:"units"`
}

type QueueType added in v0.7.2

type QueueType string
const (
	RankedTFTTurbo QueueType = "RANKED_TFT_TURBO"
	RankedTFT      QueueType = "RANKED_TFT"
)

type RatedTier added in v0.7.2

type RatedTier string
const (
	OrangeTier RatedTier = "ORANGE"
	PurpleTier RatedTier = "PURPLE"
	BlueTier   RatedTier = "BLUE"
	GreenTier  RatedTier = "GREEN"
	GrayTier   RatedTier = "GRAY"
)

type Style added in v0.7.2

type Style int8
const (
	NoStyle   Style = 0
	Bronze    Style = 1
	Silver    Style = 2
	Gold      Style = 3
	Chromatic Style = 4
)

type SummonerEndpoint

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

func (*SummonerEndpoint) ByAccessToken

func (s *SummonerEndpoint) ByAccessToken(region lol.Region, accessToken string) (*lol.SummonerDTO, error)

Get a summoner by access token.

func (*SummonerEndpoint) ByAccountID

func (s *SummonerEndpoint) ByAccountID(region lol.Region, accountID string) (*lol.SummonerDTO, error)

Get a summoner by summoner account ID.

func (*SummonerEndpoint) ByID

func (s *SummonerEndpoint) ByID(region lol.Region, PUUID string) (*lol.SummonerDTO, error)

Get a summoner by summoner ID.

func (*SummonerEndpoint) ByName

func (s *SummonerEndpoint) ByName(region lol.Region, summonerName string) (*lol.SummonerDTO, error)

Get a summoner by summoner name.

func (*SummonerEndpoint) ByPUUID

func (s *SummonerEndpoint) ByPUUID(region lol.Region, PUUID string) (*lol.SummonerDTO, error)

Get a summoner by summoner PUUID.

type TFTClient

type TFTClient struct {
	Match    *MatchEndpoint
	League   *LeagueEndpoint
	Summoner *SummonerEndpoint
	// contains filtered or unexported fields
}

func NewTFTClient

func NewTFTClient(client *internal.InternalClient) *TFTClient

Returns a new client using the API key provided.

type TopRatedLadderEntryDTO

type TopRatedLadderEntryDTO struct {
	SummonerID   string    `json:"summonerId"`
	SummonerName string    `json:"summonerName"`
	RatedTier    RatedTier `json:"ratedTier"`
	RatedRating  int       `json:"ratedRating"`
	// First placement.
	Wins                         int `json:"wins"`
	PreviousUpdateLadderPosition int `json:"previousUpdateLadderPosition"`
}

type TraitsDTO

type TraitsDTO struct {
	// Trait name.
	Name string `json:"name"`
	// Number of units with this trait.
	NumUnits int `json:"num_units"`
	// Current style for this trait.
	Style Style `json:"style"`
	// Current active tier for the trait.
	TierCurrent int `json:"tier_current"`
	// Total tiers for the trait.
	TierTotal int `json:"tier_total"`
}

type UnitsDTO

type UnitsDTO struct {
	// This field was introduced in patch 9.22 with data_version 2.
	CharacterID string   `json:"character_id"`
	ItemNames   []string `json:"itemNames"`
	// A list of the unit's items. Please refer to the Teamfight Tactics documentation for item ids.
	Items []int `json:"items"`
	// Unit name. This field is often left blank.
	Name string `json:"name"`
	// Unit rarity. This doesn't equate to the unit cost.
	Rarity int `json:"rarity"`
	// Unit tier.
	Tier int `json:"tier"`
	// If a unit is chosen as part of the Fates set mechanic, the chosen trait will be indicated by this field. Otherwise this field is excluded from the response.
	Chosen string `json:"chosen,omitempty"`
}

Jump to

Keyboard shortcuts

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