@agoric/ertp 0.16.3-u20.0 → 0.16.3-u21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@agoric/ertp",
3
- "version": "0.16.3-u20.0",
3
+ "version": "0.16.3-u21.0",
4
4
  "description": "Electronic Rights Transfer Protocol (ERTP). A smart contract framework for exchanging electronic rights",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "engines": {
8
- "node": "^18.12 || ^20.9"
8
+ "node": "^20.9 || ^22.11"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "exit 0",
12
- "prepack": "tsc --build tsconfig.build.json",
12
+ "prepack": "yarn run -T tsc --build tsconfig.build.json",
13
13
  "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
14
14
  "test": "ava",
15
15
  "test:c8": "c8 --all $C8_OPTIONS ava",
@@ -17,9 +17,9 @@
17
17
  "test:xs-unit": "exit 0",
18
18
  "test:xs-worker": "SWINGSET_WORKER_TYPE=xs-worker ava -c 2 test/swingsetTests",
19
19
  "lint-fix": "yarn lint:eslint --fix",
20
- "lint": "run-s --continue-on-error lint:*",
21
- "lint:eslint": "eslint .",
22
- "lint:types": "tsc"
20
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
21
+ "lint:eslint": "yarn run -T eslint .",
22
+ "lint:types": "yarn run -T tsc"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
@@ -39,10 +39,10 @@
39
39
  },
40
40
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
41
41
  "dependencies": {
42
- "@agoric/notifier": "^0.7.0-u20.0",
43
- "@agoric/store": "^0.9.3-u20.0",
44
- "@agoric/vat-data": "^0.5.3-u20.0",
45
- "@agoric/zone": "^0.3.0-u20.0",
42
+ "@agoric/notifier": "workspace:*",
43
+ "@agoric/store": "workspace:*",
44
+ "@agoric/vat-data": "workspace:*",
45
+ "@agoric/zone": "workspace:*",
46
46
  "@endo/errors": "^1.2.10",
47
47
  "@endo/eventual-send": "^1.3.1",
48
48
  "@endo/far": "^1.1.11",
@@ -52,7 +52,8 @@
52
52
  "@endo/promise-kit": "^1.1.10"
53
53
  },
54
54
  "devDependencies": {
55
- "@agoric/swingset-vat": "^0.33.0-u20.0",
55
+ "@agoric/swingset-vat": "workspace:*",
56
+ "@agoric/xsnap": "workspace:*",
56
57
  "@endo/bundle-source": "^4.0.0",
57
58
  "@fast-check/ava": "^1.1.5",
58
59
  "ava": "^5.3.0",
@@ -77,7 +78,7 @@
77
78
  "access": "public"
78
79
  },
79
80
  "typeCoverage": {
80
- "atLeast": 91.88
81
+ "atLeast": 93.1
81
82
  },
82
- "gitHead": "8e4207fa19dabf76c1f91f8779b5b5b93570ecea"
83
+ "gitHead": "e4dd46857133403d584bcf822a81817b355532f9"
83
84
  }
@@ -1,7 +1,7 @@
1
- export function upgradeIssuerKit<K extends AssetKind>(issuerBaggage: import("@agoric/vat-data").Baggage, optShutdownWithFailure?: ShutdownWithFailure, recoverySetsOption?: RecoverySetsOption): IssuerKit<K>;
2
- export function hasIssuer(baggage: import("@agoric/vat-data").Baggage): boolean;
3
- export function makeDurableIssuerKit<K extends AssetKind>(issuerBaggage: import("@agoric/vat-data").Baggage, name: string, assetKind?: K, displayInfo?: AdditionalDisplayInfo, optShutdownWithFailure?: ShutdownWithFailure, { elementShape, recoverySetsOption }?: IssuerOptionsRecord): IssuerKit<K>;
4
- export function prepareIssuerKit<O extends IssuerOptionsRecord, K extends AssetKind>(issuerBaggage: import("@agoric/vat-data").Baggage, name: string, assetKind?: K, displayInfo?: AdditionalDisplayInfo, optShutdownWithFailure?: ShutdownWithFailure, options?: O): O["elementShape"] extends TypedPattern<infer T extends Key> ? IssuerKit<K, T> : IssuerKit<K>;
1
+ export function upgradeIssuerKit<K extends AssetKind>(issuerBaggage: Baggage, optShutdownWithFailure?: ShutdownWithFailure, recoverySetsOption?: RecoverySetsOption): IssuerKit<K>;
2
+ export function hasIssuer(baggage: Baggage): boolean;
3
+ export function makeDurableIssuerKit<K extends AssetKind>(issuerBaggage: Baggage, name: string, assetKind?: K, displayInfo?: AdditionalDisplayInfo, optShutdownWithFailure?: ShutdownWithFailure, { elementShape, recoverySetsOption }?: IssuerOptionsRecord): IssuerKit<K>;
4
+ export function prepareIssuerKit<O extends IssuerOptionsRecord, K extends AssetKind>(issuerBaggage: Baggage, name: string, assetKind?: K, displayInfo?: AdditionalDisplayInfo, optShutdownWithFailure?: ShutdownWithFailure, options?: O): O["elementShape"] extends TypedPattern<infer T extends Key> ? IssuerKit<K, T> : IssuerKit<K>;
5
5
  export function makeIssuerKit<K extends AssetKind = "nat", O extends IssuerOptionsRecord = {}>(name: string, assetKind?: K, displayInfo?: AdditionalDisplayInfo, optShutdownWithFailure?: ShutdownWithFailure, { elementShape, recoverySetsOption }?: O): O["elementShape"] extends TypedPattern<infer T extends Key> ? IssuerKit<K, T> : IssuerKit<K>;
