@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-fi-dev-8879538.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.
- package/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +622 -313
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -60
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/exit.js +1 -0
- package/src/contractFacet/internal-types.d.ts +2 -2
- package/src/contractFacet/internal-types.d.ts.map +1 -1
- package/src/contractFacet/internal-types.js +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +11 -3
- package/src/contractFacet/reallocate.d.ts +3 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -0
- package/src/contractFacet/reallocate.js +94 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +3 -0
- package/src/contractFacet/types-ambient.d.ts +259 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +4 -4
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +5 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +4 -4
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +125 -5
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +95 -42
- package/src/contractSupport/atomicTransfer.d.ts +0 -6
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +5 -90
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +3 -3
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +5 -5
- package/src/contractSupport/index.d.ts +1 -0
- package/src/contractSupport/index.js +1 -0
- package/src/contractSupport/prepare-ownable.d.ts +11 -0
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
- package/src/contractSupport/prepare-ownable.js +100 -0
- package/src/contractSupport/priceAuthority.d.ts +23 -15
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +32 -17
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +5 -2
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
- package/src/contractSupport/priceAuthorityTransform.d.ts +14 -12
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +10 -8
- package/src/contractSupport/priceQuote.d.ts +7 -5
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +5 -1
- package/src/contractSupport/ratio.d.ts +2 -2
- package/src/contractSupport/ratio.d.ts.map +1 -1
- package/src/contractSupport/ratio.js +19 -15
- package/src/contractSupport/recorder.d.ts +31 -117
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +21 -10
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.d.ts.map +1 -1
- package/src/contractSupport/statistics.d.ts +1 -1
- package/src/contractSupport/statistics.d.ts.map +1 -1
- package/src/contractSupport/topics.d.ts +1 -1
- package/src/contractSupport/topics.d.ts.map +1 -1
- package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
- package/src/contractSupport/types-ambient.d.ts.map +1 -0
- package/src/contractSupport/{types.js → types-ambient.js} +1 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +5 -11
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +5 -8
- package/src/contracts/auction/index.d.ts +10 -10
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +2 -1
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +1 -4
- package/src/contracts/automaticRefund.d.ts +1 -1
- package/src/contracts/automaticRefund.d.ts.map +1 -1
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +8 -9
- package/src/contracts/barterExchange.d.ts +1 -1
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +2 -3
- package/src/contracts/callSpread/calculateShares.d.ts +1 -8
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/calculateShares.js +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +6 -4
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +2 -1
- package/src/contracts/callSpread/percent.d.ts +2 -4
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/position.d.ts +2 -2
- package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +8 -4
- package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
- package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
- package/src/contracts/coveredCall-durable.d.ts +2 -4
- package/src/contracts/coveredCall-durable.d.ts.map +1 -1
- package/src/contracts/exported.js +3 -3
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +7 -4
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +3 -7
- package/src/contracts/loan/index.d.ts +5 -1
- package/src/contracts/loan/index.d.ts.map +1 -1
- package/src/contracts/loan/index.js +4 -0
- package/src/contracts/loan/liquidate.d.ts +1 -12
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +4 -2
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +1 -0
- package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
- package/src/contracts/loan/types-ambient.d.ts.map +1 -0
- package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
- package/src/contracts/loan/updateDebt.js +1 -1
- package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
- package/src/contracts/mintPayments.d.ts +14 -6
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +25 -3
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +7 -0
- package/src/contracts/otcDesk.d.ts +3 -3
- package/src/contracts/otcDesk.d.ts.map +1 -1
- package/src/contracts/otcDesk.js +1 -1
- package/src/contracts/priceAggregator.d.ts +112 -18
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +16 -18
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +4 -5
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +6 -0
- package/src/contracts/sellItems.d.ts +2 -2
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +2 -3
- package/src/contracts/simpleExchange.d.ts +3 -3
- package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/types-ambient.d.ts.map +1 -0
- package/src/handleWarning.d.ts.map +1 -1
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +20 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +18 -58
- package/src/issuerRecord.d.ts +2 -2
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +4 -4
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +12 -28
- package/src/makeHandle.d.ts +2 -2
- package/src/makeHandle.d.ts.map +1 -1
- package/src/makeHandle.js +1 -1
- package/src/typeGuards.d.ts +119 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +18 -9
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +6 -14
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +20 -27
- package/src/zoeService/feeMint.d.ts +9 -16
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +21 -15
- package/src/zoeService/installationStorage.d.ts +5 -20
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +11 -7
- package/src/zoeService/instanceAdminStorage.d.ts +22 -42
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +1 -0
- package/src/zoeService/internal-types.d.ts +16 -16
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +6 -6
- package/src/zoeService/invitationQueries.d.ts.map +1 -1
- package/src/zoeService/invitationQueries.js +7 -5
- package/src/zoeService/makeInvitation.d.ts +3 -3
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +25 -21
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +2 -5
- package/src/zoeService/originalZoeSeat.d.ts +34 -0
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
- package/src/zoeService/originalZoeSeat.js +353 -0
- package/src/zoeService/startInstance.d.ts +3 -3
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +17 -11
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +26 -31
- package/src/zoeService/types-ambient.d.ts.map +1 -0
- package/src/zoeService/{types.js → types-ambient.js} +19 -32
- package/src/zoeService/utils.d.ts +54 -58
- package/src/zoeService/utils.test-d.d.ts +2 -0
- package/src/zoeService/utils.test-d.d.ts.map +1 -0
- package/src/zoeService/utils.test-d.ts +33 -0
- package/src/zoeService/zoe.d.ts +9 -13
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +7 -7
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +214 -114
- package/src/zoeService/zoeStorageManager.d.ts +9 -43
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +8 -6
- package/tools/fakePriceAuthority.d.ts +9 -8
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +21 -17
- package/tools/fakeVatAdmin.d.ts +10 -10
- package/tools/manualPriceAuthority.d.ts +11 -6
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +15 -2
- package/tools/manualTimer.d.ts +21 -40
- package/tools/manualTimer.d.ts.map +1 -1
- package/tools/manualTimer.js +30 -16
- package/tools/prepare-test-env.js +1 -1
- package/tools/scriptedOracle.d.ts +3 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +1 -1
- package/tools/scriptedPriceAuthority.d.ts +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +6 -1
- package/tools/setup-zoe.d.ts +8 -9
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +16 -1
- package/tools/test-utils.d.ts +20 -0
- package/tools/test-utils.d.ts.map +1 -0
- package/tools/test-utils.js +26 -0
- package/tools/types.d.ts +21 -21
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +10 -10
- package/CHANGELOG.md +0 -1203
- package/src/contractFacet/types.d.ts +0 -191
- package/src/contractFacet/types.d.ts.map +0 -1
- package/src/contractFacet/types.js +0 -256
- package/src/contractSupport/types.d.ts.map +0 -1
- package/src/contracts/callSpread/types.d.ts.map +0 -1
- package/src/contracts/loan/types.d.ts.map +0 -1
- package/src/contracts/types.d.ts.map +0 -1
- package/src/objArrayConversion.d.ts +0 -5
- package/src/objArrayConversion.d.ts.map +0 -1
- package/src/objArrayConversion.js +0 -35
- package/src/types.d.ts +0 -45
- package/src/types.d.ts.map +0 -1
- package/src/zoeService/types.d.ts.map +0 -1
- package/tools/internal-types.d.ts +0 -12
- package/tools/internal-types.d.ts.map +0 -1
- package/tools/internal-types.js +0 -14
- package/tools/priceAuthorityRegistry.d.ts +0 -20
- package/tools/priceAuthorityRegistry.d.ts.map +0 -1
- package/tools/priceAuthorityRegistry.js +0 -209
- package/tools/types-ambient.d.ts +0 -142
- package/tools/types-ambient.d.ts.map +0 -1
- package/tools/types-ambient.js +0 -160
- /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
- /package/src/contracts/{types.js → types-ambient.js} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AmountMath } from '@agoric/ertp';
|
|
2
|
+
import { makeRatio } from '../src/contractSupport/ratio.js';
|
|
3
|
+
|
|
4
|
+
/** @param {Pick<IssuerKit<'nat'>, 'brand' | 'issuer' | 'mint'>} kit */
|
|
5
|
+
export const withAmountUtils = kit => {
|
|
6
|
+
const decimalPlaces = kit.issuer.getDisplayInfo?.()?.decimalPlaces ?? 6;
|
|
7
|
+
return {
|
|
8
|
+
...kit,
|
|
9
|
+
/** @param {NatValue} v */
|
|
10
|
+
make: v => AmountMath.make(kit.brand, v),
|
|
11
|
+
makeEmpty: () => AmountMath.makeEmpty(kit.brand),
|
|
12
|
+
/**
|
|
13
|
+
* @param {NatValue} n
|
|
14
|
+
* @param {NatValue} [d]
|
|
15
|
+
*/
|
|
16
|
+
makeRatio: (n, d) => makeRatio(n, kit.brand, d),
|
|
17
|
+
/** @param {number} n */
|
|
18
|
+
units: n =>
|
|
19
|
+
AmountMath.make(kit.brand, BigInt(Math.round(n * 10 ** decimalPlaces))),
|
|
20
|
+
/** The intact Exo remotable */
|
|
21
|
+
issuerKit: kit,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/** @typedef {ReturnType<typeof withAmountUtils>} AmountUtils */
|
|
25
|
+
|
|
26
|
+
export { makeFakeStorageKit } from '@agoric/internal/src/storage-test-utils.js';
|
package/tools/types.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ export type PriceQuote = {
|
|
|
2
2
|
/**
|
|
3
3
|
* Amount whose value is a PriceQuoteValue
|
|
4
4
|
*/
|
|
5
|
-
quoteAmount: Amount<
|
|
5
|
+
quoteAmount: Amount<"set", PriceDescription>;
|
|
6
6
|
/**
|
|
7
7
|
* The `quoteAmount` wrapped as a payment
|
|
8
8
|
*/
|
|
9
|
-
quotePayment: ERef<Payment<
|
|
9
|
+
quotePayment: ERef<Payment<"set", PriceDescription>>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* A single-valued set of PriceDescriptions. This is the `value` in
|
|
@@ -20,19 +20,19 @@ export type PriceDescription = {
|
|
|
20
20
|
/**
|
|
21
21
|
* The amount supplied to a trade
|
|
22
22
|
*/
|
|
23
|
-
amountIn: Amount<
|
|
23
|
+
amountIn: Amount<"nat">;
|
|
24
24
|
/**
|
|
25
25
|
* The quoted result of trading `amountIn`
|
|
26
26
|
*/
|
|
27
|
-
amountOut: Amount<
|
|
27
|
+
amountOut: Amount<"nat">;
|
|
28
28
|
/**
|
|
29
29
|
* The service that gave the `timestamp`
|
|
30
30
|
*/
|
|
31
|
-
timer: import(
|
|
31
|
+
timer: import("@endo/pass-style").RemotableObject & import("@agoric/time").TimerService;
|
|
32
32
|
/**
|
|
33
33
|
* A timestamp according to `timer` for the quote
|
|
34
34
|
*/
|
|
35
|
-
timestamp: import(
|
|
35
|
+
timestamp: import("@agoric/time").TimestampRecord;
|
|
36
36
|
/**
|
|
37
37
|
* Additional conditions for the quote
|
|
38
38
|
*/
|
|
@@ -49,7 +49,7 @@ export type PriceAuthorityKit = {
|
|
|
49
49
|
};
|
|
50
50
|
export type MutableQuote = {
|
|
51
51
|
cancel: (reason?: any) => void;
|
|
52
|
-
updateLevel: (amountIn: Amount<
|
|
52
|
+
updateLevel: (amountIn: Amount<"nat">, amountOut: Amount<"nat">) => void;
|
|
53
53
|
getPromise: () => ERef<PriceQuote>;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
@@ -60,38 +60,38 @@ export type PriceAuthority = {
|
|
|
60
60
|
/**
|
|
61
61
|
* Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair
|
|
62
62
|
*/
|
|
63
|
-
getQuoteIssuer: (brandIn: Brand, brandOut: Brand) => ERef<Issuer<
|
|
63
|
+
getQuoteIssuer: (brandIn: Brand, brandOut: Brand) => ERef<Issuer<"set", PriceDescription>>;
|
|
64
64
|
/**
|
|
65
65
|
* Get the timer used in PriceQuotes for a given brandIn/brandOut pair
|
|
66
66
|
*/
|
|
67
|
-
getTimerService: (brandIn: Brand, brandOut: Brand) => ERef<import(
|
|
67
|
+
getTimerService: (brandIn: Brand, brandOut: Brand) => ERef<import("@agoric/time").TimerService>;
|
|
68
68
|
/**
|
|
69
69
|
* Be notified of the latest PriceQuotes for a given
|
|
70
70
|
* `amountIn`. The rate at which these are issued may be very different between
|
|
71
71
|
* `priceAuthorities`.
|
|
72
72
|
*/
|
|
73
|
-
makeQuoteNotifier: (amountIn: Amount<
|
|
73
|
+
makeQuoteNotifier: (amountIn: Amount<"nat">, brandOut: Brand<"nat">) => ERef<Notifier<PriceQuote>>;
|
|
74
74
|
/**
|
|
75
75
|
* Resolves after `deadline` passes on the
|
|
76
76
|
* priceAuthority's timerService with the price quote of `amountIn` at that time
|
|
77
77
|
*/
|
|
78
|
-
quoteAtTime: (deadline: import(
|
|
78
|
+
quoteAtTime: (deadline: import("@agoric/time").Timestamp, amountIn: Amount<"nat">, brandOut: Brand<"nat">) => Promise<PriceQuote>;
|
|
79
79
|
/**
|
|
80
80
|
* Get a quote corresponding to the specified amountIn
|
|
81
81
|
*/
|
|
82
|
-
quoteGiven: (amountIn: Amount<
|
|
82
|
+
quoteGiven: (amountIn: Amount<"nat">, brandOut: Brand<"nat">) => Promise<PriceQuote>;
|
|
83
83
|
/**
|
|
84
84
|
* Get a quote corresponding to the specified amountOut
|
|
85
85
|
*/
|
|
86
|
-
quoteWanted: (brandIn: Brand<
|
|
86
|
+
quoteWanted: (brandIn: Brand<"nat">, amountOut: Amount<"nat">) => Promise<PriceQuote>;
|
|
87
87
|
/**
|
|
88
88
|
* Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
|
|
89
89
|
*/
|
|
90
|
-
quoteWhenGT: (amountIn: Amount<
|
|
90
|
+
quoteWhenGT: (amountIn: Amount<"nat">, amountOutLimit: Amount<"nat">) => Promise<PriceQuote>;
|
|
91
91
|
/**
|
|
92
92
|
* Resolve when a price quote of `amountIn` reaches or exceeds `amountOutLimit`
|
|
93
93
|
*/
|
|
94
|
-
quoteWhenGTE: (amountIn: Amount<
|
|
94
|
+
quoteWhenGTE: (amountIn: Amount<"nat">, amountOutLimit: Amount<"nat">) => Promise<PriceQuote>;
|
|
95
95
|
/**
|
|
96
96
|
* Resolve when a price quote of `amountIn` reaches or drops below
|
|
97
97
|
* `amountOutLimit`
|
|
@@ -120,11 +120,11 @@ export type PriceAuthority = {
|
|
|
120
120
|
*/
|
|
121
121
|
mutableQuoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
|
|
122
122
|
};
|
|
123
|
-
export type PriceCalculator = (amount: Amount<
|
|
123
|
+
export type PriceCalculator = (amount: Amount<"nat">) => Amount<"nat">;
|
|
124
124
|
export type PriceQuery = (calcAmountIn: PriceCalculator, calcAmountOut: PriceCalculator) => {
|
|
125
|
-
amountIn: Amount<
|
|
126
|
-
amountOut: Amount<
|
|
127
|
-
timestamp?: import(
|
|
125
|
+
amountIn: Amount<"nat">;
|
|
126
|
+
amountOut: Amount<"nat">;
|
|
127
|
+
timestamp?: import("@agoric/time").TimestampRecord;
|
|
128
128
|
} | undefined;
|
|
129
129
|
/**
|
|
130
130
|
* A description of a single quote
|
|
@@ -133,10 +133,10 @@ export type PriceLevel = {
|
|
|
133
133
|
/**
|
|
134
134
|
* The amount supplied to a trade
|
|
135
135
|
*/
|
|
136
|
-
amountIn: Amount<
|
|
136
|
+
amountIn: Amount<"nat">;
|
|
137
137
|
/**
|
|
138
138
|
* The quoted result of trading `amountIn`
|
|
139
139
|
*/
|
|
140
|
-
amountOut: Amount<
|
|
140
|
+
amountOut: Amount<"nat">;
|
|
141
141
|
};
|
|
142
142
|
//# sourceMappingURL=types.d.ts.map
|
package/tools/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;iBAKc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;iBAKc,MAAM,CAAC,KAAK,EAAE,gBAAgB,CAAC;;;;kBAE/B,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AAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,cAAc,EAAE,eAAe,CAAA;CAAE,GAAG,SAAS;;;;;;;;cAOpH,MAAM,CAAC,KAAK,CAAC;;;;eAEb,MAAM,CAAC,KAAK,CAAC"}
|
package/tools/types.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Ensure this is a module.
|
|
2
|
+
export {};
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {object} PriceQuote
|
|
6
|
-
* @property {Amount<'set'>} quoteAmount
|
|
6
|
+
* @property {Amount<'set', PriceDescription>} quoteAmount
|
|
7
7
|
* Amount whose value is a PriceQuoteValue
|
|
8
|
-
* @property {ERef<Payment<'set'>>} quotePayment
|
|
8
|
+
* @property {ERef<Payment<'set', PriceDescription>>} quotePayment
|
|
9
9
|
* The `quoteAmount` wrapped as a payment
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -22,9 +22,9 @@ export {};
|
|
|
22
22
|
* The amount supplied to a trade
|
|
23
23
|
* @property {Amount<'nat'>} amountOut
|
|
24
24
|
* The quoted result of trading `amountIn`
|
|
25
|
-
* @property {import('@agoric/time
|
|
25
|
+
* @property {import('@endo/pass-style').RemotableObject & import('@agoric/time').TimerService} timer
|
|
26
26
|
* The service that gave the `timestamp`
|
|
27
|
-
* @property {import('@agoric/time
|
|
27
|
+
* @property {import('@agoric/time').TimestampRecord} timestamp
|
|
28
28
|
* A timestamp according to `timer` for the quote
|
|
29
29
|
* @property {any} [conditions]
|
|
30
30
|
* Additional conditions for the quote
|
|
@@ -64,12 +64,12 @@ export {};
|
|
|
64
64
|
* An object that mints PriceQuotes and handles
|
|
65
65
|
* triggers and notifiers for changes in the price
|
|
66
66
|
*
|
|
67
|
-
* @property {(brandIn: Brand, brandOut: Brand) => ERef<Issuer<'set'>>} getQuoteIssuer
|
|
67
|
+
* @property {(brandIn: Brand, brandOut: Brand) => ERef<Issuer<'set', PriceDescription>>} getQuoteIssuer
|
|
68
68
|
* Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair
|
|
69
69
|
*
|
|
70
70
|
* @property {(brandIn: Brand,
|
|
71
71
|
* brandOut: Brand
|
|
72
|
-
* ) => ERef<import('@agoric/time
|
|
72
|
+
* ) => ERef<import('@agoric/time').TimerService>} getTimerService
|
|
73
73
|
* Get the timer used in PriceQuotes for a given brandIn/brandOut pair
|
|
74
74
|
*
|
|
75
75
|
* @property {(amountIn: Amount<'nat'>,
|
|
@@ -79,7 +79,7 @@ export {};
|
|
|
79
79
|
* `amountIn`. The rate at which these are issued may be very different between
|
|
80
80
|
* `priceAuthorities`.
|
|
81
81
|
*
|
|
82
|
-
* @property {(deadline: import('@agoric/time
|
|
82
|
+
* @property {(deadline: import('@agoric/time').Timestamp,
|
|
83
83
|
* amountIn: Amount<'nat'>,
|
|
84
84
|
* brandOut: Brand<'nat'>
|
|
85
85
|
* ) => Promise<PriceQuote>} quoteAtTime
|
|
@@ -147,7 +147,7 @@ export {};
|
|
|
147
147
|
* @callback PriceQuery
|
|
148
148
|
* @param {PriceCalculator} calcAmountIn
|
|
149
149
|
* @param {PriceCalculator} calcAmountOut
|
|
150
|
-
* @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time
|
|
150
|
+
* @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time').TimestampRecord } | undefined}
|
|
151
151
|
*/
|
|
152
152
|
|
|
153
153
|
/**
|