@agoric/casting 0.4.3-dev-75b00b2.0 → 0.4.3-dev-bef63e5.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 +13 -13
- package/src/casting-spec.d.ts +8 -8
- package/src/casting-spec.d.ts.map +1 -1
- package/src/casting-spec.js +7 -7
- package/src/change-follower.d.ts +1 -1
- package/src/change-follower.d.ts.map +1 -1
- package/src/change-follower.js +2 -2
- package/src/defaults.d.ts +2 -2
- package/src/defaults.d.ts.map +1 -1
- package/src/defaults.js +1 -1
- package/src/follower-cosmjs.js +2 -2
- package/src/follower.d.ts +1 -1
- package/src/follower.d.ts.map +1 -1
- package/src/follower.js +6 -6
- package/src/iterable.d.ts +3 -3
- package/src/iterable.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/casting",
|
|
3
|
-
"version": "0.4.3-dev-
|
|
3
|
+
"version": "0.4.3-dev-bef63e5.0+bef63e5",
|
|
4
4
|
"description": "Agoric's OCap broadcasting system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -22,24 +22,24 @@
|
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/internal": "0.3.3-dev-
|
|
26
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
27
|
-
"@agoric/spawner": "0.6.9-dev-
|
|
28
|
-
"@agoric/store": "0.9.3-dev-
|
|
25
|
+
"@agoric/internal": "0.3.3-dev-bef63e5.0+bef63e5",
|
|
26
|
+
"@agoric/notifier": "0.6.3-dev-bef63e5.0+bef63e5",
|
|
27
|
+
"@agoric/spawner": "0.6.9-dev-bef63e5.0+bef63e5",
|
|
28
|
+
"@agoric/store": "0.9.3-dev-bef63e5.0+bef63e5",
|
|
29
29
|
"@cosmjs/encoding": "^0.30.1",
|
|
30
30
|
"@cosmjs/proto-signing": "^0.30.1",
|
|
31
31
|
"@cosmjs/stargate": "^0.30.1",
|
|
32
32
|
"@cosmjs/tendermint-rpc": "^0.30.1",
|
|
33
|
-
"@endo/far": "^0.
|
|
34
|
-
"@endo/init": "^0.
|
|
35
|
-
"@endo/lockdown": "^0.1
|
|
36
|
-
"@endo/marshal": "^0.
|
|
37
|
-
"@endo/promise-kit": "^0.
|
|
33
|
+
"@endo/far": "^1.0.1",
|
|
34
|
+
"@endo/init": "^1.0.1",
|
|
35
|
+
"@endo/lockdown": "^1.0.1",
|
|
36
|
+
"@endo/marshal": "^1.0.1",
|
|
37
|
+
"@endo/promise-kit": "^1.0.1",
|
|
38
38
|
"node-fetch": "^2.6.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@agoric/cosmic-proto": "0.3.1-dev-
|
|
42
|
-
"@endo/ses-ava": "^0.
|
|
41
|
+
"@agoric/cosmic-proto": "0.3.1-dev-bef63e5.0+bef63e5",
|
|
42
|
+
"@endo/ses-ava": "^1.0.1",
|
|
43
43
|
"@types/node-fetch": "^2.6.2",
|
|
44
44
|
"ava": "^5.3.0",
|
|
45
45
|
"c8": "^7.13.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"typeCoverage": {
|
|
63
63
|
"atLeast": 88.12
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "bef63e5f0c6ad6a553b3eef69d722c060995a247"
|
|
66
66
|
}
|
package/src/casting-spec.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ export function vstorageKeySpecToPath({ storeName, storeSubkey }: VStorageKey):
|
|
|
2
2
|
/**
|
|
3
3
|
* @param {string} storagePath
|
|
4
4
|
* @param {string} [storeName]
|
|
5
|
-
* @returns {import('./types').CastingSpec}
|
|
5
|
+
* @returns {import('./types.js').CastingSpec}
|
|
6
6
|
*/
|
|
7
|
-
export function DEFAULT_PATH_CONVERTER(storagePath: string, storeName?: string | undefined): import('./types').CastingSpec;
|
|
7
|
+
export function DEFAULT_PATH_CONVERTER(storagePath: string, storeName?: string | undefined): import('./types.js').CastingSpec;
|
|
8
8
|
/**
|
|
9
|
-
* @type {Record<string, (path: string) => import('./types').CastingSpec>}
|
|
9
|
+
* @type {Record<string, (path: string) => import('./types.js').CastingSpec>}
|
|
10
10
|
*/
|
|
11
|
-
export const pathPrefixToConverters: Record<string, (path: string) => import('./types').CastingSpec>;
|
|
12
|
-
export function makeCastingSpecFromString(specString: string): import('./types').CastingSpec;
|
|
13
|
-
export function makeCastingSpecFromObject(specObj: any): import('./types').CastingSpec;
|
|
14
|
-
export function makeCastingSpecFromRef(specCap: ERef<any>): Promise<import('./types').CastingSpec>;
|
|
15
|
-
export function makeCastingSpec(sourceP: ERef<unknown>): Promise<import('./types').CastingSpec>;
|
|
11
|
+
export const pathPrefixToConverters: Record<string, (path: string) => import('./types.js').CastingSpec>;
|
|
12
|
+
export function makeCastingSpecFromString(specString: string): import('./types.js').CastingSpec;
|
|
13
|
+
export function makeCastingSpecFromObject(specObj: any): import('./types.js').CastingSpec;
|
|
14
|
+
export function makeCastingSpecFromRef(specCap: ERef<any>): Promise<import('./types.js').CastingSpec>;
|
|
15
|
+
export function makeCastingSpec(sourceP: ERef<unknown>): Promise<import('./types.js').CastingSpec>;
|
|
16
16
|
//# sourceMappingURL=casting-spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"casting-spec.d.ts","sourceRoot":"","sources":["casting-spec.js"],"names":[],"mappings":"AA6CO,kEAHI,WAAW,GACT,MAAM,CAYlB;AAlCD;;;;GAIG;AACH,oDAJW,MAAM,mCAEJ,OAAO,
|
|
1
|
+
{"version":3,"file":"casting-spec.d.ts","sourceRoot":"","sources":["casting-spec.js"],"names":[],"mappings":"AA6CO,kEAHI,WAAW,GACT,MAAM,CAYlB;AAlCD;;;;GAIG;AACH,oDAJW,MAAM,mCAEJ,OAAO,YAAY,EAAE,WAAW,CAa5C;AAsBD;;GAEG;AACH,2DAFgC,MAAM,KAAK,OAAO,YAAY,EAAE,WAAW,EAMxE;AAMI,sDAHI,MAAM,GACJ,OAAO,YAAY,EAAE,WAAW,CAc5C;AAQM,mDAHI,GAAG,GACD,OAAO,YAAY,EAAE,WAAW,CAmC5C;AAMM,gDAHI,KAAK,GAAG,CAAC,GACP,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,CAKrD;AAQM,yCAHI,KAAK,OAAO,CAAC,GACX,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,CAgBrD"}
|
package/src/casting-spec.js
CHANGED
|
@@ -5,7 +5,7 @@ const { toAscii } = encodingStar;
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @param {string} storagePath
|
|
8
|
-
* @returns {import('./types').CastingSpec}
|
|
8
|
+
* @returns {import('./types.js').CastingSpec}
|
|
9
9
|
*/
|
|
10
10
|
const swingsetPathToCastingSpec = storagePath =>
|
|
11
11
|
harden({
|
|
@@ -22,7 +22,7 @@ const NO_DATA_VALUE = new Uint8Array([255]);
|
|
|
22
22
|
/**
|
|
23
23
|
* @param {string} storagePath
|
|
24
24
|
* @param {string} [storeName]
|
|
25
|
-
* @returns {import('./types').CastingSpec}
|
|
25
|
+
* @returns {import('./types.js').CastingSpec}
|
|
26
26
|
*/
|
|
27
27
|
const vstoragePathToCastingSpec = (storagePath, storeName = 'vstorage') => {
|
|
28
28
|
const elems = storagePath ? storagePath.split('.') : [];
|
|
@@ -58,7 +58,7 @@ export const vstorageKeySpecToPath = ({ storeName, storeSubkey }) => {
|
|
|
58
58
|
export const DEFAULT_PATH_CONVERTER = vstoragePathToCastingSpec;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* @type {Record<string, (path: string) => import('./types').CastingSpec>}
|
|
61
|
+
* @type {Record<string, (path: string) => import('./types.js').CastingSpec>}
|
|
62
62
|
*/
|
|
63
63
|
export const pathPrefixToConverters = harden({
|
|
64
64
|
'swingset:': swingsetPathToCastingSpec,
|
|
@@ -68,7 +68,7 @@ export const pathPrefixToConverters = harden({
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* @param {string} specString
|
|
71
|
-
* @returns {import('./types').CastingSpec}
|
|
71
|
+
* @returns {import('./types.js').CastingSpec}
|
|
72
72
|
*/
|
|
73
73
|
export const makeCastingSpecFromString = specString => {
|
|
74
74
|
assert.typeof(specString, 'string');
|
|
@@ -88,7 +88,7 @@ const te = new TextEncoder();
|
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* @param {any} specObj
|
|
91
|
-
* @returns {import('./types').CastingSpec}
|
|
91
|
+
* @returns {import('./types.js').CastingSpec}
|
|
92
92
|
*/
|
|
93
93
|
export const makeCastingSpecFromObject = specObj => {
|
|
94
94
|
const {
|
|
@@ -127,7 +127,7 @@ export const makeCastingSpecFromObject = specObj => {
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* @param {ERef<any>} specCap
|
|
130
|
-
* @returns {Promise<import('./types').CastingSpec>}
|
|
130
|
+
* @returns {Promise<import('./types.js').CastingSpec>}
|
|
131
131
|
*/
|
|
132
132
|
export const makeCastingSpecFromRef = async specCap => {
|
|
133
133
|
const specObj = await E(specCap).getStoreKey();
|
|
@@ -138,7 +138,7 @@ export const makeCastingSpecFromRef = async specCap => {
|
|
|
138
138
|
* Create an abstract type from a given source representation
|
|
139
139
|
*
|
|
140
140
|
* @param {ERef<unknown>} sourceP
|
|
141
|
-
* @returns {Promise<import('./types').CastingSpec>}
|
|
141
|
+
* @returns {Promise<import('./types.js').CastingSpec>}
|
|
142
142
|
*/
|
|
143
143
|
export const makeCastingSpec = async sourceP => {
|
|
144
144
|
const spec = await sourceP;
|
package/src/change-follower.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function makePollingChangeFollower(leader: import('./types').Leader): Promise<import('./types.js').Follower<import('./types').CastingChange>>;
|
|
1
|
+
export function makePollingChangeFollower(leader: import('./types.js').Leader): Promise<import('./types.js').Follower<import('./types.js').CastingChange>>;
|
|
2
2
|
//# sourceMappingURL=change-follower.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-follower.d.ts","sourceRoot":"","sources":["change-follower.js"],"names":[],"mappings":"AASO,kDAHI,OAAO,
|
|
1
|
+
{"version":3,"file":"change-follower.d.ts","sourceRoot":"","sources":["change-follower.js"],"names":[],"mappings":"AASO,kDAHI,OAAO,YAAY,EAAE,MAAM,GACzB,QAAQ,OAAO,YAAY,EAAE,QAAQ,CAAC,OAAO,YAAY,EAAE,aAAa,CAAC,CAAC,CA6CtF"}
|
package/src/change-follower.js
CHANGED
|
@@ -4,8 +4,8 @@ import { DEFAULT_KEEP_POLLING } from './defaults.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Just return an unspecified allegedValue every poll period.
|
|
6
6
|
*
|
|
7
|
-
* @param {import('./types').Leader} leader
|
|
8
|
-
* @returns {Promise<import('./types.js').Follower<import('./types').CastingChange>>}
|
|
7
|
+
* @param {import('./types.js').Leader} leader
|
|
8
|
+
* @returns {Promise<import('./types.js').Follower<import('./types.js').CastingChange>>}
|
|
9
9
|
*/
|
|
10
10
|
export const makePollingChangeFollower = async leader => {
|
|
11
11
|
const { keepPolling = DEFAULT_KEEP_POLLING } = await E(leader).getOptions();
|
package/src/defaults.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export function MAKE_DEFAULT_DECODER(): (str: any) => any;
|
|
|
15
15
|
/**
|
|
16
16
|
* Unserialize the JSONable data.
|
|
17
17
|
*
|
|
18
|
-
* @type {() => import('./types').Unserializer}
|
|
18
|
+
* @type {() => import('./types.js').Unserializer}
|
|
19
19
|
*/
|
|
20
|
-
export const MAKE_DEFAULT_UNSERIALIZER: () => import('./types').Unserializer;
|
|
20
|
+
export const MAKE_DEFAULT_UNSERIALIZER: () => import('./types.js').Unserializer;
|
|
21
21
|
//# sourceMappingURL=defaults.d.ts.map
|
package/src/defaults.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["defaults.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,yDAA0D;AAE1D,uCAAwC;AAExC,mDAAoD;AAEpD,6CAA8C;AAUvC,0BAHI,MAAM,GACJ,QAAQ,IAAI,CAAC,CAEgD;AAMnE,qCAHI,MAAM,oCAKhB;AAOM,8HAEN;AAQM,sCAHI,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMzB;AAUM,8CALI,MAAM,OACN,GAAG,iCAED,QAAQ,IAAI,CAAC,CASzB;AAOM,wCAFM,QAAQ,OAAO,CAAC,CAGgD;AAEtE,0DAaN;AAED;;;;GAIG;AACH,wCAFU,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["defaults.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,yDAA0D;AAE1D,uCAAwC;AAExC,mDAAoD;AAEpD,6CAA8C;AAUvC,0BAHI,MAAM,GACJ,QAAQ,IAAI,CAAC,CAEgD;AAMnE,qCAHI,MAAM,oCAKhB;AAOM,8HAEN;AAQM,sCAHI,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMzB;AAUM,8CALI,MAAM,OACN,GAAG,iCAED,QAAQ,IAAI,CAAC,CASzB;AAOM,wCAFM,QAAQ,OAAO,CAAC,CAGgD;AAEtE,0DAaN;AAED;;;;GAIG;AACH,wCAFU,MAAM,OAAO,YAAY,EAAE,YAAY,CA2B/C"}
|
package/src/defaults.js
CHANGED
|
@@ -95,7 +95,7 @@ export const MAKE_DEFAULT_DECODER = () => {
|
|
|
95
95
|
/**
|
|
96
96
|
* Unserialize the JSONable data.
|
|
97
97
|
*
|
|
98
|
-
* @type {() => import('./types').Unserializer}
|
|
98
|
+
* @type {() => import('./types.js').Unserializer}
|
|
99
99
|
*/
|
|
100
100
|
export const MAKE_DEFAULT_UNSERIALIZER = () => {
|
|
101
101
|
const ifaceAllegedPrefix = 'Alleged: ';
|
package/src/follower-cosmjs.js
CHANGED
|
@@ -90,8 +90,8 @@ const proofs = ['strict', 'none', 'optimistic'];
|
|
|
90
90
|
/**
|
|
91
91
|
* @template T
|
|
92
92
|
* @param {any} sourceP
|
|
93
|
-
* @param {import('./types').LeaderOrMaker} [leaderOrMaker]
|
|
94
|
-
* @param {import('./types').FollowerOptions} [options]
|
|
93
|
+
* @param {import('./types.js').LeaderOrMaker} [leaderOrMaker]
|
|
94
|
+
* @param {import('./types.js').FollowerOptions} [options]
|
|
95
95
|
* @returns {ValueFollower<T>}
|
|
96
96
|
*/
|
|
97
97
|
export const makeCosmjsFollower = (
|
package/src/follower.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function makeFollower<T>(specP: ERef<import('./types').CastingSpec> | string, leaderOrMaker?: import("./types").LeaderOrMaker | undefined, options?: import("./types").FollowerOptions | undefined): Promise<import("./follower-cosmjs.js").ValueFollower<T>>;
|
|
1
|
+
export function makeFollower<T>(specP: ERef<import('./types.js').CastingSpec> | string, leaderOrMaker?: import("./types.js").LeaderOrMaker | undefined, options?: import("./types.js").FollowerOptions | undefined): Promise<import("./follower-cosmjs.js").ValueFollower<T>>;
|
|
2
2
|
//# sourceMappingURL=follower.d.ts.map
|
package/src/follower.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"follower.d.ts","sourceRoot":"","sources":["follower.js"],"names":[],"mappings":"AA4DO,uCALI,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"follower.d.ts","sourceRoot":"","sources":["follower.js"],"names":[],"mappings":"AA4DO,uCALI,KAAK,OAAO,YAAY,EAAE,WAAW,CAAC,GAAG,MAAM,wLAYzD"}
|
package/src/follower.js
CHANGED
|
@@ -11,12 +11,12 @@ import { makeCastingSpec } from './casting-spec.js';
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @template T
|
|
14
|
-
* @param {ERef<import('./types').CastingSpec>} spec
|
|
14
|
+
* @param {ERef<import('./types.js').CastingSpec>} spec
|
|
15
15
|
*/
|
|
16
16
|
const makeSubscriptionFollower = spec => {
|
|
17
17
|
const transform = value =>
|
|
18
18
|
harden({ value, blockHeight: NaN, currentBlockHeight: NaN });
|
|
19
|
-
/** @type {import('./types').Follower<import('./types.js').ValueFollowerElement<T>>} */
|
|
19
|
+
/** @type {import('./types.js').Follower<import('./types.js').ValueFollowerElement<T>>} */
|
|
20
20
|
const follower = Far('subscription/notifier follower', {
|
|
21
21
|
getLatestIterable: async () => {
|
|
22
22
|
const { notifier, subscription } = await spec;
|
|
@@ -53,10 +53,10 @@ const makeSubscriptionFollower = spec => {
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* @template T
|
|
56
|
-
* @param {ERef<import('./types').CastingSpec> | string} specP
|
|
57
|
-
* @param {import('./types').LeaderOrMaker} [leaderOrMaker]
|
|
58
|
-
* @param {import('./types').FollowerOptions} [options]
|
|
59
|
-
* @returns {Promise<import('./follower-cosmjs').ValueFollower<T>>}
|
|
56
|
+
* @param {ERef<import('./types.js').CastingSpec> | string} specP
|
|
57
|
+
* @param {import('./types.js').LeaderOrMaker} [leaderOrMaker]
|
|
58
|
+
* @param {import('./types.js').FollowerOptions} [options]
|
|
59
|
+
* @returns {Promise<import('./follower-cosmjs.js').ValueFollower<T>>}
|
|
60
60
|
*/
|
|
61
61
|
export const makeFollower = async (specP, leaderOrMaker, options) => {
|
|
62
62
|
const spec = await makeCastingSpec(specP);
|
package/src/iterable.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export function mapAsyncIterable<TIn, TOut>(iterable: AsyncIterable<TIn>, transform: (value: TIn) => TOut): AsyncIterable<TOut>;
|
|
2
|
-
export function iterateLatest<T>(follower: ERef<import("./types").Follower<T>>): {
|
|
2
|
+
export function iterateLatest<T>(follower: ERef<import("./types.js").Follower<T>>): {
|
|
3
3
|
/** @returns {AsyncIterator<T>} */
|
|
4
4
|
[Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined>;
|
|
5
5
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
6
6
|
/** @returns {AsyncIterator<T>} */
|
|
7
7
|
[Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined>;
|
|
8
8
|
}>;
|
|
9
|
-
export function iterateEach<T>(follower: ERef<import("./types").Follower<T>>, options?: import("./types").IterateEachOptions | undefined): {
|
|
9
|
+
export function iterateEach<T>(follower: ERef<import("./types.js").Follower<T>>, options?: import("./types.js").IterateEachOptions | undefined): {
|
|
10
10
|
/** @returns {AsyncIterator<T>} */
|
|
11
11
|
[Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined>;
|
|
12
12
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
13
13
|
/** @returns {AsyncIterator<T>} */
|
|
14
14
|
[Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined>;
|
|
15
15
|
}>;
|
|
16
|
-
export function iterateReverse<T>(follower: ERef<import("./types").Follower<T>>, options?: import("./types").IterateEachOptions | undefined): {
|
|
16
|
+
export function iterateReverse<T>(follower: ERef<import("./types.js").Follower<T>>, options?: import("./types.js").IterateEachOptions | undefined): {
|
|
17
17
|
/** @returns {AsyncIterator<T>} */
|
|
18
18
|
[Symbol.asyncIterator]: () => AsyncIterator<T, any, undefined>;
|
|
19
19
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
package/src/iterable.js
CHANGED
|
@@ -22,7 +22,7 @@ export const mapAsyncIterable = (iterable, transform) => {
|
|
|
22
22
|
* TODO: Remove this function when we have an @endo/publish-kit that suppports pull topics
|
|
23
23
|
*
|
|
24
24
|
* @template T
|
|
25
|
-
* @param {ERef<import('./types').Follower<T>>} follower
|
|
25
|
+
* @param {ERef<import('./types.js').Follower<T>>} follower
|
|
26
26
|
*/
|
|
27
27
|
export const iterateLatest = follower =>
|
|
28
28
|
// For now, just pass through the iterable.
|