6
6
  export type IssuerRecord<K extends AssetKind> = {
7
7
  name: string;
@@ -28,6 +28,7 @@ export type IssuerOptionsRecord = Partial<{
28
28
  recoverySetsOption: RecoverySetsOption;
29
29
  }>;
30
30
  import { AssetKind } from './amountMath.js';
31
+ import type { Baggage } from '@agoric/vat-data';
31
32
  import type { ShutdownWithFailure } from '@agoric/swingset-vat';
32
33
  import type { RecoverySetsOption } from './types.js';
33
34
  import type { IssuerKit } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"issuerKit.d.ts","sourceRoot":"","sources":["issuerKit.js"],"names":[],"mappings":"AAiHO,iCAbkB,CAAC,SAAZ,SAAU,iBACb,OAAO,kBAAkB,EAAE,OAAO,2BAClC,mBAAmB,uBAOnB,kBAAkB,GAEhB,UAAU,CAAC,CAAC,CA4BxB;AAQM,mCAFI,OAAO,kBAAkB,EAAE,OAAO,WAEgB;AAoDtD,qCA1BkB,CAAC,SAAZ,SAAU,iBAYb,OAAO,kBAAkB,EAAE,O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CAAC,SAAZ,SAAU,iBAYb,OAAO,QACP,MAAM,cACN,CAAC,gBACD,qBAAqB,2BACrB,mBAAmB,yCAOnB,mBAAmB,GACjB,UAAU,CAAC,CAAC,CA2BxB;AAoCM,iCA7B4B,CAAC,SAAtB,mBAAoB,EACT,CAAC,SAAZ,SAAU,iBAYb,OAAO,QACP,MAAM,cACN,CAAC,gBACD,qBAAqB,2BACrB,mBAAmB,YAOnB,CAAC,GACC,CAAC,CAAC,cAAc,CAAC,SAAS,aAAa,MAAM,CAAC,SAAS,GAAG,CAAC,GAC/D,UAAU,CAAC,EAAE,CAAC,CAAC,GACf,UAAU,CAAC,CAAC,CAyCpB;AAqCM,8BAzBmB,CAAC,SAAb,SAAU,UACY,CAAC,SAAvB,mBAAoB,aACvB,MAAM,cAMN,CAAC,gBAGD,qBAAqB,2BAErB,mBAAmB,yCAOnB,CAAC,GACC,CAAC,CAAC,cAAc,CAAC,SAAS,aAAa,MAAM,CAAC,SAAS,GAAG,CAAC,GAC/D,UAAU,CAAC,EAAE,CAAC,CAAC,GACf,UAAU,CAAC,CAAC,CAmBlB;yBA7UsB,CAAC,SAAZ,SAAU;UAEV,MAAM;eACN,CAAC;iBACD,qBAAqB;kBACrB,OAAO;;;;;;;;;;;;;;;;kCA0IR,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC;0BAhKsC,iBAAiB;6BASlC,kBAAkB;yCAFN,sBAAsB;wCAG0B,YAAY;+BAAZ,YAAY;2CAAZ,YAAY;yBALnE,gBAAgB;kCAGhB,kBAAkB;6BAHlB,gBAAgB"}
package/src/issuerKit.js CHANGED
@@ -10,11 +10,12 @@ import { coerceDisplayInfo } from './displayInfo.js';
10
10
  import { preparePaymentLedger } from './paymentLedger.js';
