@agoric/inter-protocol 0.16.2-dev-6e5b422.0 → 0.16.2-dev-bd1190d.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 (112) hide show
  1. package/bundles/bundle-auctioneer-js-meta.json +116 -116
  2. package/bundles/bundle-econCommitteeCharter-js-meta.json +71 -71
  3. package/bundles/bundle-feeDistributor-js-meta.json +57 -57
  4. package/bundles/bundle-fluxAggregatorKit-js-meta.json +111 -111
  5. package/bundles/bundle-psm-js-meta.json +109 -109
  6. package/bundles/bundle-reserve-js-meta.json +108 -108
  7. package/bundles/bundle-scaledPriceAuthority-js-meta.json +84 -84
  8. package/bundles/bundle-vaultFactory-js-meta.json +133 -133
  9. package/package.json +19 -17
  10. package/src/auction/auctionBook.d.ts +80 -0
  11. package/src/auction/auctionBook.d.ts.map +1 -0
  12. package/src/auction/auctioneer.d.ts +75 -0
  13. package/src/auction/auctioneer.d.ts.map +1 -0
  14. package/src/auction/offerBook.d.ts +72 -0
  15. package/src/auction/offerBook.d.ts.map +1 -0
  16. package/src/auction/params.d.ts +142 -0
  17. package/src/auction/params.d.ts.map +1 -0
  18. package/src/auction/scheduleMath.d.ts +4 -0
  19. package/src/auction/scheduleMath.d.ts.map +1 -0
  20. package/src/auction/scheduler.d.ts +49 -0
  21. package/src/auction/scheduler.d.ts.map +1 -0
  22. package/src/auction/sortedOffers.d.ts +8 -0
  23. package/src/auction/sortedOffers.d.ts.map +1 -0
  24. package/src/auction/util.d.ts +30 -0
  25. package/src/auction/util.d.ts.map +1 -0
  26. package/src/clientSupport.d.ts +129 -0
  27. package/src/clientSupport.d.ts.map +1 -0
  28. package/src/collectFees.d.ts +2 -0
  29. package/src/collectFees.d.ts.map +1 -0
  30. package/src/contractSupport.d.ts +33 -0
  31. package/src/contractSupport.d.ts.map +1 -0
  32. package/src/econCommitteeCharter.d.ts +45 -0
  33. package/src/econCommitteeCharter.d.ts.map +1 -0
  34. package/src/feeDistributor.d.ts +234 -0
  35. package/src/feeDistributor.d.ts.map +1 -0
  36. package/src/index.d.ts +2 -0
  37. package/src/index.d.ts.map +1 -0
  38. package/src/interest-math.d.ts +3 -0
  39. package/src/interest-math.d.ts.map +1 -0
  40. package/src/interest.d.ts +28 -0
  41. package/src/interest.d.ts.map +1 -0
  42. package/src/price/fluxAggregatorContract.d.ts +110 -0
  43. package/src/price/fluxAggregatorContract.d.ts.map +1 -0
  44. package/src/price/fluxAggregatorKit.d.ts +150 -0
  45. package/src/price/fluxAggregatorKit.d.ts.map +1 -0
  46. package/src/price/priceOracleKit.d.ts +58 -0
  47. package/src/price/priceOracleKit.d.ts.map +1 -0
  48. package/src/price/roundsManager.d.ts +348 -0
  49. package/src/price/roundsManager.d.ts.map +1 -0
  50. package/src/proposals/addAssetToVault.d.ts +155 -0
  51. package/src/proposals/addAssetToVault.d.ts.map +1 -0
  52. package/src/proposals/committee-proposal.d.ts +121 -0
  53. package/src/proposals/committee-proposal.d.ts.map +1 -0
  54. package/src/proposals/core-proposal.d.ts +149 -0
  55. package/src/proposals/core-proposal.d.ts.map +1 -0
  56. package/src/proposals/econ-behaviors.d.ts +201 -0
  57. package/src/proposals/econ-behaviors.d.ts.map +1 -0
  58. package/src/proposals/price-feed-proposal.d.ts +83 -0
  59. package/src/proposals/price-feed-proposal.d.ts.map +1 -0
  60. package/src/proposals/startEconCommittee.d.ts +34 -0
  61. package/src/proposals/startEconCommittee.d.ts.map +1 -0
  62. package/src/proposals/startPSM.d.ts +61 -0
  63. package/src/proposals/startPSM.d.ts.map +1 -0
  64. package/src/proposals/startPSM.js +8 -7
  65. package/src/proposals/utils.d.ts +15 -0
  66. package/src/proposals/utils.d.ts.map +1 -0
  67. package/src/psm/psm.d.ts +193 -0
  68. package/src/psm/psm.d.ts.map +1 -0
  69. package/src/psm/types.d.ts +2 -0
  70. package/src/psm/types.d.ts.map +1 -0
  71. package/src/reserve/assetReserve.d.ts +42 -0
  72. package/src/reserve/assetReserve.d.ts.map +1 -0
  73. package/src/reserve/assetReserveKit.d.ts +126 -0
  74. package/src/reserve/assetReserveKit.d.ts.map +1 -0
  75. package/src/reserve/params.d.ts +10 -0
  76. package/src/reserve/params.d.ts.map +1 -0
  77. package/src/tokens.d.ts +36 -0
  78. package/src/tokens.d.ts.map +1 -0
  79. package/src/typeGuards.d.ts +5 -0
  80. package/src/typeGuards.d.ts.map +1 -0
  81. package/src/vaultFactory/burn.d.ts +2 -0
  82. package/src/vaultFactory/burn.d.ts.map +1 -0
  83. package/src/vaultFactory/liquidation.d.ts +24 -0
  84. package/src/vaultFactory/liquidation.d.ts.map +1 -0
  85. package/src/vaultFactory/math.d.ts +10 -0
  86. package/src/vaultFactory/math.d.ts.map +1 -0
  87. package/src/vaultFactory/orderedVaultStore.d.ts +94 -0
  88. package/src/vaultFactory/orderedVaultStore.d.ts.map +1 -0
  89. package/src/vaultFactory/params.d.ts +162 -0
  90. package/src/vaultFactory/params.d.ts.map +1 -0
  91. package/src/vaultFactory/prioritizedVaults.d.ts +279 -0
  92. package/src/vaultFactory/prioritizedVaults.d.ts.map +1 -0
  93. package/src/vaultFactory/proceeds.d.ts +34 -0
  94. package/src/vaultFactory/proceeds.d.ts.map +1 -0
  95. package/src/vaultFactory/storeUtils.d.ts +29 -0
  96. package/src/vaultFactory/storeUtils.d.ts.map +1 -0
  97. package/src/vaultFactory/type-imports.d.ts +2 -0
  98. package/src/vaultFactory/type-imports.d.ts.map +1 -0
  99. package/src/vaultFactory/types.d.ts +132 -0
  100. package/src/vaultFactory/types.d.ts.map +1 -0
  101. package/src/vaultFactory/vault.d.ts +585 -0
  102. package/src/vaultFactory/vault.d.ts.map +1 -0
  103. package/src/vaultFactory/vaultDirector.d.ts +582 -0
  104. package/src/vaultFactory/vaultDirector.d.ts.map +1 -0
  105. package/src/vaultFactory/vaultFactory.d.ts +159 -0
  106. package/src/vaultFactory/vaultFactory.d.ts.map +1 -0
  107. package/src/vaultFactory/vaultHolder.d.ts +205 -0
  108. package/src/vaultFactory/vaultHolder.d.ts.map +1 -0
  109. package/src/vaultFactory/vaultKit.d.ts +32 -0
  110. package/src/vaultFactory/vaultKit.d.ts.map +1 -0
  111. package/src/vaultFactory/vaultManager.d.ts +552 -0
  112. package/src/vaultFactory/vaultManager.d.ts.map +1 -0
