@agoric/zoe 0.27.0-upgrade-19-dev-5428c4d.0 → 0.27.0-upgrade-20-dev-ef71cfd.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 (159) hide show
  1. package/bundles/bundle-contractFacet-js-meta.json +270 -275
  2. package/bundles/bundle-contractFacet.js +1 -1
  3. package/package.json +29 -29
  4. package/src/cleanProposal.d.ts +2 -0
  5. package/src/cleanProposal.d.ts.map +1 -1
  6. package/src/cleanProposal.js +4 -2
  7. package/src/contractFacet/exit.d.ts +1 -1
  8. package/src/contractFacet/exit.d.ts.map +1 -1
  9. package/src/contractFacet/offerHandlerStorage.d.ts +1 -1
  10. package/src/contractFacet/rightsConservation.d.ts.map +1 -1
  11. package/src/contractFacet/rightsConservation.js +0 -1
  12. package/src/contractFacet/types.d.ts +184 -0
  13. package/src/contractFacet/types.d.ts.map +1 -0
  14. package/src/contractFacet/{types-ambient.d.ts → types.ts} +66 -29
  15. package/src/contractFacet/vatRoot.d.ts +8 -2
  16. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  17. package/src/contractFacet/vatRoot.js +5 -4
  18. package/src/contractFacet/zcfMint.d.ts +3 -2
  19. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  20. package/src/contractFacet/zcfMint.js +7 -7
  21. package/src/contractFacet/zcfSeat.js +2 -2
  22. package/src/contractFacet/zcfZygote.d.ts +9 -1
  23. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  24. package/src/contractFacet/zcfZygote.js +17 -5
  25. package/src/contractSupport/atomicTransfer.d.ts +6 -0
  26. package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
  27. package/src/contractSupport/atomicTransfer.js +4 -0
  28. package/src/contractSupport/bondingCurves.js +1 -1
  29. package/src/contractSupport/index.d.ts +2 -2
  30. package/src/contractSupport/index.js +2 -19
  31. package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
  32. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  33. package/src/contractSupport/priceAuthorityInitial.js +3 -1
  34. package/src/contractSupport/types-ambient.d.ts.map +1 -1
  35. package/src/contractSupport/types-ambient.js +1 -0
  36. package/src/contractSupport/zoeHelpers.d.ts +6 -1
  37. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  38. package/src/contractSupport/zoeHelpers.js +1 -0
  39. package/src/contracts/atomicSwap.d.ts +1 -1
  40. package/src/contracts/auction/index.d.ts +3 -3
  41. package/src/contracts/automaticRefund.d.ts +3 -3
  42. package/src/contracts/autoswap.d.ts +4 -0
  43. package/src/contracts/autoswap.d.ts.map +1 -1
  44. package/src/contracts/autoswap.js +4 -0
  45. package/src/contracts/barterExchange.d.ts +2 -2
  46. package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
  47. package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
  48. package/src/contracts/coveredCall-durable.d.ts +1 -1
  49. package/src/contracts/coveredCall.d.ts +1 -1
  50. package/src/contracts/loan/index.d.ts +1 -1
  51. package/src/contracts/loan/types-ambient.d.ts +13 -13
  52. package/src/contracts/loan/types-ambient.d.ts.map +1 -1
  53. package/src/contracts/loan/types-ambient.js +17 -17
  54. package/src/contracts/mintPayments.d.ts +2 -2
  55. package/src/contracts/oracle.d.ts +3 -0
  56. package/src/contracts/oracle.d.ts.map +1 -1
  57. package/src/contracts/oracle.js +1 -0
  58. package/src/contracts/priceAggregator.d.ts +2 -0
  59. package/src/contracts/priceAggregator.d.ts.map +1 -1
  60. package/src/contracts/priceAggregator.js +10 -8
  61. package/src/contracts/scaledPriceAuthority.d.ts +1 -0
  62. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
  63. package/src/contracts/scaledPriceAuthority.js +1 -0
  64. package/src/contracts/sellItems.d.ts +1 -1
  65. package/src/contracts/simpleExchange.d.ts +5 -0
  66. package/src/contracts/simpleExchange.d.ts.map +1 -1
  67. package/src/contracts/simpleExchange.js +4 -0
  68. package/src/contracts/types-ambient.d.ts +7 -7
  69. package/src/contracts/types-ambient.d.ts.map +1 -1
  70. package/src/contracts/types-ambient.js +7 -7
  71. package/src/contracts/valueVow.contract.d.ts +5 -2
  72. package/src/contracts/valueVow.contract.d.ts.map +1 -1
  73. package/src/contracts/valueVow.contract.js +1 -0
  74. package/src/instanceRecordStorage.d.ts.map +1 -1
  75. package/src/instanceRecordStorage.js +3 -1
  76. package/src/internal-types.d.ts +15 -5
  77. package/src/internal-types.d.ts.map +1 -1
  78. package/src/internal-types.js +9 -4
  79. package/src/issuerRecord.d.ts +3 -2
  80. package/src/issuerRecord.d.ts.map +1 -1
  81. package/src/issuerRecord.js +6 -2
  82. package/src/issuerStorage.d.ts +3 -2
  83. package/src/issuerStorage.d.ts.map +1 -1
  84. package/src/issuerStorage.js +6 -5
  85. package/src/typeGuards.d.ts +10 -6
  86. package/src/typeGuards.d.ts.map +1 -1
  87. package/src/typeGuards.js +7 -5
  88. package/src/types-ambient.d.ts +0 -40
  89. package/src/types-ambient.d.ts.map +1 -1
  90. package/src/types-ambient.js +4 -42
  91. package/src/types-index.d.ts +4 -0
  92. package/src/types-index.js +2 -0
  93. package/src/types.d.ts +29 -0
  94. package/src/types.d.ts.map +1 -0
  95. package/src/types.ts +44 -0
  96. package/src/zoeService/feeMint.d.ts +1 -0
  97. package/src/zoeService/feeMint.d.ts.map +1 -1
  98. package/src/zoeService/feeMint.js +4 -0
  99. package/src/zoeService/installationStorage.d.ts +3 -2
  100. package/src/zoeService/installationStorage.d.ts.map +1 -1
  101. package/src/zoeService/installationStorage.js +2 -5
  102. package/src/zoeService/internal-types.d.ts +11 -3
  103. package/src/zoeService/internal-types.d.ts.map +1 -1
  104. package/src/zoeService/internal-types.js +9 -3
  105. package/src/zoeService/invitationQueries.d.ts +3 -3
  106. package/src/zoeService/invitationQueries.js +3 -3
  107. package/src/zoeService/makeInvitation.d.ts +1 -0
  108. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  109. package/src/zoeService/makeInvitation.js +3 -0
  110. package/src/zoeService/offer/offer.d.ts +1 -0
  111. package/src/zoeService/offer/offer.d.ts.map +1 -1
  112. package/src/zoeService/offer/offer.js +3 -1
  113. package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
  114. package/src/zoeService/originalZoeSeat.js +0 -1
  115. package/src/zoeService/startInstance.d.ts.map +1 -1
  116. package/src/zoeService/startInstance.js +0 -2
  117. package/src/zoeService/types-ambient.d.ts +0 -226
  118. package/src/zoeService/types-ambient.d.ts.map +1 -1
  119. package/src/zoeService/types-ambient.js +4 -327
  120. package/src/zoeService/types.d.ts +238 -0
  121. package/src/zoeService/types.d.ts.map +1 -0
  122. package/src/zoeService/types.ts +307 -0
  123. package/src/zoeService/utils.d.ts +13 -5
  124. package/src/zoeService/utils.test-d.ts +1 -0
  125. package/src/zoeService/zoe.d.ts +11 -1
  126. package/src/zoeService/zoe.d.ts.map +1 -1
  127. package/src/zoeService/zoe.js +8 -1
  128. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  129. package/src/zoeService/zoeSeat.js +1 -2
  130. package/src/zoeService/zoeStorageManager.d.ts +5 -5
  131. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  132. package/src/zoeService/zoeStorageManager.js +4 -3
  133. package/tools/fakeVatAdmin.d.ts +9 -2
  134. package/tools/fakeVatAdmin.d.ts.map +1 -1
  135. package/tools/fakeVatAdmin.js +18 -10
  136. package/tools/manualPriceAuthority.d.ts +4 -1
  137. package/tools/manualPriceAuthority.d.ts.map +1 -1
  138. package/tools/manualPriceAuthority.js +1 -0
  139. package/tools/scriptedOracle.d.ts +6 -2
  140. package/tools/scriptedOracle.d.ts.map +1 -1
  141. package/tools/scriptedOracle.js +4 -0
  142. package/tools/setup-zoe.d.ts +12 -6
  143. package/tools/setup-zoe.d.ts.map +1 -1
  144. package/tools/setup-zoe.js +38 -5
  145. package/tools/test-utils.d.ts +1 -1
  146. package/tools/test-utils.js +1 -1
  147. package/tools/types.d.ts +1 -0
  148. package/tools/types.d.ts.map +1 -1
  149. package/tools/types.js +1 -0
  150. package/src/contractFacet/internal-types.d.ts +0 -8
  151. package/src/contractFacet/internal-types.d.ts.map +0 -1
  152. package/src/contractFacet/internal-types.js +0 -15
  153. package/src/contractFacet/types-ambient.js +0 -1
  154. package/src/contractSupport/ratio.d.ts +0 -37
  155. package/src/contractSupport/ratio.d.ts.map +0 -1
  156. package/src/contractSupport/ratio.js +0 -419
  157. package/src/contractSupport/safeMath.d.ts +0 -11
  158. package/src/contractSupport/safeMath.d.ts.map +0 -1
  159. package/src/contractSupport/safeMath.js +0 -49
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/zoe",
3
- "version": "0.27.0-upgrade-19-dev-5428c4d.0+5428c4d",
3
+ "version": "0.27.0-upgrade-20-dev-ef71cfd.0+ef71cfd",
4
4
  "description": "Zoe: the Smart Contract Framework for Offer Enforcement",
