@agoric/portfolio-api 0.2.0 → 0.2.1-upgrade-23-dev-bd79330.0.bd79330
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 +26 -28
- package/src/constants.d.ts +115 -0
- package/src/constants.d.ts.map +1 -0
- package/src/constants.js +170 -13
- package/src/evm/types.d.ts +19 -0
- package/src/evm/types.d.ts.map +1 -0
- package/src/evm/types.js +27 -0
- package/src/evm-wallet/eip712-messages.d.ts +213 -0
- package/src/evm-wallet/eip712-messages.d.ts.map +1 -0
- package/src/evm-wallet/eip712-messages.js +355 -0
- package/src/evm-wallet/message-handler-helpers.d.ts +54 -0
- package/src/evm-wallet/message-handler-helpers.d.ts.map +1 -0
- package/src/evm-wallet/message-handler-helpers.js +289 -0
- package/src/instruments.d.ts +54 -0
- package/src/instruments.d.ts.map +1 -0
- package/src/instruments.js +69 -0
- package/src/main.d.ts +6 -0
- package/src/main.d.ts.map +1 -0
- package/src/main.js +6 -1
- package/src/model/generated/ymax-machine.d.ts +71 -0
- package/src/model/generated/ymax-machine.d.ts.map +1 -0
- package/src/model/generated/ymax-machine.js +1292 -0
- package/src/model/ymax-machine.mmd +56 -0
- package/src/model/ymax-machine.schema.json +180 -0
- package/src/model/ymax-machine.yaml +942 -0
- package/src/portfolio-constants.d.ts +44 -0
- package/src/portfolio-constants.d.ts.map +1 -0
- package/src/portfolio-constants.js +80 -0
- package/src/resolver.d.ts +159 -0
- package/src/resolver.d.ts.map +1 -0
- package/src/resolver.js +115 -0
- package/src/type-guards.d.ts +39 -0
- package/src/type-guards.d.ts.map +1 -0
- package/src/type-guards.js +71 -0
- package/src/types.d.ts +296 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +337 -0
- package/src/types.ts +0 -1
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import type { NatAmount } from '@agoric/ertp';
|
|
2
|
+
import { type AccountId, type Bech32Address, type CaipChainId, type CosmosChainAddress, type TrafficEntry } from '@agoric/orchestration';
|
|
3
|
+
import type { Address as EVMAddress } from 'abitype';
|
|
4
|
+
import type { AxelarChain, SupportedChain, YieldProtocol } from './constants.js';
|
|
5
|
+
import type { InstrumentId } from './instruments.js';
|
|
6
|
+
import type { PublishedTx } from './resolver.js';
|
|
7
|
+
import type { EVMWalletUpdate, PortfolioPath } from './evm/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Feature flags to handle contract upgrade flow compatibility.
|
|
10
|
+
*/
|
|
11
|
+
export type FlowFeatures = {
|
|
12
|
+
/** Control `ProgressTracker` support. */
|
|
13
|
+
useProgressTracker?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Configuration options for flows.
|
|
17
|
+
*/
|
|
18
|
+
export type FlowConfig = {
|
|
19
|
+
features?: FlowFeatures;
|
|
20
|
+
};
|
|
21
|
+
export type SeatKeyword = 'Cash' | 'Deposit';
|
|
22
|
+
/**
|
|
23
|
+
* Reference to a local chain accounts (LCA).
|
|
24
|
+
* '+agoric' is published as `depositAddress`
|
|
25
|
+
*/
|
|
26
|
+
export type LocalChainAccountRef = '+agoric';
|
|
27
|
+
/**
|
|
28
|
+
* Identifies the blockchain hosting an address external to ymax from which
|
|
29
|
+
* funds for a deposit must be supplied.
|
|
30
|
+
*/
|
|
31
|
+
export type DepositFromChainRef = `+${AxelarChain}`;
|
|
32
|
+
/**
|
|
33
|
+
* Identifies the blockchain hosting an address external to ymax to which
|
|
34
|
+
* withdrawn funds will be sent.
|
|
35
|
+
*/
|
|
36
|
+
export type WithdrawToChainRef = `-${AxelarChain}`;
|
|
37
|
+
export type InterChainAccountRef = `@${SupportedChain}`;
|
|
38
|
+
/**
|
|
39
|
+
* An AssetPlaceRef describes a place where funds can be, either an
|
|
40
|
+
* {@link InstrumentId} (starting with an ASCII letter), a {@link SeatKeyword}
|
|
41
|
+
* wrapped in `<...>` angle brackets, or a value consisting of a
|
|
42
|
+
* single-character punctuator followed by a SupportedChain (that character
|
|
43
|
+
* being `@` for {@link InterChainAccountRef}, `+` for
|
|
44
|
+
* {@link LocalChainAccountRef} and {@link DepositFromChainRef}, and `-` for
|
|
45
|
+
* {@link WithdrawToChainRef}).
|
|
46
|
+
*/
|
|
47
|
+
export type AssetPlaceRef = `<${SeatKeyword}>` | LocalChainAccountRef | DepositFromChainRef | WithdrawToChainRef | InterChainAccountRef | InstrumentId;
|
|
48
|
+
type Empty = Record<never, NatAmount>;
|
|
49
|
+
/**
|
|
50
|
+
* Proposal shapes for portfolio operations.
|
|
51
|
+
*
|
|
52
|
+
* **openPortfolio**: Create portfolio with initial funding across protocols
|
|
53
|
+
* **rebalance**: Add funds (give) or withdraw funds (want) from protocols
|
|
54
|
+
*/
|
|
55
|
+
export type ProposalType = {
|
|
56
|
+
openPortfolio: {
|
|
57
|
+
give: {
|
|
58
|
+
/** required iff the contract was started with an Access issuer */
|
|
59
|
+
Access?: NatAmount;
|
|
60
|
+
Deposit?: NatAmount;
|
|
61
|
+
};
|
|
62
|
+
want?: Empty;
|
|
63
|
+
};
|
|
64
|
+
rebalance: {
|
|
65
|
+
give: {
|
|
66
|
+
Deposit?: NatAmount;
|
|
67
|
+
};
|
|
68
|
+
want: Empty;
|
|
69
|
+
} | {
|
|
70
|
+
want: {
|
|
71
|
+
Cash: NatAmount;
|
|
72
|
+
};
|
|
73
|
+
give: Empty;
|
|
74
|
+
};
|
|
75
|
+
withdraw: {
|
|
76
|
+
want: {
|
|
77
|
+
Cash: NatAmount;
|
|
78
|
+
};
|
|
79
|
+
give: Empty;
|
|
80
|
+
};
|
|
81
|
+
deposit: {
|
|
82
|
+
give: {
|
|
83
|
+
Deposit: NatAmount;
|
|
84
|
+
};
|
|
85
|
+
want: Empty;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Target allocation mapping from PoolKey to numerator (typically in basis points).
|
|
90
|
+
* Denominator is implicitly the sum of all numerators.
|
|
91
|
+
*/
|
|
92
|
+
export type TargetAllocation = Partial<Record<InstrumentId, bigint>>;
|
|
93
|
+
export type FlowDetail = {
|
|
94
|
+
type: 'withdraw';
|
|
95
|
+
amount: NatAmount;
|
|
96
|
+
toChain?: SupportedChain;
|
|
97
|
+
} | {
|
|
98
|
+
type: 'deposit';
|
|
99
|
+
amount: NatAmount;
|
|
100
|
+
fromChain?: SupportedChain;
|
|
101
|
+
} | {
|
|
102
|
+
type: 'rebalance';
|
|
103
|
+
};
|
|
104
|
+
/** linked list of concurrent failures, including dependencies */
|
|
105
|
+
export type FlowErrors = {
|
|
106
|
+
step: number;
|
|
107
|
+
how: string;
|
|
108
|
+
error: string;
|
|
109
|
+
next?: FlowErrors;
|
|
110
|
+
};
|
|
111
|
+
export type FlowStatus = {
|
|
112
|
+
state: 'run';
|
|
113
|
+
/** minimum currently running step */
|
|
114
|
+
step: number;
|
|
115
|
+
how: string;
|
|
116
|
+
/** currently running steps, when executing concurrently */
|
|
117
|
+
steps?: number[];
|
|
118
|
+
}
|
|
119
|
+
/** @deprecated - contract no longer does automatic recovery */
|
|
120
|
+
| {
|
|
121
|
+
state: 'undo';
|
|
122
|
+
step: number;
|
|
123
|
+
how: string;
|
|
124
|
+
} | {
|
|
125
|
+
state: 'done';
|
|
126
|
+
} | ({
|
|
127
|
+
state: 'fail';
|
|
128
|
+
} & FlowErrors);
|
|
129
|
+
export type MovementDesc = {
|
|
130
|
+
amount: NatAmount;
|
|
131
|
+
src: AssetPlaceRef;
|
|
132
|
+
dest: AssetPlaceRef;
|
|
133
|
+
/** for example: GMP fee */
|
|
134
|
+
fee?: NatAmount;
|
|
135
|
+
/** for example: { usdnOut: 98n } */
|
|
136
|
+
detail?: Record<string, bigint>;
|
|
137
|
+
claim?: boolean;
|
|
138
|
+
};
|
|
139
|
+
export type TxPhase = 'makeSrcAccount' | 'makeDestAccount' | 'apply';
|
|
140
|
+
export type FlowStep = {
|
|
141
|
+
/** Human readable description of how the step accomplishes the transfer from `src` to `dest` */
|
|
142
|
+
how: string;
|
|
143
|
+
amount: NatAmount;
|
|
144
|
+
src: AssetPlaceRef;
|
|
145
|
+
dest: AssetPlaceRef;
|
|
146
|
+
/**
|
|
147
|
+
* A single FlowStep can have an arbitrary number of associated pendingTxs
|
|
148
|
+
* entries. They are tracked by grouping them into "phases", each phase
|
|
149
|
+
* containing a sequence of TxIds in order of execution and with no implied
|
|
150
|
+
* relative sequencing constraints across phases.
|
|
151
|
+
*
|
|
152
|
+
* It is valid for the phases record
|
|
153
|
+
* - to be omitted,
|
|
154
|
+
* - to have one property,
|
|
155
|
+
* - to have no properties,
|
|
156
|
+
* - to have more than one property.
|
|
157
|
+
* and for each property, to have an array of zero or more TxIds.
|
|
158
|
+
*/
|
|
159
|
+
phases?: Partial<Record<TxPhase, TxId[]>>;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Each step in the `flow` of a FundsFlowPlan can depend upon any number of
|
|
163
|
+
* other steps, subject to the complete directed graph being acyclic.
|
|
164
|
+
* The dependencies are expressed using 0-based indices.
|
|
165
|
+
*/
|
|
166
|
+
type FlowStepDependency = [stepIndex: number, prerequisiteIndexes: number[]];
|
|
167
|
+
export type FundsFlowPlan = {
|
|
168
|
+
flow: MovementDesc[];
|
|
169
|
+
/** When `order` is absent, default to fully sequential dependencies. */
|
|
170
|
+
order?: FlowStepDependency[];
|
|
171
|
+
};
|
|
172
|
+
export type TxId = `tx${number}`;
|
|
173
|
+
export type TrafficReport = {
|
|
174
|
+
traffic: TrafficEntry[];
|
|
175
|
+
appendedTxIds?: TxId[];
|
|
176
|
+
};
|
|
177
|
+
export type PortfolioKey = `portfolio${number}`;
|
|
178
|
+
export type FlowKey = `flow${number}`;
|
|
179
|
+
export type PortfolioRemoteAccountCommonStates = 'provisioning' | 'active' | 'failed';
|
|
180
|
+
export type PortfolioGenericRemoteAccountState = {
|
|
181
|
+
chainId: CaipChainId;
|
|
182
|
+
address: string;
|
|
183
|
+
state: PortfolioRemoteAccountCommonStates;
|
|
184
|
+
} | {
|
|
185
|
+
state: 'provisioning' | 'unknown';
|
|
186
|
+
};
|
|
187
|
+
export type PortfolioEVMRemoteAccountState = {
|
|
188
|
+
chainId: `eip155:${number | bigint | string}`;
|
|
189
|
+
address: EVMAddress;
|
|
190
|
+
} & {
|
|
191
|
+
state: PortfolioRemoteAccountCommonStates;
|
|
192
|
+
/**
|
|
193
|
+
* The factory that deployed the router-based remote account and maintains a map of authorized routers.
|
|
194
|
+
*
|
|
195
|
+
* Absent for legacy accounts.
|
|
196
|
+
*/
|
|
197
|
+
routerFactory?: EVMAddress;
|
|
198
|
+
};
|
|
199
|
+
export type PortfolioCosmosRemoteAccountState = {
|
|
200
|
+
chainId: `cosmos:${string}`;
|
|
201
|
+
address: Bech32Address;
|
|
202
|
+
state: PortfolioRemoteAccountCommonStates;
|
|
203
|
+
};
|
|
204
|
+
export type PortfolioRemoteAccountState = PortfolioEVMRemoteAccountState | PortfolioCosmosRemoteAccountState | PortfolioGenericRemoteAccountState;
|
|
205
|
+
export type StatusFor = {
|
|
206
|
+
contract: {
|
|
207
|
+
contractAccount: CosmosChainAddress['value'];
|
|
208
|
+
depositFactoryAddresses?: Partial<Record<AxelarChain, AccountId>>;
|
|
209
|
+
evmRemoteAccountConfig?: {
|
|
210
|
+
remoteAccountImplementationAddresses: Partial<Record<AxelarChain, AccountId>>;
|
|
211
|
+
factoryAddresses: Partial<Record<AxelarChain, AccountId>>;
|
|
212
|
+
currentRouterAddresses: Partial<Record<AxelarChain, AccountId>>;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
pendingTx: PublishedTx;
|
|
216
|
+
evmWallet: EVMWalletUpdate;
|
|
217
|
+
evmWalletPortfolios: PortfolioPath[];
|
|
218
|
+
portfolios: {
|
|
219
|
+
addPortfolio: PortfolioKey;
|
|
220
|
+
};
|
|
221
|
+
portfolio: {
|
|
222
|
+
positionKeys: InstrumentId[];
|
|
223
|
+
accountIdByChain: Partial<Record<SupportedChain, AccountId>>;
|
|
224
|
+
accountsPending?: SupportedChain[];
|
|
225
|
+
accountStateByChain?: {
|
|
226
|
+
[evmChain in AxelarChain]?: PortfolioEVMRemoteAccountState;
|
|
227
|
+
} & {
|
|
228
|
+
[cosmosChain in 'agoric' | 'noble']?: PortfolioCosmosRemoteAccountState;
|
|
229
|
+
} & {
|
|
230
|
+
[genericChain in Exclude<SupportedChain, AxelarChain | 'agoric' | 'noble'>]?: PortfolioGenericRemoteAccountState;
|
|
231
|
+
};
|
|
232
|
+
depositAddress?: Bech32Address;
|
|
233
|
+
/** Noble Forwarding Address (NFA) registered by the contract for the `@agoric` address */
|
|
234
|
+
nobleForwardingAddress?: Bech32Address;
|
|
235
|
+
targetAllocation?: TargetAllocation;
|
|
236
|
+
/**
|
|
237
|
+
* CAIP-10 account ID of the authenticated EVM account that opened this portfolio.
|
|
238
|
+
* Derived from `permit2Payload.owner` in `openPortfolioFromEVM()`.
|
|
239
|
+
* The Permit2 signature is verified on-chain by the `depositFactory` contract
|
|
240
|
+
* when it receives the GMP call via `sendCreateAndDepositCall()`.
|
|
241
|
+
*/
|
|
242
|
+
sourceAccountId?: AccountId;
|
|
243
|
+
/** incremented by the contract every time the user sends a transaction that the planner should respond to */
|
|
244
|
+
policyVersion: number;
|
|
245
|
+
/** the count of acknowledged submissions [from the planner] associated with the current policyVersion */
|
|
246
|
+
rebalanceCount: number;
|
|
247
|
+
/** @deprecated in favor of flowsRunning */
|
|
248
|
+
flowCount: number;
|
|
249
|
+
flowsRunning?: Record<FlowKey, FlowDetail>;
|
|
250
|
+
};
|
|
251
|
+
position: {
|
|
252
|
+
protocol: YieldProtocol;
|
|
253
|
+
accountId: AccountId;
|
|
254
|
+
totalIn: NatAmount;
|
|
255
|
+
totalOut: NatAmount;
|
|
256
|
+
};
|
|
257
|
+
flow: FlowStatus & FlowDetail;
|
|
258
|
+
flowSteps: FlowStep[];
|
|
259
|
+
flowOrder: FundsFlowPlan['order'];
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Published vstorage values produced by the portfolio contract.
|
|
263
|
+
*/
|
|
264
|
+
export type PortfolioPublishedPathTypes = {
|
|
265
|
+
ymax0: StatusFor['contract'];
|
|
266
|
+
ymax1: StatusFor['contract'];
|
|
267
|
+
'ymax0.portfolios': StatusFor['portfolios'];
|
|
268
|
+
'ymax1.portfolios': StatusFor['portfolios'];
|
|
269
|
+
} & {
|
|
270
|
+
[K in `ymax${'0' | '1'}.portfolios.portfolio${number}`]: StatusFor['portfolio'];
|
|
271
|
+
} & {
|
|
272
|
+
[K in `ymax${'0' | '1'}.portfolios.portfolio${number}.positions.${string}`]: StatusFor['position'];
|
|
273
|
+
} & {
|
|
274
|
+
[K in `ymax${'0' | '1'}.portfolios.portfolio${number}.pendingTx.tx${number}`]: StatusFor['pendingTx'];
|
|
275
|
+
} & {
|
|
276
|
+
[K in `ymax${'0' | '1'}.portfolios.portfolio${number}.flows.flow${number}`]: StatusFor['flow'];
|
|
277
|
+
} & {
|
|
278
|
+
[K in `ymax${'0' | '1'}.portfolios.portfolio${number}.flows.flow${number}.steps`]: StatusFor['flowSteps'];
|
|
279
|
+
} & {
|
|
280
|
+
[K in `ymax${'0' | '1'}.evmWallets.0x${string}.portfolio`]: StatusFor['evmWalletPortfolios'];
|
|
281
|
+
} & {
|
|
282
|
+
[K in `ymax${'0' | '1'}.evmWallets.0x${string}`]: StatusFor['evmWallet'];
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Names suitable for use as `publicInvitationMaker` in {@link ContractInvitationSpec}.
|
|
286
|
+
*/
|
|
287
|
+
export type PortfolioPublicInvitationMaker = 'makeOpenPortfolioInvitation';
|
|
288
|
+
/**
|
|
289
|
+
* Names suitable for use as `invitationMakerName` in {@link ContinuingInvitationSpec}.
|
|
290
|
+
*
|
|
291
|
+
* These continuing invitation makers are returned from portfolio creation and enable
|
|
292
|
+
* ongoing operations like rebalancing between yield protocols.
|
|
293
|
+
*/
|
|
294
|
+
export type PortfolioContinuingInvitationMaker = 'Deposit' | 'Withdraw' | 'Rebalance' | 'SimpleRebalance';
|
|
295
|
+
export {};
|
|
296
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,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;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAErE;;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,CAAC;AAExD;;;;;;;;GAQG;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AgB,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC;CACtG,GAAG;KACD,CAAC,IAAI,OAAO,GAAG,GAAG,GAAG,wBAAwB,MAAM,cAAc,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC;CAC/F,GAAG;KACD,CAAC,IAAI,OAAO,GAAG,GAAG,GAAG,wBAAwB,MAAM,cAAc,MAAM,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC;CAC1G,GAAG;KACD,CAAC,IAAI,OAAO,GAAG,GAAG,GAAG,iBAAiB,MAAM,YAAY,GAAG,SAAS,CAAC,qBAAqB,CAAC;CAC7F,GAAG;KACD,CAAC,IAAI,OAAO,GAAG,GAAG,GAAG,iBAAiB,MAAM,EAAE,GAAG,SAAS,CAAC,WAAW,CAAC;CACzE,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.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars -- not detecting the TSDoc */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
} from '@agoric/orchestration';
|
|
10
|
+
;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
;
|
|
15
|
+
;
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
;
|
|
21
|
+
;
|
|
22
|
+
;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Feature flags to handle contract upgrade flow compatibility.
|
|
26
|
+
*/
|
|
27
|
+
;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Configuration options for flows.
|
|
34
|
+
*/
|
|
35
|
+
;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Reference to a local chain accounts (LCA).
|
|
42
|
+
* '+agoric' is published as `depositAddress`
|
|
43
|
+
*/
|
|
44
|
+
;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Identifies the blockchain hosting an address external to ymax from which
|
|
48
|
+
* funds for a deposit must be supplied.
|
|
49
|
+
*/
|
|
50
|
+
;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Identifies the blockchain hosting an address external to ymax to which
|
|
54
|
+
* withdrawn funds will be sent.
|
|
55
|
+
*/
|
|
56
|
+
;
|
|
57
|
+
|
|
58
|
+
;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* An AssetPlaceRef describes a place where funds can be, either an
|
|
62
|
+
* {@link InstrumentId} (starting with an ASCII letter), a {@link SeatKeyword}
|
|
63
|
+
* wrapped in `<...>` angle brackets, or a value consisting of a
|
|
64
|
+
* single-character punctuator followed by a SupportedChain (that character
|
|
65
|
+
* being `@` for {@link InterChainAccountRef}, `+` for
|
|
66
|
+
* {@link LocalChainAccountRef} and {@link DepositFromChainRef}, and `-` for
|
|
67
|
+
* {@link WithdrawToChainRef}).
|
|
68
|
+
*/
|
|
69
|
+
;
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Proposal shapes for portfolio operations.
|
|
81
|
+
*
|
|
82
|
+
* **openPortfolio**: Create portfolio with initial funding across protocols
|
|
83
|
+
* **rebalance**: Add funds (give) or withdraw funds (want) from protocols
|
|
84
|
+
*/
|
|
85
|
+
;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Target allocation mapping from PoolKey to numerator (typically in basis points).
|
|
103
|
+
* Denominator is implicitly the sum of all numerators.
|
|
104
|
+
*/
|
|
105
|
+
;
|
|
106
|
+
|
|
107
|
+
;
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
// aka simpleRebalance
|
|
111
|
+
|
|
112
|
+
/** linked list of concurrent failures, including dependencies */
|
|
113
|
+
;
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
;
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
;
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
;
|
|
146
|
+
|
|
147
|
+
;
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Each step in the `flow` of a FundsFlowPlan can depend upon any number of
|
|
173
|
+
* other steps, subject to the complete directed graph being acyclic.
|
|
174
|
+
* The dependencies are expressed using 0-based indices.
|
|
175
|
+
*/
|
|
176
|
+
;
|
|
177
|
+
|
|
178
|
+
;
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
// tx for transactions
|
|
185
|
+
;
|
|
186
|
+
|
|
187
|
+
;
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
;
|
|
193
|
+
;
|
|
194
|
+
|
|
195
|
+
;
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
;
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
;
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
;
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
;
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
;
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Published vstorage values produced by the portfolio contract.
|
|
300
|
+
*/
|
|
301
|
+
;
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Names suitable for use as `publicInvitationMaker` in {@link ContractInvitationSpec}.
|
|
324
|
+
*/
|
|
325
|
+
;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Names suitable for use as `invitationMakerName` in {@link ContinuingInvitationSpec}.
|
|
329
|
+
*
|
|
330
|
+
* These continuing invitation makers are returned from portfolio creation and enable
|
|
331
|
+
* ongoing operations like rebalancing between yield protocols.
|
|
332
|
+
*/
|
|
333
|
+
;
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
package/src/types.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type * from './constants.js';
|