@tinyburg/treasury-sdk 0.0.0-stage → 0.2.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/LICENSE +674 -0
- package/README.md +4 -2
- package/dist/Scopes.d.ts +53 -0
- package/dist/Scopes.d.ts.map +1 -0
- package/dist/Scopes.js +54 -0
- package/dist/Scopes.js.map +1 -0
- package/dist/Sdk.d.ts +1264 -0
- package/dist/Sdk.d.ts.map +1 -0
- package/dist/Sdk.js +328 -0
- package/dist/Sdk.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -3
- package/src/Scopes.ts +70 -0
- package/src/Sdk.ts +387 -0
- package/src/index.ts +52 -0
package/dist/Sdk.d.ts
ADDED
|
@@ -0,0 +1,1264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The api the treasury serves: player-to-player trades, escrowed.
|
|
3
|
+
*
|
|
4
|
+
* Nimblebit has no hold primitive, so the treasury makes one out of the gift
|
|
5
|
+
* channel: each side's item is sent to a treasury-owned vault tower, where it
|
|
6
|
+
* sits as an *unreceived* gift - a native escrow slot - until both deposits
|
|
7
|
+
* are verified, and only then is each item forwarded to the other side. A
|
|
8
|
+
* save-splice trade instead rewrites both saves directly, which is why it
|
|
9
|
+
* requires an explicit confirmation from both parties before anything runs.
|
|
10
|
+
*
|
|
11
|
+
* Every endpoint but the public stats is bearer authenticated with a JWT
|
|
12
|
+
* access token the Tinyburg OAuth server issued for the Tinyburg api
|
|
13
|
+
* (`<site>/v1`), and guarded by a leaf of the `treasury` scope area in
|
|
14
|
+
* `Scopes`. The treasury lives behind tinyburg.app: the paths here are
|
|
15
|
+
* reached at `<site>/v1/treasury/*`, which tinyburg.app forwards verbatim,
|
|
16
|
+
* `Authorization` header included. The first-party app gets its token from
|
|
17
|
+
* tinyburg.app's `/auth/token`; any other application uses the one it was
|
|
18
|
+
* issued.
|
|
19
|
+
*
|
|
20
|
+
* A token without the endpoint's scope is refused with `403` and an
|
|
21
|
+
* `insufficient_scope` challenge. Any other `403` from a trade endpoint
|
|
22
|
+
* means the treasury holds no usable grant for the caller's towers;
|
|
23
|
+
* `GrantStatus` says so explicitly and carries the url that starts the
|
|
24
|
+
* connect flow.
|
|
25
|
+
*
|
|
26
|
+
* @since 1.0.0
|
|
27
|
+
*/
|
|
28
|
+
import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/http-api";
|
|
29
|
+
import * as Schema from "effect/Schema";
|
|
30
|
+
import * as OAuthScope from "@yielded/auth/OAuthScope";
|
|
31
|
+
/**
|
|
32
|
+
* How a trade moves its items. `gift` rides Nimblebit's gift channel through
|
|
33
|
+
* the vault; `splice` rewrites both saves and can carry what the gift channel
|
|
34
|
+
* cannot (costumes, pets, coins, bux).
|
|
35
|
+
*
|
|
36
|
+
* @since 1.0.0
|
|
37
|
+
* @category Schemas
|
|
38
|
+
*/
|
|
39
|
+
export declare const TradeMechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
40
|
+
/**
|
|
41
|
+
* The games the treasury trades in. TinyTower only, until the tinyburg api
|
|
42
|
+
* serves more.
|
|
43
|
+
*
|
|
44
|
+
* @since 1.0.0
|
|
45
|
+
* @category Schemas
|
|
46
|
+
*/
|
|
47
|
+
export declare const TradeGame: Schema.Literals<readonly ["tinytower"]>;
|
|
48
|
+
/**
|
|
49
|
+
* Where a trade is in its life. The happy path is `proposed` → `accepted` →
|
|
50
|
+
* (`awaiting_confirmation`, splice only) → `escrowing` → `escrowed` →
|
|
51
|
+
* `releasing` (gift) or `executing` (splice) → `settled`; everything else is
|
|
52
|
+
* one of the ways out.
|
|
53
|
+
*
|
|
54
|
+
* @since 1.0.0
|
|
55
|
+
* @category Schemas
|
|
56
|
+
*/
|
|
57
|
+
export declare const TradeState: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
58
|
+
/**
|
|
59
|
+
* One side of a gift trade's journey through the vault: `pending` → `sent`
|
|
60
|
+
* (deposit dispatched) → `verified` (seen in the vault's gift queue) →
|
|
61
|
+
* `released` (forwarded to the counterparty) → `settled` (vault slot
|
|
62
|
+
* claimed); refunds run `refund_sent` → `refunded`, and `lost` is a deposit
|
|
63
|
+
* that never arrived.
|
|
64
|
+
*
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
* @category Schemas
|
|
67
|
+
*/
|
|
68
|
+
export declare const LegState: Schema.Literals<readonly ["pending", "sent", "verified", "released", "settled", "refund_sent", "refunded", "lost"]>;
|
|
69
|
+
/**
|
|
70
|
+
* @since 1.0.0
|
|
71
|
+
* @category Schemas
|
|
72
|
+
*/
|
|
73
|
+
export declare const TradeRole: Schema.Literals<readonly ["proposer", "counterparty"]>;
|
|
74
|
+
/**
|
|
75
|
+
* One item offered over the gift channel, in the encoded form the game
|
|
76
|
+
* exchanges items in - the same string `SendItem` carries.
|
|
77
|
+
*
|
|
78
|
+
* @since 1.0.0
|
|
79
|
+
* @category Schemas
|
|
80
|
+
*/
|
|
81
|
+
export declare const GiftItem: Schema.Struct<{
|
|
82
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
83
|
+
readonly itemType: Schema.Enum<{
|
|
84
|
+
readonly None: "None";
|
|
85
|
+
readonly Play: "Play";
|
|
86
|
+
readonly Gift: "Gift";
|
|
87
|
+
readonly Cloud: "Cloud";
|
|
88
|
+
readonly Raffle: "Raffle";
|
|
89
|
+
readonly Visit: "Visit";
|
|
90
|
+
readonly Leaderboards: "Leaderboards";
|
|
91
|
+
}>;
|
|
92
|
+
readonly item: Schema.String;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* One item offered by splice. Bitizens, costumes and pets carry the encoded
|
|
96
|
+
* string a save stores them as; coins and bux carry an amount instead.
|
|
97
|
+
*
|
|
98
|
+
* @since 1.0.0
|
|
99
|
+
* @category Schemas
|
|
100
|
+
*/
|
|
101
|
+
export declare const SpliceItem: Schema.Struct<{
|
|
102
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
103
|
+
readonly item: Schema.optional<Schema.String>;
|
|
104
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* @since 1.0.0
|
|
108
|
+
* @category Schemas
|
|
109
|
+
*/
|
|
110
|
+
export declare const SpliceItems: Schema.Struct<{
|
|
111
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
112
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
113
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
114
|
+
readonly item: Schema.optional<Schema.String>;
|
|
115
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
116
|
+
}>>;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* What one side of a trade puts in: a gift-channel item or a list of splice
|
|
120
|
+
* items, matching the trade's mechanism.
|
|
121
|
+
*
|
|
122
|
+
* @since 1.0.0
|
|
123
|
+
* @category Schemas
|
|
124
|
+
*/
|
|
125
|
+
export declare const ItemSpec: Schema.Union<readonly [Schema.Struct<{
|
|
126
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
127
|
+
readonly itemType: Schema.Enum<{
|
|
128
|
+
readonly None: "None";
|
|
129
|
+
readonly Play: "Play";
|
|
130
|
+
readonly Gift: "Gift";
|
|
131
|
+
readonly Cloud: "Cloud";
|
|
132
|
+
readonly Raffle: "Raffle";
|
|
133
|
+
readonly Visit: "Visit";
|
|
134
|
+
readonly Leaderboards: "Leaderboards";
|
|
135
|
+
}>;
|
|
136
|
+
readonly item: Schema.String;
|
|
137
|
+
}>, Schema.Struct<{
|
|
138
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
139
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
140
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
141
|
+
readonly item: Schema.optional<Schema.String>;
|
|
142
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
143
|
+
}>>;
|
|
144
|
+
}>]>;
|
|
145
|
+
/**
|
|
146
|
+
* A trade as the api describes it. `gives` and `wants` are always from the
|
|
147
|
+
* proposer's point of view; `role` is which side the caller is on, absent for
|
|
148
|
+
* an open offer the caller could accept.
|
|
149
|
+
*
|
|
150
|
+
* @since 1.0.0
|
|
151
|
+
* @category Schemas
|
|
152
|
+
*/
|
|
153
|
+
export declare const Trade: Schema.Struct<{
|
|
154
|
+
readonly id: Schema.String;
|
|
155
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
156
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
157
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
158
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
159
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
160
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
161
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
162
|
+
readonly itemType: Schema.Enum<{
|
|
163
|
+
readonly None: "None";
|
|
164
|
+
readonly Play: "Play";
|
|
165
|
+
readonly Gift: "Gift";
|
|
166
|
+
readonly Cloud: "Cloud";
|
|
167
|
+
readonly Raffle: "Raffle";
|
|
168
|
+
readonly Visit: "Visit";
|
|
169
|
+
readonly Leaderboards: "Leaderboards";
|
|
170
|
+
}>;
|
|
171
|
+
readonly item: Schema.String;
|
|
172
|
+
}>, Schema.Struct<{
|
|
173
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
174
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
175
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
176
|
+
readonly item: Schema.optional<Schema.String>;
|
|
177
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
178
|
+
}>>;
|
|
179
|
+
}>]>;
|
|
180
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
181
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
182
|
+
readonly itemType: Schema.Enum<{
|
|
183
|
+
readonly None: "None";
|
|
184
|
+
readonly Play: "Play";
|
|
185
|
+
readonly Gift: "Gift";
|
|
186
|
+
readonly Cloud: "Cloud";
|
|
187
|
+
readonly Raffle: "Raffle";
|
|
188
|
+
readonly Visit: "Visit";
|
|
189
|
+
readonly Leaderboards: "Leaderboards";
|
|
190
|
+
}>;
|
|
191
|
+
readonly item: Schema.String;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
194
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
195
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
196
|
+
readonly item: Schema.optional<Schema.String>;
|
|
197
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
198
|
+
}>>;
|
|
199
|
+
}>]>;
|
|
200
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
201
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
202
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
203
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
204
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
205
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
206
|
+
}>;
|
|
207
|
+
/**
|
|
208
|
+
* @since 1.0.0
|
|
209
|
+
* @category Schemas
|
|
210
|
+
*/
|
|
211
|
+
export declare const TradeLeg: Schema.Struct<{
|
|
212
|
+
readonly role: Schema.Literals<readonly ["proposer", "counterparty"]>;
|
|
213
|
+
readonly fromPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
214
|
+
readonly toPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
215
|
+
readonly state: Schema.Literals<readonly ["pending", "sent", "verified", "released", "settled", "refund_sent", "refunded", "lost"]>;
|
|
216
|
+
readonly itemType: Schema.Enum<{
|
|
217
|
+
readonly None: "None";
|
|
218
|
+
readonly Play: "Play";
|
|
219
|
+
readonly Gift: "Gift";
|
|
220
|
+
readonly Cloud: "Cloud";
|
|
221
|
+
readonly Raffle: "Raffle";
|
|
222
|
+
readonly Visit: "Visit";
|
|
223
|
+
readonly Leaderboards: "Leaderboards";
|
|
224
|
+
}>;
|
|
225
|
+
readonly item: Schema.String;
|
|
226
|
+
}>;
|
|
227
|
+
/**
|
|
228
|
+
* One entry of a trade's append-only history, as shown on its timeline.
|
|
229
|
+
*
|
|
230
|
+
* @since 1.0.0
|
|
231
|
+
* @category Schemas
|
|
232
|
+
*/
|
|
233
|
+
export declare const LedgerEvent: Schema.Struct<{
|
|
234
|
+
readonly event: Schema.String;
|
|
235
|
+
readonly at: Schema.DateTimeUtcFromString;
|
|
236
|
+
}>;
|
|
237
|
+
/**
|
|
238
|
+
* A trade with its legs and its history, for the participants only.
|
|
239
|
+
*
|
|
240
|
+
* @since 1.0.0
|
|
241
|
+
* @category Schemas
|
|
242
|
+
*/
|
|
243
|
+
export declare const TradeDetail: Schema.Struct<{
|
|
244
|
+
readonly trade: Schema.Struct<{
|
|
245
|
+
readonly id: Schema.String;
|
|
246
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
247
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
248
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
249
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
250
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
251
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
252
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
253
|
+
readonly itemType: Schema.Enum<{
|
|
254
|
+
readonly None: "None";
|
|
255
|
+
readonly Play: "Play";
|
|
256
|
+
readonly Gift: "Gift";
|
|
257
|
+
readonly Cloud: "Cloud";
|
|
258
|
+
readonly Raffle: "Raffle";
|
|
259
|
+
readonly Visit: "Visit";
|
|
260
|
+
readonly Leaderboards: "Leaderboards";
|
|
261
|
+
}>;
|
|
262
|
+
readonly item: Schema.String;
|
|
263
|
+
}>, Schema.Struct<{
|
|
264
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
265
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
266
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
267
|
+
readonly item: Schema.optional<Schema.String>;
|
|
268
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
269
|
+
}>>;
|
|
270
|
+
}>]>;
|
|
271
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
272
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
273
|
+
readonly itemType: Schema.Enum<{
|
|
274
|
+
readonly None: "None";
|
|
275
|
+
readonly Play: "Play";
|
|
276
|
+
readonly Gift: "Gift";
|
|
277
|
+
readonly Cloud: "Cloud";
|
|
278
|
+
readonly Raffle: "Raffle";
|
|
279
|
+
readonly Visit: "Visit";
|
|
280
|
+
readonly Leaderboards: "Leaderboards";
|
|
281
|
+
}>;
|
|
282
|
+
readonly item: Schema.String;
|
|
283
|
+
}>, Schema.Struct<{
|
|
284
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
285
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
286
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
287
|
+
readonly item: Schema.optional<Schema.String>;
|
|
288
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
289
|
+
}>>;
|
|
290
|
+
}>]>;
|
|
291
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
292
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
293
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
294
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
295
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
296
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
297
|
+
}>;
|
|
298
|
+
readonly legs: Schema.$Array<Schema.Struct<{
|
|
299
|
+
readonly role: Schema.Literals<readonly ["proposer", "counterparty"]>;
|
|
300
|
+
readonly fromPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
301
|
+
readonly toPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
302
|
+
readonly state: Schema.Literals<readonly ["pending", "sent", "verified", "released", "settled", "refund_sent", "refunded", "lost"]>;
|
|
303
|
+
readonly itemType: Schema.Enum<{
|
|
304
|
+
readonly None: "None";
|
|
305
|
+
readonly Play: "Play";
|
|
306
|
+
readonly Gift: "Gift";
|
|
307
|
+
readonly Cloud: "Cloud";
|
|
308
|
+
readonly Raffle: "Raffle";
|
|
309
|
+
readonly Visit: "Visit";
|
|
310
|
+
readonly Leaderboards: "Leaderboards";
|
|
311
|
+
}>;
|
|
312
|
+
readonly item: Schema.String;
|
|
313
|
+
}>>;
|
|
314
|
+
readonly ledger: Schema.$Array<Schema.Struct<{
|
|
315
|
+
readonly event: Schema.String;
|
|
316
|
+
readonly at: Schema.DateTimeUtcFromString;
|
|
317
|
+
}>>;
|
|
318
|
+
}>;
|
|
319
|
+
/**
|
|
320
|
+
* Whether the treasury can currently act on the caller's towers, and where
|
|
321
|
+
* to go to make it so. The url is built server-side so the browser stays
|
|
322
|
+
* configuration-free.
|
|
323
|
+
*
|
|
324
|
+
* @since 1.0.0
|
|
325
|
+
* @category Schemas
|
|
326
|
+
*/
|
|
327
|
+
export declare const GrantStatus: Schema.Struct<{
|
|
328
|
+
readonly connected: Schema.Boolean;
|
|
329
|
+
readonly scope: Schema.optional<Schema.String>;
|
|
330
|
+
readonly connectUrl: Schema.String;
|
|
331
|
+
}>;
|
|
332
|
+
/**
|
|
333
|
+
* What a tower could put into a trade, read out of its save. Bitizens are the
|
|
334
|
+
* encoded strings the gift channel carries; costumes and pets are the strings
|
|
335
|
+
* the save stores.
|
|
336
|
+
*
|
|
337
|
+
* @since 1.0.0
|
|
338
|
+
* @category Schemas
|
|
339
|
+
*/
|
|
340
|
+
export declare const Inventory: Schema.Struct<{
|
|
341
|
+
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
342
|
+
readonly bitizens: Schema.$Array<Schema.String>;
|
|
343
|
+
readonly costumes: Schema.$Array<Schema.String>;
|
|
344
|
+
readonly pets: Schema.$Array<Schema.String>;
|
|
345
|
+
readonly coins: Schema.Int;
|
|
346
|
+
readonly bux: Schema.Int;
|
|
347
|
+
}>;
|
|
348
|
+
/**
|
|
349
|
+
* The treasury's public counters, for the home page's stat tiles. Counts
|
|
350
|
+
* only, cached server-side, and deliberately free of anything per-user.
|
|
351
|
+
*
|
|
352
|
+
* @since 1.0.0
|
|
353
|
+
* @category Schemas
|
|
354
|
+
*/
|
|
355
|
+
export declare const TreasuryStats: Schema.Struct<{
|
|
356
|
+
readonly activeTraders: Schema.Int;
|
|
357
|
+
readonly settledTrades: Schema.Int;
|
|
358
|
+
readonly itemsMoved: Schema.Int;
|
|
359
|
+
}>;
|
|
360
|
+
/**
|
|
361
|
+
* @since 1.0.0
|
|
362
|
+
* @category Schemas
|
|
363
|
+
*/
|
|
364
|
+
export declare const TradeProposal: Schema.Struct<{
|
|
365
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
366
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
367
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
368
|
+
/** Absent for an open offer, which whoever accepts first gets. */
|
|
369
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
370
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
371
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
372
|
+
readonly itemType: Schema.Enum<{
|
|
373
|
+
readonly None: "None";
|
|
374
|
+
readonly Play: "Play";
|
|
375
|
+
readonly Gift: "Gift";
|
|
376
|
+
readonly Cloud: "Cloud";
|
|
377
|
+
readonly Raffle: "Raffle";
|
|
378
|
+
readonly Visit: "Visit";
|
|
379
|
+
readonly Leaderboards: "Leaderboards";
|
|
380
|
+
}>;
|
|
381
|
+
readonly item: Schema.String;
|
|
382
|
+
}>, Schema.Struct<{
|
|
383
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
384
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
385
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
386
|
+
readonly item: Schema.optional<Schema.String>;
|
|
387
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
388
|
+
}>>;
|
|
389
|
+
}>]>;
|
|
390
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
391
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
392
|
+
readonly itemType: Schema.Enum<{
|
|
393
|
+
readonly None: "None";
|
|
394
|
+
readonly Play: "Play";
|
|
395
|
+
readonly Gift: "Gift";
|
|
396
|
+
readonly Cloud: "Cloud";
|
|
397
|
+
readonly Raffle: "Raffle";
|
|
398
|
+
readonly Visit: "Visit";
|
|
399
|
+
readonly Leaderboards: "Leaderboards";
|
|
400
|
+
}>;
|
|
401
|
+
readonly item: Schema.String;
|
|
402
|
+
}>, Schema.Struct<{
|
|
403
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
404
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
405
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
406
|
+
readonly item: Schema.optional<Schema.String>;
|
|
407
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
408
|
+
}>>;
|
|
409
|
+
}>]>;
|
|
410
|
+
readonly ttlHours: Schema.Int;
|
|
411
|
+
}>;
|
|
412
|
+
/**
|
|
413
|
+
* Everything the treasury serves. The group annotation is the floor: an
|
|
414
|
+
* endpoint added later without its own leaf accepts only the whole
|
|
415
|
+
* `treasury` scope, so nothing defaults to a weaker permission.
|
|
416
|
+
*
|
|
417
|
+
* @since 1.0.0
|
|
418
|
+
* @category Groups
|
|
419
|
+
*/
|
|
420
|
+
export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", HttpApiEndpoint.HttpApiEndpoint<"AcceptTrade", "POST", "/v1/treasury/trades/:tradeId/accept", Schema.toCodecStringTree<Schema.Struct<{
|
|
421
|
+
tradeId: Schema.String;
|
|
422
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
423
|
+
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
424
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
425
|
+
readonly id: Schema.String;
|
|
426
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
427
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
428
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
429
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
430
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
431
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
432
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
433
|
+
readonly itemType: Schema.Enum<{
|
|
434
|
+
readonly None: "None";
|
|
435
|
+
readonly Play: "Play";
|
|
436
|
+
readonly Gift: "Gift";
|
|
437
|
+
readonly Cloud: "Cloud";
|
|
438
|
+
readonly Raffle: "Raffle";
|
|
439
|
+
readonly Visit: "Visit";
|
|
440
|
+
readonly Leaderboards: "Leaderboards";
|
|
441
|
+
}>;
|
|
442
|
+
readonly item: Schema.String;
|
|
443
|
+
}>, Schema.Struct<{
|
|
444
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
445
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
446
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
447
|
+
readonly item: Schema.optional<Schema.String>;
|
|
448
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
449
|
+
}>>;
|
|
450
|
+
}>]>;
|
|
451
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
452
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
453
|
+
readonly itemType: Schema.Enum<{
|
|
454
|
+
readonly None: "None";
|
|
455
|
+
readonly Play: "Play";
|
|
456
|
+
readonly Gift: "Gift";
|
|
457
|
+
readonly Cloud: "Cloud";
|
|
458
|
+
readonly Raffle: "Raffle";
|
|
459
|
+
readonly Visit: "Visit";
|
|
460
|
+
readonly Leaderboards: "Leaderboards";
|
|
461
|
+
}>;
|
|
462
|
+
readonly item: Schema.String;
|
|
463
|
+
}>, Schema.Struct<{
|
|
464
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
465
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
466
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
467
|
+
readonly item: Schema.optional<Schema.String>;
|
|
468
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
469
|
+
}>>;
|
|
470
|
+
}>]>;
|
|
471
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
472
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
473
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
474
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
475
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
476
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
477
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.Conflict | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"CancelTrade", "POST", "/v1/treasury/trades/:tradeId/cancel", Schema.toCodecStringTree<Schema.Struct<{
|
|
478
|
+
tradeId: Schema.String;
|
|
479
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
480
|
+
readonly id: Schema.String;
|
|
481
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
482
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
483
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
484
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
485
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
486
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
487
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
488
|
+
readonly itemType: Schema.Enum<{
|
|
489
|
+
readonly None: "None";
|
|
490
|
+
readonly Play: "Play";
|
|
491
|
+
readonly Gift: "Gift";
|
|
492
|
+
readonly Cloud: "Cloud";
|
|
493
|
+
readonly Raffle: "Raffle";
|
|
494
|
+
readonly Visit: "Visit";
|
|
495
|
+
readonly Leaderboards: "Leaderboards";
|
|
496
|
+
}>;
|
|
497
|
+
readonly item: Schema.String;
|
|
498
|
+
}>, Schema.Struct<{
|
|
499
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
500
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
501
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
502
|
+
readonly item: Schema.optional<Schema.String>;
|
|
503
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
504
|
+
}>>;
|
|
505
|
+
}>]>;
|
|
506
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
507
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
508
|
+
readonly itemType: Schema.Enum<{
|
|
509
|
+
readonly None: "None";
|
|
510
|
+
readonly Play: "Play";
|
|
511
|
+
readonly Gift: "Gift";
|
|
512
|
+
readonly Cloud: "Cloud";
|
|
513
|
+
readonly Raffle: "Raffle";
|
|
514
|
+
readonly Visit: "Visit";
|
|
515
|
+
readonly Leaderboards: "Leaderboards";
|
|
516
|
+
}>;
|
|
517
|
+
readonly item: Schema.String;
|
|
518
|
+
}>, Schema.Struct<{
|
|
519
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
520
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
521
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
522
|
+
readonly item: Schema.optional<Schema.String>;
|
|
523
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
524
|
+
}>>;
|
|
525
|
+
}>]>;
|
|
526
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
527
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
528
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
529
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
530
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
531
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
532
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ConfirmSplice", "POST", "/v1/treasury/trades/:tradeId/confirm", Schema.toCodecStringTree<Schema.Struct<{
|
|
533
|
+
tradeId: Schema.String;
|
|
534
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
535
|
+
readonly id: Schema.String;
|
|
536
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
537
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
538
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
539
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
540
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
541
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
542
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
543
|
+
readonly itemType: Schema.Enum<{
|
|
544
|
+
readonly None: "None";
|
|
545
|
+
readonly Play: "Play";
|
|
546
|
+
readonly Gift: "Gift";
|
|
547
|
+
readonly Cloud: "Cloud";
|
|
548
|
+
readonly Raffle: "Raffle";
|
|
549
|
+
readonly Visit: "Visit";
|
|
550
|
+
readonly Leaderboards: "Leaderboards";
|
|
551
|
+
}>;
|
|
552
|
+
readonly item: Schema.String;
|
|
553
|
+
}>, Schema.Struct<{
|
|
554
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
555
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
556
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
557
|
+
readonly item: Schema.optional<Schema.String>;
|
|
558
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
559
|
+
}>>;
|
|
560
|
+
}>]>;
|
|
561
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
562
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
563
|
+
readonly itemType: Schema.Enum<{
|
|
564
|
+
readonly None: "None";
|
|
565
|
+
readonly Play: "Play";
|
|
566
|
+
readonly Gift: "Gift";
|
|
567
|
+
readonly Cloud: "Cloud";
|
|
568
|
+
readonly Raffle: "Raffle";
|
|
569
|
+
readonly Visit: "Visit";
|
|
570
|
+
readonly Leaderboards: "Leaderboards";
|
|
571
|
+
}>;
|
|
572
|
+
readonly item: Schema.String;
|
|
573
|
+
}>, Schema.Struct<{
|
|
574
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
575
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
576
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
577
|
+
readonly item: Schema.optional<Schema.String>;
|
|
578
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
579
|
+
}>>;
|
|
580
|
+
}>]>;
|
|
581
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
582
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
583
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
584
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
585
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
586
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
587
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"GetTrade", "GET", "/v1/treasury/trades/:tradeId", Schema.toCodecStringTree<Schema.Struct<{
|
|
588
|
+
tradeId: Schema.String;
|
|
589
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
590
|
+
readonly trade: Schema.Struct<{
|
|
591
|
+
readonly id: Schema.String;
|
|
592
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
593
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
594
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
595
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
596
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
597
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
598
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
599
|
+
readonly itemType: Schema.Enum<{
|
|
600
|
+
readonly None: "None";
|
|
601
|
+
readonly Play: "Play";
|
|
602
|
+
readonly Gift: "Gift";
|
|
603
|
+
readonly Cloud: "Cloud";
|
|
604
|
+
readonly Raffle: "Raffle";
|
|
605
|
+
readonly Visit: "Visit";
|
|
606
|
+
readonly Leaderboards: "Leaderboards";
|
|
607
|
+
}>;
|
|
608
|
+
readonly item: Schema.String;
|
|
609
|
+
}>, Schema.Struct<{
|
|
610
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
611
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
612
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
613
|
+
readonly item: Schema.optional<Schema.String>;
|
|
614
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
615
|
+
}>>;
|
|
616
|
+
}>]>;
|
|
617
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
618
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
619
|
+
readonly itemType: Schema.Enum<{
|
|
620
|
+
readonly None: "None";
|
|
621
|
+
readonly Play: "Play";
|
|
622
|
+
readonly Gift: "Gift";
|
|
623
|
+
readonly Cloud: "Cloud";
|
|
624
|
+
readonly Raffle: "Raffle";
|
|
625
|
+
readonly Visit: "Visit";
|
|
626
|
+
readonly Leaderboards: "Leaderboards";
|
|
627
|
+
}>;
|
|
628
|
+
readonly item: Schema.String;
|
|
629
|
+
}>, Schema.Struct<{
|
|
630
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
631
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
632
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
633
|
+
readonly item: Schema.optional<Schema.String>;
|
|
634
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
635
|
+
}>>;
|
|
636
|
+
}>]>;
|
|
637
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
638
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
639
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
640
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
641
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
642
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
643
|
+
}>;
|
|
644
|
+
readonly legs: Schema.$Array<Schema.Struct<{
|
|
645
|
+
readonly role: Schema.Literals<readonly ["proposer", "counterparty"]>;
|
|
646
|
+
readonly fromPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
647
|
+
readonly toPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
648
|
+
readonly state: Schema.Literals<readonly ["pending", "sent", "verified", "released", "settled", "refund_sent", "refunded", "lost"]>;
|
|
649
|
+
readonly itemType: Schema.Enum<{
|
|
650
|
+
readonly None: "None";
|
|
651
|
+
readonly Play: "Play";
|
|
652
|
+
readonly Gift: "Gift";
|
|
653
|
+
readonly Cloud: "Cloud";
|
|
654
|
+
readonly Raffle: "Raffle";
|
|
655
|
+
readonly Visit: "Visit";
|
|
656
|
+
readonly Leaderboards: "Leaderboards";
|
|
657
|
+
}>;
|
|
658
|
+
readonly item: Schema.String;
|
|
659
|
+
}>>;
|
|
660
|
+
readonly ledger: Schema.$Array<Schema.Struct<{
|
|
661
|
+
readonly event: Schema.String;
|
|
662
|
+
readonly at: Schema.DateTimeUtcFromString;
|
|
663
|
+
}>>;
|
|
664
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"GrantStatus", "GET", "/v1/treasury/grant", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
665
|
+
readonly connected: Schema.Boolean;
|
|
666
|
+
readonly scope: Schema.optional<Schema.String>;
|
|
667
|
+
readonly connectUrl: Schema.String;
|
|
668
|
+
}>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ListInventory", "GET", "/v1/treasury/inventory/:playerId", Schema.toCodecStringTree<Schema.Struct<{
|
|
669
|
+
playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
670
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
671
|
+
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
672
|
+
readonly bitizens: Schema.$Array<Schema.String>;
|
|
673
|
+
readonly costumes: Schema.$Array<Schema.String>;
|
|
674
|
+
readonly pets: Schema.$Array<Schema.String>;
|
|
675
|
+
readonly coins: Schema.Int;
|
|
676
|
+
readonly bux: Schema.Int;
|
|
677
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ListTrades", "GET", "/v1/treasury/trades", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
678
|
+
readonly id: Schema.String;
|
|
679
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
680
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
681
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
682
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
683
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
684
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
685
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
686
|
+
readonly itemType: Schema.Enum<{
|
|
687
|
+
readonly None: "None";
|
|
688
|
+
readonly Play: "Play";
|
|
689
|
+
readonly Gift: "Gift";
|
|
690
|
+
readonly Cloud: "Cloud";
|
|
691
|
+
readonly Raffle: "Raffle";
|
|
692
|
+
readonly Visit: "Visit";
|
|
693
|
+
readonly Leaderboards: "Leaderboards";
|
|
694
|
+
}>;
|
|
695
|
+
readonly item: Schema.String;
|
|
696
|
+
}>, Schema.Struct<{
|
|
697
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
698
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
699
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
700
|
+
readonly item: Schema.optional<Schema.String>;
|
|
701
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
702
|
+
}>>;
|
|
703
|
+
}>]>;
|
|
704
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
705
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
706
|
+
readonly itemType: Schema.Enum<{
|
|
707
|
+
readonly None: "None";
|
|
708
|
+
readonly Play: "Play";
|
|
709
|
+
readonly Gift: "Gift";
|
|
710
|
+
readonly Cloud: "Cloud";
|
|
711
|
+
readonly Raffle: "Raffle";
|
|
712
|
+
readonly Visit: "Visit";
|
|
713
|
+
readonly Leaderboards: "Leaderboards";
|
|
714
|
+
}>;
|
|
715
|
+
readonly item: Schema.String;
|
|
716
|
+
}>, Schema.Struct<{
|
|
717
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
718
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
719
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
720
|
+
readonly item: Schema.optional<Schema.String>;
|
|
721
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
722
|
+
}>>;
|
|
723
|
+
}>]>;
|
|
724
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
725
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
726
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
727
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
728
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
729
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
730
|
+
}>>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ProposeTrade", "POST", "/v1/treasury/trades", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
731
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
732
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
733
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
734
|
+
/** Absent for an open offer, which whoever accepts first gets. */
|
|
735
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
736
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
737
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
738
|
+
readonly itemType: Schema.Enum<{
|
|
739
|
+
readonly None: "None";
|
|
740
|
+
readonly Play: "Play";
|
|
741
|
+
readonly Gift: "Gift";
|
|
742
|
+
readonly Cloud: "Cloud";
|
|
743
|
+
readonly Raffle: "Raffle";
|
|
744
|
+
readonly Visit: "Visit";
|
|
745
|
+
readonly Leaderboards: "Leaderboards";
|
|
746
|
+
}>;
|
|
747
|
+
readonly item: Schema.String;
|
|
748
|
+
}>, Schema.Struct<{
|
|
749
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
750
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
751
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
752
|
+
readonly item: Schema.optional<Schema.String>;
|
|
753
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
754
|
+
}>>;
|
|
755
|
+
}>]>;
|
|
756
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
757
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
758
|
+
readonly itemType: Schema.Enum<{
|
|
759
|
+
readonly None: "None";
|
|
760
|
+
readonly Play: "Play";
|
|
761
|
+
readonly Gift: "Gift";
|
|
762
|
+
readonly Cloud: "Cloud";
|
|
763
|
+
readonly Raffle: "Raffle";
|
|
764
|
+
readonly Visit: "Visit";
|
|
765
|
+
readonly Leaderboards: "Leaderboards";
|
|
766
|
+
}>;
|
|
767
|
+
readonly item: Schema.String;
|
|
768
|
+
}>, Schema.Struct<{
|
|
769
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
770
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
771
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
772
|
+
readonly item: Schema.optional<Schema.String>;
|
|
773
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
774
|
+
}>>;
|
|
775
|
+
}>]>;
|
|
776
|
+
readonly ttlHours: Schema.Int;
|
|
777
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
778
|
+
readonly id: Schema.String;
|
|
779
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
780
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
781
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
782
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
783
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
784
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
785
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
786
|
+
readonly itemType: Schema.Enum<{
|
|
787
|
+
readonly None: "None";
|
|
788
|
+
readonly Play: "Play";
|
|
789
|
+
readonly Gift: "Gift";
|
|
790
|
+
readonly Cloud: "Cloud";
|
|
791
|
+
readonly Raffle: "Raffle";
|
|
792
|
+
readonly Visit: "Visit";
|
|
793
|
+
readonly Leaderboards: "Leaderboards";
|
|
794
|
+
}>;
|
|
795
|
+
readonly item: Schema.String;
|
|
796
|
+
}>, Schema.Struct<{
|
|
797
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
798
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
799
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
800
|
+
readonly item: Schema.optional<Schema.String>;
|
|
801
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
802
|
+
}>>;
|
|
803
|
+
}>]>;
|
|
804
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
805
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
806
|
+
readonly itemType: Schema.Enum<{
|
|
807
|
+
readonly None: "None";
|
|
808
|
+
readonly Play: "Play";
|
|
809
|
+
readonly Gift: "Gift";
|
|
810
|
+
readonly Cloud: "Cloud";
|
|
811
|
+
readonly Raffle: "Raffle";
|
|
812
|
+
readonly Visit: "Visit";
|
|
813
|
+
readonly Leaderboards: "Leaderboards";
|
|
814
|
+
}>;
|
|
815
|
+
readonly item: Schema.String;
|
|
816
|
+
}>, Schema.Struct<{
|
|
817
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
818
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
819
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
820
|
+
readonly item: Schema.optional<Schema.String>;
|
|
821
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
822
|
+
}>>;
|
|
823
|
+
}>]>;
|
|
824
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
825
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
826
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
827
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
828
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
829
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
830
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Forbidden | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never>, false>;
|
|
831
|
+
/**
|
|
832
|
+
* What the treasury tells anyone at all: the stat counters the home page
|
|
833
|
+
* shows. The one group without `RequireAccess` or a scope requirement, and
|
|
834
|
+
* it must stay that way - the home page is public, so this rides
|
|
835
|
+
* tinyburg.app's proxy without a token behind it.
|
|
836
|
+
*
|
|
837
|
+
* @since 1.0.0
|
|
838
|
+
* @category Groups
|
|
839
|
+
*/
|
|
840
|
+
export declare const TreasuryPublicGroup: HttpApiGroup.HttpApiGroup<"TreasuryPublicGroup", HttpApiEndpoint.HttpApiEndpoint<"Stats", "GET", "/v1/treasury/stats", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
841
|
+
readonly activeTraders: Schema.Int;
|
|
842
|
+
readonly settledTrades: Schema.Int;
|
|
843
|
+
readonly itemsMoved: Schema.Int;
|
|
844
|
+
}>>, never, never, never>, false>;
|
|
845
|
+
/**
|
|
846
|
+
* @since 1.0.0
|
|
847
|
+
* @category Api
|
|
848
|
+
*/
|
|
849
|
+
export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGroup<"TreasuryGroup", HttpApiEndpoint.HttpApiEndpoint<"AcceptTrade", "POST", "/v1/treasury/trades/:tradeId/accept", Schema.toCodecStringTree<Schema.Struct<{
|
|
850
|
+
tradeId: Schema.String;
|
|
851
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
852
|
+
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
853
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
854
|
+
readonly id: Schema.String;
|
|
855
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
856
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
857
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
858
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
859
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
860
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
861
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
862
|
+
readonly itemType: Schema.Enum<{
|
|
863
|
+
readonly None: "None";
|
|
864
|
+
readonly Play: "Play";
|
|
865
|
+
readonly Gift: "Gift";
|
|
866
|
+
readonly Cloud: "Cloud";
|
|
867
|
+
readonly Raffle: "Raffle";
|
|
868
|
+
readonly Visit: "Visit";
|
|
869
|
+
readonly Leaderboards: "Leaderboards";
|
|
870
|
+
}>;
|
|
871
|
+
readonly item: Schema.String;
|
|
872
|
+
}>, Schema.Struct<{
|
|
873
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
874
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
875
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
876
|
+
readonly item: Schema.optional<Schema.String>;
|
|
877
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
878
|
+
}>>;
|
|
879
|
+
}>]>;
|
|
880
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
881
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
882
|
+
readonly itemType: Schema.Enum<{
|
|
883
|
+
readonly None: "None";
|
|
884
|
+
readonly Play: "Play";
|
|
885
|
+
readonly Gift: "Gift";
|
|
886
|
+
readonly Cloud: "Cloud";
|
|
887
|
+
readonly Raffle: "Raffle";
|
|
888
|
+
readonly Visit: "Visit";
|
|
889
|
+
readonly Leaderboards: "Leaderboards";
|
|
890
|
+
}>;
|
|
891
|
+
readonly item: Schema.String;
|
|
892
|
+
}>, Schema.Struct<{
|
|
893
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
894
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
895
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
896
|
+
readonly item: Schema.optional<Schema.String>;
|
|
897
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
898
|
+
}>>;
|
|
899
|
+
}>]>;
|
|
900
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
901
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
902
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
903
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
904
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
905
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
906
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.Conflict | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"CancelTrade", "POST", "/v1/treasury/trades/:tradeId/cancel", Schema.toCodecStringTree<Schema.Struct<{
|
|
907
|
+
tradeId: Schema.String;
|
|
908
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
909
|
+
readonly id: Schema.String;
|
|
910
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
911
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
912
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
913
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
914
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
915
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
916
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
917
|
+
readonly itemType: Schema.Enum<{
|
|
918
|
+
readonly None: "None";
|
|
919
|
+
readonly Play: "Play";
|
|
920
|
+
readonly Gift: "Gift";
|
|
921
|
+
readonly Cloud: "Cloud";
|
|
922
|
+
readonly Raffle: "Raffle";
|
|
923
|
+
readonly Visit: "Visit";
|
|
924
|
+
readonly Leaderboards: "Leaderboards";
|
|
925
|
+
}>;
|
|
926
|
+
readonly item: Schema.String;
|
|
927
|
+
}>, Schema.Struct<{
|
|
928
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
929
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
930
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
931
|
+
readonly item: Schema.optional<Schema.String>;
|
|
932
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
933
|
+
}>>;
|
|
934
|
+
}>]>;
|
|
935
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
936
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
937
|
+
readonly itemType: Schema.Enum<{
|
|
938
|
+
readonly None: "None";
|
|
939
|
+
readonly Play: "Play";
|
|
940
|
+
readonly Gift: "Gift";
|
|
941
|
+
readonly Cloud: "Cloud";
|
|
942
|
+
readonly Raffle: "Raffle";
|
|
943
|
+
readonly Visit: "Visit";
|
|
944
|
+
readonly Leaderboards: "Leaderboards";
|
|
945
|
+
}>;
|
|
946
|
+
readonly item: Schema.String;
|
|
947
|
+
}>, Schema.Struct<{
|
|
948
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
949
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
950
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
951
|
+
readonly item: Schema.optional<Schema.String>;
|
|
952
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
953
|
+
}>>;
|
|
954
|
+
}>]>;
|
|
955
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
956
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
957
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
958
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
959
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
960
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
961
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ConfirmSplice", "POST", "/v1/treasury/trades/:tradeId/confirm", Schema.toCodecStringTree<Schema.Struct<{
|
|
962
|
+
tradeId: Schema.String;
|
|
963
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
964
|
+
readonly id: Schema.String;
|
|
965
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
966
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
967
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
968
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
969
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
970
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
971
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
972
|
+
readonly itemType: Schema.Enum<{
|
|
973
|
+
readonly None: "None";
|
|
974
|
+
readonly Play: "Play";
|
|
975
|
+
readonly Gift: "Gift";
|
|
976
|
+
readonly Cloud: "Cloud";
|
|
977
|
+
readonly Raffle: "Raffle";
|
|
978
|
+
readonly Visit: "Visit";
|
|
979
|
+
readonly Leaderboards: "Leaderboards";
|
|
980
|
+
}>;
|
|
981
|
+
readonly item: Schema.String;
|
|
982
|
+
}>, Schema.Struct<{
|
|
983
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
984
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
985
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
986
|
+
readonly item: Schema.optional<Schema.String>;
|
|
987
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
988
|
+
}>>;
|
|
989
|
+
}>]>;
|
|
990
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
991
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
992
|
+
readonly itemType: Schema.Enum<{
|
|
993
|
+
readonly None: "None";
|
|
994
|
+
readonly Play: "Play";
|
|
995
|
+
readonly Gift: "Gift";
|
|
996
|
+
readonly Cloud: "Cloud";
|
|
997
|
+
readonly Raffle: "Raffle";
|
|
998
|
+
readonly Visit: "Visit";
|
|
999
|
+
readonly Leaderboards: "Leaderboards";
|
|
1000
|
+
}>;
|
|
1001
|
+
readonly item: Schema.String;
|
|
1002
|
+
}>, Schema.Struct<{
|
|
1003
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1004
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1005
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1006
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1007
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1008
|
+
}>>;
|
|
1009
|
+
}>]>;
|
|
1010
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
1011
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1012
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1013
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1014
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1015
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
1016
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"GetTrade", "GET", "/v1/treasury/trades/:tradeId", Schema.toCodecStringTree<Schema.Struct<{
|
|
1017
|
+
tradeId: Schema.String;
|
|
1018
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1019
|
+
readonly trade: Schema.Struct<{
|
|
1020
|
+
readonly id: Schema.String;
|
|
1021
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1022
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
1023
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
1024
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1025
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
1026
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
1027
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1028
|
+
readonly itemType: Schema.Enum<{
|
|
1029
|
+
readonly None: "None";
|
|
1030
|
+
readonly Play: "Play";
|
|
1031
|
+
readonly Gift: "Gift";
|
|
1032
|
+
readonly Cloud: "Cloud";
|
|
1033
|
+
readonly Raffle: "Raffle";
|
|
1034
|
+
readonly Visit: "Visit";
|
|
1035
|
+
readonly Leaderboards: "Leaderboards";
|
|
1036
|
+
}>;
|
|
1037
|
+
readonly item: Schema.String;
|
|
1038
|
+
}>, Schema.Struct<{
|
|
1039
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1040
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1041
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1042
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1043
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1044
|
+
}>>;
|
|
1045
|
+
}>]>;
|
|
1046
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
1047
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1048
|
+
readonly itemType: Schema.Enum<{
|
|
1049
|
+
readonly None: "None";
|
|
1050
|
+
readonly Play: "Play";
|
|
1051
|
+
readonly Gift: "Gift";
|
|
1052
|
+
readonly Cloud: "Cloud";
|
|
1053
|
+
readonly Raffle: "Raffle";
|
|
1054
|
+
readonly Visit: "Visit";
|
|
1055
|
+
readonly Leaderboards: "Leaderboards";
|
|
1056
|
+
}>;
|
|
1057
|
+
readonly item: Schema.String;
|
|
1058
|
+
}>, Schema.Struct<{
|
|
1059
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1060
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1061
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1062
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1063
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1064
|
+
}>>;
|
|
1065
|
+
}>]>;
|
|
1066
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
1067
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1068
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1069
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1070
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1071
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
1072
|
+
}>;
|
|
1073
|
+
readonly legs: Schema.$Array<Schema.Struct<{
|
|
1074
|
+
readonly role: Schema.Literals<readonly ["proposer", "counterparty"]>;
|
|
1075
|
+
readonly fromPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1076
|
+
readonly toPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1077
|
+
readonly state: Schema.Literals<readonly ["pending", "sent", "verified", "released", "settled", "refund_sent", "refunded", "lost"]>;
|
|
1078
|
+
readonly itemType: Schema.Enum<{
|
|
1079
|
+
readonly None: "None";
|
|
1080
|
+
readonly Play: "Play";
|
|
1081
|
+
readonly Gift: "Gift";
|
|
1082
|
+
readonly Cloud: "Cloud";
|
|
1083
|
+
readonly Raffle: "Raffle";
|
|
1084
|
+
readonly Visit: "Visit";
|
|
1085
|
+
readonly Leaderboards: "Leaderboards";
|
|
1086
|
+
}>;
|
|
1087
|
+
readonly item: Schema.String;
|
|
1088
|
+
}>>;
|
|
1089
|
+
readonly ledger: Schema.$Array<Schema.Struct<{
|
|
1090
|
+
readonly event: Schema.String;
|
|
1091
|
+
readonly at: Schema.DateTimeUtcFromString;
|
|
1092
|
+
}>>;
|
|
1093
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"GrantStatus", "GET", "/v1/treasury/grant", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1094
|
+
readonly connected: Schema.Boolean;
|
|
1095
|
+
readonly scope: Schema.optional<Schema.String>;
|
|
1096
|
+
readonly connectUrl: Schema.String;
|
|
1097
|
+
}>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ListInventory", "GET", "/v1/treasury/inventory/:playerId", Schema.toCodecStringTree<Schema.Struct<{
|
|
1098
|
+
playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1099
|
+
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1100
|
+
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1101
|
+
readonly bitizens: Schema.$Array<Schema.String>;
|
|
1102
|
+
readonly costumes: Schema.$Array<Schema.String>;
|
|
1103
|
+
readonly pets: Schema.$Array<Schema.String>;
|
|
1104
|
+
readonly coins: Schema.Int;
|
|
1105
|
+
readonly bux: Schema.Int;
|
|
1106
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ListTrades", "GET", "/v1/treasury/trades", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
|
|
1107
|
+
readonly id: Schema.String;
|
|
1108
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1109
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
1110
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
1111
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1112
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
1113
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
1114
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1115
|
+
readonly itemType: Schema.Enum<{
|
|
1116
|
+
readonly None: "None";
|
|
1117
|
+
readonly Play: "Play";
|
|
1118
|
+
readonly Gift: "Gift";
|
|
1119
|
+
readonly Cloud: "Cloud";
|
|
1120
|
+
readonly Raffle: "Raffle";
|
|
1121
|
+
readonly Visit: "Visit";
|
|
1122
|
+
readonly Leaderboards: "Leaderboards";
|
|
1123
|
+
}>;
|
|
1124
|
+
readonly item: Schema.String;
|
|
1125
|
+
}>, Schema.Struct<{
|
|
1126
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1127
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1128
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1129
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1130
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1131
|
+
}>>;
|
|
1132
|
+
}>]>;
|
|
1133
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
1134
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1135
|
+
readonly itemType: Schema.Enum<{
|
|
1136
|
+
readonly None: "None";
|
|
1137
|
+
readonly Play: "Play";
|
|
1138
|
+
readonly Gift: "Gift";
|
|
1139
|
+
readonly Cloud: "Cloud";
|
|
1140
|
+
readonly Raffle: "Raffle";
|
|
1141
|
+
readonly Visit: "Visit";
|
|
1142
|
+
readonly Leaderboards: "Leaderboards";
|
|
1143
|
+
}>;
|
|
1144
|
+
readonly item: Schema.String;
|
|
1145
|
+
}>, Schema.Struct<{
|
|
1146
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1147
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1148
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1149
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1150
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1151
|
+
}>>;
|
|
1152
|
+
}>]>;
|
|
1153
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
1154
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1155
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1156
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1157
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1158
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
1159
|
+
}>>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ProposeTrade", "POST", "/v1/treasury/trades", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1160
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1161
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
1162
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1163
|
+
/** Absent for an open offer, which whoever accepts first gets. */
|
|
1164
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
1165
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
1166
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1167
|
+
readonly itemType: Schema.Enum<{
|
|
1168
|
+
readonly None: "None";
|
|
1169
|
+
readonly Play: "Play";
|
|
1170
|
+
readonly Gift: "Gift";
|
|
1171
|
+
readonly Cloud: "Cloud";
|
|
1172
|
+
readonly Raffle: "Raffle";
|
|
1173
|
+
readonly Visit: "Visit";
|
|
1174
|
+
readonly Leaderboards: "Leaderboards";
|
|
1175
|
+
}>;
|
|
1176
|
+
readonly item: Schema.String;
|
|
1177
|
+
}>, Schema.Struct<{
|
|
1178
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1179
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1180
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1181
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1182
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1183
|
+
}>>;
|
|
1184
|
+
}>]>;
|
|
1185
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
1186
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1187
|
+
readonly itemType: Schema.Enum<{
|
|
1188
|
+
readonly None: "None";
|
|
1189
|
+
readonly Play: "Play";
|
|
1190
|
+
readonly Gift: "Gift";
|
|
1191
|
+
readonly Cloud: "Cloud";
|
|
1192
|
+
readonly Raffle: "Raffle";
|
|
1193
|
+
readonly Visit: "Visit";
|
|
1194
|
+
readonly Leaderboards: "Leaderboards";
|
|
1195
|
+
}>;
|
|
1196
|
+
readonly item: Schema.String;
|
|
1197
|
+
}>, Schema.Struct<{
|
|
1198
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1199
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1200
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1201
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1202
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1203
|
+
}>>;
|
|
1204
|
+
}>]>;
|
|
1205
|
+
readonly ttlHours: Schema.Int;
|
|
1206
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
1207
|
+
readonly id: Schema.String;
|
|
1208
|
+
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1209
|
+
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
1210
|
+
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
1211
|
+
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1212
|
+
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
1213
|
+
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
1214
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1215
|
+
readonly itemType: Schema.Enum<{
|
|
1216
|
+
readonly None: "None";
|
|
1217
|
+
readonly Play: "Play";
|
|
1218
|
+
readonly Gift: "Gift";
|
|
1219
|
+
readonly Cloud: "Cloud";
|
|
1220
|
+
readonly Raffle: "Raffle";
|
|
1221
|
+
readonly Visit: "Visit";
|
|
1222
|
+
readonly Leaderboards: "Leaderboards";
|
|
1223
|
+
}>;
|
|
1224
|
+
readonly item: Schema.String;
|
|
1225
|
+
}>, Schema.Struct<{
|
|
1226
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1227
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1228
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1229
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1230
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1231
|
+
}>>;
|
|
1232
|
+
}>]>;
|
|
1233
|
+
readonly wants: Schema.Union<readonly [Schema.Struct<{
|
|
1234
|
+
readonly _tag: Schema.tag<"GiftItem">;
|
|
1235
|
+
readonly itemType: Schema.Enum<{
|
|
1236
|
+
readonly None: "None";
|
|
1237
|
+
readonly Play: "Play";
|
|
1238
|
+
readonly Gift: "Gift";
|
|
1239
|
+
readonly Cloud: "Cloud";
|
|
1240
|
+
readonly Raffle: "Raffle";
|
|
1241
|
+
readonly Visit: "Visit";
|
|
1242
|
+
readonly Leaderboards: "Leaderboards";
|
|
1243
|
+
}>;
|
|
1244
|
+
readonly item: Schema.String;
|
|
1245
|
+
}>, Schema.Struct<{
|
|
1246
|
+
readonly _tag: Schema.tag<"SpliceItems">;
|
|
1247
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
1248
|
+
readonly kind: Schema.Literals<readonly ["bitizen", "costume", "pet", "coins", "bux"]>;
|
|
1249
|
+
readonly item: Schema.optional<Schema.String>;
|
|
1250
|
+
readonly amount: Schema.optional<Schema.Int>;
|
|
1251
|
+
}>>;
|
|
1252
|
+
}>]>;
|
|
1253
|
+
readonly role: Schema.optional<Schema.Literals<readonly ["proposer", "counterparty"]>>;
|
|
1254
|
+
readonly proposerConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1255
|
+
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1256
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1257
|
+
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1258
|
+
readonly failureReason: Schema.optional<Schema.String>;
|
|
1259
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Forbidden | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never>, false> | HttpApiGroup.HttpApiGroup<"TreasuryPublicGroup", HttpApiEndpoint.HttpApiEndpoint<"Stats", "GET", "/v1/treasury/stats", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1260
|
+
readonly activeTraders: Schema.Int;
|
|
1261
|
+
readonly settledTrades: Schema.Int;
|
|
1262
|
+
readonly itemsMoved: Schema.Int;
|
|
1263
|
+
}>>, never, never, never>, false>>;
|
|
1264
|
+
//# sourceMappingURL=Sdk.d.ts.map
|