@arkadiuminc/sdk 2.14.0 → 2.15.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.
package/README.md CHANGED
@@ -33,7 +33,6 @@ main();
33
33
 
34
34
  - Analytics
35
35
  - [App Insights](TODO)
36
- - [Google Tag manager](TODO)
37
36
  - [Standardized Spec for every game](https://arkadium.atlassian.net/wiki/spaces/DepartmentBusinessOperations/pages/23675756/Standardized+Spec+for+every+game+-+GA+AppInsights)
38
37
  - [AppInsight stamper](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23993424/AppInsight+stamper)
39
38
  - [Adaptive Sampling Implementation](https://arkadium.atlassian.net/wiki/spaces/PhoenixGames/pages/23897949/Adaptive+Sampling+Implementation)
@@ -34,11 +34,12 @@ export declare class PersistenceGame implements IPersistence {
34
34
  */
35
35
  constructor(rpcProvider: RpcProvider, host: IHost, backend: Backend);
36
36
  getCookie(cookieName: string): Promise<string>;
37
+ private getPrefixedLocalStorageKey;
37
38
  getLocalStorageItem(key: string): Promise<string | null>;
38
39
  setLocalStorageItem(key: string, value: string): Promise<void>;
39
40
  removeLocalStorageItem(key: string): Promise<void>;
40
41
  private getCollection;
41
- private getRemoteToLocalStorageCollection;
42
+ private getRemoteToLocalStorageKey;
42
43
  private isRemoteStorageBlacklisted;
43
44
  getRemoteStorageItem(key: string): Promise<RemoteStorageValueType | null>;
44
45
  setRemoteStorageItem(key: string, value: RemoteStorageValueType): Promise<void>;
@@ -0,0 +1,26 @@
1
+ import { ApiEnv, Backend } from '../backend/backend.api';
2
+
3
+ export interface Wallet {
4
+ init(env: ApiEnv): Promise<void>;
5
+ getGems(): Promise<number>;
6
+ consumeGems(amount: number): Promise<boolean>;
7
+ }
8
+ export declare class WalletGame implements Wallet {
9
+ private backendApi;
10
+ private virtualItemsApi;
11
+ private virtualItemGateway;
12
+ private currencySku;
13
+ constructor(backendApi: Backend);
14
+ init(env: ApiEnv): Promise<void>;
15
+ /**
16
+ * Allows querying for the wallet balance
17
+ * @returns the amount of gems in the user wallet
18
+ */
19
+ getGems(): Promise<number>;
20
+ /**
21
+ * Consumes the desired amount of gems from the user wallet
22
+ * @param amount
23
+ * @returns true if the spending of the gem amount was successful, false otherwise
24
+ */
25
+ consumeGems(amount: number): Promise<boolean>;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -6,6 +6,7 @@ import { AnalyticsApiContract } 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
10
  import { HostGame } from './api/features/host';
10
11
 
11
12
  export declare class ArkadiumGameSdk {
@@ -22,7 +23,8 @@ export declare class ArkadiumGameSdk {
22
23
  analytics: AnalyticsApiContract;
23
24
  private timeoutTester;
24
25
  persistence: PersistenceGame;
25
- constructor({ rpcProvider, backendApi, host, lifecycle, ads, auth, analytics, timeoutTester, persistence }: {
26
+ wallet: Wallet;
27
+ constructor({ rpcProvider, backendApi, host, lifecycle, ads, auth, analytics, timeoutTester, persistence, wallet }: {
26
28
  rpcProvider: RpcProvider;
27
29
  backendApi: Backend;
28
30
  host: HostGame;
@@ -32,6 +34,7 @@ export declare class ArkadiumGameSdk {
32
34
  analytics: AnalyticsApiContract;
33
35
  timeoutTester: TimeoutTesterContract;
34
36
  persistence: PersistenceGame;
37
+ wallet: WalletGame;
35
38
  });
36
39
  initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
37
40
  getEnv(): ApiEnv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.14.0",
3
+ "version": "2.15.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",
@@ -62,6 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@arkadium/eagle-payments-api-client": "^0.0.35",
65
+ "@arkadium/eagle-virtual-items-api-client": "^0.1.3",
65
66
  "@arkadium/eagle-user-client": "^0.0.90",
66
67
  "@commitlint/cli": "^17.8.1",
67
68
  "@commitlint/config-conventional": "^17.8.1",