5
5
  "type": "module",
6
6
  "main": "./src/zoeService/zoe.js",
@@ -43,35 +43,35 @@
43
43
  },
44
44
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
45
45
  "dependencies": {
46
- "@agoric/base-zone": "0.1.1-upgrade-19-dev-5428c4d.0+5428c4d",
47
- "@agoric/ertp": "0.16.3-upgrade-19-dev-5428c4d.0+5428c4d",
48
- "@agoric/internal": "0.4.0-upgrade-19-dev-5428c4d.0+5428c4d",
49
- "@agoric/notifier": "0.7.0-upgrade-19-dev-5428c4d.0+5428c4d",
50
- "@agoric/store": "0.9.3-upgrade-19-dev-5428c4d.0+5428c4d",
51
- "@agoric/swingset-liveslots": "0.10.3-upgrade-19-dev-5428c4d.0+5428c4d",
52
- "@agoric/swingset-vat": "0.33.0-upgrade-19-dev-5428c4d.0+5428c4d",
53
- "@agoric/time": "0.3.3-upgrade-19-dev-5428c4d.0+5428c4d",
54
- "@agoric/vat-data": "0.5.3-upgrade-19-dev-5428c4d.0+5428c4d",
55
- "@agoric/vow": "0.2.0-upgrade-19-dev-5428c4d.0+5428c4d",
56
- "@agoric/zone": "0.3.0-upgrade-19-dev-5428c4d.0+5428c4d",
57
- "@endo/bundle-source": "^3.5.1",
58
- "@endo/captp": "^4.4.4",
59
- "@endo/common": "^1.2.9",
60
- "@endo/errors": "^1.2.9",
61
- "@endo/eventual-send": "^1.3.0",
62
- "@endo/exo": "^1.5.8",
63
- "@endo/far": "^1.1.10",
64
- "@endo/import-bundle": "^1.3.3",
65
- "@endo/marshal": "^1.6.3",
66
- "@endo/nat": "^5.0.14",
67
- "@endo/pass-style": "^1.4.8",
68
- "@endo/patterns": "^1.4.8",
69
- "@endo/promise-kit": "^1.1.9",
46
+ "@agoric/base-zone": "0.1.1-upgrade-20-dev-ef71cfd.0+ef71cfd",
47
+ "@agoric/ertp": "0.16.3-upgrade-20-dev-ef71cfd.0+ef71cfd",
48
+ "@agoric/internal": "0.4.0-upgrade-20-dev-ef71cfd.0+ef71cfd",
49
+ "@agoric/notifier": "0.7.0-upgrade-20-dev-ef71cfd.0+ef71cfd",
50
+ "@agoric/store": "0.9.3-upgrade-20-dev-ef71cfd.0+ef71cfd",
51
+ "@agoric/swingset-liveslots": "0.10.3-upgrade-20-dev-ef71cfd.0+ef71cfd",
52
+ "@agoric/swingset-vat": "0.33.0-upgrade-20-dev-ef71cfd.0+ef71cfd",
53
+ "@agoric/time": "0.3.3-upgrade-20-dev-ef71cfd.0+ef71cfd",
54
+ "@agoric/vat-data": "0.5.3-upgrade-20-dev-ef71cfd.0+ef71cfd",
55
+ "@agoric/vow": "0.2.0-upgrade-20-dev-ef71cfd.0+ef71cfd",
56
+ "@agoric/zone": "0.3.0-upgrade-20-dev-ef71cfd.0+ef71cfd",
57
+ "@endo/bundle-source": "^4.0.0",
58
+ "@endo/captp": "^4.4.5",
59
+ "@endo/common": "^1.2.10",
60
+ "@endo/errors": "^1.2.10",
61
+ "@endo/eventual-send": "^1.3.1",
62
+ "@endo/exo": "^1.5.9",
63
+ "@endo/far": "^1.1.11",
64
+ "@endo/import-bundle": "^1.4.0",
65
+ "@endo/marshal": "^1.6.4",
66
+ "@endo/nat": "^5.1.0",
67
+ "@endo/pass-style": "^1.5.0",
68
+ "@endo/patterns": "^1.5.0",
69
+ "@endo/promise-kit": "^1.1.10",
70
70
  "yargs-parser": "^21.1.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@agoric/kmarshal": "0.1.1-upgrade-19-dev-5428c4d.0+5428c4d",
74
- "@endo/init": "^1.1.8",
73
+ "@agoric/kmarshal": "0.1.1-upgrade-20-dev-ef71cfd.0+ef71cfd",
74
+ "@endo/init": "^1.1.9",
75
75
  "ava": "^5.3.0",
76
76
  "c8": "^10.1.2",
77
77
  "import-meta-resolve": "^4.1.0",
@@ -98,7 +98,7 @@
98
98
  "access": "public"
99
99
  },
