@agoric/zoe 0.26.3-dev-fa844b5.0 → 0.26.3-dev-21fe8d9.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 (216) hide show
  1. package/bundles/bundle-contractFacet-js-meta.json +84 -84
  2. package/bundles/bundle-contractFacet.d.ts +7 -0
  3. package/bundles/bundle-contractFacet.d.ts.map +1 -0
  4. package/package.json +15 -15
  5. package/src/cleanProposal.d.ts +9 -0
  6. package/src/cleanProposal.d.ts.map +1 -0
  7. package/src/contractFacet/allocationMath.d.ts +7 -0
  8. package/src/contractFacet/allocationMath.d.ts.map +1 -0
  9. package/src/contractFacet/evalContractCode.d.ts +2 -0
  10. package/src/contractFacet/evalContractCode.d.ts.map +1 -0
  11. package/src/contractFacet/exit.d.ts +2 -0
  12. package/src/contractFacet/exit.d.ts.map +1 -0
  13. package/src/contractFacet/internal-types.d.ts +8 -0
  14. package/src/contractFacet/internal-types.d.ts.map +1 -0
  15. package/src/contractFacet/offerHandlerStorage.d.ts +5 -0
  16. package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -0
  17. package/src/contractFacet/offerSafety.d.ts +34 -0
  18. package/src/contractFacet/offerSafety.d.ts.map +1 -0
  19. package/src/contractFacet/reallocate.d.ts +3 -0
  20. package/src/contractFacet/reallocate.d.ts.map +1 -0
  21. package/src/contractFacet/rightsConservation.d.ts +12 -0
  22. package/src/contractFacet/rightsConservation.d.ts.map +1 -0
  23. package/src/contractFacet/vatRoot.d.ts +14 -0
  24. package/src/contractFacet/vatRoot.d.ts.map +1 -0
  25. package/src/contractFacet/zcfMint.d.ts +8 -0
  26. package/src/contractFacet/zcfMint.d.ts.map +1 -0
  27. package/src/contractFacet/zcfSeat.d.ts +3 -0
  28. package/src/contractFacet/zcfSeat.d.ts.map +1 -0
  29. package/src/contractFacet/zcfZygote.d.ts +2 -0
  30. package/src/contractFacet/zcfZygote.d.ts.map +1 -0
  31. package/src/contractSupport/atomicTransfer.d.ts +6 -0
  32. package/src/contractSupport/atomicTransfer.d.ts.map +1 -0
  33. package/src/contractSupport/bondingCurves.d.ts +6 -0
  34. package/src/contractSupport/bondingCurves.d.ts.map +1 -0
  35. package/src/contractSupport/durability.d.ts +5 -0
  36. package/src/contractSupport/durability.d.ts.map +1 -0
  37. package/src/contractSupport/index.d.ts +14 -0
  38. package/src/contractSupport/index.d.ts.map +1 -0
  39. package/src/contractSupport/prepare-ownable.d.ts +11 -0
  40. package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
  41. package/src/contractSupport/priceAuthority.d.ts +27 -0
  42. package/src/contractSupport/priceAuthority.d.ts.map +1 -0
  43. package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
  44. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -0
  45. package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -0
  46. package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -0
  47. package/src/contractSupport/priceAuthorityTransform.d.ts +14 -0
  48. package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -0
  49. package/src/contractSupport/priceQuote.d.ts +7 -0
  50. package/src/contractSupport/priceQuote.d.ts.map +1 -0
  51. package/src/contractSupport/ratio.d.ts +28 -0
  52. package/src/contractSupport/ratio.d.ts.map +1 -0
  53. package/src/contractSupport/recorder.d.ts +143 -0
  54. package/src/contractSupport/recorder.d.ts.map +1 -0
  55. package/src/contractSupport/safeMath.d.ts +11 -0
  56. package/src/contractSupport/safeMath.d.ts.map +1 -0
  57. package/src/contractSupport/stateMachine.d.ts +6 -0
  58. package/src/contractSupport/stateMachine.d.ts.map +1 -0
  59. package/src/contractSupport/statistics.d.ts +7 -0
  60. package/src/contractSupport/statistics.d.ts.map +1 -0
  61. package/src/contractSupport/topics.d.ts +22 -0
  62. package/src/contractSupport/topics.d.ts.map +1 -0
  63. package/src/contractSupport/types.d.ts +63 -0
  64. package/src/contractSupport/types.d.ts.map +1 -0
  65. package/src/contractSupport/zoeHelpers.d.ts +30 -0
  66. package/src/contractSupport/zoeHelpers.d.ts.map +1 -0
  67. package/src/contracts/atomicSwap.d.ts +16 -0
  68. package/src/contracts/atomicSwap.d.ts.map +1 -0
  69. package/src/contracts/auction/assertBidSeat.d.ts +2 -0
  70. package/src/contracts/auction/assertBidSeat.d.ts.map +1 -0
  71. package/src/contracts/auction/firstPriceLogic.d.ts +2 -0
  72. package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -0
  73. package/src/contracts/auction/index.d.ts +78 -0
  74. package/src/contracts/auction/index.d.ts.map +1 -0
  75. package/src/contracts/auction/secondPriceLogic.d.ts +2 -0
  76. package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -0
  77. package/src/contracts/automaticRefund.d.ts +25 -0
  78. package/src/contracts/automaticRefund.d.ts.map +1 -0
  79. package/src/contracts/autoswap.d.ts +43 -0
  80. package/src/contracts/autoswap.d.ts.map +1 -0
  81. package/src/contracts/barterExchange.d.ts +22 -0
  82. package/src/contracts/barterExchange.d.ts.map +1 -0
  83. package/src/contracts/callSpread/calculateShares.d.ts +2 -0
  84. package/src/contracts/callSpread/calculateShares.d.ts.map +1 -0
  85. package/src/contracts/callSpread/fundedCallSpread.d.ts +60 -0
  86. package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -0
  87. package/src/contracts/callSpread/payoffHandler.d.ts +11 -0
  88. package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -0
  89. package/src/contracts/callSpread/percent.d.ts +3 -0
  90. package/src/contracts/callSpread/percent.d.ts.map +1 -0
  91. package/src/contracts/callSpread/position.d.ts +10 -0
  92. package/src/contracts/callSpread/position.d.ts.map +1 -0
  93. package/src/contracts/callSpread/pricedCallSpread.d.ts +66 -0
  94. package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -0
  95. package/src/contracts/callSpread/types.d.ts +30 -0
  96. package/src/contracts/callSpread/types.d.ts.map +1 -0
  97. package/src/contracts/coveredCall-durable.d.ts +21 -0
  98. package/src/contracts/coveredCall-durable.d.ts.map +1 -0
  99. package/src/contracts/coveredCall.d.ts +64 -0
  100. package/src/contracts/coveredCall.d.ts.map +1 -0
  101. package/src/contracts/exported.d.ts +2 -0
  102. package/src/contracts/exported.d.ts.map +1 -0
  103. package/src/contracts/loan/addCollateral.d.ts +3 -0
  104. package/src/contracts/loan/addCollateral.d.ts.map +1 -0
  105. package/src/contracts/loan/borrow.d.ts +3 -0
  106. package/src/contracts/loan/borrow.d.ts.map +1 -0
  107. package/src/contracts/loan/close.d.ts +3 -0
  108. package/src/contracts/loan/close.d.ts.map +1 -0
  109. package/src/contracts/loan/index.d.ts +64 -0
  110. package/src/contracts/loan/index.d.ts.map +1 -0
  111. package/src/contracts/loan/lend.d.ts +3 -0
  112. package/src/contracts/loan/lend.d.ts.map +1 -0
  113. package/src/contracts/loan/liquidate.d.ts +3 -0
  114. package/src/contracts/loan/liquidate.d.ts.map +1 -0
  115. package/src/contracts/loan/scheduleLiquidation.d.ts +3 -0
  116. package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -0
  117. package/src/contracts/loan/types.d.ts +161 -0
  118. package/src/contracts/loan/types.d.ts.map +1 -0
  119. package/src/contracts/loan/updateDebt.d.ts +11 -0
  120. package/src/contracts/loan/updateDebt.d.ts.map +1 -0
  121. package/src/contracts/mintAndSellNFT.d.ts +28 -0
  122. package/src/contracts/mintAndSellNFT.d.ts.map +1 -0
  123. package/src/contracts/mintPayments.d.ts +30 -0
  124. package/src/contracts/mintPayments.d.ts.map +1 -0
  125. package/src/contracts/oracle.d.ts +26 -0
  126. package/src/contracts/oracle.d.ts.map +1 -0
  127. package/src/contracts/otcDesk.d.ts +79 -0
  128. package/src/contracts/otcDesk.d.ts.map +1 -0
  129. package/src/contracts/priceAggregator.d.ts +107 -0
  130. package/src/contracts/priceAggregator.d.ts.map +1 -0
  131. package/src/contracts/priceAggregator.js +0 -1
  132. package/src/contracts/priceAggregatorTypes.d.ts +77 -0
  133. package/src/contracts/priceAggregatorTypes.d.ts.map +1 -0
  134. package/src/contracts/scaledPriceAuthority.d.ts +21 -0
  135. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -0
  136. package/src/contracts/sellItems.d.ts +30 -0
  137. package/src/contracts/sellItems.d.ts.map +1 -0
  138. package/src/contracts/simpleExchange.d.ts +37 -0
  139. package/src/contracts/simpleExchange.d.ts.map +1 -0
  140. package/src/contracts/types.d.ts +80 -0
  141. package/src/contracts/types.d.ts.map +1 -0
  142. package/src/handleWarning.d.ts +3 -0
  143. package/src/handleWarning.d.ts.map +1 -0
  144. package/src/instanceRecordStorage.d.ts +2 -0
  145. package/src/instanceRecordStorage.d.ts.map +1 -0
  146. package/src/internal-types.d.ts +179 -0
  147. package/src/internal-types.d.ts.map +1 -0
  148. package/src/issuerRecord.d.ts +3 -0
  149. package/src/issuerRecord.d.ts.map +1 -0
  150. package/src/issuerStorage.d.ts +14 -0
  151. package/src/issuerStorage.d.ts.map +1 -0
  152. package/src/makeHandle.d.ts +4 -0
  153. package/src/makeHandle.d.ts.map +1 -0
  154. package/src/typeGuards.d.ts +169 -0
  155. package/src/typeGuards.d.ts.map +1 -0
  156. package/src/types.d.ts +46 -0
  157. package/src/types.d.ts.map +1 -0
  158. package/src/zoeService/createZCFVat.d.ts +2 -0
  159. package/src/zoeService/createZCFVat.d.ts.map +1 -0
  160. package/src/zoeService/escrowStorage.d.ts +7 -0
  161. package/src/zoeService/escrowStorage.d.ts.map +1 -0
  162. package/src/zoeService/feeMint.d.ts +23 -0
  163. package/src/zoeService/feeMint.d.ts.map +1 -0
  164. package/src/zoeService/installationStorage.d.ts +20 -0
  165. package/src/zoeService/installationStorage.d.ts.map +1 -0
  166. package/src/zoeService/instanceAdminStorage.d.ts +103 -0
  167. package/src/zoeService/instanceAdminStorage.d.ts.map +1 -0
  168. package/src/zoeService/internal-types.d.ts +90 -0
  169. package/src/zoeService/internal-types.d.ts.map +1 -0
  170. package/src/zoeService/invitationQueries.d.ts +6 -0
  171. package/src/zoeService/invitationQueries.d.ts.map +1 -0
  172. package/src/zoeService/makeInvitation.d.ts +5 -0
  173. package/src/zoeService/makeInvitation.d.ts.map +1 -0
  174. package/src/zoeService/offer/burnInvitation.d.ts +5 -0
  175. package/src/zoeService/offer/burnInvitation.d.ts.map +1 -0
  176. package/src/zoeService/offer/offer.d.ts +2 -0
  177. package/src/zoeService/offer/offer.d.ts.map +1 -0
  178. package/src/zoeService/originalZoeSeat.d.ts +34 -0
  179. package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
  180. package/src/zoeService/startInstance.d.ts +4 -0
  181. package/src/zoeService/startInstance.d.ts.map +1 -0
  182. package/src/zoeService/types.d.ts +224 -0
  183. package/src/zoeService/types.d.ts.map +1 -0
  184. package/src/zoeService/utils.test-d.d.ts +2 -0
  185. package/src/zoeService/utils.test-d.d.ts.map +1 -0
  186. package/src/zoeService/zoe.d.ts +57 -0
  187. package/src/zoeService/zoe.d.ts.map +1 -0
  188. package/src/zoeService/zoe.js +0 -2
  189. package/src/zoeService/zoeSeat.d.ts +26 -0
  190. package/src/zoeService/zoeSeat.d.ts.map +1 -0
  191. package/src/zoeService/zoeStorageManager.d.ts +41 -0
  192. package/src/zoeService/zoeStorageManager.d.ts.map +1 -0
  193. package/tools/fakePriceAuthority.d.ts +30 -0
  194. package/tools/fakePriceAuthority.d.ts.map +1 -0
  195. package/tools/fakeVatAdmin.d.ts +103 -0
  196. package/tools/fakeVatAdmin.d.ts.map +1 -0
  197. package/tools/internal-types.d.ts +12 -0
  198. package/tools/internal-types.d.ts.map +1 -0
  199. package/tools/manualPriceAuthority.d.ts +21 -0
  200. package/tools/manualPriceAuthority.d.ts.map +1 -0
  201. package/tools/manualTimer.d.ts +44 -0
  202. package/tools/manualTimer.d.ts.map +1 -0
  203. package/tools/prepare-test-env-ava.d.ts +2 -0
  204. package/tools/prepare-test-env-ava.d.ts.map +1 -0
  205. package/tools/prepare-test-env.d.ts +2 -0
  206. package/tools/prepare-test-env.d.ts.map +1 -0
  207. package/tools/scriptedOracle.d.ts +27 -0
  208. package/tools/scriptedOracle.d.ts.map +1 -0
  209. package/tools/scriptedPriceAuthority.d.ts +2 -0
  210. package/tools/scriptedPriceAuthority.d.ts.map +1 -0
  211. package/tools/setup-zoe.d.ts +33 -0
  212. package/tools/setup-zoe.d.ts.map +1 -0
  213. package/tools/types-ambient.d.ts +142 -0
  214. package/tools/types-ambient.d.ts.map +1 -0
  215. package/tools/types.d.ts +142 -0
  216. package/tools/types.d.ts.map +1 -0
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Start an instance of an Oracle that follows a script. The Oracle has access
3
+ * to a timer, and looks in the script for events indexed by the current time.
4
+ * It responds to onQuery() by reporting any current event. This is intended to
5
+ * be useful for tests.
6
+ * The queries return an object that has fields { event, time, query }. event is
7
+ * whatever was in the script indexed by the time. The query is returned in the
8
+ * result, but has no impact on the result. If the script has no entry for the
9
+ * time, the event is 'nothing to report'.
10
+ *
11
+ * @param {Record<string, any>} script
12
+ * @param {Installation<import('../src/contracts/oracle.js').OracleStart>} oracleInstallation
13
+ * @param {import('@agoric/time').TimerService} timer
14
+ * @param {ZoeService} zoe
15
+ * @param {Issuer} feeIssuer
16
+ */
17
+ export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import('../src/contracts/oracle.js').OracleStart>, timer: import('@agoric/time').TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
18
+ publicFacet: {
19
+ query(query: OracleQuery): Promise<unknown>;
20
+ makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
21
+ } & import("@endo/eventual-send").RemotableBrand<{}, {
22
+ query(query: OracleQuery): Promise<unknown>;
23
+ makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
24
+ }>;
25
+ creatorFacet: OracleCreatorFacet;
26
+ }>;
27
+ //# sourceMappingURL=scriptedOracle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,OAAO,MAAM,EAAE,GAAG,CAAC,sBACnB,aAAa,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;;;;;;;;GAqChB"}
@@ -0,0 +1,2 @@
1
+ export function makeScriptedPriceAuthority(options: any): PriceAuthority;
2
+ //# sourceMappingURL=scriptedPriceAuthority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAWA,yEAoFC"}
@@ -0,0 +1,33 @@
1
+ export function makeZoeKitForTest(vatAdminSvc?: VatAdminSvc | undefined): {
2
+ zoeService: ZoeService;
3
+ zoeConfigFacet: import("@endo/exo").Guarded<{
4
+ updateZcfBundleId(bundleId: any): void;
5
+ }>;
6
+ feeMintAccess: FeeMintAccess;
7
+ setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
8
+ };
9
+ export function makeZoeForTest(vatAdminSvc?: VatAdminSvc | undefined): ZoeService;
10
+ export function setUpZoeForTest<T extends unknown = unknown>({ setJig, feeIssuerConfig, vatAdminSvc, useNearRemote, }?: {
11
+ setJig?: ((jig: T) => void) | undefined;
12
+ feeIssuerConfig?: FeeIssuerConfig | undefined;
13
+ vatAdminSvc?: VatAdminSvc | undefined;
14
+ useNearRemote?: boolean | undefined;
15
+ }): Promise<{
16
+ zoe: ZoeService;
17
+ feeMintAccessP: FeeMintAccess;
18
+ vatAdminSvc: VatAdminSvc;
19
+ vatAdminState: {
20
+ getExitMessage: () => any;
21
+ getHasExited: () => boolean;
22
+ getExitWithFailure: () => any;
23
+ installBundle: (id: any, bundle: any) => any;
24
+ installNamedBundle: (name: any, id: any, bundle: any) => any;
25
+ getCriticalVatKey: () => {};
26
+ getVatPowers: () => {
27
+ D: (bcap: any) => {
28
+ getBundle: () => * EndoZipBase64Bundle;
29
+ };
30
+ };
31
+ } | undefined;
32
+ }>;
33
+ //# sourceMappingURL=setup-zoe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AASO;;;;;;;EAKN;AAKM,kFACoC;AAYpC;IAL+B,MAAM,gBAArB,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;;;;;;;;;;;;;;;;;;GA+BzC"}
@@ -0,0 +1,142 @@
1
+ type PriceQuote = {
2
+ /**
3
+ * Amount whose value is a PriceQuoteValue
4
+ */
5
+ quoteAmount: Amount<'set'>;
6
+ /**
7
+ * The `quoteAmount` wrapped as a payment
8
+ */
9
+ quotePayment: ERef<globalThis.Payment<"set">>;
10
+ };
11
+ /**
12
+ * A single-valued set of PriceDescriptions. This is the `value` in
13
+ * PriceQuote.quoteAmount (`{ brand, value: PriceQuoteValue }`).
14
+ */
15
+ type PriceQuoteValue = [PriceDescription];
16
+ /**
17
+ * A description of a single quote
18
+ */
19
+ type PriceDescription = {
20
+ /**
21
+ * The amount supplied to a trade
22
+ */
23
+ amountIn: Amount<'nat'>;
24
+ /**
25
+ * The quoted result of trading `amountIn`
26
+ */
27
+ amountOut: Amount<'nat'>;
28
+ /**
29
+ * The service that gave the `timestamp`
30
+ */
31
+ timer: import('@agoric/time').TimerService;
32
+ /**
33
+ * A timestamp according to `timer` for the quote
34
+ */
35
+ timestamp: import('@agoric/time').TimestampRecord;
36
+ /**
37
+ * Additional conditions for the quote
38
+ */
39
+ conditions?: any;
40
+ };
41
+ type PriceQuoteCreate = (priceQuery: PriceQuery) => ERef<PriceQuote> | undefined;
42
+ type PriceQuoteTrigger = (createQuote: PriceQuoteCreate) => any;
43
+ type PriceAuthorityAdmin = {
44
+ fireTriggers: (createQuote: PriceQuoteCreate) => Promise<void>;
45
+ };
46
+ type PriceAuthorityKit = {
47
+ priceAuthority: PriceAuthority;
48
+ adminFacet: PriceAuthorityAdmin;
49
+ };
50
+ type MutableQuote = {
51
+ cancel: (reason?: any) => void;
52
+ updateLevel: (amountIn: Amount<'nat'>, amountOut: Amount<'nat'>) => void;
53
+ getPromise: () => ERef<PriceQuote>;
54
+ };
55
+ /**
56
+ * An object that mints PriceQuotes and handles
57
+ * triggers and notifiers for changes in the price
58
+ */
59
+ type PriceAuthority = {
60
+ /**
61
+ * Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair
62
+ */
63
+ getQuoteIssuer: (brandIn: Brand, brandOut: Brand) => ERef<globalThis.Issuer<"set">>;
64
+ /**
65
+ * Get the timer used in PriceQuotes for a given brandIn/brandOut pair
66
+ */
67
+ getTimerService: (brandIn: Brand, brandOut: Brand) => ERef<import("@agoric/time").TimerService>;
68
+ /**
69
+ * Be notified of the latest PriceQuotes for a given
70
+ * `amountIn`. The rate at which these are issued may be very different between
71
+ * `priceAuthorities`.
72
+ */
73
+ makeQuoteNotifier: (amountIn: Amount<'nat'>, brandOut: Brand<'nat'>) => ERef<Notifier<PriceQuote>>;
74
+ /**
75
+ * Resolves after `deadline` passes on the
76
+ * priceAuthority's timerService with the price quote of `amountIn` at that time
77
+ */
78
+ quoteAtTime: (deadline: import('@agoric/time').Timestamp, amountIn: Amount<'nat'>, brandOut: Brand<'nat'>) => Promise<PriceQuote>;
79
+ /**
80
+ * Get a quote corresponding to the specified amountIn
81
+ */
82
+ quoteGiven: (amountIn: Amount<'nat'>, brandOut: Brand<'nat'>) => Promise<PriceQuote>;
83
+ /**
84
+ * Get a quote corresponding to the specified amountOut
85
+ */
86
+ quoteWanted: (brandIn: Brand<'nat'>, amountOut: Amount<'nat'>) => Promise<PriceQuote>;
87
+ /**
88
+ * Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
89
+ */
90
+ quoteWhenGT: (amountIn: Amount<'nat'>, amountOutLimit: Amount<'nat'>) => Promise<PriceQuote>;
91
+ /**
92
+ * Resolve when a price quote of `amountIn` reaches or exceeds `amountOutLimit`
93
+ */
94
+ quoteWhenGTE: (amountIn: Amount<'nat'>, amountOutLimit: Amount<'nat'>) => Promise<PriceQuote>;
95
+ /**
96
+ * Resolve when a price quote of `amountIn` reaches or drops below
97
+ * `amountOutLimit`
98
+ */
99
+ quoteWhenLTE: (amountIn: Amount, amountOutLimit: Amount) => Promise<PriceQuote>;
100
+ /**
101
+ * Resolve when the price quote of `amountIn` drops below `amountOutLimit`
102
+ */
103
+ quoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => Promise<PriceQuote>;
104
+ /**
105
+ * Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
106
+ */
107
+ mutableQuoteWhenGT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
108
+ /**
109
+ * Resolve when a price quote of `amountIn` reaches or exceeds
110
+ * `amountOutLimit`
111
+ */
112
+ mutableQuoteWhenGTE: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
113
+ /**
114
+ * Resolve when a price quote of `amountIn` reaches or drops below
115
+ * `amountOutLimit`
116
+ */
117
+ mutableQuoteWhenLTE: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
118
+ /**
119
+ * Resolve when the price quote of `amountIn` drops below `amountOutLimit`
120
+ */
121
+ mutableQuoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
122
+ };
123
+ type PriceCalculator = (amount: Amount<'nat'>) => Amount<'nat'>;
124
+ type PriceQuery = (calcAmountIn: PriceCalculator, calcAmountOut: PriceCalculator) => {
125
+ amountIn: Amount<'nat'>;
126
+ amountOut: Amount<'nat'>;
127
+ timestamp?: import('@agoric/time').TimestampRecord;
128
+ } | undefined;
129
+ /**
130
+ * A description of a single quote
131
+ */
132
+ type PriceLevel = {
133
+ /**
134
+ * The amount supplied to a trade
135
+ */
136
+ amountIn: Amount<'nat'>;
137
+ /**
138
+ * The quoted result of trading `amountIn`
139
+ */
140
+ amountOut: Am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;;;kBAGb,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC,EACrC,cAA4B,EAAE,OAAO,KAAK,CAAC,KACpC,QAAQ,UAAU,CAAC;;;;;kBAGb,CAAC,QAAQ,EAAE,MAAM,EAC9B,cAA4B,EAAE,MAAM,KAC7B,QAAQ,UAAU,CAAC;;;;iBAIb,CAAC,QAAQ,EAAE,MAAM,EAC9B,cAA4B,EAAE,MAAM,KAC7B,QAAQ,UAAU,CAAC;;;;mCAGF,MAAM,kBACA,MAAM;;;;;oCAIZ,MAAM,kBACA,MAAM;;;;;oCAKZ,MAAM,kBACA,MAAM;;;;mCAKZ,MAAM,kBACA,MAAM;;uBAMxB,CAAC,MAAM,EAAE,OAAO,KAAK,CAAC,KAAK,OAAO,KAAK,CAAC;iCAK1C,eAAe,iBACf,eAAe,KACb;IAAE,QAAQ,EAAE,OAAO,KAAK,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,KAAK,CAAC,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,cAAc,EAAE,eAAe,CAAA;CAAE,GAAG,SAAS;;;;;;;;cAOpH,OAAO,KAAK,CAAC;;;;eAEb,OAAO,KAAK,CAAC"}
@@ -0,0 +1,142 @@
1
+ export type PriceQuote = {
2
+ /**
3
+ * Amount whose value is a PriceQuoteValue
4
+ */
5
+ quoteAmount: Amount<'set'>;
6
+ /**
7
+ * The `quoteAmount` wrapped as a payment
8
+ */
9
+ quotePayment: ERef<globalThis.Payment<"set">>;
10
+ };
11
+ /**
12
+ * A single-valued set of PriceDescriptions. This is the `value` in
13
+ * PriceQuote.quoteAmount (`{ brand, value: PriceQuoteValue }`).
14
+ */
15
+ export type PriceQuoteValue = [PriceDescription];
16
+ /**
17
+ * A description of a single quote
18
+ */
19
+ export type PriceDescription = {
20
+ /**
21
+ * The amount supplied to a trade
22
+ */
23
+ amountIn: Amount<'nat'>;
24
+ /**
25
+ * The quoted result of trading `amountIn`
26
+ */
27
+ amountOut: Amount<'nat'>;
28
+ /**
29
+ * The service that gave the `timestamp`
30
+ */
31
+ timer: import('@agoric/time').TimerService;
32
+ /**
33
+ * A timestamp according to `timer` for the quote
34
+ */
35
+ timestamp: import('@agoric/time').TimestampRecord;
36
+ /**
37
+ * Additional conditions for the quote
38
+ */
39
+ conditions?: any;
40
+ };
41
+ export type PriceQuoteCreate = (priceQuery: PriceQuery) => ERef<PriceQuote> | undefined;
42
+ export type PriceQuoteTrigger = (createQuote: PriceQuoteCreate) => any;
43
+ export type PriceAuthorityAdmin = {
44
+ fireTriggers: (createQuote: PriceQuoteCreate) => Promise<void>;
45
+ };
46
+ export type PriceAuthorityKit = {
47
+ priceAuthority: PriceAuthority;
48
+ adminFacet: PriceAuthorityAdmin;
49
+ };
50
+ export type MutableQuote = {
51
+ cancel: (reason?: any) => void;
52
+ updateLevel: (amountIn: Amount<'nat'>, amountOut: Amount<'nat'>) => void;
53
+ getPromise: () => ERef<PriceQuote>;
54
+ };
55
+ /**
56
+ * An object that mints PriceQuotes and handles
57
+ * triggers and notifiers for changes in the price
58
+ */
59
+ export type PriceAuthority = {
60
+ /**
61
+ * Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair
62
+ */
63
+ getQuoteIssuer: (brandIn: Brand, brandOut: Brand) => ERef<globalThis.Issuer<"set">>;
64
+ /**
65
+ * Get the timer used in PriceQuotes for a given brandIn/brandOut pair
66
+ */
67
+ getTimerService: (brandIn: Brand, brandOut: Brand) => ERef<import("@agoric/time").TimerService>;
68
+ /**
69
+ * Be notified of the latest PriceQuotes for a given
70
+ * `amountIn`. The rate at which these are issued may be very different between
71
+ * `priceAuthorities`.
72
+ */
73
+ makeQuoteNotifier: (amountIn: Amount<'nat'>, brandOut: Brand<'nat'>) => ERef<Notifier<PriceQuote>>;
74
+ /**
75
+ * Resolves after `deadline` passes on the
76
+ * priceAuthority's timerService with the price quote of `amountIn` at that time
77
+ */
78
+ quoteAtTime: (deadline: import('@agoric/time').Timestamp, amountIn: Amount<'nat'>, brandOut: Brand<'nat'>) => Promise<PriceQuote>;
79
+ /**
80
+ * Get a quote corresponding to the specified amountIn
81
+ */
82
+ quoteGiven: (amountIn: Amount<'nat'>, brandOut: Brand<'nat'>) => Promise<PriceQuote>;
83
+ /**
84
+ * Get a quote corresponding to the specified amountOut
85
+ */
86
+ quoteWanted: (brandIn: Brand<'nat'>, amountOut: Amount<'nat'>) => Promise<PriceQuote>;
87
+ /**
88
+ * Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
89
+ */
90
+ quoteWhenGT: (amountIn: Amount<'nat'>, amountOutLimit: Amount<'nat'>) => Promise<PriceQuote>;
91
+ /**
92
+ * Resolve when a price quote of `amountIn` reaches or exceeds `amountOutLimit`
93
+ */
94
+ quoteWhenGTE: (amountIn: Amount<'nat'>, amountOutLimit: Amount<'nat'>) => Promise<PriceQuote>;
95
+ /**
96
+ * Resolve when a price quote of `amountIn` reaches or drops below
97
+ * `amountOutLimit`
98
+ */
99
+ quoteWhenLTE: (amountIn: Amount, amountOutLimit: Amount) => Promise<PriceQuote>;
100
+ /**
101
+ * Resolve when the price quote of `amountIn` drops below `amountOutLimit`
102
+ */
103
+ quoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => Promise<PriceQuote>;
104
+ /**
105
+ * Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
106
+ */
107
+ mutableQuoteWhenGT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
108
+ /**
109
+ * Resolve when a price quote of `amountIn` reaches or exceeds
110
+ * `amountOutLimit`
111
+ */
112
+ mutableQuoteWhenGTE: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
113
+ /**
114
+ * Resolve when a price quote of `amountIn` reaches or drops below
115
+ * `amountOutLimit`
116
+ */
117
+ mutableQuoteWhenLTE: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
118
+ /**
119
+ * Resolve when the price quote of `amountIn` drops below `amountOutLimit`
120
+ */
121
+ mutableQuoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
122
+ };
123
+ export type PriceCalculator = (amount: Amount<'nat'>) => Amount<'nat'>;
124
+ export type PriceQuery = (calcAmountIn: PriceCalculator, calcAmountOut: PriceCalculator) => {
125
+ amountIn: Amount<'nat'>;
126
+ amountOut: Amount<'nat'>;
127
+ timestamp?: import('@agoric/time').TimestampRecord;
128
+ } | undefined;
129
+ /**
130
+ * A description of a single quote
131
+ */
132
+ export type PriceLevel = {
133
+ /**
134
+ * The amount supplied to a trade
135
+ */
136
+ amountIn: Amount<'nat'>;
137
+ /**
138
+ * The quoted result of trading `amountIn`
139
+ */
140
+ amountOut: Amount<'nat'>;
141
+ };
142
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;iBAKc,OAAO,KAAK,CAAC;;;;;;;;;;8BAOd,CAAC,gBAAgB,CAAC;;;;;;;;cAQjB,OAAO,KAAK,CAAC;;;;eAEb,OAAO,KAAK,CAAC;;;;WAEb,OAAO,cAAc,EAAE,YAAY;;;;eAEnC,OAAO,cAAc,EAAE,eAAe;;;;iBAEtC,GAAG;;4CAMN,UAAU;8CAMV,gBAAgB;;kBAKb,CAAC,WAAW,EAAE,gBAAgB,KAAK,QAAQ,IAAI,CAAC;;;oBAKhD,cAAc;gBACd,mBAAmB;;;YAKnB,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI;iBACtB,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,KAAK,CAAC,KAAK,IAAI;;;;;;;;;;;8BASjD,KAAK,YAAY,KAAK;;;;+BAGtB,KAAK,YACJ,KAAK;;;;;;kCAIL,OAAO,KAAK,CAAC,YACb,MAAM,KAAK,CAAC;;;;;iBAMvB,CAAC,QAAQ,EAAE,OAAO,cAAc,EAAE,SAAS,EACxD,QAAsB,EAAE,OAAO,KAAK,CAAC,EACrC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