@agoric/zoe 0.26.3-dev-da3b8a8.0 → 0.26.3-dev-afcbcd7.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.
Files changed (225) hide show
  1. package/bundles/bundle-contractFacet-js-meta.json +185 -195
  2. package/bundles/bundle-contractFacet.js +1 -1
  3. package/package.json +15 -12
  4. package/src/contractFacet/zcfZygote.js +3 -4
  5. package/src/contractSupport/ratio.js +1 -1
  6. package/src/contracts/callSpread/calculateShares.js +1 -1
  7. package/src/contracts/callSpread/fundedCallSpread.js +1 -1
  8. package/src/contracts/callSpread/payoffHandler.js +1 -1
  9. package/src/contracts/callSpread/pricedCallSpread.js +1 -1
  10. package/src/contracts/exported.js +1 -1
  11. package/src/contracts/loan/close.js +1 -1
  12. package/src/contracts/priceAggregator.js +1 -1
  13. package/src/zoeService/escrowStorage.js +1 -1
  14. package/src/zoeService/zoe.js +3 -4
  15. package/src/zoeService/zoeStorageManager.js +1 -1
  16. package/bundles/bundle-contractFacet.d.ts +0 -7
  17. package/bundles/bundle-contractFacet.d.ts.map +0 -1
  18. package/src/cleanProposal.d.ts +0 -9
  19. package/src/cleanProposal.d.ts.map +0 -1
  20. package/src/contractFacet/allocationMath.d.ts +0 -7
  21. package/src/contractFacet/allocationMath.d.ts.map +0 -1
  22. package/src/contractFacet/evalContractCode.d.ts +0 -2
  23. package/src/contractFacet/evalContractCode.d.ts.map +0 -1
  24. package/src/contractFacet/exit.d.ts +0 -2
  25. package/src/contractFacet/exit.d.ts.map +0 -1
  26. package/src/contractFacet/internal-types.d.ts +0 -8
  27. package/src/contractFacet/internal-types.d.ts.map +0 -1
  28. package/src/contractFacet/offerHandlerStorage.d.ts +0 -5
  29. package/src/contractFacet/offerHandlerStorage.d.ts.map +0 -1
  30. package/src/contractFacet/offerSafety.d.ts +0 -34
  31. package/src/contractFacet/offerSafety.d.ts.map +0 -1
  32. package/src/contractFacet/reallocate.d.ts +0 -3
  33. package/src/contractFacet/reallocate.d.ts.map +0 -1
  34. package/src/contractFacet/rightsConservation.d.ts +0 -12
  35. package/src/contractFacet/rightsConservation.d.ts.map +0 -1
  36. package/src/contractFacet/vatRoot.d.ts +0 -14
  37. package/src/contractFacet/vatRoot.d.ts.map +0 -1
  38. package/src/contractFacet/zcfMint.d.ts +0 -6
  39. package/src/contractFacet/zcfMint.d.ts.map +0 -1
  40. package/src/contractFacet/zcfSeat.d.ts +0 -3
  41. package/src/contractFacet/zcfSeat.d.ts.map +0 -1
  42. package/src/contractFacet/zcfZygote.d.ts +0 -3
  43. package/src/contractFacet/zcfZygote.d.ts.map +0 -1
  44. package/src/contractSupport/atomicTransfer.d.ts +0 -6
  45. package/src/contractSupport/atomicTransfer.d.ts.map +0 -1
  46. package/src/contractSupport/bondingCurves.d.ts +0 -6
  47. package/src/contractSupport/bondingCurves.d.ts.map +0 -1
  48. package/src/contractSupport/durability.d.ts +0 -5
  49. package/src/contractSupport/durability.d.ts.map +0 -1
  50. package/src/contractSupport/index.d.ts +0 -13
  51. package/src/contractSupport/index.d.ts.map +0 -1
  52. package/src/contractSupport/priceAuthority.d.ts +0 -37
  53. package/src/contractSupport/priceAuthority.d.ts.map +0 -1
  54. package/src/contractSupport/priceAuthorityInitial.d.ts +0 -3
  55. package/src/contractSupport/priceAuthorityInitial.d.ts.map +0 -1
  56. package/src/contractSupport/priceAuthorityQuoteMint.d.ts +0 -2
  57. package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +0 -1
  58. package/src/contractSupport/priceAuthorityTransform.d.ts +0 -15
  59. package/src/contractSupport/priceAuthorityTransform.d.ts.map +0 -1
  60. package/src/contractSupport/priceQuote.d.ts +0 -7
  61. package/src/contractSupport/priceQuote.d.ts.map +0 -1
  62. package/src/contractSupport/ratio.d.ts +0 -28
  63. package/src/contractSupport/ratio.d.ts.map +0 -1
  64. package/src/contractSupport/recorder.d.ts +0 -229
  65. package/src/contractSupport/recorder.d.ts.map +0 -1
  66. package/src/contractSupport/safeMath.d.ts +0 -11
  67. package/src/contractSupport/safeMath.d.ts.map +0 -1
  68. package/src/contractSupport/stateMachine.d.ts +0 -6
  69. package/src/contractSupport/stateMachine.d.ts.map +0 -1
  70. package/src/contractSupport/statistics.d.ts +0 -7
  71. package/src/contractSupport/statistics.d.ts.map +0 -1
  72. package/src/contractSupport/topics.d.ts +0 -22
  73. package/src/contractSupport/topics.d.ts.map +0 -1
  74. package/src/contractSupport/types.d.ts +0 -63
  75. package/src/contractSupport/types.d.ts.map +0 -1
  76. package/src/contractSupport/zoeHelpers.d.ts +0 -30
  77. package/src/contractSupport/zoeHelpers.d.ts.map +0 -1
  78. package/src/contracts/atomicSwap.d.ts +0 -16
  79. package/src/contracts/atomicSwap.d.ts.map +0 -1
  80. package/src/contracts/auction/assertBidSeat.d.ts +0 -2
  81. package/src/contracts/auction/assertBidSeat.d.ts.map +0 -1
  82. package/src/contracts/auction/firstPriceLogic.d.ts +0 -2
  83. package/src/contracts/auction/firstPriceLogic.d.ts.map +0 -1
  84. package/src/contracts/auction/index.d.ts +0 -56
  85. package/src/contracts/auction/index.d.ts.map +0 -1
  86. package/src/contracts/auction/secondPriceLogic.d.ts +0 -2
  87. package/src/contracts/auction/secondPriceLogic.d.ts.map +0 -1
  88. package/src/contracts/automaticRefund.d.ts +0 -25
  89. package/src/contracts/automaticRefund.d.ts.map +0 -1
  90. package/src/contracts/autoswap.d.ts +0 -43
  91. package/src/contracts/autoswap.d.ts.map +0 -1
  92. package/src/contracts/barterExchange.d.ts +0 -22
  93. package/src/contracts/barterExchange.d.ts.map +0 -1
  94. package/src/contracts/callSpread/calculateShares.d.ts +0 -2
  95. package/src/contracts/callSpread/calculateShares.d.ts.map +0 -1
  96. package/src/contracts/callSpread/fundedCallSpread.d.ts +0 -60
  97. package/src/contracts/callSpread/fundedCallSpread.d.ts.map +0 -1
  98. package/src/contracts/callSpread/payoffHandler.d.ts +0 -11
  99. package/src/contracts/callSpread/payoffHandler.d.ts.map +0 -1
  100. package/src/contracts/callSpread/percent.d.ts +0 -3
  101. package/src/contracts/callSpread/percent.d.ts.map +0 -1
  102. package/src/contracts/callSpread/position.d.ts +0 -10
  103. package/src/contracts/callSpread/position.d.ts.map +0 -1
  104. package/src/contracts/callSpread/pricedCallSpread.d.ts +0 -66
  105. package/src/contracts/callSpread/pricedCallSpread.d.ts.map +0 -1
  106. package/src/contracts/callSpread/types.d.ts +0 -30
  107. package/src/contracts/callSpread/types.d.ts.map +0 -1
  108. package/src/contracts/coveredCall-durable.d.ts +0 -23
  109. package/src/contracts/coveredCall-durable.d.ts.map +0 -1
  110. package/src/contracts/coveredCall.d.ts +0 -64
  111. package/src/contracts/coveredCall.d.ts.map +0 -1
  112. package/src/contracts/exported.d.ts +0 -2
  113. package/src/contracts/exported.d.ts.map +0 -1
  114. package/src/contracts/loan/addCollateral.d.ts +0 -3
  115. package/src/contracts/loan/addCollateral.d.ts.map +0 -1
  116. package/src/contracts/loan/borrow.d.ts +0 -3
  117. package/src/contracts/loan/borrow.d.ts.map +0 -1
  118. package/src/contracts/loan/close.d.ts +0 -3
  119. package/src/contracts/loan/close.d.ts.map +0 -1
  120. package/src/contracts/loan/index.d.ts +0 -64
  121. package/src/contracts/loan/index.d.ts.map +0 -1
  122. package/src/contracts/loan/lend.d.ts +0 -3
  123. package/src/contracts/loan/lend.d.ts.map +0 -1
  124. package/src/contracts/loan/liquidate.d.ts +0 -3
  125. package/src/contracts/loan/liquidate.d.ts.map +0 -1
  126. package/src/contracts/loan/scheduleLiquidation.d.ts +0 -3
  127. package/src/contracts/loan/scheduleLiquidation.d.ts.map +0 -1
  128. package/src/contracts/loan/types.d.ts +0 -161
  129. package/src/contracts/loan/types.d.ts.map +0 -1
  130. package/src/contracts/loan/updateDebt.d.ts +0 -11
  131. package/src/contracts/loan/updateDebt.d.ts.map +0 -1
  132. package/src/contracts/mintAndSellNFT.d.ts +0 -28
  133. package/src/contracts/mintAndSellNFT.d.ts.map +0 -1
  134. package/src/contracts/mintPayments.d.ts +0 -30
  135. package/src/contracts/mintPayments.d.ts.map +0 -1
  136. package/src/contracts/oracle.d.ts +0 -26
  137. package/src/contracts/oracle.d.ts.map +0 -1
  138. package/src/contracts/otcDesk.d.ts +0 -79
  139. package/src/contracts/otcDesk.d.ts.map +0 -1
  140. package/src/contracts/priceAggregator.d.ts +0 -91
  141. package/src/contracts/priceAggregator.d.ts.map +0 -1
  142. package/src/contracts/priceAggregatorTypes.d.ts +0 -77
  143. package/src/contracts/priceAggregatorTypes.d.ts.map +0 -1
  144. package/src/contracts/scaledPriceAuthority.d.ts +0 -23
  145. package/src/contracts/scaledPriceAuthority.d.ts.map +0 -1
  146. package/src/contracts/sellItems.d.ts +0 -30
  147. package/src/contracts/sellItems.d.ts.map +0 -1
  148. package/src/contracts/simpleExchange.d.ts +0 -37
  149. package/src/contracts/simpleExchange.d.ts.map +0 -1
  150. package/src/contracts/types.d.ts +0 -80
  151. package/src/contracts/types.d.ts.map +0 -1
  152. package/src/handleWarning.d.ts +0 -3
  153. package/src/handleWarning.d.ts.map +0 -1
  154. package/src/instanceRecordStorage.d.ts +0 -2
  155. package/src/instanceRecordStorage.d.ts.map +0 -1
  156. package/src/internal-types.d.ts +0 -177
  157. package/src/internal-types.d.ts.map +0 -1
  158. package/src/issuerRecord.d.ts +0 -3
  159. package/src/issuerRecord.d.ts.map +0 -1
  160. package/src/issuerStorage.d.ts +0 -14
  161. package/src/issuerStorage.d.ts.map +0 -1
  162. package/src/makeHandle.d.ts +0 -4
  163. package/src/makeHandle.d.ts.map +0 -1
  164. package/src/objArrayConversion.d.ts +0 -5
  165. package/src/objArrayConversion.d.ts.map +0 -1
  166. package/src/typeGuards.d.ts +0 -168
  167. package/src/typeGuards.d.ts.map +0 -1
  168. package/src/types.d.ts +0 -45
  169. package/src/types.d.ts.map +0 -1
  170. package/src/zoeService/createZCFVat.d.ts +0 -2
  171. package/src/zoeService/createZCFVat.d.ts.map +0 -1
  172. package/src/zoeService/escrowStorage.d.ts +0 -7
  173. package/src/zoeService/escrowStorage.d.ts.map +0 -1
  174. package/src/zoeService/feeMint.d.ts +0 -30
  175. package/src/zoeService/feeMint.d.ts.map +0 -1
  176. package/src/zoeService/installationStorage.d.ts +0 -35
  177. package/src/zoeService/installationStorage.d.ts.map +0 -1
  178. package/src/zoeService/instanceAdminStorage.d.ts +0 -123
  179. package/src/zoeService/instanceAdminStorage.d.ts.map +0 -1
  180. package/src/zoeService/internal-types.d.ts +0 -90
  181. package/src/zoeService/internal-types.d.ts.map +0 -1
  182. package/src/zoeService/invitationQueries.d.ts +0 -6
  183. package/src/zoeService/invitationQueries.d.ts.map +0 -1
  184. package/src/zoeService/makeInvitation.d.ts +0 -5
  185. package/src/zoeService/makeInvitation.d.ts.map +0 -1
  186. package/src/zoeService/offer/burnInvitation.d.ts +0 -5
  187. package/src/zoeService/offer/burnInvitation.d.ts.map +0 -1
  188. package/src/zoeService/offer/offer.d.ts +0 -2
  189. package/src/zoeService/offer/offer.d.ts.map +0 -1
  190. package/src/zoeService/startInstance.d.ts +0 -4
  191. package/src/zoeService/startInstance.d.ts.map +0 -1
  192. package/src/zoeService/types.d.ts +0 -226
  193. package/src/zoeService/types.d.ts.map +0 -1
  194. package/src/zoeService/zoe.d.ts +0 -61
  195. package/src/zoeService/zoe.d.ts.map +0 -1
  196. package/src/zoeService/zoeSeat.d.ts +0 -56
  197. package/src/zoeService/zoeSeat.d.ts.map +0 -1
  198. package/src/zoeService/zoeStorageManager.d.ts +0 -75
  199. package/src/zoeService/zoeStorageManager.d.ts.map +0 -1
  200. package/tools/fakePriceAuthority.d.ts +0 -30
  201. package/tools/fakePriceAuthority.d.ts.map +0 -1
  202. package/tools/fakeVatAdmin.d.ts +0 -103
  203. package/tools/fakeVatAdmin.d.ts.map +0 -1
  204. package/tools/internal-types.d.ts +0 -12
  205. package/tools/internal-types.d.ts.map +0 -1
  206. package/tools/manualPriceAuthority.d.ts +0 -20
  207. package/tools/manualPriceAuthority.d.ts.map +0 -1
  208. package/tools/manualTimer.d.ts +0 -44
  209. package/tools/manualTimer.d.ts.map +0 -1
  210. package/tools/prepare-test-env-ava.d.ts +0 -2
  211. package/tools/prepare-test-env-ava.d.ts.map +0 -1
  212. package/tools/prepare-test-env.d.ts +0 -2
  213. package/tools/prepare-test-env.d.ts.map +0 -1
  214. package/tools/priceAuthorityRegistry.d.ts +0 -20
  215. package/tools/priceAuthorityRegistry.d.ts.map +0 -1
  216. package/tools/scriptedOracle.d.ts +0 -27
  217. package/tools/scriptedOracle.d.ts.map +0 -1
  218. package/tools/scriptedPriceAuthority.d.ts +0 -2
  219. package/tools/scriptedPriceAuthority.d.ts.map +0 -1
  220. package/tools/setup-zoe.d.ts +0 -35
  221. package/tools/setup-zoe.d.ts.map +0 -1
  222. package/tools/types-ambient.d.ts +0 -142
  223. package/tools/types-ambient.d.ts.map +0 -1
  224. package/tools/types.d.ts +0 -142
  225. package/tools/types.d.ts.map +0 -1
