@stackedapp/types 1.5.10 → 1.5.11
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/stacked-types.d.ts +25 -19
- package/package.json +1 -1
package/dist/stacked-types.d.ts
CHANGED
|
@@ -557,6 +557,10 @@ type Restriction = {
|
|
|
557
557
|
eventCount: number;
|
|
558
558
|
message?: string;
|
|
559
559
|
};
|
|
560
|
+
type IUserCryptoWallet = {
|
|
561
|
+
address: string;
|
|
562
|
+
createdAt?: number;
|
|
563
|
+
};
|
|
560
564
|
interface IUser {
|
|
561
565
|
_id: Stringable;
|
|
562
566
|
deleted?: boolean;
|
|
@@ -571,10 +575,7 @@ interface IUser {
|
|
|
571
575
|
/** last push generic notification to come back into the app */
|
|
572
576
|
lastPushedGeneric?: number;
|
|
573
577
|
};
|
|
574
|
-
cryptoWallets?: Array<
|
|
575
|
-
address: string;
|
|
576
|
-
createdAt: number;
|
|
577
|
-
}>;
|
|
578
|
+
cryptoWallets?: Array<IUserCryptoWallet>;
|
|
578
579
|
rewardWallets?: Array<{
|
|
579
580
|
address: string;
|
|
580
581
|
createdAt: number;
|
|
@@ -726,7 +727,7 @@ type Nullable<T> = {
|
|
|
726
727
|
/** this is the Stacked platforms' copy of a user/entity's snapshot for the current app/game */
|
|
727
728
|
type StackedSnapshot = Nullable<Pick<IPlayerSnapshot, '_id' | 'gameId' | 'playerId' | 'unifiedUserLinkedAt' | 'unifiedUserUnlinkedAt' | 'referredById' | 'username' | 'snapshotLastUpdated' | 'offersLastChecked' | 'daysInGame' | 'loginStreak' | 'daysInGameLastUpdated' | 'dateSignedUp' | 'dynamic' | 'stakedTokens' | 'currencies' | 'levels' | 'quests' | 'trustScore' | 'trustLastUpdated' | 'achievements' | 'memberships' | 'cryptoWallets' | 'identifiers' | 'entityKind' | 'entityLinks'>>;
|
|
728
729
|
/** represents a stacked snapshot's data within a specific app/game. This is scoped to the app/game! */
|
|
729
|
-
type
|
|
730
|
+
type StackedEntityData = Pick<IPlayerData, 'gameId' | 'playerId' | 'currencies'>;
|
|
730
731
|
|
|
731
732
|
type StackedCompletionConditions = ICompletionCondition;
|
|
732
733
|
/** Stripped sibling offer data for client rendering */
|
|
@@ -769,27 +770,32 @@ interface StackedReward extends IReward {
|
|
|
769
770
|
type StackedBaseUser = Pick<IUser, 'appConnections' | 'providers'>;
|
|
770
771
|
/** extra data populated into a stacked web/mobile app user */
|
|
771
772
|
interface StackedBaseUserExtra {
|
|
772
|
-
cryptoWallets?: Array<{
|
|
773
|
-
address: string;
|
|
773
|
+
cryptoWallets?: Array<IUserCryptoWallet & {
|
|
774
774
|
balances: Record<string, number>;
|
|
775
775
|
}>;
|
|
776
776
|
}
|
|
777
|
-
type StackedUser = StackedBaseUser & StackedBaseUserExtra
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
777
|
+
type StackedUser = StackedBaseUser & StackedBaseUserExtra;
|
|
778
|
+
/** This user's app connection data which is a snapshot of their profile in your app, plus the stacked platform's data (like stacked points, etc) */
|
|
779
|
+
type StackedAppConnection = {
|
|
780
|
+
snapshot: StackedSnapshot;
|
|
781
|
+
stackedData: StackedEntityData;
|
|
781
782
|
};
|
|
782
|
-
/**
|
|
783
|
-
type IClientPlayerData = StackedSnapshotData;
|
|
783
|
+
/** Returned alongside offers when fetching a specific user/player's offers */
|
|
784
784
|
type StackedUserResponse = {
|
|
785
|
-
/** @deprecated use
|
|
785
|
+
/** @deprecated use stackedData instead */
|
|
786
786
|
data?: IClientPlayerData | null;
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
787
|
+
user?: StackedUser;
|
|
788
|
+
} & StackedAppConnection;
|
|
789
|
+
/** @deprecated - old way of getting a specific game player's currencies in stacked */
|
|
790
|
+
type IClientPlayerData = StackedEntityData;
|
|
791
|
+
/** Stacked mobile web app's initialize user response */
|
|
792
|
+
interface StackedUserWithAppConnections {
|
|
790
793
|
user: StackedUser;
|
|
791
|
-
|
|
794
|
+
apps: {
|
|
795
|
+
[appId: string]: StackedAppConnection;
|
|
796
|
+
};
|
|
797
|
+
}
|
|
792
798
|
|
|
793
799
|
type StackedEnv = IEnv;
|
|
794
800
|
|
|
795
|
-
export type { IClientPlayerData, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCompletionConditions, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot,
|
|
801
|
+
export type { IClientPlayerData, StackedAppConnection, StackedBaseOffer, StackedBaseUser, StackedBaseUserExtra, StackedCompletionConditions, StackedEntityData, StackedEnv, StackedOffer, StackedReward, StackedRewardKind, StackedSnapshot, StackedSnapshotProgress, StackedUser, StackedUserOffer, StackedUserResponse, StackedUserWithAppConnections, UserOfferStatus };
|