100
100
  "typeCoverage": {
101
- "atLeast": 85.11
101
+ "atLeast": 85.15
102
102
  },
103
- "gitHead": "5428c4da67b53cef7ff53ba7b2a28cf6ec8f643a"
103
+ "gitHead": "ef71cfdc9e62572cab9a3d2821dc446ce0d700c3"
104
104
  }
@@ -6,4 +6,6 @@ export function cleanKeywords(uncleanKeywordRecord: {
6
6
  export function coerceAmountPatternKeywordRecord(allegedAmountKeywordRecord: any, getAssetKindByBrand: any): Record<string | number | symbol, any>;
7
7
  export function coerceAmountKeywordRecord(allegedAmountKeywordRecord: unknown, getAssetKindByBrand: any): AmountKeywordRecord;
8
8
  export function cleanProposal(proposal: Proposal, getAssetKindByBrand: GetAssetKindByBrand): ProposalRecord;
9
+ import type { Proposal } from '@agoric/zoe';
10
+ import type { ProposalRecord } from '@agoric/zoe';
9
11
  //# sourceMappingURL=cleanProposal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cleanProposal.d.ts","sourceRoot":"","sources":["cleanProposal.js"],"names":[],"mappings":"AAWA,iCAAkC,GAAG,CAAC;AAa/B,sDAYN;AAMM,oDAHI;IAAC,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,GACnB,MAAM,EAAE,CAcpB;AAEM,mJAsBN;AAQM,sEAJI,OAAO,uBACP,GAAC,GACC,mBAAmB,CAa/B;AA4CM,wCAJI,QAAQ,uBACR,mBAAmB,GACjB,cAAc,CA6B1B"}
1
+ {"version":3,"file":"cleanProposal.d.ts","sourceRoot":"","sources":["cleanProposal.js"],"names":[],"mappings":"AASA,iCAAkC,GAAG,CAAC;AAiB/B,sDAYN;AAMM,oDAHI;IAAC,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,GACnB,MAAM,EAAE,CAcpB;AAEM,mJAsBN;AAQM,sEAJI,OAAO,uBACP,GAAC,GACC,mBAAmB,CAa/B;AA4CM,wCAJI,QAAQ,uBACR,mBAAmB,GACjB,cAAc,CA6B1B;8BA9JoD,aAAa;oCAAb,aAAa"}
@@ -5,12 +5,14 @@ import { assertRecord } from '@endo/marshal';
5
5
  import { assertKey, assertPattern, mustMatch, isKey } from '@agoric/store';
6
6
  import { FullProposalShape } from './typeGuards.js';
7
7
 
8
- import './internal-types.js';
9
-
10
8
  const { ownKeys } = Reflect;
11
9
 
12
10
  export const MAX_KEYWORD_LENGTH = 100;
13
11
 
12
+ /**
13
+ * @import {ExitRule, Proposal, ProposalRecord} from '@agoric/zoe';
14
+ */
15
+
14
16
  const firstCapASCII = /^[A-Z][a-zA-Z0-9_$]*$/;
15
17
 
16
18
  // We adopt simple requirements on keywords so that they do not accidentally
@@ -1,2 +1,2 @@
1
- export function makeMakeExiter(baggage: any): (proposal: ProposalRecord, zcfSeat: ZCFSeat) => ExitObj;
1
+ export function makeMakeExiter(baggage: any): (proposal: globalThis.ProposalRecord, zcfSeat: globalThis.ZCFSeat) => ExitObj;
2
2
  //# sourceMappingURL=exit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["exit.js"],"names":[],"mappings":"AAwBO,sGAwGN"}
1
+ {"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["exit.js"],"names":[],"mappings":"AAwBO,4HAwGN"}
@@ -1,5 +1,5 @@
1
1
  export function makeOfferHandlerStorage(zcfBaggage: any): {
2
- storeOfferHandler: (offerHandler: any) => Handle<"Invitation">;
2
+ storeOfferHandler: (offerHandler: any) => globalThis.Handle<"Invitation">;
3
3
  takeOfferHandler: (invitationHandle: InvitationHandle, details?: Details) => OfferHandler;
4
4
  };
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"rightsConservation.d.ts","sourceRoot":"","sources":["rightsConservation.js"],"names":[],"mappings":"AAqFA;;;;;;;;;GASG;AACH,uDANW,MAAM,EAAE,cAER,MAAM,EAAE,GAEN,IAAI,CAMhB"}
1
+ {"version":3,"file":"rightsConservation.d.ts","sourceRoot":"","sources":["rightsConservation.js"],"names":[],"mappings":"AAoFA;;;;;;;;;GASG;AACH,uDANW,MAAM,EAAE,cAER,MAAM,EAAE,GAEN,IAAI,CAMhB"}
@@ -2,7 +2,6 @@ import { assert, Fail } from '@endo/errors';
2
2
  import { makeScalarMapStore } from '@agoric/store';
3
3
  import { AmountMath } from '@agoric/ertp';
4
4
 
5
- import '../internal-types.js';
6
5
  /**
7
6
  * @import {MapStore} from '@agoric/store';
8
7
  */
@@ -0,0 +1,184 @@
1
+ import type { AdditionalDisplayInfo, Amount, AnyAmount, AssetKind, Brand, DisplayInfo, Issuer, Payment } from '@agoric/ertp';
2
+ import type { Subscriber } from '@agoric/notifier';
3
+ import type { ERef } from '@endo/far';
4
+ import type { Passable } from '@endo/pass-style';
5
+ import type { Key, Pattern } from '@endo/patterns';
6
+ import type { AmountKeywordRecord, ExitRule, FeeMintAccess, Instance, InvitationDetails, Keyword, ProposalRecord, StandardTerms, UserSeat, ZoeService } from '../types-index.js';
7
+ import type { ContractStartFunction } from '../zoeService/utils.js';
8
+ /**
9
+ * Any passable non-thenable. Often an explanatory string.
10
+ */
11
+ export type Completion = Passable;
12
+ export type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit;
13
+ export type InvitationAmount = Amount<'set', InvitationDetails>;
14
+ export type ZoeIssuerRecord<K extends AssetKind = AssetKind, M extends Key = Key> = {
15
+ brand: Brand<K>;
16
+ issuer: Issuer<K, M>;
17
+ assetKind: K;
18
+ displayInfo?: DisplayInfo<K>;
19
+ };
20
+ export type Allocation = Record<Keyword, AnyAmount>;
21
+ /**
22
+ * Zoe Contract Facet
23
+ *
24
+ * The Zoe interface specific to a contract instance. The Zoe Contract
25
+ * Facet is an API object used by running contract instances to access
26
+ * the Zoe state for that instance. The Zoe Contract Facet is accessed
27
+ * synchronously from within the contract, and usually is referred to
28
+ * in code as zcf.
29
+ */
30
+ export type ZCF<CT = Record<string, unknown>> = {
31
+ /**
32
+ * - atomically reallocate amounts among seats.
33
+ */
34
+ atomicRearrange: (transfers: TransferPart[]) => void;
35
+ /**
36
+ * - check
37
+ * whether a keyword is valid and unique and could be added in
38
+ * `saveIssuer`
39
+ */
40
+ assertUniqueKeyword: (keyword: Keyword) => void;
41
+ /**
42
+ * Informs Zoe about an issuer and returns a promise for acknowledging
43
+ * when the issuer is added and ready.
44
+ *
45
+ * @returns the AmountMath and brand synchronously accessible after
46
+ * saving
47
+ */
48
+ saveIssuer: <I extends Issuer>(issuerP: ERef<I>, keyword: Keyword) => Promise<I extends Issuer<infer K, infer M> ? ZoeIssuerRecord<K, M> : never>;
49
+ /**
50
+ * Make a credible Zoe invitation for a particular smart contract
51
+ * indicated by the `instance` in the details of the invitation. Zoe
52
+ * also puts the `installation` and a unique `handle` in the details
53
+ * of the invitation. The contract must provide a `description` for
54
+ * the invitation and should include whatever information is necessary
55
+ * for a potential buyer of the invitation to know what they are
56
+ * getting in the `customDetails`. `customDetails` will be
57
+ * placed in the details of the invitation.
58
+ */
59
+ makeInvitation: <R, A = undefined>(offerHandler: OfferHandler<ERef<R>, A>, description: string, customDetails?: object, proposalShape?: Pattern) => Promise<Invitation<R, A>>;
60
+ shutdown: (completion: Completion) => void;
61
+ shutdownWithFailure: import('@agoric/swingset-vat').ShutdownWithFailure;
62
+ getZoeService: () => ERef<ZoeService>;
63
+ getInvitationIssuer: () => Issuer<'set'>;
64
+ getTerms: () => StandardTerms & CT;
65
+ getBrandForIssuer: <K extends AssetKind>(issuer: Issuer<K>) => Brand<K>;
66
+ getIssuerForBrand: <K_1 extends AssetKind>(brand: Brand<K_1>) => Issuer<K_1>;
67
+ getAssetKind: (brand: Brand) => AssetKind;
68
+ makeZCFMint: <K_2 extends AssetKind = 'nat'>(keyword: Keyword, assetKind?: K_2 | undefined, displayInfo?: AdditionalDisplayInfo, options?: import('@agoric/ertp').IssuerOptionsRecord) => Promise<ZCFMint<K_2>>;
69
+ registerFeeMint: ZCFRegisterFeeMint;
70
+ makeEmptySeatKit: ZCFMakeEmptySeatKit;
71
+ setTestJig: SetTestJig;
72
+ stopAcceptingOffers: () => Promise<void>;
73
+ setOfferFilter: (strings: Array<string>) => Promise<void>;
74
+ getOfferFilter: () => Promise<Array<string>>;
75
+ getInstance: () => Instance;
76
+ };
77
+ export type TransferPart = [
78
+ fromSeat?: ZCFSeat,
79
+ toSeat?: ZCFSeat,
80
+ fromAmounts?: AmountKeywordRecord,
81
+ toAmounts?: AmountKeywordRecord
82
+ ];
83
+ export type ZCFRegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => Promise<ZCFMint<'nat'>>;
84
+ /**
85
+ * Provide a jig object for testing purposes only.
86
+ *
87
+ * The contract code provides a callback whose return result will
88
+ * be made available to the test that started this contract. The
89
+ * supplied callback will only be called in a testing context,
90
+ * never in production; i.e., it is only called if `testJigSetter`
91
+ * was supplied.
92
+ *
93
+ * If no `testFn` is supplied, then an empty jig will be used.
94
+ * An additional `zcf` property set to the current ContractFacet
95
+ * will be appended to the returned jig object (overriding any
96
+ * provided by the `testFn`).
97
+ */
98
+ export type SetTestJig = (testFn?: () => Record<string, unknown>) => void;
99
+ export type ZCFMint<K extends AssetKind = AssetKind> = {
100
+ getIssuerRecord: () => ZoeIssuerRecord<K>;
101
+ /**
102
+ * All the amounts in gains must be of this ZCFMint's brand.
103
+ * The gains' keywords are in the namespace of that seat.
104
+ * Add the gains to that seat's allocation.
105
+ * The resulting state must be offer safe. (Currently, increasing assets can
106
+ * never violate offer safety anyway.)
107
+ *
108
+ * Mint that amount of assets into the pooled purse.
109
+ * If a seat is provided, it is returned. Otherwise a new seat is
110
+ * returned.
111
+ */
112
+ mintGains: (gains: AmountKeywordRecord, zcfSeat?: ZCFSeat) => ZCFSeat;
113
+ /**
114
+ * All the amounts in losses must be of this ZCFMint's brand.
115
+ * The losses' keywords are in the namespace of that seat.
116
+ * Subtract losses from that seat's allocation.
117
+ * The resulting state must be offer safe.
118
+ *
119
+ * Burn that amount of assets from the pooled purse.
120
+ */
121
+ burnLosses: (losses: AmountKeywordRecord, zcfSeat: ZCFSeat) => void;
122
+ };
123
+ /**
124
+ * fail called with the reason for this failure, where reason is
125
+ * normally an instanceof Error.
126
+ */
127
+ export type ZCFSeatFail = (reason: unknown) => Error;
128
+ export type ZCFSeat = import('@endo/pass-style').RemotableObject & {
129
+ exit: (completion?: Completion) => void;
130
+ fail: ZCFSeatFail;
131
+ getSubscriber: () => Promise<Subscriber<Allocation>>;
132
+ hasExited: () => boolean;
133
+ getProposal: () => ProposalRecord;
134
+ /**
135
+ * @param brand used for filling in an empty amount if the `keyword`
136
+ * is not present in the allocation
137
+ */
138
+ getAmountAllocated: <B extends Brand<any>>(keyword: Keyword, brand?: B) => B extends Brand<infer K> ? Amount<K> : Amount;
139
+ getCurrentAllocation: () => Allocation;
140
+ isOfferSafe: (newAllocation: Allocation) => boolean;
141
+ };
142
+ export type ZcfSeatKit = {
143
+ zcfSeat: ZCFSeat;
144
+ userSeat: Promise<UserSeat>;
145
+ };
146
+ export type HandleOffer<OR, OA> = (seat: ZCFSeat, offerArgs: OA) => OR;
147
+ export type OfferHandler<OR = unknown, OA = never> = HandleOffer<OR, OA> | {
148
+ handle: HandleOffer<OR, OA>;
149
+ };
150
+ export type ContractMeta<SF extends ContractStartFunction = ContractStartFunction> = {
151
+ customTermsShape?: Record<Parameters<SF>[0] extends ZCF<infer CT> ? keyof CT : never, Pattern>;
152
+ privateArgsShape?: {
153
+ [K in keyof Parameters<SF>[1]]: Pattern;
154
+ };
155
+ /**
156
+ * - `none` means that the contract is not upgradable.
157
+ * - `canUpgrade` means this code can perform an upgrade
158
+ * - `canBeUpgraded` means that the contract stores kinds durably such that the next version can upgrade
159
+ */
160
+ upgradability?: 'none' | 'canBeUpgraded' | 'canUpgrade' | undefined;
161
+ };
162
+ /**
163
+ * API for a contract start function.
164
+ *
165
+ * CAVEAT: assumes synchronous
166
+ */
167
+ export type ContractStartFn<PF = any, CF = any, CT = any, PA = any> = (zcf: ZCF<CT>, privateArgs: PA, baggage: import('@agoric/vat-data').Baggage) => ContractStartFnResult<PF, CF>;
168
+ export type ContractStartFnResult<PF, CF> = {
169
+ publicFacet?: PF;
170
+ creatorFacet?: CF;
171
+ creatorInvitation?: Promise<Invitation<any, any>> | undefined;
172
+ };
173
+ /**
174
+ * @deprecated use the parameterized version
175
+ */
176
+ export type AdminFacet = import('../zoeService/utils.js').AdminFacet<any>;
177
+ declare const OfferReturn: unique symbol;
178
+ declare const OfferArgs: unique symbol;
179
+ export type Invitation<R = unknown, A = undefined> = Payment<'set', InvitationDetails> & {
180
+ [OfferReturn]?: R;
181
+ [OfferArgs]?: A;
182
+ };
183
+ export {};
184
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,EACL,WAAW,EACX,MAAM,EACN,OAAO,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,M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,GAAG,OAAO,EAAE,CAAC,GAAG,SAAS,IAAI,OAAO,CAC1D,KAAK,EACL,iBAAiB,CAClB,GAAG;IAEF,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;CACjB,CAAC"}
@@ -1,14 +1,49 @@
1
- /// <reference types="@agoric/ertp/exported" />
2
- /// <reference types="@endo/pass-style" />
3
- /// <reference path="../zoeService/utils.d.ts" />
1
+ import type {
2
+ AdditionalDisplayInfo,
3
+ Amount,
4
+ AnyAmount,
5
+ AssetKind,
6
+ Brand,
7
+ DisplayInfo,
8
+ Issuer,
9
+ Payment,
10
+ } from '@agoric/ertp';
11
+ import type { Subscriber } from '@agoric/notifier';
12
+ import type { ERef } from '@endo/far';
13
+ import type { Passable } from '@endo/pass-style';
14
+ import type { Key, Pattern } from '@endo/patterns';
15
+ import type {
16
+ AmountKeywordRecord,
17
+ ExitRule,
18
+ FeeMintAccess,
19
+ Instance,
20
+ InvitationDetails,
21
+ Keyword,
22
+ ProposalRecord,
23
+ StandardTerms,
24
+ UserSeat,
25
+ ZoeService,
26
+ } from '../types-index.js';
27
+ import type { ContractStartFunction } from '../zoeService/utils.js';
4
28
 
5
29
  /**
6
30
  * Any passable non-thenable. Often an explanatory string.
7
31
  */
8
- type Completion = import('@endo/pass-style').Passable;
9
- type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit;
32
+ export type Completion = Passable;
33
+ export type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit;
10
34
 
11
- type InvitationAmount = Amount<'set', InvitationDetails>;
35
+ export type InvitationAmount = Amount<'set', InvitationDetails>;
36
+
37
+ export type ZoeIssuerRecord<
38
+ K extends AssetKind = AssetKind,
39
+ M extends Key = Key,
40
+ > = {
41
+ brand: Brand<K>;
42
+ issuer: Issuer<K, M>;
43
+ assetKind: K;
44
+ displayInfo?: DisplayInfo<K>;
45
+ };
46
+ export type Allocation = Record<Keyword, AnyAmount>;
12
47
 
13
48
  /**
14
49
  * Zoe Contract Facet
@@ -19,7 +54,7 @@ type InvitationAmount = Amount<'set', InvitationDetails>;
19
54
  * synchronously from within the contract, and usually is referred to
20
55
  * in code as zcf.
21
56
  */
22
- type ZCF<CT = Record<string, unknown>> = {
57
+ export type ZCF<CT = Record<string, unknown>> = {
23
58
  /**
24
59
  * - atomically reallocate amounts among seats.
25
60
  */
@@ -40,7 +75,9 @@ type ZCF<CT = Record<string, unknown>> = {
40
75
  saveIssuer: <I extends Issuer>(
41
76
  issuerP: ERef<I>,
42
77
  keyword: Keyword,
43
- ) => Promise<I extends Issuer<infer K, infer M> ? IssuerRecord<K, M> : never>;
78
+ ) => Promise<
79
+ I extends Issuer<infer K, infer M> ? ZoeIssuerRecord<K, M> : never
80
+ >;
44
81
 
45
82
  /**
46
83
  * Make a credible Zoe invitation for a particular smart contract
@@ -65,7 +102,7 @@ type ZCF<CT = Record<string, unknown>> = {
65
102
  getTerms: () => StandardTerms & CT;
66
103
  getBrandForIssuer: <K extends AssetKind>(issuer: Issuer<K>) => Brand<K>;
67
104
  getIssuerForBrand: <K_1 extends AssetKind>(brand: Brand<K_1>) => Issuer<K_1>;
68
- getAssetKind: GetAssetKindByBrand;
105
+ getAssetKind: (brand: Brand) => AssetKind;
69
106
  makeZCFMint: <K_2 extends AssetKind = 'nat'>(
70
107
  keyword: Keyword,
71
108
  assetKind?: K_2 | undefined,
@@ -81,14 +118,14 @@ type ZCF<CT = Record<string, unknown>> = {
81
118
  getInstance: () => Instance;
82
119
  };
83
120
 
84
- type TransferPart = [
121
+ export type TransferPart = [
85
122
  fromSeat?: ZCFSeat,
86
123
  toSeat?: ZCFSeat,
87
124
  fromAmounts?: AmountKeywordRecord,
88
125
  toAmounts?: AmountKeywordRecord,
89
126
  ];
90
127
 
91
- type ZCFRegisterFeeMint = (
128
+ export type ZCFRegisterFeeMint = (
92
129
  keyword: Keyword,
93
130
  allegedFeeMintAccess: FeeMintAccess,
94
131
  ) => Promise<ZCFMint<'nat'>>;
@@ -106,9 +143,9 @@ type ZCFRegisterFeeMint = (
106
143
  * will be appended to the returned jig object (overriding any
107
144
  * provided by the `testFn`).
108
145
  */
109
- type SetTestJig = (testFn?: () => Record<string, unknown>) => void;
110
- type ZCFMint<K extends AssetKind = AssetKind> = {
111
- getIssuerRecord: () => IssuerRecord<K>;
146
+ export type SetTestJig = (testFn?: () => Record<string, unknown>) => void;
147
+ export type ZCFMint<K extends AssetKind = AssetKind> = {
148
+ getIssuerRecord: () => ZoeIssuerRecord<K>;
112
149
  /**
113
150
  * All the amounts in gains must be of this ZCFMint's brand.
114
151
  * The gains' keywords are in the namespace of that seat.
@@ -135,8 +172,8 @@ type ZCFMint<K extends AssetKind = AssetKind> = {
135
172
  * fail called with the reason for this failure, where reason is
136
173
  * normally an instanceof Error.
137
174
  */
138
- type ZCFSeatFail = (reason: unknown) => Error;
139
- type ZCFSeat = import('@endo/pass-style').RemotableObject & {
175
+ export type ZCFSeatFail = (reason: unknown) => Error;
176
+ export type ZCFSeat = import('@endo/pass-style').RemotableObject & {
140
177
  exit: (completion?: Completion) => void;
141
178
  fail: ZCFSeatFail;
142
179
  getSubscriber: () => Promise<Subscriber<Allocation>>;
@@ -146,26 +183,26 @@ type ZCFSeat = import('@endo/pass-style').RemotableObject & {
146
183
  * @param brand used for filling in an empty amount if the `keyword`
147
184
  * is not present in the allocation
148
185
  */
149
- getAmountAllocated: <B extends Brand>(
186
+ getAmountAllocated: <B extends Brand<any>>(
150
187
  keyword: Keyword,
151
188
  brand?: B,
152
189
  ) => B extends Brand<infer K> ? Amount<K> : Amount;
153
190
  getCurrentAllocation: () => Allocation;
154
191
  isOfferSafe: (newAllocation: Allocation) => boolean;
155
192
  };
156
- type ZcfSeatKit = {
193
+ export type ZcfSeatKit = {
157
194
  zcfSeat: ZCFSeat;
158
195
  userSeat: Promise<UserSeat>;
159
196
  };
160
- type HandleOffer<OR, OA> = (seat: ZCFSeat, offerArgs: OA) => OR;
161
- type OfferHandler<OR = unknown, OA = never> =
197
+ export type HandleOffer<OR, OA> = (seat: ZCFSeat, offerArgs: OA) => OR;
198
+ export type OfferHandler<OR = unknown, OA = never> =
162
199
  | HandleOffer<OR, OA>
163
200
  | {
164
201
  handle: HandleOffer<OR, OA>;
165
202
  };
166
- type ContractMeta<
203
+ export type ContractMeta<
167
204
  SF extends // import inline to maintain ambient mode
168
- import('../zoeService/utils').ContractStartFunction = import('../zoeService/utils').ContractStartFunction,
205
+ ContractStartFunction = ContractStartFunction,
169
206
  > = {
170
207
  customTermsShape?: Record<
171
208
  Parameters<SF>[0] extends ZCF<infer CT> ? keyof CT : never,
@@ -184,25 +221,25 @@ type ContractMeta<
184
221
  *
185
222
  * CAVEAT: assumes synchronous
186
223
  */
187
- type ContractStartFn<PF = any, CF = any, CT = any, PA = any> = (
224
+ export type ContractStartFn<PF = any, CF = any, CT = any, PA = any> = (
188
225
  zcf: ZCF<CT>,
189
226
  privateArgs: PA,
190
227
  baggage: import('@agoric/vat-data').Baggage,
191
228
  ) => ContractStartFnResult<PF, CF>;
192
- type ContractStartFnResult<PF, CF> = {
229
+ export type ContractStartFnResult<PF, CF> = {
193
230
  publicFacet?: PF;
194
231
  creatorFacet?: CF;
195
232
  creatorInvitation?: Promise<Invitation<any, any>> | undefined;
196
233
  };
197
234
 
198
- // XXX redef, losing documentation
199
- type ContractOf<S extends (...args: any) => any> =
200
- import('../zoeService/utils').ContractOf<S>;
201
- type AdminFacet = import('../zoeService/utils').AdminFacet<any>;
235
+ /**
236
+ * @deprecated use the parameterized version
237
+ */
238
+ export type AdminFacet = import('../zoeService/utils.js').AdminFacet<any>;
202
239
 
203
240
  declare const OfferReturn: unique symbol;
204
241
  declare const OfferArgs: unique symbol;
205
- type Invitation<R = unknown, A = undefined> = Payment<
242
+ export type Invitation<R = unknown, A = undefined> = Payment<
206
243
  'set',
207
244
  InvitationDetails
208
245
  > & {
@@ -1,14 +1,20 @@
1
1
  /**
2
- * @param {VatPowers & { testJigSetter: TestJigSetter }} powers
2
+ * @import {ZoeService} from '@agoric/zoe';
3
+ */
4
+ /**
5
+ * @param {VatPowers & { testJigSetter: ( {zcf}: {zcf: ZCF} ) => void }} powers
3
6
  * @param {{contractBundleCap: BundleCap, zoeService: ZoeService, invitationIssuer: Issuer<'set'>, privateArgs?: any}} vatParameters
4
7
  * @param {import('@agoric/vat-data').Baggage} baggage
5
8
  */
6
9
  export function buildRootObject(powers: VatPowers & {
7
- testJigSetter: TestJigSetter;
10
+ testJigSetter: ({ zcf }: {
11
+ zcf: ZCF;
12
+ }) => void;
8
13
  }, vatParameters: {
9
14
  contractBundleCap: BundleCap;
10
15
  zoeService: ZoeService;
11
16
  invitationIssuer: Issuer<"set">;
12
17
  privateArgs?: any;
13
18
  }, baggage: import("@agoric/vat-data").Baggage): Promise<import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {}>>;
19
+ import type { ZoeService } from '@agoric/zoe';
14
20
  //# sourceMappingURL=vatRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vatRoot.d.ts","sourceRoot":"","sources":["vatRoot.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,wCAJW,SAAS,GAAG;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,iBAC5C;IAAC,iBAAiB,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAA;CAAC,WAC1G,OAAO,kBAAkB,EAAE,OAAO,oIA+D5C"}
1
+ {"version":3,"file":"vatRoot.d.ts","sourceRoot":"","sources":["vatRoot.js"],"names":[],"mappings":"AAeA;;GAEG;AAEH;;;;GAIG;AACH,wCAJW,SAAS,GAAG;IAAE,aAAa,EAAE,CAAE,EAAC,GAAG,EAAC,EAAE;QAAC,GAAG,EAAE,GAAG,CAAA;KAAC,KAAM,IAAI,CAAA;CAAE,iBAC5D;IAAC,iBAAiB,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAA;CAAC,WAC1G,OAAO,kBAAkB,EAAE,OAAO,oIA8D5C;gCApE4B,aAAa"}
@@ -11,12 +11,14 @@ import { Fail } from '@endo/errors';
11
11
  import { Far } from '@endo/marshal';
12
12
  import { E } from '@endo/far';
13
13
 
14
- import '../internal-types.js';
15
-
16
14
  import { makeZCFZygote } from './zcfZygote.js';
17
15
 
18
16
  /**
19
- * @param {VatPowers & { testJigSetter: TestJigSetter }} powers
17
+ * @import {ZoeService} from '@agoric/zoe';
18
+ */
19
+
20
+ /**
21
+ * @param {VatPowers & { testJigSetter: ( {zcf}: {zcf: ZCF} ) => void }} powers
20
22
  * @param {{contractBundleCap: BundleCap, zoeService: ZoeService, invitationIssuer: Issuer<'set'>, privateArgs?: any}} vatParameters
21
23
  * @param {import('@agoric/vat-data').Baggage} baggage
22
24
  */
@@ -72,7 +74,6 @@ export async function buildRootObject(powers, vatParameters, baggage) {
72
74
  issuerStorageFromZoe,
73
75
  privateArgs = undefined,
74
76
  ) => {
75
- /** @type {ZCFZygote} */
76
77
  return E(zcfZygote).startContract(
77
78
  zoeInstanceAdmin,
78
79
  instanceRecordFromZoe,
@@ -1,8 +1,9 @@
1
- export function sumAmountKeywordRecord(amr: AmountKeywordRecord, issuerRecord: IssuerRecord): Amount;
1
+ export function sumAmountKeywordRecord(amr: AmountKeywordRecord, issuerRecord: ZoeIssuerRecord): Amount;
2
2
  export function prepareZcMint(zcfBaggage: import("@agoric/vat-data").Baggage, recordIssuer: {
3
- (keyword: string, issuerRecord: IssuerRecord): void;
3
+ (keyword: string, issuerRecord: ZoeIssuerRecord): void;
4
4
  }, getAssetKindByBrand: GetAssetKindByBrand, makeEmptySeatKit: (exit?: undefined) => {
5
5
  zcfSeat: any;
6
6
  userSeat: Promise<UserSeat>;
7
7
  }, reallocator: ZcfMintReallocator): (keyword: string, zoeMintP: ERef<ZoeMint<K>>) => Promise<ZCFMint<K>>;
8
+ import type { ZCFMint } from '@agoric/zoe';
8
9
  //# sourceMappingURL=zcfMint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAmBO,4CAJI,mBAAmB,gBACnB,YAAY,GACV,MAAM,CAYlB;AASM,0CANI,OAAO,kBAAkB,EAAE,OAAO,gBAClC;IAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI,CAAA;CAAE,uBACvD,mBAAmB,oBACnB,CAAC,IAAI,CAAC,EAAE,SAAS,KAAK;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,eACnE,kBAAkB,IA0Gb,SAJH,MAIU,EAAE,UAHZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAGK,KAFlB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAWjC"}
1
+ {"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAmBO,4CAJI,mBAAmB,gBACnB,eAAe,GACb,MAAM,CAYlB;AASM,0CANI,OAAO,kBAAkB,EAAE,OAAO,gBAClC;IAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAAG,IAAI,CAAA;CAAE,uBAC1D,mBAAmB,oBACnB,CAAC,IAAI,CAAC,EAAE,SAAS,KAAK;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,eACnE,kBAAkB,IA0Gb,SAJH,MAIU,EAAE,UAHZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAGK,KAFlB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAWjC;6BA5IkC,aAAa"}
@@ -6,15 +6,15 @@ import { prepareExoClass } from '@agoric/vat-data';
6
6
  import { coerceAmountKeywordRecord } from '../cleanProposal.js';
7
7
  import { assertFullIssuerRecord, makeIssuerRecord } from '../issuerRecord.js';
8
8
  import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
9
-
10
- import '../internal-types.js';
11
9
  import { ZcfMintI } from './typeGuards.js';
12
- import './internal-types.js';
13
- import './types-ambient.js';
10
+
11
+ /**
12
+ * @import {ZCFMint, ZCFSeat} from '@agoric/zoe';
13
+ */
14
14
 
15
15
  /**
16
16
  * @param {AmountKeywordRecord} amr
17
- * @param {IssuerRecord} issuerRecord
17
+ * @param {ZoeIssuerRecord} issuerRecord
18
18
  * @returns {Amount}
19
19
  */
20
20
  export const sumAmountKeywordRecord = (amr, issuerRecord) => {
@@ -31,7 +31,7 @@ export const sumAmountKeywordRecord = (amr, issuerRecord) => {
31
31
 
32
32
  /**
33
33
  * @param {import('@agoric/vat-data').Baggage} zcfBaggage
34
- * @param {{ (keyword: string, issuerRecord: IssuerRecord): void }} recordIssuer
34
+ * @param {{ (keyword: string, issuerRecord: ZoeIssuerRecord): void }} recordIssuer
35
35
  * @param {GetAssetKindByBrand} getAssetKindByBrand
36
36
  * @param {(exit?: undefined) => { zcfSeat: any; userSeat: Promise<UserSeat> }} makeEmptySeatKit
37
37
  * @param {ZcfMintReallocator} reallocator
@@ -51,7 +51,7 @@ export const prepareZcMint = (
51
51
  * @template {AssetKind} [K=AssetKind]
52
52
  * @param {string} keyword
53
53
  * @param {ZoeMint<K>} zoeMint
54
- * @param {Required<IssuerRecord<K>>} issuerRecord
54
+ * @param {Required<ZoeIssuerRecord<K>>} issuerRecord
55
55
  */
56
56
  (keyword, zoeMint, issuerRecord) => {
57
57
  const {