@agoric/ertp 0.16.3-dev-d6fae11.0.d6fae11 → 0.16.3-dev-64cee5a.0.64cee5a
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 +7 -7
- package/src/mathHelpers/copyBagMathHelpers.d.ts +3 -2
- package/src/mathHelpers/copyBagMathHelpers.d.ts.map +1 -1
- package/src/mathHelpers/copyBagMathHelpers.js +6 -3
- package/src/payment.d.ts +3 -1
- package/src/payment.d.ts.map +1 -1
- package/src/payment.js +7 -3
- package/src/purse.d.ts +5 -3
- package/src/purse.d.ts.map +1 -1
- package/src/purse.js +8 -4
- package/src/typeGuards.d.ts +3 -1
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/ertp",
|
|
3
|
-
"version": "0.16.3-dev-
|
|
3
|
+
"version": "0.16.3-dev-64cee5a.0.64cee5a",
|
|
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",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
43
|
-
"@agoric/store": "0.9.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/zone": "0.2.3-dev-
|
|
42
|
+
"@agoric/notifier": "0.6.3-dev-64cee5a.0.64cee5a",
|
|
43
|
+
"@agoric/store": "0.9.3-dev-64cee5a.0.64cee5a",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-64cee5a.0.64cee5a",
|
|
45
|
+
"@agoric/zone": "0.2.3-dev-64cee5a.0.64cee5a",
|
|
46
46
|
"@endo/errors": "^1.2.13",
|
|
47
47
|
"@endo/eventual-send": "^1.3.4",
|
|
48
48
|
"@endo/far": "^1.1.14",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@endo/promise-kit": "^1.1.13"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
55
|
+
"@agoric/swingset-vat": "0.32.3-dev-64cee5a.0.64cee5a",
|
|
56
56
|
"@endo/bundle-source": "^4.1.2",
|
|
57
57
|
"@fast-check/ava": "^1.1.5",
|
|
58
58
|
"ava": "^5.3.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"typeCoverage": {
|
|
80
80
|
"atLeast": 92.99
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "64cee5ae5d1a3488a30ce042d6f3f561ac2a6e82"
|
|
83
83
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** @type {MathHelpers<
|
|
2
|
-
export const copyBagMathHelpers: MathHelpers<
|
|
1
|
+
/** @type {MathHelpers<CopyBag>} */
|
|
2
|
+
export const copyBagMathHelpers: MathHelpers<CopyBag>;
|
|
3
|
+
import type { CopyBag } from '@endo/patterns';
|
|
3
4
|
import type { MathHelpers } from '../types.js';
|
|
4
5
|
//# sourceMappingURL=copyBagMathHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyBagMathHelpers.d.ts","sourceRoot":"","sources":["copyBagMathHelpers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copyBagMathHelpers.d.ts","sourceRoot":"","sources":["copyBagMathHelpers.js"],"names":[],"mappings":"AAqBA,mCAAmC;AACnC,iCADW,YAAY,OAAO,CAAC,CAY5B;6BAlBuB,gBAAgB;iCADZ,aAAa"}
|
|
@@ -11,12 +11,15 @@ import {
|
|
|
11
11
|
bagDisjointSubtract,
|
|
12
12
|
} from '@agoric/store';
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @import {MathHelpers} from '../types.js'
|
|
16
|
+
* @import {CopyBag} from '@endo/patterns';
|
|
17
|
+
*/
|
|
15
18
|
|
|
16
|
-
/** @type {
|
|
19
|
+
/** @type {CopyBag} */
|
|
17
20
|
const empty = makeCopyBag([]);
|
|
18
21
|
|
|
19
|
-
/** @type {MathHelpers<
|
|
22
|
+
/** @type {MathHelpers<CopyBag>} */
|
|
20
23
|
export const copyBagMathHelpers = harden({
|
|
21
24
|
doCoerce: bag => {
|
|
22
25
|
mustMatch(bag, M.bag(), 'bag of amount');
|
package/src/payment.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export function preparePaymentKind<K extends AssetKind>(issuerZone:
|
|
1
|
+
export function preparePaymentKind<K extends AssetKind>(issuerZone: Zone, name: string, brand: Brand<K>, PaymentI: InterfaceGuard<any>): () => Payment<K, any>;
|
|
2
2
|
import type { AssetKind } from './types.js';
|
|
3
|
+
import type { Zone } from '@agoric/zone';
|
|
3
4
|
import type { Brand } from './types.js';
|
|
5
|
+
import type { InterfaceGuard } from '@endo/patterns';
|
|
4
6
|
import type { Payment } from './types.js';
|
|
5
7
|
//# sourceMappingURL=payment.d.ts.map
|
package/src/payment.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["payment.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["payment.js"],"names":[],"mappings":"AAmBO,mCAPkB,CAAC,SAAb,SAAW,cACb,IAAI,QACJ,MAAM,SACN,MAAM,CAAC,CAAC,YACR,eAAe,GAAG,CAAC,GACjB,MAAM,QAAQ,CAAC,EAAE,GAAG,CAAC,CAejC;+BA3B2C,YAAY;0BACjC,cAAc;2BADO,YAAY;oCAEvB,gBAAgB;6BAFL,YAAY"}
|
package/src/payment.js
CHANGED
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import { initEmpty } from '@agoric/store';
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @import {AssetKind, Brand, Payment} from './types.js'
|
|
7
|
+
* @import {Zone} from '@agoric/zone';
|
|
8
|
+
* @import {InterfaceGuard} from '@endo/patterns';
|
|
9
|
+
*/
|
|
6
10
|
|
|
7
11
|
// TODO Type InterfaceGuard better than InterfaceGuard<any>
|
|
8
12
|
/**
|
|
9
13
|
* @template {AssetKind} K
|
|
10
|
-
* @param {
|
|
14
|
+
* @param {Zone} issuerZone
|
|
11
15
|
* @param {string} name
|
|
12
16
|
* @param {Brand<K>} brand
|
|
13
|
-
* @param {
|
|
17
|
+
* @param {InterfaceGuard<any>} PaymentI
|
|
14
18
|
* @returns {() => Payment<K, any>}
|
|
15
19
|
*/
|
|
16
20
|
export const preparePaymentKind = (issuerZone, name, brand, PaymentI) => {
|
package/src/purse.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function preparePurseKind(issuerZone:
|
|
2
|
-
purse:
|
|
3
|
-
depositFacet:
|
|
1
|
+
export function preparePurseKind(issuerZone: Zone, name: string, assetKind: AssetKind, brand: Brand, PurseIKit: {
|
|
2
|
+
purse: InterfaceGuard<any>;
|
|
3
|
+
depositFacet: InterfaceGuard<any>;
|
|
4
4
|
}, purseMethods: {
|
|
5
5
|
depositInternal: any;
|
|
6
6
|
withdrawInternal: any;
|
|
@@ -16,8 +16,10 @@ export function preparePurseKind(issuerZone: import("@agoric/zone").Zone, name:
|
|
|
16
16
|
getRecoverySet(): import("@endo/patterns").CopySet<any>;
|
|
17
17
|
recoverAll(): import("./types.js").NatAmount | import("./types.js").CopySetAmount<import("@endo/patterns").Key> | import("./types.js").SetAmount<import("@endo/patterns").Key> | import("./types.js").CopyBagAmount<import("@endo/patterns").Key>;
|
|
18
18
|
}>;
|
|
19
|
+
import type { Zone } from '@agoric/zone';
|
|
19
20
|
import type { AssetKind } from './types.js';
|
|
20
21
|
import type { Brand } from './types.js';
|
|
22
|
+
import type { InterfaceGuard } from '@endo/patterns';
|
|
21
23
|
import type { RecoverySetsOption } from './types.js';
|
|
22
24
|
import type { Payment } from './types.js';
|
|
23
25
|
//# sourceMappingURL=purse.d.ts.map
|
package/src/purse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purse.d.ts","sourceRoot":"","sources":["purse.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"purse.d.ts","sourceRoot":"","sources":["purse.js"],"names":[],"mappings":"AA+BO,6CAfI,IAAI,QACJ,MAAM,aACN,SAAS,SACT,KAAK,aACL;IACN,KAAK,EAAE,eAAe,GAAG,CAAC,CAAC;IAC3B,YAAY,EAAE,eAAe,GAAG,CAAC,CAAC;CACnC,gBACO;IACN,eAAe,EAAE,GAAG,CAAC;IACrB,gBAAgB,EAAE,GAAG,CAAC;CACvB,qBACO,kBAAkB,uBAClB,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;GA4JlD;0BAjLsB,cAAc;+BAD2B,YAAY;2BAAZ,YAAY;oCAE3C,gBAAgB;wCAFe,YAAY;6BAAZ,YAAY"}
|
package/src/purse.js
CHANGED
|
@@ -4,19 +4,23 @@ import { AmountMath } from './amountMath.js';
|
|
|
4
4
|
import { makeTransientNotifierKit } from './transientNotifier.js';
|
|
5
5
|
import { makeAmountStore } from './amountStore.js';
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* @import {AssetKind, RecoverySetsOption, Brand, Payment} from './types.js'
|
|
9
|
+
* @import {Zone} from '@agoric/zone';
|
|
10
|
+
* @import {InterfaceGuard} from '@endo/patterns';
|
|
11
|
+
*/
|
|
8
12
|
|
|
9
13
|
const EMPTY_COPY_SET = makeCopySet([]);
|
|
10
14
|
|
|
11
15
|
// TODO Type InterfaceGuard better than InterfaceGuard<any>
|
|
12
16
|
/**
|
|
13
|
-
* @param {
|
|
17
|
+
* @param {Zone} issuerZone
|
|
14
18
|
* @param {string} name
|
|
15
19
|
* @param {AssetKind} assetKind
|
|
16
20
|
* @param {Brand} brand
|
|
17
21
|
* @param {{
|
|
18
|
-
* purse:
|
|
19
|
-
* depositFacet:
|
|
22
|
+
* purse: InterfaceGuard<any>;
|
|
23
|
+
* depositFacet: InterfaceGuard<any>;
|
|
20
24
|
* }} PurseIKit
|
|
21
25
|
* @param {{
|
|
22
26
|
* depositInternal: any;
|
package/src/typeGuards.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @import {AmountValue, Ratio} from './types.js'
|
|
3
3
|
* @import {TypedPattern} from '@agoric/internal'
|
|
4
4
|
* @import {CopyBag, CopySet, Pattern} from '@endo/patterns';
|
|
5
|
+
* @import {NatValue} from './types.js';
|
|
5
6
|
*/
|
|
6
7
|
export const BrandShape: import("@endo/patterns").Matcher;
|
|
7
8
|
export const IssuerShape: import("@endo/patterns").Matcher;
|
|
@@ -28,7 +29,7 @@ export namespace AmountShape {
|
|
|
28
29
|
export const AmountPatternShape: import("@endo/patterns").Matcher;
|
|
29
30
|
/** @type {TypedPattern<Ratio>} */
|
|
30
31
|
export const RatioShape: TypedPattern<Ratio>;
|
|
31
|
-
export function isNatValue(value: AmountValue): value is
|
|
32
|
+
export function isNatValue(value: AmountValue): value is NatValue;
|
|
32
33
|
export function isCopySetValue(value: AmountValue): value is CopySet;
|
|
33
34
|
export function isSetValue(value: AmountValue): value is SetValue;
|
|
34
35
|
export function isCopyBagValue(value: AmountValue): value is CopyBag;
|
|
@@ -86,6 +87,7 @@ declare const AmountValueShape: import("@endo/patterns").Matcher;
|
|
|
86
87
|
import type { Ratio } from './types.js';
|
|
87
88
|
import type { TypedPattern } from '@agoric/internal';
|
|
88
89
|
import type { AmountValue } from './types.js';
|
|
90
|
+
import type { NatValue } from './types.js';
|
|
89
91
|
import type { CopySet } from '@endo/patterns';
|
|
90
92
|
import type { CopyBag } from '@endo/patterns';
|
|
91
93
|
import type { Pattern } from '@endo/patterns';
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,0DAA+C;AAC/C,2DAAiD;AACjD,4DAAmD;AACnD,0DAA+C;AAC/C,iEAA6D;AAC7D,6DAAqD;AACrD,yDAA6C;;;;;AAkE7C;;;;;;;;;;GAUG;AACH,kEAA8C;AAE9C,kCAAkC;AAClC,yBADW,aAAa,KAAK,CAAC,CACiD;AASxE,kCAHI,WAAW,GACT,KAAK,IAAI,QAAQ,CAEkC;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,0CAA2C,GAAG,CAAC;AAE/C,8DAAuE;AAEvE,gEAaE;;;;;;;;AAaF;;;;;GAKG;AAOI,kDAJI,OAAO,mBACP,OAAO,gBACP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEjB;AAhLD,iEAKE;2BAzEmC,YAAY;kCAClB,kBAAkB;iCADZ,YAAY;8BAGtB,YAAY;6BADK,gBAAgB;6BAAhB,gBAAgB;6BAAhB,gBAAgB"}
|
package/src/typeGuards.js
CHANGED
|
@@ -5,6 +5,7 @@ import { M, matches, getInterfaceGuardPayload } from '@endo/patterns';
|
|
|
5
5
|
* @import {AmountValue, Ratio} from './types.js'
|
|
6
6
|
* @import {TypedPattern} from '@agoric/internal'
|
|
7
7
|
* @import {CopyBag, CopySet, Pattern} from '@endo/patterns';
|
|
8
|
+
* @import {NatValue} from './types.js';
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
export const BrandShape = M.remotable('Brand');
|
|
@@ -100,7 +101,7 @@ harden(RatioShape);
|
|
|
100
101
|
* Returns true if value is a Nat bigint.
|
|
101
102
|
*
|
|
102
103
|
* @param {AmountValue} value
|
|
103
|
-
* @returns {value is
|
|
104
|
+
* @returns {value is NatValue}
|
|
104
105
|
*/
|
|
105
106
|
export const isNatValue = value => matches(value, NatValueShape);
|
|
106
107
|
harden(isNatValue);
|