11
11
 
12
12
  /**
13
- * @import {AdditionalDisplayInfo, RecoverySetsOption, IssuerKit, PaymentLedger} from './types.js';
13
+ * @import {Key, Pattern} from '@endo/patterns';
14
+ * @import {Zone} from '@agoric/base-zone';
14
15
  * @import {ShutdownWithFailure} from '@agoric/swingset-vat';
15
16
  * @import {TypedPattern} from '@agoric/internal';
16
- * @import {CopyTaggedInterface, Key, RemotableObject} from '@endo/patterns';
17
- * @import {Pattern} from '@endo/patterns';
17
+ * @import {Baggage} from '@agoric/vat-data';
18
+ * @import {AdditionalDisplayInfo, RecoverySetsOption, IssuerKit, PaymentLedger} from './types.js';
18
19
  */
19
20
 
20
21
  /**
@@ -31,7 +32,7 @@ import { preparePaymentLedger } from './paymentLedger.js';
31
32
  *
32
33
  * @template {AssetKind} K
33
34
  * @param {IssuerRecord<K>} issuerRecord
34
- * @param {import('@agoric/zone').Zone} issuerZone
35
+ * @param {Zone} issuerZone
35
36
  * @param {RecoverySetsOption} recoverySetsState Omitted from issuerRecord
36
37
  * because it was added in an upgrade.
37
38
  * @param {ShutdownWithFailure} [optShutdownWithFailure] If this issuer fails in
@@ -99,7 +100,7 @@ const RECOVERY_SETS_STATE = 'recoverySetsState';
99
100
  * make a new one.
100
101
  *
101
102
  * @template {AssetKind} K
102
- * @param {import('@agoric/vat-data').Baggage} issuerBaggage
103
+ * @param {Baggage} issuerBaggage
103
104
  * @param {ShutdownWithFailure} [optShutdownWithFailure] If this issuer fails in
104
105
  * the middle of an atomic action (which btw should never happen), it
105
106
  * potentially leaves its ledger in a corrupted state. If this function was
@@ -143,7 +144,7 @@ harden(upgradeIssuerKit);
143
144
  /**
144
145
  * Does baggage already have an issuerKit?
145
146
  *
146
- * @param {import('@agoric/vat-data').Baggage} baggage
147
+ * @param {Baggage} baggage
147
148
  */
148
149
  export const hasIssuer = baggage => baggage.has(INSTANCE_KEY);
149
150
 
@@ -183,7 +184,7 @@ export const hasIssuer = baggage => baggage.has(INSTANCE_KEY);
183
184
  * basic fungible tokens.
184
185
  *
185
186
  * `displayInfo` gives information to the UI on how to display the amount.
186
- * @param {import('@agoric/vat-data').Baggage} issuerBaggage
187
+ * @param {Baggage} issuerBaggage
187
188
  * @param {string} name
188
189
  * @param {K} [assetKind]
189
190
  * @param {AdditionalDisplayInfo} [displayInfo]
@@ -242,7 +243,7 @@ harden(makeDurableIssuerKit);
242
243
  * basic fungible tokens.
243
244
  *
244
245
  * `displayInfo` gives information to the UI on how to display the amount.
245
- * @param {import('@agoric/vat-data').Baggage} issuerBaggage
246
+ * @param {Baggage} issuerBaggage
246
247
  * @param {string} name
247
248
  * @param {K} [assetKind]
248
249
  * @param {AdditionalDisplayInfo} [displayInfo]
@@ -1,5 +1,6 @@
1
- export function preparePaymentLedger<K extends AssetKind>(issuerZone: import("@agoric/zone").Zone, name: string, assetKind: K, displayInfo: DisplayInfo<K>, elementShape: Pattern, recoverySetsState: RecoverySetsOption, optShutdownWithFailure?: ShutdownWithFailure): PaymentLedger<K>;
1
+ export function preparePaymentLedger<K extends AssetKind>(issuerZone: Zone, name: string, assetKind: K, displayInfo: DisplayInfo<K>, elementShape: Pattern, recoverySetsState: RecoverySetsOption, optShutdownWithFailure?: ShutdownWithFailure): PaymentLedger<K>;
2
2
  import type { AssetKind } from './types.js';
3
+ import type { Zone } from '@agoric/base-zone';
3
4
  import type { DisplayInfo } from './types.js';
4
5
  import type { Pattern } from '@endo/patterns';