@@ -1,30 +0,0 @@
1
- /**
2
- * This is a very simple contract that creates a new issuer and mints payments
3
- * from it, in order to give an example of how that can be done. This contract
4
- * sends new tokens to anyone who has an invitation.
5
- *
6
- * The expectation is that most contracts that want to do something similar
7
- * would use the ability to mint new payments internally rather than sharing
8
- * that ability widely as this one does.
9
- *
10
- * To pay others in tokens, the creator of the instance can make
11
- * invitations for them, which when used to make an offer, will payout
12
- * the specified amount of tokens.
13
- *
14
- * @param {ZCF} zcf
15
- */
16
- export function start(zcf: ZCF): Promise<{
17
- creatorFacet: {
18
- makeInvitation: (value?: bigint) => Promise<Invitation<R, A>>;
19
- getTokenIssuer: () => Issuer<"nat">;
20
- } & import("@endo/eventual-send").RemotableBrand<{}, {
21
- makeInvitation: (value?: bigint) => Promise<Invitation<R, A>>;
22
- getTokenIssuer: () => Issuer<"nat">;
23
- }>;
24
- publicFacet: {
25
- getTokenIssuer: () => Issuer<"nat">;
26
- } & import("@endo/eventual-send").RemotableBrand<{}, {
27
- getTokenIssuer: () => Issuer<"nat">;
28
- }>;
29
- }>;
30
- //# sourceMappingURL=mintPayments.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mintPayments.d.ts","sourceRoot":"","sources":["mintPayments.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,2BAFW,GAAG;;;;;;;;;;;;;GAyCb"}
@@ -1,26 +0,0 @@
1
- export type OracleContract = ContractOf<typeof start>;
2
- export type OracleStart = typeof start;
3
- /**
4
- * This contract provides oracle queries for a fee or for free.
5
- *
6
- * @param {ZCF} zcf
7
- */
8
- export function start(zcf: ZCF): Promise<{
9
- creatorFacet: {
10
- initialize(privateParams: any): OracleCreatorFacet;
11
- } & import("@endo/eventual-send").RemotableBrand<{}, {
12
- initialize(privateParams: any): OracleCreatorFacet;
13
- }>;
14
- publicFacet: {
15
- /** @param {OracleQuery} query */
16
- query(query: OracleQuery): Promise<unknown>;
17
- /** @param {OracleQuery} query */
18
- makeQueryInvitation(query: OracleQuery): Promise<Invitation<R, A>>;
19
- } & import("@endo/eventual-send").RemotableBrand<{}, {
20
- /** @param {OracleQuery} query */
21
- query(query: OracleQuery): Promise<unknown>;
22
- /** @param {OracleQuery} query */
23
- makeQueryInvitation(query: OracleQuery): Promise<Invitation<R, A>>;
24
- }>;
25
- }>;
26
- //# sourceMappingURL=oracle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["oracle.js"],"names":[],"mappings":"6BAyGc,WAAW,YAAY,CAAC;0BACxB,YAAY;AAlG1B;;;;GAIG;AACH,2BAFW,GAAG;;;;;;;QAkDV,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;QAhBvB,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;GAwB1B"}
@@ -1,79 +0,0 @@
1
- /**
2
- * This contract is inspired by the description of an OTC Desk smart
3
- * contract in this article:
4
- * https://medium.com/dragonfly-research/unbundling-uniswap-the-future-of-on-chain-market-making-1c7d6948d570
5
- *
6
- * The creator of this contract instance can take three actions: add
7
- * inventory, remove inventory, and make quotes for potential trading
8
- * partners.
9
- *
10
- * To add inventory, the creator of the contract instance can call
11
- * `E(creatorFacet).makeAddInventoryInvitation(issuerKeywordRecord)`
12
- * and receive an invitation to add inventory. In this call, they must
13
- * pass in an issuerKeywordRecord of any issuers they wish to add
14
- * inventory for, if these issuers have not yet been saved to ZCF.
15
- * When actually escrowing the inventory as an offer, the proposal
16
- * must not `want` anything. All of the newly escrowed inventory is
17
- * taken and reallocated to the marketMakerSeat in the contract.
18
- *
19
- * To remove inventory, the creator of the contract instance can call
20
- * `E(creatorFacet).makeRemoveInventoryInvitation()` and receive an
21
- * invitation to remove inventory. When making an offer to remove
22
- * inventory, the proposal should specify the `want`, which will be
23
- * removed, but should not give anything.
24
- *
25
- * To make a quote, the creator can call
26
- * `E(creatorFacet).makeQuote(price, assets, timeAuthority,
27
- * deadline)`. `price` and `assets` are amountKeywordRecords that will
28
- * be used in the coveredCall. The assets are the underlyingAssets in
29
- * the call option, and the price is used as the strikePrice. The
30
- * timeAuthority should be a timer, and the deadline can be any time
31
- * understood by the timer. The quote will be cancelled after the
32
- * deadline. `makeQuote` returns a covered call option that can be
33
- * given away for free or sold. Importantly, if the recipient chooses
34
- * to exercise the option, they can verify that the goods being
35
- * offered are already escrowed, and the trade is guaranteed to
36
- * succeed if their proposal matches the quote.
37
- *
38
- * @param {ZCF<Record<string, any>>} zcf
39
- */
40
- export function start(zcf: ZCF<Record<string, any>>): {
41
- creatorFacet: {
42
- /**
43
- * The inventory can be added in bulk before any quotes are made
44
- * or can be added immediately before a quote.
45
- *
46
- * @param {IssuerKeywordRecord} [issuerKeywordRecord]
47
- * @returns {Promise<Payment>}
48
- */
49
- makeAddInventoryInvitation: (issuerKeywordRecord?: IssuerKeywordRecord | undefined) => Promise<Payment>;
50
- /**
51
- * The inventory can be removed at any time, since the inventory
52
- * used for active quotes is escrowed separately within the coveredCall
53
- * instance.
54
- *
55
- * @returns {Promise<Payment>}
56
- */
57
- makeRemoveInventoryInvitation: () => Promise<Payment>;
58
- makeQuote: (price: AmountKeywordRecord, assets: AmountKeywordRecord, timeAuthority: Timer, deadline: any) => Promise<Payment>;
59
- } & import("@endo/eventual-send").RemotableBrand<{}, {
60
- /**
61
- * The inventory can be added in bulk before any quotes are made
62
- * or can be added immediately before a quote.
63
- *
64
- * @param {IssuerKeywordRecord} [issuerKeywordRecord]
65
- * @returns {Promise<Payment>}
66
- */
67
- makeAddInventoryInvitation: (issuerKeywordRecord?: IssuerKeywordRecord | undefined) => Promise<Payment>;
68
- /**
69
- * The inventory can be removed at any time, since the inventory
70
- * used for active quotes is escrowed separately within the coveredCall
71
- * instance.
72
- *
73
- * @returns {Promise<Payment>}
74
- */
75
- makeRemoveInventoryInvitation: () => Promise<Payment>;
76
- makeQuote: (price: AmountKeywordRecord, assets: AmountKeywordRecord, timeAuthority: Timer, deadline: any) => Promise<Payment>;
77
- }>;
78
- };
79
- //# sourceMappingURL=otcDesk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"otcDesk.d.ts","sourceRoot":"","sources":["otcDesk.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,2BAFW,IAAI,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;;QAoE/B;;;;;;WAMG;+FADU,QAAQ,OAAO,CAAC;QAM7B;;;;;;WAMG;6CADU,QAAQ,OAAO,CAAC;2BAzEpB,mBAAmB,UACnB,mBAAmB,iBACnB,KAAK,YACL,GAAG,KACD,QAAQ,OAAO,CAAC;;QAqD3B;;;;;;WAMG;+FADU,QAAQ,OAAO,CAAC;QAM7B;;;;;;WAMG;6CADU,QAAQ,OAAO,CAAC;2BAzEpB,mBAAmB,UACnB,mBAAmB,iBACnB,KAAK,YACL,GAAG,KACD,QAAQ,OAAO,CAAC;;EA8E9B"}
@@ -1,91 +0,0 @@
1
- export type ParsableNumber = bigint | number | string;
2
- export type OraclePriceSubmission = Readonly<ParsableNumber | {
3
- data: ParsableNumber;
4
- }>;
5
- export type Price = ParsableNumber | Ratio;
6
- export type PriceAggregatorContract = ContractOf<typeof start>;
7
- /**
8
- * @deprecated use fluxAggregator
9
- *
10
- * This contract aggregates price values from a set of oracles and provides a
11
- * PriceAuthority for their median. This naive method is game-able and so this module
12
- * is a stub until we complete what is now in `fluxAggregatorKit.js`.
13
- *
14
- * @param {ZCF<{
15
- * timer: import('@agoric/time/src/types').TimerService,
16
- * POLL_INTERVAL: bigint,
17
- * brandIn: Brand<'nat'>,
18
- * brandOut: Brand<'nat'>,
19
- * unitAmountIn: Amount<'nat'>,
20
- * }>} zcf
21
- * @param {{
22
- * marshaller: Marshaller,
23
- * quoteMint?: ERef<Mint<'set'>>,
24
- * storageNode: ERef<StorageNode>,
25
- * }} privateArgs
26
- */
27
- export function start(zcf: ZCF<{
28
- timer: import('@agoric/time/src/types').TimerService;
29
- POLL_INTERVAL: bigint;
30
- brandIn: Brand<'nat'>;
31
- brandOut: Brand<'nat'>;
32
- unitAmountIn: Amount<'nat'>;
33
- }>, privateArgs: {
34
- marshaller: Marshaller;
35
- quoteMint?: ERef<Mint<"set">> | undefined;
36
- storageNode: ERef<StorageNode>;
37
- }): Promise<{
38
- creatorFacet: {
39
- /**
40
- * An "oracle invitation" is an invitation to be able to submit data to
41
- * include in the priceAggregator's results.
42
- *
43
- * The offer result from this invitation is a OracleAdmin, which can be used
44
- * directly to manage the price submissions as well as to terminate the
45
- * relationship.
46
- *
47
- * @param {Instance | string} [oracleKey]
48
- */
49
- makeOracleInvitation: (oracleKey?: string | Instance | undefined) => Promise<Invitation<R, A>>;
50
- /** @param {OracleKey} oracleKey */
51
- deleteOracle: (oracleKey: OracleKey) => Promise<void>;
52
- /**
53
- * @param {Instance | string} [oracleInstance]
54
- * @param {OracleQuery} [query]
55
- * @returns {Promise<OracleAdmin<Price>>}
56
- */
57
- initOracle: (oracleInstance?: string | Instance | undefined, query?: OracleQuery | undefined) => Promise<OracleAdmin<Price>>;
58
- } & import("@endo/eventual-send").RemotableBrand<{}, {
59
- /**
60
- * An "oracle invitation" is an invitation to be able to submit data to
61
- * include in the priceAggregator's results.
62
- *
63
- * The offer result from this invitation is a OracleAdmin, which can be used
64
- * directly to manage the price submissions as well as to terminate the
65
- * relationship.
66
- *
67
- * @param {Instance | string} [oracleKey]
68
- */
69
- makeOracleInvitation: (oracleKey?: string | Instance | undefined) => Promise<Invitation<R, A>>;
70
- /** @param {OracleKey} oracleKey */
71
- deleteOracle: (oracleKey: OracleKey) => Promise<void>;
72
- /**
73
- * @param {Instance | string} [oracleInstance]
74
- * @param {OracleQuery} [query]
75
- * @returns {Promise<OracleAdmin<Price>>}
76
- */
77
- initOracle: (oracleInstance?: string | Instance | undefined, query?: OracleQuery | undefined) => Promise<OracleAdmin<Price>>;
78
- }>;
79
- publicFacet: {
80
- getPriceAuthority(): PriceAuthority;
81
- getSubscriber: () => StoredSubscriber<unknown>;
82
- /** Diagnostic tool */
83
- getRoundCompleteNotifier(): Promise<Notifier<any>>;
84
- } & import("@endo/eventual-send").RemotableBrand<{}, {
85
- getPriceAuthority(): PriceAuthority;
86
- getSubscriber: () => StoredSubscriber<unknown>;
87
- /** Diagnostic tool */
88
- getRoundCompleteNotifier(): Promise<Notifier<any>>;
89
- }>;
90
- }>;
91
- //# sourceMappingURL=priceAggregator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"priceAggregator.d.ts","sourceRoot":"","sources":["priceAggregator.js"],"names":[],"mappings":"6BAqCc,MAAM,GAAG,MAAM,GAAG,MAAM;oCAEzB,SAAS,cAAc,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;oBAGlD,cAAc,GAAG,KAAK;sCAmlBtB,WAAW,YAAY,CAAC;AA9kBtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH;WAZU,OAAO,wBAAwB,EAAE,YAAY;mBACrC,MAAM;aACZ,MAAM,KAAK,CAAC;cACX,MAAM,KAAK,CAAC;kBACR,OAAO,KAAK,CAAC;;gBAGf,UAAU;;iBAET,KAAK,WAAW,CAAC;;;QAiX7B;;;;;;;;;WASG;;QAsDH,mCAAmC;kCAAvB,SAAS;QAarB;;;;WAIG;yGADU,QAAQ,YAAY,KAAK,CAAC,CAAC;;QA/ExC;;;;;;;;;WASG;;QAsDH,mCAAmC;kCAAvB,SAAS;QAarB;;;;WAIG;yGADU,QAAQ,YAAY,KAAK,CAAC,CAAC;;;;;QAmHxC,sBAAsB;;;;;QAAtB,sBAAsB;;;GAOzB"}
@@ -1,77 +0,0 @@
1
- type OracleAdmin<R extends unknown> = {
2
- /**
3
- * Remove the oracle from the aggregator
4
- */
5
- delete: () => Promise<void>;
6
- /**
7
- * Rather than waiting for the polling query, push a result directly from this oracle
8
- */
9
- pushResult: (result: R) => Promise<void>;
10
- };
11
- type OracleKey = {} | string;
12
- type PriceAggregatorKit = Pick<import("./priceAggregator").PriceAggregatorContract, 'creatorFacet' | 'publicFacet'>;
13
- type OracleQuery = Record<string, unknown> & {
14
- kind?: string;
15
- increment?: bigint;
16
- };
17
- /**
18
- * The public methods accessible from the contract instance
19
- */
20
- type OraclePublicFacet = {
21
- /**
22
- * Create an invitation for an oracle query
23
- */
24
- makeQueryInvitation: (query: OracleQuery) => ERef<Invitation>;
25
- /**
26
- * Make an unpaid query
27
- */
28
- query: (query: OracleQuery) => ERef<unknown>;
29
- };
30
- type OracleCreatorFacetMakeWithdrawInvitation = (total?: boolean | undefined) => ERef<Invitation>;
31
- /**
32
- * The private methods accessible from the contract instance
33
- */
34
- type OracleCreatorFacet = {
35
- /**
36
- * Get the current fee amounts
37
- */
38
- getCurrentFees: () => AmountKeywordRecord;
39
- /**
40
- * Create an invitation to withdraw fees
41
- */
42
- makeWithdrawInvitation: OracleCreatorFacetMakeWithdrawInvitation;
43
- /**
44
- * Make an invitation to withdraw all fees and shutdown
45
- */
46
- makeShutdownInvitation: () => Promise<Invitation>;
47
- };
48
- type OraclePrivateParameters = {
49
- oracleHandler: OracleHandler;
50
- };
51
- type OracleInitializationFacet = {
52
- initialize: (privateParams: OraclePrivateParameters) => OracleCreatorFacet;
53
- };
54
- type OracleKit = {
55
- creatorFacet: OracleCreatorFacet;
56
- publicFacet: OraclePublicFacet;
57
- instance: Instance;
58
- };
59
- type OracleReply = {
60
- reply: unknown;
61
- requiredFee?: Amount<AssetKind> | undefined;
62
- };
63
- type OracleHandler = {
64
- /**
65
- * Callback to reply to a query
66
- */
67
- onQuery: (query: OracleQuery, fee: Amount) => Promise<OracleReply>;
68
- /**
69
- * Notice an error
70
- */
71
- onError: (query: OracleQuery, reason: unknown) => void;
72
- /**
73
- * Notice a successful reply
74
- */
75
- onReply: (query: OracleQuery, reply: unknown, requiredFee: Amount | undefined) => void;
76
- };
77
- //# sourceMappingURL=priceAggregatorTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"priceAggregatorTypes.d.ts","sourceRoot":"","sources":["priceAggregatorTypes.js"],"names":[],"mappings":";;;;YAGc,MAAM,QAAQ,IAAI,CAAC;;;;yBAEV,CAAC,KAAK,QAAQ,IAAI,CAAC;;iBAK7B,EAAE,GAAG,MAAM;0BAIX,KAAK,OAAO,mBAAmB,EAAE,uBAAuB,EAAE,cAAc,GAAG,aAAa,CAAC;mBAIzF,OAAO,MAAM,EAAE,OAAO,CAAC,GAAG;IACtC,IAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAW,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;;;;iCAMkB,WAAW,KAAK,KAAK,UAAU,CAAC;;;;mBAEhC,WAAW,KAAK,KAAK,OAAO,CAAC;;iFAOtC,KAAK,UAAU,CAAC;;;;;;;;oBAMf,MAAM,mBAAmB;;;;4BAEzB,wCAAwC;;;;4BAExC,MAAM,QAAQ,UAAU,CAAC;;;mBAMzB,aAAa;;;gCAKG,uBAAuB,KAC7C,kBAAkB;;;kBAKZ,kBAAkB;iBAClB,iBAAiB;cACjB,QAAQ;;;WAKR,OAAO;;;;;;;qBAMC,WAAW,OAAO,MAAM,KAAK,QAAQ,WAAW,CAAC;;;;qBAEjD,WAAW,UAAU,OAAO,KAAK,IAAI;;;;qBAErC,WAAW,SACX,OAAO,eACD,MAAM,GAAG,SAAS,KACtC,IAAI"}
@@ -1,23 +0,0 @@
1
- export function prepare(zcf: ZCF<ScaledPriceAuthorityOpts>, privateArgs: object, baggage: MapStore<string, any>): Promise<{
2
- publicFacet: {
3
- getPriceAuthority: () => Promise<PriceAuthority>;
4
- } & import("@endo/eventual-send").RemotableBrand<{}, {
5
- getPriceAuthority: () => Promise<PriceAuthority>;
6
- }>;
7
- }>;
8
- export type ScaledPriceAuthorityOpts = {
9
- sourcePriceAuthority: ERef<PriceAuthority>;
10
- /**
11
- * - sourceAmountIn:targetAmountIn
12
- */
13
- scaleIn: Ratio;
14
- /**
15
- * - sourceAmountOut:targetAmountOut
16
- */
17
- scaleOut: Ratio;
18
- /**
19
- * - targetAmountIn:targetAmountOut
20
- */
21
- initialPrice?: Ratio | undefined;
22
- };
23
- //# sourceMappingURL=scaledPriceAuthority.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scaledPriceAuthority.d.ts","sourceRoot":"","sources":["scaledPriceAuthority.js"],"names":[],"mappings":"AAiCO,6BALI,IAAI,wBAAwB,CAAC,eAC7B,MAAM;;;;;;GA0DhB;;0BA1Ea,KAAK,cAAc,CAAC;;;;aACpB,KAAK;;;;cACL,KAAK"}
@@ -1,30 +0,0 @@
1
- /**
2
- * Sell items in exchange for money. Items may be fungible or
3
- * non-fungible and multiple items may be bought at once. Money must
4
- * be fungible.
5
- *
6
- * The `pricePerItem` is to be set in the terms. It is expected that all items
7
- * are sold for the same uniform price.
8
- *
9
- * The initial offer should be { give: { Items: items } }, accompanied by
10
- * terms as described above.
11
- * Buyers use offers that match { want: { Items: items } give: { Money: m } }.
12
- * The items provided should match particular items that the seller still has
13
- * available to sell, and the money should be pricePerItem times the number of
14
- * items requested.
15
- *
16
- * When all the items have been sold, the contract will terminate, triggering
17
- * the creator's payout. If the creator has an onDemand exit clause, they can
18
- * exit early to collect their winnings. The remaining items will still be
19
- * available for sale, but the creator won't be able to collect later earnings.
20
- *
21
- * @param {ZCF<{pricePerItem: Amount<'nat'>}>} zcf
22
- */
23
- export function start(zcf: ZCF<{
24
- pricePerItem: Amount<'nat'>;
25
- }>): {
26
- creatorFacet: SellItemsCreatorFacet;
27
- creatorInvitation: Promise<Invitation<R, A>>;
28
- publicFacet: SellItemsPublicFacet;
29
- };
30
- //# sourceMappingURL=sellItems.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sellItems.d.ts","sourceRoot":"","sources":["sellItems.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;kBAF8B,OAAO,KAAK,CAAC;;;;;EAuH1C"}
@@ -1,37 +0,0 @@
1
- /**
2
- * SimpleExchange is an exchange with a simple matching algorithm, which allows
3
- * an unlimited number of parties to create new orders or accept existing
4
- * orders. The notifier allows callers to find the current list of orders.
5
- * https://agoric.com/documentation/zoe/guide/contracts/simple-exchange.html
6
- *
7
- * The SimpleExchange uses Asset and Price as its keywords. The contract treats
8
- * the two keywords symmetrically. New offers can be created and existing offers
9
- * can be accepted in either direction.
10
- *
11
- * { give: { 'Asset', simoleans(5n) }, want: { 'Price', quatloos(3) } }
12
- * { give: { 'Price', quatloos(8) }, want: { 'Asset', simoleans(3n) } }
13
- *
14
- * The Asset is treated as an exact amount to be exchanged, while the
15
- * Price is a limit that may be improved on. This simple exchange does
16
- * not partially fill orders.
17
- *
18
- * The publicFacet is returned from the contract.
19
- *
20
- * @param {ZCF} zcf
21
- */
22
- export function start(zcf: ZCF): {
23
- publicFacet: {
24
- makeInvitation: () => Promise<Invitation<R, A>>;
25
- getNotifier: () => Notifier<{
26
- buys: any;
27
- sells: any;
28
- }>;
29
- } & import("@endo/eventual-send").RemotableBrand<{}, {
30
- makeInvitation: () => Promise<Invitation<R, A>>;
31
- getNotifier: () => Notifier<{
32
- buys: any;
33
- sells: any;
34
- }>;
35
- }>;
36
- };
37
- //# sourceMappingURL=simpleExchange.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simpleExchange.d.ts","sourceRoot":"","sources":["simpleExchange.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,2BAFW,GAAG;;;;;;;;;;;;;;EAgHb"}
@@ -1,80 +0,0 @@
1
- type SellItemsPublicFacet = {
2
- getItemsIssuer: () => Issuer;
3
- getAvailableItems: () => Amount;
4
- };
5
- type SellItemsCreatorOnly = {
6
- makeBuyerInvitation: () => Promise<Invitation>;
7
- };
8
- type SellItemsCreatorFacet = SellItemsPublicFacet & SellItemsCreatorOnly;
9
- type SellItemsParameters = {
10
- customValueProperties: Record<string, any>;
11
- count: number;
12
- moneyIssuer: Issuer;
13
- sellItemsInstallation: Installation;
14
- pricePerItem: Amount;
15
- };
16
- type SellItemsResult = {
17
- sellItemsCreatorSeat: UserSeat;
18
- sellItemsCreatorFacet: SellItemsCreatorFacet;
19
- sellItemsInstance: Instance;
20
- sellItemsPublicFacet: SellItemsPublicFacet;
21
- };
22
- type MintAndSellNFTCreatorFacet = {
23
- sellTokens: (sellParams: SellItemsParameters) => Promise<SellItemsResult>;
24
- getIssuer: () => Issuer;
25
- };
26
- type AutomaticRefundPublicFacet = {
27
- getOffersCount: () => bigint;
28
- makeInvitation: () => Promise<Invitation>;
29
- };
30
- type AutoswapPublicFacet = {
31
- /**
32
- * synonym for
33
- * makeSwapInInvitation
34
- */
35
- makeSwapInvitation: () => Promise<Invitation>;
36
- /**
37
- * make an invitation
38
- * that allows one to do a swap in which the In amount is specified and the Out
39
- * amount is calculated
40
- */
41
- makeSwapInInvitation: () => Promise<Invitation>;
42
- /**
43
- * make an invitation
44
- * that allows one to do a swap in which the Out amount is specified and the In
45
- * amount is calculated
46
- */
47
- makeSwapOutInvitation: () => Promise<Invitation>;
48
- /**
49
- * make an
50
- * invitation that allows one to add liquidity to the pool.
51
- */
52
- makeAddLiquidityInvitation: () => Promise<Invitation>;
53
- /**
54
- * make an
55
- * invitation that allows one to remove liquidity from the pool.
56
- */
57
- makeRemoveLiquidityInvitation: () => Promise<Invitation>;
58
- getLiquidityIssuer: () => Issuer;
59
- /**
60
- * get the current value of
61
- * liquidity held by investors.
62
- */
63
- getLiquiditySupply: () => bigint;
64
- /**
65
- * calculate the amount of brandOut that will be returned if the amountIn is
66
- * offered using makeSwapInInvitation at the current price.
67
- */
68
- getInputPrice: (amountIn: Amount, brandOut: Brand) => Amount;
69
- /**
70
- * calculate the amount of brandIn that is required in order to get amountOut
71
- * using makeSwapOutInvitation at the current price
72
- */
73
- getOutputPrice: (amountOut: Amount, brandIn: Brand) => Amount;
74
- /**
75
- * get an
76
- * AmountKeywordRecord showing the current balances in the pool.
77
- */
78
- getPoolAllocation: () => Record<string, Amount>;
79
- };
80
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";oBAEc,MAAM,MAAM;uBACZ,MAAM,MAAM;;;yBAGZ,MAAM,QAAQ,UAAU,CAAC;;6BAE1B,oBAAoB,GAAG,oBAAoB;;2BAK1C,OAAO,MAAM,EAAE,GAAG,CAAC;WACnB,MAAM;iBACN,MAAM;2BACN,YAAY;kBACZ,MAAM;;;0BAGN,QAAQ;2BACR,qBAAqB;uBACrB,QAAQ;0BACR,oBAAoB;;;6BAGP,mBAAmB,KAAK,QAAQ,eAAe,CAAC;eAC7D,MAAM,MAAM;;;oBAKZ,MAAM,MAAM;oBACZ,MAAM,QAAQ,UAAU,CAAC;;;;;;;wBAKzB,MAAM,QAAQ,UAAU,CAAC;;;;;;0BAEzB,MAAM,QAAQ,UAAU,CAAC;;;;;;2BAGzB,MAAM,QAAQ,UAAU,CAAC;;;;;gCAGzB,MAAM,QAAQ,UAAU,CAAC;;;;;mCAEzB,MAAM,QAAQ,UAAU,CAAC;wBAEzB,MAAM,MAAM;;;;;wBACZ,MAAM,MAAM;;;;;8BAED,MAAM,YAAY,KAAK,KAAK,MAAM;;;;;gCAGjC,MAAM,WAAW,KAAK,KAAK,MAAM;;;;;uBAG7C,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- export function handlePWarning(promise: Promise<any>): void;
2
- export function handlePKitWarning(promiseKit: PromiseRecord<any>): void;
3
- //# sourceMappingURL=handleWarning.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handleWarning.d.ts","sourceRoot":"","sources":["handleWarning.js"],"names":[],"mappings":"AASO,wCAHI,QAAQ,GAAG,CAAC,GACV,IAAI,CAIhB;AASM,8CAHI,cAAc,GAAG,CAAC,GAChB,IAAI,CAIhB"}
@@ -1,2 +0,0 @@
1
- export function makeInstanceRecordStorage(baggage: MapStore<string, any>): (ir: InstanceRecord) => InstanceState;
2
- //# sourceMappingURL=instanceRecordStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instanceRecordStorage.d.ts","sourceRoot":"","sources":["instanceRecordStorage.js"],"names":[],"mappings":"AA8BO,gFAFW,cAAc,KAAK,aAAa,CAqFjD"}