@tinyburg/treasury-sdk 0.2.0 → 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/dist/Scopes.d.ts +1 -1
- package/dist/Scopes.js +1 -1
- package/dist/Sdk.d.ts +75 -75
- package/dist/Sdk.d.ts.map +1 -1
- package/dist/Sdk.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/Scopes.ts +1 -1
- package/src/Sdk.ts +1 -1
- package/src/index.ts +1 -1
package/dist/Scopes.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These guard the treasury's own api - proposing, accepting and watching
|
|
5
5
|
* trades - not the towers the trades move items between. Acting on a tower
|
|
6
6
|
* (depositing an item into escrow, splicing a save) happens through the
|
|
7
|
-
*
|
|
7
|
+
* tinyburg api under that game's own scopes, with a grant the player gives the
|
|
8
8
|
* treasury separately on the consent screen. Splitting the two means "let the
|
|
9
9
|
* treasury manage my trades" and "let the treasury touch my tower" are
|
|
10
10
|
* distinct questions with distinct answers.
|
package/dist/Scopes.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These guard the treasury's own api - proposing, accepting and watching
|
|
5
5
|
* trades - not the towers the trades move items between. Acting on a tower
|
|
6
6
|
* (depositing an item into escrow, splicing a save) happens through the
|
|
7
|
-
*
|
|
7
|
+
* tinyburg api under that game's own scopes, with a grant the player gives the
|
|
8
8
|
* treasury separately on the consent screen. Splitting the two means "let the
|
|
9
9
|
* treasury manage my trades" and "let the treasury touch my tower" are
|
|
10
10
|
* distinct questions with distinct answers.
|
package/dist/Sdk.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ import * as OAuthScope from "@yielded/auth/OAuthScope";
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const TradeMechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
40
40
|
/**
|
|
41
|
-
* The games the treasury trades in. TinyTower only, until the
|
|
41
|
+
* The games the treasury trades in. TinyTower only, until the tinyburg api
|
|
42
42
|
* serves more.
|
|
43
43
|
*
|
|
44
44
|
* @since 1.0.0
|
|
@@ -417,20 +417,11 @@ export declare const TradeProposal: Schema.Struct<{
|
|
|
417
417
|
* @since 1.0.0
|
|
418
418
|
* @category Groups
|
|
419
419
|
*/
|
|
420
|
-
export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", HttpApiEndpoint.HttpApiEndpoint<"
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
readonly connectUrl: Schema.String;
|
|
424
|
-
}>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ListInventory", "GET", "/v1/treasury/inventory/:playerId", Schema.toCodecStringTree<Schema.Struct<{
|
|
425
|
-
playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
426
|
-
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
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<{
|
|
427
423
|
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
428
|
-
|
|
429
|
-
readonly costumes: Schema.$Array<Schema.String>;
|
|
430
|
-
readonly pets: Schema.$Array<Schema.String>;
|
|
431
|
-
readonly coins: Schema.Int;
|
|
432
|
-
readonly bux: Schema.Int;
|
|
433
|
-
}>>, 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<{
|
|
424
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
434
425
|
readonly id: Schema.String;
|
|
435
426
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
436
427
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -483,11 +474,14 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
483
474
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
484
475
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
485
476
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
486
|
-
}
|
|
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;
|
|
487
481
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
488
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"]>;
|
|
489
484
|
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
490
|
-
/** Absent for an open offer, which whoever accepts first gets. */
|
|
491
485
|
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
492
486
|
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
493
487
|
readonly _tag: Schema.tag<"GiftItem">;
|
|
@@ -529,8 +523,15 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
529
523
|
readonly amount: Schema.optional<Schema.Int>;
|
|
530
524
|
}>>;
|
|
531
525
|
}>]>;
|
|
532
|
-
readonly
|
|
533
|
-
|
|
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<{
|
|
534
535
|
readonly id: Schema.String;
|
|
535
536
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
536
537
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -583,7 +584,7 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
583
584
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
584
585
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
585
586
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
586
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.
|
|
587
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"GetTrade", "GET", "/v1/treasury/trades/:tradeId", Schema.toCodecStringTree<Schema.Struct<{
|
|
587
588
|
tradeId: Schema.String;
|
|
588
589
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
589
590
|
readonly trade: Schema.Struct<{
|
|
@@ -660,11 +661,20 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
660
661
|
readonly event: Schema.String;
|
|
661
662
|
readonly at: Schema.DateTimeUtcFromString;
|
|
662
663
|
}>>;
|
|
663
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
664
|
-
|
|
665
|
-
|
|
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<{
|
|
666
671
|
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
667
|
-
|
|
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<{
|
|
668
678
|
readonly id: Schema.String;
|
|
669
679
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
670
680
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -717,14 +727,11 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
717
727
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
718
728
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
719
729
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
720
|
-
}
|
|
721
|
-
tradeId: Schema.String;
|
|
722
|
-
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
723
|
-
readonly id: Schema.String;
|
|
730
|
+
}>>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ProposeTrade", "POST", "/v1/treasury/trades", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
724
731
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
725
732
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
726
|
-
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
727
733
|
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
734
|
+
/** Absent for an open offer, which whoever accepts first gets. */
|
|
728
735
|
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
729
736
|
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
730
737
|
readonly _tag: Schema.tag<"GiftItem">;
|
|
@@ -766,15 +773,8 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
766
773
|
readonly amount: Schema.optional<Schema.Int>;
|
|
767
774
|
}>>;
|
|
768
775
|
}>]>;
|
|
769
|
-
readonly
|
|
770
|
-
|
|
771
|
-
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
772
|
-
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
773
|
-
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
774
|
-
readonly failureReason: Schema.optional<Schema.String>;
|
|
775
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ConfirmSplice", "POST", "/v1/treasury/trades/:tradeId/confirm", Schema.toCodecStringTree<Schema.Struct<{
|
|
776
|
-
tradeId: Schema.String;
|
|
777
|
-
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
776
|
+
readonly ttlHours: Schema.Int;
|
|
777
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
778
778
|
readonly id: Schema.String;
|
|
779
779
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
780
780
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -827,7 +827,7 @@ export declare const TreasuryGroup: HttpApiGroup.HttpApiGroup<"TreasuryGroup", H
|
|
|
827
827
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
828
828
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
829
829
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
830
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.
|
|
830
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Forbidden | typeof HttpApiError.ServiceUnavailable>, OAuthScope.RequireAccess, never>, false>;
|
|
831
831
|
/**
|
|
832
832
|
* What the treasury tells anyone at all: the stat counters the home page
|
|
833
833
|
* shows. The one group without `RequireAccess` or a scope requirement, and
|
|
@@ -846,20 +846,11 @@ export declare const TreasuryPublicGroup: HttpApiGroup.HttpApiGroup<"TreasuryPub
|
|
|
846
846
|
* @since 1.0.0
|
|
847
847
|
* @category Api
|
|
848
848
|
*/
|
|
849
|
-
export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGroup<"TreasuryGroup", HttpApiEndpoint.HttpApiEndpoint<"
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
readonly connectUrl: Schema.String;
|
|
853
|
-
}>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ListInventory", "GET", "/v1/treasury/inventory/:playerId", Schema.toCodecStringTree<Schema.Struct<{
|
|
854
|
-
playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
855
|
-
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
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<{
|
|
856
852
|
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
857
|
-
|
|
858
|
-
readonly costumes: Schema.$Array<Schema.String>;
|
|
859
|
-
readonly pets: Schema.$Array<Schema.String>;
|
|
860
|
-
readonly coins: Schema.Int;
|
|
861
|
-
readonly bux: Schema.Int;
|
|
862
|
-
}>>, 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<{
|
|
853
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
863
854
|
readonly id: Schema.String;
|
|
864
855
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
865
856
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -912,11 +903,14 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
912
903
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
913
904
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
914
905
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
915
|
-
}
|
|
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;
|
|
916
910
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
917
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"]>;
|
|
918
913
|
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
919
|
-
/** Absent for an open offer, which whoever accepts first gets. */
|
|
920
914
|
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
921
915
|
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
922
916
|
readonly _tag: Schema.tag<"GiftItem">;
|
|
@@ -958,8 +952,15 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
958
952
|
readonly amount: Schema.optional<Schema.Int>;
|
|
959
953
|
}>>;
|
|
960
954
|
}>]>;
|
|
961
|
-
readonly
|
|
962
|
-
|
|
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<{
|
|
963
964
|
readonly id: Schema.String;
|
|
964
965
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
965
966
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -1012,7 +1013,7 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
1012
1013
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1013
1014
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1014
1015
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
1015
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.
|
|
1016
|
+
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"GetTrade", "GET", "/v1/treasury/trades/:tradeId", Schema.toCodecStringTree<Schema.Struct<{
|
|
1016
1017
|
tradeId: Schema.String;
|
|
1017
1018
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1018
1019
|
readonly trade: Schema.Struct<{
|
|
@@ -1089,11 +1090,20 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
1089
1090
|
readonly event: Schema.String;
|
|
1090
1091
|
readonly at: Schema.DateTimeUtcFromString;
|
|
1091
1092
|
}>>;
|
|
1092
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
1093
|
-
|
|
1094
|
-
|
|
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<{
|
|
1095
1100
|
readonly playerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1096
|
-
|
|
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<{
|
|
1097
1107
|
readonly id: Schema.String;
|
|
1098
1108
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1099
1109
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -1146,14 +1156,11 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
1146
1156
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1147
1157
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1148
1158
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
1149
|
-
}
|
|
1150
|
-
tradeId: Schema.String;
|
|
1151
|
-
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1152
|
-
readonly id: Schema.String;
|
|
1159
|
+
}>>>, never, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ProposeTrade", "POST", "/v1/treasury/trades", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1153
1160
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1154
1161
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
1155
|
-
readonly state: Schema.Literals<readonly ["proposed", "accepted", "awaiting_confirmation", "escrowing", "escrowed", "releasing", "executing", "settled", "cancelled", "refunding", "refunded", "expired", "failed"]>;
|
|
1156
1162
|
readonly proposerPlayerId: Schema.brand<Schema.String, "PlayerId">;
|
|
1163
|
+
/** Absent for an open offer, which whoever accepts first gets. */
|
|
1157
1164
|
readonly counterpartyPlayerId: Schema.optional<Schema.brand<Schema.String, "PlayerId">>;
|
|
1158
1165
|
readonly gives: Schema.Union<readonly [Schema.Struct<{
|
|
1159
1166
|
readonly _tag: Schema.tag<"GiftItem">;
|
|
@@ -1195,15 +1202,8 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
1195
1202
|
readonly amount: Schema.optional<Schema.Int>;
|
|
1196
1203
|
}>>;
|
|
1197
1204
|
}>]>;
|
|
1198
|
-
readonly
|
|
1199
|
-
|
|
1200
|
-
readonly counterpartyConfirmedAt: Schema.optional<Schema.DateTimeUtcFromString>;
|
|
1201
|
-
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1202
|
-
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1203
|
-
readonly failureReason: Schema.optional<Schema.String>;
|
|
1204
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.NotFound | typeof HttpApiError.Conflict>, OAuthScope.RequireAccess, never> | HttpApiEndpoint.HttpApiEndpoint<"ConfirmSplice", "POST", "/v1/treasury/trades/:tradeId/confirm", Schema.toCodecStringTree<Schema.Struct<{
|
|
1205
|
-
tradeId: Schema.String;
|
|
1206
|
-
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
1205
|
+
readonly ttlHours: Schema.Int;
|
|
1206
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
1207
1207
|
readonly id: Schema.String;
|
|
1208
1208
|
readonly mechanism: Schema.Literals<readonly ["gift", "splice"]>;
|
|
1209
1209
|
readonly game: Schema.Literals<readonly ["tinytower"]>;
|
|
@@ -1256,7 +1256,7 @@ export declare const Api: HttpApi.HttpApi<"TreasurySdk", HttpApiGroup.HttpApiGro
|
|
|
1256
1256
|
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1257
1257
|
readonly expiresAt: Schema.DateTimeUtcFromString;
|
|
1258
1258
|
readonly failureReason: Schema.optional<Schema.String>;
|
|
1259
|
-
}>>, Schema.toCodecJson<typeof HttpApiError.
|
|
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
1260
|
readonly activeTraders: Schema.Int;
|
|
1261
1261
|
readonly settledTrades: Schema.Int;
|
|
1262
1262
|
readonly itemsMoved: Schema.Int;
|
package/dist/Sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sdk.d.ts","sourceRoot":"","sources":["../src/Sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAC;AAQvD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,8CAAsC,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,yCAAiC,CAAC;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,sMAcrB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,qHASnB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,SAAS,wDAAgD,CAAC;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;EAInB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;EAIrB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;EAGtB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;IAAwC,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAehB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;EAOnB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;EAGtB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0KAmG7B,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;iCAAyD,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IApHZ,kEAAkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAoHoB,CAAC"}
|
package/dist/Sdk.js
CHANGED
|
@@ -45,7 +45,7 @@ import * as Scopes from "./Scopes.js";
|
|
|
45
45
|
*/
|
|
46
46
|
export const TradeMechanism = /*#__PURE__*/Schema.Literals(["gift", "splice"]);
|
|
47
47
|
/**
|
|
48
|
-
* The games the treasury trades in. TinyTower only, until the
|
|
48
|
+
* The games the treasury trades in. TinyTower only, until the tinyburg api
|
|
49
49
|
* serves more.
|
|
50
50
|
*
|
|
51
51
|
* @since 1.0.0
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* These guard the treasury's own api - proposing, accepting and watching
|
|
8
8
|
* trades - not the towers the trades move items between. Acting on a tower
|
|
9
9
|
* (depositing an item into escrow, splicing a save) happens through the
|
|
10
|
-
*
|
|
10
|
+
* tinyburg api under that game's own scopes, with a grant the player gives the
|
|
11
11
|
* treasury separately on the consent screen. Splitting the two means "let the
|
|
12
12
|
* treasury manage my trades" and "let the treasury touch my tower" are
|
|
13
13
|
* distinct questions with distinct answers.
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* These guard the treasury's own api - proposing, accepting and watching
|
|
8
8
|
* trades - not the towers the trades move items between. Acting on a tower
|
|
9
9
|
* (depositing an item into escrow, splicing a save) happens through the
|
|
10
|
-
*
|
|
10
|
+
* tinyburg api under that game's own scopes, with a grant the player gives the
|
|
11
11
|
* treasury separately on the consent screen. Splitting the two means "let the
|
|
12
12
|
* treasury manage my trades" and "let the treasury touch my tower" are
|
|
13
13
|
* distinct questions with distinct answers.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinyburg/treasury-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "treasury (trade escrow) sdk for tinyburg.app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nimblebit",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tinyburg/nimblebit-sdk": "^0.2.
|
|
38
|
-
"@tinyburg/tinytower-sdk": "^0.2.
|
|
37
|
+
"@tinyburg/nimblebit-sdk": "^0.2.1",
|
|
38
|
+
"@tinyburg/tinytower-sdk": "^0.2.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@yielded/auth": "0.1.0-beta.47",
|
package/src/Scopes.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* These guard the treasury's own api - proposing, accepting and watching
|
|
5
5
|
* trades - not the towers the trades move items between. Acting on a tower
|
|
6
6
|
* (depositing an item into escrow, splicing a save) happens through the
|
|
7
|
-
*
|
|
7
|
+
* tinyburg api under that game's own scopes, with a grant the player gives the
|
|
8
8
|
* treasury separately on the consent screen. Splitting the two means "let the
|
|
9
9
|
* treasury manage my trades" and "let the treasury touch my tower" are
|
|
10
10
|
* distinct questions with distinct answers.
|
package/src/Sdk.ts
CHANGED
|
@@ -51,7 +51,7 @@ import * as Scopes from "./Scopes.ts";
|
|
|
51
51
|
export const TradeMechanism = Schema.Literals(["gift", "splice"]);
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* The games the treasury trades in. TinyTower only, until the
|
|
54
|
+
* The games the treasury trades in. TinyTower only, until the tinyburg api
|
|
55
55
|
* serves more.
|
|
56
56
|
*
|
|
57
57
|
* @since 1.0.0
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* These guard the treasury's own api - proposing, accepting and watching
|
|
9
9
|
* trades - not the towers the trades move items between. Acting on a tower
|
|
10
10
|
* (depositing an item into escrow, splicing a save) happens through the
|
|
11
|
-
*
|
|
11
|
+
* tinyburg api under that game's own scopes, with a grant the player gives the
|
|
12
12
|
* treasury separately on the consent screen. Splitting the two means "let the
|
|
13
13
|
* treasury manage my trades" and "let the treasury touch my tower" are
|
|
14
14
|
* distinct questions with distinct answers.
|