Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"prettier": "^3.5.3",
"prettier-plugin-jsdoc": "^1.3.2",
"prettier-plugin-sh": "^0.17.2",
"ts-morph": "^27.0.2",
"type-coverage": "^2.29.7",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
import { assert } from '@endo/errors';
import { buildVatController } from '@agoric/swingset-vat';

/**
* @import {SwingSetConfig} from '@agoric/swingset-vat';
*/

const bfile = name => new URL(name, import.meta.url).pathname;

test('ertp service upgrade', async t => {
Expand Down
5 changes: 4 additions & 1 deletion packages/ERTP/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// This file can contain .js-specific Typescript compiler config.
{
"extends": "../../tsconfig.json",
"compilerOptions": {},
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
},
"include": [
// omit exported.js because 1) it need not be included in the typecheck of
// this package because it's only consumed by other packages and 2)
Expand Down
4 changes: 4 additions & 0 deletions packages/async-flow/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// This file can contain .js-specific Typescript compiler config.
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
},
"include": [
"*.js",
"scripts",
Expand Down
5 changes: 4 additions & 1 deletion packages/base-zone/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// This file can contain .js-specific Typescript compiler config.
{
"extends": "../../tsconfig.json",
"compilerOptions": {},
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
},
"include": [
"*.js",
"scripts",
Expand Down
1 change: 1 addition & 0 deletions packages/boot/test/upgrading/upgrade-contracts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { buildVatController } from '@agoric/swingset-vat';

/**
* @import {TestFn} from 'ava';
* @import {SwingSetConfig} from '@agoric/swingset-vat';
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/test/upgrading/upgrade-vats.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';

import { BridgeId, deepCopyJsonable } from '@agoric/internal';
import { buildVatController } from '@agoric/swingset-vat';
import { buildVatController, type SwingSetConfig } from '@agoric/swingset-vat';
import { makeRunUtils } from '@agoric/swingset-vat/tools/run-utils.js';
import { Fail } from '@endo/errors';
import { makeTagged } from '@endo/marshal';
Expand Down
1 change: 1 addition & 0 deletions packages/boot/tools/liquidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@agoric/vats/tools/board-utils.js';
import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
import type { ExecutionContext } from 'ava';
import type { ManagerType } from '@agoric/swingset-vat';
import { insistManagerType, makeSwingsetHarness } from './supports.js';
import { type SwingsetTestKit, makeSwingsetTestKit } from './supports.js';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-utils/src/sync-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/**
* @import {RemotableObject} from '@endo/marshal';
* @import {VstorageKit} from './vstorage-kit';
* @import {VstorageKit} from './vstorage-kit.js';
*/

/**
Expand Down
5 changes: 4 additions & 1 deletion packages/client-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {},
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
},
"include": [
"src",
"test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import test from 'ava';

import { assertOfferResult } from '../../src/assertOfferResult.js';

/**
* @import {UserSeat} from '@agoric/zoe';
*/

test('assertOfferResult', async t => {
/** @type {UserSeat} */
const mockSeat = {
Expand Down
1 change: 1 addition & 0 deletions packages/governance/src/contractGovernance/paramManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { CONTRACT_ELECTORATE } from './governParam.js';
* @import {RelativeTime} from '@agoric/time';
* @import {StoredPublisherKit} from '@agoric/notifier';
* @import {ParamType} from '../constants.js';
* @import {Ratio} from '@agoric/ertp';
*/

/**
Expand Down
51 changes: 31 additions & 20 deletions packages/governance/src/types.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @agoric/group-jsdoc-imports */

export {};

/**
Expand All @@ -7,6 +9,15 @@ export {};
* @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';
* @import {Ratio} from '@agoric/ertp';
* @import {TimestampRecord} from '@agoric/time';
* @import {RelativeTimeRecord} from '@agoric/time';
* @import {Timestamp} from '@agoric/time';
* @import {RelativeTime} from '@agoric/time';
* @import {ParamTypesMap} from './contractGovernance/typedParamManager.js';
* @import {start} from './contractGovernor.js';
* @import {ParamRecordsFromTypes} from './contractGovernance/typedParamManager.js';
* @import {TimerService} from '@agoric/time';
*/

/**
Expand Down Expand Up @@ -42,8 +53,8 @@ export {};

/**
* @typedef { Amount | Brand | Installation | Instance | number | bigint |
* Ratio | string | import('@agoric/time').TimestampRecord |
* import('@agoric/time').RelativeTimeRecord | Container<any, any> } ParamValue
* Ratio | string | TimestampRecord |
* RelativeTimeRecord | Container<any, any> } ParamValue
*/

// XXX better to use the manifest constant ParamTypes
Expand All @@ -59,8 +70,8 @@ export {};
* T extends 'nat' ? bigint :
* T extends 'ratio' ? Ratio :
* T extends 'string' ? string :
* T extends 'timestamp' ? import('@agoric/time').Timestamp :
* T extends 'relativeTime' ? import('@agoric/time').RelativeTime :
* T extends 'timestamp' ? Timestamp :
* T extends 'relativeTime' ? RelativeTime :
* T extends 'unknown' ? unknown :
* never
* } ParamValueForType
Expand All @@ -74,10 +85,10 @@ export {};
/**
* Terms a contract must provide in order to be governed.
*
* @template {import('./contractGovernance/typedParamManager.js').ParamTypesMap} T Governed parameters of contract
* @template {ParamTypesMap} T Governed parameters of contract
* @typedef {{
* electionManager: import('@agoric/zoe/src/zoeService/utils.js').Instance<typeof import('./contractGovernor.js').start>,
* governedParams: import('./contractGovernance/typedParamManager.js').ParamRecordsFromTypes<T & {
* electionManager: Instance<typeof start>,
* governedParams: ParamRecordsFromTypes<T & {
* Electorate: 'invitation'
* }>
* }} GovernanceTerms
Expand Down Expand Up @@ -342,8 +353,8 @@ export {};

/**
* @typedef {object} ClosingRule
* @property {ERef<import('@agoric/time').TimerService>} timer
* @property {import('@agoric/time').Timestamp} deadline
* @property {ERef<TimerService>} timer
* @property {Timestamp} deadline
*/

/**
Expand All @@ -356,8 +367,8 @@ export {};
* @typedef {object} AddQuestionReturn
* @property {VoteCounterPublicFacet} publicFacet
* @property {VoteCounterCreatorFacet} creatorFacet
* @property {import('@agoric/zoe/src/zoeService/utils.js').Instance<typeof import('./binaryVoteCounter.js').start>} instance
* @property {import('@agoric/time').Timestamp} deadline
* @property {Instance<typeof import('./binaryVoteCounter.js').start>} instance
* @property {Timestamp} deadline
* @property {Handle<'Question'>} questionHandle
*/

Expand Down Expand Up @@ -388,7 +399,7 @@ export {};
* @template [P=StandardParamPath] path for a paramManagerRetriever
* @typedef {object} ParamChangeIssue
* @property {ParamChangesSpec<P>} spec
* @property {import('@agoric/zoe/src/zoeService/utils.js').Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>} contract
* @property {Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>} contract
*/

/**
Expand Down Expand Up @@ -441,8 +452,8 @@ export {};
* @property {(name: string) => bigint} getNat
* @property {(name: string) => Ratio} getRatio
* @property {(name: string) => string} getString
* @property {(name: string) => import('@agoric/time').TimestampRecord} getTimestamp
* @property {(name: string) => import('@agoric/time').RelativeTimeRecord} getRelativeTime
* @property {(name: string) => TimestampRecord} getTimestamp
* @property {(name: string) => RelativeTimeRecord} getRelativeTime
* @property {(name: string) => any} getUnknown
* @property {(name: string, proposedValue: ParamValue) => ParamValue} getVisibleValue - for
* most types, the visible value is the same as proposedValue. For Invitations
Expand Down Expand Up @@ -624,7 +635,7 @@ export {};
*
* @callback VoteOnParamChanges
* @param {Installation} voteCounterInstallation
* @param {import('@agoric/time').Timestamp} deadline
* @param {Timestamp} deadline
* @param {ParamChangesSpec<P>} paramSpec
* @returns {Promise<ContractGovernanceVoteResult>}
*/
Expand All @@ -634,14 +645,14 @@ export {};
* @param {string} apiMethodName
* @param {Passable[]} methodArgs
* @param {Installation} voteCounterInstallation
* @param {import('@agoric/time').Timestamp} deadline
* @param {Timestamp} deadline
* @returns {Promise<ContractGovernanceVoteResult>}
*/

/**
* @callback VoteOnOfferFilter
* @param {Installation} voteCounterInstallation
* @param {import('@agoric/time').Timestamp} deadline
* @param {Timestamp} deadline
* @param {string[]} strings
* @returns {Promise<ContractGovernanceVoteResult>}
*/
Expand Down Expand Up @@ -689,7 +700,7 @@ export {};
* @callback AssertContractGovernance
*
* @param {ERef<ZoeService>} zoe
* @param {import('@agoric/zoe/src/zoeService/utils.js').Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>} allegedGoverned
* @param {Instance<(zcf: ZCF<GovernanceTerms<{}>>) => {}>} allegedGoverned
* @param {Instance<(zcf) => {publicFacet: GovernorPublic}>} allegedGovernor
* @param {Installation<typeof import('@agoric/governance/src/contractGovernor.js').start>} contractGovernorInstallation
* @returns {Promise<GovernancePair>}
Expand All @@ -711,7 +722,7 @@ export {};
*/

/**
* @typedef {typeof import('./contractGovernor.js').start} GovernorSF
* @typedef {typeof start} GovernorSF
*/

// TODO find a way to parameterize the startInstance so the governed contract types flow
Expand All @@ -722,7 +733,7 @@ export {};
* Same result as StartedInstanceKit but:
* - typed for contractGovernor installation being started by Zoe. (It in turn starts the governed contract.)
* - parameterized by Installation instead of StartFunction
* @property {import('@agoric/zoe/src/zoeService/utils.js').Instance<GovernorSF>} instance
* @property {Instance<GovernorSF>} instance
* @property {AdminFacet} adminFacet
* @property {GovernorCreatorFacet<InstallationStart<Awaited<I>>>} creatorFacet
* @property {GovernorPublic} publicFacet
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/auction/auctionBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
* @import {PriceAuthority} from '@agoric/zoe/tools/types.js';
* @import {TypedPattern, Remote} from '@agoric/internal';
* @import {MakeRecorderKit} from '@agoric/zoe/src/contractSupport/recorder.js';
* @import {Ratio} from '@agoric/ertp';
*/

const { makeEmpty } = AmountMath;
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/auction/auctionMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {

/**
* @import {Amount} from '@agoric/ertp/src/types.js';
* @import {Ratio} from '@agoric/ertp/src/ratio.js';
*/

/**
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/auction/auctioneer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { AuctionState } from './util.js';
* @import {ScheduleNotification} from './scheduler.js';
* @import {OfferSpec} from './auctionBook.js';
* @import {FullSchedule} from './scheduler.js';
* @import {AssetReservePublicFacet} from '../reserve/assetReserve.js';
*/

const BASIS_POINTS = 10_000n;
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/auction/offerBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
* @import {MapStore} from '@agoric/store';
* @import {Baggage} from '@agoric/vat-data';
* @import {Key, Pattern} from '@endo/patterns';
* @import {Ratio} from '@agoric/ertp';
*/

// multiple offers might be provided at the same time (since the time
Expand Down
3 changes: 2 additions & 1 deletion packages/inter-protocol/src/auction/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { M } from '@agoric/store';
* @import {Remote} from '@agoric/internal';
* @import {TimerBrand} from '@agoric/time';
* @import {StoredPublisherKit} from '@agoric/notifier';
* @import {TimerService} from '@agoric/time';
* @import {RelativeTime, TimerService} from '@agoric/time';
* @import {AssetReservePublicFacet} from '../reserve/assetReserve.js';
*/

// TODO duplicated with zoe/src/TypeGuards.js
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/auction/scheduleMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { assertAllDefined, makeTracer } from '@agoric/internal';
* @import {TimestampRecord} from '@agoric/time';
* @import {AuctionParamManager} from './params.js';
* @import {Schedule} from './scheduler.js';
* @import {Timestamp} from '@agoric/time';
*/

const { subtract, multiply, floorDivide } = natSafeMath;
Expand Down
9 changes: 8 additions & 1 deletion packages/inter-protocol/src/auction/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
* @import {TimerBrand} from '@agoric/time';
* @import {Recorder} from '@agoric/zoe/src/contractSupport/recorder.js';
* @import {TimestampRecord} from '@agoric/time';
* @import {Timestamp} from '@agoric/time';
* @import {RelativeTime} from '@agoric/time';
*/

const trace = makeTracer('SCHED', true);
Expand Down Expand Up @@ -99,7 +101,12 @@ export const makeScheduler = async (
*/
let liveSchedule = null;

/** @returns {Promise<{ now: Timestamp; nextSchedule: Schedule | null }>} */
/**
* @returns {Promise<{
* now: Timestamp;
* nextSchedule: Schedule | null;
* }>}
*/
const initializeNextSchedule = async () => {
return E.when(
// XXX manualTimer returns a bigint, not a timeRecord.
Expand Down
4 changes: 4 additions & 0 deletions packages/inter-protocol/src/auction/sortedOffers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { RatioShape } from '@agoric/ertp';

import { decodeData, encodeData } from '../vaultFactory/storeUtils.js';

/**
* @import {Ratio} from '@agoric/ertp';
*/

/**
* @file we use a floating point representation of the price or rate as the
* first part of the key in the store. The second part is the sequence number
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/auction/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Far } from '@endo/marshal';
/**
* @import {Key, Pattern} from '@endo/patterns';
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
* @import {Ratio} from '@agoric/ertp';
*/

/**
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/interest-math.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {

/**
* @import {Amount, Brand, Payment} from '@agoric/ertp';
* @import {Ratio} from '@agoric/ertp/src/ratio.js';
*/

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/inter-protocol/src/interest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { TimeMath } from '@agoric/time';
* @import {Timestamp} from '@agoric/time'
* @import {RelativeTime} from '@agoric/time'
* @import {AdminFacet, InvitationAmount, ZCFMint} from '@agoric/zoe';
* @import {Ratio} from '@agoric/ertp';
* @import {Calculate, CalculatorKit} from './vaultFactory/types-ambient.js';
* @import {MintAndTransfer} from './vaultFactory/types-ambient.js';
*/

export const SECONDS_PER_YEAR = 60n * 60n * 24n * 365n;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { deeplyFulfilledObject, makeTracer } from '@agoric/internal';
import { Stable } from '@agoric/internal/src/tokens.js';
import { makeScalarBigMapStore } from '@agoric/vat-data';
Expand Down
1 change: 1 addition & 0 deletions packages/inter-protocol/src/proposals/startPSM.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
/**
* @import {BootstrapManifest} from '@agoric/vats/src/core/lib-boot.js'
* @import {PSMKit} from './econ-behaviors.js';
* @import {FeeMintAccess} from '@agoric/zoe';
*/
/** @import {MetricsNotification} from '../psm/psm.js' */
/** @import {EconomyBootstrapPowers} from './econ-behaviors.js' */
Expand Down
Loading
Loading