@arkadiuminc/sdk 2.24.3 → 2.26.0
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.
- package/dist/pkg/api/features/ads/index.d.ts +3 -1
- package/dist/pkg/api/features/game-lifecycle/game-lifecycle.api.d.ts +11 -16
- package/dist/pkg/api/features/host/index.d.ts +3 -0
- package/dist/pkg/api/features/wallet/index.d.ts +2 -2
- package/dist/pkg/arkadium-arena-sdk.d.ts +4 -3
- package/dist/pkg/arkadium-game-sdk.d.ts +3 -3
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { RpcProvider } from '../../core/rpc';
|
|
|
2
2
|
import { ApiEnv } from '../backend/backend.api';
|
|
3
3
|
import { Auth } from '../auth/';
|
|
4
4
|
import { BannerAdOptions, AdTypes } from './display-ad';
|
|
5
|
+
import { GameLifecycleArena } from '../game-lifecycle/game-lifecycle.api';
|
|
5
6
|
|
|
6
7
|
/** @hidden */
|
|
7
8
|
export interface AdsArena extends Ads, AdsArenaBanner {
|
|
@@ -29,12 +30,13 @@ interface AdsGameBanner {
|
|
|
29
30
|
}
|
|
30
31
|
/** @hidden */
|
|
31
32
|
export declare class AdsArenaProvider implements AdsArena {
|
|
33
|
+
private lifecycle;
|
|
32
34
|
bannerSizes: typeof AdTypes;
|
|
33
35
|
private interstitial;
|
|
34
36
|
private rewarded;
|
|
35
37
|
private preroll;
|
|
36
38
|
private banner;
|
|
37
|
-
constructor(rpcProvider: RpcProvider, auth: Auth);
|
|
39
|
+
constructor(rpcProvider: RpcProvider, auth: Auth, lifecycle: GameLifecycleArena);
|
|
38
40
|
setVideoAdsDomain(domain: string): void;
|
|
39
41
|
setDisplayAdsDomain(domain: string): void;
|
|
40
42
|
showPrerollAd({ duration }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
2
|
|
|
3
|
-
declare enum LifecycleEvent {
|
|
3
|
+
export declare enum LifecycleEvent {
|
|
4
4
|
TEST_READY = 1,
|
|
5
5
|
GAME_START = 2,
|
|
6
6
|
INTERACT = 3,
|
|
@@ -12,24 +12,14 @@ declare enum LifecycleEvent {
|
|
|
12
12
|
GEMS_UPDATE = 9
|
|
13
13
|
}
|
|
14
14
|
declare type LifecycleFn = (event: LifecycleEvent, payload?: any) => void;
|
|
15
|
-
export interface GameLifecycleContract {
|
|
16
|
-
subscribe(fn: LifecycleFn): void;
|
|
17
|
-
onTestReady(): Promise<void>;
|
|
18
|
-
onPauseReady(): Promise<void>;
|
|
19
|
-
onGamePause(): Promise<void>;
|
|
20
|
-
onGameResume(): Promise<void>;
|
|
21
|
-
onGameStart(): Promise<void>;
|
|
22
|
-
onInteract(): Promise<void>;
|
|
23
|
-
onChangeScore(score: number): Promise<void>;
|
|
24
|
-
onGameEnd(): Promise<void>;
|
|
25
|
-
onGemsUpdate(): Promise<void>;
|
|
26
|
-
}
|
|
27
15
|
/** @hidden */
|
|
28
|
-
export declare class
|
|
16
|
+
export declare class GameLifecycleArena {
|
|
29
17
|
private rpcProvider;
|
|
30
18
|
private subscribers;
|
|
19
|
+
LifecycleEvent: typeof LifecycleEvent;
|
|
31
20
|
constructor(rpcProvider: RpcProvider);
|
|
32
|
-
|
|
21
|
+
onEvent(event: LifecycleEvent, payload?: any): void;
|
|
22
|
+
dispatchEvent(event: LifecycleEvent): Promise<void>;
|
|
33
23
|
subscribe(cb: LifecycleFn): void;
|
|
34
24
|
onTestReady(): Promise<void>;
|
|
35
25
|
onGameStart(): Promise<void>;
|
|
@@ -41,9 +31,13 @@ export declare class GameLifecycle implements GameLifecycleContract {
|
|
|
41
31
|
onPauseReady(): Promise<void>;
|
|
42
32
|
onGemsUpdate(): Promise<void>;
|
|
43
33
|
}
|
|
44
|
-
export declare class
|
|
34
|
+
export declare class GameLifecycleGame {
|
|
45
35
|
private rpcProvider;
|
|
36
|
+
private eventCallbacks;
|
|
37
|
+
LifecycleEvent: typeof LifecycleEvent;
|
|
46
38
|
constructor(rpcProvider: RpcProvider);
|
|
39
|
+
private onEvent;
|
|
40
|
+
dispatchEvent(event: LifecycleEvent, payload?: any): Promise<any>;
|
|
47
41
|
onTestReady(): Promise<void>;
|
|
48
42
|
onGameStart(): Promise<void>;
|
|
49
43
|
/** @hidden */
|
|
@@ -58,5 +52,6 @@ export declare class GameLifecycleProxy implements GameLifecycleContract {
|
|
|
58
52
|
onGameResume(): Promise<void>;
|
|
59
53
|
onPauseReady(): Promise<void>;
|
|
60
54
|
onGemsUpdate(): Promise<void>;
|
|
55
|
+
registerEventCallback(event: LifecycleEvent, callback: () => void): void;
|
|
61
56
|
}
|
|
62
57
|
export {};
|
|
@@ -10,6 +10,7 @@ export interface IHost {
|
|
|
10
10
|
openPurchaseForm(r: PurchaseRequest): Promise<void>;
|
|
11
11
|
onOpenPurchaseForm?(observer: any): any;
|
|
12
12
|
getArenaName(): Promise<string>;
|
|
13
|
+
getGameSDKUrl(): Promise<string>;
|
|
13
14
|
}
|
|
14
15
|
export declare type PurchaseRequest = {
|
|
15
16
|
type?: string;
|
|
@@ -45,6 +46,7 @@ export declare class HostArena implements IHost {
|
|
|
45
46
|
onOpenPurchaseForm(observer: any): () => void;
|
|
46
47
|
purchaseFormClosed(madePurchase: boolean): Promise<void>;
|
|
47
48
|
getArenaName(): Promise<string>;
|
|
49
|
+
getGameSDKUrl(): Promise<string>;
|
|
48
50
|
}
|
|
49
51
|
export declare class HostGame implements IHost {
|
|
50
52
|
private rpcProvider;
|
|
@@ -65,5 +67,6 @@ export declare class HostGame implements IHost {
|
|
|
65
67
|
onPurchaseFormStateChange(observer: any): () => void;
|
|
66
68
|
private purchaseFormClosed;
|
|
67
69
|
getArenaName(): Promise<string>;
|
|
70
|
+
getGameSDKUrl(): Promise<string>;
|
|
68
71
|
}
|
|
69
72
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiEnv, Backend } from '../backend/backend.api';
|
|
2
|
-
import {
|
|
2
|
+
import { GameLifecycleArena } from '../game-lifecycle/game-lifecycle.api';
|
|
3
3
|
import { RpcProvider } from '../../core/rpc';
|
|
4
4
|
|
|
5
5
|
export interface Wallet {
|
|
@@ -14,7 +14,7 @@ export declare class WalletArena implements Wallet {
|
|
|
14
14
|
private virtualItemGateway;
|
|
15
15
|
private currencySku;
|
|
16
16
|
private isInited;
|
|
17
|
-
constructor(backendApi: Backend, lifecycle:
|
|
17
|
+
constructor(backendApi: Backend, lifecycle: GameLifecycleArena, rpcProvider: RpcProvider);
|
|
18
18
|
init(env: ApiEnv): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Allows querying for the wallet balance
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiEnv, Backend, SessionStorageType } from './api/features/backend/backend.api';
|
|
2
|
-
import {
|
|
2
|
+
import { GameLifecycleArena } from './api/features/game-lifecycle/game-lifecycle.api';
|
|
3
3
|
import { RpcProvider } from './api/core/rpc';
|
|
4
4
|
import { AdsArena } from './api/features/ads/';
|
|
5
5
|
import { AuthArena } from './api/features/auth/';
|
|
@@ -17,7 +17,7 @@ export declare class ArkadiumArenaSdk {
|
|
|
17
17
|
private rpcProvider;
|
|
18
18
|
backendApi: Backend;
|
|
19
19
|
host: HostArena;
|
|
20
|
-
lifecycle:
|
|
20
|
+
lifecycle: GameLifecycleArena;
|
|
21
21
|
ads: AdsArena;
|
|
22
22
|
auth: AuthArena;
|
|
23
23
|
analytics: AnalyticsApiContract;
|
|
@@ -31,7 +31,7 @@ export declare class ArkadiumArenaSdk {
|
|
|
31
31
|
private gamePingListener;
|
|
32
32
|
$pingNotification: Observable<number>;
|
|
33
33
|
version: string;
|
|
34
|
-
constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostArena, lifecycle:
|
|
34
|
+
constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostArena, lifecycle: GameLifecycleArena, ads: AdsArena, auth: AuthArena, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract, persistence: PersistenceArena, wallet: WalletArena, debug: DebugProviderArena);
|
|
35
35
|
setEnv(e: ApiEnv): void;
|
|
36
36
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
37
37
|
private envDiscoverListener;
|
|
@@ -48,6 +48,7 @@ export { ApiEnv };
|
|
|
48
48
|
/** @hidden */
|
|
49
49
|
export declare class ArenaApi {
|
|
50
50
|
static version: string;
|
|
51
|
+
static ApiEnv: typeof ApiEnv;
|
|
51
52
|
private static sdk;
|
|
52
53
|
static onGameSDKLoaded(target: any, callback: any, env?: ApiEnv): void;
|
|
53
54
|
static dispose(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiEnv, Backend } from './api/features/backend/backend.api';
|
|
2
|
-
import {
|
|
2
|
+
import { GameLifecycleGame } from './api/features/game-lifecycle/game-lifecycle.api';
|
|
3
3
|
import { AdsGame } from './api/features/ads/';
|
|
4
4
|
import { AuthGame } from './api/features/auth/';
|
|
5
5
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
@@ -17,7 +17,7 @@ export declare class ArkadiumGameSdk {
|
|
|
17
17
|
private rpcProvider;
|
|
18
18
|
private backendApi;
|
|
19
19
|
host: HostGame;
|
|
20
|
-
lifecycle:
|
|
20
|
+
lifecycle: GameLifecycleGame;
|
|
21
21
|
ads: AdsGame;
|
|
22
22
|
auth: AuthGame;
|
|
23
23
|
analytics: AnalyticsApiContract;
|
|
@@ -28,7 +28,7 @@ export declare class ArkadiumGameSdk {
|
|
|
28
28
|
rpcProvider: RpcProvider;
|
|
29
29
|
backendApi: Backend;
|
|
30
30
|
host: HostGame;
|
|
31
|
-
lifecycle:
|
|
31
|
+
lifecycle: GameLifecycleGame;
|
|
32
32
|
ads: AdsGame;
|
|
33
33
|
auth: AuthGame;
|
|
34
34
|
analytics: AnalyticsApiContract;
|