@arkadiuminc/sdk 2.57.0 → 2.58.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.
@@ -2,11 +2,38 @@ import { ApiEnv, Backend } from '../backend/backend.api';
2
2
  import { ApiSet as VirtualItemApi } from '@arkadium/eagle-virtual-items-api-client';
3
3
  import { GameLifecycleArena } from '../game-lifecycle/game-lifecycle.api';
4
4
  import { RpcProvider } from '../../core/rpc';
5
+ import { IHost } from '../host';
5
6
 
7
+ export declare type Item = {
8
+ sku: string;
9
+ amount: number;
10
+ };
11
+ export declare type Items = {
12
+ [sku: string]: Item;
13
+ };
14
+ export declare type Bundle = {
15
+ sku: string;
16
+ price: number;
17
+ salesPrice: number;
18
+ salesEndDate: string;
19
+ isSalesActive: boolean;
20
+ contents: Item[];
21
+ };
22
+ export declare type Bundles = {
23
+ [sku: string]: Bundle;
24
+ };
6
25
  export interface Wallet {
7
26
  init?(env: ApiEnv): Promise<void>;
8
27
  getGems(): Promise<number>;
9
28
  consumeGems(amount: number): Promise<boolean>;
29
+ getBundles(): Promise<Bundles>;
30
+ purchaseBundle(bundleSku: string, amount: number): Promise<boolean>;
31
+ getCatalog(): Promise<Items>;
32
+ grantCatalogItem(itemSku: string, amount: number): Promise<boolean>;
33
+ getInventory(): Promise<Items>;
34
+ getInventoryItemAmount(sku: string): Promise<number>;
35
+ consumeInventoryItem(sku: string, amount: number): Promise<boolean>;
36
+ hasInventoryItem(sku: string, amount: number): Promise<boolean>;
10
37
  }
11
38
  export interface VirtualItemsApiProvider {
12
39
  getVirtualItemsApi(): VirtualItemApi;
@@ -14,12 +41,14 @@ export interface VirtualItemsApiProvider {
14
41
  export declare class WalletArena implements Wallet, VirtualItemsApiProvider {
15
42
  private backendApi;
16
43
  private lifecycle;
44
+ private host;
17
45
  private virtualItemsApi;
18
46
  private virtualItemGateway;
19
47
  private currencySku;
20
48
  private isInited;
21
49
  private _isGemsSupported;
22
- constructor(backendApi: Backend, lifecycle: GameLifecycleArena, rpcProvider: RpcProvider);
50
+ private _cachedBundles;
51
+ constructor(backendApi: Backend, lifecycle: GameLifecycleArena, rpcProvider: RpcProvider, host: IHost);
23
52
  getVirtualItemsApi(): VirtualItemApi;
24
53
  init(env: ApiEnv): Promise<void>;
25
54
  setGemsSupported(isSupported: boolean): void;
@@ -35,6 +64,14 @@ export declare class WalletArena implements Wallet, VirtualItemsApiProvider {
35
64
  * @returns true if the spending of the gem amount was successful, false otherwise
36
65
  */
37
66
  consumeGems(amount: number): Promise<boolean>;
67
+ getBundles(): Promise<Bundles>;
68
+ purchaseBundle(bundleSku: string, amount?: number): Promise<boolean>;
69
+ getCatalog(): Promise<Items>;
70
+ grantCatalogItem(itemSku: string, amount?: number): Promise<boolean>;
71
+ getInventory(): Promise<Items>;
72
+ getInventoryItemAmount(sku: string): Promise<number>;
73
+ consumeInventoryItem(sku: string, amount?: number): Promise<boolean>;
74
+ hasInventoryItem(sku: string, amount?: number): Promise<boolean>;
38
75
  }
39
76
  export declare class WalletGame implements Wallet {
40
77
  private rpcProvider;
@@ -51,4 +88,12 @@ export declare class WalletGame implements Wallet {
51
88
  */
52
89
  consumeGems(amount: number): Promise<boolean>;
53
90
  isGemsSupported(): Promise<boolean>;
91
+ getBundles(): Promise<Bundles>;
92
+ purchaseBundle(bundleSku: string, amount?: number): Promise<boolean>;
93
+ getCatalog(): Promise<Items>;
94
+ grantCatalogItem(itemSku: string, amount?: number): Promise<boolean>;
95
+ getInventory(): Promise<Items>;
96
+ getInventoryItemAmount(sku: string): Promise<number>;
97
+ consumeInventoryItem(sku: string, amount?: number): Promise<boolean>;
98
+ hasInventoryItem(sku: string, amount?: number): Promise<boolean>;
54
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.57.0",
3
+ "version": "2.58.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",