5
6
  import type { RecoverySetsOption } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"paymentLedger.d.ts","sourceRoot":"","sources":["paymentLedger.js"],"names":[],"mappings":"AAsFO,qCAVkB,CAAC,SAAb,SAAW,cACb,OAAO,cAAc,EAAE,IAAI,QAC3B,MAAM,aACN,CAAC,eACD,YAAY,CAAC,CAAC,gBACd,OAAO,qBACP,kBAAkB,2BAClB,mBAAmB,GACjB,cAAc,CAAC,CAAC,CAyT5B;+BA9XwH,YAAY;iCAAZ,YAAY;6BADtG,gBAAgB;wCAC0E,YAAY;yCAC/F,sBAAsB;mCAD6D,YAAY"}
1
+ {"version":3,"file":"paymentLedger.d.ts","sourceRoot":"","sources":["paymentLedger.js"],"names":[],"mappings":"AAuFO,qCAVkB,CAAC,SAAb,SAAW,cACb,IAAI,QACJ,MAAM,aACN,CAAC,eACD,YAAY,CAAC,CAAC,gBACd,OAAO,qBACP,kBAAkB,2BAClB,mBAAmB,GACjB,cAAc,CAAC,CAAC,CAyT5B;+BA5XwH,YAAY;0BAJ9G,mBAAmB;iCAI+E,YAAY;6BALtG,gBAAgB;wCAK0E,YAAY;yCAF/F,sBAAsB;mCAE6D,YAAY"}
@@ -2,20 +2,21 @@
2
2
 
3
3
  /// <reference types="@agoric/store/exported.js" />
4
4
 
5
- import { X, q, Fail, annotateError } from '@endo/errors';
5
+ import { q, Fail, annotateError, X } from '@endo/errors';
6
6
  import { isPromise } from '@endo/promise-kit';
7
- import { mustMatch, M, keyEQ } from '@agoric/store';
7
+ import { mustMatch, M, keyEQ } from '@endo/patterns';
8
8
  import { AmountMath } from './amountMath.js';
9
9
  import { preparePaymentKind } from './payment.js';
10
10
  import { preparePurseKind } from './purse.js';
11
-
12
11
  import { BrandI, makeIssuerInterfaces } from './typeGuards.js';
13
12
 
14
13
  /**
15
14
  * @import {Key, Pattern} from '@endo/patterns';
16
- * @import {Amount, AssetKind, DisplayInfo, PaymentLedger, Payment, Brand, RecoverySetsOption, Purse, Issuer, Mint} from './types.js'
17
- * @import {ShutdownWithFailure} from '@agoric/swingset-vat'
15
+ * @import {Zone} from '@agoric/base-zone';
18
16
  * @import {TypedPattern} from '@agoric/internal';
17
+ * @import {ShutdownWithFailure} from '@agoric/swingset-vat';
18
+ * @import {AmountStore} from './amountStore.js';
19
+ * @import {Amount, AssetKind, DisplayInfo, PaymentLedger, Payment, Brand, RecoverySetsOption, Purse, Issuer, Mint} from './types.js';
19
20
  */
20
21
 
21
22
  /**
@@ -75,7 +76,7 @@ const amountShapeFromElementShape = (brand, assetKind, elementShape) => {
75
76
  * minting and transfer authority originates here.
76
77
  *
77
78
  * @template {AssetKind} K
78
- * @param {import('@agoric/zone').Zone} issuerZone
79
+ * @param {Zone} issuerZone
79
80
  * @param {string} name
80
81
  * @param {K} assetKind
81
82
  * @param {DisplayInfo<K>} displayInfo
@@ -240,7 +241,7 @@ export const preparePaymentLedger = (
240
241
  /**
241
242
  * Used by the purse code to implement purse.deposit
242
243
  *
243
- * @param {import('./amountStore.js').AmountStore} balanceStore
244
+ * @param {AmountStore} balanceStore
244
245
  * @param {Payment} srcPayment
245
246
  * @param {Pattern} [optAmountShape]
246
247
  * @returns {Amount}
@@ -274,7 +275,7 @@ export const preparePaymentLedger = (
274
275
  /**
275
276
  * Used by the purse code to implement purse.withdraw
276
277
  *
277
- * @param {import('./amountStore.js').AmountStore} balanceStore
278
+ * @param {AmountStore} balanceStore
278
279
  * @param {Amount} amount - the amount to be withdrawn
279
280
  * @param {SetStore<Payment>} [recoverySet]
280
281
  * @returns {Payment}