@agoric/ertp 0.16.3-u13.0 → 0.16.3-u16.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/exported.d.ts +37 -0
- package/exported.js +2 -1
- package/package.json +35 -26
- package/src/amountMath.d.ts +44 -31
- package/src/amountMath.d.ts.map +1 -1
- package/src/amountMath.js +130 -120
- package/src/amountStore.d.ts +9 -0
- package/src/amountStore.d.ts.map +1 -0
- package/src/amountStore.js +34 -0
- package/src/displayInfo.d.ts +3 -0
- package/src/displayInfo.d.ts.map +1 -1
- package/src/displayInfo.js +2 -0
- package/src/index.js +8 -0
- package/src/issuerKit.d.ts +30 -6
- package/src/issuerKit.d.ts.map +1 -1
- package/src/issuerKit.js +218 -76
- package/src/legacy-payment-helpers.d.ts +6 -1
- package/src/legacy-payment-helpers.d.ts.map +1 -1
- package/src/legacy-payment-helpers.js +33 -32
- package/src/mathHelpers/copyBagMathHelpers.d.ts +3 -4
- package/src/mathHelpers/copyBagMathHelpers.d.ts.map +1 -1
- package/src/mathHelpers/copyBagMathHelpers.js +4 -5
- package/src/mathHelpers/copySetMathHelpers.d.ts +3 -3
- package/src/mathHelpers/copySetMathHelpers.d.ts.map +1 -1
- package/src/mathHelpers/copySetMathHelpers.js +6 -4
- package/src/mathHelpers/natMathHelpers.d.ts +8 -7
- package/src/mathHelpers/natMathHelpers.d.ts.map +1 -1
- package/src/mathHelpers/natMathHelpers.js +7 -8
- package/src/mathHelpers/setMathHelpers.d.ts +2 -0
- package/src/mathHelpers/setMathHelpers.d.ts.map +1 -1
- package/src/mathHelpers/setMathHelpers.js +2 -1
- package/src/payment.d.ts +4 -2
- package/src/payment.d.ts.map +1 -1
- package/src/payment.js +6 -7
- package/src/paymentLedger.d.ts +6 -2
- package/src/paymentLedger.d.ts.map +1 -1
- package/src/paymentLedger.js +71 -90
- package/src/purse.d.ts +19 -9
- package/src/purse.d.ts.map +1 -1
- package/src/purse.js +86 -25
- package/src/transientNotifier.d.ts +1 -1
- package/src/transientNotifier.d.ts.map +1 -1
- package/src/transientNotifier.js +5 -0
- package/src/typeGuards.d.ts +41 -9
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +38 -43
- package/src/types.d.ts +250 -215
- package/src/types.d.ts.map +1 -1
- package/src/types.js +305 -326
- package/CHANGELOG.md +0 -767
- package/src/types-ambient.d.ts +0 -376
- package/src/types-ambient.d.ts.map +0 -1
- package/src/types-ambient.js +0 -440
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transientNotifier.d.ts","sourceRoot":"","sources":["transientNotifier.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transientNotifier.d.ts","sourceRoot":"","sources":["transientNotifier.js"],"names":[],"mappings":"AAaO;;;EAoBN"}
|
package/src/transientNotifier.js
CHANGED
|
@@ -4,6 +4,11 @@ import { makeScalarBigWeakMapStore } from '@agoric/vat-data';
|
|
|
4
4
|
import { provideLazy } from '@agoric/store';
|
|
5
5
|
import { makeNotifierKit } from '@agoric/notifier';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @import {Purse} from './types.js';
|
|
9
|
+
* @import {LatestTopic, NotifierRecord} from '@agoric/notifier');
|
|
10
|
+
*/
|
|
11
|
+
|
|
7
12
|
// Note: Virtual for high cardinality, but *not* durable, and so
|
|
8
13
|
// broken across an upgrade.
|
|
9
14
|
export const makeTransientNotifierKit = () => {
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @import {AmountValue, AssetKindForValue, AssetValueForKind, Brand, MathHelpers} from './types.js' */
|
|
1
2
|
export const BrandShape: import("@endo/patterns").Matcher;
|
|
2
3
|
export const IssuerShape: import("@endo/patterns").Matcher;
|
|
3
4
|
export const PaymentShape: import("@endo/patterns").Matcher;
|
|
@@ -13,10 +14,10 @@ export namespace RatioShape {
|
|
|
13
14
|
export { AmountShape as numerator };
|
|
14
15
|
export { AmountShape as denominator };
|
|
15
16
|
}
|
|
16
|
-
export function isNatValue(value: AmountValue): value is
|
|
17
|
-
export function isCopySetValue(value: AmountValue): value is CopySet
|
|
17
|
+
export function isNatValue(value: AmountValue): value is import("./types.js").NatValue;
|
|
18
|
+
export function isCopySetValue(value: AmountValue): value is CopySet;
|
|
18
19
|
export function isSetValue(value: AmountValue): value is SetValue;
|
|
19
|
-
export function isCopyBagValue(value: AmountValue): value is CopyBag
|
|
20
|
+
export function isCopyBagValue(value: AmountValue): value is CopyBag;
|
|
20
21
|
export const MAX_ABSOLUTE_DECIMAL_PLACES: 100;
|
|
21
22
|
export const AssetKindShape: import("@endo/patterns").Matcher;
|
|
22
23
|
export const DisplayInfoShape: import("@endo/patterns").Matcher;
|
|
@@ -27,16 +28,47 @@ export namespace IssuerKitShape {
|
|
|
27
28
|
export { IssuerShape as issuer };
|
|
28
29
|
export { DisplayInfoShape as displayInfo };
|
|
29
30
|
}
|
|
30
|
-
export const BrandI: import("@endo/patterns").InterfaceGuard
|
|
31
|
+
export const BrandI: import("@endo/patterns").InterfaceGuard<{
|
|
32
|
+
isMyIssuer: import("@endo/patterns").MethodGuard;
|
|
33
|
+
getAllegedName: import("@endo/patterns").MethodGuard;
|
|
34
|
+
getDisplayInfo: import("@endo/patterns").MethodGuard;
|
|
35
|
+
getAmountShape: import("@endo/patterns").MethodGuard;
|
|
36
|
+
}>;
|
|
31
37
|
export function makeIssuerInterfaces(brandShape?: Pattern, assetKindShape?: Pattern, amountShape?: Pattern): {
|
|
32
|
-
IssuerI: import("@endo/patterns").InterfaceGuard
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
IssuerI: import("@endo/patterns").InterfaceGuard<{
|
|
39
|
+
getBrand: import("@endo/patterns").MethodGuard;
|
|
40
|
+
getAllegedName: import("@endo/patterns").MethodGuard;
|
|
41
|
+
getAssetKind: import("@endo/patterns").MethodGuard;
|
|
42
|
+
getDisplayInfo: import("@endo/patterns").MethodGuard;
|
|
43
|
+
makeEmptyPurse: import("@endo/patterns").MethodGuard;
|
|
44
|
+
isLive: import("@endo/patterns").MethodGuard;
|
|
45
|
+
getAmountOf: import("@endo/patterns").MethodGuard;
|
|
46
|
+
burn: import("@endo/patterns").MethodGuard;
|
|
47
|
+
}>;
|
|
48
|
+
MintI: import("@endo/patterns").InterfaceGuard<{
|
|
49
|
+
getIssuer: import("@endo/patterns").MethodGuard;
|
|
50
|
+
mintPayment: import("@endo/patterns").MethodGuard;
|
|
51
|
+
}>;
|
|
52
|
+
PaymentI: import("@endo/patterns").InterfaceGuard<{
|
|
53
|
+
getAllegedBrand: import("@endo/patterns").MethodGuard;
|
|
54
|
+
}>;
|
|
35
55
|
PurseIKit: {
|
|
36
|
-
purse: import("@endo/patterns").InterfaceGuard
|
|
37
|
-
|
|
56
|
+
purse: import("@endo/patterns").InterfaceGuard<{
|
|
57
|
+
getAllegedBrand: import("@endo/patterns").MethodGuard;
|
|
58
|
+
getCurrentAmount: import("@endo/patterns").MethodGuard;
|
|
59
|
+
getCurrentAmountNotifier: import("@endo/patterns").MethodGuard;
|
|
60
|
+
deposit: import("@endo/patterns").MethodGuard;
|
|
61
|
+
getDepositFacet: import("@endo/patterns").MethodGuard;
|
|
62
|
+
withdraw: import("@endo/patterns").MethodGuard;
|
|
63
|
+
getRecoverySet: import("@endo/patterns").MethodGuard;
|
|
64
|
+
recoverAll: import("@endo/patterns").MethodGuard;
|
|
65
|
+
}>;
|
|
66
|
+
depositFacet: import("@endo/patterns").InterfaceGuard<{
|
|
67
|
+
receive: import("@endo/patterns").MethodGuard;
|
|
68
|
+
}>;
|
|
38
69
|
};
|
|
39
70
|
};
|
|
40
71
|
declare const AmountValueShape: import("@endo/patterns").Matcher;
|
|
72
|
+
import type { AmountValue } from './types.js';
|
|
41
73
|
export {};
|
|
42
74
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA,wGAAwG;AAExG,0DAA+C;AAC/C,2DAAiD;AACjD,4DAAmD;AACnD,0DAA+C;AAC/C,iEAA6D;AAC7D,6DAAqD;AACrD,yDAA6C;;;;;;;;;AA+EtC,kCAHI,WAAW,GACT,KAAK,IAAI,OAAO,YAAY,EAAE,QAAQ,CAEa;AASzD,sCAHI,WAAW,GACT,KAAK,IAAI,OAAO,CAE2C;AAYjE,kCAHI,WAAW,GACT,KAAK,IAAI,QAAQ,CAEkC;AASzD,sCAHI,WAAW,GACT,KAAK,IAAI,OAAO,CAE2C;AAIxE,8CAA+C;AAE/C,8DAAuE;AAEvE,gEAaE;;;;;;;;AAYF;;;;;GAKG;AAOI,kDAJI,OAAO,mBACP,OAAO,gBACP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkEjB;AAlKD,iEAKE;iCArEuF,YAAY"}
|
package/src/typeGuards.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
import { M, matches } from '@
|
|
3
|
+
import { M, matches, getInterfaceGuardPayload } from '@endo/patterns';
|
|
4
|
+
/** @import {AmountValue, AssetKindForValue, AssetValueForKind, Brand, MathHelpers} from './types.js' */
|
|
4
5
|
|
|
5
6
|
export const BrandShape = M.remotable('Brand');
|
|
6
7
|
export const IssuerShape = M.remotable('Issuer');
|
|
@@ -11,62 +12,56 @@ export const NotifierShape = M.remotable('Notifier');
|
|
|
11
12
|
export const MintShape = M.remotable('Mint');
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
|
-
* When the AmountValue of an Amount fits the NatValueShape, i.e., when it is
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* set of fungible units.
|
|
15
|
+
* When the AmountValue of an Amount fits the NatValueShape, i.e., when it is a
|
|
16
|
+
* non-negative bigint, then it represents that many units of the fungible asset
|
|
17
|
+
* represented by that amount. The brand of that amount should indeed represent
|
|
18
|
+
* a kind of asset consisting of a countable set of fungible units.
|
|
19
19
|
*/
|
|
20
20
|
const NatValueShape = M.nat();
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* When the AmountValue of an Amount fits the CopySetValueShape, i.e., when it
|
|
24
|
-
* is a CopySet, then it represents the set of those
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* from the same asset class.
|
|
24
|
+
* is a CopySet, then it represents the set of those keys, where each key
|
|
25
|
+
* represents some individual non-fungible item, like a concert ticket, from the
|
|
26
|
+
* non-fungible asset class represented by that amount's brand. The amount
|
|
27
|
+
* itself represents the set of these items, as opposed to any of the other
|
|
28
|
+
* items from the same asset class.
|
|
30
29
|
*
|
|
31
|
-
* If a given value class represents concert tickets, it seems bizarre
|
|
32
|
-
*
|
|
33
|
-
* the
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* "You can't always get..."
|
|
30
|
+
* If a given value class represents concert tickets, it seems bizarre that we
|
|
31
|
+
* can form amounts of any key. The hard constraint is that the code that holds
|
|
32
|
+
* the mint for that asset class---the one associated with that brand, only
|
|
33
|
+
* mints the items representing the real units of that asset class as defined by
|
|
34
|
+
* it. Anyone else can put together an amount expressing, for example, that they
|
|
35
|
+
* "want" some items that will never be minted. That want will never be
|
|
36
|
+
* satisfied. "You can't always get..."
|
|
39
37
|
*/
|
|
40
38
|
const CopySetValueShape = M.set();
|
|
41
39
|
|
|
42
40
|
/**
|
|
43
|
-
* When the AmountValue of an Amount fits the SetValueShape, i.e., when it
|
|
44
|
-
*
|
|
41
|
+
* When the AmountValue of an Amount fits the SetValueShape, i.e., when it is a
|
|
42
|
+
* CopyArray of passable Keys. This representation is deprecated.
|
|
45
43
|
*
|
|
46
44
|
* @deprecated Please change from using array-based SetValues to CopySet-based
|
|
47
|
-
*
|
|
45
|
+
* CopySetValues.
|
|
48
46
|
*/
|
|
49
47
|
const SetValueShape = M.arrayOf(M.key());
|
|
50
48
|
|
|
51
49
|
/**
|
|
52
50
|
* When the AmountValue of an Amount fits the CopyBagValueShape, i.e., when it
|
|
53
|
-
* is a CopyBag, then it represents the bag (multiset) of those
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* the bag of these items, as opposed to any of the other items
|
|
60
|
-
* from the same asset class.
|
|
51
|
+
* is a CopyBag, then it represents the bag (multiset) of those keys, where each
|
|
52
|
+
* key represents some individual semi-fungible item, like a concert ticket,
|
|
53
|
+
* from the semi-fungible asset class represented by that amount's brand. The
|
|
54
|
+
* number of times that key appears in the bag is the number of fungible units
|
|
55
|
+
* of that key. The amount itself represents the bag of these items, as opposed
|
|
56
|
+
* to any of the other items from the same asset class.
|
|
61
57
|
*
|
|
62
|
-
* If a given value class represents concert tickets, it seems bizarre
|
|
63
|
-
*
|
|
64
|
-
* the
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* "You can't always get..."
|
|
58
|
+
* If a given value class represents concert tickets, it seems bizarre that we
|
|
59
|
+
* can form amounts of any key. The hard constraint is that the code that holds
|
|
60
|
+
* the mint for that asset class---the one associated with that brand, only
|
|
61
|
+
* mints the items representing the real units of that asset class as defined by
|
|
62
|
+
* it. Anyone else can put together an amount expressing, for example, that they
|
|
63
|
+
* "want" some items that will never be minted. That want will never be
|
|
64
|
+
* satisfied. "You can't always get..."
|
|
70
65
|
*/
|
|
71
66
|
const CopyBagValueShape = M.bag();
|
|
72
67
|
|
|
@@ -106,11 +101,11 @@ export const isCopySetValue = value => matches(value, CopySetValueShape);
|
|
|
106
101
|
harden(isCopySetValue);
|
|
107
102
|
|
|
108
103
|
/**
|
|
109
|
-
* Returns true if value is a pass by copy array structure. Does not
|
|
110
|
-
*
|
|
104
|
+
* Returns true if value is a pass by copy array structure. Does not check for
|
|
105
|
+
* duplicates. To check for duplicates, use setMathHelpers.coerce.
|
|
111
106
|
*
|
|
112
107
|
* @deprecated Please change from using array-based SetValues to CopySet-based
|
|
113
|
-
*
|
|
108
|
+
* CopySetValues.
|
|
114
109
|
* @param {AmountValue} value
|
|
115
110
|
* @returns {value is SetValue}
|
|
116
111
|
*/
|
|
@@ -218,7 +213,7 @@ export const makeIssuerInterfaces = (
|
|
|
218
213
|
});
|
|
219
214
|
|
|
220
215
|
const DepositFacetI = M.interface('DepositFacet', {
|
|
221
|
-
receive: PurseI.methodGuards.deposit,
|
|
216
|
+
receive: getInterfaceGuardPayload(PurseI).methodGuards.deposit,
|
|
222
217
|
});
|
|
223
218
|
|
|
224
219
|
const PurseIKit = harden({
|