@agoric/portfolio-api 0.1.1-dev-a091e87.0.a091e87 → 0.1.1-dev-9288d84.0.9288d84
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/type-guards.d.ts +11 -1
- package/src/type-guards.d.ts.map +1 -1
- package/src/type-guards.ts +23 -1
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-9288d84.0.9288d84",
|
|
4
4
|
"description": "API for Portfolio management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"generate:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agoric/internal": "0.3.3-dev-
|
|
31
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
30
|
+
"@agoric/internal": "0.3.3-dev-9288d84.0.9288d84",
|
|
31
|
+
"@agoric/orchestration": "0.1.1-dev-9288d84.0.9288d84",
|
|
32
32
|
"@endo/common": "^1.2.13",
|
|
33
33
|
"@endo/errors": "^1.2.13",
|
|
34
34
|
"@endo/patterns": "^1.7.0"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": "^20.9 || ^22.11"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "9288d84e2de10401f8211183329034ee0e7ffc43"
|
|
73
73
|
}
|
package/src/type-guards.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { InstrumentId } from './instruments.js';
|
|
2
|
-
import type { LocalChainAccountRef, InterChainAccountRef } from './types.js';
|
|
2
|
+
import type { DepositFromChainRef, LocalChainAccountRef, InterChainAccountRef, WithdrawToChainRef } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Without regard to supported chains, is the input plausibly a
|
|
5
|
+
* DepositFromChainRef (i.e., does it start with `+`)?
|
|
6
|
+
*/
|
|
7
|
+
export declare const isDepositFromChainRef: (ref: string) => ref is DepositFromChainRef;
|
|
3
8
|
/**
|
|
4
9
|
* Without regard to supported chains, is the input plausibly a
|
|
5
10
|
* LocalChainAccountRef (i.e., does it start with `+`)?
|
|
@@ -15,4 +20,9 @@ export declare const isInterChainAccountRef: (ref: string) => ref is InterChainA
|
|
|
15
20
|
* (i.e., does it start with an ASCII letter)?
|
|
16
21
|
*/
|
|
17
22
|
export declare const isInstrumentId: (ref: string) => ref is InstrumentId;
|
|
23
|
+
/**
|
|
24
|
+
* Without regard to supported chains, is the input plausibly a
|
|
25
|
+
* WithdrawToChainRef (i.e., does it start with `-`)?
|
|
26
|
+
*/
|
|
27
|
+
export declare const isWithdrawToChainRef: (ref: string) => ref is WithdrawToChainRef;
|
|
18
28
|
//# 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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,
|
|
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,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,KACV,GAAG,IAAI,mBAA0C,CAAC;AAGrD;;;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;AAGzB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,kBACrC,CAAC"}
|
package/src/type-guards.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { InstrumentId } from './instruments.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
DepositFromChainRef,
|
|
4
|
+
LocalChainAccountRef,
|
|
5
|
+
InterChainAccountRef,
|
|
6
|
+
WithdrawToChainRef,
|
|
7
|
+
} from './types.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Without regard to supported chains, is the input plausibly a
|
|
11
|
+
* DepositFromChainRef (i.e., does it start with `+`)?
|
|
12
|
+
*/
|
|
13
|
+
export const isDepositFromChainRef = (
|
|
14
|
+
ref: string,
|
|
15
|
+
): ref is DepositFromChainRef => ref.startsWith('+');
|
|
16
|
+
harden(isDepositFromChainRef);
|
|
3
17
|
|
|
4
18
|
/**
|
|
5
19
|
* Without regard to supported chains, is the input plausibly a
|
|
@@ -26,3 +40,11 @@ harden(isInterChainAccountRef);
|
|
|
26
40
|
export const isInstrumentId = (ref: string): ref is InstrumentId =>
|
|
27
41
|
!!ref.match(/^[a-z]/i);
|
|
28
42
|
harden(isInstrumentId);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Without regard to supported chains, is the input plausibly a
|
|
46
|
+
* WithdrawToChainRef (i.e., does it start with `-`)?
|
|
47
|
+
*/
|
|
48
|
+
export const isWithdrawToChainRef = (ref: string): ref is WithdrawToChainRef =>
|
|
49
|
+
ref.startsWith('-');
|
|
50
|
+
harden(isWithdrawToChainRef);
|