BattleNet class

A Dart wrapper client for the Battle.net API.

This class provides methods to interact with various Battle.net API endpoints, including OAuth, WoW Game Data (Token, Connected Realm, Mythic Keystone Dungeons, and Mythic Keystone Affixes).

Constructors

BattleNet({required String clientId, required String clientSecret, LogLevel logLevel = LogLevel.BASIC, bool enableReleaseLogging = false, int connectionTimeout = 10000})
Creates an instance of BattleNet.

Properties

connectionTimeout int
The connection timeout in milliseconds for API requests.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildAuthorizationUri({required Uri redirectUri, required List<BattleNetScope> scope}) Uri
Builds Authorization Request Uri with the provided parameters.
getConnectedRealm({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required int id}) Future<ConnectedRealmSearchData>
Returns a connected realm by ID.
getConnectedRealmSearch({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, ServerStatus? statusType, RealmTimezone? realmsTimezone, String orderBy = 'id:asc', int page = 1, int pageSize = 150, bool? hasQueue, PopulationType? populationType, bool? realmsIsTournament}) Future<ConnectedRealmSearchResponse>
Query a connected realm by search parameters.
getMythicKeystoneAffix({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required BattleNetLocale locale, required int keystoneAffixId}) Future<MythicKeystoneAffixResponse>
Returns a Mythic Keystone affix by ID.
getMythicKeystoneAffixesIndex({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required BattleNetLocale locale}) Future<MythicKeystoneAffixesIndexResponse>
Returns an index of Mythic Keystone affixes.
getMythicKeystoneAffixMedia({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required BattleNetLocale locale, required int keystoneAffixId}) Future<MythicKeystoneAffixMediaResponse>
Returns media for a Mythic Keystone affix by ID.
getMythicKeystonePeriod({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required BattleNetLocale locale, required int periodId}) Future<MythicKeystonePeriodResponse>
Returns a Mythic Keystone period by ID.
getMythicKeystonePeriodsIndex({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required BattleNetLocale locale}) Future<MythicKeystonePeriodsIndexResponse>
Returns an index of Mythic Keystone periods.
getTokenIndex({required String accessToken, required BattleNetRegion region, required BattleNetNamespace namespace, required BattleNetLocale locale}) Future<TokenIndexResponse>
OAuthRegion end WoW Region start Game Region start Returns the WoW Token index.
getUserInfo({required String accessToken}) Future<UserInfoResponse>
Returns basic information about the user associated with the current bearer token.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postAuthorizationCode({required Uri redirectUri, required String code}) Future<AuthorizationCodeResponse>
The access token request is the second part of the authorization code flow. When the first part completes, the user's browser is redirected to an application's redirect_uri. This redirect URI also includes an access code and (optionally) a state parameter. This request allows the application to exchange the access code for an access token to can use in subsequent API requests.
postClientCredentials() Future<ClientCredentialsResponse>
OAuthRegion start This is the only request necessary for the client credential flow, OAuth's authentication flow intended for application servers.
postTokenValidation({required String token}) Future<CheckTokenResponse>
Verifies that a given bearer token is valid and retrieves metadata about the token, including the client_id used to create the token, expiration timestamp, and scopes granted to the token.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited