@agoric/portfolio-api 0.1.1-dev-6d1b224.0.6d1b224 → 0.1.1-dev-2ce7c93.0.2ce7c93

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/portfolio-api",
3
- "version": "0.1.1-dev-6d1b224.0.6d1b224",
3
+ "version": "0.1.1-dev-2ce7c93.0.2ce7c93",
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-6d1b224.0.6d1b224",
30
+ "@agoric/orchestration": "0.1.1-dev-2ce7c93.0.2ce7c93",
31
31
  "@endo/common": "^1.2.13"
32
32
  },
33
33
  "devDependencies": {
34
- "@agoric/internal": "0.3.3-dev-6d1b224.0.6d1b224",
34
+ "@agoric/internal": "0.3.3-dev-2ce7c93.0.2ce7c93",
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": "6d1b2246165751111258f3396273652d2e0d5fdd"
67
+ "gitHead": "2ce7c9393faeade1792021c863b464b58945477c"
68
68
  }
@@ -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
- * Treat these identifers as opaque strings. There are separate data structures
6
- * to map them to functional interfaces for interoperation.
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 {
@@ -23,6 +28,18 @@ export namespace InstrumentId {
23
28
  let Compound_Ethereum: "Compound_Ethereum";
24
29
  let Compound_Optimism: "Compound_Optimism";
25
30
  let ERC4626_vaultU2_Ethereum: "ERC4626_vaultU2_Ethereum";
31
+ let ERC4626_morphoClearstarHighYieldUsdc_Ethereum: "ERC4626_morphoClearstarHighYieldUsdc_Ethereum";
32
+ let ERC4626_morphoClearstarUsdcCore_Ethereum: "ERC4626_morphoClearstarUsdcCore_Ethereum";
33
+ let ERC4626_morphoGauntletUsdcRwa_Ethereum: "ERC4626_morphoGauntletUsdcRwa_Ethereum";
34
+ let ERC4626_morphoSteakhouseHighYieldInstant_Ethereum: "ERC4626_morphoSteakhouseHighYieldInstant_Ethereum";
35
+ let ERC4626_morphoClearstarInstitutionalUsdc_Ethereum: "ERC4626_morphoClearstarInstitutionalUsdc_Ethereum";
36
+ let ERC4626_morphoClearstarUsdcReactor_Ethereum: "ERC4626_morphoClearstarUsdcReactor_Ethereum";
37
+ let ERC4626_morphoAlphaUsdcCore_Ethereum: "ERC4626_morphoAlphaUsdcCore_Ethereum";
38
+ let ERC4626_morphoResolvUsdc_Ethereum: "ERC4626_morphoResolvUsdc_Ethereum";
39
+ let ERC4626_morphoGauntletUsdcFrontier_Ethereum: "ERC4626_morphoGauntletUsdcFrontier_Ethereum";
40
+ let ERC4626_morphoHyperithmUsdcMidcurve_Ethereum: "ERC4626_morphoHyperithmUsdcMidcurve_Ethereum";
41
+ let ERC4626_morphoHyperithmUsdcDegen_Ethereum: "ERC4626_morphoHyperithmUsdcDegen_Ethereum";
42
+ let ERC4626_morphoGauntletUsdcCore_Ethereum: "ERC4626_morphoGauntletUsdcCore_Ethereum";
26
43
  let USDN: "USDN";
27
44
  let USDNVault: "USDNVault";
28
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["instruments.js"],"names":[],"mappings":";;;;;;;2BAOU,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["instruments.js"],"names":[],"mappings":";;;;;;;;;;;;2BAYU,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC"}
@@ -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
- * Treat these identifers as opaque strings. There are separate data structures
6
- * to map them to functional interfaces for interoperation.
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
  */
@@ -24,6 +29,28 @@ export const InstrumentId = /** @type {const} */ ({
24
29
  Compound_Ethereum: 'Compound_Ethereum',
25
30
  Compound_Optimism: 'Compound_Optimism',
26
31
  ERC4626_vaultU2_Ethereum: 'ERC4626_vaultU2_Ethereum',
32
+ ERC4626_morphoClearstarHighYieldUsdc_Ethereum:
33
+ 'ERC4626_morphoClearstarHighYieldUsdc_Ethereum',
34
+ ERC4626_morphoClearstarUsdcCore_Ethereum:
35
+ 'ERC4626_morphoClearstarUsdcCore_Ethereum',
36
+ ERC4626_morphoGauntletUsdcRwa_Ethereum:
37
+ 'ERC4626_morphoGauntletUsdcRwa_Ethereum',
38
+ ERC4626_morphoSteakhouseHighYieldInstant_Ethereum:
39
+ 'ERC4626_morphoSteakhouseHighYieldInstant_Ethereum',
40
+ ERC4626_morphoClearstarInstitutionalUsdc_Ethereum:
41
+ 'ERC4626_morphoClearstarInstitutionalUsdc_Ethereum',
42
+ ERC4626_morphoClearstarUsdcReactor_Ethereum:
43
+ 'ERC4626_morphoClearstarUsdcReactor_Ethereum',
44
+ ERC4626_morphoAlphaUsdcCore_Ethereum: 'ERC4626_morphoAlphaUsdcCore_Ethereum',
45
+ ERC4626_morphoResolvUsdc_Ethereum: 'ERC4626_morphoResolvUsdc_Ethereum',
46
+ ERC4626_morphoGauntletUsdcFrontier_Ethereum:
47
+ 'ERC4626_morphoGauntletUsdcFrontier_Ethereum',
48
+ ERC4626_morphoHyperithmUsdcMidcurve_Ethereum:
49
+ 'ERC4626_morphoHyperithmUsdcMidcurve_Ethereum',
50
+ ERC4626_morphoHyperithmUsdcDegen_Ethereum:
51
+ 'ERC4626_morphoHyperithmUsdcDegen_Ethereum',
52
+ ERC4626_morphoGauntletUsdcCore_Ethereum:
53
+ 'ERC4626_morphoGauntletUsdcCore_Ethereum',
27
54
  USDN: 'USDN',
28
55
  USDNVault: 'USDNVault',
29
56
  });
package/src/main.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./constants.js";
2
2
  export * from "./instruments.js";
3
3
  export * from "./resolver.js";
4
+ export * from "./type-guards.js";
4
5
  export * from "./types-index.js";
5
6
  //# sourceMappingURL=main.d.ts.map
package/src/main.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './constants.js';
2
2
  export * from './instruments.js';
3
3
  export * from './resolver.js';
4
+ export * from './type-guards.js';
4
5
 
5
6
  // eslint-disable-next-line import/export -- just types
6
7
  export * from './types-index.js';
@@ -1,10 +1,18 @@
1
- import type { InterChainAccountRef, LocalChainAccountRef } from './types.js';
1
+ import type { InstrumentId } from './instruments.js';
2
+ import type { LocalChainAccountRef, InterChainAccountRef } from './types.js';
2
3
  /**
3
- * Does it match the pattern, without regard to supported chains.
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
- * Does it match the pattern, without regard to supported chains.
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
@@ -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;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,GAAG,IAAI,oBAA2C,CAAC;AAGtD;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,GAAG,IAAI,oBAA2C,CAAC"}
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"}
@@ -1,7 +1,9 @@
1
- import type { InterChainAccountRef, LocalChainAccountRef } from './types.js';
1
+ import type { InstrumentId } from './instruments.js';
2
+ import type { LocalChainAccountRef, InterChainAccountRef } from './types.js';
2
3
 
3
4
  /**
4
- * Does it match the pattern, without regard to supported chains.
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
- * Does it match the pattern, without regard to supported chains.
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);