@agoric/zoe 0.26.3-dev-fa844b5.0 → 0.26.3-dev-a477bee.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/bundles/bundle-contractFacet-js-meta.json +84 -84
- package/bundles/bundle-contractFacet.d.ts +7 -0
- package/bundles/bundle-contractFacet.d.ts.map +1 -0
- package/package.json +15 -15
- package/src/cleanProposal.d.ts +9 -0
- package/src/cleanProposal.d.ts.map +1 -0
- package/src/contractFacet/allocationMath.d.ts +7 -0
- package/src/contractFacet/allocationMath.d.ts.map +1 -0
- package/src/contractFacet/evalContractCode.d.ts +2 -0
- package/src/contractFacet/evalContractCode.d.ts.map +1 -0
- package/src/contractFacet/exit.d.ts +2 -0
- package/src/contractFacet/exit.d.ts.map +1 -0
- package/src/contractFacet/internal-types.d.ts +8 -0
- package/src/contractFacet/internal-types.d.ts.map +1 -0
- package/src/contractFacet/offerHandlerStorage.d.ts +5 -0
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -0
- package/src/contractFacet/offerSafety.d.ts +34 -0
- package/src/contractFacet/offerSafety.d.ts.map +1 -0
- package/src/contractFacet/reallocate.d.ts +3 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -0
- package/src/contractFacet/rightsConservation.d.ts +12 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -0
- package/src/contractFacet/vatRoot.d.ts +14 -0
- package/src/contractFacet/vatRoot.d.ts.map +1 -0
- package/src/contractFacet/zcfMint.d.ts +8 -0
- package/src/contractFacet/zcfMint.d.ts.map +1 -0
- package/src/contractFacet/zcfSeat.d.ts +3 -0
- package/src/contractFacet/zcfSeat.d.ts.map +1 -0
- package/src/contractFacet/zcfZygote.d.ts +2 -0
- package/src/contractFacet/zcfZygote.d.ts.map +1 -0
- package/src/contractSupport/atomicTransfer.d.ts +6 -0
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -0
- package/src/contractSupport/bondingCurves.d.ts +6 -0
- package/src/contractSupport/bondingCurves.d.ts.map +1 -0
- package/src/contractSupport/durability.d.ts +5 -0
- package/src/contractSupport/durability.d.ts.map +1 -0
- package/src/contractSupport/index.d.ts +14 -0
- package/src/contractSupport/index.d.ts.map +1 -0
- package/src/contractSupport/prepare-ownable.d.ts +11 -0
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
- package/src/contractSupport/priceAuthority.d.ts +27 -0
- package/src/contractSupport/priceAuthority.d.ts.map +1 -0
- package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -0
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -0
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -0
- package/src/contractSupport/priceAuthorityTransform.d.ts +14 -0
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -0
- package/src/contractSupport/priceQuote.d.ts +7 -0
- package/src/contractSupport/priceQuote.d.ts.map +1 -0
- package/src/contractSupport/ratio.d.ts +28 -0
- package/src/contractSupport/ratio.d.ts.map +1 -0
- package/src/contractSupport/recorder.d.ts +143 -0
- package/src/contractSupport/recorder.d.ts.map +1 -0
- package/src/contractSupport/safeMath.d.ts +11 -0
- package/src/contractSupport/safeMath.d.ts.map +1 -0
- package/src/contractSupport/stateMachine.d.ts +6 -0
- package/src/contractSupport/stateMachine.d.ts.map +1 -0
- package/src/contractSupport/statistics.d.ts +7 -0
- package/src/contractSupport/statistics.d.ts.map +1 -0
- package/src/contractSupport/topics.d.ts +22 -0
- package/src/contractSupport/topics.d.ts.map +1 -0
- package/src/contractSupport/types.d.ts +63 -0
- package/src/contractSupport/types.d.ts.map +1 -0
- package/src/contractSupport/zoeHelpers.d.ts +30 -0
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -0
- package/src/contracts/atomicSwap.d.ts +16 -0
- package/src/contracts/atomicSwap.d.ts.map +1 -0
- package/src/contracts/auction/assertBidSeat.d.ts +2 -0
- package/src/contracts/auction/assertBidSeat.d.ts.map +1 -0
- package/src/contracts/auction/firstPriceLogic.d.ts +2 -0
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -0
- package/src/contracts/auction/index.d.ts +78 -0
- package/src/contracts/auction/index.d.ts.map +1 -0
- package/src/contracts/auction/secondPriceLogic.d.ts +2 -0
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -0
- package/src/contracts/automaticRefund.d.ts +25 -0
- package/src/contracts/automaticRefund.d.ts.map +1 -0
- package/src/contracts/autoswap.d.ts +43 -0
- package/src/contracts/autoswap.d.ts.map +1 -0
- package/src/contracts/barterExchange.d.ts +22 -0
- package/src/contracts/barterExchange.d.ts.map +1 -0
- package/src/contracts/callSpread/calculateShares.d.ts +2 -0
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts +60 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -0
- package/src/contracts/callSpread/payoffHandler.d.ts +11 -0
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -0
- package/src/contracts/callSpread/percent.d.ts +3 -0
- package/src/contracts/callSpread/percent.d.ts.map +1 -0
- package/src/contracts/callSpread/position.d.ts +10 -0
- package/src/contracts/callSpread/position.d.ts.map +1 -0
- package/src/contracts/callSpread/pricedCallSpread.d.ts +66 -0
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -0
- package/src/contracts/callSpread/types.d.ts +30 -0
- package/src/contracts/callSpread/types.d.ts.map +1 -0
- package/src/contracts/coveredCall-durable.d.ts +21 -0
- package/src/contracts/coveredCall-durable.d.ts.map +1 -0
- package/src/contracts/coveredCall.d.ts +64 -0
- package/src/contracts/coveredCall.d.ts.map +1 -0
- package/src/contracts/exported.d.ts +2 -0
- package/src/contracts/exported.d.ts.map +1 -0
- package/src/contracts/loan/addCollateral.d.ts +3 -0
- package/src/contracts/loan/addCollateral.d.ts.map +1 -0
- package/src/contracts/loan/borrow.d.ts +3 -0
- package/src/contracts/loan/borrow.d.ts.map +1 -0
- package/src/contracts/loan/close.d.ts +3 -0
- package/src/contracts/loan/close.d.ts.map +1 -0
- package/src/contracts/loan/index.d.ts +64 -0
- package/src/contracts/loan/index.d.ts.map +1 -0
- package/src/contracts/loan/lend.d.ts +3 -0
- package/src/contracts/loan/lend.d.ts.map +1 -0
- package/src/contracts/loan/liquidate.d.ts +3 -0
- package/src/contracts/loan/liquidate.d.ts.map +1 -0
- package/src/contracts/loan/scheduleLiquidation.d.ts +3 -0
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -0
- package/src/contracts/loan/types.d.ts +161 -0
- package/src/contracts/loan/types.d.ts.map +1 -0
- package/src/contracts/loan/updateDebt.d.ts +11 -0
- package/src/contracts/loan/updateDebt.d.ts.map +1 -0
- package/src/contracts/mintAndSellNFT.d.ts +28 -0
- package/src/contracts/mintAndSellNFT.d.ts.map +1 -0
- package/src/contracts/mintPayments.d.ts +30 -0
- package/src/contracts/mintPayments.d.ts.map +1 -0
- package/src/contracts/oracle.d.ts +26 -0
- package/src/contracts/oracle.d.ts.map +1 -0
- package/src/contracts/otcDesk.d.ts +79 -0
- package/src/contracts/otcDesk.d.ts.map +1 -0
- package/src/contracts/priceAggregator.d.ts +107 -0
- package/src/contracts/priceAggregator.d.ts.map +1 -0
- package/src/contracts/priceAggregator.js +0 -1
- package/src/contracts/priceAggregatorTypes.d.ts +77 -0
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -0
- package/src/contracts/scaledPriceAuthority.d.ts +21 -0
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -0
- package/src/contracts/sellItems.d.ts +30 -0
- package/src/contracts/sellItems.d.ts.map +1 -0
- package/src/contracts/simpleExchange.d.ts +37 -0
- package/src/contracts/simpleExchange.d.ts.map +1 -0
- package/src/contracts/types.d.ts +80 -0
- package/src/contracts/types.d.ts.map +1 -0
- package/src/handleWarning.d.ts +3 -0
- package/src/handleWarning.d.ts.map +1 -0
- package/src/instanceRecordStorage.d.ts +2 -0
- package/src/instanceRecordStorage.d.ts.map +1 -0
- package/src/internal-types.d.ts +179 -0
- package/src/internal-types.d.ts.map +1 -0
- package/src/issuerRecord.d.ts +3 -0
- package/src/issuerRecord.d.ts.map +1 -0
- package/src/issuerStorage.d.ts +14 -0
- package/src/issuerStorage.d.ts.map +1 -0
- package/src/makeHandle.d.ts +4 -0
- package/src/makeHandle.d.ts.map +1 -0
- package/src/typeGuards.d.ts +169 -0
- package/src/typeGuards.d.ts.map +1 -0
- package/src/types.d.ts +46 -0
- package/src/types.d.ts.map +1 -0
- package/src/zoeService/createZCFVat.d.ts +2 -0
- package/src/zoeService/createZCFVat.d.ts.map +1 -0
- package/src/zoeService/escrowStorage.d.ts +7 -0
- package/src/zoeService/escrowStorage.d.ts.map +1 -0
- package/src/zoeService/feeMint.d.ts +23 -0
- package/src/zoeService/feeMint.d.ts.map +1 -0
- package/src/zoeService/installationStorage.d.ts +20 -0
- package/src/zoeService/installationStorage.d.ts.map +1 -0
- package/src/zoeService/instanceAdminStorage.d.ts +103 -0
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -0
- package/src/zoeService/internal-types.d.ts +90 -0
- package/src/zoeService/internal-types.d.ts.map +1 -0
- package/src/zoeService/invitationQueries.d.ts +6 -0
- package/src/zoeService/invitationQueries.d.ts.map +1 -0
- package/src/zoeService/makeInvitation.d.ts +5 -0
- package/src/zoeService/makeInvitation.d.ts.map +1 -0
- package/src/zoeService/offer/burnInvitation.d.ts +5 -0
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -0
- package/src/zoeService/offer/offer.d.ts +2 -0
- package/src/zoeService/offer/offer.d.ts.map +1 -0
- package/src/zoeService/originalZoeSeat.d.ts +34 -0
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
- package/src/zoeService/startInstance.d.ts +4 -0
- package/src/zoeService/startInstance.d.ts.map +1 -0
- package/src/zoeService/types.d.ts +224 -0
- package/src/zoeService/types.d.ts.map +1 -0
- package/src/zoeService/utils.test-d.d.ts +2 -0
- package/src/zoeService/utils.test-d.d.ts.map +1 -0
- package/src/zoeService/zoe.d.ts +57 -0
- package/src/zoeService/zoe.d.ts.map +1 -0
- package/src/zoeService/zoe.js +0 -2
- package/src/zoeService/zoeSeat.d.ts +26 -0
- package/src/zoeService/zoeSeat.d.ts.map +1 -0
- package/src/zoeService/zoeStorageManager.d.ts +41 -0
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -0
- package/tools/fakePriceAuthority.d.ts +30 -0
- package/tools/fakePriceAuthority.d.ts.map +1 -0
- package/tools/fakeVatAdmin.d.ts +103 -0
- package/tools/fakeVatAdmin.d.ts.map +1 -0
- package/tools/internal-types.d.ts +12 -0
- package/tools/internal-types.d.ts.map +1 -0
- package/tools/manualPriceAuthority.d.ts +21 -0
- package/tools/manualPriceAuthority.d.ts.map +1 -0
- package/tools/manualTimer.d.ts +44 -0
- package/tools/manualTimer.d.ts.map +1 -0
- package/tools/prepare-test-env-ava.d.ts +2 -0
- package/tools/prepare-test-env-ava.d.ts.map +1 -0
- package/tools/prepare-test-env.d.ts +2 -0
- package/tools/prepare-test-env.d.ts.map +1 -0
- package/tools/scriptedOracle.d.ts +27 -0
- package/tools/scriptedOracle.d.ts.map +1 -0
- package/tools/scriptedPriceAuthority.d.ts +2 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -0
- package/tools/setup-zoe.d.ts +33 -0
- package/tools/setup-zoe.d.ts.map +1 -0
- package/tools/types-ambient.d.ts +142 -0
- package/tools/types-ambient.d.ts.map +1 -0
- package/tools/types.d.ts +142 -0
- package/tools/types.d.ts.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coveredCall.d.ts","sourceRoot":"","sources":["coveredCall.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,2BAFW,GAAG;;EA6Cb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exported.d.ts","sourceRoot":"","sources":["exported.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addCollateral.d.ts","sourceRoot":"","sources":["addCollateral.js"],"names":[],"mappings":"AAUA,0CAA0C;AAC1C,0CADW,2BAA2B,CAwBpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borrow.d.ts","sourceRoot":"","sources":["borrow.js"],"names":[],"mappings":"AAkBA,mCAAmC;AACnC,mCADW,oBAAoB,CAoI7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"close.d.ts","sourceRoot":"","sources":["close.js"],"names":[],"mappings":"AAYA,sCAAsC;AACtC,sCADW,uBAAuB,CAiDhC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add collateral of a particular brand and get a loan of another
|
|
3
|
+
* brand. Collateral (also known as margin) must be greater than the
|
|
4
|
+
* loan value, at an amount set by the Maintenance Margin Requirement
|
|
5
|
+
* (mmr) in the terms of the contract. The loan does not have a
|
|
6
|
+
* distinct end time. Rather, if the value of the collateral changes
|
|
7
|
+
* such that insufficient margin is provided, the collateral is
|
|
8
|
+
* liquidated, and the loan is closed. At any time, the borrower can
|
|
9
|
+
* add collateral or repay the loan with interest, closing the loan.
|
|
10
|
+
* The borrower can set up their own margin calls by getting the
|
|
11
|
+
* `priceAuthority` from the terms and calling
|
|
12
|
+
* `E(priceAuthority).quoteWhenLT(allCollateral, x)` where x is the
|
|
13
|
+
* value of the collateral in the Loan brand at which they want a
|
|
14
|
+
* reminder to addCollateral.
|
|
15
|
+
*
|
|
16
|
+
* Note that all collateral must be of the same brand and all of the
|
|
17
|
+
* loaned amount and interest must be of the same (separate) brand.
|
|
18
|
+
*
|
|
19
|
+
* Terms:
|
|
20
|
+
* * mmr (default = 150/100) - the Maintenance Margin Requirement, as a
|
|
21
|
+
* ratio. The default is 150/100, meaning that collateral should be
|
|
22
|
+
* worth at least 150% of the loan. If the value of the collateral
|
|
23
|
+
* drops below mmr, liquidation occurs.
|
|
24
|
+
* * priceAuthority - will be used for getting the current value of
|
|
25
|
+
* collateral and setting liquidation triggers.
|
|
26
|
+
* * autoswapInstance - The running contract instance for an Autoswap
|
|
27
|
+
* installation. The publicFacet of the
|
|
28
|
+
* instance is used for producing an invitation to sell the
|
|
29
|
+
* collateral on liquidation.
|
|
30
|
+
* * periodNotifier - the Notifier that provides notifications that
|
|
31
|
+
* periods have passed, on which compound interest will be
|
|
32
|
+
* calculated using the interestRate. Notifiers don't guarantee
|
|
33
|
+
* that clients will see all the changes, so the contract must
|
|
34
|
+
* track when interest last accrued.
|
|
35
|
+
* * interestRate - the rate in basis points that will be multiplied
|
|
36
|
+
* with the debt on every period to compound interest.
|
|
37
|
+
* * interestPeriod - the period at which interest compounds.
|
|
38
|
+
*
|
|
39
|
+
* IssuerKeywordRecord:
|
|
40
|
+
* * Keyword: 'Collateral' - The issuer for the digital assets to be
|
|
41
|
+
* escrowed as collateral.
|
|
42
|
+
* * Keyword: 'Loan' - The issuer for the digital assets to be loaned
|
|
43
|
+
* out.
|
|
44
|
+
*
|
|
45
|
+
* @param {ZCF<{
|
|
46
|
+
* mmr: Ratio,
|
|
47
|
+
* autoswapInstance: Instance,
|
|
48
|
+
* priceAuthority: PriceAuthority,
|
|
49
|
+
* periodNotifier: PeriodNotifier,
|
|
50
|
+
* interestRate: Ratio,
|
|
51
|
+
* interestPeriod: bigint,
|
|
52
|
+
* }>} zcf
|
|
53
|
+
*/
|
|
54
|
+
export function start(zcf: ZCF<{
|
|
55
|
+
mmr: Ratio;
|
|
56
|
+
autoswapInstance: Instance;
|
|
57
|
+
priceAuthority: PriceAuthority;
|
|
58
|
+
periodNotifier: PeriodNotifier;
|
|
59
|
+
interestRate: Ratio;
|
|
60
|
+
interestPeriod: bigint;
|
|
61
|
+
}>): Promise<{
|
|
62
|
+
creatorInvitation: Promise<Invitation<unknown, undefined>>;
|
|
63
|
+
}>;
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,2BATW,IAAI;IACd,GAAO,EAAE,KAAK,CAAC;IACf,gBAAoB,EAAE,QAAQ,CAAC;IAC/B,cAAkB,EAAE,cAAc,CAAC;IACnC,cAAkB,EAAE,cAAc,CAAC;IACnC,YAAgB,EAAE,KAAK,CAAC;IACxB,cAAkB,EAAE,MAAM,CAAC;CACxB,CAAC;;GAsCJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lend.d.ts","sourceRoot":"","sources":["lend.js"],"names":[],"mappings":"AAaA,iCAAiC;AACjC,iCADW,kBAAkB,CA4B3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquidate.d.ts","sourceRoot":"","sources":["liquidate.js"],"names":[],"mappings":"AAKO,wIA6CN;AAeM,+BAJI,GAAG,UACH,sBAAsB,GACpB,QAAQ,IAAI,CAAC,CAiBzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleLiquidation.d.ts","sourceRoot":"","sources":["scheduleLiquidation.js"],"names":[],"mappings":"AAWA,kCAAkC;AAClC,kCADW,mBAAmB,CAsD5B"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Notifier that provides notifications that periods have passed.
|
|
3
|
+
* Since notifiers can't be relied on to produce an output every time
|
|
4
|
+
* they should, we'll track the time of last payment, and catch up if
|
|
5
|
+
* any times have been missed. Compound interest will be calculated
|
|
6
|
+
* using the interestRate.
|
|
7
|
+
*/
|
|
8
|
+
type PeriodNotifier = Notifier<import('@agoric/time').TimestampRecord>;
|
|
9
|
+
/**
|
|
10
|
+
* The running contract instance for an Autoswap installation. The
|
|
11
|
+
* publicFacet from the Autoswap
|
|
12
|
+
* instance is used for producing an invitation to sell the
|
|
13
|
+
* collateral on liquidation.
|
|
14
|
+
*/
|
|
15
|
+
type AutoswapInstance = Instance;
|
|
16
|
+
type LoanTerms = {
|
|
17
|
+
/**
|
|
18
|
+
* - Maintenance Margin Requirement, a Ratio record.
|
|
19
|
+
* Default is 150%
|
|
20
|
+
*/
|
|
21
|
+
mmr: Ratio;
|
|
22
|
+
autoswapInstance: AutoswapInstance;
|
|
23
|
+
/**
|
|
24
|
+
* Used for getting the current value of collateral and setting
|
|
25
|
+
* liquidation triggers.
|
|
26
|
+
*/
|
|
27
|
+
priceAuthority: PriceAuthority;
|
|
28
|
+
periodNotifier: PeriodNotifier;
|
|
29
|
+
/**
|
|
30
|
+
* The rate in basis points that will be multiplied with the debt on
|
|
31
|
+
* every period to compound interest.
|
|
32
|
+
*/
|
|
33
|
+
interestRate: Ratio;
|
|
34
|
+
interestPeriod: import('@agoric/time').RelativeTime;
|
|
35
|
+
loanBrand: Brand;
|
|
36
|
+
collateralBrand: Brand;
|
|
37
|
+
};
|
|
38
|
+
type LenderSeatProperty = {
|
|
39
|
+
/**
|
|
40
|
+
* The ZCFSeat representing the lender's position in the contract.
|
|
41
|
+
*/
|
|
42
|
+
lenderSeat: ZCFSeat;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The loan now has a lenderSeat, which is added to the config.
|
|
46
|
+
*/
|
|
47
|
+
type LoanConfigWithLender = LoanTerms & LenderSeatProperty;
|
|
48
|
+
type BorrowerConfigProperties = {
|
|
49
|
+
/**
|
|
50
|
+
* The ZCFSeat holding the collateral in escrow after the borrower
|
|
51
|
+
* escrows it
|
|
52
|
+
*/
|
|
53
|
+
collateralSeat: ZCFSeat;
|
|
54
|
+
/**
|
|
55
|
+
* A function to get the current debt
|
|
56
|
+
*/
|
|
57
|
+
getDebt: () => Amount<'nat'>;
|
|
58
|
+
/**
|
|
59
|
+
* PromiseKit that includes a promise that resolves to a PriceQuote
|
|
60
|
+
* when liquidation is triggered
|
|
61
|
+
*/
|
|
62
|
+
liquidationPromiseKit: PromiseRecord<PriceQuote>;
|
|
63
|
+
};
|
|
64
|
+
type BorrowerConfigPropertiesMinusDebt = {
|
|
65
|
+
/**
|
|
66
|
+
* The ZCFSeat holding the collateral in escrow after the borrower
|
|
67
|
+
* escrows it
|
|
68
|
+
*/
|
|
69
|
+
collateralSeat: ZCFSeat;
|
|
70
|
+
/**
|
|
71
|
+
* PromiseKit that includes a promise that resolves to a PriceQuote
|
|
72
|
+
* when liquidation is triggered
|
|
73
|
+
*/
|
|
74
|
+
liquidationPromiseKit: PromiseRecord<PriceQuote>;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The loan has a lender, a borrower, and collateral escrowed.
|
|
78
|
+
*/
|
|
79
|
+
type LoanConfigWithBorrower = LoanConfigWithLender & BorrowerConfigProperties;
|
|
80
|
+
type LoanConfigWithBorrowerMinusDebt = LoanConfigWithLender & BorrowerConfigPropertiesMinusDebt;
|
|
81
|
+
type ScheduleLiquidation = (zcf: ZCF, config: LoanConfigWithBorrower) => any;
|
|
82
|
+
type MakeLendInvitation = (zcf: ZCF, config: LoanTerms) => Promise<Invitation>;
|
|
83
|
+
type MakeBorrowInvitation = (zcf: ZCF, config: LoanConfigWithLender) => Promise<Invitation>;
|
|
84
|
+
type MakeCloseLoanInvitation = (zcf: ZCF, config: LoanConfigWithBorrower) => Promise<Invitation>;
|
|
85
|
+
/**
|
|
86
|
+
* Allows holder to add collateral to the contract. Exits the seat
|
|
87
|
+
* after adding.
|
|
88
|
+
*/
|
|
89
|
+
type MakeAddCollateralInvitation = (zcf: ZCF, config: LoanConfigWithBorrower) => Promise<Invitation>;
|
|
90
|
+
type MakeDebtCalculator = (debtCalculatorConfig: DebtCalculatorConfig) => any;
|
|
91
|
+
type CalcInterestFn = (oldDebt: Amount<'nat'>, interestRate: Ratio) => Amount<'nat'>;
|
|
92
|
+
type DebtCalculatorConfig = {
|
|
93
|
+
/**
|
|
94
|
+
* A function to calculate the interest, given the debt value and an
|
|
95
|
+
* interest rate in basis points.
|
|
96
|
+
*/
|
|
97
|
+
calcInterestFn: CalcInterestFn;
|
|
98
|
+
/**
|
|
99
|
+
* The debt at the start of the loan, in Loan brand
|
|
100
|
+
*/
|
|
101
|
+
originalDebt: Amount<'nat'>;
|
|
102
|
+
/**
|
|
103
|
+
* The AsyncIterable to notify when a period has occurred
|
|
104
|
+
*/
|
|
105
|
+
periodNotifier: PeriodNotifier;
|
|
106
|
+
interestRate: Ratio;
|
|
107
|
+
/**
|
|
108
|
+
* the period at which the outstanding debt increases by the interestRate
|
|
109
|
+
*/
|
|
110
|
+
interestPeriod: import('@agoric/time').RelativeTime;
|
|
111
|
+
zcf: ZCF;
|
|
112
|
+
configMinusGetDebt: LoanConfigWithBorrowerMinusDebt;
|
|
113
|
+
/**
|
|
114
|
+
* The starting point from which to calculate
|
|
115
|
+
* interest.
|
|
116
|
+
*/
|
|
117
|
+
basetime: import('@agoric/time').Timestamp;
|
|
118
|
+
};
|
|
119
|
+
type ConfigMinusGetDebt = {
|
|
120
|
+
collateralSeat: ZCFSeat;
|
|
121
|
+
liquidationPromiseKit: PromiseRecord<any>;
|
|
122
|
+
mmr?: bigint | undefined;
|
|
123
|
+
autoswapInstance: Handle<'Instance'>;
|
|
124
|
+
priceAuthority: PriceAuthority;
|
|
125
|
+
periodNotifier: PeriodNotifier;
|
|
126
|
+
interestRate: bigint;
|
|
127
|
+
interestPeriod: import('@agoric/time').RelativeTime;
|
|
128
|
+
lenderSeat: ZCFSeat;
|
|
129
|
+
};
|
|
130
|
+
type BorrowFacet = {
|
|
131
|
+
/**
|
|
132
|
+
* Make an invitation to close the loan by repaying the debt
|
|
133
|
+
* (including interest).
|
|
134
|
+
*/
|
|
135
|
+
makeCloseLoanInvitation: () => Promise<Invitation>;
|
|
136
|
+
/**
|
|
137
|
+
* Make an invitation to add collateral to protect against liquidation
|
|
138
|
+
*/
|
|
139
|
+
makeAddCollateralInvitation: () => Promise<Invitation>;
|
|
140
|
+
/**
|
|
141
|
+
* Get a promise for a priceQuote that will resolve if liquidation
|
|
142
|
+
* occurs. The priceQuote is for the value of the collateral that
|
|
143
|
+
* triggered the liquidation. This may be lower than expected if the
|
|
144
|
+
* price is moving quickly.
|
|
145
|
+
*/
|
|
146
|
+
getLiquidationPromise: () => Promise<PriceQuote>;
|
|
147
|
+
/**
|
|
148
|
+
* Get the timestamp at which the debt was most recently recalculated.
|
|
149
|
+
*/
|
|
150
|
+
getLastCalculationTimestamp: () => import('@agoric/time').Timestamp;
|
|
151
|
+
/**
|
|
152
|
+
* Get a Notifier that will be updated when the current debt (an Amount with the Loan
|
|
153
|
+
* Brand) changes. This will increase as interest is added.
|
|
154
|
+
*/
|
|
155
|
+
getDebtNotifier: () => Notifier<Amount>;
|
|
156
|
+
/**
|
|
157
|
+
* Get a recent report of the amount of collateral in the loan
|
|
158
|
+
*/
|
|
159
|
+
getRecentCollateralAmount: () => Amount;
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;sBACa,SAAS,OAAO,cAAc,EAAE,eAAe,CAAC;;;;;;;wBAUhD,QAAQ;;;;;;SAUP,KAAK;sBAGL,gBAAgB;;;;;oBAEhB,cAAc;oBAKd,cAAc;;;;;kBAEd,KAAK;oBAIL,OAAO,cAAc,EAAE,YAAY;eAEnC,KAAK;qBACL,KAAK;;;;;;gBAKL,OAAO;;;;;4BAMR,SAAS,GAAG,kBAAkB;;;;;;oBAQ7B,OAAO;;;;aAKP,MAAM,OAAO,KAAK,CAAC;;;;;;;;;;;;oBAanB,OAAO;;;;;;;;;;8BAYR,oBAAoB,GAAG,wBAAwB;uCAM/C,oBAAoB,GAAG,iCAAiC;iCAM1D,GAAG,UACH,sBAAsB;gCAKtB,GAAG,UACH,SAAS,KACP,QAAQ,UAAU,CAAC;kCAKrB,GAAG,UACH,oBAAoB,KAClB,QAAQ,UAAU,CAAC;qCAKrB,GAAG,UACH,sBAAsB,KACpB,QAAQ,UAAU,CAAC;;;;;yCAQrB,GAAG,UACH,sBAAsB,KACpB,QAAQ,UAAU,CAAC;iDAKrB,oBAAoB;gCAKpB,OAAO,KAAK,CAAC,gBACb,KAAK,KACH,OAAO,KAAK,CAAC;;;;;;oBAKZ,cAAc;;;;kBAKd,OAAO,KAAK,CAAC;;;;oBAIb,cAAc;kBAId,KAAK;;;;oBACL,OAAO,cAAc,EAAE,YAAY;SAInC,GAAG;wBAEH,+BAA+B;;;;;cAC/B,OAAO,cAAc,EAAE,SAAS;;;oBAMhC,OAAO;;;sBAGP,OAAO,UAAU,CAAC;oBAClB,cAAc;oBACd,cAAc;kBACd,MAAM;oBACN,OAAO,cAAc,EAAE,YAAY;gBACnC,OAAO;;;;;;;6BAMP,MAAM,QAAQ,UAAU,CAAC;;;;iCAKzB,MAAM,QAAQ,UAAU,CAAC;;;;;;;2BAIzB,MAAM,QAAQ,UAAU,CAAC;;;;iCAOzB,MAAM,OAAO,cAAc,EAAE,SAAS;;;;;qBAItC,MAAM,SAAS,MAAM,CAAC;;;;+BAKtB,MAAM,MAAM"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {CalcInterestFn} Calculate the interest using an interest
|
|
3
|
+
* rate in basis points.
|
|
4
|
+
* i.e. oldDebtValue is 40,000
|
|
5
|
+
* interestRate (in basis points) is 5 = 5/10,000
|
|
6
|
+
* interest charged this period is 20 loan brand
|
|
7
|
+
*/
|
|
8
|
+
export const calculateInterest: CalcInterestFn;
|
|
9
|
+
/** @type {MakeDebtCalculator} */
|
|
10
|
+
export const makeDebtCalculator: MakeDebtCalculator;
|
|
11
|
+
//# sourceMappingURL=updateDebt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateDebt.d.ts","sourceRoot":"","sources":["updateDebt.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,gCANU,cAAc,CAOgB;AAExC,iCAAiC;AACjC,iCADW,kBAAkB,CAyE3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This contract mints non-fungible tokens and creates a selling contract
|
|
3
|
+
* instance to sell the tokens in exchange for some sort of money.
|
|
4
|
+
*
|
|
5
|
+
* startInstance() returns a creatorFacet which is a
|
|
6
|
+
* ticketMaker with a `.sellTokens()` method. `.sellTokens()` takes a
|
|
7
|
+
* specification of what is being sold, such as:
|
|
8
|
+
* {
|
|
9
|
+
* customValueProperties: { ...arbitrary },
|
|
10
|
+
* count: 3n,
|
|
11
|
+
* moneyIssuer: moolaIssuer,
|
|
12
|
+
* sellItemsInstallationHandle,
|
|
13
|
+
* pricePerItem: AmountMath.make(moolaBrand, 20n),
|
|
14
|
+
* }
|
|
15
|
+
* The payouts are returned as an offerResult in the `outcome`, and an API that
|
|
16
|
+
* allows selling the tickets that were produced. You can reuse the ticket maker
|
|
17
|
+
* to mint more tickets (e.g. for a separate show.)
|
|
18
|
+
*
|
|
19
|
+
* @param {ZCF<{
|
|
20
|
+
* tokenName: string,
|
|
21
|
+
* }>} zcf
|
|
22
|
+
*/
|
|
23
|
+
export function start(zcf: ZCF<{
|
|
24
|
+
tokenName: string;
|
|
25
|
+
}>): {
|
|
26
|
+
creatorFacet: MintAndSellNFTCreatorFacet;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=mintAndSellNFT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintAndSellNFT.d.ts","sourceRoot":"","sources":["mintAndSellNFT.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,2BAJW,IAAI;IACd,SAAW,EAAE,MAAM,CAAC;CACjB,CAAC;;EA4FJ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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<string, undefined>>;
|
|
19
|
+
getTokenIssuer: () => globalThis.Issuer<"nat">;
|
|
20
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
21
|
+
makeInvitation: (value?: bigint) => Promise<Invitation<string, undefined>>;
|
|
22
|
+
getTokenIssuer: () => globalThis.Issuer<"nat">;
|
|
23
|
+
}>;
|
|
24
|
+
publicFacet: {
|
|
25
|
+
getTokenIssuer: () => globalThis.Issuer<"nat">;
|
|
26
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
27
|
+
getTokenIssuer: () => globalThis.Issuer<"nat">;
|
|
28
|
+
}>;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=mintPayments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintPayments.d.ts","sourceRoot":"","sources":["mintPayments.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,2BAFW,GAAG;;;;;;;;;;;;;GAyCb"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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<unknown, never>>;
|
|
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<unknown, never>>;
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=oracle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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: import('@agoric/time').TimerService, 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: import('@agoric/time').TimerService, deadline: any) => Promise<Payment>;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=otcDesk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,OAAO,cAAc,EAAE,YAAY,YACnC,GAAG,KACD,QAAQ,OAAO,CAAC;;QAqD3B;;;;;;WAMG;+FADU,QAAQ,OAAO,CAAC;QAM7B;;;;;;WAMG;6CADU,QAAQ,OAAO,CAAC;2BAzEpB,mBAAmB,UACnB,mBAAmB,iBACnB,OAAO,cAAc,EAAE,YAAY,YACnC,GAAG,KACD,QAAQ,OAAO,CAAC;;EA8E9B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
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').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').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<globalThis.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<{
|
|
50
|
+
admin: OracleAdmin<Price>;
|
|
51
|
+
invitationMakers: {
|
|
52
|
+
PushPrice: (price: ParsableNumber) => Promise<Invitation<void>>;
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
notifier?: Notifier<OraclePriceSubmission> | undefined;
|
|
56
|
+
scaleValueOut?: number | undefined;
|
|
57
|
+
}>>;
|
|
58
|
+
/** @param {OracleKey} oracleKey */
|
|
59
|
+
deleteOracle: (oracleKey: OracleKey) => Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* @param {Instance | string} [oracleInstance]
|
|
62
|
+
* @param {OracleQuery} [query]
|
|
63
|
+
* @returns {Promise<OracleAdmin<Price>>}
|
|
64
|
+
*/
|
|
65
|
+
initOracle: (oracleInstance?: string | Instance | undefined, query?: OracleQuery | undefined) => Promise<OracleAdmin<Price>>;
|
|
66
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
67
|
+
/**
|
|
68
|
+
* An "oracle invitation" is an invitation to be able to submit data to
|
|
69
|
+
* include in the priceAggregator's results.
|
|
70
|
+
*
|
|
71
|
+
* The offer result from this invitation is a OracleAdmin, which can be used
|
|
72
|
+
* directly to manage the price submissions as well as to terminate the
|
|
73
|
+
* relationship.
|
|
74
|
+
*
|
|
75
|
+
* @param {Instance | string} [oracleKey]
|
|
76
|
+
*/
|
|
77
|
+
makeOracleInvitation: (oracleKey?: string | Instance | undefined) => Promise<Invitation<{
|
|
78
|
+
admin: OracleAdmin<Price>;
|
|
79
|
+
invitationMakers: {
|
|
80
|
+
PushPrice: (price: ParsableNumber) => Promise<Invitation<void>>;
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
notifier?: Notifier<OraclePriceSubmission> | undefined;
|
|
84
|
+
scaleValueOut?: number | undefined;
|
|
85
|
+
}>>;
|
|
86
|
+
/** @param {OracleKey} oracleKey */
|
|
87
|
+
deleteOracle: (oracleKey: OracleKey) => Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* @param {Instance | string} [oracleInstance]
|
|
90
|
+
* @param {OracleQuery} [query]
|
|
91
|
+
* @returns {Promise<OracleAdmin<Price>>}
|
|
92
|
+
*/
|
|
93
|
+
initOracle: (oracleInstance?: string | Instance | undefined, query?: OracleQuery | undefined) => Promise<OracleAdmin<Price>>;
|
|
94
|
+
}>;
|
|
95
|
+
publicFacet: {
|
|
96
|
+
getPriceAuthority(): PriceAuthority;
|
|
97
|
+
getSubscriber: () => StoredSubscriber<unknown>;
|
|
98
|
+
/** Diagnostic tool */
|
|
99
|
+
getRoundCompleteNotifier(): Promise<Notifier<any>>;
|
|
100
|
+
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
101
|
+
getPriceAuthority(): PriceAuthority;
|
|
102
|
+
getSubscriber: () => StoredSubscriber<unknown>;
|
|
103
|
+
/** Diagnostic tool */
|
|
104
|
+
getRoundCompleteNotifier(): Promise<Notifier<any>>;
|
|
105
|
+
}>;
|
|
106
|
+
}>;
|
|
107
|
+
//# sourceMappingURL=priceAggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceAggregator.d.ts","sourceRoot":"","sources":["priceAggregator.js"],"names":[],"mappings":"6BAoCc,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,2BAbW,IAAI;IACd,KAAO,EAAE,OAAO,cAAc,EAAE,YAAY,CAAC;IAC7C,aAAe,EAAE,MAAM,CAAC;IACxB,OAAS,EAAE,MAAM,KAAK,CAAC,CAAC;IACxB,QAAU,EAAE,MAAM,KAAK,CAAC,CAAC;IACzB,YAAc,EAAE,OAAO,KAAK,CAAC,CAAC;CAC3B,CAAC;gBAEU,UAAU;;;;;QAmXrB;;;;;;;;;WASG;;mBAY4B,YAAY,KAAK,CAAC;8BAAoB;gBAAC,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,QAAQ,WAAW,IAAI,CAAC,CAAC,CAAA;aAAC;;;;;QA0CtI,mCAAmC;kCAAvB,SAAS;QAarB;;;;WAIG;yGADU,QAAQ,YAAY,KAAK,CAAC,CAAC;;QA/ExC;;;;;;;;;WASG;;mBAY4B,YAAY,KAAK,CAAC;8BAAoB;gBAAC,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,QAAQ,WAAW,IAAI,CAAC,CAAC,CAAA;aAAC;;;;;QA0CtI,mCAAmC;kCAAvB,SAAS;QAarB;;;;WAIG;yGADU,QAAQ,YAAY,KAAK,CAAC,CAAC;;;;;QAmHxC,sBAAsB;;;;;QAAtB,sBAAsB;;;GAOzB"}
|