@arkadiuminc/sdk 2.72.3 → 2.73.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,9 @@ import { GameLifecycleArena, GameLifecycleGame } from '../game-lifecycle/game-li
7
7
  import { AnalyticsApi } from '../analytics/analytics.api';
8
8
  import { IHost } from '../host';
9
9
 
10
+ export declare type RewardAdResult = {
11
+ value: number;
12
+ };
10
13
  export declare type ShowInterstitialAdOptions = {
11
14
  duration?: number;
12
15
  };
@@ -23,9 +26,7 @@ export interface AdsGame extends Ads, AdsGameBanner {
23
26
  interface Ads {
24
27
  showPrerollAd?(options: VideoAdOptions): Promise<void>;
25
28
  showInterstitialAd(options: VideoAdOptions): Promise<void>;
26
- showRewardAd(options: VideoAdOptions): Promise<{
27
- value: number;
28
- }>;
29
+ showRewardAd(options: VideoAdOptions): Promise<RewardAdResult>;
29
30
  }
30
31
  interface AdsArenaBanner {
31
32
  showBannerAd?(options: BannerAdOptions): any;
@@ -49,9 +50,7 @@ export declare class AdsArenaProvider implements AdsArena {
49
50
  setDisplayAdsDomain(domain: string): void;
50
51
  showPrerollAd(options: VideoAdOptions): Promise<void>;
51
52
  showInterstitialAd(options: VideoAdOptions): Promise<void>;
52
- showRewardAd(options: VideoAdOptions): Promise<{
53
- value: number;
54
- }>;
53
+ showRewardAd(options: VideoAdOptions): Promise<RewardAdResult>;
55
54
  showBannerAd(options: BannerAdOptions): any;
56
55
  }
57
56
  export declare class AdsGameProvider implements AdsGame {
@@ -62,9 +61,7 @@ export declare class AdsGameProvider implements AdsGame {
62
61
  private readonly banner;
63
62
  constructor(rpcProvider: RpcProvider, env: ApiEnv, auth: Auth, lifecycle: GameLifecycleGame);
64
63
  showInterstitialAd({ duration }?: ShowInterstitialAdOptions): Promise<void>;
65
- showRewardAd({ duration, context, data }?: ShowRewardAdOptions): Promise<{
66
- value: number;
67
- }>;
64
+ showRewardAd({ duration, context, data }?: ShowRewardAdOptions): Promise<RewardAdResult>;
68
65
  showBannerAd(adId: string, dimensions: AdTypes[]): Promise<void>;
69
66
  }
70
67
  export {};
@@ -3,22 +3,9 @@ import { createStore } from '../../utils/observable';
3
3
  import { RpcProvider } from '../../core/rpc';
4
4
  import { IHost } from '../host';
5
5
  import { PersistenceArena } from '../persistence';
6
+ import { UserProfile, AuthFormObserver, AuthStatusObserver } from './types';
6
7
 
7
- interface Image {
8
- png: string;
9
- webp: string;
10
- }
11
- interface UserProfile {
12
- uid: string;
13
- username: string;
14
- avatar: Image;
15
- avatarFrame?: Image;
16
- avatarBackground?: string;
17
- isUserSubscriber: boolean;
18
- aarpMembershipStatus?: boolean;
19
- coins?: number;
20
- level?: number;
21
- }
8
+ export type { UserProfile, UserProfileImage, AuthFormObserver, AuthStatusObserver } from './types';
22
9
  interface UserProfileReaderContract {
23
10
  authStatus: ReturnType<typeof createStore<boolean>>;
24
11
  isUserAuthorized(): Promise<boolean>;
@@ -29,7 +16,7 @@ interface AuthUIManagerContract {
29
16
  openAuthRequest: ReturnType<typeof createStore<boolean>>;
30
17
  openAuthForm(): Promise<void>;
31
18
  closeAuthForm(): Promise<void>;
32
- onOpenAuthForm(observer: any): void;
19
+ onOpenAuthForm(observer: AuthFormObserver): void;
33
20
  }
34
21
  export declare function getAvatarLink(avatarName: string, extension: string): string;
35
22
  interface UserIdentity {
@@ -47,10 +34,10 @@ export declare abstract class Auth {
47
34
  isUserAuthorized(): Promise<boolean>;
48
35
  getToken(): Promise<string | undefined>;
49
36
  abstract getUserProfile(): Promise<UserProfile | null>;
50
- onAuthStatusChange(observer: any): () => void;
37
+ onAuthStatusChange(observer: AuthStatusObserver): () => void;
51
38
  openAuthForm(): Promise<void>;
52
39
  closeAuthForm(): Promise<void>;
53
- onOpenAuthForm(observer: any): void | undefined;
40
+ onOpenAuthForm(observer: AuthFormObserver): void | undefined;
54
41
  getUserId(): Promise<string | undefined>;
55
42
  }
56
43
  export declare class AuthArena extends Auth {
@@ -71,4 +58,3 @@ export declare class AuthGame extends Auth {
71
58
  getUserProfile(): Promise<UserProfile | null>;
72
59
  getUserIdentity(): Promise<UserIdentity | undefined>;
73
60
  }
74
- export {};
@@ -0,0 +1,26 @@
1
+ import { ObserverFn } from '../../utils/observable';
2
+
3
+ /** Resolved avatar or frame asset URLs for png and webp. */
4
+ export interface UserProfileImage {
5
+ png: string;
6
+ webp: string;
7
+ }
8
+ /** User profile from `sdk.auth.getUserProfile()` (game-facing; not eagle-user-client `UserProfileDTO`). */
9
+ export interface UserProfile {
10
+ uid: string;
11
+ username: string;
12
+ avatar: UserProfileImage;
13
+ /** Eagle only */
14
+ avatarFrame?: UserProfileImage;
15
+ /** Eagle only */
16
+ avatarBackground?: string;
17
+ isUserSubscriber: boolean;
18
+ /** AARP only */
19
+ aarpMembershipStatus?: boolean;
20
+ /** AARP only */
21
+ coins?: number;
22
+ /** AARP only */
23
+ level?: number;
24
+ }
25
+ export declare type AuthFormObserver = ObserverFn<boolean>;
26
+ export declare type AuthStatusObserver = ObserverFn<boolean>;
@@ -1,5 +1,8 @@
1
+ import { HostArena } from '../host';
2
+
1
3
  export declare class ConfigArena {
2
- constructor();
4
+ private host;
5
+ constructor(host: HostArena);
3
6
  getProperty(propertyName: string): Promise<any>;
4
7
  }
5
8
  export declare class ConfigGame {
@@ -1,18 +1,5 @@
1
- interface Image {
2
- png: string;
3
- webp: string;
4
- }
5
- interface UserProfile {
6
- uid: string;
7
- username: string;
8
- avatar: Image;
9
- avatarFrame?: Image;
10
- avatarBackground?: string;
11
- isUserSubscriber: boolean;
12
- aarpMembershipStatus?: boolean;
13
- coins?: number;
14
- level?: number;
15
- }
1
+ import { UserProfile } from '../features/auth/types';
2
+
16
3
  export declare type MockUser = {
17
4
  profile: UserProfile;
18
5
  wallet: {
@@ -24,4 +11,3 @@ export declare function getMockUserEnabled(): boolean;
24
11
  export declare function setMockUserEnabled(enabled: boolean): void;
25
12
  export declare function getMockUser(): MockUser | undefined;
26
13
  export declare function setMockUser(user: MockUser): void;
27
- export {};
@@ -6,7 +6,7 @@ import { AnalyticsApiProxy } from './api/features/analytics/analytics.api';
6
6
  import { RpcProvider } from './api/core/rpc';
7
7
  import { TimeoutTesterContract } from './api/core/timeout-tester';
8
8
  import { PersistenceGame } from './api/features/persistence';
9
- import { Wallet, WalletGame } from './api/features/wallet';
9
+ import { WalletGame } from './api/features/wallet';
10
10
  import { HostGame } from './api/features/host';
11
11
  import { LeaderboardGame } from './api/features/leaderboard';
12
12
  import { TournamentsGame } from './api/features/tournaments';
@@ -28,7 +28,7 @@ export declare class ArkadiumGameSdk {
28
28
  analytics: AnalyticsApiProxy;
29
29
  private timeoutTester;
30
30
  persistence: PersistenceGame;
31
- wallet: Wallet;
31
+ wallet: WalletGame;
32
32
  leaderboard: LeaderboardGame;
33
33
  tournaments: TournamentsGame;
34
34
  logger: ILogger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.72.3",
3
+ "version": "2.73.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",