@pixels-online/pixels-client-js-sdk 1.14.0 → 1.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.
- package/dist/core/OfferwallClient.d.ts +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +531 -73
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +533 -72
- package/dist/index.js.map +1 -1
- package/dist/offerwall-sdk.umd.js +533 -72
- package/dist/offerwall-sdk.umd.js.map +1 -1
- package/dist/types/blockchain/user_wallet.d.ts +20 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/linking.d.ts +17 -0
- package/dist/types/offer.d.ts +140 -21
- package/dist/types/player.d.ts +132 -32
- package/dist/types/reward.d.ts +10 -9
- package/dist/utils/conditions.d.ts +31 -3
- package/dist/utils/template.d.ts +2 -0
- package/package.json +2 -1
|
@@ -5,6 +5,7 @@ import { OfferwallConfig } from '../types/index';
|
|
|
5
5
|
import { IClientOffer } from '../types/offer';
|
|
6
6
|
import { ConnectionState } from '../types/connection';
|
|
7
7
|
import { IClientPlayer } from '../types/player';
|
|
8
|
+
import { StackedLinkResult } from '../types/linking';
|
|
8
9
|
export declare const mapEnvToOfferClientUrl: (env: "test" | "live" | (string & {})) => "https://offers.pixels.xyz" | "https://offers.sandbox.pixels.xyz" | "https://offers.staging.pixels.xyz" | "https://offers.preview.pixels.xyz" | "https://offers.dev.pixels.xyz";
|
|
9
10
|
export declare class OfferwallClient {
|
|
10
11
|
private config;
|
|
@@ -17,7 +18,9 @@ export declare class OfferwallClient {
|
|
|
17
18
|
private hooks;
|
|
18
19
|
private logger;
|
|
19
20
|
private isInitializing;
|
|
21
|
+
private pendingStackedToken;
|
|
20
22
|
constructor(config: OfferwallConfig);
|
|
23
|
+
private setupStackedLinkDetection;
|
|
21
24
|
/**
|
|
22
25
|
* Get the offer store instance
|
|
23
26
|
*/
|
|
@@ -67,5 +70,30 @@ export declare class OfferwallClient {
|
|
|
67
70
|
getAuthLinkToken(): Promise<string>;
|
|
68
71
|
getGameId(): string | null;
|
|
69
72
|
getDashboardRedirectUrl(): Promise<string | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Detect if there's a Stacked link token in the current URL
|
|
75
|
+
* @returns The token string if found, null otherwise
|
|
76
|
+
*/
|
|
77
|
+
detectStackedLinkToken(): string | null;
|
|
78
|
+
/**
|
|
79
|
+
* Clear the stackedToken from the URL without page reload
|
|
80
|
+
*/
|
|
81
|
+
private clearStackedTokenFromUrl;
|
|
82
|
+
/**
|
|
83
|
+
* Consume a Stacked link token to link the current game player
|
|
84
|
+
* to a Stacked unified user account.
|
|
85
|
+
*
|
|
86
|
+
* IMPORTANT: The player must be authenticated (have a valid JWT from tokenProvider)
|
|
87
|
+
* before calling this method.
|
|
88
|
+
*
|
|
89
|
+
* @param token The Stacked link token from the URL
|
|
90
|
+
* @returns Promise resolving to the link result
|
|
91
|
+
*/
|
|
92
|
+
consumeStackedLinkToken(token: string): Promise<StackedLinkResult>;
|
|
93
|
+
/**
|
|
94
|
+
* Detects the token from URL, consumes it if player is authenticated.
|
|
95
|
+
* @returns Promise resolving to the link result, or null if no token found
|
|
96
|
+
*/
|
|
97
|
+
processStackedLinkToken(): Promise<StackedLinkResult | null>;
|
|
70
98
|
private handleError;
|
|
71
99
|
}
|
package/dist/index.d.ts
CHANGED