@agoric/zoe 0.26.3-upgrade-18a-dev-4ee0508.0 → 0.27.0-u19.1

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 (85) hide show
  1. package/bundles/bundle-contractFacet-js-meta.json +243 -238
  2. package/bundles/bundle-contractFacet.js +1 -1
  3. package/package.json +30 -30
  4. package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
  5. package/src/contractFacet/offerHandlerStorage.js +5 -0
  6. package/src/contractFacet/reallocate.d.ts.map +1 -1
  7. package/src/contractFacet/reallocate.js +4 -0
  8. package/src/contractFacet/types-ambient.d.ts +4 -66
  9. package/src/contractFacet/zcfMint.d.ts +1 -1
  10. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  11. package/src/contractFacet/zcfMint.js +2 -14
  12. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  13. package/src/contractFacet/zcfSeat.js +12 -188
  14. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  15. package/src/contractFacet/zcfZygote.js +10 -4
  16. package/src/contractSupport/durability.d.ts +1 -0
  17. package/src/contractSupport/durability.d.ts.map +1 -1
  18. package/src/contractSupport/durability.js +4 -0
  19. package/src/contractSupport/priceQuote.d.ts +1 -0
  20. package/src/contractSupport/priceQuote.d.ts.map +1 -1
  21. package/src/contractSupport/priceQuote.js +6 -1
  22. package/src/contractSupport/recorder.d.ts +8 -24
  23. package/src/contractSupport/recorder.d.ts.map +1 -1
  24. package/src/contractSupport/recorder.js +6 -0
  25. package/src/contractSupport/zoeHelpers.d.ts +5 -1
  26. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  27. package/src/contractSupport/zoeHelpers.js +6 -2
  28. package/src/contracts/coveredCall.d.ts.map +1 -1
  29. package/src/contracts/coveredCall.js +1 -6
  30. package/src/contracts/priceAggregator.d.ts.map +1 -1
  31. package/src/contracts/priceAggregator.js +5 -4
  32. package/src/internal-types.d.ts +0 -1
  33. package/src/internal-types.d.ts.map +1 -1
  34. package/src/internal-types.js +0 -1
  35. package/src/issuerStorage.d.ts.map +1 -1
  36. package/src/issuerStorage.js +4 -0
  37. package/src/typeGuards.d.ts +2 -1
  38. package/src/typeGuards.d.ts.map +1 -1
  39. package/src/typeGuards.js +3 -2
  40. package/src/zoeService/escrowStorage.d.ts.map +1 -1
  41. package/src/zoeService/escrowStorage.js +4 -0
  42. package/src/zoeService/installationStorage.d.ts +1 -3
  43. package/src/zoeService/installationStorage.d.ts.map +1 -1
  44. package/src/zoeService/installationStorage.js +6 -3
  45. package/src/zoeService/instanceAdminStorage.d.ts +1 -0
  46. package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
  47. package/src/zoeService/instanceAdminStorage.js +4 -0
  48. package/src/zoeService/internal-types.d.ts +1 -2
  49. package/src/zoeService/internal-types.d.ts.map +1 -1
  50. package/src/zoeService/internal-types.js +1 -7
  51. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  52. package/src/zoeService/makeInvitation.js +0 -1
  53. package/src/zoeService/offer/burnInvitation.d.ts +1 -1
  54. package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
  55. package/src/zoeService/offer/burnInvitation.js +3 -2
  56. package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
  57. package/src/zoeService/originalZoeSeat.js +6 -3
  58. package/src/zoeService/startInstance.d.ts +1 -1
  59. package/src/zoeService/startInstance.d.ts.map +1 -1
  60. package/src/zoeService/startInstance.js +5 -2
  61. package/src/zoeService/types-ambient.d.ts +11 -5
  62. package/src/zoeService/types-ambient.d.ts.map +1 -1
  63. package/src/zoeService/types-ambient.js +9 -5
  64. package/src/zoeService/utils.d.ts +5 -5
  65. package/src/zoeService/zoeSeat.d.ts +1 -4
  66. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  67. package/src/zoeService/zoeSeat.js +5 -2
  68. package/tools/fakePriceAuthority.d.ts +3 -2
  69. package/tools/fakePriceAuthority.d.ts.map +1 -1
  70. package/tools/fakePriceAuthority.js +9 -6
  71. package/tools/fakeVatAdmin.d.ts +2 -3
  72. package/tools/fakeVatAdmin.d.ts.map +1 -1
  73. package/tools/fakeVatAdmin.js +5 -2
  74. package/tools/manualPriceAuthority.d.ts +3 -2
  75. package/tools/manualPriceAuthority.d.ts.map +1 -1
  76. package/tools/manualPriceAuthority.js +7 -6
  77. package/tools/scriptedOracle.d.ts +1 -1
  78. package/tools/scriptedPriceAuthority.d.ts.map +1 -1
  79. package/tools/scriptedPriceAuthority.js +6 -5
  80. package/tools/test-utils.d.ts +9 -5
  81. package/tools/test-utils.d.ts.map +1 -1
  82. package/tools/test-utils.js +5 -1
  83. package/tools/types.d.ts +4 -0
  84. package/tools/types.d.ts.map +1 -1
  85. package/tools/types.js +4 -0
