@agoric/portfolio-api 0.1.1-dev-192500d.0.192500d → 0.1.1-dev-9b77fff.0.9b77fff
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/types.d.ts +14 -2
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +21 -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-9b77fff.0.9b77fff",
|
|
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-9b77fff.0.9b77fff",
|
|
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-9b77fff.0.9b77fff",
|
|
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": "9b77fff24571dde366d6f2b83db5e80444f2e202"
|
|
68
68
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NatAmount } from '@agoric/ertp';
|
|
2
2
|
import { type AccountId, type Bech32Address, type CosmosChainAddress, type TrafficEntry } from '@agoric/orchestration';
|
|
3
|
-
import type { SupportedChain, YieldProtocol } from './constants.js';
|
|
3
|
+
import type { AxelarChain, SupportedChain, YieldProtocol } from './constants.js';
|
|
4
4
|
import type { InstrumentId } from './instruments.js';
|
|
5
5
|
import type { PublishedTx } from './resolver.js';
|
|
6
6
|
/**
|
|
@@ -22,8 +22,18 @@ export type SeatKeyword = 'Cash' | 'Deposit';
|
|
|
22
22
|
* '+agoric' is published as `depositAddress`
|
|
23
23
|
*/
|
|
24
24
|
export type LocalChainAccountRef = '+agoric';
|
|
25
|
+
/**
|
|
26
|
+
* Identifies the blockchain hosting an address external to ymax from which
|
|
27
|
+
* funds for a deposit must be supplied.
|
|
28
|
+
*/
|
|
29
|
+
export type DepositFromChainRef = `+${AxelarChain}`;
|
|
30
|
+
/**
|
|
31
|
+
* Identifies the blockchain hosting an address external to ymax to which
|
|
32
|
+
* withdrawn funds will be sent.
|
|
33
|
+
*/
|
|
34
|
+
export type WithdrawToChainRef = `-${AxelarChain}`;
|
|
25
35
|
export type InterChainAccountRef = `@${SupportedChain}`;
|
|
26
|
-
export type AssetPlaceRef = `<${SeatKeyword}>` | LocalChainAccountRef | InterChainAccountRef | InstrumentId;
|
|
36
|
+
export type AssetPlaceRef = `<${SeatKeyword}>` | LocalChainAccountRef | DepositFromChainRef | WithdrawToChainRef | InterChainAccountRef | InstrumentId;
|
|
27
37
|
type Empty = Record<never, NatAmount>;
|
|
28
38
|
/**
|
|
29
39
|
* Proposal shapes for portfolio operations.
|
|
@@ -72,9 +82,11 @@ export type TargetAllocation = Partial<Record<InstrumentId, bigint>>;
|
|
|
72
82
|
export type FlowDetail = {
|
|
73
83
|
type: 'withdraw';
|
|
74
84
|
amount: NatAmount;
|
|
85
|
+
toChain?: SupportedChain;
|
|
75
86
|
} | {
|
|
76
87
|
type: 'deposit';
|
|
77
88
|
amount: NatAmount;
|
|
89
|
+
fromChain?: SupportedChain;
|
|
78
90
|
} | {
|
|
79
91
|
type: 'rebalance';
|
|
80
92
|
};
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,WAAW,EAAE,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,WAAW,EAAE,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,IAAI,cAAc,EAAE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S,CAAC;KACrB,CAAC;IACF,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAC1C,SAAS,GACT,UAAU,GACV,WAAW,GACX,iBAAiB,CAAC"}
|
package/src/types.ts
CHANGED
|
@@ -10,7 +10,11 @@ import type {
|
|
|
10
10
|
ContinuingInvitationSpec,
|
|
11
11
|
ContractInvitationSpec,
|
|
12
12
|
} from '@agoric/smart-wallet/src/invitations.js';
|
|
13
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
AxelarChain,
|
|
15
|
+
SupportedChain,
|
|
16
|
+
YieldProtocol,
|
|
17
|
+
} from './constants.js';
|
|
14
18
|
import type { InstrumentId } from './instruments.js';
|
|
15
19
|
import type { PublishedTx } from './resolver.js';
|
|
16
20
|
|
|
@@ -36,11 +40,25 @@ export type SeatKeyword = 'Cash' | 'Deposit';
|
|
|
36
40
|
*/
|
|
37
41
|
export type LocalChainAccountRef = '+agoric';
|
|
38
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Identifies the blockchain hosting an address external to ymax from which
|
|
45
|
+
* funds for a deposit must be supplied.
|
|
46
|
+
*/
|
|
47
|
+
export type DepositFromChainRef = `+${AxelarChain}`;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Identifies the blockchain hosting an address external to ymax to which
|
|
51
|
+
* withdrawn funds will be sent.
|
|
52
|
+
*/
|
|
53
|
+
export type WithdrawToChainRef = `-${AxelarChain}`;
|
|
54
|
+
|
|
39
55
|
export type InterChainAccountRef = `@${SupportedChain}`;
|
|
40
56
|
|
|
41
57
|
export type AssetPlaceRef =
|
|
42
58
|
| `<${SeatKeyword}>`
|
|
43
59
|
| LocalChainAccountRef
|
|
60
|
+
| DepositFromChainRef
|
|
61
|
+
| WithdrawToChainRef
|
|
44
62
|
| InterChainAccountRef
|
|
45
63
|
| InstrumentId;
|
|
46
64
|
|
|
@@ -75,8 +93,8 @@ export type ProposalType = {
|
|
|
75
93
|
export type TargetAllocation = Partial<Record<InstrumentId, bigint>>;
|
|
76
94
|
|
|
77
95
|
export type FlowDetail =
|
|
78
|
-
| { type: 'withdraw'; amount: NatAmount }
|
|
79
|
-
| { type: 'deposit'; amount: NatAmount }
|
|
96
|
+
| { type: 'withdraw'; amount: NatAmount; toChain?: SupportedChain }
|
|
97
|
+
| { type: 'deposit'; amount: NatAmount; fromChain?: SupportedChain }
|
|
80
98
|
| { type: 'rebalance' }; // aka simpleRebalance
|
|
81
99
|
|
|
82
100
|
/** linked list of concurrent failures, including dependencies */
|