diff --git a/multichain-testing/package.json b/multichain-testing/package.json index 81a7db66556..d6ea49e807e 100644 --- a/multichain-testing/package.json +++ b/multichain-testing/package.json @@ -39,7 +39,7 @@ "patch-package": "^8.0.0", "starshipjs": "2.4.1", "ts-blank-space": "^0.4.4", - "typescript": "~5.8.1-rc" + "typescript": "~5.8.2" }, "resolutions": { "axios": "1.6.7", diff --git a/multichain-testing/test/fast-usdc/fu-actors.ts b/multichain-testing/test/fast-usdc/fu-actors.ts index c0439c31c60..9776c35e235 100644 --- a/multichain-testing/test/fast-usdc/fu-actors.ts +++ b/multichain-testing/test/fast-usdc/fu-actors.ts @@ -12,6 +12,7 @@ import type { ExecutionContext } from 'ava'; import { makeDoOffer, type WalletDriver } from '../../tools/e2e-tools.js'; import type { createWallet } from '../../tools/wallet.js'; import type { commonSetup, SetupContextWithWallets } from '../support.js'; +import type { InvitationDetails } from '@agoric/zoe'; const { fromEntries } = Object; diff --git a/multichain-testing/yarn.lock b/multichain-testing/yarn.lock index 2b68120e075..178f5a5485b 100644 --- a/multichain-testing/yarn.lock +++ b/multichain-testing/yarn.lock @@ -4925,7 +4925,7 @@ __metadata: patch-package: "npm:^8.0.0" starshipjs: "npm:2.4.1" ts-blank-space: "npm:^0.4.4" - typescript: "npm:~5.8.1-rc" + typescript: "npm:~5.8.2" languageName: unknown linkType: soft @@ -5468,13 +5468,13 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.8.1-rc": - version: 5.8.1-rc - resolution: "typescript@npm:5.8.1-rc" +"typescript@npm:~5.8.2": + version: 5.8.2 + resolution: "typescript@npm:5.8.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/7692b2584d0bddbab2b9a76457908276cb968935b9e1a89b7429939b1c02c7c47b5b23f1e989e18bf441fc545a311f02e143e7594a3914e240554637011a7d70 + checksum: 10c0/5c4f6fbf1c6389b6928fe7b8fcd5dc73bb2d58cd4e3883f1d774ed5bd83b151cbac6b7ecf11723de56d4676daeba8713894b1e9af56174f2f9780ae7848ec3c6 languageName: node linkType: hard @@ -5488,13 +5488,13 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~5.8.1-rc#optional!builtin": - version: 5.8.1-rc - resolution: "typescript@patch:typescript@npm%3A5.8.1-rc#optional!builtin::version=5.8.1-rc&hash=5786d5" +"typescript@patch:typescript@npm%3A~5.8.2#optional!builtin": + version: 5.8.2 + resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin::version=5.8.2&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/45267f3c53240100da1d53ec8ebaa008f019055fe339c79baf596bab180aab2821751781bfc3202d5f6180fe01200aed9ebf45dec84490ef3a9d90359326c075 + checksum: 10c0/5448a08e595cc558ab321e49d4cac64fb43d1fa106584f6ff9a8d8e592111b373a995a1d5c7f3046211c8a37201eb6d0f1566f15cdb7a62a5e3be01d087848e2 languageName: node linkType: hard diff --git a/package.json b/package.json index eda2f3ab68b..afd1cd9c000 100644 --- a/package.json +++ b/package.json @@ -36,13 +36,13 @@ "type-coverage": "^2.27.1", "typedoc": "^0.26.7", "typedoc-plugin-markdown": "^4.2.1", - "typescript": "~5.8.1-rc", - "typescript-eslint": "^8.22.0" + "typescript": "~5.8.2", + "typescript-eslint": "^8.26.0" }, "resolutions": { "**/protobufjs": "^7.2.6", "**/@types/estree": "^1.0.0", - "@endo/eslint-plugin/typescript-eslint": "^8.22.0" + "@endo/eslint-plugin/typescript-eslint": "^8.26.0" }, "engines": { "node": "^18.12 || ^20.9" diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index f1356c5c4e8..2df1484c70d 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -77,6 +77,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 91.77 + "atLeast": 91.88 } } diff --git a/packages/ERTP/src/amountMath.js b/packages/ERTP/src/amountMath.js index 33ba194495d..1d6e6286a7d 100644 --- a/packages/ERTP/src/amountMath.js +++ b/packages/ERTP/src/amountMath.js @@ -9,7 +9,7 @@ import { copyBagMathHelpers } from './mathHelpers/copyBagMathHelpers.js'; /** * @import {CopyBag, CopySet} from '@endo/patterns'; - * @import {Amount, AssetValueForKind, Brand, CopyBagAmount, CopySetAmount, MathHelpers, NatAmount, NatValue, SetAmount, SetValue} from './types.js'; + * @import {Amount, AmountValue, AssetValueForKind, Brand, CopyBagAmount, CopySetAmount, MathHelpers, NatAmount, NatValue, SetAmount, SetValue} from './types.js'; */ // NB: AssetKind is both a constant for enumerated values and a type for those values. @@ -105,7 +105,7 @@ const assertValueGetAssetKind = value => { * * Made available only for testing, but it is harmless for other uses. * - * @template V + * @template {AmountValue} V * @param {V} value * @returns {MathHelpers} */ @@ -113,7 +113,9 @@ export const assertValueGetHelpers = value => // @ts-expect-error cast helpers[assertValueGetAssetKind(value)]; -/** @type {(allegedBrand: Brand, brand?: Brand) => void} */ +/** + * @type {(allegedBrand: Brand, brand?: Brand) => void} + */ const optionalBrandCheck = (allegedBrand, brand) => { if (brand !== undefined) { assertRemotable(brand, 'brand'); diff --git a/packages/ERTP/src/issuerKit.js b/packages/ERTP/src/issuerKit.js index 0493f44ebfa..f0bcd214470 100644 --- a/packages/ERTP/src/issuerKit.js +++ b/packages/ERTP/src/issuerKit.js @@ -13,6 +13,8 @@ import { preparePaymentLedger } from './paymentLedger.js'; * @import {AdditionalDisplayInfo, RecoverySetsOption, IssuerKit, PaymentLedger} from './types.js'; * @import {ShutdownWithFailure} from '@agoric/swingset-vat'; * @import {TypedPattern} from '@agoric/internal'; + * @import {CopyTaggedInterface, Key, RemotableObject} from '@endo/patterns'; + * @import {Pattern} from '@endo/patterns'; */ /** @@ -252,7 +254,7 @@ harden(makeDurableIssuerKit); * anything else is corrupted by that corrupted state. See * https://github.com/Agoric/agoric-sdk/issues/3434 * @param {O} [options] - * @returns {O['elementShape'] extends TypedPattern + * @returns {O['elementShape'] extends TypedPattern * ? IssuerKit * : IssuerKit} */ @@ -328,7 +330,7 @@ harden(prepareIssuerKit); * anything else is corrupted by that corrupted state. See * https://github.com/Agoric/agoric-sdk/issues/3434 * @param {O} [options] - * @returns {O['elementShape'] extends TypedPattern + * @returns {O['elementShape'] extends TypedPattern * ? IssuerKit * : IssuerKit} */ diff --git a/packages/ERTP/src/legacy-payment-helpers.js b/packages/ERTP/src/legacy-payment-helpers.js index aa8fa4dfeb7..1ad5fed7403 100644 --- a/packages/ERTP/src/legacy-payment-helpers.js +++ b/packages/ERTP/src/legacy-payment-helpers.js @@ -7,7 +7,7 @@ import { AmountMath } from './amountMath.js'; /** * @import {ERef} from '@endo/far'; - * @import {Key} from '@endo/patterns'; + * @import {Key, Pattern} from '@endo/patterns'; * @import {Amount, AssetKind, Payment, Purse} from './types.js'; */ diff --git a/packages/ERTP/src/paymentLedger.js b/packages/ERTP/src/paymentLedger.js index adc03ce9b7e..9c69196de0c 100644 --- a/packages/ERTP/src/paymentLedger.js +++ b/packages/ERTP/src/paymentLedger.js @@ -12,6 +12,7 @@ import { preparePurseKind } from './purse.js'; import { BrandI, makeIssuerInterfaces } from './typeGuards.js'; /** + * @import {Key, Pattern} from '@endo/patterns'; * @import {Amount, AssetKind, DisplayInfo, PaymentLedger, Payment, Brand, RecoverySetsOption, Purse, Issuer, Mint} from './types.js' * @import {ShutdownWithFailure} from '@agoric/swingset-vat' * @import {TypedPattern} from '@agoric/internal'; diff --git a/packages/ERTP/src/typeGuards.js b/packages/ERTP/src/typeGuards.js index f66267ec0d2..bf11b46ceba 100644 --- a/packages/ERTP/src/typeGuards.js +++ b/packages/ERTP/src/typeGuards.js @@ -4,6 +4,7 @@ import { M, matches, getInterfaceGuardPayload } from '@endo/patterns'; /** * @import {AmountValue, Ratio} from './types.js' * @import {TypedPattern} from '@agoric/internal' + * @import {CopyBag, CopySet, Pattern} from '@endo/patterns'; */ export const BrandShape = M.remotable('Brand'); diff --git a/packages/SwingSet/package.json b/packages/SwingSet/package.json index 0ada049bee5..e56deb58c1d 100644 --- a/packages/SwingSet/package.json +++ b/packages/SwingSet/package.json @@ -100,6 +100,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 76.28 + "atLeast": 76.25 } } diff --git a/packages/agoric-cli/package.json b/packages/agoric-cli/package.json index 388359a3649..ce963c413d7 100644 --- a/packages/agoric-cli/package.json +++ b/packages/agoric-cli/package.json @@ -100,6 +100,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 78.73 + "atLeast": 78.96 } } diff --git a/packages/base-zone/src/is-passable.js b/packages/base-zone/src/is-passable.js index 6a3fe59fbbe..c9ee6e6a88b 100644 --- a/packages/base-zone/src/is-passable.js +++ b/packages/base-zone/src/is-passable.js @@ -1,5 +1,9 @@ import { isPassable as realIsPassable } from '@endo/pass-style'; +/** + * @import {Passable} from '@endo/pass-style'; + */ + /** * @deprecated Import `isPassable` directly from `@endo/pass-style` * @param {any} specimen diff --git a/packages/base-zone/src/types.js b/packages/base-zone/src/types.js index 2adedd5247c..8d9bc9ff205 100644 --- a/packages/base-zone/src/types.js +++ b/packages/base-zone/src/types.js @@ -7,6 +7,7 @@ import { watchPromise } from './watch-promise.js'; export {}; /** + * @import {MapStore, SetStore, StoreOptions, WeakMapStore, WeakSetStore} from '@agoric/store'; * @import {Key} from '@endo/patterns'; * @import {Passable} from '@endo/pass-style'; */ diff --git a/packages/boot/package.json b/packages/boot/package.json index ce638ba3d31..4b5e469ffd8 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -95,6 +95,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 91.27 + "atLeast": 91.39 } } diff --git a/packages/builders/package.json b/packages/builders/package.json index 061d010e903..2f66aac7e13 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -81,6 +81,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 91.57 + "atLeast": 91.55 } } diff --git a/packages/cache/src/cache.js b/packages/cache/src/cache.js index 19412f78261..0fc52317230 100644 --- a/packages/cache/src/cache.js +++ b/packages/cache/src/cache.js @@ -6,6 +6,7 @@ import { makeScalarStoreCoordinator } from './store.js'; /** * @import {Passable, RemotableObject} from '@endo/pass-style'; + * @import {Key, Pattern} from '@endo/patterns'; */ /** diff --git a/packages/cache/src/store.js b/packages/cache/src/store.js index b3700a284e9..8e1f7c051ba 100644 --- a/packages/cache/src/store.js +++ b/packages/cache/src/store.js @@ -4,7 +4,11 @@ import { matches, makeScalarMapStore } from '@agoric/store'; import { makeScalarBigMapStore } from '@agoric/vat-data'; import { untilTrue } from '@agoric/internal'; import { withGroundState, makeState } from './state.js'; -/** @import {Passable} from '@endo/pass-style' */ + +/** + * @import {Passable, RemotableObject} from '@endo/pass-style'; + * @import {Key, Pattern} from '@endo/patterns'; + */ /** * @param {(obj: Passable) => Passable} [sanitize] diff --git a/packages/cache/src/types.js b/packages/cache/src/types.js index e4e2a2aa543..526a2163065 100644 --- a/packages/cache/src/types.js +++ b/packages/cache/src/types.js @@ -10,6 +10,7 @@ export {}; /** * @import { ERef } from '@endo/far' * @import {Passable} from '@endo/pass-style' + * @import {Key, Pattern} from '@endo/patterns'; */ /** diff --git a/packages/cosmic-proto/package.json b/packages/cosmic-proto/package.json index f605deb0432..f96a8d4d97d 100644 --- a/packages/cosmic-proto/package.json +++ b/packages/cosmic-proto/package.json @@ -173,7 +173,7 @@ "ava": "^5.3.1", "rimraf": "^5.0.0", "tsd": "^0.31.1", - "typescript": "~5.8.1-rc" + "typescript": "~5.8.2" }, "dependencies": { "@endo/base64": "^1.0.9", diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json index bc956d07a06..b1ae9428677 100644 --- a/packages/cosmic-swingset/package.json +++ b/packages/cosmic-swingset/package.json @@ -53,11 +53,9 @@ }, "devDependencies": { "@agoric/kmarshal": "^0.1.0", - "@endo/eventual-send": "^1.2.8", "ava": "^5.3.0", "better-sqlite3": "^9.1.1", - "c8": "^10.1.2", - "ses": "^1.10.0" + "c8": "^10.1.2" }, "publishConfig": { "access": "public" @@ -75,6 +73,6 @@ "timeout": "20m" }, "typeCoverage": { - "atLeast": 83.4 + "atLeast": 84.13 } } diff --git a/packages/deploy-script-support/package.json b/packages/deploy-script-support/package.json index 36b6fbf2933..6361d6b27df 100644 --- a/packages/deploy-script-support/package.json +++ b/packages/deploy-script-support/package.json @@ -72,6 +72,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 83.71 + "atLeast": 83.92 } } diff --git a/packages/deploy-script-support/src/depositInvitation.js b/packages/deploy-script-support/src/depositInvitation.js index 6f02dd82c99..fc6a491b365 100644 --- a/packages/deploy-script-support/src/depositInvitation.js +++ b/packages/deploy-script-support/src/depositInvitation.js @@ -1,6 +1,10 @@ // @ts-check import { E } from '@endo/far'; +/** + * @import {InvitationDetails} from '@agoric/zoe'; + */ + /** * @param {ERef} zoeInvitationPurse */ diff --git a/packages/deploy-script-support/src/offer.js b/packages/deploy-script-support/src/offer.js index 2307988735d..c276716b4e6 100644 --- a/packages/deploy-script-support/src/offer.js +++ b/packages/deploy-script-support/src/offer.js @@ -4,7 +4,10 @@ import { E } from '@endo/far'; // Avoid pulling in too many dependencies like notifiers import { AmountMath } from '@agoric/ertp/src/amountMath.js'; -/** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */ +/** + * @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js'; + * @import {InvitationDetails, Proposal} from '@agoric/zoe'; + */ /** * @typedef {object} OfferHelperConfig diff --git a/packages/fast-usdc/test/exos/settler.test.ts b/packages/fast-usdc/test/exos/settler.test.ts index bd14fa738e8..a8fd16809d8 100644 --- a/packages/fast-usdc/test/exos/settler.test.ts +++ b/packages/fast-usdc/test/exos/settler.test.ts @@ -11,6 +11,7 @@ import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js'; import { buildVTransferEvent } from '@agoric/orchestration/tools/ibc-mocks.js'; import type { Zone } from '@agoric/zone'; import type { EReturn } from '@endo/far'; +import type { ZcfSeatKit } from '@agoric/zoe'; import { PendingTxStatus, TxStatus } from '../../src/constants.js'; import { prepareSettler, diff --git a/packages/governance/package.json b/packages/governance/package.json index 1a9b695a017..0d4830de831 100644 --- a/packages/governance/package.json +++ b/packages/governance/package.json @@ -76,6 +76,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 89.48 + "atLeast": 89.54 } } diff --git a/packages/governance/src/binaryVoteCounter.js b/packages/governance/src/binaryVoteCounter.js index 076fd27adb3..4812dbd3239 100644 --- a/packages/governance/src/binaryVoteCounter.js +++ b/packages/governance/src/binaryVoteCounter.js @@ -19,6 +19,7 @@ import { makeQuorumCounter } from './quorumCounter.js'; /** * @import {MapStore} from '@agoric/swingset-liveslots'; + * @import {ZCF} from '@agoric/zoe'; * @import {BuildVoteCounter, OutcomeRecord, Position, QuestionSpec, VoteStatistics} from './types.js'; */ diff --git a/packages/governance/src/committee.js b/packages/governance/src/committee.js index 90ae66dfc05..790cfb58716 100644 --- a/packages/governance/src/committee.js +++ b/packages/governance/src/committee.js @@ -17,6 +17,7 @@ import { prepareVoterKit } from './voterKit.js'; /** * @import {MapStore} from '@agoric/swingset-liveslots'; + * @import {ContractMeta, Invitation, ZCF} from '@agoric/zoe'; * @import {ElectorateCreatorFacet, CommitteeElectoratePublic, QuestionDetails, OutcomeRecord, AddQuestion} from './types.js'; */ diff --git a/packages/governance/src/contractGovernance/governApi.js b/packages/governance/src/contractGovernance/governApi.js index b737825b615..e8d90068544 100644 --- a/packages/governance/src/contractGovernance/governApi.js +++ b/packages/governance/src/contractGovernance/governApi.js @@ -11,6 +11,7 @@ import { } from '../question.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {Passable, RemotableObject} from '@endo/pass-style'; * @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation, GovernedApis} from '../types.js'; */ diff --git a/packages/governance/src/contractGovernance/governFilter.js b/packages/governance/src/contractGovernance/governFilter.js index 293f6dc65e9..91bb099dfb1 100644 --- a/packages/governance/src/contractGovernance/governFilter.js +++ b/packages/governance/src/contractGovernance/governFilter.js @@ -11,6 +11,7 @@ import { } from '../question.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {Position, ApiGovernor, ApiInvocationIssue, PoserFacet, VoteOnApiInvocation, FilterGovernor, GovernedCreatorFacet, OfferFilterIssue, VoteOnOfferFilter} from '../types.js'; */ diff --git a/packages/governance/src/contractGovernance/governParam.js b/packages/governance/src/contractGovernance/governParam.js index 3e9a707d9b0..fc455c22732 100644 --- a/packages/governance/src/contractGovernance/governParam.js +++ b/packages/governance/src/contractGovernance/governParam.js @@ -12,6 +12,7 @@ import { import { ParamChangesQuestionDetailsShape } from '../typeGuards.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {ParamValue, ParamChangePositions, QuestionSpec, ChangeParamsPosition, ParamChangeIssue, ParamGovernor, ParamManagerRetriever, PoserFacet, VoteOnParamChanges} from '../types.js'; */ diff --git a/packages/governance/src/contractGovernance/paramManager.js b/packages/governance/src/contractGovernance/paramManager.js index 08370b58ef2..bac56257977 100644 --- a/packages/governance/src/contractGovernance/paramManager.js +++ b/packages/governance/src/contractGovernance/paramManager.js @@ -20,6 +20,7 @@ import { CONTRACT_ELECTORATE } from './governParam.js'; /** * @import {MapStore} from '@agoric/swingset-liveslots'; + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {AnyParamManager, GovernanceSubscriptionState, ParamManagerBase, ParamStateRecord, ParamValueTyped, UpdateParams} from '../types.js'; */ diff --git a/packages/governance/src/contractGovernance/typedParamManager.js b/packages/governance/src/contractGovernance/typedParamManager.js index ecd80d844f4..a86bf76db0a 100644 --- a/packages/governance/src/contractGovernance/typedParamManager.js +++ b/packages/governance/src/contractGovernance/typedParamManager.js @@ -5,6 +5,7 @@ import { CONTRACT_ELECTORATE } from './governParam.js'; import { makeParamManagerBuilder } from './paramManager.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, GovernanceSubscriptionState, GovernanceTerms, ParamManagerBase, ParamStateRecord, ParamValueForType, UpdateParams} from '../types.js'; * @import {ParamType} from '../constants.js'; */ diff --git a/packages/governance/src/contractGovernor.js b/packages/governance/src/contractGovernor.js index 594d17aa28a..1c09d4373d0 100644 --- a/packages/governance/src/contractGovernor.js +++ b/packages/governance/src/contractGovernor.js @@ -9,6 +9,7 @@ import { prepareContractGovernorKit } from './contractGovernorKit.js'; import { ParamChangesQuestionDetailsShape } from './typeGuards.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {GovernableStartFn, GovernorCreatorFacet, GovernorPublic, ParamChangeIssueDetails} from './types.js'; */ @@ -62,6 +63,7 @@ export const validateQuestionFromCounter = async ( electorate, voteCounter, ) => { + /** @type {Promise} */ const counterPublicP = E(zoe).getPublicFacet(voteCounter); const questionDetails = await E(counterPublicP).getDetails(); diff --git a/packages/governance/src/contractGovernorKit.js b/packages/governance/src/contractGovernorKit.js index 2f903dd39f2..13958bb4388 100644 --- a/packages/governance/src/contractGovernorKit.js +++ b/packages/governance/src/contractGovernorKit.js @@ -18,6 +18,7 @@ import { ClosingRuleShape, ParamChangesSpecShape } from './typeGuards.js'; /** * @import {EReturn} from '@endo/far'; + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {ClosingRule, GovernableStartFn, LimitedCF, PoserFacet, VoteOnApiInvocation, VoteOnOfferFilter, VoteOnParamChanges} from './types.js'; */ diff --git a/packages/governance/src/contractHelper.js b/packages/governance/src/contractHelper.js index 7f5725d8de2..9453840fd43 100644 --- a/packages/governance/src/contractHelper.js +++ b/packages/governance/src/contractHelper.js @@ -12,6 +12,7 @@ import { GovernorFacetShape } from './typeGuards.js'; import { CONTRACT_ELECTORATE } from './contractGovernance/governParam.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, GovernanceSubscriptionState, GovernanceTerms, GovernedApis, GovernedCreatorFacet, GovernedPublicFacet} from './types.js'; * @import {Baggage} from '@agoric/vat-data'; */ diff --git a/packages/governance/src/electorateTools.js b/packages/governance/src/electorateTools.js index 43d625c1b72..1e43189547b 100644 --- a/packages/governance/src/electorateTools.js +++ b/packages/governance/src/electorateTools.js @@ -4,6 +4,7 @@ import { deeplyFulfilled, Far } from '@endo/marshal'; /** * @import {MapStore} from '@agoric/swingset-liveslots'; + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn} from './types.js'; */ diff --git a/packages/governance/src/multiCandidateVoteCounter.js b/packages/governance/src/multiCandidateVoteCounter.js index a14cb430566..d1a5075ddbe 100644 --- a/packages/governance/src/multiCandidateVoteCounter.js +++ b/packages/governance/src/multiCandidateVoteCounter.js @@ -20,6 +20,7 @@ import { breakTie } from './breakTie.js'; /** * @import {MapStore} from '@agoric/swingset-liveslots'; + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {QuestionSpec, BuildMultiVoteCounter, MultiOutcomeRecord, Position, VoteStatistics} from './types.js'; */ diff --git a/packages/governance/src/noActionElectorate.js b/packages/governance/src/noActionElectorate.js index cfde5182e46..55733673976 100644 --- a/packages/governance/src/noActionElectorate.js +++ b/packages/governance/src/noActionElectorate.js @@ -6,6 +6,7 @@ import { EmptyProposalShape } from '@agoric/zoe/src/typeGuards.js'; import { ElectoratePublicI, ElectorateCreatorI } from './typeGuards.js'; /** + * @import {ContractMeta, ContractStartFn, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {ElectoratePublic, ElectorateCreatorFacet} from './types.js'; */ diff --git a/packages/governance/src/types.js b/packages/governance/src/types.js index 10ee04bfde5..f1362c29917 100644 --- a/packages/governance/src/types.js +++ b/packages/governance/src/types.js @@ -3,6 +3,9 @@ export {}; /** * @import {Guarded} from '@endo/exo'; * @import {Passable, Container} from '@endo/pass-style'; + * @import {Publisher} from '@agoric/notifier'; + * @import {AdminFacet, InstallationStart, InvitationAmount} from '@agoric/zoe'; + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {ContractStartFunction} from '@agoric/zoe/src/zoeService/utils.js'; */ @@ -550,7 +553,7 @@ export {}; /** * @typedef {object} ContractGovernanceVoteResult - * @property {Instance} instance - instance of the VoteCounter + * @property {Instance<((zcf: ZCF<{questionSpec: QuestionSpec, quorumThreshold: bigint }>, { outcomePublisher }: { outcomePublisher: Publisher; }) => {publicFacet: VoteCounterPublicFacet, creatorFacet: VoteCounterCreatorFacet})>} instance - instance of the VoteCounter * @property {ERef} details * @property {Promise} outcomeOfUpdate - A promise for the result * of updating the parameter value. Primarily useful for its behavior on @@ -687,7 +690,7 @@ export {}; * * @param {ERef} zoe * @param {import('@agoric/zoe/src/zoeService/utils.js').Instance<(zcf: ZCF>) => {}>} allegedGoverned - * @param {Instance} allegedGovernor + * @param {Instance<(zcf) => {publicFacet: GovernorPublic}>} allegedGovernor * @param {Installation} contractGovernorInstallation * @returns {Promise} */ @@ -697,7 +700,7 @@ export {}; * electorate * * @param {ERef} zoe - * @param {Instance} allegedGovernor + * @param {Instance<(zcf) => {publicFacet: GovernorPublic}>} allegedGovernor * @param {Instance} allegedElectorate * @returns {Promise} */ diff --git a/packages/governance/src/validators.js b/packages/governance/src/validators.js index 4d626944c46..1a3e7b38898 100644 --- a/packages/governance/src/validators.js +++ b/packages/governance/src/validators.js @@ -27,6 +27,7 @@ const assertContractGovernance = async ( await Promise.all([allegedGovernedTermsP, realGovernedP]); assert( + // @ts-expect-error XXX types allegedGovernor === realGovernorInstance, 'The alleged governor did not match the governor retrieved from the governed contract', ); diff --git a/packages/governance/src/voterKit.js b/packages/governance/src/voterKit.js index 7dea9b257ba..ea04bc0d93f 100644 --- a/packages/governance/src/voterKit.js +++ b/packages/governance/src/voterKit.js @@ -4,6 +4,7 @@ import { E } from '@endo/eventual-send'; import { PositionShape, QuestionHandleShape } from './typeGuards.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {VoteCounterCreatorFacet, VoteCounterPublicFacet, QuestionSpec, OutcomeRecord, AddQuestion, AddQuestionReturn, CompletedBallet, Position} from './types.js'; */ diff --git a/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js b/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js index d817520ed99..ad7695b296d 100644 --- a/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js +++ b/packages/governance/test/swingsetTests/committeeBinary/vat-voter.js @@ -73,6 +73,7 @@ const build = async (log, zoe) => { }); }, createMultiVoter: async (name, invitation, choices) => { + /** @type {any} */ const electorateInstance = await E(zoe).getInstance(invitation); /** @type {Promise} electoratePublicFacet */ const electoratePublicFacet = E(zoe).getPublicFacet(electorateInstance); diff --git a/packages/governance/tools/puppetContractGovernor.js b/packages/governance/tools/puppetContractGovernor.js index 0ad9aa3e07b..5f3e7182f1c 100644 --- a/packages/governance/tools/puppetContractGovernor.js +++ b/packages/governance/tools/puppetContractGovernor.js @@ -8,6 +8,7 @@ import { makeApiInvocationPositions } from '../src/contractGovernance/governApi. /** * @import {Passable, RemotableObject} from '@endo/pass-style'; + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {GovernableStartFn, ParamChangesSpec} from '../src/types.js'; */ diff --git a/packages/governance/tools/puppetGovernance.js b/packages/governance/tools/puppetGovernance.js index 64f5bee7e5d..c77c2122c31 100644 --- a/packages/governance/tools/puppetGovernance.js +++ b/packages/governance/tools/puppetGovernance.js @@ -4,6 +4,7 @@ import { resolve as importMetaResolve } from 'import-meta-resolve'; import { CONTRACT_ELECTORATE, ParamTypes } from '../src/index.js'; /** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; * @import {GovernableStartFn} from '../src/types.js'; */ diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index 664e8f735df..b1f9ace5ddd 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -82,6 +82,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 95.62 + "atLeast": 95.68 } } diff --git a/packages/inter-protocol/src/auction/auctioneer.js b/packages/inter-protocol/src/auction/auctioneer.js index a09589c9a7e..b16c1b97cfd 100644 --- a/packages/inter-protocol/src/auction/auctioneer.js +++ b/packages/inter-protocol/src/auction/auctioneer.js @@ -37,6 +37,7 @@ import { AuctionState } from './util.js'; /** * @import {TypedPattern} from '@agoric/internal'; * @import {Baggage} from '@agoric/vat-data'; + * @import {AdminFacet, ContractOf, InvitationAmount} from '@agoric/zoe'; * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */ diff --git a/packages/inter-protocol/src/auction/offerBook.js b/packages/inter-protocol/src/auction/offerBook.js index 2d98415531c..2e273a90447 100644 --- a/packages/inter-protocol/src/auction/offerBook.js +++ b/packages/inter-protocol/src/auction/offerBook.js @@ -12,7 +12,10 @@ import { toScaledRateOfferKey, } from './sortedOffers.js'; -/** @import {Baggage} from '@agoric/vat-data' */ +/** + * @import {Baggage} from '@agoric/vat-data'; + * @import {Key, Pattern} from '@endo/patterns'; + */ // multiple offers might be provided at the same time (since the time // granularity is limited to blocks), so we increment a sequenceNumber with each diff --git a/packages/inter-protocol/src/auction/util.js b/packages/inter-protocol/src/auction/util.js index 2dc76cffbe4..257c64a7989 100644 --- a/packages/inter-protocol/src/auction/util.js +++ b/packages/inter-protocol/src/auction/util.js @@ -7,7 +7,10 @@ import { } from '@agoric/zoe/src/contractSupport/index.js'; import { Far } from '@endo/marshal'; -/** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */ +/** + * @import {Key, Pattern} from '@endo/patterns'; + * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; + */ /** * Constants for Auction State. diff --git a/packages/inter-protocol/src/clientSupport.js b/packages/inter-protocol/src/clientSupport.js index 58c92353f80..5f9bf94b0b9 100644 --- a/packages/inter-protocol/src/clientSupport.js +++ b/packages/inter-protocol/src/clientSupport.js @@ -5,6 +5,10 @@ import { AmountMath } from '@agoric/ertp'; import { assertAllDefined } from '@agoric/internal'; import { parseRatio } from '@agoric/zoe/src/contractSupport/ratio.js'; +/** + * @import {Proposal} from '@agoric/zoe'; + */ + // XXX support other decimal places const COSMOS_UNIT = 1_000_000n; const scaleDecimals = num => BigInt(num * Number(COSMOS_UNIT)); diff --git a/packages/inter-protocol/src/interest.js b/packages/inter-protocol/src/interest.js index 7faf77615df..d0504eeba9c 100644 --- a/packages/inter-protocol/src/interest.js +++ b/packages/inter-protocol/src/interest.js @@ -13,6 +13,7 @@ import { TimeMath } from '@agoric/time'; /** * @import {Timestamp} from '@agoric/time' * @import {RelativeTime} from '@agoric/time' + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; */ export const SECONDS_PER_YEAR = 60n * 60n * 24n * 365n; diff --git a/packages/inter-protocol/src/proposals/econ-behaviors.js b/packages/inter-protocol/src/proposals/econ-behaviors.js index a90744fca9a..8303865bd3a 100644 --- a/packages/inter-protocol/src/proposals/econ-behaviors.js +++ b/packages/inter-protocol/src/proposals/econ-behaviors.js @@ -10,7 +10,10 @@ import { makeGovernedTerms as makeGovernedATerms } from '../auction/params.js'; import { makeReserveTerms } from '../reserve/params.js'; import { makeGovernedTerms as makeGovernedVFTerms } from '../vaultFactory/params.js'; -/** @import {StartedInstanceKit} from '@agoric/zoe/src/zoeService/utils.js' */ +/** + * @import {StartedInstanceKit} from '@agoric/zoe/src/zoeService/utils.js'; + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; + */ const trace = makeTracer('RunEconBehaviors', true); @@ -25,8 +28,10 @@ export const SECONDS_PER_WEEK = 7n * SECONDS_PER_DAY; /** * @typedef {object} PSMKit * @property {string} label - * @property {Instance} psm - * @property {Instance} psmGovernor + * @property {Instance} psm + * @property {Instance< + * import('../../../governance/src/contractGovernor.js').start + * >} psmGovernor * @property {Awaited< * ReturnType< * Awaited< diff --git a/packages/inter-protocol/src/proposals/upgrade-vaults.js b/packages/inter-protocol/src/proposals/upgrade-vaults.js index b92961d871f..91decce1243 100644 --- a/packages/inter-protocol/src/proposals/upgrade-vaults.js +++ b/packages/inter-protocol/src/proposals/upgrade-vaults.js @@ -55,10 +55,10 @@ export const upgradeVaults = async ( await priceAuthority8400; + /** @type {Instance} */ const auctionNewInstance = await auctionUpgradeNewInstance; auctionUpgradeNewInstanceProducer.reset(); const publicFacet = E(zoe).getPublicFacet(auctionNewInstance); - /** @type {import('@agoric/inter-protocol/src/auction/scheduler.js').FullSchedule} */ const schedules = await E(publicFacet).getSchedules(); const now = await E(chainTimerService).getCurrentTimestamp(); (schedules.nextAuctionSchedule && @@ -97,7 +97,6 @@ export const upgradeVaults = async ( for (const kwd of Object.keys(vaultBrands)) { const collateralBrand = vaultBrands[kwd]; - /** @type {any} */ const governedParams = await E(directorPF).getGovernedParams({ collateralBrand, }); diff --git a/packages/inter-protocol/src/provisionPool.js b/packages/inter-protocol/src/provisionPool.js index ee002f1a011..e0f4068bab1 100644 --- a/packages/inter-protocol/src/provisionPool.js +++ b/packages/inter-protocol/src/provisionPool.js @@ -18,7 +18,10 @@ import { prepareProvisionPoolKit, } from './provisionPoolKit.js'; -/** @import {Marshal} from '@endo/marshal'; */ +/** + * @import {Marshal} from '@endo/marshal'; + * @import {ContractMeta, Invitation, ZCF} from '@agoric/zoe'; + */ /** @type {ContractMeta} */ export const meta = { diff --git a/packages/inter-protocol/src/provisionPoolKit.js b/packages/inter-protocol/src/provisionPoolKit.js index 3c5b5550cc7..33dc758c8b1 100644 --- a/packages/inter-protocol/src/provisionPoolKit.js +++ b/packages/inter-protocol/src/provisionPoolKit.js @@ -25,6 +25,7 @@ import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js'; /** * @import {BridgeMessage} from '@agoric/cosmic-swingset/src/types.js'; + * @import {ZCF} from '@agoric/zoe'; */ const trace = makeTracer('ProvPool'); diff --git a/packages/inter-protocol/src/psm/psm.js b/packages/inter-protocol/src/psm/psm.js index 3cc734f96b5..c0d531f3540 100644 --- a/packages/inter-protocol/src/psm/psm.js +++ b/packages/inter-protocol/src/psm/psm.js @@ -45,6 +45,7 @@ import { makeNatAmountShape } from '../contractSupport.js'; /** * @import {EReturn} from '@endo/far'; + * @import {ContractMeta, FeeMintAccess, Installation} from '@agoric/zoe'; */ /** diff --git a/packages/inter-protocol/src/reserve/assetReserve.js b/packages/inter-protocol/src/reserve/assetReserve.js index 53df26aaccf..1bfd563ccbf 100644 --- a/packages/inter-protocol/src/reserve/assetReserve.js +++ b/packages/inter-protocol/src/reserve/assetReserve.js @@ -10,6 +10,7 @@ import { prepareAssetReserveKit } from './assetReserveKit.js'; /** * @import {EReturn} from '@endo/far'; + * @import {ContractMeta, FeeMintAccess, Installation} from '@agoric/zoe'; */ const trace = makeTracer('AR', true); diff --git a/packages/inter-protocol/src/reserve/assetReserveKit.js b/packages/inter-protocol/src/reserve/assetReserveKit.js index 122335644ac..1105afec361 100644 --- a/packages/inter-protocol/src/reserve/assetReserveKit.js +++ b/packages/inter-protocol/src/reserve/assetReserveKit.js @@ -16,6 +16,7 @@ const trace = makeTracer('ReserveKit', true); /** * @import {EReturn} from '@endo/far'; * @import {TypedPattern} from '@agoric/internal'; + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; */ /** diff --git a/packages/inter-protocol/src/reserve/params.js b/packages/inter-protocol/src/reserve/params.js index f7e8aa2eac5..bec990a3669 100644 --- a/packages/inter-protocol/src/reserve/params.js +++ b/packages/inter-protocol/src/reserve/params.js @@ -2,6 +2,10 @@ import { CONTRACT_ELECTORATE, ParamTypes } from '@agoric/governance'; +/** + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; + */ + /** * @param {InvitationAmount} poserInvitationAmount */ diff --git a/packages/inter-protocol/src/vaultFactory/types-ambient.js b/packages/inter-protocol/src/vaultFactory/types-ambient.js index cc6cdd0fe7e..64e256337c6 100644 --- a/packages/inter-protocol/src/vaultFactory/types-ambient.js +++ b/packages/inter-protocol/src/vaultFactory/types-ambient.js @@ -96,7 +96,10 @@ /** * @typedef {object} LiquidationStrategy * @property {() => KeywordKeywordRecord} keywordMapping - * @property {(collateral: Amount, run: Amount) => Proposal} makeProposal + * @property {( + * collateral: Amount, + * run: Amount, + * ) => import('@agoric/zoe').Proposal} makeProposal * @property {(debt: Amount) => Promise} makeInvitation */ diff --git a/packages/inter-protocol/src/vaultFactory/vaultDirector.js b/packages/inter-protocol/src/vaultFactory/vaultDirector.js index 2bd52ebc0c4..00ad4010d7e 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultDirector.js +++ b/packages/inter-protocol/src/vaultFactory/vaultDirector.js @@ -40,6 +40,7 @@ import { } from './vaultManager.js'; /** + * @import {ContractMeta, ContractStartFn, HandleOffer, Invitation, OfferHandler, TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe'; * @import {EReturn} from '@endo/far'; * @import {TypedPattern} from '@agoric/internal'; */ diff --git a/packages/inter-protocol/src/vaultFactory/vaultFactory.js b/packages/inter-protocol/src/vaultFactory/vaultFactory.js index b2d27dca2f6..fa0cadcf17f 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultFactory.js +++ b/packages/inter-protocol/src/vaultFactory/vaultFactory.js @@ -29,7 +29,10 @@ import { InvitationShape } from '../auction/params.js'; import { SHORTFALL_INVITATION_KEY, vaultDirectorParamTypes } from './params.js'; import { provideDirector } from './vaultDirector.js'; -/** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */ +/** + * @import {ContractMeta, ContractOf, FeeMintAccess, HandleOffer, Invitation, OfferHandler, TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe'; + * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; + */ const trace = makeTracer('VF', true); @@ -69,7 +72,7 @@ harden(meta); * initialShortfallInvitation: Invitation; * storageNode: ERef; * marshaller: ERef; - * auctioneerInstance: Instance; + * auctioneerInstance: Instance; * managerParams: Record< * string, * import('./params.js').VaultManagerParamOverrides diff --git a/packages/inter-protocol/src/vaultFactory/vaultHolder.js b/packages/inter-protocol/src/vaultFactory/vaultHolder.js index 567849ae3e0..4531b32e7b9 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultHolder.js +++ b/packages/inter-protocol/src/vaultFactory/vaultHolder.js @@ -5,6 +5,10 @@ import { M, prepareExoClassKit } from '@agoric/vat-data'; import { TopicsRecordShape } from '@agoric/zoe/src/contractSupport/index.js'; import { UnguardedHelperI } from '@agoric/internal/src/typeGuards.js'; +/** + * @import {Key, Pattern} from '@endo/patterns'; + */ + /** * @typedef {{ * topicKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit; diff --git a/packages/inter-protocol/src/vaultFactory/vaultManager.js b/packages/inter-protocol/src/vaultFactory/vaultManager.js index 6181f852a90..42df2d7d33d 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultManager.js +++ b/packages/inter-protocol/src/vaultFactory/vaultManager.js @@ -67,6 +67,7 @@ import { AuctionPFShape } from '../auction/auctioneer.js'; /** * @import {EReturn} from '@endo/far'; + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */ diff --git a/packages/inter-protocol/test/auction/auctionContract.test.js b/packages/inter-protocol/test/auction/auctionContract.test.js index 95ff406c4e8..6f245ad1636 100644 --- a/packages/inter-protocol/test/auction/auctionContract.test.js +++ b/packages/inter-protocol/test/auction/auctionContract.test.js @@ -39,7 +39,10 @@ import { setUpInstallations } from './tools.js'; /** @type {import('ava').TestFn>>} */ const test = anyTest; -/** @import {AmountUtils} from '@agoric/zoe/tools/test-utils.js'; */ +/** + * @import {AmountUtils} from '@agoric/zoe/tools/test-utils.js' + * @import {ExitRule} from '@agoric/zoe'; + */ /** * @typedef {Record & { diff --git a/packages/inter-protocol/test/supports.js b/packages/inter-protocol/test/supports.js index de0e179b0dc..da6cebe2497 100644 --- a/packages/inter-protocol/test/supports.js +++ b/packages/inter-protocol/test/supports.js @@ -18,7 +18,10 @@ import { buildZoeManualTimer } from '@agoric/zoe/tools/manualTimer.js'; import { setUpZoeForTest as generalSetUpZoeForTest } from '@agoric/zoe/tools/setup-zoe.js'; import { E } from '@endo/far'; -/** @import {EconomyBootstrapPowers as Space} from '../src/proposals/econ-behaviors.js' */ +/** + * @import {SourceBundle} from '@agoric/zoe'; + * @import {EconomyBootstrapPowers as Space} from '../src/proposals/econ-behaviors.js' + */ export { makeMockChainStorageRoot }; diff --git a/packages/internal/package.json b/packages/internal/package.json index 65ebb7b7ab8..3a05a12ee48 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -59,6 +59,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.04 + "atLeast": 92.65 } } diff --git a/packages/internal/src/config.js b/packages/internal/src/config.js index 119dc467e16..2a05de87f21 100644 --- a/packages/internal/src/config.js +++ b/packages/internal/src/config.js @@ -31,10 +31,12 @@ export const BridgeId = /** @type {const} */ ({ }); harden(BridgeId); +/** @satisfies {Record} */ export const CosmosInitKeyToBridgeId = { - vbankPort: BridgeId.BANK, - vibcPort: BridgeId.DIBC, + vbankPort: 'bank', + vibcPort: 'dibc', }; +harden(CosmosInitKeyToBridgeId); export const WalletName = /** @type {const} */ ({ depositFacet: 'depositFacet', diff --git a/packages/notifier/package.json b/packages/notifier/package.json index dad2c76c807..5b6b58e8019 100644 --- a/packages/notifier/package.json +++ b/packages/notifier/package.json @@ -76,6 +76,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 90.77 + "atLeast": 90.9 } } diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json index e847077274e..6a87081605d 100644 --- a/packages/orchestration/package.json +++ b/packages/orchestration/package.json @@ -95,6 +95,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 97.77 + "atLeast": 97.84 } } diff --git a/packages/orchestration/src/examples/auto-stake-it.contract.js b/packages/orchestration/src/examples/auto-stake-it.contract.js index 667a6ebc72f..31d6f128e6d 100644 --- a/packages/orchestration/src/examples/auto-stake-it.contract.js +++ b/packages/orchestration/src/examples/auto-stake-it.contract.js @@ -14,6 +14,7 @@ import { registerChainsAndAssets } from '../utils/chain-hub-helper.js'; * @import {Zone} from '@agoric/zone'; * @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js'; * @import {CosmosChainInfo, Denom, DenomDetail} from '../types.js'; + * @import {ZCF} from '@agoric/zoe'; */ /** diff --git a/packages/orchestration/src/examples/basic-flows.contract.js b/packages/orchestration/src/examples/basic-flows.contract.js index cef9b27c4e9..7ddfe8543f9 100644 --- a/packages/orchestration/src/examples/basic-flows.contract.js +++ b/packages/orchestration/src/examples/basic-flows.contract.js @@ -12,6 +12,7 @@ import * as flows from './basic-flows.flows.js'; /** * @import {Zone} from '@agoric/zone'; * @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration'; + * @import {ZCF} from '@agoric/zoe'; * @import {OrchestrationPowers, OrchestrationTools} from '../utils/start-helper.js'; */ diff --git a/packages/orchestration/src/examples/send-anywhere.flows.js b/packages/orchestration/src/examples/send-anywhere.flows.js index 6022fcb40f1..dea3b6da4b7 100644 --- a/packages/orchestration/src/examples/send-anywhere.flows.js +++ b/packages/orchestration/src/examples/send-anywhere.flows.js @@ -4,6 +4,7 @@ import { M, mustMatch } from '@endo/patterns'; /** * @import {GuestInterface, GuestOf} from '@agoric/async-flow'; + * @import {Invitation, ZCF, ZCFSeat} from '@agoric/zoe'; * @import {Vow} from '@agoric/vow'; * @import {LocalOrchestrationAccountKit} from '../exos/local-orchestration-account.js'; * @import {ZoeTools} from '../utils/zoe-tools.js'; diff --git a/packages/orchestration/src/examples/stake-bld.contract.js b/packages/orchestration/src/examples/stake-bld.contract.js index db657e1235c..9af9bdab21c 100644 --- a/packages/orchestration/src/examples/stake-bld.contract.js +++ b/packages/orchestration/src/examples/stake-bld.contract.js @@ -19,6 +19,7 @@ import { makeZoeTools } from '../utils/zoe-tools.js'; * @import {Remote} from '@agoric/internal'; * @import {TimerService} from '@agoric/time'; * @import {LocalChain} from '@agoric/vats/src/localchain.js'; + * @import {ZCF} from '@agoric/zoe'; */ const trace = makeTracer('StakeBld'); @@ -112,7 +113,8 @@ export const start = async (zcf, privateArgs, baggage) => { trace('makeStakeBldInvitation', give); const { holder } = await makeLocalAccountKit(); /** @type {Record>} */ - // @ts-expect-error XXX PaymentPKeywordRecord throught deeplyFulfilled will be a PaymnentKeywordRecord + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- fails only through some build paths + // @ts-ignore XXX PaymentPKeywordRecord, though after deeplyFulfilled it will be a PaymentKeywordRecord const { In } = await deeplyFulfilled( withdrawFromSeat(zcf, seat, give), ); diff --git a/packages/orchestration/src/examples/stake-ica.contract.js b/packages/orchestration/src/examples/stake-ica.contract.js index 82a0d0e54a6..89f0ba79b8c 100644 --- a/packages/orchestration/src/examples/stake-ica.contract.js +++ b/packages/orchestration/src/examples/stake-ica.contract.js @@ -17,6 +17,7 @@ const trace = makeTracer('StakeIca'); /** * @import {Baggage} from '@agoric/vat-data'; * @import {Remote} from '@agoric/internal'; + * @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe'; * @import {IBCConnectionID, NameHub} from '@agoric/vats'; * @import {TimerService} from '@agoric/time'; * @import {ResolvedContinuingOfferResult} from '../utils/zoe-tools.js'; diff --git a/packages/orchestration/src/examples/staking-combinations.contract.js b/packages/orchestration/src/examples/staking-combinations.contract.js index cdd537be2ff..e75877a8770 100644 --- a/packages/orchestration/src/examples/staking-combinations.contract.js +++ b/packages/orchestration/src/examples/staking-combinations.contract.js @@ -17,6 +17,7 @@ import { prepareChainHubAdmin } from '../exos/chain-hub-admin.js'; /** * @import {GuestInterface} from '@agoric/async-flow'; + * @import {ContractMeta, Invitation, ZCF, ZCFSeat} from '@agoric/zoe'; * @import {Zone} from '@agoric/zone'; * @import {OrchestrationTools, OrchestrationPowers} from '../utils/start-helper.js'; * @import {CosmosOrchestrationAccount} from '../exos/cosmos-orchestration-account.js'; diff --git a/packages/orchestration/src/exos/cosmos-orchestration-account.js b/packages/orchestration/src/exos/cosmos-orchestration-account.js index eb495d115f1..72811216245 100644 --- a/packages/orchestration/src/exos/cosmos-orchestration-account.js +++ b/packages/orchestration/src/exos/cosmos-orchestration-account.js @@ -68,6 +68,7 @@ import { makeTimestampHelper } from '../utils/time.js'; /** * @import {HostOf} from '@agoric/async-flow'; * @import {AmountArg, IcaAccount, CosmosChainAddress, CosmosValidatorAddress, ICQConnection, StakingAccountActions, StakingAccountQueries, OrchestrationAccountCommon, CosmosRewardsResponse, IBCConnectionInfo, IBCMsgTransferOptions, ChainHub, CosmosDelegationResponse} from '../types.js'; + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; * @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'; * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js'; * @import {Remote} from '@agoric/internal'; diff --git a/packages/orchestration/src/exos/ibc-packet.js b/packages/orchestration/src/exos/ibc-packet.js index dd25ac55fa9..5eb6dbc1a68 100644 --- a/packages/orchestration/src/exos/ibc-packet.js +++ b/packages/orchestration/src/exos/ibc-packet.js @@ -7,6 +7,7 @@ import { E } from '@endo/far'; export const ICS20_TRANSFER_SUCCESS_RESULT = 'AQ=='; /** + * @import {Key, Pattern} from '@endo/patterns'; * @import {JsonSafe, TypedJson, ResponseTo} from '@agoric/cosmic-proto'; * @import {Vow, VowTools} from '@agoric/vow'; * @import {LocalChainAccount} from '@agoric/vats/src/localchain.js'; diff --git a/packages/orchestration/src/exos/local-orchestration-account.js b/packages/orchestration/src/exos/local-orchestration-account.js index 8b00049fd5d..0b661433603 100644 --- a/packages/orchestration/src/exos/local-orchestration-account.js +++ b/packages/orchestration/src/exos/local-orchestration-account.js @@ -29,6 +29,7 @@ import { TransferRouteShape } from './chain-hub.js'; * @import {HostOf} from '@agoric/async-flow'; * @import {LocalChain, LocalChainAccount} from '@agoric/vats/src/localchain.js'; * @import {AmountArg, CosmosChainAddress, DenomAmount, IBCMsgTransferOptions, IBCConnectionInfo, OrchestrationAccountCommon, LocalAccountMethods, TransferRoute, AccountId, AccountIdArg} from '@agoric/orchestration'; + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; * @import {RecorderKit, MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js'. * @import {Zone} from '@agoric/zone'; * @import {Remote} from '@agoric/internal'; diff --git a/packages/orchestration/src/exos/portfolio-holder-kit.js b/packages/orchestration/src/exos/portfolio-holder-kit.js index 0b8f213796d..b57800f4fab 100644 --- a/packages/orchestration/src/exos/portfolio-holder-kit.js +++ b/packages/orchestration/src/exos/portfolio-holder-kit.js @@ -12,6 +12,7 @@ const { fromEntries } = Object; * @import {MapStore} from '@agoric/store'; * @import {VowTools} from '@agoric/vow'; * @import {ResolvedPublicTopic} from '@agoric/zoe/src/contractSupport/topics.js'; + * @import {Invitation, ZCF} from '@agoric/zoe'; * @import {Zone} from '@agoric/zone'; * @import {OrchestrationAccount, OrchestrationAccountCommon, MakeCombineInvitationMakers} from '@agoric/orchestration'; */ diff --git a/packages/orchestration/src/fixtures/query-flows.contract.js b/packages/orchestration/src/fixtures/query-flows.contract.js index d735bfe78ca..f3f1f5054b1 100644 --- a/packages/orchestration/src/fixtures/query-flows.contract.js +++ b/packages/orchestration/src/fixtures/query-flows.contract.js @@ -7,6 +7,7 @@ import { withOrchestration } from '../utils/start-helper.js'; import * as flows from './query-flows.flows.js'; /** + * @import {ZCF} from '@agoric/zoe'; * @import {Zone} from '@agoric/zone'; * @import {OrchestrationPowers} from '..//utils/start-helper.js'; * @import {OrchestrationTools} from '../utils/start-helper.js'; diff --git a/packages/orchestration/src/types.ts b/packages/orchestration/src/types.ts index e20fdc40b18..43471a171a6 100644 --- a/packages/orchestration/src/types.ts +++ b/packages/orchestration/src/types.ts @@ -1,7 +1,6 @@ /** @file Rollup of all type definitions in the package, for local import and external export */ -// For ZCF which is only available ambiently -/// +import type { ZCF } from '@agoric/zoe'; export type * from './chain-info.js'; export type * from './cosmos-api.js'; diff --git a/packages/orchestration/test/facade.test.ts b/packages/orchestration/test/facade.test.ts index db0512e0d2a..be115f0ebc7 100644 --- a/packages/orchestration/test/facade.test.ts +++ b/packages/orchestration/test/facade.test.ts @@ -5,6 +5,7 @@ import { prepareSwingsetVowTools } from '@agoric/vow/vat.js'; import { setupZCFTest } from '@agoric/zoe/test/unitTests/zcf/setupZcfTest.js'; import { makeHeapZone } from '@agoric/zone'; import type { TestFn } from 'ava'; +import type { ZCF } from '@agoric/zoe'; import type { OrchestrationFlow } from '../src/orchestration-api.js'; import { provideOrchestration } from '../src/utils/start-helper.js'; import { commonSetup } from './supports.js'; diff --git a/packages/orchestration/test/staking-ops.test.ts b/packages/orchestration/test/staking-ops.test.ts index 33434eb2c45..59ce67031cf 100644 --- a/packages/orchestration/test/staking-ops.test.ts +++ b/packages/orchestration/test/staking-ops.test.ts @@ -25,6 +25,7 @@ import { decodeBase64, encodeBase64 } from '@endo/base64'; import { Far } from '@endo/far'; import { Timestamp } from '@agoric/cosmic-proto/google/protobuf/timestamp.js'; import { makeNameHubKit } from '@agoric/vats'; +import type { Invitation, ZCF } from '@agoric/zoe'; import { prepareCosmosOrchestrationAccountKit } from '../src/exos/cosmos-orchestration-account.js'; import type { CosmosChainAddress, diff --git a/packages/orchestration/test/utils/zcf-tools.test.ts b/packages/orchestration/test/utils/zcf-tools.test.ts index 7abbd8833a1..44f97f05f6a 100644 --- a/packages/orchestration/test/utils/zcf-tools.test.ts +++ b/packages/orchestration/test/utils/zcf-tools.test.ts @@ -9,6 +9,7 @@ import { makeNodeBundleCache } from '@endo/bundle-source/cache.js'; import { E, Far, type EReturn } from '@endo/far'; import type { TestFn } from 'ava'; import { createRequire } from 'node:module'; +import type { ZCF } from '@agoric/zoe'; import { makeZcfTools } from '../../src/utils/zcf-tools.js'; const nodeRequire = createRequire(import.meta.url); diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 337340368c7..efc723e4e1c 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -70,6 +70,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 94.58 + "atLeast": 94.51 } } diff --git a/packages/smart-wallet/src/invitations.js b/packages/smart-wallet/src/invitations.js index ae4ee732901..43524d561de 100644 --- a/packages/smart-wallet/src/invitations.js +++ b/packages/smart-wallet/src/invitations.js @@ -59,14 +59,17 @@ const MAX_PIPE_LENGTH = 2; */ /** - * @typedef {Pick} InvitationsPurseQuery + * @typedef {Pick< + * import('@agoric/zoe').InvitationDetails, + * 'description' | 'instance' + * >} InvitationsPurseQuery */ /** * @param {ERef} zoe * @param {ERef} agoricNames * @param {Brand<'set'>} invitationBrand - * @param {Purse<'set', InvitationDetails>} invitationsPurse + * @param {Purse<'set', import('@agoric/zoe').InvitationDetails>} invitationsPurse * @param {(fromOfferId: string) => import('./types.js').InvitationMakers} getInvitationContinuation */ export const makeInvitationsHelper = ( diff --git a/packages/smart-wallet/src/offerWatcher.js b/packages/smart-wallet/src/offerWatcher.js index 38da65c2d77..109a509b0f5 100644 --- a/packages/smart-wallet/src/offerWatcher.js +++ b/packages/smart-wallet/src/offerWatcher.js @@ -19,6 +19,7 @@ import { UNPUBLISHED_RESULT } from './offers.js'; * @import {PromiseWatcher} from '@agoric/swingset-liveslots'; * @import {Baggage} from '@agoric/vat-data'; * @import {Vow, VowTools} from '@agoric/vow'; + * @import {PaymentPKeywordRecord, Proposal, UserSeat, ZoeService} from '@agoric/zoe'; */ /** diff --git a/packages/smart-wallet/src/offers.js b/packages/smart-wallet/src/offers.js index 834aa3b4e6f..90a067cece2 100644 --- a/packages/smart-wallet/src/offers.js +++ b/packages/smart-wallet/src/offers.js @@ -1,3 +1,7 @@ +/** + * @import {InvitationDetails, Proposal} from '@agoric/zoe'; + */ + /** * @typedef {number | string} OfferId */ diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index 5d94b181526..6be1841eae8 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -47,6 +47,7 @@ import { prepareOfferWatcher, makeWatchOfferOutcomes } from './offerWatcher.js'; /** * @import {WeakMapStore, MapStore} from '@agoric/store' + * @import {InvitationDetails, PaymentPKeywordRecord, Proposal, UserSeat} from '@agoric/zoe'; * @import {EReturn} from '@endo/far'; * @import {OfferId, OfferStatus} from './offers.js'; */ diff --git a/packages/smart-wallet/src/types.ts b/packages/smart-wallet/src/types.ts index 019bcc212dc..3b32167ddb3 100644 --- a/packages/smart-wallet/src/types.ts +++ b/packages/smart-wallet/src/types.ts @@ -9,6 +9,7 @@ import type { agoric } from '@agoric/cosmic-proto/agoric/bundle.js'; import type { AgoricNamesRemotes } from '@agoric/vats/tools/board-utils.js'; import type { PublicTopic } from '@agoric/zoe/src/contractSupport/topics.js'; import type { Payment } from '@agoric/ertp'; +import type { InvitationDetails } from '@agoric/zoe'; import type { OfferSpec } from './offers.js'; declare const CapDataShape: unique symbol; diff --git a/packages/smart-wallet/test/invitation1.test.js b/packages/smart-wallet/test/invitation1.test.js index 46d3ca05aa3..0d6737d2061 100644 --- a/packages/smart-wallet/test/invitation1.test.js +++ b/packages/smart-wallet/test/invitation1.test.js @@ -17,6 +17,10 @@ import { makeNodeBundleCache } from '@endo/bundle-source/cache.js'; import { eventLoopIteration } from '@agoric/internal/src/testing-utils.js'; import { prepareSmartWallet } from '../src/smartWallet.js'; +/** + * @import {InvitationDetails, Proposal} from '@agoric/zoe'; + */ + /** @type {import('ava').TestFn>>} */ const test = anyTest; diff --git a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js index 4557a4cc954..ffaf89b2c02 100644 --- a/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js +++ b/packages/smart-wallet/test/swingsetTests/upgradeWalletFactory/bootstrap-walletFactory-service-upgrade.js @@ -11,6 +11,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; import { makePromiseKit } from '@endo/promise-kit'; +/** + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; + */ + const trace = makeTracer('BootWFUpg', false); export const wfV1BundleName = 'walletFactoryV1'; diff --git a/packages/store/exported.d.ts b/packages/store/exported.d.ts index 563c422026e..006ed7fcb73 100644 --- a/packages/store/exported.d.ts +++ b/packages/store/exported.d.ts @@ -10,7 +10,7 @@ import { WeakMapStore as _WeakMapStore, WeakSetStore as _WeakSetStore, } from './src/types.js'; -import { Pattern as _Pattern } from '@endo/patterns'; + declare global { // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. export { @@ -21,7 +21,5 @@ declare global { _StoreOptions as StoreOptions, _WeakMapStore as WeakMapStore, _WeakSetStore as WeakSetStore, - // other packages - _Pattern as Pattern, }; } diff --git a/packages/store/package.json b/packages/store/package.json index 5cce1ba6385..b98a6f8e484 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -61,6 +61,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 89.69 + "atLeast": 89.62 } } diff --git a/packages/swing-store/package.json b/packages/swing-store/package.json index f21c31ca8be..2b9b9fa2d9a 100644 --- a/packages/swing-store/package.json +++ b/packages/swing-store/package.json @@ -49,6 +49,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 79.04 + "atLeast": 79.43 } } diff --git a/packages/swingset-liveslots/package.json b/packages/swingset-liveslots/package.json index 82abf2c5527..cf21a87e31e 100644 --- a/packages/swingset-liveslots/package.json +++ b/packages/swingset-liveslots/package.json @@ -66,6 +66,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 75.2 + "atLeast": 75.24 } } diff --git a/packages/swingset-liveslots/src/collectionManager.js b/packages/swingset-liveslots/src/collectionManager.js index 69dfc18531d..a706b7347f7 100644 --- a/packages/swingset-liveslots/src/collectionManager.js +++ b/packages/swingset-liveslots/src/collectionManager.js @@ -27,6 +27,7 @@ import { makeCache } from './cache.js'; /** * @import {ToCapData, FromCapData} from '@endo/marshal'; + * @import {Pattern} from '@endo/patterns'; */ // XXX TODO: The following key length limit was put in place due to limitations diff --git a/packages/swingset-liveslots/src/message.js b/packages/swingset-liveslots/src/message.js index 5dcc513b6d9..d4b5f06801b 100644 --- a/packages/swingset-liveslots/src/message.js +++ b/packages/swingset-liveslots/src/message.js @@ -1,6 +1,10 @@ import { assert, Fail } from '@endo/errors'; import { insistCapData } from './capdata.js'; +/** + * @import {VatDeliveryResult} from './types.js'; + */ + /** * @typedef {{ * methargs: import('./types.js').SwingSetCapData, // of [method, args] diff --git a/packages/swingset-runner/package.json b/packages/swingset-runner/package.json index 4df8b6226f6..c0226d72f71 100644 --- a/packages/swingset-runner/package.json +++ b/packages/swingset-runner/package.json @@ -59,6 +59,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 55.08 + "atLeast": 55.56 } } diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index 55ac100f817..a5f21952063 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -66,6 +66,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 88.88 + "atLeast": 88.85 } } diff --git a/packages/vats/package.json b/packages/vats/package.json index 4ae480359db..8665ca09fe2 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -77,6 +77,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 90.43 + "atLeast": 90.39 } } diff --git a/packages/vats/src/centralSupply.js b/packages/vats/src/centralSupply.js index ee0cc37366d..71bd8d345ba 100644 --- a/packages/vats/src/centralSupply.js +++ b/packages/vats/src/centralSupply.js @@ -1,6 +1,10 @@ import { AmountMath } from '@agoric/ertp'; import { E, Far } from '@endo/far'; +/** + * @import {ContractMeta, ContractOf, FeeMintAccess, Invitation, OfferHandler, TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe'; + */ + /** * The sole purpose of this contract is to mint the initial supply of the * central currency, RUN. diff --git a/packages/vats/src/core/demoIssuers.js b/packages/vats/src/core/demoIssuers.js index c48a8890969..cc90d778020 100644 --- a/packages/vats/src/core/demoIssuers.js +++ b/packages/vats/src/core/demoIssuers.js @@ -11,6 +11,8 @@ import { import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js'; import { Stake, Stable } from '@agoric/internal/src/tokens.js'; +/** @import {FeeMintAccess, Installation} from '@agoric/zoe' */ + const { multiply, floorDivide } = natSafeMath; const { entries, fromEntries, keys, values } = Object; diff --git a/packages/vats/src/core/startWalletFactory.js b/packages/vats/src/core/startWalletFactory.js index fdd9a830516..7aca9771cc0 100644 --- a/packages/vats/src/core/startWalletFactory.js +++ b/packages/vats/src/core/startWalletFactory.js @@ -14,6 +14,7 @@ import { /** * @import {EReturn} from '@endo/far'; + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; */ const trace = makeTracer('StartWF'); diff --git a/packages/vats/src/core/types-ambient.d.ts b/packages/vats/src/core/types-ambient.d.ts index 39945737a0c..6eaa1d19e8b 100644 --- a/packages/vats/src/core/types-ambient.d.ts +++ b/packages/vats/src/core/types-ambient.d.ts @@ -232,6 +232,7 @@ type WellKnownContracts = { provisionPool: typeof import('@agoric/inter-protocol/src/provisionPool.js').start; priceAggregator: typeof import('@agoric/inter-protocol/src/price/fluxAggregatorContract.js').start; reserve: typeof import('@agoric/inter-protocol/src/reserve/assetReserve.js').start; + reserveGovernor: typeof import('@agoric/governance/src/contractGovernor.js').start; VaultFactory: typeof import('@agoric/inter-protocol/src/vaultFactory/vaultFactory.js').start; // no typeof because walletFactory is exporting `start` as a type walletFactory: import('@agoric/smart-wallet/src/walletFactory.js').start; diff --git a/packages/vats/src/localchain.js b/packages/vats/src/localchain.js index fb93e17f4a8..678b4e7bb82 100644 --- a/packages/vats/src/localchain.js +++ b/packages/vats/src/localchain.js @@ -14,6 +14,7 @@ const { Vow$ } = NetworkShape; /** * @import {EReturn} from '@endo/far'; + * @import {Key, Pattern} from '@endo/patterns'; * @import {TypedJson, ResponseTo, JsonSafe} from '@agoric/cosmic-proto'; * @import {PromiseVow, VowTools} from '@agoric/vow'; * @import {TargetApp, TargetRegistration} from './bridge-target.js'; diff --git a/packages/vats/src/proposals/restart-vats-proposal.js b/packages/vats/src/proposals/restart-vats-proposal.js index fe4d1611034..96f47b91ec5 100644 --- a/packages/vats/src/proposals/restart-vats-proposal.js +++ b/packages/vats/src/proposals/restart-vats-proposal.js @@ -3,6 +3,10 @@ import { deeplyFulfilledObject, makeTracer } from '@agoric/internal'; import { M, mustMatch } from '@agoric/store'; import { E, getInterfaceOf } from '@endo/far'; +/** + * @import {AdminFacet, ContractOf, InvitationAmount, ZCFMint} from '@agoric/zoe'; + */ + const trace = makeTracer('RV'); const HR = '----------------'; diff --git a/packages/vats/src/vat-bank.js b/packages/vats/src/vat-bank.js index 3456fef7a5d..19148564990 100644 --- a/packages/vats/src/vat-bank.js +++ b/packages/vats/src/vat-bank.js @@ -22,6 +22,7 @@ import { } from './virtual-purse.js'; /** + * @import {Amount, DisplayInfo, Issuer, IssuerKit, Payment} from '@agoric/ertp'; * @import {Guarded} from '@endo/exo'; * @import {RemotableObject} from '@endo/pass-style'; * @import {BridgeMessage, BridgeBigInt} from '@agoric/cosmic-swingset/src/types.js'; diff --git a/packages/vats/src/vat-zoe.js b/packages/vats/src/vat-zoe.js index f37422e4853..af904aab10d 100644 --- a/packages/vats/src/vat-zoe.js +++ b/packages/vats/src/vat-zoe.js @@ -28,7 +28,7 @@ export function buildRootObject(vatPowers, _vatParams, zoeBaggage) { const vatAdminSvc = await adminVat; - /** @type {ZCFSpec} */ + /** @type {import('@agoric/zoe').ZCFSpec} */ const zcfSpec = { name: zcfBundleName }; zoeBaggage.init( diff --git a/packages/vats/src/virtual-purse.js b/packages/vats/src/virtual-purse.js index 8b8ac1ff915..a8a538cb398 100644 --- a/packages/vats/src/virtual-purse.js +++ b/packages/vats/src/virtual-purse.js @@ -13,6 +13,11 @@ import { PaymentShape, } from '@agoric/ertp'; +/** + * @import {Key, Pattern} from '@endo/patterns'; + * @import {Amount, Issuer, IssuerKit, Paymnent} from '@agoric/ertp'; + */ + /** * @param {Pattern} [brandShape] * @param {Pattern} [amountShape] diff --git a/packages/vats/test/bootstrapPayment.test.js b/packages/vats/test/bootstrapPayment.test.js index d0212fc136b..7bac281dc6c 100644 --- a/packages/vats/test/bootstrapPayment.test.js +++ b/packages/vats/test/bootstrapPayment.test.js @@ -8,7 +8,7 @@ import { claim } from '@agoric/ertp/src/legacy-payment-helpers.js'; import centralSupplyBundle from '../bundles/bundle-centralSupply.js'; import { feeIssuerConfig } from '../src/core/utils.js'; -/** @import {Installation} from '@agoric/zoe/src/zoeService/utils.js' */ +/** @import {FeeMintAccess, Installation} from '@agoric/zoe' */ /** * @typedef {import('ava').ExecutionContext<{ * zoe: ZoeService; diff --git a/packages/vats/test/vpurse.test.js b/packages/vats/test/vpurse.test.js index 4e7572660d8..0a873c04140 100644 --- a/packages/vats/test/vpurse.test.js +++ b/packages/vats/test/vpurse.test.js @@ -10,6 +10,11 @@ import { makeNotifierKit } from '@agoric/notifier'; import { makeDurableZone } from '@agoric/zone/durable.js'; import { prepareVirtualPurse } from '../src/virtual-purse.js'; +/** + * @import {Amount} from '@agoric/ertp'; + * @import {NotifierRecord} from '@agoric/notifier'; + */ + /** @type {import('ava').TestFn>} */ const test = rawTest; diff --git a/packages/vats/tools/bank-utils.js b/packages/vats/tools/bank-utils.js index eb0ec53dc11..0e08cfb6c8d 100644 --- a/packages/vats/tools/bank-utils.js +++ b/packages/vats/tools/bank-utils.js @@ -6,6 +6,11 @@ import { Far } from '@endo/marshal'; import { buildRootObject as buildBankVatRoot } from '../src/vat-bank.js'; import { FAUCET_ADDRESS, makeFakeBankBridge } from './fake-bridge.js'; +/** + * @import {Amount, Brand, Issuer, IssuerKit, Payment} from '@agoric/ertp'; + * @import {SubscriptionRecord} from '@agoric/notifier'; + */ + /** * @deprecated use makeFakeBankManagerKit * @param {Pick, 'brand' | 'issuer'>[]} issuerKits diff --git a/packages/vats/tools/board-utils.js b/packages/vats/tools/board-utils.js index c9ee33bb416..6cf0769d819 100644 --- a/packages/vats/tools/board-utils.js +++ b/packages/vats/tools/board-utils.js @@ -1,3 +1,8 @@ +/** + * @import {ContractMeta, Installation, Instance, Invitation, ZCF} from '@agoric/zoe'; + * @import {DisplayInfo} from '@agoric/ertp'; + */ + /** * @typedef {{ * brand: import('@agoric/internal/src/marshal.js').BoardRemote; diff --git a/packages/vow/package.json b/packages/vow/package.json index 2a85797234c..842ec67ed24 100755 --- a/packages/vow/package.json +++ b/packages/vow/package.json @@ -56,6 +56,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 91.62 + "atLeast": 91.75 } } diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json index 7c12a246544..a8acacd0275 100644 --- a/packages/xsnap/package.json +++ b/packages/xsnap/package.json @@ -77,6 +77,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 93.51 + "atLeast": 93.56 } } diff --git a/packages/zoe/exported.d.ts b/packages/zoe/exported.d.ts index a22bb5136d4..b65dbf9db9b 100644 --- a/packages/zoe/exported.d.ts +++ b/packages/zoe/exported.d.ts @@ -1,5 +1,47 @@ -import './src/contractFacet/types-ambient.js'; -import './src/zoeService/types-ambient.js'; +/* eslint-disable -- doesn't understand .d.ts */ + +/// +/// + import './src/contractSupport/types-ambient.js'; import './src/contracts/exported.js'; import './src/types-ambient.js'; + +import { + AdminFacet as _AdminFacet, + AmountKeywordRecord as _AmountKeywordRecord, + ContractMeta as _ContractMeta, + Installation as _Installation, + Instance as _Instance, + Invitation as _Invitation, + InvitationAmount as _InvitationAmount, + FeeIssuerConfig as _FeeIssuerConfig, + OfferHandler as _OfferHandler, + ProposalRecord as _ProposalRecord, + TransferPart as _TransferPart, + ZCF as _ZCF, + ZCFMint as _ZCFMint, + ZCFSeat as _ZCFSeat, + ZoeService as _ZoeService, +} from './src/types-index.js'; + +declare global { + // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. + export { + _AdminFacet as __AdminFacet, + _AmountKeywordRecord as AmountKeywordRecord, + _ContractMeta as ContractMeta, + _FeeIssuerConfig as FeeIssuerConfig, + _Installation as Installation, + _Instance as Instance, + _Invitation as Invitation, + _InvitationAmount as InvitationAmount, + _OfferHandler as OfferHandler, + _ProposalRecord as ProposalRecord, + _TransferPart as TransferPart, + _ZCF as ZCF, + _ZCFMint as ZCFMint, + _ZCFSeat as ZCFSeat, + _ZoeService as ZoeService, + }; +} diff --git a/packages/zoe/package.json b/packages/zoe/package.json index 7f15ed6dbd5..e132884ba5b 100644 --- a/packages/zoe/package.json +++ b/packages/zoe/package.json @@ -98,6 +98,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 85.11 + "atLeast": 85.04 } } diff --git a/packages/zoe/src/cleanProposal.js b/packages/zoe/src/cleanProposal.js index fdeafe30034..e39fe7b3333 100644 --- a/packages/zoe/src/cleanProposal.js +++ b/packages/zoe/src/cleanProposal.js @@ -11,6 +11,10 @@ const { ownKeys } = Reflect; export const MAX_KEYWORD_LENGTH = 100; +/** + * @import {ExitRule, Proposal} from '@agoric/zoe'; + */ + const firstCapASCII = /^[A-Z][a-zA-Z0-9_$]*$/; // We adopt simple requirements on keywords so that they do not accidentally diff --git a/packages/zoe/src/contractFacet/internal-types.js b/packages/zoe/src/contractFacet/internal-types.js deleted file mode 100644 index 74e0f816eb2..00000000000 --- a/packages/zoe/src/contractFacet/internal-types.js +++ /dev/null @@ -1,15 +0,0 @@ -// @jessie-check - -/** - * @typedef {( {zcf}: {zcf: ZCF} ) => void} TestJigSetter - */ - -/** - * @typedef ZCFZygote - * @property {(instanceAdminFromZoe: ERef, - * instanceRecordFromZoe: InstanceRecord, - * issuerStorageFromZoe: IssuerRecords, - * privateArgs?: object, - * ) => Promise} startContract - * @property {(privateArgs?: object) => void} restartContract - */ diff --git a/packages/zoe/src/contractFacet/types-ambient.js b/packages/zoe/src/contractFacet/types-ambient.js deleted file mode 100644 index 469002eeeed..00000000000 --- a/packages/zoe/src/contractFacet/types-ambient.js +++ /dev/null @@ -1 +0,0 @@ -// Dummy file for .d.ts twin to declare ambients diff --git a/packages/zoe/src/contractFacet/types-ambient.d.ts b/packages/zoe/src/contractFacet/types.ts similarity index 80% rename from packages/zoe/src/contractFacet/types-ambient.d.ts rename to packages/zoe/src/contractFacet/types.ts index bcac00c752c..3a66d6258f9 100644 --- a/packages/zoe/src/contractFacet/types-ambient.d.ts +++ b/packages/zoe/src/contractFacet/types.ts @@ -1,14 +1,33 @@ -/// -/// -/// +import type { Passable } from '@endo/pass-style'; +import type { ERef } from '@endo/far'; +import type { Pattern } from '@endo/patterns'; +import type { + AdditionalDisplayInfo, + Amount, + AssetKind, + Brand, + Issuer, + Payment, +} from '@agoric/ertp'; +import type { Subscriber } from '@agoric/notifier'; +import type { + AmountKeywordRecord, + ExitRule, + FeeMintAccess, + Instance, + InvitationDetails, + ProposalRecord, + UserSeat, + ZoeService, +} from '../types-index.js'; /** * Any passable non-thenable. Often an explanatory string. */ -type Completion = import('@endo/pass-style').Passable; -type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit; +export type Completion = Passable; +export type ZCFMakeEmptySeatKit = (exit?: ExitRule | undefined) => ZcfSeatKit; -type InvitationAmount = Amount<'set', InvitationDetails>; +export type InvitationAmount = Amount<'set', InvitationDetails>; /** * Zoe Contract Facet @@ -19,7 +38,7 @@ type InvitationAmount = Amount<'set', InvitationDetails>; * synchronously from within the contract, and usually is referred to * in code as zcf. */ -type ZCF> = { +export type ZCF> = { /** * - atomically reallocate amounts among seats. */ @@ -65,7 +84,7 @@ type ZCF> = { getTerms: () => StandardTerms & CT; getBrandForIssuer: (issuer: Issuer) => Brand; getIssuerForBrand: (brand: Brand) => Issuer; - getAssetKind: GetAssetKindByBrand; + getAssetKind: (brand: Brand) => AssetKind; makeZCFMint: ( keyword: Keyword, assetKind?: K_2 | undefined, @@ -81,14 +100,14 @@ type ZCF> = { getInstance: () => Instance; }; -type TransferPart = [ +export type TransferPart = [ fromSeat?: ZCFSeat, toSeat?: ZCFSeat, fromAmounts?: AmountKeywordRecord, toAmounts?: AmountKeywordRecord, ]; -type ZCFRegisterFeeMint = ( +export type ZCFRegisterFeeMint = ( keyword: Keyword, allegedFeeMintAccess: FeeMintAccess, ) => Promise>; @@ -106,8 +125,8 @@ type ZCFRegisterFeeMint = ( * will be appended to the returned jig object (overriding any * provided by the `testFn`). */ -type SetTestJig = (testFn?: () => Record) => void; -type ZCFMint = { +export type SetTestJig = (testFn?: () => Record) => void; +export type ZCFMint = { getIssuerRecord: () => IssuerRecord; /** * All the amounts in gains must be of this ZCFMint's brand. @@ -135,8 +154,8 @@ type ZCFMint = { * fail called with the reason for this failure, where reason is * normally an instanceof Error. */ -type ZCFSeatFail = (reason: unknown) => Error; -type ZCFSeat = import('@endo/pass-style').RemotableObject & { +export type ZCFSeatFail = (reason: unknown) => Error; +export type ZCFSeat = import('@endo/pass-style').RemotableObject & { exit: (completion?: Completion) => void; fail: ZCFSeatFail; getSubscriber: () => Promise>; @@ -153,17 +172,17 @@ type ZCFSeat = import('@endo/pass-style').RemotableObject & { getCurrentAllocation: () => Allocation; isOfferSafe: (newAllocation: Allocation) => boolean; }; -type ZcfSeatKit = { +export type ZcfSeatKit = { zcfSeat: ZCFSeat; userSeat: Promise; }; -type HandleOffer = (seat: ZCFSeat, offerArgs: OA) => OR; -type OfferHandler = +export type HandleOffer = (seat: ZCFSeat, offerArgs: OA) => OR; +export type OfferHandler = | HandleOffer | { handle: HandleOffer; }; -type ContractMeta< +export type ContractMeta< SF extends // import inline to maintain ambient mode import('../zoeService/utils').ContractStartFunction = import('../zoeService/utils').ContractStartFunction, > = { @@ -184,25 +203,25 @@ type ContractMeta< * * CAVEAT: assumes synchronous */ -type ContractStartFn = ( +export type ContractStartFn = ( zcf: ZCF, privateArgs: PA, baggage: import('@agoric/vat-data').Baggage, ) => ContractStartFnResult; -type ContractStartFnResult = { +export type ContractStartFnResult = { publicFacet?: PF; creatorFacet?: CF; creatorInvitation?: Promise> | undefined; }; // XXX redef, losing documentation -type ContractOf any> = +export type ContractOf any> = import('../zoeService/utils').ContractOf; -type AdminFacet = import('../zoeService/utils').AdminFacet; +export type AdminFacet = import('../zoeService/utils').AdminFacet; declare const OfferReturn: unique symbol; declare const OfferArgs: unique symbol; -type Invitation = Payment< +export type Invitation = Payment< 'set', InvitationDetails > & { diff --git a/packages/zoe/src/contractFacet/vatRoot.js b/packages/zoe/src/contractFacet/vatRoot.js index 00404e0c003..36a0f4f4cef 100644 --- a/packages/zoe/src/contractFacet/vatRoot.js +++ b/packages/zoe/src/contractFacet/vatRoot.js @@ -11,12 +11,14 @@ import { Fail } from '@endo/errors'; import { Far } from '@endo/marshal'; import { E } from '@endo/far'; -import '../internal-types.js'; - import { makeZCFZygote } from './zcfZygote.js'; /** - * @param {VatPowers & { testJigSetter: TestJigSetter }} powers + * @import {ZoeService} from '@agoric/zoe'; + */ + +/** + * @param {VatPowers & { testJigSetter: ( {zcf}: {zcf: ZCF} ) => void }} powers * @param {{contractBundleCap: BundleCap, zoeService: ZoeService, invitationIssuer: Issuer<'set'>, privateArgs?: any}} vatParameters * @param {import('@agoric/vat-data').Baggage} baggage */ @@ -72,7 +74,6 @@ export async function buildRootObject(powers, vatParameters, baggage) { issuerStorageFromZoe, privateArgs = undefined, ) => { - /** @type {ZCFZygote} */ return E(zcfZygote).startContract( zoeInstanceAdmin, instanceRecordFromZoe, diff --git a/packages/zoe/src/contractFacet/zcfMint.js b/packages/zoe/src/contractFacet/zcfMint.js index dc2c37012d5..cdb6986392c 100644 --- a/packages/zoe/src/contractFacet/zcfMint.js +++ b/packages/zoe/src/contractFacet/zcfMint.js @@ -9,8 +9,10 @@ import { addToAllocation, subtractFromAllocation } from './allocationMath.js'; import '../internal-types.js'; import { ZcfMintI } from './typeGuards.js'; -import './internal-types.js'; -import './types-ambient.js'; + +/** + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, TransferPart, ZCF, ZCFMint, ZCFSeat} from '@agoric/zoe'; + */ /** * @param {AmountKeywordRecord} amr diff --git a/packages/zoe/src/contractFacet/zcfSeat.js b/packages/zoe/src/contractFacet/zcfSeat.js index 04477ee110d..ca9bbf6efa6 100644 --- a/packages/zoe/src/contractFacet/zcfSeat.js +++ b/packages/zoe/src/contractFacet/zcfSeat.js @@ -23,6 +23,7 @@ import { TransferPartShape } from '../contractSupport/atomicTransfer.js'; /** * @import {LegacyWeakMap, WeakMapStore} from '@agoric/store'; * @import {MapStore} from '@agoric/swingset-liveslots'; + * @import {ContractMeta, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; */ /** diff --git a/packages/zoe/src/contractFacet/zcfZygote.js b/packages/zoe/src/contractFacet/zcfZygote.js index b54d6af977c..2e0e1a00a03 100644 --- a/packages/zoe/src/contractFacet/zcfZygote.js +++ b/packages/zoe/src/contractFacet/zcfZygote.js @@ -30,9 +30,21 @@ import { prepareZcMint } from './zcfMint.js'; import { ZcfI } from './typeGuards.js'; /// -/// -/** @import {IssuerOptionsRecord} from '@agoric/ertp' */ +/** + * @import {IssuerOptionsRecord} from '@agoric/ertp'; + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, SetTestJig, TransferPart, ZCF, ZCFMint, ZCFRegisterFeeMint, ZoeService} from '@agoric/zoe'; + */ + +/** + * @typedef ZCFZygote + * @property {(instanceAdminFromZoe: ERef, + * instanceRecordFromZoe: InstanceRecord, + * issuerStorageFromZoe: IssuerRecords, + * privateArgs?: object, + * ) => Promise} startContract + * @property {(privateArgs?: object) => void} restartContract + */ /** * Make the ZCF vat in zygote-usable form. First, a generic ZCF is @@ -42,7 +54,7 @@ import { ZcfI } from './typeGuards.js'; * @param {VatPowers} powers * @param {ERef} zoeService * @param {Issuer<'set'>} invitationIssuer - * @param {TestJigSetter} testJigSetter + * @param {( {zcf}: {zcf: ZCF} ) => void} testJigSetter * @param {BundleCap} contractBundleCap * @param {import('@agoric/vat-data').Baggage} zcfBaggage * @returns {Promise} diff --git a/packages/zoe/src/contractSupport/atomicTransfer.js b/packages/zoe/src/contractSupport/atomicTransfer.js index befda09311c..68cb95436dd 100644 --- a/packages/zoe/src/contractSupport/atomicTransfer.js +++ b/packages/zoe/src/contractSupport/atomicTransfer.js @@ -1,6 +1,10 @@ import { M } from '@agoric/store'; import { AmountKeywordRecordShape, SeatShape } from '../typeGuards.js'; +/** + * @import {ContractMeta, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + export const TransferPartShape = M.splitArray( harden([M.opt(SeatShape), M.opt(SeatShape), M.opt(AmountKeywordRecordShape)]), harden([M.opt(AmountKeywordRecordShape)]), diff --git a/packages/zoe/src/contractSupport/priceAuthorityInitial.js b/packages/zoe/src/contractSupport/priceAuthorityInitial.js index fc19c7747fb..abd455c1c49 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityInitial.js +++ b/packages/zoe/src/contractSupport/priceAuthorityInitial.js @@ -11,6 +11,7 @@ import { multiplyBy } from './ratio.js'; import { mintQuote } from './priceAuthorityTransform.js'; /** + * @import {Amount, Brand, Mint} from '@agoric/ertp'; * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */ diff --git a/packages/zoe/src/contractSupport/types-ambient.js b/packages/zoe/src/contractSupport/types-ambient.js index a285ce8c9d5..3c5b1bf5bad 100644 --- a/packages/zoe/src/contractSupport/types-ambient.js +++ b/packages/zoe/src/contractSupport/types-ambient.js @@ -1,6 +1,7 @@ // @jessie-check /// +/// /** * @typedef {object} SeatGainsLossesRecord diff --git a/packages/zoe/src/contractSupport/zoeHelpers.js b/packages/zoe/src/contractSupport/zoeHelpers.js index f8a59830f2a..59f3e1ca484 100644 --- a/packages/zoe/src/contractSupport/zoeHelpers.js +++ b/packages/zoe/src/contractSupport/zoeHelpers.js @@ -9,6 +9,7 @@ import { atomicTransfer, fromOnly, toOnly } from './atomicTransfer.js'; /** * @import {Pattern} from '@endo/patterns'; + * @import {ContractMeta, Invitation, Proposal, ZCF, ZCFSeat} from '@agoric/zoe'; */ export const defaultAcceptanceMsg = `The offer has been accepted. Once the contract has been completed, please check your payout`; diff --git a/packages/zoe/src/contracts/autoswap.js b/packages/zoe/src/contracts/autoswap.js index 269f7335722..3acf8e1fe57 100644 --- a/packages/zoe/src/contracts/autoswap.js +++ b/packages/zoe/src/contracts/autoswap.js @@ -13,6 +13,10 @@ import { calcSecondaryRequired, } from '../contractSupport/index.js'; +/** + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + /** * Autoswap is a rewrite of Uniswap. Please see the documentation for * more https://agoric.com/documentation/zoe/guide/contracts/autoswap.html diff --git a/packages/zoe/src/contracts/loan/types-ambient.js b/packages/zoe/src/contracts/loan/types-ambient.js index 39fa1067fec..98d902fb8b3 100644 --- a/packages/zoe/src/contracts/loan/types-ambient.js +++ b/packages/zoe/src/contracts/loan/types-ambient.js @@ -43,7 +43,7 @@ /** * @typedef LenderSeatProperty - * @property {ZCFSeat} lenderSeat + * @property {import('../../types-index').ZCFSeat} lenderSeat * * The ZCFSeat representing the lender's position in the contract. */ @@ -57,7 +57,7 @@ /** * @typedef BorrowerConfigProperties * - * @property {ZCFSeat} collateralSeat + * @property {import('../../types-index').ZCFSeat} collateralSeat * * The ZCFSeat holding the collateral in escrow after the borrower * escrows it @@ -75,7 +75,7 @@ /** * @typedef BorrowerConfigPropertiesMinusDebt * - * @property {ZCFSeat} collateralSeat + * @property {import('../../types-index').ZCFSeat} collateralSeat * * The ZCFSeat holding the collateral in escrow after the borrower * escrows it @@ -99,29 +99,29 @@ /** * @callback ScheduleLiquidation - * @param {ZCF} zcf + * @param {import('../../types-index').ZCF} zcf * @param {LoanConfigWithBorrower} config */ /** * @callback MakeLendInvitation - * @param {ZCF} zcf + * @param {import('../../types-index').ZCF} zcf * @param {LoanTerms} config - * @returns {Promise} lendInvitation + * @returns {Promise} lendInvitation */ /** * @callback MakeBorrowInvitation - * @param {ZCF} zcf + * @param {import('../../types-index').ZCF} zcf * @param {LoanConfigWithLender} config - * @returns {Promise} borrowInvitation + * @returns {Promise} borrowInvitation */ /** * @callback MakeCloseLoanInvitation - * @param {ZCF} zcf + * @param {import('../../types-index').ZCF} zcf * @param {LoanConfigWithBorrower} config - * @returns {Promise} closeLoanInvitation + * @returns {Promise} closeLoanInvitation */ /** @@ -129,9 +129,9 @@ * after adding. * * @callback MakeAddCollateralInvitation - * @param {ZCF} zcf + * @param {import('../../types-index').ZCF} zcf * @param {LoanConfigWithBorrower} config - * @returns {Promise} addCollateralInvitation + * @returns {Promise} addCollateralInvitation */ /** @@ -166,7 +166,7 @@ * * the period at which the outstanding debt increases by the interestRate * - * @property {ZCF} zcf + * @property {import('../../types-index').ZCF} zcf * * @property {LoanConfigWithBorrowerMinusDebt} configMinusGetDebt * @property {import('@agoric/time').Timestamp} basetime The starting point from which to calculate @@ -175,7 +175,7 @@ /** * @typedef {object} ConfigMinusGetDebt - * @property {ZCFSeat} collateralSeat + * @property {import('../../types-index').ZCFSeat} collateralSeat * @property {PromiseRecord} liquidationPromiseKit * @property {bigint} [mmr] * @property {Handle<'Instance'>} autoswapInstance @@ -183,18 +183,18 @@ * @property {PeriodNotifier} periodNotifier * @property {bigint} interestRate * @property {import('@agoric/time').RelativeTime} interestPeriod - * @property {ZCFSeat} lenderSeat + * @property {import('../../types-index').ZCFSeat} lenderSeat */ /** * @typedef {object} BorrowFacet * - * @property {() => Promise} makeCloseLoanInvitation + * @property {() => Promise} makeCloseLoanInvitation * * Make an invitation to close the loan by repaying the debt * (including interest). * - * @property {() => Promise} makeAddCollateralInvitation + * @property {() => Promise} makeAddCollateralInvitation * * Make an invitation to add collateral to protect against liquidation * diff --git a/packages/zoe/src/contracts/oracle.js b/packages/zoe/src/contracts/oracle.js index 96f7c6cdd15..24cd8248700 100644 --- a/packages/zoe/src/contracts/oracle.js +++ b/packages/zoe/src/contracts/oracle.js @@ -6,6 +6,7 @@ import { E } from '@endo/eventual-send'; import { atomicTransfer } from '../contractSupport/index.js'; /** + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; * @import {ContractOf} from '../zoeService/utils.js'; */ diff --git a/packages/zoe/src/contracts/priceAggregator.js b/packages/zoe/src/contracts/priceAggregator.js index 6697321622d..9a9c4d10c7a 100644 --- a/packages/zoe/src/contracts/priceAggregator.js +++ b/packages/zoe/src/contracts/priceAggregator.js @@ -34,7 +34,9 @@ import { * @import {LegacyMap} from '@agoric/store' * @import {ContractOf} from '../zoeService/utils.js'; * @import {PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; */ + /** @typedef {bigint | number | string} ParsableNumber */ /** * @typedef {Readonly} OraclePriceSubmission @@ -588,8 +590,10 @@ const start = async (zcf, privateArgs) => { // Obtain the oracle's publicFacet. assert(oracleInstance); - /** @type {import('./oracle.js').OracleContract['publicFacet']} */ - const oracle = await E(zoe).getPublicFacet(oracleInstance); + const oracle = + /** @type {import('./oracle.js').OracleContract['publicFacet']} */ ( + await E(zoe).getPublicFacet(oracleInstance) + ); assert(records.has(record), 'Oracle record is already deleted'); /** @type {import('@agoric/time').Timestamp} */ diff --git a/packages/zoe/src/contracts/scaledPriceAuthority.js b/packages/zoe/src/contracts/scaledPriceAuthority.js index 2b43bff8fcf..f9e20fc33fe 100644 --- a/packages/zoe/src/contracts/scaledPriceAuthority.js +++ b/packages/zoe/src/contracts/scaledPriceAuthority.js @@ -11,6 +11,7 @@ import { provideQuoteMint } from '../contractSupport/priceAuthorityQuoteMint.js' /** * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; + * @import {ZCF} from '@agoric/zoe'; */ /** diff --git a/packages/zoe/src/contracts/simpleExchange.js b/packages/zoe/src/contracts/simpleExchange.js index 79e910dab20..548c83cb887 100644 --- a/packages/zoe/src/contracts/simpleExchange.js +++ b/packages/zoe/src/contracts/simpleExchange.js @@ -8,6 +8,10 @@ import { assertIssuerKeywords, } from '../contractSupport/zoeHelpers.js'; +/** + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + /** * SimpleExchange is an exchange with a simple matching algorithm, which allows * an unlimited number of parties to create new orders or accept existing diff --git a/packages/zoe/src/contracts/types-ambient.js b/packages/zoe/src/contracts/types-ambient.js index c1df139ad2c..52f307d0468 100644 --- a/packages/zoe/src/contracts/types-ambient.js +++ b/packages/zoe/src/contracts/types-ambient.js @@ -4,7 +4,7 @@ * @property {() => Amount} getAvailableItems * * @typedef {object} SellItemsCreatorOnly - * @property {() => Promise} makeBuyerInvitation + * @property {() => Promise} makeBuyerInvitation * * @typedef {SellItemsPublicFacet & SellItemsCreatorOnly} SellItemsCreatorFacet */ @@ -31,22 +31,22 @@ /** * @typedef {object} AutomaticRefundPublicFacet * @property {() => bigint} getOffersCount - * @property {() => Promise} makeInvitation + * @property {() => Promise} makeInvitation */ /** * @typedef {object} AutoswapPublicFacet - * @property {() => Promise} makeSwapInvitation synonym for + * @property {() => Promise} makeSwapInvitation synonym for * makeSwapInInvitation - * @property {() => Promise} makeSwapInInvitation make an invitation + * @property {() => Promise} makeSwapInInvitation make an invitation * that allows one to do a swap in which the In amount is specified and the Out * amount is calculated - * @property {() => Promise} makeSwapOutInvitation make an invitation + * @property {() => Promise} makeSwapOutInvitation make an invitation * that allows one to do a swap in which the Out amount is specified and the In * amount is calculated - * @property {() => Promise} makeAddLiquidityInvitation make an + * @property {() => Promise} makeAddLiquidityInvitation make an * invitation that allows one to add liquidity to the pool. - * @property {() => Promise} makeRemoveLiquidityInvitation make an + * @property {() => Promise} makeRemoveLiquidityInvitation make an * invitation that allows one to remove liquidity from the pool. * @property {() => Issuer} getLiquidityIssuer * @property {() => bigint} getLiquiditySupply get the current value of diff --git a/packages/zoe/src/contracts/valueVow.contract.js b/packages/zoe/src/contracts/valueVow.contract.js index d8fc8beb7e8..8d8f6fce3c0 100644 --- a/packages/zoe/src/contracts/valueVow.contract.js +++ b/packages/zoe/src/contracts/valueVow.contract.js @@ -2,6 +2,7 @@ import { prepareVowTools } from '@agoric/vow'; import { makeDurableZone } from '@agoric/zone/durable.js'; /** + * @import {ContractMeta, ContractStartFn, HandleOffer, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; * @import { Baggage } from '@agoric/vat-data'; */ diff --git a/packages/zoe/src/internal-types.js b/packages/zoe/src/internal-types.js index 8fef1fe51cf..8b287374693 100644 --- a/packages/zoe/src/internal-types.js +++ b/packages/zoe/src/internal-types.js @@ -1,6 +1,11 @@ // @jessie-check /// +/** + * @import {Completion, ContractStartFn, PaymentPKeywordRecord, UserSeat} from '@agoric/zoe'; + * @import {Pattern} from '@endo/patterns'; + */ + /** * @typedef {object} SeatData * @property {ProposalRecord} proposal diff --git a/packages/zoe/src/typeGuards.js b/packages/zoe/src/typeGuards.js index f2ba085c7e8..934a06b78db 100644 --- a/packages/zoe/src/typeGuards.js +++ b/packages/zoe/src/typeGuards.js @@ -15,6 +15,7 @@ import { TimestampShape } from '@agoric/time'; /** * @import {TypedPattern} from '@agoric/internal'; + * @import {AfterDeadlineExitRule} from '@agoric/zoe'; */ // keywords have an initial cap @@ -114,7 +115,7 @@ export const isOnDemandExitRule = exit => { harden(isOnDemandExitRule); /** - * @param {ExitRule} exit + * @param {import('./types-index').ExitRule} exit * @returns {exit is WaivedExitRule} */ export const isWaivedExitRule = exit => { @@ -124,7 +125,7 @@ export const isWaivedExitRule = exit => { harden(isWaivedExitRule); /** - * @param {ExitRule} exit + * @param {import('./types-index').ExitRule} exit * @returns {exit is AfterDeadlineExitRule} */ export const isAfterDeadlineExitRule = exit => { @@ -133,7 +134,7 @@ export const isAfterDeadlineExitRule = exit => { }; harden(isAfterDeadlineExitRule); -/** @type {TypedPattern} */ +/** @type {TypedPattern} */ export const InvitationElementShape = M.splitRecord({ description: M.string(), handle: InvitationHandleShape, diff --git a/packages/zoe/src/types-index.d.ts b/packages/zoe/src/types-index.d.ts new file mode 100644 index 00000000000..d9ef7af29d9 --- /dev/null +++ b/packages/zoe/src/types-index.d.ts @@ -0,0 +1,3 @@ +// Export all the types this package provides +export type * from './contractFacet/types.js'; +export type * from './zoeService/types.js'; diff --git a/packages/zoe/src/types-index.js b/packages/zoe/src/types-index.js new file mode 100644 index 00000000000..d382eb5feaf --- /dev/null +++ b/packages/zoe/src/types-index.js @@ -0,0 +1,2 @@ +// Empty JS file to correspond with its .d.ts twin +export {}; diff --git a/packages/zoe/src/zoeService/feeMint.js b/packages/zoe/src/zoeService/feeMint.js index a8f9771707b..74363565838 100644 --- a/packages/zoe/src/zoeService/feeMint.js +++ b/packages/zoe/src/zoeService/feeMint.js @@ -14,6 +14,10 @@ import { import { Fail, q } from '@endo/errors'; import { FeeMintAccessShape } from '../typeGuards.js'; +/** + * @import {FeeIssuerConfig, ZoeService} from '@agoric/zoe'; + */ + /** @deprecated Redundant. Just omit it. */ const FEE_MINT_KIT = 'FeeMintKit'; diff --git a/packages/zoe/src/zoeService/installationStorage.js b/packages/zoe/src/zoeService/installationStorage.js index c9f4973e44d..4cfb6ececee 100644 --- a/packages/zoe/src/zoeService/installationStorage.js +++ b/packages/zoe/src/zoeService/installationStorage.js @@ -16,6 +16,7 @@ import { * @import {LegacyWeakMap, WeakMapStore} from '@agoric/store'; * @import {MapStore} from '@agoric/swingset-liveslots'; * @import {BundleID, BundleCap} from '@agoric/swingset-vat'; + * @import {SourceBundle} from '@agoric/zoe'; */ /** diff --git a/packages/zoe/src/zoeService/internal-types.js b/packages/zoe/src/zoeService/internal-types.js index f1c5bdcb9ee..532834326f0 100644 --- a/packages/zoe/src/zoeService/internal-types.js +++ b/packages/zoe/src/zoeService/internal-types.js @@ -1,4 +1,9 @@ // @jessie-check +/// + +/** + * @import {FeeMintAccess, GetBrands, GetBundleIDFromInstallation, GetIssuers, InstallBundle, InstallBundleID} from './types.js'; + */ /** * Create a purse for a new issuer @@ -127,9 +132,9 @@ * @property {GetBrands} getBrands * @property {GetIssuers} getIssuers * @property {import('./utils.js').GetTerms} getTerms - * @property {GetOfferFilter} getOfferFilter - * @property {SetOfferFilter} setOfferFilter - * @property {GetInstallationForInstance} getInstallationForInstance + * @property {(instance: import('./utils.js').Instance) => string[]} getOfferFilter + * @property {(instance: Instance, strings: string[]) => any} setOfferFilter + * @property {(instance: import('./utils.js').Instance) => Promise} getInstallationForInstance * @property {GetInstanceAdmin} getInstanceAdmin * @property {UnwrapInstallation} unwrapInstallation * @property {(invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined} getProposalShapeForInvitation diff --git a/packages/zoe/src/zoeService/invitationQueries.js b/packages/zoe/src/zoeService/invitationQueries.js index df5d670012a..276e9d24410 100644 --- a/packages/zoe/src/zoeService/invitationQueries.js +++ b/packages/zoe/src/zoeService/invitationQueries.js @@ -4,7 +4,7 @@ import { X, Fail, q, makeError, annotateError } from '@endo/errors'; import { E } from '@endo/eventual-send'; export const makeInvitationQueryFns = invitationIssuer => { - /** @type {GetInvitationDetails} */ + /** @type {import('./types.ts').GetInvitationDetails} */ const getInvitationDetails = async invitationP => { const onRejected = reason => { const err = makeError( @@ -21,11 +21,11 @@ export const makeInvitationQueryFns = invitationIssuer => { return invAmount.value[0]; }; - /** @type {GetInstance} */ + /** @type {import('./types.ts').GetInstance} */ const getInstance = invitation => E.get(getInvitationDetails(invitation)).instance; - /** @type {GetInstallation} */ + /** @type {import('./types.ts').GetInstallation} */ const getInstallation = invitation => E.get(getInvitationDetails(invitation)).installation; diff --git a/packages/zoe/src/zoeService/makeInvitation.js b/packages/zoe/src/zoeService/makeInvitation.js index 8558695db98..b9b8a1a21a1 100644 --- a/packages/zoe/src/zoeService/makeInvitation.js +++ b/packages/zoe/src/zoeService/makeInvitation.js @@ -4,6 +4,9 @@ import { Fail, q } from '@endo/errors'; import { provideDurableMapStore } from '@agoric/vat-data'; import { AssetKind, hasIssuer, prepareIssuerKit } from '@agoric/ertp'; import { InvitationElementShape } from '../typeGuards.js'; +/** + * @import {FeeIssuerConfig, InvitationDetails} from '@agoric/zoe'; + */ /** * Not deprecated because the first use below is still correct. diff --git a/packages/zoe/src/zoeService/offer/offer.js b/packages/zoe/src/zoeService/offer/offer.js index 092e3d9f223..d9b66e292da 100644 --- a/packages/zoe/src/zoeService/offer/offer.js +++ b/packages/zoe/src/zoeService/offer/offer.js @@ -9,7 +9,9 @@ import { cleanProposal } from '../../cleanProposal.js'; import { burnInvitation } from './burnInvitation.js'; import { makeInvitationQueryFns } from '../invitationQueries.js'; -import '../internal-types.js'; +/** + * @import {Offer} from '@agoric/zoe'; + */ export const makeOfferMethod = offerDataAccess => { /** @type {Offer} */ diff --git a/packages/zoe/src/zoeService/types-ambient.js b/packages/zoe/src/zoeService/types-ambient.js index 050f23f339f..26b21e73097 100644 --- a/packages/zoe/src/zoeService/types-ambient.js +++ b/packages/zoe/src/zoeService/types-ambient.js @@ -1,328 +1,5 @@ -// @jessie-check +/** @file @deprecated */ -/// - -/** - * @typedef {object} ZoeService - * - * Zoe provides a framework for deploying and working with smart - * contracts. It is accessed as a long-lived and well-trusted service - * that enforces offer safety for the contracts that use it. Zoe has a - * single `invitationIssuer` for the entirety of its lifetime. By - * having a reference to Zoe, a user can get the `invitationIssuer` - * and thus validate any `invitation` they receive from someone else. - * - * Zoe has two different facets: the public Zoe service and the - * contract facet (ZCF). Each contract instance has a copy of ZCF - * within its vat. The contract and ZCF never have direct access to - * the users' payments or the Zoe purses. - * - * @property {GetInvitationIssuer} getInvitationIssuer - * - * Zoe has a single `invitationIssuer` for the entirety of its - * lifetime. By having a reference to Zoe, a user can get the - * `invitationIssuer` and thus validate any `invitation` they receive - * from someone else. The mint associated with the invitationIssuer - * creates the ERTP payments that represent the right to interact with - * a smart contract in particular ways. - * - * @property {InstallBundle} install - * @property {InstallBundleID} installBundleID - * @property {import('./utils.js').StartInstance} startInstance - * @property {Offer} offer - * @property {import('./utils.js').GetPublicFacet} getPublicFacet - * @property {GetIssuers} getIssuers - * @property {GetBrands} getBrands - * @property {import('./utils.js').GetTerms} getTerms - * @property {GetOfferFilter} getOfferFilter - * @property {GetInstallationForInstance} getInstallationForInstance - * @property {GetInstance} getInstance - * @property {GetInstallation} getInstallation - * @property {GetInvitationDetails} getInvitationDetails - * Return an object with the instance, installation, description, invitation - * handle, and any custom properties specific to the contract. - * @property {GetFeeIssuer} getFeeIssuer - * @property {GetConfiguration} getConfiguration - * @property {GetBundleIDFromInstallation} getBundleIDFromInstallation - * @property {(invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined} getProposalShapeForInvitation - * Return the pattern (if any) associated with the invitationHandle that a - * proposal is required to match to be accepted by zoe.offer(). - */ - -/** - * @callback GetInvitationIssuer - * @returns {Promise>} - */ - -/** - * @callback GetFeeIssuer - * @returns {Promise>} - */ - -/** - * @callback GetConfiguration - * @returns {{ - * feeIssuerConfig: FeeIssuerConfig, - * }} - */ - -/** - * @callback GetIssuers - * @param {import('./utils.js').Instance} instance - * @returns {Promise} - */ - -/** - * @callback GetBrands - * @param {import('./utils.js').Instance} instance - * @returns {Promise} - */ - -/** - * @callback GetOfferFilter - * @param {import('./utils.js').Instance} instance - * @returns {string[]} - */ - -/** - * @callback SetOfferFilter - * @param {Instance} instance - * @param {string[]} strings - */ - -/** - * @callback GetInstallationForInstance - * @param {import('./utils.js').Instance} instance - * @returns {Promise} - */ - -/** - * @callback GetInstance - * @param {ERef} invitation - * @returns {Promise>} - */ - -/** - * @callback GetInstallation - * @param {ERef} invitation - * @returns {Promise} - */ - -/** - * @callback GetInvitationDetails - * @param {ERef>} invitation - * @returns {Promise} - */ - -// TODO remove support for source bundles, leaving only support for hash bundles. -// https://github.com/Agoric/agoric-sdk/issues/4565 -/** - * @callback InstallBundle - * - * Create an installation by safely evaluating the code and - * registering it with Zoe. Returns an installation. - * - * @param {Bundle | SourceBundle} bundle - * @param {string} [bundleLabel] - * @returns {Promise} - */ - -// TODO consolidate installBundleID into install. -// https://github.com/Agoric/agoric-sdk/issues/4974 -/** - * @callback InstallBundleID - * - * Create an installation from a Bundle ID. Returns an installation. - * - * @param {BundleID} bundleID - * @param {string} [bundleLabel] - * @returns {Promise} - */ - -/** - * @callback GetBundleIDFromInstallation - * - * Verify that an alleged Installation is real, and return the Bundle ID it - * will use for contract code. - * - * @param {ERef} allegedInstallation - * @returns {Promise} - */ - -/** - * @typedef {( - * invitation: ERef>, - * proposal?: Proposal, - * paymentKeywordRecord?: PaymentPKeywordRecord, - * offerArgs?: Args, - * ) => Promise> - * } Offer - * - * To redeem an invitation, the user normally provides a proposal (their - * rules for the offer) as well as payments to be escrowed by Zoe. If - * either the proposal or payments would be empty, indicate this by - * omitting that argument or passing undefined, rather than passing an - * empty record. - * - * The proposal has three parts: `want` and `give` are used by Zoe to - * enforce offer safety, and `exit` is used to specify the particular - * payout-liveness policy that Zoe can guarantee. `want` and `give` - * are objects with keywords as keys and amounts as values. - * `paymentKeywordRecord` is a record with keywords as keys, and the - * values are the actual payments to be escrowed. A payment is - * expected for every rule under `give`. - */ - -/** - * Zoe uses seats to access or manipulate offers. They let contracts and users - * interact with them. Zoe has two kinds of seats. ZCFSeats are used within - * contracts and with zcf methods. UserSeats represent offers external to Zoe - * and the contract. The party who exercises an invitation and sends the offer() - * message to Zoe gets a UserSeat that can check payouts' status or retrieve the - * result of processing the offer in the contract. This varies, but examples are - * a string and an invitation for another seat. - * - * Also, a UserSeat can be handed to an agent outside Zoe and the contract, - * letting them query or monitor the current state, access the payouts and - * result, and, if it's allowed for this seat, call tryExit(). - * - * Since anyone can attempt to exit the seat if they have a reference to it, you - * should only share a UserSeat with trusted parties. - * - * UserSeat includes queries for the associated offer's current state and an - * operation to request that the offer exit, as follows: - * - * @see {@link https://docs.agoric.com/zoe/api/zoe.html#userseat-object}} - * @template {object} [OR=unknown] - * @typedef {object} UserSeat - * @property {() => Promise} getProposal - * @property {() => Promise} getPayouts - * returns a promise for a KeywordPaymentRecord containing all the payouts from - * this seat. The promise will resolve after the seat has exited. - * @property {(keyword: Keyword) => Promise>} getPayout - * returns a promise for the Payment corresponding to the indicated keyword. - * The promise will resolve after the seat has exited. If there is no payment - * corresponding to the keyword, an error will be thrown. (It used to return - * undefined.) - * @property {() => Promise} getOfferResult - * @property {() => void} [tryExit] - * Note: Only works if the seat's `proposal` has an `OnDemand` `exit` clause. Zoe's - * offer-safety guarantee applies no matter how a seat's interaction with a - * contract ends. Under normal circumstances, the participant might be able to - * call `tryExit()`, or the contract might do something explicitly. On exiting, - * the seat holder gets its current `allocation` and the `seat` can no longer - * interact with the contract. - * @property {() => Promise} hasExited - * Returns true if the seat has exited, false if it is still active. - * @property {() => Promise<0|1>} numWantsSatisfied returns 1 if the proposal's - * want clause was satisfied by the final allocation, otherwise 0. This is - * numeric to support a planned enhancement called "multiples" which will allow - * the return value to be any non-negative number. The promise will resolve - * after the seat has exited. - * @property {() => Promise} getFinalAllocation - * return a promise for the final allocation. The promise will resolve after the - * seat has exited. - * @property {() => Subscriber} getExitSubscriber returns a subscriber that - * will be notified when the seat has exited or failed. - */ - -/** - * @typedef {Partial} Proposal - * - * @typedef {{give: AmountKeywordRecord, - * want: AmountKeywordRecord, - * exit: ExitRule - * }} ProposalRecord - */ - -/** - * @typedef {Record} AmountKeywordRecord - * - * The keys are keywords, and the values are amounts. For example: - * { Asset: AmountMath.make(assetBrand, 5n), Price: - * AmountMath.make(priceBrand, 9n) } - */ - -/** - * @typedef {object} Waker - * @property {() => void} wake - */ - -/** - * @typedef {object} OnDemandExitRule - * @property {null} onDemand - */ - -/** - * @typedef {object} WaivedExitRule - * @property {null} waived - */ - -/** - * @typedef {object} AfterDeadlineExitRule - * @property {{timer: import('@agoric/time').TimerService, deadline: import('@agoric/time').Timestamp}} afterDeadline - */ - -/** - * @typedef {OnDemandExitRule | WaivedExitRule | AfterDeadlineExitRule} ExitRule - * - * The possible keys are 'waived', 'onDemand', and 'afterDeadline'. - * `timer` and `deadline` only are used for the `afterDeadline` key. - * The possible records are: - * `{ waived: null }` - * `{ onDemand: null }` - * `{ afterDeadline: { timer :Timer, deadline :Deadline } }` - */ - -/** - * @typedef {import('./utils.js').Instance} Instance - */ - -/** - * @typedef {{bundleCap: import('@agoric/swingset-vat').BundleCap } | {name: string} | {id: BundleID}} ZCFSpec - */ - -/** - * @typedef {Record} SourceBundle - * Opaque type for a JSONable source bundle - */ - -/** - * @typedef {Record>>} PaymentPKeywordRecord - * @typedef {Record>} PaymentKeywordRecord - */ - -/** - * @typedef {object} InvitationDetails - * @property {Installation} installation - * @property {import('./utils.js').Instance} instance - * @property {InvitationHandle} handle - * @property {string} description - * @property {Record} [customDetails] - */ - -/** - * @template [SF=any] contract start function - * @typedef {import('./utils.js').Installation} Installation - */ - -/** - * @template {Installation} I - * @typedef {import('./utils.js').InstallationStart} InstallationStart - */ - -/** - * @typedef {object} FeeIssuerConfig - * @property {string} name - * @property {AssetKind} assetKind - * @property {DisplayInfo} displayInfo - */ - -/** - * @typedef {object} ZoeFeesConfig - * @property {NatValue} getPublicFacetFee - */ - -/** - * @typedef {Handle<'feeMintAccess'>} FeeMintAccess - */ +console.error( + 'NOTICE: src/zoeService/types-ambient.js no longer provides types; use explicit imports or the top level `/exported.js`', +); diff --git a/packages/zoe/src/zoeService/types.ts b/packages/zoe/src/zoeService/types.ts new file mode 100644 index 00000000000..effa5a38e07 --- /dev/null +++ b/packages/zoe/src/zoeService/types.ts @@ -0,0 +1,299 @@ +import type { + AnyAmount, + AssetKind, + DisplayInfo, + Issuer, + NatValue, + Payment, +} from '@agoric/ertp'; +import type { Subscriber } from '@agoric/notifier'; +import type { ERef, EReturn } from '@endo/eventual-send'; +import type { Bundle, BundleID } from '@agoric/swingset-vat'; +import type { ContractStartFunction, StartParams } from './utils.js'; + +export type IssuerKeywordRecord = Record>; + +/** @see {@link https://github.com/sindresorhus/type-fest/blob/main/source/is-any.d.ts} */ +type IsAny = 0 extends 1 & NoInfer ? true : false; + +/** + * Zoe provides a framework for deploying and working with smart + * contracts. It is accessed as a long-lived and well-trusted service + * that enforces offer safety for the contracts that use it. Zoe has a + * single `invitationIssuer` for the entirety of its lifetime. By + * having a reference to Zoe, a user can get the `invitationIssuer` + * and thus validate any `invitation` they receive from someone else. + * + * Zoe has two different facets: the public Zoe service and the + * contract facet (ZCF). Each contract instance has a copy of ZCF + * within its vat. The contract and ZCF never have direct access to + * the users' payments or the Zoe purses. + */ +export type ZoeService = { + /** + * Zoe has a single `invitationIssuer` for the entirety of its + * lifetime. By having a reference to Zoe, a user can get the + * `invitationIssuer` and thus validate any `invitation` they receive + * from someone else. The mint associated with the invitationIssuer + * creates the ERTP payments that represent the right to interact with + * a smart contract in particular ways. + */ + getInvitationIssuer: GetInvitationIssuer; + install: InstallBundle; + installBundleID: InstallBundleID; + startInstance: import('./utils.js').StartInstance; + offer: Offer; + getPublicFacet: ( + instance: ERef, + ) => Promise< + IsAny extends true + ? any + : I extends import('./utils.js').Instance< + infer SF extends ContractStartFunction + > + ? IsAny extends true + ? unknown + : EReturn['publicFacet'] + : never + >; + getIssuers: GetIssuers; + getBrands: GetBrands; + getTerms: >( + instance: I, + ) => IsAny extends true + ? Promise + : I extends ERef< + import('./utils.js').Instance + > + ? IsAny extends true + ? Promise + : Promise['terms']> + : never; + getOfferFilter: (instance: ERef) => Promise; + getInstallationForInstance: GetInstallationForInstance; + getInstance: GetInstance; + getInstallation: GetInstallation; + /** + * Return an object with the instance, installation, description, invitation + * handle, and any custom properties specific to the contract. + */ + getInvitationDetails: GetInvitationDetails; + getFeeIssuer: GetFeeIssuer; + getConfiguration: GetConfiguration; + getBundleIDFromInstallation: GetBundleIDFromInstallation; + /** + * Return the pattern (if any) associated with the invitationHandle that a + * proposal is required to match to be accepted by zoe.offer(). + */ + getProposalShapeForInvitation: ( + invitationHandle: InvitationHandle, + ) => import('@endo/patterns').Pattern | undefined; +}; +type GetInvitationIssuer = () => Promise>; +type GetFeeIssuer = () => Promise>; +type GetConfiguration = () => { + feeIssuerConfig: FeeIssuerConfig; +}; +export type GetIssuers = ( + instance: import('./utils.js').Instance, +) => Promise; +export type GetBrands = ( + instance: import('./utils.js').Instance, +) => Promise; +type GetInstallationForInstance = ( + instance: import('./utils.js').Instance, +) => Promise; +export type GetInstance = ( + invitation: ERef, +) => Promise>; +export type GetInstallation = ( + invitation: ERef, +) => Promise; +export type GetInvitationDetails = ( + invitation: ERef>, +) => Promise; +/** + * Create an installation by safely evaluating the code and + * registering it with Zoe. Returns an installation. + */ +export type InstallBundle = ( + bundle: Bundle | SourceBundle, + bundleLabel?: string | undefined, +) => Promise; +/** + * Create an installation from a Bundle ID. Returns an installation. + */ +export type InstallBundleID = ( + bundleID: BundleID, + bundleLabel?: string | undefined, +) => Promise; +/** + * Verify that an alleged Installation is real, and return the Bundle ID it + * will use for contract code. + */ +export type GetBundleIDFromInstallation = ( + allegedInstallation: ERef, +) => Promise; +/** + * To redeem an invitation, the user normally provides a proposal (their + * rules for the offer) as well as payments to be escrowed by Zoe. If + * either the proposal or payments would be empty, indicate this by + * omitting that argument or passing undefined, rather than passing an + * empty record. + * + * The proposal has three parts: `want` and `give` are used by Zoe to + * enforce offer safety, and `exit` is used to specify the particular + * payout-liveness policy that Zoe can guarantee. `want` and `give` + * are objects with keywords as keys and amounts as values. + * `paymentKeywordRecord` is a record with keywords as keys, and the + * values are the actual payments to be escrowed. A payment is + * expected for every rule under `give`. + */ +export type Offer = ( + invitation: ERef>, + proposal?: Proposal, + paymentKeywordRecord?: PaymentPKeywordRecord, + offerArgs?: Args, +) => Promise>; +/** + * Zoe uses seats to access or manipulate offers. They let contracts and users + * interact with them. Zoe has two kinds of seats. ZCFSeats are used within + * contracts and with zcf methods. UserSeats represent offers external to Zoe + * and the contract. The party who exercises an invitation and sends the offer() + * message to Zoe gets a UserSeat that can check payouts' status or retrieve the + * result of processing the offer in the contract. This varies, but examples are + * a string and an invitation for another seat. + * + * Also, a UserSeat can be handed to an agent outside Zoe and the contract, + * letting them query or monitor the current state, access the payouts and + * result, and, if it's allowed for this seat, call tryExit(). + * + * Since anyone can attempt to exit the seat if they have a reference to it, you + * should only share a UserSeat with trusted parties. + * + * UserSeat includes queries for the associated offer's current state and an + * operation to request that the offer exit, as follows: + */ +export type UserSeat = { + getProposal: () => Promise; + /** + * returns a promise for a KeywordPaymentRecord containing all the payouts from + * this seat. The promise will resolve after the seat has exited. + */ + getPayouts: () => Promise; + /** + * returns a promise for the Payment corresponding to the indicated keyword. + * The promise will resolve after the seat has exited. If there is no payment + * corresponding to the keyword, an error will be thrown. (It used to return + * undefined.) + */ + getPayout: (keyword: Keyword) => Promise>; + getOfferResult: () => Promise; + /** + * Note: Only works if the seat's `proposal` has an `OnDemand` `exit` clause. Zoe's + * offer-safety guarantee applies no matter how a seat's interaction with a + * contract ends. Under normal circumstances, the participant might be able to + * call `tryExit()`, or the contract might do something explicitly. On exiting, + * the seat holder gets its current `allocation` and the `seat` can no longer + * interact with the contract. + */ + tryExit?: (() => void) | undefined; + /** + * Returns true if the seat has exited, false if it is still active. + */ + hasExited: () => Promise; + /** + * returns 1 if the proposal's + * want clause was satisfied by the final allocation, otherwise 0. This is + * numeric to support a planned enhancement called "multiples" which will allow + * the return value to be any non-negative number. The promise will resolve + * after the seat has exited. + */ + numWantsSatisfied: () => Promise<0 | 1>; + /** + * return a promise for the final allocation. The promise will resolve after the + * seat has exited. + */ + getFinalAllocation: () => Promise; + /** + * returns a subscriber that + * will be notified when the seat has exited or failed. + */ + getExitSubscriber: () => Subscriber; +}; +export type Proposal = Partial; +export type ProposalRecord = { + give: AmountKeywordRecord; + want: AmountKeywordRecord; + exit: ExitRule; +}; +/** + * The keys are keywords, and the values are amounts. For example: + * { Asset: AmountMath.make(assetBrand, 5n), Price: + * AmountMath.make(priceBrand, 9n) } + */ +export type AmountKeywordRecord = Record; +export type Waker = { + wake: () => void; +}; +export type OnDemandExitRule = { + onDemand: null; +}; +export type WaivedExitRule = { + waived: null; +}; +export type AfterDeadlineExitRule = { + afterDeadline: { + timer: import('@agoric/time').TimerService; + deadline: import('@agoric/time').Timestamp; + }; +}; +/** + * The possible keys are 'waived', 'onDemand', and 'afterDeadline'. + * `timer` and `deadline` only are used for the `afterDeadline` key. + * The possible records are: + * `{ waived: null }` + * `{ onDemand: null }` + * `{ afterDeadline: { timer :Timer, deadline :Deadline } }` + */ +export type ExitRule = + | OnDemandExitRule + | WaivedExitRule + | AfterDeadlineExitRule; +export type Instance = import('./utils.js').Instance; +export type ZCFSpec = + | { + bundleCap: import('@agoric/swingset-vat').BundleCap; + } + | { + name: string; + } + | { + /** Bundle ID */ + id: string; + }; +/** + * Opaque type for a JSONable source bundle + */ +export type SourceBundle = Record; +export type PaymentPKeywordRecord = Record>>; +export type PaymentKeywordRecord = Record>; +export type InvitationDetails = { + installation: Installation; + instance: import('./utils.js').Instance; + handle: InvitationHandle; + description: string; + customDetails?: Record | undefined; +}; +export type Installation = import('./utils.js').Installation; +export type InstallationStart = + import('./utils.js').InstallationStart; +export type FeeIssuerConfig = { + name: string; + assetKind: AssetKind; + displayInfo: DisplayInfo; +}; +export type ZoeFeesConfig = { + getPublicFacetFee: NatValue; +}; +export type FeeMintAccess = Handle<'feeMintAccess'>; diff --git a/packages/zoe/src/zoeService/utils.d.ts b/packages/zoe/src/zoeService/utils.d.ts index 4637d5427d4..0af9099e45a 100644 --- a/packages/zoe/src/zoeService/utils.d.ts +++ b/packages/zoe/src/zoeService/utils.d.ts @@ -1,13 +1,10 @@ -// Ambient types -import '../types-ambient.js'; -import '../contractFacet/types-ambient.js'; - import type { Issuer } from '@agoric/ertp/src/types.js'; import type { TagContainer } from '@agoric/internal/src/tagged.js'; import type { Baggage } from '@agoric/swingset-liveslots'; import type { VatUpgradeResults } from '@agoric/swingset-vat'; import type { RemotableObject } from '@endo/marshal'; import type { FarRef } from '@endo/far'; +import type { ZCF } from '../types-index.js'; // XXX https://github.com/Agoric/agoric-sdk/issues/4565 type SourceBundle = Record; diff --git a/packages/zoe/src/zoeService/utils.test-d.ts b/packages/zoe/src/zoeService/utils.test-d.ts index 121b9700f71..307ce082933 100644 --- a/packages/zoe/src/zoeService/utils.test-d.ts +++ b/packages/zoe/src/zoeService/utils.test-d.ts @@ -1,5 +1,6 @@ import { E } from '@endo/far'; import type { StartedInstanceKit } from './utils.js'; +import type { ZCF } from '../types-index.js'; const someContractStartFn = ( zcf: ZCF, diff --git a/packages/zoe/src/zoeService/zoe.js b/packages/zoe/src/zoeService/zoe.js index e8983bdfb57..caa7570f597 100644 --- a/packages/zoe/src/zoeService/zoe.js +++ b/packages/zoe/src/zoeService/zoe.js @@ -28,7 +28,11 @@ import { getZcfBundleCap } from './createZCFVat.js'; import { defaultFeeIssuerConfig, prepareFeeMint } from './feeMint.js'; import { ZoeServiceI } from '../typeGuards.js'; -/** @import {Baggage} from '@agoric/vat-data' */ +/** + * @import {VatAdminSvc} from '@agoric/swingset-vat'; + * @import {Baggage} from '@agoric/vat-data'; + * @import {FeeIssuerConfig, FeeMintAccess, ZCFSpec, ZoeService} from './types.js'; + */ /** * Create a durable instance of Zoe. @@ -289,3 +293,6 @@ export { makeDurableZoeKit, makeZoeKit }; /** * @typedef {ReturnType} ZoeKit */ + +// eslint-disable-next-line import/export -- no named value exports; only types +export * from '../types-index.js'; diff --git a/packages/zoe/src/zoeService/zoeStorageManager.js b/packages/zoe/src/zoeService/zoeStorageManager.js index 80d0c2cd5d6..61739e70a1c 100644 --- a/packages/zoe/src/zoeService/zoeStorageManager.js +++ b/packages/zoe/src/zoeService/zoeStorageManager.js @@ -29,7 +29,10 @@ import { ZoeStorageManagerIKit, } from '../typeGuards.js'; -/** @import {Baggage} from '@agoric/vat-data' */ +/** + * @import {Baggage} from '@agoric/vat-data'; + * @import {ContractMeta, ContractStartFn, InvitationAmount, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ const { ownKeys } = Reflect; diff --git a/packages/zoe/test/minimalMakeKindContract.js b/packages/zoe/test/minimalMakeKindContract.js index f9c98590977..a89f05ab4b8 100644 --- a/packages/zoe/test/minimalMakeKindContract.js +++ b/packages/zoe/test/minimalMakeKindContract.js @@ -1,4 +1,5 @@ /* global VatData */ +// @ts-nocheck const start = _zcf => { VatData.defineKind('x', () => {}, {}); diff --git a/packages/zoe/test/offerArgsUsageContract.js b/packages/zoe/test/offerArgsUsageContract.js index 9679585279c..25974362e4f 100644 --- a/packages/zoe/test/offerArgsUsageContract.js +++ b/packages/zoe/test/offerArgsUsageContract.js @@ -1,3 +1,7 @@ +/** + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + /** @param {ZCF} zcf */ const start = zcf => { /** @type {OfferHandler} */ diff --git a/packages/zoe/test/swingsetTests/brokenContracts/bootstrap.js b/packages/zoe/test/swingsetTests/brokenContracts/bootstrap.js index f29b387c32d..086327417b5 100644 --- a/packages/zoe/test/swingsetTests/brokenContracts/bootstrap.js +++ b/packages/zoe/test/swingsetTests/brokenContracts/bootstrap.js @@ -2,6 +2,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; import { makeIssuerKit, AmountMath } from '@agoric/ertp'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + const setupBasicMints = () => { const all = [ makeIssuerKit('moola'), diff --git a/packages/zoe/test/swingsetTests/makeKind/bootstrap.js b/packages/zoe/test/swingsetTests/makeKind/bootstrap.js index 3f6babe74f2..c9c674c440f 100644 --- a/packages/zoe/test/swingsetTests/makeKind/bootstrap.js +++ b/packages/zoe/test/swingsetTests/makeKind/bootstrap.js @@ -1,6 +1,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + export function buildRootObject(vatPowers) { const { D } = vatPowers; return Far('root', { diff --git a/packages/zoe/test/swingsetTests/offerArgs/bootstrap.js b/packages/zoe/test/swingsetTests/offerArgs/bootstrap.js index a45a0dc319f..583e29ca1ea 100644 --- a/packages/zoe/test/swingsetTests/offerArgs/bootstrap.js +++ b/packages/zoe/test/swingsetTests/offerArgs/bootstrap.js @@ -1,6 +1,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + export function buildRootObject(vatPowers) { const { D } = vatPowers; return Far('root', { diff --git a/packages/zoe/test/swingsetTests/privateArgs/bootstrap.js b/packages/zoe/test/swingsetTests/privateArgs/bootstrap.js index d1c238d7469..355a6d44906 100644 --- a/packages/zoe/test/swingsetTests/privateArgs/bootstrap.js +++ b/packages/zoe/test/swingsetTests/privateArgs/bootstrap.js @@ -1,6 +1,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + export function buildRootObject(vatPowers) { const { D } = vatPowers; return Far('root', { diff --git a/packages/zoe/test/swingsetTests/runMint/vat-alice.js b/packages/zoe/test/swingsetTests/runMint/vat-alice.js index 9fdc73127bf..ab2f5d679d8 100644 --- a/packages/zoe/test/swingsetTests/runMint/vat-alice.js +++ b/packages/zoe/test/swingsetTests/runMint/vat-alice.js @@ -1,6 +1,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + /** * @param {*} log * @param {ZoeService} zoe diff --git a/packages/zoe/test/swingsetTests/zoe/bootstrap.js b/packages/zoe/test/swingsetTests/zoe/bootstrap.js index 6f87bfe669a..ab383c3eed1 100644 --- a/packages/zoe/test/swingsetTests/zoe/bootstrap.js +++ b/packages/zoe/test/swingsetTests/zoe/bootstrap.js @@ -3,6 +3,10 @@ import { Far } from '@endo/marshal'; import { makeIssuerKit, AmountMath } from '@agoric/ertp'; import buildManualTimer from '../../../tools/manualTimer.js'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + const setupBasicMints = () => { const all = [ makeIssuerKit('moola'), diff --git a/packages/zoe/test/types.test-d.ts b/packages/zoe/test/types.test-d.ts index f50bd4703e9..f1b5b55cd35 100644 --- a/packages/zoe/test/types.test-d.ts +++ b/packages/zoe/test/types.test-d.ts @@ -9,8 +9,16 @@ import { expectNotType, expectType } from 'tsd'; import { M, type Key } from '@endo/patterns'; // 'prepare' is deprecated but still supported +import type { Brand } from '@agoric/ertp'; import type { prepare as scaledPriceAuthorityStart } from '../src/contracts/scaledPriceAuthority.js'; import type { Instance } from '../src/zoeService/utils.js'; +import type { + ContractMeta, + Invitation, + ZCF, + ZCFSeat, + ZoeService, +} from '../src/types-index.js'; const zoe = {} as ZoeService; const scaledPriceInstallation = {} as Installation< diff --git a/packages/zoe/test/unitTests/blockedOffers.test.js b/packages/zoe/test/unitTests/blockedOffers.test.js index d59cea38d6f..84ec8ad7de2 100644 --- a/packages/zoe/test/unitTests/blockedOffers.test.js +++ b/packages/zoe/test/unitTests/blockedOffers.test.js @@ -15,6 +15,10 @@ import { import { assertPayoutAmount } from '../zoeTestHelpers.js'; import { makeOffer } from './makeOffer.js'; +/** + * @import {ContractMeta, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + const dirname = path.dirname(new URL(import.meta.url).pathname); const contractRoot = `${dirname}/zcf/zcfTesterContract.js`; diff --git a/packages/zoe/test/unitTests/bounty.js b/packages/zoe/test/unitTests/bounty.js index bfec6ca4185..53503ca6c9a 100644 --- a/packages/zoe/test/unitTests/bounty.js +++ b/packages/zoe/test/unitTests/bounty.js @@ -3,6 +3,10 @@ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; import { AmountMath } from '@agoric/ertp'; +/** + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + /** * This contract lets a funder endow a bounty that will pay out if an Oracle * reports an event at a deadline. To make a simple contract for a test the diff --git a/packages/zoe/test/unitTests/contractSupport/zoeHelpers.test.js b/packages/zoe/test/unitTests/contractSupport/zoeHelpers.test.js index 7965ce0f4e1..df800717745 100644 --- a/packages/zoe/test/unitTests/contractSupport/zoeHelpers.test.js +++ b/packages/zoe/test/unitTests/contractSupport/zoeHelpers.test.js @@ -8,6 +8,10 @@ import { satisfies, } from '../../../src/contractSupport/index.js'; +/** + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + test('ZoeHelpers messages', t => { t.is( defaultAcceptanceMsg, diff --git a/packages/zoe/test/unitTests/contracts/autoswap.test.js b/packages/zoe/test/unitTests/contracts/autoswap.test.js index 8cb619ffe1f..a5485d0e50e 100644 --- a/packages/zoe/test/unitTests/contracts/autoswap.test.js +++ b/packages/zoe/test/unitTests/contracts/autoswap.test.js @@ -111,6 +111,7 @@ test('autoSwap API interactions, no jig', async t => { const bobInstance = await E(zoe).getInstance(bobExclInvitation); const bobInstallation = await E(zoe).getInstallation(bobExclInvitation); t.is(bobInstallation, installation, `installation`); + /** @type {any} */ const bobAutoswap = E(zoe).getPublicFacet(bobInstance); // Bob looks up how much he can get in simoleans for 3 moola diff --git a/packages/zoe/test/unitTests/contracts/callSpread.test.js b/packages/zoe/test/unitTests/contracts/callSpread.test.js index b9ffec421fb..4df618737dd 100644 --- a/packages/zoe/test/unitTests/contracts/callSpread.test.js +++ b/packages/zoe/test/unitTests/contracts/callSpread.test.js @@ -14,6 +14,10 @@ import { } from '../../zoeTestHelpers.js'; import { makeFakePriceAuthority } from '../../../tools/fakePriceAuthority.js'; +/** + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + const dirname = path.dirname(new URL(import.meta.url).pathname); const fundedCallSpread = `${dirname}/../../../src/contracts/callSpread/fundedCallSpread.js`; diff --git a/packages/zoe/test/unitTests/contracts/coveredCall.test.js b/packages/zoe/test/unitTests/contracts/coveredCall.test.js index aca556a0aaa..dc89f50aa8d 100644 --- a/packages/zoe/test/unitTests/contracts/coveredCall.test.js +++ b/packages/zoe/test/unitTests/contracts/coveredCall.test.js @@ -15,6 +15,10 @@ import { setup } from '../setupBasicMints.js'; import { setupNonFungible } from '../setupNonFungibleMints.js'; import { assertAmountsEqual } from '../../zoeTestHelpers.js'; +/** + * @import {FeeIssuerConfig, InvitationDetails} from '@agoric/zoe'; + */ + const dirname = path.dirname(new URL(import.meta.url).pathname); const coveredCallRoot = `${dirname}/../../../src/contracts/coveredCall.js`; diff --git a/packages/zoe/test/unitTests/contracts/mintPayments.test.js b/packages/zoe/test/unitTests/contracts/mintPayments.test.js index d4bd1d0b5bc..aabcd825673 100644 --- a/packages/zoe/test/unitTests/contracts/mintPayments.test.js +++ b/packages/zoe/test/unitTests/contracts/mintPayments.test.js @@ -64,6 +64,7 @@ test('zoe - mint payments', async t => { // Let's get the tokenIssuer from the contract so we can evaluate // what we get as our payout + /** @type {any} */ const publicFacet = await E(zoe).getPublicFacet(instance); const tokenIssuer = await E(publicFacet).getTokenIssuer(); const tokenBrand = await E(tokenIssuer).getBrand(); @@ -158,6 +159,7 @@ test('zoe - mint payments with unrelated give and want', async t => { // Let's get the tokenIssuer from the contract so we can evaluate // what we get as our payout + /** @type {any} */ const publicFacet = await E(zoe).getPublicFacet(instance); const tokenIssuer = await E(publicFacet).getTokenIssuer(); const tokenBrand = await E(tokenIssuer).getBrand(); diff --git a/packages/zoe/test/unitTests/contracts/oracle.test.js b/packages/zoe/test/unitTests/contracts/oracle.test.js index 4680c10fd64..7998da8eca6 100644 --- a/packages/zoe/test/unitTests/contracts/oracle.test.js +++ b/packages/zoe/test/unitTests/contracts/oracle.test.js @@ -12,6 +12,10 @@ import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp'; import { makeFakeVatAdmin } from '../../../tools/fakeVatAdmin.js'; import { makeZoeForTest } from '../../../tools/setup-zoe.js'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + /** * @typedef {object} TestContext * @property {ZoeService} zoe diff --git a/packages/zoe/test/unitTests/contracts/priceAggregator.test.js b/packages/zoe/test/unitTests/contracts/priceAggregator.test.js index dc8282c7754..ca6ce00c138 100644 --- a/packages/zoe/test/unitTests/contracts/priceAggregator.test.js +++ b/packages/zoe/test/unitTests/contracts/priceAggregator.test.js @@ -29,6 +29,7 @@ import { } from '../../../src/contractSupport/ratio.js'; /** + * @import {FeeIssuerConfig, ZoeService} from '@agoric/zoe'; * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; * @import {ZoeManualTimer} from '../../../tools/manualTimer.js'; */ diff --git a/packages/zoe/test/unitTests/contracts/scaledPriceAuthority.test.js b/packages/zoe/test/unitTests/contracts/scaledPriceAuthority.test.js index f4e10c86f34..d42156d5a28 100644 --- a/packages/zoe/test/unitTests/contracts/scaledPriceAuthority.test.js +++ b/packages/zoe/test/unitTests/contracts/scaledPriceAuthority.test.js @@ -13,6 +13,10 @@ import { makeFakeVatAdmin } from '../../../tools/fakeVatAdmin.js'; import buildManualTimer from '../../../tools/manualTimer.js'; import { makeManualPriceAuthority } from '../../../tools/manualPriceAuthority.js'; +/** + * @import {FeeIssuerConfig, ZoeService} from '@agoric/zoe'; + */ + // This contract still uses 'prepare', so this test covers that case. /** * @typedef {object} TestContext diff --git a/packages/zoe/test/unitTests/contracts/sellTickets.test.js b/packages/zoe/test/unitTests/contracts/sellTickets.test.js index 92e86ea357a..cb3b5bb9d80 100644 --- a/packages/zoe/test/unitTests/contracts/sellTickets.test.js +++ b/packages/zoe/test/unitTests/contracts/sellTickets.test.js @@ -200,7 +200,9 @@ test(`mint and sell opera tickets`, async t => { const { value: [{ instance }], } = await E(invitationIssuer).getAmountOf(invitation); + /** @type {any} */ const ticketSalesPublicFacet = await E(zoe).getPublicFacet(instance); + /** @type {any} */ const terms = await E(zoe).getTerms(instance); const ticketIssuer = await E(ticketSalesPublicFacet).getItemsIssuer(); const ticketBrand = await E(ticketIssuer).getBrand(); @@ -289,6 +291,7 @@ test(`mint and sell opera tickets`, async t => { const { value: [{ instance: ticketSalesInstance }], } = await E(invitationIssuer).getAmountOf(invitation); + /** @type {any} */ const ticketSalesPublicFacet = await E(zoe).getPublicFacet(ticketSalesInstance); const ticketIssuer = await E(ticketSalesPublicFacet).getItemsIssuer(); @@ -297,6 +300,7 @@ test(`mint and sell opera tickets`, async t => { const jokerPurse = await E(moolaIssuer).makeEmptyPurse(); await E(jokerPurse).deposit(moola100Payment); + /** @type {any} */ const { pricePerItem } = await E(zoe).getTerms(ticketSalesInstance); // Joker does NOT check available tickets and tries to buy the ticket @@ -364,6 +368,7 @@ test(`mint and sell opera tickets`, async t => { const { value: [{ instance: ticketSalesInstance }], } = await E(invitationIssuer).getAmountOf(invitation); + /** @type {any} */ const ticketSalesPublicFacet = await E(zoe).getPublicFacet(ticketSalesInstance); const ticketIssuer = await E(ticketSalesPublicFacet).getItemsIssuer(); @@ -433,8 +438,10 @@ test(`mint and sell opera tickets`, async t => { const { value: [{ instance: ticketSalesInstance }], } = await E(invitationIssuer).getAmountOf(invitation); + /** @type {any} */ const ticketSalesPublicFacet = await E(zoe).getPublicFacet(ticketSalesInstance); + /** @type {any} */ const terms = await E(zoe).getTerms(ticketSalesInstance); const ticketIssuer = await E(ticketSalesPublicFacet).getItemsIssuer(); const ticketBrand = await E(ticketIssuer).getBrand(); diff --git a/packages/zoe/test/unitTests/installFromSource.js b/packages/zoe/test/unitTests/installFromSource.js index c7714387781..254803951ec 100644 --- a/packages/zoe/test/unitTests/installFromSource.js +++ b/packages/zoe/test/unitTests/installFromSource.js @@ -1,6 +1,10 @@ import bundleSource from '@endo/bundle-source'; import { E } from '@endo/eventual-send'; +/** + * @import {FeeIssuerConfig, ZoeService} from '@agoric/zoe'; + */ + /** * @param {ZoeService} zoe * @param {*} vatAdminState diff --git a/packages/zoe/test/unitTests/makeOffer.js b/packages/zoe/test/unitTests/makeOffer.js index ece49066122..6ac5df458fe 100644 --- a/packages/zoe/test/unitTests/makeOffer.js +++ b/packages/zoe/test/unitTests/makeOffer.js @@ -1,6 +1,11 @@ import { assert } from '@endo/errors'; import { E } from '@endo/eventual-send'; +/** + * @import {PaymentPKeywordRecord, Proposal, UserSeat, ZoeService } from '@agoric/zoe'; + * @import {Pattern} from '@endo/patterns'; + */ + /** * @param {ERef} zoe * @param {ZCF} zcf diff --git a/packages/zoe/test/unitTests/setupBasicMints.js b/packages/zoe/test/unitTests/setupBasicMints.js index 0ca43e22b0e..a16f9ee1826 100644 --- a/packages/zoe/test/unitTests/setupBasicMints.js +++ b/packages/zoe/test/unitTests/setupBasicMints.js @@ -3,6 +3,10 @@ import { makeScalarMapStore } from '@agoric/store'; import { makeZoeForTest } from '../../tools/setup-zoe.js'; import { makeFakeVatAdmin } from '../../tools/fakeVatAdmin.js'; +/** + * @import {MapStore} from '@agoric/swingset-liveslots'; + */ + export const setup = () => { const moolaKit = makeIssuerKit('moola'); const simoleanKit = makeIssuerKit('simoleans'); diff --git a/packages/zoe/test/unitTests/zcf/offer-proposalShape.test.js b/packages/zoe/test/unitTests/zcf/offer-proposalShape.test.js index ed4ea98cd4a..8f49c28309c 100644 --- a/packages/zoe/test/unitTests/zcf/offer-proposalShape.test.js +++ b/packages/zoe/test/unitTests/zcf/offer-proposalShape.test.js @@ -11,6 +11,10 @@ import { makeZoeForTest } from '../../../tools/setup-zoe.js'; import { setup } from '../setupBasicMints.js'; import { makeFakeVatAdmin } from '../../../tools/fakeVatAdmin.js'; +/** + * @import {ZoeService} from '@agoric/zoe'; + */ + const dirname = path.dirname(new URL(import.meta.url).pathname); const contractRoot = `${dirname}/zcfTesterContract.js`; diff --git a/packages/zoe/test/unitTests/zcf/setupZcfTest.js b/packages/zoe/test/unitTests/zcf/setupZcfTest.js index 350dd664e35..f721dddabd6 100644 --- a/packages/zoe/test/unitTests/zcf/setupZcfTest.js +++ b/packages/zoe/test/unitTests/zcf/setupZcfTest.js @@ -11,6 +11,10 @@ const dirname = path.dirname(new URL(import.meta.url).pathname); const contractRoot = `${dirname}/zcfTesterContract.js`; +/** + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + /** * Test setup utility * diff --git a/packages/zoe/test/unitTests/zcf/zcf.test.js b/packages/zoe/test/unitTests/zcf/zcf.test.js index d6a7d967e89..6107c1a5187 100644 --- a/packages/zoe/test/unitTests/zcf/zcf.test.js +++ b/packages/zoe/test/unitTests/zcf/zcf.test.js @@ -12,6 +12,10 @@ import buildManualTimer from '../../../tools/manualTimer.js'; import { setupZCFTest } from './setupZcfTest.js'; import { assertAmountsEqual } from '../../zoeTestHelpers.js'; +/** + * @import {ContractMeta, Invitation, OfferHandler, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + test(`zcf.getZoeService`, async t => { const { zoe, zcf } = await setupZCFTest(); const zoeService = await zcf.getZoeService(); diff --git a/packages/zoe/test/unitTests/zcf/zcfSeat.test.js b/packages/zoe/test/unitTests/zcf/zcfSeat.test.js index 568815a6cb1..209e98e039f 100644 --- a/packages/zoe/test/unitTests/zcf/zcfSeat.test.js +++ b/packages/zoe/test/unitTests/zcf/zcfSeat.test.js @@ -9,6 +9,10 @@ import { makeZoeForTest } from '../../../tools/setup-zoe.js'; import { setup } from '../setupBasicMints.js'; import { makeFakeVatAdmin } from '../../../tools/fakeVatAdmin.js'; +/** + * @import {ContractMeta, ContractStartFn, Invitation, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe'; + */ + const dirname = path.dirname(new URL(import.meta.url).pathname); const contractRoot = `${dirname}/zcfTesterContract.js`; diff --git a/packages/zoe/tools/scriptedOracle.js b/packages/zoe/tools/scriptedOracle.js index 41e91096507..ce8135b26e2 100644 --- a/packages/zoe/tools/scriptedOracle.js +++ b/packages/zoe/tools/scriptedOracle.js @@ -2,6 +2,10 @@ import { TimeMath } from '@agoric/time'; import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; +/** + * @import {ZoeService} from '../src/types-index.js'; + */ + /** * Start an instance of an Oracle that follows a script. The Oracle has access * to a timer, and looks in the script for events indexed by the current time. diff --git a/packages/zoe/tools/setup-zoe.js b/packages/zoe/tools/setup-zoe.js index 5914ce20c04..ca9988bb1c3 100644 --- a/packages/zoe/tools/setup-zoe.js +++ b/packages/zoe/tools/setup-zoe.js @@ -5,6 +5,10 @@ import bundleSource from '@endo/bundle-source'; import { makeDurableZoeKit } from '../src/zoeService/zoe.js'; import fakeVatAdmin, { makeFakeVatAdmin } from './fakeVatAdmin.js'; +/** + * @import {FeeIssuerConfig} from '../src/types-index.js'; + */ + /** * @param {VatAdminSvc} [vatAdminSvc] */ diff --git a/packages/zoe/tsconfig.json b/packages/zoe/tsconfig.json index a2922a31637..1baf5ff4a7e 100644 --- a/packages/zoe/tsconfig.json +++ b/packages/zoe/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../tsconfig.json", - "compilerOptions": {}, + "compilerOptions": {"skipLibCheck": false}, "include": [ "contractFacet.js", "scripts", diff --git a/packages/zoe/typedoc.json b/packages/zoe/typedoc.json index f5de7d0924e..354b78dc310 100644 --- a/packages/zoe/typedoc.json +++ b/packages/zoe/typedoc.json @@ -4,11 +4,10 @@ ], "entryPoints": [ "src/contractFacet/internal-types.js", - "src/contractFacet/types-ambient.d.ts", + "src/contractFacet/types.js", "src/contractSupport/index.js", "src/contractSupport/types-ambient.js", "src/types.js", - "src/zoeService/types-ambient.js", "src/zoeService/utils.d.ts", "src/zoeService/zoe.js", "tools/manualTimer.js" diff --git a/yarn.lock b/yarn.lock index 6ddf1b52099..72179ab5f59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3729,85 +3729,85 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@8.22.0", "@typescript-eslint/eslint-plugin@^8.0.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.22.0.tgz#63a1b0d24d85a971949f8d71d693019f58d2e861" - integrity sha512-4Uta6REnz/xEJMvwf72wdUnC3rr4jAQf5jnTkeRQ9b6soxLxhDEbS/pfMPoJLDfFPNVRdryqWUIV/2GZzDJFZw== +"@typescript-eslint/eslint-plugin@8.26.0", "@typescript-eslint/eslint-plugin@^8.0.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.26.0.tgz#7e880faf91f89471c30c141951e15f0eb3a0599e" + integrity sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.22.0" - "@typescript-eslint/type-utils" "8.22.0" - "@typescript-eslint/utils" "8.22.0" - "@typescript-eslint/visitor-keys" "8.22.0" + "@typescript-eslint/scope-manager" "8.26.0" + "@typescript-eslint/type-utils" "8.26.0" + "@typescript-eslint/utils" "8.26.0" + "@typescript-eslint/visitor-keys" "8.26.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" - ts-api-utils "^2.0.0" + ts-api-utils "^2.0.1" -"@typescript-eslint/parser@8.22.0", "@typescript-eslint/parser@^8.0.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.22.0.tgz#f21c5db24271f182ebbb4ba8c7ad3eb76e5f5f3a" - integrity sha512-MqtmbdNEdoNxTPzpWiWnqNac54h8JDAmkWtJExBVVnSrSmi9z+sZUt0LfKqk9rjqmKOIeRhO4fHHJ1nQIjduIQ== +"@typescript-eslint/parser@8.26.0", "@typescript-eslint/parser@^8.0.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.26.0.tgz#9b4d2198e89f64fb81e83167eedd89a827d843a9" + integrity sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA== dependencies: - "@typescript-eslint/scope-manager" "8.22.0" - "@typescript-eslint/types" "8.22.0" - "@typescript-eslint/typescript-estree" "8.22.0" - "@typescript-eslint/visitor-keys" "8.22.0" + "@typescript-eslint/scope-manager" "8.26.0" + "@typescript-eslint/types" "8.26.0" + "@typescript-eslint/typescript-estree" "8.26.0" + "@typescript-eslint/visitor-keys" "8.26.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.22.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.22.0.tgz#e85836ddeb8eae715f870628bcc32fe96aaf4d0e" - integrity sha512-/lwVV0UYgkj7wPSw0o8URy6YI64QmcOdwHuGuxWIYznO6d45ER0wXUbksr9pYdViAofpUCNJx/tAzNukgvaaiQ== +"@typescript-eslint/scope-manager@8.26.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.26.0.tgz#b06623fad54a3a77fadab5f652ef75ed3780b545" + integrity sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA== dependencies: - "@typescript-eslint/types" "8.22.0" - "@typescript-eslint/visitor-keys" "8.22.0" + "@typescript-eslint/types" "8.26.0" + "@typescript-eslint/visitor-keys" "8.26.0" -"@typescript-eslint/type-utils@8.22.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.22.0.tgz#cd9f23c23f021357ef0baa3490d4d96edcc97509" - integrity sha512-NzE3aB62fDEaGjaAYZE4LH7I1MUwHooQ98Byq0G0y3kkibPJQIXVUspzlFOmOfHhiDLwKzMlWxaNv+/qcZurJA== +"@typescript-eslint/type-utils@8.26.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.26.0.tgz#9ee8cc98184b5f66326578de9c097edc89da6f68" + integrity sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q== dependencies: - "@typescript-eslint/typescript-estree" "8.22.0" - "@typescript-eslint/utils" "8.22.0" + "@typescript-eslint/typescript-estree" "8.26.0" + "@typescript-eslint/utils" "8.26.0" debug "^4.3.4" - ts-api-utils "^2.0.0" + ts-api-utils "^2.0.1" -"@typescript-eslint/types@8.22.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.22.0.tgz#d9dec7116479ad03aeb6c8ac9c5223c4c79cf360" - integrity sha512-0S4M4baNzp612zwpD4YOieP3VowOARgK2EkN/GBn95hpyF8E2fbMT55sRHWBq+Huaqk3b3XK+rxxlM8sPgGM6A== +"@typescript-eslint/types@8.26.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.26.0.tgz#c4e93a8faf3a38a8d8adb007dc7834f1c89ee7bf" + integrity sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA== -"@typescript-eslint/typescript-estree@8.22.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.22.0.tgz#c188c3e19529d5b3145577c0bd967e2683b114df" - integrity sha512-SJX99NAS2ugGOzpyhMza/tX+zDwjvwAtQFLsBo3GQxiGcvaKlqGBkmZ+Y1IdiSi9h4Q0Lr5ey+Cp9CGWNY/F/w== +"@typescript-eslint/typescript-estree@8.26.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.26.0.tgz#128972172005a7376e34ed2ecba4e29363b0cad1" + integrity sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ== dependencies: - "@typescript-eslint/types" "8.22.0" - "@typescript-eslint/visitor-keys" "8.22.0" + "@typescript-eslint/types" "8.26.0" + "@typescript-eslint/visitor-keys" "8.26.0" debug "^4.3.4" fast-glob "^3.3.2" is-glob "^4.0.3" minimatch "^9.0.4" semver "^7.6.0" - ts-api-utils "^2.0.0" + ts-api-utils "^2.0.1" -"@typescript-eslint/utils@8.22.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.22.0.tgz#c8cc4e52a9c711af8a741a82dc5d7242b7a8dd44" - integrity sha512-T8oc1MbF8L+Bk2msAvCUzjxVB2Z2f+vXYfcucE2wOmYs7ZUwco5Ep0fYZw8quNwOiw9K8GYVL+Kgc2pETNTLOg== +"@typescript-eslint/utils@8.26.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.26.0.tgz#845d20ed8378a5594e6445f54e53b972aee7b3e6" + integrity sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.22.0" - "@typescript-eslint/types" "8.22.0" - "@typescript-eslint/typescript-estree" "8.22.0" + "@typescript-eslint/scope-manager" "8.26.0" + "@typescript-eslint/types" "8.26.0" + "@typescript-eslint/typescript-estree" "8.26.0" -"@typescript-eslint/visitor-keys@8.22.0": - version "8.22.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.22.0.tgz#02cc005014c372033eb9171e2275b76cba722a3f" - integrity sha512-AWpYAXnUgvLNabGTy3uBylkgZoosva/miNd1I8Bz3SjotmQPbVqhO4Cczo8AsZ44XVErEBPr/CRSgaj8sG7g0w== +"@typescript-eslint/visitor-keys@8.26.0": + version "8.26.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.26.0.tgz#a4876216756c69130ea958df3b77222c2ad95290" + integrity sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg== dependencies: - "@typescript-eslint/types" "8.22.0" + "@typescript-eslint/types" "8.26.0" eslint-visitor-keys "^4.2.0" "@yarnpkg/lockfile@^1.1.0": @@ -11789,10 +11789,10 @@ triple-beam@^1.3.0: resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984" integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg== -ts-api-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.0.0.tgz#b9d7d5f7ec9f736f4d0f09758b8607979044a900" - integrity sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ== +ts-api-utils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.0.1.tgz#660729385b625b939aaa58054f45c058f33f10cd" + integrity sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w== ts-blank-space@^0.4.1, ts-blank-space@^0.4.4: version "0.4.4" @@ -12013,16 +12013,16 @@ typedoc@^0.26.7: shiki "^1.16.2" yaml "^2.5.1" -typescript-eslint@^7.3.1, typescript-eslint@^8.14.0, typescript-eslint@^8.22.0: - version "8.22.0" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.22.0.tgz#1d4becf1d65385e57e9271fbd557ccc22f6c0f53" - integrity sha512-Y2rj210FW1Wb6TWXzQc5+P+EWI9/zdS57hLEc0gnyuvdzWo8+Y8brKlbj0muejonhMI/xAZCnZZwjbIfv1CkOw== +typescript-eslint@^7.3.1, typescript-eslint@^8.14.0, typescript-eslint@^8.26.0: + version "8.26.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.26.0.tgz#f44cafdaa6edc99e3612b33b791eb77a56286320" + integrity sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA== dependencies: - "@typescript-eslint/eslint-plugin" "8.22.0" - "@typescript-eslint/parser" "8.22.0" - "@typescript-eslint/utils" "8.22.0" + "@typescript-eslint/eslint-plugin" "8.26.0" + "@typescript-eslint/parser" "8.26.0" + "@typescript-eslint/utils" "8.26.0" -"typescript@5.1.6 - 5.7.x", typescript@^5.4.5: +"typescript@5.1.6 - 5.7.x": version "5.7.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== @@ -12032,16 +12032,16 @@ typescript-eslint@^7.3.1, typescript-eslint@^8.14.0, typescript-eslint@^8.22.0: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typescript@^5.4.5, typescript@~5.8.2: + version "5.8.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4" + integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ== + typescript@~5.6.3: version "5.6.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== -typescript@~5.8.1-rc: - version "5.8.1-rc" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.1-rc.tgz#678b7586bf1d7fdec0dbf35708ab7bb39ce13c3d" - integrity sha512-D8IlSOUk1E08jpFdK81reYkA1a/4XtEdV6MElOGdbu/uOy1RpEDqNO/onWmqUaLkTyeHmmU/QlWvjcM9cqF85g== - uc.micro@^2.0.0, uc.micro@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee"