@arkadiuminc/sdk 2.15.1 → 2.16.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.
@@ -8,10 +8,12 @@ declare enum LifecycleEvent {
8
8
  GAME_END = 5,
9
9
  PAUSE_READY = 6,
10
10
  GAME_PAUSE = 7,
11
- GAME_RESUME = 8
11
+ GAME_RESUME = 8,
12
+ GEMS_UPDATE = 9
12
13
  }
13
14
  declare type LifecycleFn = (event: LifecycleEvent, payload?: any) => void;
14
15
  export interface GameLifecycleContract {
16
+ subscribe(fn: LifecycleFn): void;
15
17
  onTestReady(): Promise<void>;
16
18
  onPauseReady(): Promise<void>;
17
19
  onGamePause(): Promise<void>;
@@ -20,7 +22,7 @@ export interface GameLifecycleContract {
20
22
  onInteract(): Promise<void>;
21
23
  onChangeScore(score: number): Promise<void>;
22
24
  onGameEnd(): Promise<void>;
23
- subscribe(fn: LifecycleFn): void;
25
+ onGemsUpdate(): Promise<void>;
24
26
  }
25
27
  /** @hidden */
26
28
  export declare class GameLifecycle implements GameLifecycleContract {
@@ -28,15 +30,16 @@ export declare class GameLifecycle implements GameLifecycleContract {
28
30
  private subscribers;
29
31
  constructor(rpcProvider: RpcProvider);
30
32
  private processLifecycleEvent;
33
+ subscribe(cb: LifecycleFn): void;
31
34
  onTestReady(): Promise<void>;
32
35
  onGameStart(): Promise<void>;
33
36
  onInteract(): Promise<void>;
34
37
  onChangeScore(score: number): Promise<void>;
35
38
  onGameEnd(): Promise<void>;
36
- subscribe(cb: LifecycleFn): void;
37
39
  onGamePause(): Promise<void>;
38
40
  onGameResume(): Promise<void>;
39
41
  onPauseReady(): Promise<void>;
42
+ onGemsUpdate(): Promise<void>;
40
43
  }
41
44
  export declare class GameLifecycleProxy implements GameLifecycleContract {
42
45
  private rpcProvider;
@@ -54,5 +57,6 @@ export declare class GameLifecycleProxy implements GameLifecycleContract {
54
57
  onGamePause(): Promise<void>;
55
58
  onGameResume(): Promise<void>;
56
59
  onPauseReady(): Promise<void>;
60
+ onGemsUpdate(): Promise<void>;
57
61
  }
58
62
  export {};
@@ -1,4 +1,5 @@
1
1
  import { ApiEnv, Backend } from '../backend/backend.api';
2
+ import { GameLifecycleContract } from '../game-lifecycle/game-lifecycle.api';
2
3
 
3
4
  export interface Wallet {
4
5
  init(env: ApiEnv): Promise<void>;
@@ -7,10 +8,11 @@ export interface Wallet {
7
8
  }
8
9
  export declare class WalletGame implements Wallet {
9
10
  private backendApi;
11
+ private lifecycle;
10
12
  private virtualItemsApi;
11
13
  private virtualItemGateway;
12
14
  private currencySku;
13
- constructor(backendApi: Backend);
15
+ constructor(backendApi: Backend, lifecycle: GameLifecycleContract);
14
16
  init(env: ApiEnv): Promise<void>;
15
17
  /**
16
18
  * Allows querying for the wallet balance
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.15.1",
3
+ "version": "2.16.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",