@agoric/portfolio-api 0.1.1-dev-9fca75b.0.9fca75b → 0.1.1-dev-192500d.0.192500d
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 +4 -4
- package/src/instruments.d.ts +7 -2
- package/src/instruments.d.ts.map +1 -1
- package/src/instruments.js +7 -2
- package/src/main.d.ts +1 -0
- package/src/main.js +1 -0
- package/src/type-guards.d.ts +11 -3
- package/src/type-guards.d.ts.map +1 -1
- package/src/type-guards.ts +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/portfolio-api",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-192500d.0.192500d",
|
|
4
4
|
"description": "API for Portfolio management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"generate:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
30
|
+
"@agoric/orchestration": "0.1.1-dev-192500d.0.192500d",
|
|
31
31
|
"@endo/common": "^1.2.13"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@agoric/internal": "0.3.3-dev-
|
|
34
|
+
"@agoric/internal": "0.3.3-dev-192500d.0.192500d",
|
|
35
35
|
"@types/js-yaml": "^4",
|
|
36
36
|
"ajv": "^6.12.6",
|
|
37
37
|
"ava": "^5.3.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": "^20.9 || ^22.11"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "192500d7a565f6b43c468a28996d24375e4ff5c7"
|
|
68
68
|
}
|
package/src/instruments.d.ts
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
* Mnemonic IDs for supported financial instruments in which a portfolio can use
|
|
3
3
|
* assets to take a position.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* These identifiers are to be treated as opaque strings, but must not start
|
|
6
|
+
* with punctuation that could result in them being misinterpreted as any other
|
|
7
|
+
* kind of {@link AssetPlaceRef} (e.g., a `<`-prefixed {@link SeatKeyword} or
|
|
8
|
+
* `@`-prefixed {@link InterChainAccountRef}), and in fact must start with an
|
|
9
|
+
* ASCII letter unless the implementation of {@link isInstrumentId} is relaxed.
|
|
10
|
+
* There are separate data structures to map them to functional interfaces for
|
|
11
|
+
* interoperation.
|
|
7
12
|
*/
|
|
8
13
|
export type InstrumentId = (typeof InstrumentId)[keyof typeof InstrumentId];
|
|
9
14
|
export namespace InstrumentId {
|
package/src/instruments.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["instruments.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["instruments.js"],"names":[],"mappings":";;;;;;;;;;;;2BAYU,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC"}
|
package/src/instruments.js
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
* Mnemonic IDs for supported financial instruments in which a portfolio can use
|
|
3
3
|
* assets to take a position.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* These identifiers are to be treated as opaque strings, but must not start
|
|
6
|
+
* with punctuation that could result in them being misinterpreted as any other
|
|
7
|
+
* kind of {@link AssetPlaceRef} (e.g., a `<`-prefixed {@link SeatKeyword} or
|
|
8
|
+
* `@`-prefixed {@link InterChainAccountRef}), and in fact must start with an
|
|
9
|
+
* ASCII letter unless the implementation of {@link isInstrumentId} is relaxed.
|
|
10
|
+
* There are separate data structures to map them to functional interfaces for
|
|
11
|
+
* interoperation.
|
|
7
12
|
*
|
|
8
13
|
* @enum {(typeof InstrumentId)[keyof typeof InstrumentId]}
|
|
9
14
|
*/
|
package/src/main.d.ts
CHANGED
package/src/main.js
CHANGED
package/src/type-guards.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InstrumentId } from './instruments.js';
|
|
2
|
+
import type { LocalChainAccountRef, InterChainAccountRef } from './types.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Without regard to supported chains, is the input plausibly a
|
|
5
|
+
* LocalChainAccountRef (i.e., does it start with `+`)?
|
|
4
6
|
*/
|
|
5
7
|
export declare const isLocalChainAccountRef: (ref: string) => ref is LocalChainAccountRef;
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
9
|
+
* Without regard to supported chains, is the input plausibly an
|
|
10
|
+
* InterChainAccountRef (i.e., does it start with `@`)?
|
|
8
11
|
*/
|
|
9
12
|
export declare const isInterChainAccountRef: (ref: string) => ref is InterChainAccountRef;
|
|
13
|
+
/**
|
|
14
|
+
* Without regard to supported chains, is the input plausibly an InstrumentId
|
|
15
|
+
* (i.e., does it start with an ASCII letter)?
|
|
16
|
+
*/
|
|
17
|
+
export declare const isInstrumentId: (ref: string) => ref is InstrumentId;
|
|
10
18
|
//# sourceMappingURL=type-guards.d.ts.map
|
package/src/type-guards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE7E
|
|
1
|
+
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,GAAG,IAAI,oBAA2C,CAAC;AAGtD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,GAAG,IAAI,oBAA2C,CAAC;AAGtD;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,YAC5B,CAAC"}
|
package/src/type-guards.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InstrumentId } from './instruments.js';
|
|
2
|
+
import type { LocalChainAccountRef, InterChainAccountRef } from './types.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Without regard to supported chains, is the input plausibly a
|
|
6
|
+
* LocalChainAccountRef (i.e., does it start with `+`)?
|
|
5
7
|
*/
|
|
6
8
|
export const isLocalChainAccountRef = (
|
|
7
9
|
ref: string,
|
|
@@ -9,9 +11,18 @@ export const isLocalChainAccountRef = (
|
|
|
9
11
|
harden(isLocalChainAccountRef);
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
14
|
+
* Without regard to supported chains, is the input plausibly an
|
|
15
|
+
* InterChainAccountRef (i.e., does it start with `@`)?
|
|
13
16
|
*/
|
|
14
17
|
export const isInterChainAccountRef = (
|
|
15
18
|
ref: string,
|
|
16
19
|
): ref is InterChainAccountRef => ref.startsWith('@');
|
|
17
20
|
harden(isInterChainAccountRef);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Without regard to supported chains, is the input plausibly an InstrumentId
|
|
24
|
+
* (i.e., does it start with an ASCII letter)?
|
|
25
|
+
*/
|
|
26
|
+
export const isInstrumentId = (ref: string): ref is InstrumentId =>
|
|
27
|
+
!!ref.match(/^[a-z]/i);
|
|
28
|
+
harden(isInstrumentId);
|