@percayso-community/cayso-contracts 0.26.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export const CONTRACT_SCHEMA = {
17
- "contractVersion": "0.26.0",
17
+ "contractVersion": "0.29.0",
18
18
  "packageName": "@percayso-community/cayso-contracts",
19
19
  "capabilities": {
20
20
  "wallet": "cayso.wallet",
@@ -57,6 +57,18 @@ export const CONTRACT_SCHEMA = {
57
57
  "method": "POST",
58
58
  "path": "/api/commercial-payments"
59
59
  },
60
+ "citizenTransfer": {
61
+ "method": "POST",
62
+ "path": "/api/citizen-transfers"
63
+ },
64
+ "handleChange": {
65
+ "method": "POST",
66
+ "path": "/api/handle-changes"
67
+ },
68
+ "handleChangeReceipt": {
69
+ "method": "GET",
70
+ "path": "/api/handle-changes/receipt"
71
+ },
60
72
  "citizenMarket": {
61
73
  "method": "GET",
62
74
  "path": "/api/citizen-market"
@@ -230,6 +242,13 @@ export const CONTRACT_SCHEMA = {
230
242
  "readonly": true,
231
243
  "optional": true
232
244
  },
245
+ "handleChangeReference": {
246
+ "type": {
247
+ "scalar": "string"
248
+ },
249
+ "readonly": true,
250
+ "optional": true
251
+ },
233
252
  "mandateFor": {
234
253
  "type": {
235
254
  "array": {
@@ -654,6 +673,18 @@ export const CONTRACT_SCHEMA = {
654
673
  {
655
674
  "literal": "commercial_payment_store_not_configured"
656
675
  },
676
+ {
677
+ "literal": "citizen_transfer_store_not_configured"
678
+ },
679
+ {
680
+ "literal": "handle_change_store_not_configured"
681
+ },
682
+ {
683
+ "literal": "handle_change_price_not_configured"
684
+ },
685
+ {
686
+ "literal": "handle_change_payee_not_configured"
687
+ },
657
688
  {
658
689
  "literal": "citizen_market_not_configured"
659
690
  },
@@ -696,6 +727,15 @@ export const CONTRACT_SCHEMA = {
696
727
  {
697
728
  "ref": "CommercialPaymentRefusal"
698
729
  },
730
+ {
731
+ "ref": "CitizenTransferRefusal"
732
+ },
733
+ {
734
+ "ref": "HandleChangeRefusal"
735
+ },
736
+ {
737
+ "ref": "HandleChangeReceiptReadRefusal"
738
+ },
699
739
  {
700
740
  "ref": "QuotePlacementRefusal"
701
741
  },
@@ -893,6 +933,163 @@ export const CONTRACT_SCHEMA = {
893
933
  }
894
934
  }
895
935
  },
936
+ "CitizenTransfer": {
937
+ "kind": "object",
938
+ "properties": {
939
+ "movementId": {
940
+ "type": {
941
+ "scalar": "string"
942
+ },
943
+ "readonly": true,
944
+ "optional": false
945
+ },
946
+ "fromWalletId": {
947
+ "type": {
948
+ "scalar": "string"
949
+ },
950
+ "readonly": true,
951
+ "optional": false
952
+ },
953
+ "payeeWalletId": {
954
+ "type": {
955
+ "scalar": "string"
956
+ },
957
+ "readonly": true,
958
+ "optional": false
959
+ },
960
+ "cents": {
961
+ "type": {
962
+ "ref": "Cents"
963
+ },
964
+ "readonly": true,
965
+ "optional": false
966
+ },
967
+ "transferredAt": {
968
+ "type": {
969
+ "ref": "Millis"
970
+ },
971
+ "readonly": true,
972
+ "optional": false
973
+ }
974
+ }
975
+ },
976
+ "CitizenTransferMade": {
977
+ "kind": "object",
978
+ "properties": {
979
+ "outcome": {
980
+ "type": {
981
+ "literal": "transferred"
982
+ },
983
+ "readonly": true,
984
+ "optional": false
985
+ },
986
+ "transfer": {
987
+ "type": {
988
+ "ref": "CitizenTransfer"
989
+ },
990
+ "readonly": true,
991
+ "optional": false
992
+ }
993
+ }
994
+ },
995
+ "CitizenTransferRefusal": {
996
+ "kind": "alias",
997
+ "of": {
998
+ "union": [
999
+ {
1000
+ "literal": "assurance_not_money_grade"
1001
+ },
1002
+ {
1003
+ "literal": "sender_has_no_citizen_wallet"
1004
+ },
1005
+ {
1006
+ "literal": "payee_wallet_not_found"
1007
+ },
1008
+ {
1009
+ "literal": "payee_wallet_not_a_citizens"
1010
+ },
1011
+ {
1012
+ "literal": "payee_wallet_has_no_live_binding"
1013
+ },
1014
+ {
1015
+ "literal": "payee_is_the_sender"
1016
+ },
1017
+ {
1018
+ "literal": "amount_not_positive_whole_cents"
1019
+ },
1020
+ {
1021
+ "literal": "unrestricted_cents_insufficient"
1022
+ },
1023
+ {
1024
+ "literal": "cents_frozen"
1025
+ },
1026
+ {
1027
+ "literal": "idempotency_key_reused_for_a_different_transfer"
1028
+ },
1029
+ {
1030
+ "literal": "carve_contended"
1031
+ }
1032
+ ]
1033
+ }
1034
+ },
1035
+ "CitizenTransferRefused": {
1036
+ "kind": "object",
1037
+ "properties": {
1038
+ "outcome": {
1039
+ "type": {
1040
+ "literal": "refused"
1041
+ },
1042
+ "readonly": true,
1043
+ "optional": false
1044
+ },
1045
+ "error": {
1046
+ "type": {
1047
+ "ref": "CitizenTransferRefusal"
1048
+ },
1049
+ "readonly": true,
1050
+ "optional": false
1051
+ }
1052
+ }
1053
+ },
1054
+ "CitizenTransferRequest": {
1055
+ "kind": "object",
1056
+ "properties": {
1057
+ "payeeWalletId": {
1058
+ "type": {
1059
+ "scalar": "string"
1060
+ },
1061
+ "readonly": true,
1062
+ "optional": false
1063
+ },
1064
+ "cents": {
1065
+ "type": {
1066
+ "ref": "Cents"
1067
+ },
1068
+ "readonly": true,
1069
+ "optional": false
1070
+ },
1071
+ "idempotencyKey": {
1072
+ "type": {
1073
+ "scalar": "string"
1074
+ },
1075
+ "readonly": true,
1076
+ "optional": false
1077
+ }
1078
+ }
1079
+ },
1080
+ "CitizenTransferResponse": {
1081
+ "kind": "alias",
1082
+ "of": {
1083
+ "union": [
1084
+ {
1085
+ "ref": "CitizenTransferMade"
1086
+ },
1087
+ {
1088
+ "ref": "CitizenTransferRefused"
1089
+ }
1090
+ ]
1091
+ }
1092
+ },
896
1093
  "Citizenship": {
897
1094
  "kind": "alias",
898
1095
  "of": {
@@ -1329,6 +1526,15 @@ export const CONTRACT_SCHEMA = {
1329
1526
  {
1330
1527
  "literal": "make-commercial-payment"
1331
1528
  },
1529
+ {
1530
+ "literal": "make-citizen-transfer"
1531
+ },
1532
+ {
1533
+ "literal": "change-handle"
1534
+ },
1535
+ {
1536
+ "literal": "read-handle-change-receipt"
1537
+ },
1332
1538
  {
1333
1539
  "literal": "place-quote"
1334
1540
  },
@@ -1574,6 +1780,255 @@ export const CONTRACT_SCHEMA = {
1574
1780
  ]
1575
1781
  }
1576
1782
  },
1783
+ "HandleChangeCharged": {
1784
+ "kind": "object",
1785
+ "properties": {
1786
+ "outcome": {
1787
+ "type": {
1788
+ "literal": "charged"
1789
+ },
1790
+ "readonly": true,
1791
+ "optional": false
1792
+ },
1793
+ "receipt": {
1794
+ "type": {
1795
+ "ref": "HandleChangeReceipt"
1796
+ },
1797
+ "readonly": true,
1798
+ "optional": false
1799
+ }
1800
+ }
1801
+ },
1802
+ "HandleChangeNoCharge": {
1803
+ "kind": "object",
1804
+ "properties": {
1805
+ "outcome": {
1806
+ "type": {
1807
+ "literal": "no-charge"
1808
+ },
1809
+ "readonly": true,
1810
+ "optional": false
1811
+ }
1812
+ }
1813
+ },
1814
+ "HandleChangeReceipt": {
1815
+ "kind": "object",
1816
+ "properties": {
1817
+ "statement": {
1818
+ "type": {
1819
+ "ref": "HandleChangeReceiptStatement"
1820
+ },
1821
+ "readonly": true,
1822
+ "optional": false
1823
+ },
1824
+ "signature": {
1825
+ "type": {
1826
+ "scalar": "string"
1827
+ },
1828
+ "readonly": true,
1829
+ "optional": false
1830
+ }
1831
+ }
1832
+ },
1833
+ "HandleChangeReceiptFound": {
1834
+ "kind": "object",
1835
+ "properties": {
1836
+ "outcome": {
1837
+ "type": {
1838
+ "literal": "receipt"
1839
+ },
1840
+ "readonly": true,
1841
+ "optional": false
1842
+ },
1843
+ "receipt": {
1844
+ "type": {
1845
+ "ref": "HandleChangeReceipt"
1846
+ },
1847
+ "readonly": true,
1848
+ "optional": false
1849
+ }
1850
+ }
1851
+ },
1852
+ "HandleChangeReceiptReadRefusal": {
1853
+ "kind": "alias",
1854
+ "of": {
1855
+ "union": [
1856
+ {
1857
+ "literal": "payer_has_no_citizen_wallet"
1858
+ },
1859
+ {
1860
+ "literal": "handle_change_reference_charged_to_another_wallet"
1861
+ }
1862
+ ]
1863
+ }
1864
+ },
1865
+ "HandleChangeReceiptReadRefused": {
1866
+ "kind": "object",
1867
+ "properties": {
1868
+ "outcome": {
1869
+ "type": {
1870
+ "literal": "refused"
1871
+ },
1872
+ "readonly": true,
1873
+ "optional": false
1874
+ },
1875
+ "error": {
1876
+ "type": {
1877
+ "ref": "HandleChangeReceiptReadRefusal"
1878
+ },
1879
+ "readonly": true,
1880
+ "optional": false
1881
+ }
1882
+ }
1883
+ },
1884
+ "HandleChangeReceiptReadResponse": {
1885
+ "kind": "alias",
1886
+ "of": {
1887
+ "union": [
1888
+ {
1889
+ "ref": "HandleChangeReceiptFound"
1890
+ },
1891
+ {
1892
+ "ref": "HandleChangeNoCharge"
1893
+ },
1894
+ {
1895
+ "ref": "HandleChangeReceiptReadRefused"
1896
+ }
1897
+ ]
1898
+ }
1899
+ },
1900
+ "HandleChangeReceiptStatement": {
1901
+ "kind": "object",
1902
+ "properties": {
1903
+ "reason": {
1904
+ "type": {
1905
+ "literal": "handle-change"
1906
+ },
1907
+ "readonly": true,
1908
+ "optional": false
1909
+ },
1910
+ "movementKind": {
1911
+ "type": {
1912
+ "literal": "charge"
1913
+ },
1914
+ "readonly": true,
1915
+ "optional": false
1916
+ },
1917
+ "movementId": {
1918
+ "type": {
1919
+ "scalar": "string"
1920
+ },
1921
+ "readonly": true,
1922
+ "optional": false
1923
+ },
1924
+ "handleChangeReference": {
1925
+ "type": {
1926
+ "scalar": "string"
1927
+ },
1928
+ "readonly": true,
1929
+ "optional": false
1930
+ },
1931
+ "assertionIssuer": {
1932
+ "type": {
1933
+ "scalar": "string"
1934
+ },
1935
+ "readonly": true,
1936
+ "optional": false
1937
+ },
1938
+ "assertionId": {
1939
+ "type": {
1940
+ "scalar": "string"
1941
+ },
1942
+ "readonly": true,
1943
+ "optional": false
1944
+ },
1945
+ "payerWalletId": {
1946
+ "type": {
1947
+ "scalar": "string"
1948
+ },
1949
+ "readonly": true,
1950
+ "optional": false
1951
+ },
1952
+ "payeeLeg": {
1953
+ "type": {
1954
+ "ref": "MarketplaceReceiptLeg"
1955
+ },
1956
+ "readonly": true,
1957
+ "optional": false
1958
+ },
1959
+ "writtenAt": {
1960
+ "type": {
1961
+ "ref": "Millis"
1962
+ },
1963
+ "readonly": true,
1964
+ "optional": false
1965
+ },
1966
+ "keyId": {
1967
+ "type": {
1968
+ "ref": "MarketplaceReceiptKeyId"
1969
+ },
1970
+ "readonly": true,
1971
+ "optional": false
1972
+ }
1973
+ }
1974
+ },
1975
+ "HandleChangeRefusal": {
1976
+ "kind": "alias",
1977
+ "of": {
1978
+ "union": [
1979
+ {
1980
+ "literal": "assurance_not_money_grade"
1981
+ },
1982
+ {
1983
+ "literal": "payer_has_no_citizen_wallet"
1984
+ },
1985
+ {
1986
+ "literal": "cents_insufficient"
1987
+ },
1988
+ {
1989
+ "literal": "cents_frozen"
1990
+ },
1991
+ {
1992
+ "literal": "handle_change_reference_charged_to_another_wallet"
1993
+ },
1994
+ {
1995
+ "literal": "carve_contended"
1996
+ }
1997
+ ]
1998
+ }
1999
+ },
2000
+ "HandleChangeRefused": {
2001
+ "kind": "object",
2002
+ "properties": {
2003
+ "outcome": {
2004
+ "type": {
2005
+ "literal": "refused"
2006
+ },
2007
+ "readonly": true,
2008
+ "optional": false
2009
+ },
2010
+ "error": {
2011
+ "type": {
2012
+ "ref": "HandleChangeRefusal"
2013
+ },
2014
+ "readonly": true,
2015
+ "optional": false
2016
+ }
2017
+ }
2018
+ },
2019
+ "HandleChangeResponse": {
2020
+ "kind": "alias",
2021
+ "of": {
2022
+ "union": [
2023
+ {
2024
+ "ref": "HandleChangeCharged"
2025
+ },
2026
+ {
2027
+ "ref": "HandleChangeRefused"
2028
+ }
2029
+ ]
2030
+ }
2031
+ },
1577
2032
  "HolderType": {
1578
2033
  "kind": "alias",
1579
2034
  "of": {
@@ -1828,6 +2283,9 @@ export const CONTRACT_SCHEMA = {
1828
2283
  {
1829
2284
  "literal": "allocation_policy_version_not_configured"
1830
2285
  },
2286
+ {
2287
+ "literal": "allocation_share_out_of_range"
2288
+ },
1831
2289
  {
1832
2290
  "literal": "payee_wallet_not_found"
1833
2291
  },
@@ -1837,6 +2295,9 @@ export const CONTRACT_SCHEMA = {
1837
2295
  {
1838
2296
  "literal": "payee_wallet_has_no_live_binding"
1839
2297
  },
2298
+ {
2299
+ "literal": "payee_wallet_is_the_buyers"
2300
+ },
1840
2301
  {
1841
2302
  "literal": "unrestricted_cents_insufficient"
1842
2303
  },
@@ -4047,6 +4508,9 @@ export const CONTRACT_SCHEMA = {
4047
4508
  },
4048
4509
  {
4049
4510
  "literal": "quoted_sale_compensation"
4511
+ },
4512
+ {
4513
+ "literal": "marketplace_settlement"
4050
4514
  }
4051
4515
  ]
4052
4516
  }
package/dist/errors.d.ts CHANGED
@@ -44,6 +44,8 @@
44
44
  import type { FounderClaimRefusal } from './citizenship.js';
45
45
  import type { BuyBackRefusal, QuotePlacementRefusal, QuoteWithdrawalRefusal } from './citizen-market.js';
46
46
  import type { SettlementAssertionRefusal, StandingAuthorisationRefusal } from './cloud-settlement.js';
47
+ import type { CitizenTransferRefusal } from './citizen-transfer.js';
48
+ import type { HandleChangeReceiptReadRefusal, HandleChangeRefusal } from './handle-change.js';
47
49
  import type { CommercialPaymentRefusal } from './commercial-payment.js';
48
50
  import type { MarketplaceReceiptReadRefusal } from './marketplace-receipt.js';
49
51
  import type { MarketplaceOrderRefusal, MarketplaceRefundRefusal } from './marketplace-settlement.js';
@@ -119,6 +121,27 @@ export type CaysoApiErrorCode =
119
121
  * (CAY-0079 §3).
120
122
  */
121
123
  | 'commercial_payment_store_not_configured'
124
+ /**
125
+ * No Citizen transfer store is wired, so the route is closed (CAY-0088 §3). It
126
+ * describes the deployment and not the transfer, so it is not a member of the
127
+ * transfer's refusal union.
128
+ */
129
+ | 'citizen_transfer_store_not_configured'
130
+ /**
131
+ * No Handle-change store is wired, so the route is closed (CAY-0091). It describes
132
+ * the deployment and not the payment, so it is not a member of the refusal union.
133
+ */
134
+ | 'handle_change_store_not_configured'
135
+ /**
136
+ * The Handle-change price is not configured on this deployment, so nothing can be
137
+ * charged (CAY-0091). An unset price is a closed door, never a free Handle change.
138
+ */
139
+ | 'handle_change_price_not_configured'
140
+ /**
141
+ * The Organisation Wallet a Handle change is charged to is not configured on this
142
+ * deployment (CAY-0091). There is no default payee, so the route is closed.
143
+ */
144
+ | 'handle_change_payee_not_configured'
122
145
  /**
123
146
  * The citizen market is shut on this deployment: no store is wired, or a figure
124
147
  * the book needs is not set in the canon and so not configured here (CAY-0080,
@@ -164,11 +187,13 @@ export type CaysoApiErrorCode =
164
187
  */
165
188
  | 'marketplace_order_store_not_configured'
166
189
  /**
167
- * The signed order pays a Citizen publisher, and this version serves the
168
- * house-publisher sale only (CAY-0082 §2). Nothing was checked against the payee and
169
- * nothing moved. A seam code rather than a {@link MarketplaceOrderRefusal}, because it
170
- * describes this deployment and not the order; the third-party sale retires it when
171
- * it ships.
190
+ * The signed order pays a Citizen publisher and carries no Community share
191
+ * (`communityShareBasisPoints`): Store Platform signed it before CAY-0090 put the
192
+ * share in the order, so Cayso has no figure to divide the price by. Nothing was
193
+ * checked against the payee and nothing moved. Before the share was a fact every
194
+ * Citizen publisher's order was answered this way; now only one without it is.
195
+ * A seam code rather than a {@link MarketplaceOrderRefusal}, because it describes
196
+ * what the deployments in the path speak and not the order.
172
197
  */
173
198
  | 'third_party_marketplace_sale_not_served'
174
199
  /** The request body or parameters did not satisfy the declared schema. */
@@ -176,7 +201,7 @@ export type CaysoApiErrorCode =
176
201
  /** There is no such purchase under this caller's wallet. */
177
202
  | 'not_found'
178
203
  /** Something failed on the way and the refusal discloses nothing further. */
179
- | 'internal_error' | PurchaseFailureReason | PurchaseCancelRefusalReason | FounderClaimRefusal | CommercialPaymentRefusal | QuotePlacementRefusal | QuoteWithdrawalRefusal | BuyBackRefusal | MarketplaceReceiptReadRefusal | MarketplaceOrderRefusal | MarketplaceRefundRefusal | StandingAuthorisationRefusal | SettlementAssertionRefusal;
204
+ | 'internal_error' | PurchaseFailureReason | PurchaseCancelRefusalReason | FounderClaimRefusal | CommercialPaymentRefusal | CitizenTransferRefusal | HandleChangeRefusal | HandleChangeReceiptReadRefusal | QuotePlacementRefusal | QuoteWithdrawalRefusal | BuyBackRefusal | MarketplaceReceiptReadRefusal | MarketplaceOrderRefusal | MarketplaceRefundRefusal | StandingAuthorisationRefusal | SettlementAssertionRefusal;
180
205
  /**
181
206
  * The body of every refusal on this surface: one code, and nothing beside it.
182
207
  *