@@ -0,0 +1,150 @@
1
+ export const INVITATION_MAKERS_DESC: "oracle invitation";
2
+ export function prepareFluxAggregatorKit(baggage: MapStore<string, unknown>, zcf: ZCF<ChainlinkConfig & {
3
+ timer: TimerService;
4
+ brandIn: Brand<'nat'>;
5
+ brandOut: Brand<'nat'>;
6
+ unitAmountIn?: Amount<"nat"> | undefined;
7
+ }>, timerPresence: TimerService, quoteKit: import('./roundsManager.js').QuoteKit, storageNode: StorageNode, makeDurablePublishKit: () => PublishKit<any>, makeRecorder: import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorder): Promise<() => {
8
+ creator: {
9
+ /**
10
+ * An "oracle invitation" is an invitation to be able to submit data to
11
+ * include in the priceAggregator's results.
12
+ *
13
+ * The offer result from this invitation is a OracleAdmin, which can be used
14
+ * directly to manage the price submissions as well as to terminate the
15
+ * relationship.
16
+ *
17
+ * @param {string} oracleId unique per contract instance
18
+ */
19
+ makeOracleInvitation(oracleId: string): Promise<Invitation<R, A>>;
20
+ /** @param {string} oracleId */
21
+ removeOracle(oracleId: string): Promise<void>;
22
+ getRoundData: (roundIdRaw: any) => Promise<import("./roundsManager.js").RoundData>;
23
+ /** @param {string} oracleId */
24
+ initOracle(oracleId: string): Promise<{
25
+ admin: {
26
+ disable(): void;
27
+ };
28
+ oracle: {
29
+ pushPrice({ roundId: roundIdRaw, unitPrice: valueRaw, }: import("./priceOracleKit.js").PriceDatum): Promise<void>;
30
+ getStatus(): import("./priceOracleKit.js").OracleStatus;
31
+ };
32
+ } & import("@endo/eventual-send").RemotableBrand<{}, {
33
+ admin: {
34
+ disable(): void;
35
+ };
36
+ oracle: {
37
+ pushPrice({ roundId: roundIdRaw, unitPrice: valueRaw, }: import("./priceOracleKit.js").PriceDatum): Promise<void>;
38
+ getStatus(): import("./priceOracleKit.js").OracleStatus;
39
+ };
40
+ }>>;
41
+ /**
42
+ * a method to provide all current info oracleStatuses need. Intended only
43
+ * only to be callable by oracleStatuses. Not for use by contracts to read state.
44
+ *
45
+ * @param {string} oracleId
46
+ * @param {bigint} queriedRoundId
47
+ * @returns {Promise<RoundState>}
48
+ */
49
+ oracleRoundState(oracleId: string, queriedRoundId: bigint): Promise<RoundState>;
50
+ };
51
+ public: {
52
+ getPriceAuthority(): PriceAuthority;
53
+ getPublicTopics(): {
54
+ quotes: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<PriceDescription>;
55
+ latestRound: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./roundsManager.js").LatestRound>;
56
+ };
57
+ };
58
+ } & import("@endo/eventual-send").RemotableBrand<{}, {
59
+ creator: {
60
+ /**
61
+ * An "oracle invitation" is an invitation to be able to submit data to
62
+ * include in the priceAggregator's results.
63
+ *
64
+ * The offer result from this invitation is a OracleAdmin, which can be used
65
+ * directly to manage the price submissions as well as to terminate the
66
+ * relationship.
67
+ *
68
+ * @param {string} oracleId unique per contract instance
69
+ */
70
+ makeOracleInvitation(oracleId: string): Promise<Invitation<R, A>>;
71
+ /** @param {string} oracleId */
72
+ removeOracle(oracleId: string): Promise<void>;
73
+ getRoundData: (roundIdRaw: any) => Promise<import("./roundsManager.js").RoundData>;
74
+ /** @param {string} oracleId */
75
+ initOracle(oracleId: string): Promise<{
76
+ admin: {
77
+ disable(): void;
78
+ };
79
+ oracle: {
80
+ pushPrice({ roundId: roundIdRaw, unitPrice: valueRaw, }: import("./priceOracleKit.js").PriceDatum): Promise<void>;
81
+ getStatus(): import("./priceOracleKit.js").OracleStatus;
82
+ };
83
+ } & import("@endo/eventual-send").RemotableBrand<{}, {
84
+ admin: {
85
+ disable(): void;
86
+ };
87
+ oracle: {
88
+ pushPrice({ roundId: roundIdRaw, unitPrice: valueRaw, }: import("./priceOracleKit.js").PriceDatum): Promise<void>;
89
+ getStatus(): import("./priceOracleKit.js").OracleStatus;
90
+ };
91
+ }>>;
92
+ /**
93
+ * a method to provide all current info oracleStatuses need. Intended only
94
+ * only to be callable by oracleStatuses. Not for use by contracts to read state.
95
+ *
96
+ * @param {string} oracleId
97
+ * @param {bigint} queriedRoundId
98
+ * @returns {Promise<RoundState>}
99
+ */
100
+ oracleRoundState(oracleId: string, queriedRoundId: bigint): Promise<RoundState>;
101
+ };
102
+ public: {
103
+ getPriceAuthority(): PriceAuthority;
104
+ getPublicTopics(): {
105
+ quotes: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<PriceDescription>;
106
+ latestRound: import("@agoric/zoe/src/contractSupport/topics.js").PublicTopic<import("./roundsManager.js").LatestRound>;
107
+ };
108
+ };
109
+ }>>;
110
+ export type Baggage = import('@agoric/vat-data').Baggage;
111
+ export type Timestamp = import('@agoric/time/src/types').Timestamp;
112
+ /**
113
+ * // TODO: use RelativeTime, not RelativeTimeValue
114
+ */
115
+ export type RelativeTime = import('@agoric/time/src/types').RelativeTime;
116
+ export type RelativeTimeValue = import('@agoric/time/src/types').RelativeTimeValue;
117
+ export type TimerService = import('@agoric/time/src/types').TimerService;
118
+ export type RoundState = {
119
+ eligibleForSpecificRound: boolean;
120
+ queriedRoundId: bigint;
121
+ latestSubmission: bigint;
122
+ startedAt: Timestamp;
123
+ roundTimeout: number;
124
+ oracleCount: number;
125
+ };
126
+ export type ChainlinkConfig = {
127
+ maxSubmissionCount: number;
128
+ minSubmissionCount: number;
129
+ /**
130
+ * the number of rounds an Oracle has to wait before they can initiate a round
131
+ */
132
+ restartDelay: bigint;
133
+ /**
134
+ * an immutable check for a lower bound of what
135
+ * submission values are accepted from an oracle
136
+ */
137
+ minSubmissionValue: number;
138
+ /**
139
+ * an immutable check for an upper bound of what
140
+ * submission values are accepted from an oracle
141
+ */
142
+ maxSubmissionValue: number;
143
+ /**
144
+ * the number of seconds after the previous round that
145
+ * allowed to lapse before allowing an oracle to skip an unfinished round
146
+ */
147
+ timeout: number;
148
+ };
149
+ export type FluxAggregatorKit = ReturnType<Awaited<ReturnType<typeof prepareFluxAggregatorKit>>>;
150
+ //# sourceMappingURL=fluxAggregatorKit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluxAggregatorKit.d.ts","sourceRoot":"","sources":["fluxAggregatorKit.js"],"names":[],"mappings":"AAsBA,yDAA0D;AA2DnD;WAXG,YAAY;aACV,MAAM,KAAK,CAAC;cACX,MAAM,KAAK,CAAC;;mBAGd,YAAY,YACZ,OAAO,oBAAoB,EAAE,QAAQ,eACrC,WAAW,yBACX,MAAM,WAAW,GAAG,CAAC,gBACrB,OAAO,6CAA6C,EAAE,YAAY;;QA8IrE;;;;;;;;;WASG;uCADQ,MAAM;QAsCjB,+BAA+B;+BAAnB,MAAM;;QAalB,+BAA+B;6BAAnB,MAAM;;;;;;;;;;;;;;;;;QAoBlB;;;;;;;WAOG;mCAHQ,MAAM,kBACN,MAAM,GACJ,QAAQ,UAAU,CAAC;;;;;;;;;;;QArFhC;;;;;;;;;WASG;uCADQ,MAAM;QAsCjB,+BAA+B;+BAAnB,MAAM;;QAalB,+BAA+B;6BAAnB,MAAM;;;;;;;;;;;;;;;;;QAoBlB;;;;;;;WAOG;mCAHQ,MAAM,kBACN,MAAM,GACJ,QAAQ,UAAU,CAAC;;;;;;;;;IAqDvC;sBA9UY,OAAO,kBAAkB,EAAE,OAAO;wBAClC,OAAO,wBAAwB,EAAE,SAAS;;;;2BAC1C,OAAO,wBAAwB,EAAE,YAAY;gCAE7C,OAAO,wBAAwB,EAAE,iBAAiB;2BAClD,OAAO,wBAAwB,EAAE,YAAY;;8BAQ5C,OAAO;oBACP,MAAM;sBACN,MAAM;eACN,SAAS;kBACT,MAAM;iBACN,MAAM;;;wBAMN,MAAM;wBACN,MAAM;;;;kBACN,MAAM;;;;;wBACN,MAAM;;;;;wBAEN,MAAM;;;;;aAEN,MAAM;;gCAiTN,WAAW,QAAQ,WAAW,+BAA+B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ export const INVITATION_MAKERS_DESC: "oracle invitation";
2
+ export function prepareOracleAdminKit(baggage: any): (args_0: HeldParams) => {
3
+ admin: {
4
+ disable(): void;
5
+ };
6
+ oracle: {
7
+ /**
8
+ * push a unitPrice result from this oracle
9
+ *
10
+ * @param {PriceDatum} datum
11
+ */
12
+ pushPrice({ roundId: roundIdRaw, unitPrice: valueRaw, }: PriceDatum): Promise<void>;
13
+ /**
14
+ *
15
+ * @returns {OracleStatus}
16
+ */
17
+ getStatus(): OracleStatus;
18
+ };
19
+ } & import("@endo/eventual-send").RemotableBrand<{}, {
20
+ admin: {
21
+ disable(): void;
22
+ };
23
+ oracle: {
24
+ /**
25
+ * push a unitPrice result from this oracle
26
+ *
27
+ * @param {PriceDatum} datum
28
+ */
29
+ pushPrice({ roundId: roundIdRaw, unitPrice: valueRaw, }: PriceDatum): Promise<void>;
30
+ /**
31
+ *
32
+ * @returns {OracleStatus}
33
+ */
34
+ getStatus(): OracleStatus;
35
+ };
36
+ }>;
37
+ export type HeldParams = {
38
+ oracleId: string;
39
+ roundPowers: {
40
+ handlePush: (status: OracleStatus, result: import('./roundsManager.js').PriceRound) => Promise<OracleStatus>;
41
+ };
42
+ };
43
+ export type PriceDatum = {
44
+ roundId: number | undefined;
45
+ unitPrice: NatValue;
46
+ };
47
+ export type OracleStatus = {
48
+ disabled?: boolean | undefined;
49
+ lastReportedRound: bigint;
50
+ lastStartedRound: bigint;
51
+ latestSubmission: bigint;
52
+ oracleId: string;
53
+ };
54
+ export type ImmutableState = Readonly<HeldParams & {}>;
55
+ export type MutableState = OracleStatus & {};
56
+ export type State = ImmutableState & MutableState;
57
+ export type OracleKit = ReturnType<ReturnType<typeof prepareOracleAdminKit>>;
58
+ //# sourceMappingURL=priceOracleKit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"priceOracleKit.d.ts","sourceRoot":"","sources":["priceOracleKit.js"],"names":[],"mappings":"AAMA,yDAA0D;AA2DnD;;;;;QAcC;;;;WAIG;iEADQ,UAAU;QA0BrB;;;WAGG;qBADU,YAAY;;;;;;;QA/BzB;;;;WAIG;iEADQ,UAAU;QA0BrB;;;WAGG;qBADU,YAAY;;GAc9B;;cAlHY,MAAM;;6BACoB,YAAY,UAAU,OAAO,oBAAoB,EAAE,UAAU,KAAK,QAAQ,YAAY,CAAC;;;yBAKnH;IAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,SAAS,EAAE,QAAQ,CAAA;CAAE;;;uBAMnD,MAAM;sBACN,MAAM;sBACN,MAAM;cACN,MAAM;;6BAGP,SAAS,UAAU,GAAG,EAC/B,CAAC;2BAEQ,YAAY,GAAG,EACxB;oBAEU,cAAc,GAAG,YAAY;wBA4F7B,WAAW,WAAW,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,348 @@
1
+ /** @type {bigint} */
2
+ export const ROUND_MAX: bigint;
3
+ export function prepareRoundsManagerKit(baggage: any): (args_0: Readonly<import("./fluxAggregatorKit.js").ChainlinkConfig & {
4
+ quoteKit: QuoteKit;
5
+ answerPublisher: Publisher<void>;
6
+ brandIn: Brand<'nat'>;
7
+ brandOut: Brand<'nat'>;
8
+ latestRoundPublisher: import('@agoric/zoe/src/contractSupport/recorder.js').Recorder<LatestRound>;
9
+ timerPresence: TimerService;
10
+ }> & {
11
+ unitAmountIn: Amount<'nat'>;
12
+ }) => {
13
+ helper: {
14
+ /**
15
+ * @param {bigint} roundId
16
+ */
17
+ acceptingSubmissions(roundId: bigint): boolean;
18
+ /**
19
+ * @param {OracleStatus} status
20
+ * @param {bigint} roundId
21
+ */
22
+ delayed(status: OracleStatus, roundId: bigint): boolean;
23
+ /**
24
+ * @param {bigint} roundId
25
+ */
26
+ deleteRoundDetails(roundId: bigint): void;
27
+ /**
28
+ * @param {bigint} roundId
29
+ */
30
+ isNextRound(roundId: bigint): boolean;
31
+ /**
32
+ * @param {bigint} roundId
33
+ * @param {Timestamp} blockTimestamp
34
+ * @param {string} oracleId
35
+ */
36
+ initializeNewRound(roundId: bigint, blockTimestamp: Timestamp, oracleId: string): void;
37
+ /**
38
+ * @param {bigint} roundId
39
+ * @param {bigint} rrId reporting round ID
40
+ */
41
+ previousAndCurrentUnanswered(roundId: bigint, rrId: bigint): boolean;
42
+ /**
43
+ * @param {bigint} roundId
44
+ * @param {OracleStatus} status
45
+ * @param {Timestamp} blockTimestamp
46
+ * @returns {OracleStatus | undefined} the new status
47
+ */
48
+ proposeNewRound(roundId: bigint, status: OracleStatus, blockTimestamp: Timestamp): OracleStatus | undefined;
49
+ /**
50
+ * @param {bigint} submission
51
+ * @param {bigint} roundId
52
+ * @param {OracleStatus} status
53
+ * @returns {OracleStatus} the new status
54
+ */
55
+ recordSubmission(submission: bigint, roundId: bigint, status: OracleStatus): OracleStatus;
56
+ /**
57
+ * @param {bigint} roundId
58
+ * @param {Timestamp} blockTimestamp
59
+ */
60
+ supersedable(roundId: bigint, blockTimestamp: Timestamp): boolean;
61
+ /**
62
+ * @param {bigint} roundId
63
+ * @param {Timestamp} blockTimestamp
64
+ */
65
+ timedOut(roundId: bigint, blockTimestamp: Timestamp): boolean;
66
+ /**
67
+ * @param {bigint} roundId
68
+ * @param {Timestamp} blockTimestamp
69
+ */
70
+ updateRoundAnswer(roundId: bigint, blockTimestamp: Timestamp): (number | boolean)[] | (bigint | boolean)[];
71
+ /**
72
+ * @param {bigint} roundId
73
+ * @param {Timestamp} blockTimestamp
74
+ */
75
+ updateTimedOutRoundInfo(roundId: bigint, blockTimestamp: Timestamp): void;
76
+ /**
77
+ * @param {OracleStatus} status
78
+ * @param {bigint} roundId
79
+ * @param {Timestamp} blockTimestamp
80
+ * @returns {string?} error message, if there is one
81
+ */
82
+ validateOracleRound(status: OracleStatus, roundId: bigint, blockTimestamp: Timestamp): string | null;
83
+ };
84
+ contract: {
85
+ /**
86
+ *
87
+ * @param {PriceQuoteValue} quote
88
+ */
89
+ authenticateQuote(quote: PriceQuoteValue): Promise<{
90
+ quoteAmount: Amount<"set">;
91
+ quotePayment: Payment<"set">;
92
+ }>;
93
+ /**
94
+ * @param {object} param0
95
+ * @param {number} [param0.overrideValueOut]
96
+ * @param {Timestamp} [param0.timestamp]
97
+ */
98
+ makeCreateQuote({ overrideValueOut, timestamp }?: {
99
+ overrideValueOut?: number | undefined;
100
+ timestamp?: import("@agoric/time/src/types").Timestamp | undefined;
101
+ }): ((priceQuery: any) => Promise<{
102
+ quoteAmount: Amount<"set">;
103
+ quotePayment: Payment<"set">;
104
+ }> | undefined) & import("@endo/eventual-send").RemotableBrand<{}, (priceQuery: any) => Promise<{
105
+ quoteAmount: Amount<"set">;
106
+ quotePayment: Payment<"set">;
107
+ }> | undefined>;
108
+ /**
109
+ * @param {OracleStatus} status
110
+ * @param {bigint} queriedRoundId
111
+ * @param {Timestamp} blockTimestamp
112
+ */
113
+ eligibleForSpecificRound(status: OracleStatus, queriedRoundId: bigint, blockTimestamp: Timestamp): boolean;
114
+ /**
115
+ * consumers are encouraged to check
116
+ * that they're receiving fresh data by inspecting the updatedAt and
117
+ * answeredInRound return values.
118
+ *
119
+ * @param {bigint | number} roundIdRaw
120
+ * @returns {Promise<RoundData>}
121
+ */
122
+ getRoundData(roundIdRaw: bigint | number): Promise<RoundData>;
123
+ /** @type {(roundId: bigint) => Readonly<RoundDetails & Round>} */
124
+ getRoundStatus(roundId: bigint): Readonly<RoundDetails & Round>;
125
+ /**
126
+ * a method to provide all current info oracleStatuses need. Intended only
127
+ * only to be callable by oracleStatuses. Not for use by contracts to read state.
128
+ *
129
+ * @param {OracleStatus} status
130
+ * @param {Timestamp} blockTimestamp
131
+ */
132
+ oracleRoundStateSuggestRound(status: OracleStatus, blockTimestamp: Timestamp): {
133
+ eligibleForSpecificRound: boolean;
134
+ queriedRoundId: bigint;
135
+ latestSubmission: bigint;
136
+ startedAt: import("@agoric/time/src/types").Timestamp;
137
+ roundTimeout: number;
138
+ };
139
+ };
140
+ oracle: {
141
+ /**
142
+ * push a unitPrice result from this oracle
143
+ *
144
+ * @param {OracleStatus} status
145
+ * @param {PriceRound} result
146
+ */
147
+ handlePush(status: OracleStatus, { roundId: roundIdRaw, unitPrice: valueRaw }: PriceRound): Promise<import("./priceOracleKit.js").OracleStatus>;
148
+ };
149
+ } & import("@endo/eventual-send").RemotableBrand<{}, {
150
+ helper: {
151
+ /**
152
+ * @param {bigint} roundId
153
+ */
154
+ acceptingSubmissions(roundId: bigint): boolean;
155
+ /**
156
+ * @param {OracleStatus} status
157
+ * @param {bigint} roundId
158
+ */
159
+ delayed(status: OracleStatus, roundId: bigint): boolean;
160
+ /**
161
+ * @param {bigint} roundId
162
+ */
163
+ deleteRoundDetails(roundId: bigint): void;
164
+ /**
165
+ * @param {bigint} roundId
166
+ */
167
+ isNextRound(roundId: bigint): boolean;
168
+ /**
169
+ * @param {bigint} roundId
170
+ * @param {Timestamp} blockTimestamp
171
+ * @param {string} oracleId
172
+ */
173
+ initializeNewRound(roundId: bigint, blockTimestamp: Timestamp, oracleId: string): void;
174
+ /**
175
+ * @param {bigint} roundId
176
+ * @param {bigint} rrId reporting round ID
177
+ */
178
+ previousAndCurrentUnanswered(roundId: bigint, rrId: bigint): boolean;
179
+ /**
180
+ * @param {bigint} roundId
181
+ * @param {OracleStatus} status
182
+ * @param {Timestamp} blockTimestamp
183
+ * @returns {OracleStatus | undefined} the new status
184
+ */
185
+ proposeNewRound(roundId: bigint, status: OracleStatus, blockTimestamp: Timestamp): OracleStatus | undefined;
186
+ /**
187
+ * @param {bigint} submission
188
+ * @param {bigint} roundId
189
+ * @param {OracleStatus} status
190
+ * @returns {OracleStatus} the new status
191
+ */
192
+ recordSubmission(submission: bigint, roundId: bigint, status: OracleStatus): OracleStatus;
193
+ /**
194
+ * @param {bigint} roundId
195
+ * @param {Timestamp} blockTimestamp
196
+ */
197
+ supersedable(roundId: bigint, blockTimestamp: Timestamp): boolean;
198
+ /**
199
+ * @param {bigint} roundId
200
+ * @param {Timestamp} blockTimestamp
201
+ */
202
+ timedOut(roundId: bigint, blockTimestamp: Timestamp): boolean;
203
+ /**
204
+ * @param {bigint} roundId
205
+ * @param {Timestamp} blockTimestamp
206
+ */
207
+ updateRoundAnswer(roundId: bigint, blockTimestamp: Timestamp): (number | boolean)[] | (bigint | boolean)[];
208
+ /**
209
+ * @param {bigint} roundId
210
+ * @param {Timestamp} blockTimestamp
211
+ */
212
+ updateTimedOutRoundInfo(roundId: bigint, blockTimestamp: Timestamp): void;
213
+ /**
214
+ * @param {OracleStatus} status
215
+ * @param {bigint} roundId
216
+ * @param {Timestamp} blockTimestamp
217
+ * @returns {string?} error message, if there is one
218
+ */
219
+ validateOracleRound(status: OracleStatus, roundId: bigint, blockTimestamp: Timestamp): string | null;
220
+ };
221
+ contract: {
222
+ /**
223
+ *
224
+ * @param {PriceQuoteValue} quote
225
+ */
226
+ authenticateQuote(quote: PriceQuoteValue): Promise<{
227
+ quoteAmount: Amount<"set">;
228
+ quotePayment: Payment<"set">;
229
+ }>;
230
+ /**
231
+ * @param {object} param0
232
+ * @param {number} [param0.overrideValueOut]
233
+ * @param {Timestamp} [param0.timestamp]
234
+ */
235
+ makeCreateQuote({ overrideValueOut, timestamp }?: {
236
+ overrideValueOut?: number | undefined;
237
+ timestamp?: import("@agoric/time/src/types").Timestamp | undefined;
238
+ }): ((priceQuery: any) => Promise<{
239
+ quoteAmount: Amount<"set">;
240
+ quotePayment: Payment<"set">;
241
+ }> | undefined) & import("@endo/eventual-send").RemotableBrand<{}, (priceQuery: any) => Promise<{
242
+ quoteAmount: Amount<"set">;
243
+ quotePayment: Payment<"set">;
244
+ }> | undefined>;
245
+ /**
246
+ * @param {OracleStatus} status
247
+ * @param {bigint} queriedRoundId
248
+ * @param {Timestamp} blockTimestamp
249
+ */
250
+ eligibleForSpecificRound(status: OracleStatus, queriedRoundId: bigint, blockTimestamp: Timestamp): boolean;
251
+ /**
252
+ * consumers are encouraged to check
253
+ * that they're receiving fresh data by inspecting the updatedAt and
254
+ * answeredInRound return values.
255
+ *
256
+ * @param {bigint | number} roundIdRaw
257
+ * @returns {Promise<RoundData>}
258
+ */
259
+ getRoundData(roundIdRaw: bigint | number): Promise<RoundData>;
260
+ /** @type {(roundId: bigint) => Readonly<RoundDetails & Round>} */
261
+ getRoundStatus(roundId: bigint): Readonly<RoundDetails & Round>;
262
+ /**
263
+ * a method to provide all current info oracleStatuses need. Intended only
264
+ * only to be callable by oracleStatuses. Not for use by contracts to read state.
265
+ *
266
+ * @param {OracleStatus} status
267
+ * @param {Timestamp} blockTimestamp
268
+ */
269
+ oracleRoundStateSuggestRound(status: OracleStatus, blockTimestamp: Timestamp): {
270
+ eligibleForSpecificRound: boolean;
271
+ queriedRoundId: bigint;
272
+ latestSubmission: bigint;
273
+ startedAt: import("@agoric/time/src/types").Timestamp;
274
+ roundTimeout: number;
275
+ };
276
+ };
277
+ oracle: {
278
+ /**
279
+ * push a unitPrice result from this oracle
280
+ *
281
+ * @param {OracleStatus} status
282
+ * @param {PriceRound} result
283
+ */
284
+ handlePush(status: OracleStatus, { roundId: roundIdRaw, unitPrice: valueRaw }: PriceRound): Promise<import("./priceOracleKit.js").OracleStatus>;
285
+ };
286
+ }>;
287
+ export type OracleStatus = import('./priceOracleKit.js').OracleStatus;
288
+ export type Timestamp = import('@agoric/time/src/types').Timestamp;
289
+ export type TimerService = import('@agoric/time/src/types').TimerService;
290
+ export type PriceRound = {
291
+ roundId: number | undefined;
292
+ unitPrice: NatValue;
293
+ };
294
+ export type LatestRound = Pick<RoundData, 'roundId' | 'startedAt'> & {
295
+ startedBy: string;
296
+ };
297
+ export type RoundData = Round & {
298
+ roundId: bigint;
299
+ };
300
+ export type Round = {
301
+ /**
302
+ * the answer for the given round
303
+ */
304
+ answer: bigint;
305
+ /**
306
+ * the timestamp when the round was started. This is 0
307
+ * if the round hasn't been started yet.
308
+ */
309
+ startedAt: Timestamp;
310
+ /**
311
+ * the timestamp when the round last was updated (i.e.
312
+ * answer was last computed)
313
+ */
314
+ updatedAt: Timestamp;
315
+ /**
316
+ * the round ID of the round in which the answer
317
+ * was computed. answeredInRound may be smaller than roundId when the round
318
+ * timed out. answeredInRound is equal to roundId when the round didn't time out
319
+ * and was completed regularly.
320
+ */
321
+ answeredInRound: bigint;
322
+ };
323
+ export type RoundDetails = {
324
+ submissions: bigint[];
325
+ maxSubmissions: number;
326
+ minSubmissions: number;
327
+ roundTimeout: number;
328
+ };
329
+ export type QuoteKit = IssuerKit<'set'>;
330
+ export type HeldParams = Readonly<import('./fluxAggregatorKit.js').ChainlinkConfig & {
331
+ quoteKit: QuoteKit;
332
+ answerPublisher: Publisher<void>;
333
+ brandIn: Brand<'nat'>;
334
+ brandOut: Brand<'nat'>;
335
+ latestRoundPublisher: import('@agoric/zoe/src/contractSupport/recorder.js').Recorder<LatestRound>;
336
+ timerPresence: TimerService;
337
+ }>;
338
+ export type ImmutableState = Readonly<HeldParams & {
339
+ details: MapStore<bigint, RoundDetails>;
340
+ rounds: MapStore<bigint, Round>;
341
+ unitIn: bigint;
342
+ }>;
343
+ export type MutableState = {
344
+ lastValueOutForUnitIn: bigint | null;
345
+ reportingRoundId: bigint;
346
+ };
347
+ export type State = ImmutableState & MutableState;
348
+ //# sourceMappingURL=roundsManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundsManager.d.ts","sourceRoot":"","sources":["roundsManager.js"],"names":[],"mappings":"AAyBA,qBAAqB;AACrB,wBADW,MAAM,CAC4B;AAqEtC;cArBM,QAAQ;qBACD,UAAU,IAAI,CAAC;aACvB,MAAM,KAAK,CAAC;cACX,MAAM,KAAK,CAAC;0BACA,OAAO,6CAA6C,EAAE,QAAQ,CAAC,WAAW,CAAC;mBAClF,YAAY;;kBAuCqB,OAAO,KAAK,CAAC;;;QAsDxD;;WAEG;sCADQ,MAAM;QASjB;;;WAGG;wBAFQ,YAAY,WACZ,MAAM;QAQjB;;WAEG;oCADQ,MAAM;QAUjB;;WAEG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