@agoric/zoe 0.26.3-dev-d7e3856.0.d7e3856 → 0.26.3-dev-cbcb2b4.0.cbcb2b4
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 +223 -223
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +15 -15
- package/src/contractSupport/recorder.d.ts +17 -15
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +10 -21
- package/tools/scriptedPriceAuthority.d.ts +27 -2
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/zoe",
|
|
3
|
-
"version": "0.26.3-dev-
|
|
3
|
+
"version": "0.26.3-dev-cbcb2b4.0.cbcb2b4",
|
|
4
4
|
"description": "Zoe: the Smart Contract Framework for Offer Enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/zoeService/zoe.js",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agoric/base-zone": "0.1.1-dev-
|
|
47
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
48
|
-
"@agoric/internal": "0.3.3-dev-
|
|
49
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
50
|
-
"@agoric/store": "0.9.3-dev-
|
|
51
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
52
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
53
|
-
"@agoric/time": "0.3.3-dev-
|
|
54
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
55
|
-
"@agoric/vow": "0.1.1-dev-
|
|
56
|
-
"@agoric/zone": "0.2.3-dev-
|
|
46
|
+
"@agoric/base-zone": "0.1.1-dev-cbcb2b4.0.cbcb2b4",
|
|
47
|
+
"@agoric/ertp": "0.16.3-dev-cbcb2b4.0.cbcb2b4",
|
|
48
|
+
"@agoric/internal": "0.3.3-dev-cbcb2b4.0.cbcb2b4",
|
|
49
|
+
"@agoric/notifier": "0.6.3-dev-cbcb2b4.0.cbcb2b4",
|
|
50
|
+
"@agoric/store": "0.9.3-dev-cbcb2b4.0.cbcb2b4",
|
|
51
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-cbcb2b4.0.cbcb2b4",
|
|
52
|
+
"@agoric/swingset-vat": "0.32.3-dev-cbcb2b4.0.cbcb2b4",
|
|
53
|
+
"@agoric/time": "0.3.3-dev-cbcb2b4.0.cbcb2b4",
|
|
54
|
+
"@agoric/vat-data": "0.5.3-dev-cbcb2b4.0.cbcb2b4",
|
|
55
|
+
"@agoric/vow": "0.1.1-dev-cbcb2b4.0.cbcb2b4",
|
|
56
|
+
"@agoric/zone": "0.2.3-dev-cbcb2b4.0.cbcb2b4",
|
|
57
57
|
"@endo/bundle-source": "^4.1.2",
|
|
58
58
|
"@endo/captp": "^4.4.8",
|
|
59
59
|
"@endo/common": "^1.2.13",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"yargs-parser": "^21.1.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@agoric/kmarshal": "0.1.1-dev-
|
|
73
|
+
"@agoric/kmarshal": "0.1.1-dev-cbcb2b4.0.cbcb2b4",
|
|
74
74
|
"@endo/init": "^1.1.12",
|
|
75
75
|
"ava": "^5.3.0",
|
|
76
76
|
"c8": "^10.1.3",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"access": "public"
|
|
99
99
|
},
|
|
100
100
|
"typeCoverage": {
|
|
101
|
-
"atLeast": 84.
|
|
101
|
+
"atLeast": 84.74
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "cbcb2b45335dbc3e56238b85021ded728d402003"
|
|
104
104
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export function prepareRecorder(baggage: import("@agoric/vat-data").Baggage, marshaller:
|
|
2
|
-
getStorageNode():
|
|
1
|
+
export function prepareRecorder(baggage: import("@agoric/vat-data").Baggage, marshaller: ERemote<Marshaller>): (publisher: globalThis.Publisher<unknown>, storageNode: Remote<globalThis.StorageNode>, valueShape?: TypedPattern<any> | undefined) => import("@endo/exo").Guarded<{
|
|
2
|
+
getStorageNode(): Remote<globalThis.StorageNode>;
|
|
3
3
|
/**
|
|
4
4
|
* Memoizes the remote call to the storage node
|
|
5
5
|
*
|
|
@@ -24,18 +24,18 @@ export function prepareRecorder(baggage: import("@agoric/vat-data").Baggage, mar
|
|
|
24
24
|
export function defineRecorderKit({ makeRecorder, makeDurablePublishKit }: {
|
|
25
25
|
makeRecorder: MakeRecorder;
|
|
26
26
|
makeDurablePublishKit: ReturnType<typeof prepareDurablePublishKit>;
|
|
27
|
-
}): <T>(storageNode:
|
|
27
|
+
}): <T>(storageNode: Remote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
|
|
28
28
|
export function defineERecorderKit({ makeRecorder, makeDurablePublishKit }: {
|
|
29
29
|
makeRecorder: MakeRecorder;
|
|
30
30
|
makeDurablePublishKit: ReturnType<typeof prepareDurablePublishKit>;
|
|
31
|
-
}): <T>(storageNodeP:
|
|
32
|
-
export function prepareRecorderKit(baggage: import("@agoric/vat-data").Baggage, marshaller:
|
|
33
|
-
export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Baggage, marshaller:
|
|
31
|
+
}): <T>(storageNodeP: ERemote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => EventualRecorderKit<T>;
|
|
32
|
+
export function prepareRecorderKit(baggage: import("@agoric/vat-data").Baggage, marshaller: ERemote<Marshaller>): <T>(storageNode: Remote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
|
|
33
|
+
export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Baggage, marshaller: ERemote<Marshaller>): {
|
|
34
34
|
makeDurablePublishKit: <T>(options?: Parameters<(options?: {
|
|
35
35
|
valueDurability?: "mandatory" | undefined;
|
|
36
36
|
}) => import("@agoric/notifier").DurablePublishKitState>[0]) => PublishKit<T>;
|
|
37
|
-
makeRecorder: (publisher: globalThis.Publisher<unknown>, storageNode:
|
|
38
|
-
getStorageNode():
|
|
37
|
+
makeRecorder: (publisher: globalThis.Publisher<unknown>, storageNode: Remote<globalThis.StorageNode>, valueShape?: TypedPattern<any> | undefined) => import("@endo/exo").Guarded<{
|
|
38
|
+
getStorageNode(): Remote<globalThis.StorageNode>;
|
|
39
39
|
/**
|
|
40
40
|
* Memoizes the remote call to the storage node
|
|
41
41
|
*
|
|
@@ -57,8 +57,8 @@ export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Bag
|
|
|
57
57
|
*/
|
|
58
58
|
writeFinal(value: any): Promise<void>;
|
|
59
59
|
}>;
|
|
60
|
-
makeRecorderKit: <T>(storageNode:
|
|
61
|
-
makeERecorderKit: <T>(storageNodeP:
|
|
60
|
+
makeRecorderKit: <T>(storageNode: Remote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
|
|
61
|
+
makeERecorderKit: <T>(storageNodeP: ERemote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => EventualRecorderKit<T>;
|
|
62
62
|
};
|
|
63
63
|
export function prepareMockRecorderKitMakers(): {
|
|
64
64
|
storageNode: globalThis.StorageNode & {
|
|
@@ -67,8 +67,8 @@ export function prepareMockRecorderKitMakers(): {
|
|
|
67
67
|
makeDurablePublishKit: <T>(options?: Parameters<(options?: {
|
|
68
68
|
valueDurability?: "mandatory" | undefined;
|
|
69
69
|
}) => import("@agoric/notifier").DurablePublishKitState>[0]) => PublishKit<T>;
|
|
70
|
-
makeRecorder: (publisher: globalThis.Publisher<unknown>, storageNode:
|
|
71
|
-
getStorageNode():
|
|
70
|
+
makeRecorder: (publisher: globalThis.Publisher<unknown>, storageNode: Remote<globalThis.StorageNode>, valueShape?: TypedPattern<any> | undefined) => import("@endo/exo").Guarded<{
|
|
71
|
+
getStorageNode(): Remote<globalThis.StorageNode>;
|
|
72
72
|
/**
|
|
73
73
|
* Memoizes the remote call to the storage node
|
|
74
74
|
*
|
|
@@ -90,15 +90,15 @@ export function prepareMockRecorderKitMakers(): {
|
|
|
90
90
|
*/
|
|
91
91
|
writeFinal(value: any): Promise<void>;
|
|
92
92
|
}>;
|
|
93
|
-
makeRecorderKit: <T>(storageNode:
|
|
94
|
-
makeERecorderKit: <T>(storageNodeP:
|
|
93
|
+
makeRecorderKit: <T>(storageNode: Remote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
|
|
94
|
+
makeERecorderKit: <T>(storageNodeP: ERemote<StorageNode>, valueShape?: TypedPattern<T> | undefined) => EventualRecorderKit<T>;
|
|
95
95
|
};
|
|
96
96
|
export namespace RecorderKitShape {
|
|
97
97
|
let recorder: import("@endo/patterns").Matcher;
|
|
98
98
|
let subscriber: import("@endo/patterns").Matcher;
|
|
99
99
|
}
|
|
100
100
|
export type Recorder<T> = {
|
|
101
|
-
getStorageNode():
|
|
101
|
+
getStorageNode(): Remote<StorageNode>;
|
|
102
102
|
getStoragePath(): Promise<string>;
|
|
103
103
|
write(value: T): Promise<void>;
|
|
104
104
|
writeFinal(value: T): Promise<void>;
|
|
@@ -112,6 +112,8 @@ export type EventualRecorderKit<T> = Pick<PublishKit<T>, "subscriber"> & {
|
|
|
112
112
|
export type MakeRecorder = ReturnType<typeof prepareRecorder>;
|
|
113
113
|
export type MakeRecorderKit = ReturnType<typeof defineRecorderKit>;
|
|
114
114
|
export type MakeERecorderKit = ReturnType<typeof defineERecorderKit>;
|
|
115
|
+
import type { ERemote } from '@agoric/internal';
|
|
116
|
+
import type { Remote } from '@agoric/internal';
|
|
115
117
|
import type { TypedPattern } from '@agoric/internal';
|
|
116
118
|
import { prepareDurablePublishKit } from '@agoric/notifier';
|
|
117
119
|
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["recorder.js"],"names":[],"mappings":"AAgDO,yCAHI,OAAO,kBAAkB,EAAE,OAAO,cAClC,
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["recorder.js"],"names":[],"mappings":"AAgDO,yCAHI,OAAO,kBAAkB,EAAE,OAAO,cAClC,QAAQ,UAAU,CAAC;;IAmCxB;;;;OAIG;sBADU,OAAO,CAAC,MAAM,CAAC;IAa5B;;;;;OAKG;iBAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;IAa1B;;;;;OAKG;sBAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;GAkB/B;AAWM,2EAFI;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,qBAAqB,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;CAAC,IAI5F,CAAC,eACH,OAAO,WAAW,CAAC,+CAEjB,WAAW,CAAC,CAAC,CAAC,CAQ5B;AAUM,4EAFI;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,qBAAqB,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;CAAC,IAI5F,CAAC,gBACH,QAAQ,WAAW,CAAC,+CAElB,mBAAmB,CAAC,CAAC,CAAC,CAUpC;AAaM,4CAHI,OAAO,kBAAkB,EAAE,OAAO,cAClC,QAAQ,UAAU,CAAC,IA/Cf,CAAC,eACH,OAAO,WAAW,CAAC,+CAEjB,WAAW,CAAC,CAAC,CAAC,CAqD5B;AAaM,kDAHI,OAAO,kBAAkB,EAAE,OAAO,cAClC,QAAQ,UAAU,CAAC;;;;;;QAvIxB;;;;WAIG;0BADU,OAAO,CAAC,MAAM,CAAC;QAa5B;;;;;WAKG;qBAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;QAa1B;;;;;WAKG;0BAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;;sBA+BjB,CAAC,eACH,OAAO,WAAW,CAAC,+CAEjB,WAAW,CAAC,CAAC,CAAC;uBAoBd,CAAC,gBACH,QAAQ,WAAW,CAAC,+CAElB,mBAAmB,CAAC,CAAC,CAAC;EAiEpC;AAKM;;;;;;;;;QApKD;;;;WAIG;0BADU,OAAO,CAAC,MAAM,CAAC;QAa5B;;;;;WAKG;qBAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;QAa1B;;;;;WAKG;0BAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;;sBA+BjB,CAAC,eACH,OAAO,WAAW,CAAC,+CAEjB,WAAW,CAAC,CAAC,CAAC;uBAoBd,CAAC,gBACH,QAAQ,WAAW,CAAC,+CAElB,mBAAmB,CAAC,CAAC,CAAC;EA6EpC;;;;;qBAhOY,CAAC,IACD;IAAE,cAAc,IAAI,OAAO,WAAW,CAAC,CAAC;IAAC,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE;wBAIjJ,CAAC,IACD,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;CAAE;gCAI7D,CAAC,IACD,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;CAAE;2BAmGnE,UAAU,CAAC,OAAO,eAAe,CAAC;8BAuBlC,UAAU,CAAC,OAAO,iBAAiB,CAAC;+BA0BpC,UAAU,CAAC,OAAO,kBAAkB,CAAC;6BA/KH,kBAAkB;4BAAlB,kBAAkB;kCAAlB,kBAAkB;yCAVzB,kBAAkB"}
|
|
@@ -10,7 +10,7 @@ import { M, makeScalarBigMapStore, prepareExoClass } from '@agoric/vat-data';
|
|
|
10
10
|
import { E } from '@endo/eventual-send';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @import {TypedPattern} from '@agoric/internal';
|
|
13
|
+
* @import {TypedPattern, ERemote, Remote} from '@agoric/internal';
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -27,7 +27,7 @@ import { E } from '@endo/eventual-send';
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @template T
|
|
30
|
-
* @typedef {{ getStorageNode():
|
|
30
|
+
* @typedef {{ getStorageNode(): Remote<StorageNode>, getStoragePath(): Promise<string>, write(value: T): Promise<void>, writeFinal(value: T): Promise<void> }} Recorder
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -44,7 +44,7 @@ import { E } from '@endo/eventual-send';
|
|
|
44
44
|
* Wrap a Publisher to record all the values to chain storage.
|
|
45
45
|
*
|
|
46
46
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {ERemote<Marshaller>} marshaller
|
|
48
48
|
*/
|
|
49
49
|
export const prepareRecorder = (baggage, marshaller) => {
|
|
50
50
|
const makeRecorder = prepareExoClass(
|
|
@@ -59,7 +59,7 @@ export const prepareRecorder = (baggage, marshaller) => {
|
|
|
59
59
|
/**
|
|
60
60
|
* @template T
|
|
61
61
|
* @param {PublishKit<T>['publisher']} publisher
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {Remote<StorageNode>} storageNode
|
|
63
63
|
* @param {TypedPattern<any>} [valueShape]
|
|
64
64
|
*/
|
|
65
65
|
(
|
|
@@ -148,19 +148,13 @@ harden(prepareRecorder);
|
|
|
148
148
|
export const defineRecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
|
|
149
149
|
/**
|
|
150
150
|
* @template T
|
|
151
|
-
* @param {
|
|
151
|
+
* @param {Remote<StorageNode>} storageNode
|
|
152
152
|
* @param {TypedPattern<T>} [valueShape]
|
|
153
153
|
* @returns {RecorderKit<T>}
|
|
154
154
|
*/
|
|
155
155
|
const makeRecorderKit = (storageNode, valueShape) => {
|
|
156
156
|
const { subscriber, publisher } = makeDurablePublishKit();
|
|
157
|
-
const recorder = makeRecorder(
|
|
158
|
-
publisher,
|
|
159
|
-
/** @type { Awaited<import('@endo/far').FarRef<StorageNode>> } */ (
|
|
160
|
-
storageNode
|
|
161
|
-
),
|
|
162
|
-
valueShape,
|
|
163
|
-
);
|
|
157
|
+
const recorder = makeRecorder(publisher, storageNode, valueShape);
|
|
164
158
|
return harden({ subscriber, recorder });
|
|
165
159
|
};
|
|
166
160
|
return makeRecorderKit;
|
|
@@ -177,19 +171,14 @@ export const defineRecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
|
|
|
177
171
|
export const defineERecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
|
|
178
172
|
/**
|
|
179
173
|
* @template T
|
|
180
|
-
* @param {
|
|
174
|
+
* @param {ERemote<StorageNode>} storageNodeP
|
|
181
175
|
* @param {TypedPattern<T>} [valueShape]
|
|
182
176
|
* @returns {EventualRecorderKit<T>}
|
|
183
177
|
*/
|
|
184
178
|
const makeERecorderKit = (storageNodeP, valueShape) => {
|
|
185
179
|
const { publisher, subscriber } = makeDurablePublishKit();
|
|
186
180
|
const recorderP = E.when(storageNodeP, storageNode =>
|
|
187
|
-
makeRecorder(
|
|
188
|
-
publisher,
|
|
189
|
-
// @ts-expect-error Casting because it's remote
|
|
190
|
-
/** @type { import('@endo/far').FarRef<StorageNode> } */ (storageNode),
|
|
191
|
-
valueShape,
|
|
192
|
-
),
|
|
181
|
+
makeRecorder(publisher, storageNode, valueShape),
|
|
193
182
|
);
|
|
194
183
|
return { subscriber, recorderP };
|
|
195
184
|
};
|
|
@@ -205,7 +194,7 @@ harden(defineERecorderKit);
|
|
|
205
194
|
* When there is, prepare the kinds separately and pass to the kit definers.
|
|
206
195
|
*
|
|
207
196
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
208
|
-
* @param {
|
|
197
|
+
* @param {ERemote<Marshaller>} marshaller
|
|
209
198
|
*/
|
|
210
199
|
export const prepareRecorderKit = (baggage, marshaller) => {
|
|
211
200
|
const makeDurablePublishKit = prepareDurablePublishKit(
|
|
@@ -225,7 +214,7 @@ export const prepareRecorderKit = (baggage, marshaller) => {
|
|
|
225
214
|
* `makeERecorderKit` is for closures that must return a `subscriber` synchronously but can defer the `recorder`.
|
|
226
215
|
*
|
|
227
216
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
228
|
-
* @param {
|
|
217
|
+
* @param {ERemote<Marshaller>} marshaller
|
|
229
218
|
*/
|
|
230
219
|
export const prepareRecorderKitMakers = (baggage, marshaller) => {
|
|
231
220
|
const makeDurablePublishKit = prepareDurablePublishKit(
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import {
|
|
2
|
+
* @import {Brand} from '@agoric/ertp';
|
|
3
|
+
* @import {TimerService, RelativeTime} from '@agoric/time';
|
|
4
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery} from '@agoric/zoe/tools/types.js';
|
|
3
5
|
*/
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {object} options
|
|
9
|
+
* @param {Brand<'nat'>} options.actualBrandIn
|
|
10
|
+
* @param {Brand<'nat'>} options.actualBrandOut
|
|
11
|
+
* @param {bigint[]} options.priceList
|
|
12
|
+
* @param {TimerService} options.timer
|
|
13
|
+
* @param {Amount<'nat'>} [options.unitAmountIn]
|
|
14
|
+
* @param {RelativeTime} options.quoteInterval
|
|
15
|
+
* @param {IssuerKit<'set', PriceDescription>} [options.quoteIssuerKit]
|
|
16
|
+
*/
|
|
17
|
+
export function makeScriptedPriceAuthority(options: {
|
|
18
|
+
actualBrandIn: Brand<"nat">;
|
|
19
|
+
actualBrandOut: Brand<"nat">;
|
|
20
|
+
priceList: bigint[];
|
|
21
|
+
timer: TimerService;
|
|
22
|
+
unitAmountIn?: import("@agoric/ertp").NatAmount | undefined;
|
|
23
|
+
quoteInterval: RelativeTime;
|
|
24
|
+
quoteIssuerKit?: globalThis.IssuerKit<"set", PriceDescription> | undefined;
|
|
25
|
+
}): PriceAuthority;
|
|
26
|
+
import type { Brand } from '@agoric/ertp';
|
|
27
|
+
import type { TimerService } from '@agoric/time';
|
|
28
|
+
import type { RelativeTime } from '@agoric/time';
|
|
29
|
+
import type { PriceDescription } from '@agoric/zoe/tools/types.js';
|
|
5
30
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
6
31
|
//# sourceMappingURL=scriptedPriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAWA
|
|
1
|
+
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAWA;;;;GAIG;AAEH;;;;;;;;;;GAUG;AACH,oDARG;IAA+B,aAAa,EAApC,MAAM,KAAK,CAAC;IACW,cAAc,EAArC,MAAM,KAAK,CAAC;IACO,SAAS,EAA5B,MAAM,EAAE;IACe,KAAK,EAA5B,YAAY;IACa,YAAY;IACd,aAAa,EAApC,YAAY;IACkC,cAAc;CAAC,kBAuFvE;2BArGuB,cAAc;kCACO,cAAc;kCAAd,cAAc;sCACiC,4BAA4B;oCAA5B,4BAA4B"}
|
|
@@ -10,9 +10,22 @@ import {
|
|
|
10
10
|
} from '../src/contractSupport/index.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @import {
|
|
13
|
+
* @import {Brand} from '@agoric/ertp';
|
|
14
|
+
* @import {TimerService, RelativeTime} from '@agoric/time';
|
|
15
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery} from '@agoric/zoe/tools/types.js';
|
|
14
16
|
*/
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {object} options
|
|
21
|
+
* @param {Brand<'nat'>} options.actualBrandIn
|
|
22
|
+
* @param {Brand<'nat'>} options.actualBrandOut
|
|
23
|
+
* @param {bigint[]} options.priceList
|
|
24
|
+
* @param {TimerService} options.timer
|
|
25
|
+
* @param {Amount<'nat'>} [options.unitAmountIn]
|
|
26
|
+
* @param {RelativeTime} options.quoteInterval
|
|
27
|
+
* @param {IssuerKit<'set', PriceDescription>} [options.quoteIssuerKit]
|
|
28
|
+
*/
|
|
16
29
|
export function makeScriptedPriceAuthority(options) {
|
|
17
30
|
const {
|
|
18
31
|
actualBrandIn,
|
|
@@ -89,6 +102,7 @@ export function makeScriptedPriceAuthority(options) {
|
|
|
89
102
|
updateState: t => {
|
|
90
103
|
t = TimeMath.absValue(t);
|
|
91
104
|
currentPrice =
|
|
105
|
+
// @ts-expect-error XXX: this does not support quoteInterval being a RelativeTimeRecord
|
|
92
106
|
priceList[Number(Number(t / quoteInterval) % priceList.length)];
|
|
93
107
|
|
|
94
108
|
void fireTriggers(createQuote);
|