@spawnco/sdk-types 0.0.23 → 0.0.24

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/index.d.mts CHANGED
@@ -219,7 +219,7 @@ interface LeaderboardEntry {
219
219
  isMe?: boolean;
220
220
  timestamp: number;
221
221
  }
222
- type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy' | 'inventory'>;
223
- type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'inventory' | 'room'>;
222
+ type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
223
+ type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;
224
224
 
225
225
  export type { InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, User };
package/dist/index.d.ts CHANGED
@@ -219,7 +219,7 @@ interface LeaderboardEntry {
219
219
  isMe?: boolean;
220
220
  timestamp: number;
221
221
  }
222
- type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy' | 'inventory'>;
223
- type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'inventory' | 'room'>;
222
+ type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
223
+ type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;
224
224
 
225
225
  export type { InventoryItem, Item, LeaderboardEntry, Room, RoomInfo, RoomVisibility, SpawnClientSDK__V0, SpawnClientSDK__V1, SpawnServerSDK__V0, SpawnServerSDK__V1, TokenPayload, User };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spawnco/sdk-types",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "TypeScript type definitions for Spawn SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/v1.ts CHANGED
@@ -118,46 +118,68 @@ export interface SpawnServerSDK__V1<TConfig = any> {
118
118
  inventory: {
119
119
  currencies: {
120
120
  // Credit currency (creates if doesn't exist)
121
- credit(userId: string, currency: string, amount: number, options?: {
122
- idempotencyKey?: string;
123
- reason?: string;
124
- }): Promise<{ newBalance: number }>;
125
-
121
+ credit(
122
+ userId: string,
123
+ currency: string,
124
+ amount: number,
125
+ options?: {
126
+ idempotencyKey?: string;
127
+ reason?: string;
128
+ }
129
+ ): Promise<{ newBalance: number }>;
130
+
126
131
  // Debit currency (returns false if insufficient)
127
- debit(userId: string, currency: string, amount: number, options?: {
128
- idempotencyKey?: string;
129
- reason?: string;
130
- }): Promise<{ success: boolean; newBalance?: number }>;
131
-
132
+ debit(
133
+ userId: string,
134
+ currency: string,
135
+ amount: number,
136
+ options?: {
137
+ idempotencyKey?: string;
138
+ reason?: string;
139
+ }
140
+ ): Promise<{ success: boolean; newBalance?: number }>;
141
+
132
142
  // Atomic multi-currency exchange
133
- exchange(userId: string, tx: {
134
- debit: Record<string, number>;
135
- credit: Record<string, number>;
136
- }, options?: {
137
- idempotencyKey?: string;
138
- reason?: string;
139
- }): Promise<{ success: boolean; balances?: Record<string, number> }>;
140
-
143
+ exchange(
144
+ userId: string,
145
+ tx: {
146
+ debit: Record<string, number>;
147
+ credit: Record<string, number>;
148
+ },
149
+ options?: {
150
+ idempotencyKey?: string;
151
+ reason?: string;
152
+ }
153
+ ): Promise<{ success: boolean; balances?: Record<string, number> }>;
154
+
141
155
  // Get user's balances
142
156
  get(userId: string): Promise<Record<string, number>>;
143
157
  };
144
158
 
145
159
  items: {
146
160
  // Grant items to user (returns instance IDs)
147
- grant(userId: string, items: Array<{
148
- itemId: string;
149
- data?: any;
150
- }>, options?: {
151
- idempotencyKey?: string;
152
- reason?: string;
153
- }): Promise<string[]>;
154
-
161
+ grant(
162
+ userId: string,
163
+ items: Array<{
164
+ itemId: string;
165
+ data?: any;
166
+ }>,
167
+ options?: {
168
+ idempotencyKey?: string;
169
+ reason?: string;
170
+ }
171
+ ): Promise<string[]>;
172
+
155
173
  // Consume an item by instance ID
156
- consume(userId: string, instanceId: string, options?: {
157
- idempotencyKey?: string;
158
- reason?: string;
159
- }): Promise<boolean>;
160
-
174
+ consume(
175
+ userId: string,
176
+ instanceId: string,
177
+ options?: {
178
+ idempotencyKey?: string;
179
+ reason?: string;
180
+ }
181
+ ): Promise<boolean>;
182
+
161
183
  // Get user's inventory
162
184
  list(userId: string): Promise<InventoryItem[]>;
163
185
  };
@@ -256,5 +278,5 @@ export interface LeaderboardEntry {
256
278
 
257
279
  // v0 sdk types for testing
258
280
 
259
- export type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy' | 'inventory'>;
260
- export type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'inventory' | 'room'>;
281
+ export type SpawnClientSDK__V0<TConfig = any> = Omit<SpawnClientSDK__V1<TConfig>, 'economy'>;
282
+ export type SpawnServerSDK__V0<TConfig = any> = Omit<SpawnServerSDK__V1<TConfig>, 'economy' | 'room'>;