@@ -30,9 +30,9 @@ export type InstallationStart<I> =
30
30
 
31
31
  export type ContractStartFunction = (
32
32
  zcf?: ZCF,
33
- privateArgs?: {},
33
+ privateArgs?: object,
34
34
  baggage?: Baggage,
35
- ) => ERef<{ creatorFacet?: {}; publicFacet?: {} }>;
35
+ ) => ERef<{ creatorFacet?: object; publicFacet?: object }>;
36
36
 
37
37
  export type AdminFacet<SF extends ContractStartFunction> = FarRef<{
38
38
  // Completion, which is currently any
@@ -76,8 +76,8 @@ export type StartedInstanceKit<SF extends ContractStartFunction> = {
76
76
  instance: Instance<SF>;
77
77
  adminFacet: AdminFacet<SF>;
78
78
  // theses are empty by default. the return type will override
79
- creatorFacet: {};
80
- publicFacet: {};
79
+ creatorFacet: object;
80
+ publicFacet: object;
81
81
  } & (SF extends ContractStartFunction
82
82
  ? // override if the start function specfies the types
83
83
  Awaited<ReturnType<SF>>
@@ -120,7 +120,7 @@ export type GetPublicFacet = <SF>(
120
120
 
121
121
  export type GetTerms = <SF>(instance: Instance<SF>) => Promise<
122
122
  // only type if 'terms' info is available
123
- StartParams<SF>['terms'] extends {}
123
+ StartParams<SF>['terms'] extends object
124
124
  ? StartParams<SF>['terms']
125
125
  : // XXX returning `any` in this case
126
126
  any
@@ -16,10 +16,7 @@ export function makeZoeSeatAdminFactory(baggage: import("@agoric/vat-data").Bagg
16
16
  fail(reason: any): void;
17
17
  /** @param {HandleOfferResult} result */
18
18
  resolveExitAndResult({ offerResultPromise, exitObj }: HandleOfferResult): void;
19
- getExitSubscriber(): import("@endo/exo").Guarded<{
20
- subscribeAfter(publishCount?: bigint): Promise<any>;
21
- getUpdateSince(updateCount: any): any;
22
- }>;
19
+ getExitSubscriber(): globalThis.Subscriber<any>;
23
20
  finalPayouts(payments: any): Promise<void>;
24
21
  }>;
25
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"zoeSeat.d.ts","sourceRoot":"","sources":["zoeSeat.js"],"names":[],"mappings":"AAkDO,iDAFI,OAAO,kBAAkB,EAAE,OAAO,uBAwWhC,UAAU,YACV,cAAc,uBACd,mBAAmB,iBACnB,aAAa,YACb,IAAI,CAAC,OAAO,CAAC,2BACb,OAAO;;;;;;;;;;;;;;;;QA3IZ,wCAAwC;8DAA5B,iBAAiB;;;;;;;EAoKpC"}
1
+ {"version":3,"file":"zoeSeat.d.ts","sourceRoot":"","sources":["zoeSeat.js"],"names":[],"mappings":"AAmDO,iDAFI,OAAO,kBAAkB,EAAE,OAAO,uBA0WhC,UAAU,YACV,cAAc,uBACd,mBAAmB,iBACnB,aAAa,YACb,IAAI,CAAC,OAAO,CAAC,2BACb,OAAO;;;;;;;;;;;;;;;;QA3IZ,wCAAwC;8DAA5B,iBAAiB;;;;EAoKpC"}
@@ -4,6 +4,7 @@ import { E } from '@endo/eventual-send';
4
4
  import { M, prepareExoClassKit } from '@agoric/vat-data';
5
5
  import { deeplyFulfilled } from '@endo/marshal';
6
6
  import { makePromiseKit } from '@endo/promise-kit';
7
+ import { NonNullish } from '@agoric/internal';
7
8
 
8
9
  import { satisfiesWant } from '../contractFacet/offerSafety.js';
9
10
  import '../types-ambient.js';
@@ -143,8 +144,10 @@ export const makeZoeSeatAdminFactory = baggage => {
143
144
  // doExit(), which ensures that finalPayouts() has set state.payouts.
144
145
  return E.when(
145
146
  state.subscriber.subscribeAfter(),
146
- () => state.payouts[keyword],
147
- () => state.payouts[keyword],
147
+ () =>
148
+ NonNullish(state.payouts[keyword], `No payout for "${keyword}"`),
149
+ () =>
150
+ NonNullish(state.payouts[keyword], `No payout for "${keyword}"`),
148
151
  );
149
152
  },
150
153
 
@@ -6,7 +6,7 @@
6
6
  * @property {Array<[number, number]>} [tradeList]
7
7
  * @property {import('@agoric/time').TimerService} timer
8
8
  * @property {import('@agoric/time').RelativeTime} [quoteInterval]
9
- * @property {ERef<Mint<'set'>>} [quoteMint]
9
+ * @property {ERef<Mint<'set', PriceDescription>>} [quoteMint]
10
10
  * @property {Amount<'nat'>} [unitAmountIn]
11
11
  */
12
12
  /**
@@ -24,8 +24,9 @@ export type FakePriceAuthorityOptions = {
24
24
  tradeList?: [number, number][] | undefined;
25
25
  timer: import("@agoric/time").TimerService;
26
26
  quoteInterval?: import("@agoric/time").RelativeTime | undefined;
27
- quoteMint?: globalThis.ERef<globalThis.Mint<"set">> | undefined;
27
+ quoteMint?: globalThis.ERef<globalThis.Mint<"set", PriceDescription>> | undefined;
28
28
  unitAmountIn?: import("@agoric/ertp").NatAmount | undefined;
29
29
  };
30
30
  import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
31
+ import type { PriceDescription } from '@agoric/zoe/tools/types.js';
31
32
  //# sourceMappingURL=fakePriceAuthority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,gDAHW,yBAAyB,GACvB,OAAO,CAAC,cAAc,CAAC,CAwSnC;;mBAvTa,KAAK,CAAC,KAAK,CAAC;oBACZ,KAAK,CAAC,KAAK,CAAC;;;WAGZ,OAAO,cAAc,EAAE,YAAY;;;;;oCAhB4C,4BAA4B"}
1
+ {"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,gDAHW,yBAAyB,GACvB,OAAO,CAAC,cAAc,CAAC,CAwSnC;;mBAvTa,KAAK,CAAC,KAAK,CAAC;oBACZ,KAAK,CAAC,KAAK,CAAC;;;WAGZ,OAAO,cAAc,EAAE,YAAY;;;;;oCAhB4C,4BAA4B;sCAA5B,4BAA4B"}
@@ -1,16 +1,19 @@
1
1
  import { Fail } from '@endo/errors';
2
- import { makePromiseKit } from '@endo/promise-kit';
3
2
  import { E } from '@endo/eventual-send';
4
3
  import { Far } from '@endo/marshal';
4
+ import { makePromiseKit } from '@endo/promise-kit';
5
5
 
6
- import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
6
+ import { AmountMath } from '@agoric/ertp';
7
7
  import {
8
- makeNotifierKit,
9
8
  makeNotifierFromAsyncIterable,
9
+ makeNotifierKit,
10
10
  } from '@agoric/notifier';
11
11
  import { TimeMath } from '@agoric/time';
12
12
 
13
- import { natSafeMath } from '../src/contractSupport/index.js';
13
+ import {
14
+ makePriceQuoteIssuer,
15
+ natSafeMath,
16
+ } from '../src/contractSupport/index.js';
14
17
 
15
18
  /**
16
19
  * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
@@ -31,7 +34,7 @@ const timestampLTE = (a, b) => TimeMath.compareAbs(a, b) <= 0;
31
34
  * @property {Array<[number, number]>} [tradeList]
32
35
  * @property {import('@agoric/time').TimerService} timer
33
36
  * @property {import('@agoric/time').RelativeTime} [quoteInterval]
34
- * @property {ERef<Mint<'set'>>} [quoteMint]
37
+ * @property {ERef<Mint<'set', PriceDescription>>} [quoteMint]
35
38
  * @property {Amount<'nat'>} [unitAmountIn]
36
39
  */
37
40
 
@@ -51,7 +54,7 @@ export async function makeFakePriceAuthority(options) {
51
54
  timer,
52
55
  unitAmountIn = AmountMath.make(actualBrandIn, 1n),
53
56
  quoteInterval = 1n,
54
- quoteMint = makeIssuerKit('quote', AssetKind.SET).mint,
57
+ quoteMint = makePriceQuoteIssuer().mint,
55
58
  } = options;
56
59
 
57
60
  tradeList ||
@@ -1,7 +1,5 @@
1
1
  export const zcfBundleCap: any;
2
2
  export default fakeVatAdmin;
3
- export type BundleID = import("@agoric/swingset-vat").BundleID;
4
- export type EndoZipBase64Bundle = import("@agoric/swingset-vat").EndoZipBase64Bundle;
5
3
  export type BundleCap = import("@agoric/swingset-vat").BundleCap;
6
4
  declare const fakeVatAdmin: {
7
5
  getBundleCap: (bundleID: any) => Promise<any>;
@@ -95,9 +93,10 @@ export function makeFakeVatAdmin(testContextSetter?: (...args: any) => unknown,
95
93
  getCriticalVatKey: () => {};
96
94
  getVatPowers: () => {
97
95
  D: (bcap: any) => {
98
- getBundle: () => globalThis.EndoZipBase64Bundle;
96
+ getBundle: () => EndoZipBase64Bundle;
99
97
  };
100
98
  };
101
99
  };
102
100
  };
101
+ import type { EndoZipBase64Bundle } from '@agoric/swingset-vat';
103
102
  //# sourceMappingURL=fakeVatAdmin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fakeVatAdmin.d.ts","sourceRoot":"","sources":["fakeVatAdmin.js"],"names":[],"mappings":"AAsBA,+BAA4C;;uBAR7B,OAAO,sBAAsB,EAAE,QAAQ;kCACvC,OAAO,sBAAsB,EAAE,mBAAmB;wBAGlD,OAAO,sBAAsB,EAAE,SAAS;AAoJvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA8C;AA9I9C;;;GAGG;AACH,qDAHW,CAAC,GAAG,IAAI,KAAA,KAAK,OAAO,eACpB,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqIjC"}
1
+ {"version":3,"file":"fakeVatAdmin.d.ts","sourceRoot":"","sources":["fakeVatAdmin.js"],"names":[],"mappings":"AAyBA,+BAA4C;;wBAJ7B,OAAO,sBAAsB,EAAE,SAAS;AAoJvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA8C;AA9I9C;;;GAGG;AACH,qDAHW,CAAC,GAAG,IAAI,KAAA,KAAK,OAAO,eACpB,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqIjC;yCAjJ+C,sBAAsB"}
@@ -12,8 +12,11 @@ import { handlePKitWarning } from '../src/handleWarning.js';
12
12
  import { makeHandle } from '../src/makeHandle.js';
13
13
  import zcfBundle from '../bundles/bundle-contractFacet.js';
14
14
 
15
- /** @typedef { import('@agoric/swingset-vat').BundleID} BundleID */
16
- /** @typedef { import('@agoric/swingset-vat').EndoZipBase64Bundle} EndoZipBase64Bundle */
15
+ /**
16
+ * @import {LegacyWeakMap, WeakMapStore} from '@agoric/store';
17
+ * @import {MapStore} from '@agoric/swingset-liveslots';
18
+ * @import {BundleID, EndoZipBase64Bundle} from '@agoric/swingset-vat';
19
+ */
17
20
 
18
21
  // this simulates a bundlecap, which is normally a swingset "device node"
19
22
  /** @typedef { import('@agoric/swingset-vat').BundleCap } BundleCap */
@@ -7,7 +7,7 @@
7
7
  * @param {Brand<'nat'>} options.actualBrandOut
8
8
  * @param {Ratio} options.initialPrice
9
9
  * @param {import('@agoric/time').TimerService} options.timer
10
- * @param {IssuerKit<'set'>} [options.quoteIssuerKit]
10
+ * @param {IssuerKit<'set', PriceDescription>} [options.quoteIssuerKit]
11
11
  * @returns {PriceAuthority & { setPrice: (Ratio) => void; disable: () => void }}
12
12
  */
13
13
  export function makeManualPriceAuthority(options: {
@@ -15,11 +15,12 @@ export function makeManualPriceAuthority(options: {
15
15
  actualBrandOut: Brand<"nat">;
16
16
  initialPrice: Ratio;
17
17
  timer: import("@agoric/time").TimerService;
18
- quoteIssuerKit?: globalThis.IssuerKit<"set"> | undefined;
18
+ quoteIssuerKit?: globalThis.IssuerKit<"set", PriceDescription> | undefined;
19
19
  }): PriceAuthority & {
20
20
  setPrice: (Ratio: any) => void;
21
21
  disable: () => void;
22
22
  };
23
23
  export type ManualPriceAuthority = ReturnType<typeof makeManualPriceAuthority>;
24
+ import type { PriceDescription } from '@agoric/zoe/tools/types.js';
24
25
  import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
25
26
  //# sourceMappingURL=manualPriceAuthority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"AAYA;;GAEG;AAEH;;;;;;;;GAQG;AACH,kDAPG;IAA8B,aAAa,EAAnC,KAAK,CAAC,KAAK,CAAC;IACU,cAAc,EAApC,KAAK,CAAC,KAAK,CAAC;IACG,YAAY,EAA3B,KAAK;IACwC,KAAK,EAAlD,OAAO,cAAc,EAAE,YAAY;IACR,cAAc;CACjD,GAAU,cAAc,GAAG;IAAE,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA8E/E;mCACa,UAAU,CAAC,OAAO,wBAAwB,CAAC;oCAzFoC,4BAA4B"}
1
+ {"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"AAaA;;GAEG;AAEH;;;;;;;;GAQG;AACH,kDAPG;IAA8B,aAAa,EAAnC,KAAK,CAAC,KAAK,CAAC;IACU,cAAc,EAApC,KAAK,CAAC,KAAK,CAAC;IACG,YAAY,EAA3B,KAAK;IACwC,KAAK,EAAlD,OAAO,cAAc,EAAE,YAAY;IACU,cAAc;CACnE,GAAU,cAAc,GAAG;IAAE,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA8E/E;mCACa,UAAU,CAAC,OAAO,wBAAwB,CAAC;sCAzFoC,4BAA4B;oCAA5B,4BAA4B"}
@@ -1,13 +1,14 @@
1
1
  // @jessie-check
2
2
 
3
- import { AmountMath, makeIssuerKit, AssetKind } from '@agoric/ertp';
3
+ import { AmountMath } from '@agoric/ertp';
4
+ import { makeNotifierKit } from '@agoric/notifier';
4
5
  import { E } from '@endo/eventual-send';
5
6
  import { Far } from '@endo/marshal';
6
- import { makeNotifierKit } from '@agoric/notifier';
7
7
  import {
8
- makeOnewayPriceAuthorityKit,
9
- floorMultiplyBy,
10
8
  floorDivideBy,
9
+ floorMultiplyBy,
10
+ makeOnewayPriceAuthorityKit,
11
+ makePriceQuoteIssuer,
11
12
  } from '../src/contractSupport/index.js';
12
13
 
13
14
  /**
@@ -20,7 +21,7 @@ import {
20
21
  * @param {Brand<'nat'>} options.actualBrandOut
21
22
  * @param {Ratio} options.initialPrice
22
23
  * @param {import('@agoric/time').TimerService} options.timer
23
- * @param {IssuerKit<'set'>} [options.quoteIssuerKit]
24
+ * @param {IssuerKit<'set', PriceDescription>} [options.quoteIssuerKit]
24
25
  * @returns {PriceAuthority & { setPrice: (Ratio) => void; disable: () => void }}
25
26
  */
26
27
  export function makeManualPriceAuthority(options) {
@@ -29,7 +30,7 @@ export function makeManualPriceAuthority(options) {
29
30
  actualBrandOut,
30
31
  initialPrice, // brandOut / brandIn
31
32
  timer,
32
- quoteIssuerKit = makeIssuerKit('quote', AssetKind.SET),
33
+ quoteIssuerKit = makePriceQuoteIssuer(),
33
34
  } = options;
34
35
  const { brand, issuer: quoteIssuer, mint: quoteMint } = quoteIssuerKit;
35
36
 
@@ -15,7 +15,7 @@
15
15
  * @param {Issuer} feeIssuer
16
16
  */
17
17
  export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import("../src/contracts/oracle.js").OracleStart>, timer: import("@agoric/time").TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
18
- publicFacet: {
18
+ publicFacet: object & {
19
19
  query(query: OracleQuery): Promise<unknown>;
20
20
  makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
21
21
  } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
@@ -1 +1 @@
1
- {"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAUA;;GAEG;AAEH,yEAoFC;oCAvF4F,4BAA4B"}
1
+ {"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH,yEAoFC;oCAvF4F,4BAA4B"}
@@ -1,11 +1,12 @@
1
- import { AmountMath, makeIssuerKit, AssetKind } from '@agoric/ertp';
2
- import { E } from '@endo/eventual-send';
3
- import { Far } from '@endo/marshal';
1
+ import { AmountMath } from '@agoric/ertp';
4
2
  import { observeNotifier } from '@agoric/notifier';
5
3
  import { TimeMath } from '@agoric/time';
4
+ import { E } from '@endo/eventual-send';
5
+ import { Far } from '@endo/marshal';
6
6
  import {
7
- natSafeMath,
8
7
  makeOnewayPriceAuthorityKit,
8
+ makePriceQuoteIssuer,
9
+ natSafeMath,
9
10
  } from '../src/contractSupport/index.js';
10
11
 
11
12
  /**
@@ -20,7 +21,7 @@ export function makeScriptedPriceAuthority(options) {
20
21
  timer,
21
22
  unitAmountIn = AmountMath.make(actualBrandIn, 1n),
22
23
  quoteInterval = 1n,
23
- quoteIssuerKit = makeIssuerKit('quote', AssetKind.SET),
24
+ quoteIssuerKit = makePriceQuoteIssuer(),
24
25
  } = options;
25
26
  const { brand, issuer: quoteIssuer, mint: quoteMint } = quoteIssuerKit;
26
27
  let currentPrice = priceList[0];
@@ -1,4 +1,4 @@
1
- export function withAmountUtils(kit: Pick<IssuerKit<"nat">, "brand" | "issuer" | "mint">): {
1
+ export function withAmountUtils(kit: Pick<IssuerKit<"nat", any>, "brand" | "issuer" | "mint">): {
2
2
  /** @param {NatValue} v */
3
3
  make: (v: NatValue) => import("@agoric/ertp").NatAmount;
4
4
  makeEmpty: () => import("@agoric/ertp").NatAmount;
@@ -10,11 +10,15 @@ export function withAmountUtils(kit: Pick<IssuerKit<"nat">, "brand" | "issuer" |
10
10
  /** @param {number} n */
11
11
  units: (n: number) => import("@agoric/ertp").NatAmount;
12
12
  /** The intact Exo remotable */
13
- issuerKit: Pick<globalThis.IssuerKit<"nat">, "brand" | "issuer" | "mint">;
14
- brand: globalThis.Brand<"nat">;
15
- issuer: globalThis.Issuer<"nat", import("@endo/patterns").Key>;
16
- mint: globalThis.Mint<"nat", import("@endo/patterns").Key>;
13
+ issuerKit: Pick<IssuerKit<"nat", any>, "brand" | "issuer" | "mint">;
14
+ brand: Brand<"nat">;
15
+ issuer: Issuer<"nat", any>;
16
+ mint: globalThis.Mint<"nat", any>;
17
17
  };
18
18
  export { makeFakeStorageKit } from "@agoric/internal/src/storage-test-utils.js";
19
19
  export type AmountUtils = ReturnType<typeof withAmountUtils>;
20
+ import type { IssuerKit } from '@agoric/ertp';
21
+ import type { NatValue } from '@agoric/ertp';
22
+ import type { Brand } from '@agoric/ertp';
23
+ import type { Issuer } from '@agoric/ertp';
20
24
  //# sourceMappingURL=test-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["test-utils.js"],"names":[],"mappings":"AAIO,qCADK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3D,0BAA0B;cAAd,QAAQ;;IAGpB;;;OAGG;mBAFQ,QAAQ,MACR,QAAQ;IAGnB,wBAAwB;eAAZ,MAAM;IAGlB,+BAA+B;;;;;EAGlC;;0BACa,UAAU,CAAC,OAAO,eAAe,CAAC"}
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["test-utils.js"],"names":[],"mappings":"AAQO,qCADK,IAAI,CAAC,UAAU,KAAK,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAKhE,0BAA0B;cAAd,QAAQ;;IAGpB;;;OAGG;mBAFQ,QAAQ,MACR,QAAQ;IAGnB,wBAAwB;eAAZ,MAAM;IAGlB,+BAA+B;;;;;EAGlC;;0BACa,UAAU,CAAC,OAAO,eAAe,CAAC;+BAvB2B,cAAc;8BAAd,cAAc;2BAAd,cAAc;4BAAd,cAAc"}
@@ -1,7 +1,11 @@
1
1
  import { AmountMath } from '@agoric/ertp';
2
2
  import { makeRatio } from '../src/contractSupport/ratio.js';
3
3
 
4
- /** @param {Pick<IssuerKit<'nat'>, 'brand' | 'issuer' | 'mint'>} kit */
4
+ /**
5
+ * @import {Amount, Brand, DepositFacet, Issuer, IssuerKit, NatValue} from '@agoric/ertp';
6
+ */
7
+
8
+ /** @param {Pick<IssuerKit<'nat', any>, 'brand' | 'issuer' | 'mint'>} kit */
5
9
  export const withAmountUtils = kit => {
6
10
  const decimalPlaces = kit.issuer.getDisplayInfo?.()?.decimalPlaces ?? 6;
7
11
  return {
package/tools/types.d.ts CHANGED
@@ -139,4 +139,8 @@ export type PriceLevel = {
139
139
  */
140
140
  amountOut: Amount<"nat">;
141
141
  };
142
+ import type { Amount } from '@agoric/ertp';
143
+ import type { Payment } from '@agoric/ertp';
144
+ import type { Brand } from '@agoric/ertp';
145
+ import type { Issuer } from '@agoric/ertp';
142
146
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;iBAKc,MAAM,CAAC,KAAK,EAAE,gBAAgB,CAAC;;;;kBAE/B,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;;;;;;8BAKvC,CAAC,gBAAgB,CAAC;;;;;;;;cAQjB,MAAM,CAAC,KAAK,CAAC;;;;eAEb,MAAM,CAAC,KAAK,CAAC;;;;WAEb,OAAO,kBAAkB,EAAE,eAAe,GAAG,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Ac,EAAE,eAAe,CAAA;CAAE,GAAG,SAAS;;;;;;;;cAOpH,OAAO,KAAK,CAAC;;;;eAEb,OAAO,KAAK,CAAC;;4BA9J+C,cAAc;6BAAd,cAAc;2BAAd,cAAc;4BAAd,cAAc"}
package/tools/types.js CHANGED
@@ -1,6 +1,10 @@
1
1
  // Ensure this is a module.
2
2
  export {};
3
3
 
4
+ /**
5
+ * @import {Amount, Brand, DepositFacet, Issuer, IssuerKit, Payment} from '@agoric/ertp';
6
+ */
7
+
4
8
  /**
5
9
  * @typedef {object} PriceQuote
6
10
  * @property {Amount<'set', PriceDescription>} quoteAmount