@agoric/portfolio-api 0.2.1-upgrade-23-dev-3121fd7.0.3121fd7 → 0.3.0-u23.0
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/constants.d.ts +0 -115
- package/src/constants.d.ts.map +0 -1
- package/src/evm/types.d.ts +0 -19
- package/src/evm/types.d.ts.map +0 -1
- package/src/evm-wallet/eip712-messages.d.ts +0 -213
- package/src/evm-wallet/eip712-messages.d.ts.map +0 -1
- package/src/evm-wallet/message-handler-helpers.d.ts +0 -54
- package/src/evm-wallet/message-handler-helpers.d.ts.map +0 -1
- package/src/instruments.d.ts +0 -54
- package/src/instruments.d.ts.map +0 -1
- package/src/main.d.ts +0 -6
- package/src/main.d.ts.map +0 -1
- package/src/model/generated/ymax-machine.d.ts +0 -71
- package/src/model/generated/ymax-machine.d.ts.map +0 -1
- package/src/portfolio-constants.d.ts +0 -44
- package/src/portfolio-constants.d.ts.map +0 -1
- package/src/resolver.d.ts +0 -159
- package/src/resolver.d.ts.map +0 -1
- package/src/type-guards.d.ts +0 -39
- package/src/type-guards.d.ts.map +0 -1
- package/src/types.d.ts +0 -296
- package/src/types.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/portfolio-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-u23.0",
|
|
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.
|
|
31
|
-
"@agoric/orchestration": "0.
|
|
30
|
+
"@agoric/internal": "0.5.0-u23.0",
|
|
31
|
+
"@agoric/orchestration": "0.3.0-u23.0",
|
|
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": "1147be15b0704de17204d04e2407fa3192b98a1c"
|
|
73
73
|
}
|
package/src/constants.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @import {ClusterName, TypedPattern} from '@agoric/internal';
|
|
3
|
-
* @import {CaipChainId} from '@agoric/orchestration';
|
|
4
|
-
* @import {FlowConfig} from './types.js';
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Configuration arguments for newly-created portfolio flows.
|
|
8
|
-
*
|
|
9
|
-
* This is only a default so that existing flows continue to behave as before
|
|
10
|
-
* for replay fidelity.
|
|
11
|
-
*
|
|
12
|
-
* @type {FlowConfig | undefined}
|
|
13
|
-
*/
|
|
14
|
-
export const DEFAULT_FLOW_CONFIG: FlowConfig | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Yield protocols for Proof of Concept.
|
|
17
|
-
*/
|
|
18
|
-
export type YieldProtocol = (typeof YieldProtocol)[keyof typeof YieldProtocol];
|
|
19
|
-
/**
|
|
20
|
-
* Yield protocols for Proof of Concept.
|
|
21
|
-
*
|
|
22
|
-
* @enum {(typeof YieldProtocol)[keyof typeof YieldProtocol]}
|
|
23
|
-
*/
|
|
24
|
-
export const YieldProtocol: import("@agoric/internal").KeyMirrorResult<{
|
|
25
|
-
Aave: null;
|
|
26
|
-
Compound: null;
|
|
27
|
-
USDN: null;
|
|
28
|
-
Beefy: null;
|
|
29
|
-
ERC4626: null;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* EVM chain wallet operations that incur different gas costs.
|
|
33
|
-
* Supply: user is supplying assets to a yield protocol on the target chain.
|
|
34
|
-
* Withdraw: user is withdrawing assets from a yield protocol on the target chain.
|
|
35
|
-
* DepositForBurn: user is transferring assets off the target chain via CCTP.
|
|
36
|
-
*/
|
|
37
|
-
export type EvmWalletOperationType = (typeof EvmWalletOperationType)[keyof typeof EvmWalletOperationType];
|
|
38
|
-
export namespace EvmWalletOperationType {
|
|
39
|
-
let Supply: "supply";
|
|
40
|
-
let Withdraw: "withdraw";
|
|
41
|
-
let DepositForBurn: "depositforburn";
|
|
42
|
-
}
|
|
43
|
-
export type AxelarChain = (typeof AxelarChain)[keyof typeof AxelarChain];
|
|
44
|
-
/**
|
|
45
|
-
* @enum {(typeof AxelarChain)[keyof typeof AxelarChain]}
|
|
46
|
-
*/
|
|
47
|
-
export const AxelarChain: import("@agoric/internal").KeyMirrorResult<{
|
|
48
|
-
Arbitrum: null;
|
|
49
|
-
Avalanche: null;
|
|
50
|
-
Base: null;
|
|
51
|
-
Ethereum: null;
|
|
52
|
-
Optimism: null;
|
|
53
|
-
}>;
|
|
54
|
-
/**
|
|
55
|
-
* cf. https://chainlist.org/
|
|
56
|
-
* XXX this probably belongs in @agoric/orchestration
|
|
57
|
-
* @type {Readonly<Record<ClusterName, Readonly<Partial<Record<AxelarChain, bigint>>>>>}
|
|
58
|
-
*/
|
|
59
|
-
export const Eip155ChainIds: Readonly<Record<ClusterName, Readonly<Partial<Record<AxelarChain, bigint>>>>>;
|
|
60
|
-
export type SupportedChain = (typeof SupportedChain)[keyof typeof SupportedChain];
|
|
61
|
-
/**
|
|
62
|
-
* @enum {(typeof SupportedChain)[keyof typeof SupportedChain]}
|
|
63
|
-
*/
|
|
64
|
-
export const SupportedChain: import("@agoric/internal").KeyMirrorResult<{
|
|
65
|
-
Arbitrum: "Arbitrum";
|
|
66
|
-
Avalanche: "Avalanche";
|
|
67
|
-
Base: "Base";
|
|
68
|
-
Ethereum: "Ethereum";
|
|
69
|
-
Optimism: "Optimism";
|
|
70
|
-
agoric: "agoric";
|
|
71
|
-
noble: "noble";
|
|
72
|
-
}>;
|
|
73
|
-
/**
|
|
74
|
-
* cf. https://standards.chainagnostic.org/CAIPs/caip-2
|
|
75
|
-
* Please keep in sync with ../../../services/ymax-planner/src/support.ts `spectrumChainIds`
|
|
76
|
-
*
|
|
77
|
-
* XXX this probably belongs in @agoric/orchestration
|
|
78
|
-
*
|
|
79
|
-
* @type {Readonly<Record<ClusterName, Readonly<Partial<Record<SupportedChain, CaipChainId>>>>>}
|
|
80
|
-
*/
|
|
81
|
-
export const CaipChainIds: Readonly<Record<ClusterName, Readonly<Partial<Record<SupportedChain, CaipChainId>>>>>;
|
|
82
|
-
/**
|
|
83
|
-
* cf. https://developers.circle.com/stablecoins/usdc-contract-addresses
|
|
84
|
-
* XXX this might belong in @agoric/orchestration
|
|
85
|
-
* @type {Readonly<Record<ClusterName, Readonly<Partial<Record<SupportedChain, string>>>>>}
|
|
86
|
-
*/
|
|
87
|
-
export const UsdcTokenIds: Readonly<Record<ClusterName, Readonly<Partial<Record<SupportedChain, string>>>>>;
|
|
88
|
-
/**
|
|
89
|
-
* Strategies for portfolio rebalancing of bulk deposits.
|
|
90
|
-
*/
|
|
91
|
-
export type RebalanceStrategy = (typeof RebalanceStrategy)[keyof typeof RebalanceStrategy];
|
|
92
|
-
export namespace RebalanceStrategy {
|
|
93
|
-
let Preset: "preset";
|
|
94
|
-
let PreserveExistingProportions: "pep";
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Treat account deltas smaller than this value (in micro-units) as dust.
|
|
98
|
-
* This corresponds to 100 uusdc, i.e., $0.0001 for USDC.
|
|
99
|
-
*/
|
|
100
|
-
export const ACCOUNT_DUST_EPSILON: 100n;
|
|
101
|
-
/**
|
|
102
|
-
* Feature flags to handle contract upgrade flow compatibility.
|
|
103
|
-
* @type {TypedPattern<FlowConfig['features']>}
|
|
104
|
-
*/
|
|
105
|
-
export const FlowFeaturesShape: TypedPattern<FlowConfig["features"]>;
|
|
106
|
-
/**
|
|
107
|
-
* Configuration options for flows.
|
|
108
|
-
* @type {TypedPattern<FlowConfig>}
|
|
109
|
-
*/
|
|
110
|
-
export const FlowConfigShape: TypedPattern<FlowConfig>;
|
|
111
|
-
import type { FlowConfig } from './types.js';
|
|
112
|
-
import type { ClusterName } from '@agoric/internal';
|
|
113
|
-
import type { CaipChainId } from '@agoric/orchestration';
|
|
114
|
-
import type { TypedPattern } from '@agoric/internal';
|
|
115
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/src/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,kCAFU,UAAU,GAAG,SAAS,CAO9B;;;;4BAMQ,CAAC,OAAO,aAAa,EAAE,MAAM,OAAO,aAAa,CAAC;AAH5D;;;;GAIG;AACH;;;;;;GAMG;;;;;;;qCASO,CAAC,OAAO,sBAAsB,EAAE,MAAM,OAAO,sBAAsB,CAAC;;;;;;0BAUpE,CAAC,OAAO,WAAW,EAAE,MAAM,OAAO,WAAW,CAAC;AADxD;;GAEG;AACH;;;;;;GAMG;AAGH;;;;GAIG;AACH,6BAFU,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAkBrF;6BAIQ,CAAC,OAAO,cAAc,EAAE,MAAM,OAAO,cAAc,CAAC;AAD9D;;GAEG;AACH;;;;;;;;GAWG;AAMH;;;;;;;GAOG;AACH,2BAFU,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAgB7F;AAGF;;;;GAIG;AACH,2BAFU,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAwBxF;;;;gCAMQ,CAAC,OAAO,iBAAiB,EAAE,MAAM,OAAO,iBAAiB,CAAC;;;;;AAgBpE;;;GAGG;AACH,mCAAoC,IAAI,CAAC;AAEzC;;;GAGG;AACH,gCAFU,aAAa,UAAU,CAAC,UAAU,CAAC,CAAC,CAO5C;AAEF;;;GAGG;AACH,8BAFU,aAAa,UAAU,CAAC,CAOhC;gCA5M2B,YAAY;iCAFG,kBAAkB;iCAChC,uBAAuB;kCADT,kBAAkB"}
|
package/src/evm/types.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { PureData } from '@endo/pass-style';
|
|
2
|
-
export type PortfolioPath = `published.ymax${0 | 1}.portfolios.portfolio${number}`;
|
|
3
|
-
type EIPCommonMessageUpdate = {
|
|
4
|
-
updated: 'messageUpdate';
|
|
5
|
-
nonce: bigint;
|
|
6
|
-
deadline: bigint;
|
|
7
|
-
};
|
|
8
|
-
export type EIPMessageUpdate = EIPCommonMessageUpdate & ({
|
|
9
|
-
status: 'pending';
|
|
10
|
-
} | {
|
|
11
|
-
status: 'error';
|
|
12
|
-
error: string;
|
|
13
|
-
} | {
|
|
14
|
-
status: 'ok';
|
|
15
|
-
result: PureData;
|
|
16
|
-
});
|
|
17
|
-
export type EVMWalletUpdate = EIPMessageUpdate | never;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=types.d.ts.map
|
package/src/evm/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,aAAa,GACvB,iBAAiB,CAAC,GAAG,CAAC,wBAAwB,MAAM,EAAE,CAAC;AAEzD,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,CACI;IACE,MAAM,EAAE,SAAS,CAAC;CACnB,GACD;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,QAAQ,CAAC;CAClB,CACJ,CAAC;AAEJ,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,KAAK,CAAC"}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Portfolio operations are either in a permit2 witness or standalone,
|
|
3
|
-
* in either case, following EIP-712
|
|
4
|
-
*
|
|
5
|
-
* The fields included in the operation differ based on which way they're submitted.
|
|
6
|
-
* In the wrapped case, we don't want to repeat stuff from the permit envelope.
|
|
7
|
-
* {@link OperationTypes}
|
|
8
|
-
*
|
|
9
|
-
* Currently all types and helpers are built around a hard-coded Ymax product
|
|
10
|
-
* name but with some effort this could be parametrizable
|
|
11
|
-
*/
|
|
12
|
-
import type { Address, TypedDataDomain, TypedDataToPrimitiveTypes } from 'abitype';
|
|
13
|
-
import type { TypedDataDefinition } from 'viem';
|
|
14
|
-
import type { TypedDataParameter } from '@agoric/orchestration/src/utils/abitype.js';
|
|
15
|
-
import { type Witness, type getPermitWitnessTransferFromData, type getPermitBatchWitnessTransferFromData } from '@agoric/orchestration/src/utils/permit2.js';
|
|
16
|
-
declare const YMAX_DOMAIN_NAME = "Ymax";
|
|
17
|
-
declare const YMAX_DOMAIN_VERSION = "1";
|
|
18
|
-
declare const StandaloneDomainTypeParams: [{
|
|
19
|
-
readonly name: "name";
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
}, {
|
|
22
|
-
readonly name: "version";
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
}, {
|
|
25
|
-
readonly name: "chainId";
|
|
26
|
-
readonly type: "uint256";
|
|
27
|
-
}, {
|
|
28
|
-
readonly name: "verifyingContract";
|
|
29
|
-
readonly type: "address";
|
|
30
|
-
}];
|
|
31
|
-
declare const YmaxStandaloneDomainBase: {
|
|
32
|
-
readonly name: "Ymax";
|
|
33
|
-
readonly version: "1";
|
|
34
|
-
};
|
|
35
|
-
export type YmaxFullDomain = typeof YmaxStandaloneDomainBase & {
|
|
36
|
-
chainId: bigint;
|
|
37
|
-
verifyingContract: Address;
|
|
38
|
-
};
|
|
39
|
-
declare const SharedPortfolioTypeParams: [];
|
|
40
|
-
/**
|
|
41
|
-
* Fields included in Permit data that we don't want duplicated in witness data,
|
|
42
|
-
* so only included in standalone typed data.
|
|
43
|
-
*/
|
|
44
|
-
declare const PortfolioStandaloneTypeParams: [{
|
|
45
|
-
readonly name: "nonce";
|
|
46
|
-
readonly type: "uint256";
|
|
47
|
-
}, {
|
|
48
|
-
readonly name: "deadline";
|
|
49
|
-
readonly type: "uint256";
|
|
50
|
-
}];
|
|
51
|
-
/**
|
|
52
|
-
* The set of portfolio operations supported by EVM Wallets, and their associated params
|
|
53
|
-
*/
|
|
54
|
-
declare const OperationTypes: {
|
|
55
|
-
readonly OpenPortfolio: readonly [{
|
|
56
|
-
readonly name: "allocations";
|
|
57
|
-
readonly type: "Allocation[]";
|
|
58
|
-
}];
|
|
59
|
-
readonly Rebalance: readonly [{
|
|
60
|
-
readonly name: "portfolio";
|
|
61
|
-
readonly type: "uint256";
|
|
62
|
-
}];
|
|
63
|
-
readonly SetTargetAllocation: readonly [{
|
|
64
|
-
readonly name: "allocations";
|
|
65
|
-
readonly type: "Allocation[]";
|
|
66
|
-
}, {
|
|
67
|
-
readonly name: "portfolio";
|
|
68
|
-
readonly type: "uint256";
|
|
69
|
-
}];
|
|
70
|
-
readonly Deposit: readonly [{
|
|
71
|
-
readonly name: "portfolio";
|
|
72
|
-
readonly type: "uint256";
|
|
73
|
-
}];
|
|
74
|
-
/**
|
|
75
|
-
* Withdraw funds from a portfolio to the source EVM account.
|
|
76
|
-
* The signer of the message must match the portfolio's source EVM account
|
|
77
|
-
* The destination chain is determined from the domain info (chainId).
|
|
78
|
-
* - token: ERC-20 token contract address (must be USDC contract on the destination chain)
|
|
79
|
-
*/
|
|
80
|
-
readonly Withdraw: readonly [{
|
|
81
|
-
readonly name: "withdraw";
|
|
82
|
-
readonly type: "Asset";
|
|
83
|
-
}, {
|
|
84
|
-
readonly name: "portfolio";
|
|
85
|
-
readonly type: "uint256";
|
|
86
|
-
}];
|
|
87
|
-
};
|
|
88
|
-
type OperationTypes = typeof OperationTypes;
|
|
89
|
-
export type OperationTypeNames = keyof OperationTypes;
|
|
90
|
-
declare const OperationSubTypes: {
|
|
91
|
-
readonly Allocation: readonly [{
|
|
92
|
-
readonly name: "instrument";
|
|
93
|
-
readonly type: "string";
|
|
94
|
-
}, {
|
|
95
|
-
readonly name: "portion";
|
|
96
|
-
readonly type: "uint256";
|
|
97
|
-
}];
|
|
98
|
-
readonly Asset: [{
|
|
99
|
-
readonly name: "token";
|
|
100
|
-
readonly type: "address";
|
|
101
|
-
}, {
|
|
102
|
-
readonly name: "amount";
|
|
103
|
-
readonly type: "uint256";
|
|
104
|
-
}];
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Target allocation for portfolio positions.
|
|
108
|
-
* Uses 'portion' (not 'basisPoints') to allow flexible ratios.
|
|
109
|
-
* The denominator is implicitly the sum of all portions.
|
|
110
|
-
*
|
|
111
|
-
* Examples:
|
|
112
|
-
* - [{instrument: 'A', portion: 60}, {instrument: 'B', portion: 40}] => 60:40 ratio
|
|
113
|
-
* - [{instrument: 'A', portion: 6}, {instrument: 'B', portion: 4}] => 6:4 ratio (same as 60:40)
|
|
114
|
-
*/
|
|
115
|
-
export type TargetAllocation = TypedDataToPrimitiveTypes<typeof OperationSubTypes>['Allocation'];
|
|
116
|
-
/**
|
|
117
|
-
* In the wrapped case, the domain is fixed by permit2, so we can't choose name/version there.
|
|
118
|
-
* so we put the ymax-specifc domain name and version in the type name.
|
|
119
|
-
*/
|
|
120
|
-
declare const getYmaxWitnessTypeName: <T extends OperationTypeNames>(operation: T) => `YmaxV1${T}`;
|
|
121
|
-
type YmaxWitnessTypeName<T extends OperationTypeNames> = ReturnType<typeof getYmaxWitnessTypeName<T>>;
|
|
122
|
-
declare const getYmaxWitnessFieldName: <T extends OperationTypeNames>(operation: T) => `ymax${T}`;
|
|
123
|
-
type YmaxWitnessFieldName<T extends OperationTypeNames> = ReturnType<typeof getYmaxWitnessFieldName<T>>;
|
|
124
|
-
export type YmaxWitnessTypeParam<T extends OperationTypeNames = OperationTypeNames> = TypedDataParameter<YmaxWitnessFieldName<T>, Extract<keyof YmaxWitnessOperationTypes<T>, string>>;
|
|
125
|
-
type YmaxWitnessOperationTypes<T extends OperationTypeNames = OperationTypeNames> = {
|
|
126
|
-
[K in T as YmaxWitnessTypeName<K>]: [
|
|
127
|
-
...OperationTypes[K],
|
|
128
|
-
...typeof SharedPortfolioTypeParams
|
|
129
|
-
];
|
|
130
|
-
};
|
|
131
|
-
type YmaxWitnessTypes<T extends OperationTypeNames = OperationTypeNames> = YmaxWitnessOperationTypes<T> & typeof OperationSubTypes;
|
|
132
|
-
type YmaxStandaloneOperationTypes<T extends OperationTypeNames = OperationTypeNames> = {
|
|
133
|
-
[K in T]: [
|
|
134
|
-
...OperationTypes[K],
|
|
135
|
-
...typeof SharedPortfolioTypeParams,
|
|
136
|
-
...typeof PortfolioStandaloneTypeParams
|
|
137
|
-
];
|
|
138
|
-
};
|
|
139
|
-
type YmaxStandaloneTypes<T extends OperationTypeNames = OperationTypeNames> = YmaxStandaloneOperationTypes<T> & typeof OperationSubTypes & {
|
|
140
|
-
EIP712Domain: typeof StandaloneDomainTypeParams;
|
|
141
|
-
};
|
|
142
|
-
export type YmaxOperationType<T extends OperationTypeNames> = TypedDataToPrimitiveTypes<OperationTypes & typeof OperationSubTypes>[T];
|
|
143
|
-
type YmaxWitnessData<T extends OperationTypeNames> = TypedDataToPrimitiveTypes<YmaxWitnessTypes<T>>[YmaxWitnessTypeParam<T>['type']];
|
|
144
|
-
type YmaxStandaloneData<T extends OperationTypeNames> = TypedDataToPrimitiveTypes<YmaxStandaloneTypes<T>>[T];
|
|
145
|
-
export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(operation: T) => { [K in T]: {
|
|
146
|
-
readonly OpenPortfolio: readonly [{
|
|
147
|
-
readonly name: "allocations";
|
|
148
|
-
readonly type: "Allocation[]";
|
|
149
|
-
}];
|
|
150
|
-
readonly Rebalance: readonly [{
|
|
151
|
-
readonly name: "portfolio";
|
|
152
|
-
readonly type: "uint256";
|
|
153
|
-
}];
|
|
154
|
-
readonly SetTargetAllocation: readonly [{
|
|
155
|
-
readonly name: "allocations";
|
|
156
|
-
readonly type: "Allocation[]";
|
|
157
|
-
}, {
|
|
158
|
-
readonly name: "portfolio";
|
|
159
|
-
readonly type: "uint256";
|
|
160
|
-
}];
|
|
161
|
-
readonly Deposit: readonly [{
|
|
162
|
-
readonly name: "portfolio";
|
|
163
|
-
readonly type: "uint256";
|
|
164
|
-
}];
|
|
165
|
-
/**
|
|
166
|
-
* Withdraw funds from a portfolio to the source EVM account.
|
|
167
|
-
* The signer of the message must match the portfolio's source EVM account
|
|
168
|
-
* The destination chain is determined from the domain info (chainId).
|
|
169
|
-
* - token: ERC-20 token contract address (must be USDC contract on the destination chain)
|
|
170
|
-
*/
|
|
171
|
-
readonly Withdraw: readonly [{
|
|
172
|
-
readonly name: "withdraw";
|
|
173
|
-
readonly type: "Asset";
|
|
174
|
-
}, {
|
|
175
|
-
readonly name: "portfolio";
|
|
176
|
-
readonly type: "uint256";
|
|
177
|
-
}];
|
|
178
|
-
}[K]; } & {
|
|
179
|
-
readonly Allocation: readonly [{
|
|
180
|
-
readonly name: "instrument";
|
|
181
|
-
readonly type: "string";
|
|
182
|
-
}, {
|
|
183
|
-
readonly name: "portion";
|
|
184
|
-
readonly type: "uint256";
|
|
185
|
-
}];
|
|
186
|
-
readonly Asset: [{
|
|
187
|
-
readonly name: "token";
|
|
188
|
-
readonly type: "address";
|
|
189
|
-
}, {
|
|
190
|
-
readonly name: "amount";
|
|
191
|
-
readonly type: "uint256";
|
|
192
|
-
}];
|
|
193
|
-
};
|
|
194
|
-
export declare const getYmaxWitness: <T extends OperationTypeNames>(operation: T, data: NoInfer<YmaxWitnessData<T>>) => Witness<YmaxWitnessTypes<T>, YmaxWitnessTypeParam<T>>;
|
|
195
|
-
export declare const getYmaxStandaloneDomain: (chainId: bigint | number, verifyingContract: Address) => YmaxFullDomain;
|
|
196
|
-
export declare const getYmaxStandaloneOperationData: <T extends OperationTypeNames>(data: NoInfer<YmaxStandaloneData<T>>, operation: T, chainId: bigint | number, verifyingContract: Address) => TypedDataDefinition<YmaxStandaloneTypes<T>, T, T> & {
|
|
197
|
-
domain: YmaxFullDomain;
|
|
198
|
-
};
|
|
199
|
-
export type YmaxStandaloneOperationData<T extends OperationTypeNames = OperationTypeNames> = ReturnType<typeof getYmaxStandaloneOperationData<T>>;
|
|
200
|
-
export type YmaxPermitWitnessTransferFromData<T extends OperationTypeNames = OperationTypeNames> = ReturnType<typeof getPermitWitnessTransferFromData<YmaxWitnessTypes<T>, YmaxWitnessTypeParam<T>>>;
|
|
201
|
-
export type YmaxPermitBatchWitnessTransferFromData<T extends OperationTypeNames = OperationTypeNames> = ReturnType<typeof getPermitBatchWitnessTransferFromData<YmaxWitnessTypes<T>, YmaxWitnessTypeParam<T>>>;
|
|
202
|
-
export declare function validateYmaxDomainBase(domain: TypedDataDomain): asserts domain is typeof YmaxStandaloneDomainBase;
|
|
203
|
-
export declare function validateYmaxDomain(domain: TypedDataDomain, validContractAddresses?: Record<number | string, Address> | undefined): asserts domain is YmaxFullDomain;
|
|
204
|
-
export declare function validateYmaxOperationTypeName<T extends OperationTypeNames>(typeName: string): asserts typeName is T;
|
|
205
|
-
export declare const splitWitnessFieldType: <T extends OperationTypeNames>(fieldName: `${typeof YMAX_DOMAIN_NAME}V${typeof YMAX_DOMAIN_VERSION}${T}`) => {
|
|
206
|
-
domain: {
|
|
207
|
-
readonly name: "Ymax";
|
|
208
|
-
readonly version: "1";
|
|
209
|
-
};
|
|
210
|
-
primaryType: T;
|
|
211
|
-
};
|
|
212
|
-
export {};
|
|
213
|
-
//# sourceMappingURL=eip712-messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eip712-messages.d.ts","sourceRoot":"","sources":["eip712-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,OAAO,EAEP,eAAe,EACf,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,gCAAgC,EACrC,KAAK,qCAAqC,EAG3C,MAAM,4CAA4C,CAAC;AAEpD,QAAA,MAAM,gBAAgB,SAAS,CAAC;AAChC,QAAA,MAAM,mBAAmB,MAAM,CAAC;AAIhC,QAAA,MAAM,0BAA0B;;;;;;;;;;;;EAKS,CAAC;AAE1C,QAAA,MAAM,wBAAwB;;;CAGM,CAAC;AACrC,MAAM,MAAM,cAAc,GAAG,OAAO,wBAAwB,GAAG;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AASF,QAAA,MAAM,yBAAyB,IAA6C,CAAC;AAE7E;;;GAGG;AACH,QAAA,MAAM,6BAA6B;;;;;;EAGM,CAAC;AAE1C;;GAEG;AACH,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;IAQlB;;;;;OAKG;;;;;;;;CAEyB,CAAC;AAC/B,KAAK,cAAc,GAAG,OAAO,cAAc,CAAC;AAC5C,MAAM,MAAM,kBAAkB,GAAG,MAAM,cAA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;CAqB1E,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Helpers to handle portfolio EIP-712 messages, extracting operation and
|
|
3
|
-
* deposit permit details, as well as verifying the signature.
|
|
4
|
-
*
|
|
5
|
-
* The viem runtime dependency is expected as a power to make this usable both
|
|
6
|
-
* on chain and in off-chain services.
|
|
7
|
-
*/
|
|
8
|
-
import type { AbiParameterToPrimitiveType, Address, TypedDataDomain } from 'abitype';
|
|
9
|
-
import type { hashStruct, isHex, recoverTypedDataAddress, validateTypedData } from 'viem/utils';
|
|
10
|
-
import { encodeType, type WithSignature } from '@agoric/orchestration/src/utils/viem.js';
|
|
11
|
-
import { type PermitWitnessTransferFromInputComponents } from '@agoric/orchestration/src/utils/permit2.js';
|
|
12
|
-
import { type OperationTypeNames, type YmaxStandaloneOperationData, type YmaxPermitWitnessTransferFromData, type YmaxOperationType, type YmaxFullDomain } from './eip712-messages.js';
|
|
13
|
-
export type YmaxOperationDetails<T extends OperationTypeNames = OperationTypeNames> = {
|
|
14
|
-
[P in T]: {
|
|
15
|
-
operation: P;
|
|
16
|
-
domain: YmaxFullDomain;
|
|
17
|
-
data: YmaxOperationType<P>;
|
|
18
|
-
};
|
|
19
|
-
}[T];
|
|
20
|
-
export type PermitWitnessTransferFromPayload = AbiParameterToPrimitiveType<{
|
|
21
|
-
type: 'tuple';
|
|
22
|
-
components: typeof PermitWitnessTransferFromInputComponents;
|
|
23
|
-
}>;
|
|
24
|
-
export type PermitDetails = {
|
|
25
|
-
chainId: NonNullable<TypedDataDomain['chainId']>;
|
|
26
|
-
token: Address;
|
|
27
|
-
amount: bigint;
|
|
28
|
-
spender: Address;
|
|
29
|
-
permit2Payload: Omit<PermitWitnessTransferFromPayload, 'transferDetails'>;
|
|
30
|
-
};
|
|
31
|
-
export type FullMessageDetails<T extends OperationTypeNames = OperationTypeNames> = YmaxOperationDetails<T> & {
|
|
32
|
-
permitDetails?: PermitDetails;
|
|
33
|
-
evmWalletAddress: Address;
|
|
34
|
-
nonce: bigint;
|
|
35
|
-
deadline: bigint;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* EVM Message handler utils that depend on 'viem' utils for their
|
|
39
|
-
* implementation. Since on-chain we cannot directly import from 'viem',
|
|
40
|
-
* use a maker pattern to create these utils.
|
|
41
|
-
*/
|
|
42
|
-
export declare const makeEVMHandlerUtils: (viemUtils: {
|
|
43
|
-
isHex: typeof isHex;
|
|
44
|
-
hashStruct: typeof hashStruct;
|
|
45
|
-
recoverTypedDataAddress: typeof recoverTypedDataAddress;
|
|
46
|
-
validateTypedData: typeof validateTypedData;
|
|
47
|
-
encodeType: typeof encodeType;
|
|
48
|
-
}) => {
|
|
49
|
-
extractOperationDetailsFromStandaloneData: <T extends OperationTypeNames>(data: YmaxStandaloneOperationData<T>, validContractAddresses?: Record<number | string, Address>) => YmaxOperationDetails<T>;
|
|
50
|
-
extractOperationDetailsFromPermit2WitnessData: <T extends OperationTypeNames>(data: YmaxPermitWitnessTransferFromData<T>) => YmaxOperationDetails<T>;
|
|
51
|
-
extractPermitDetails: <T extends OperationTypeNames>(data: YmaxPermitWitnessTransferFromData<T>, owner: Address, signature: WithSignature<object>["signature"]) => PermitDetails;
|
|
52
|
-
extractOperationDetailsFromSignedData: <T extends OperationTypeNames = "Withdraw" | "Deposit" | "Rebalance" | "OpenPortfolio" | "SetTargetAllocation">(signedData: WithSignature<YmaxPermitWitnessTransferFromData<T> | YmaxStandaloneOperationData<T>>, validStandaloneContractAddresses?: Record<number | string, Address>) => Promise<FullMessageDetails<T>>;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=message-handler-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-handler-helpers.d.ts","sourceRoot":"","sources":["message-handler-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,2BAA2B,EAC3B,OAAO,EACP,eAAe,EAChB,M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IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAW;IAC7C,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,UAAU,EAAE,OAAO,UAAU,CAAC;CAC/B;gDAqBG,CAAC,SAAS,kBAAkB,QAEtB,2BAA2B,CAAC,CAAC,CAAC,2BACX,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,KACxD,oBAAoB,CAAC,CAAC,CAAC;oDA6BxB,CAAC,SAAS,kBAAkB,QAEtB,iCAAiC,CAAC,CAAC,CAAC,KACzC,oBAAoB,CAAC,CAAC,CAAC;2BAmCI,CAAC,SAAS,kBAAkB,QAClD,iCAAiC,CAAC,CAAC,CAAC,SACnC,OAAO,aACH,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,KAC5C,aAAa;4CAiDd,CAAC,SAAS,kBAAkB,+FAEhB,aAAa,CACvB,iCAAiC,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,CACtE,qCACkC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,KAClE,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAoDlC,CAAC"}
|
package/src/instruments.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mnemonic IDs for supported financial instruments in which a portfolio can use
|
|
3
|
-
* assets to take a position.
|
|
4
|
-
*
|
|
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.
|
|
12
|
-
*/
|
|
13
|
-
export type InstrumentId = (typeof InstrumentId)[keyof typeof InstrumentId];
|
|
14
|
-
export namespace InstrumentId {
|
|
15
|
-
let Aave_Arbitrum: "Aave_Arbitrum";
|
|
16
|
-
let Aave_Avalanche: "Aave_Avalanche";
|
|
17
|
-
let Aave_Base: "Aave_Base";
|
|
18
|
-
let Aave_Ethereum: "Aave_Ethereum";
|
|
19
|
-
let Aave_Optimism: "Aave_Optimism";
|
|
20
|
-
let Beefy_compoundUsdc_Arbitrum: "Beefy_compoundUsdc_Arbitrum";
|
|
21
|
-
let Beefy_compoundUsdc_Optimism: "Beefy_compoundUsdc_Optimism";
|
|
22
|
-
let Beefy_morphoGauntletUsdc_Ethereum: "Beefy_morphoGauntletUsdc_Ethereum";
|
|
23
|
-
let Beefy_morphoSeamlessUsdc_Base: "Beefy_morphoSeamlessUsdc_Base";
|
|
24
|
-
let Beefy_morphoSmokehouseUsdc_Ethereum: "Beefy_morphoSmokehouseUsdc_Ethereum";
|
|
25
|
-
let Beefy_re7_Avalanche: "Beefy_re7_Avalanche";
|
|
26
|
-
let Compound_Arbitrum: "Compound_Arbitrum";
|
|
27
|
-
let Compound_Base: "Compound_Base";
|
|
28
|
-
let Compound_Ethereum: "Compound_Ethereum";
|
|
29
|
-
let Compound_Optimism: "Compound_Optimism";
|
|
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";
|
|
43
|
-
let ERC4626_morphoSteakhousePrimeUsdc_Base: "ERC4626_morphoSteakhousePrimeUsdc_Base";
|
|
44
|
-
let ERC4626_morphoSteakhouseUsdc_Base: "ERC4626_morphoSteakhouseUsdc_Base";
|
|
45
|
-
let ERC4626_morphoGauntletUsdcPrime_Base: "ERC4626_morphoGauntletUsdcPrime_Base";
|
|
46
|
-
let ERC4626_morphoSeamlessUsdcVault_Base: "ERC4626_morphoSeamlessUsdcVault_Base";
|
|
47
|
-
let ERC4626_morphoSteakhouseHighYieldUsdc_Arbitrum: "ERC4626_morphoSteakhouseHighYieldUsdc_Arbitrum";
|
|
48
|
-
let ERC4626_morphoGauntletUsdcCore_Arbitrum: "ERC4626_morphoGauntletUsdcCore_Arbitrum";
|
|
49
|
-
let ERC4626_morphoHyperithmUsdc_Arbitrum: "ERC4626_morphoHyperithmUsdc_Arbitrum";
|
|
50
|
-
let ERC4626_morphoGauntletUsdcPrime_Optimism: "ERC4626_morphoGauntletUsdcPrime_Optimism";
|
|
51
|
-
let USDN: "USDN";
|
|
52
|
-
let USDNVault: "USDNVault";
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=instruments.d.ts.map
|
package/src/instruments.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["instruments.js"],"names":[],"mappings":";;;;;;;;;;;;2BAYU,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC"}
|
package/src/main.d.ts
DELETED
package/src/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.js"],"names":[],"mappings":""}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GENERATED FILE - DO NOT EDIT.
|
|
3
|
-
* Source: ../ymax-machine.yaml
|
|
4
|
-
* To regenerate: yarn run -T tsx scripts/gen-ymax-machine.mts
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {object} TransitionTarget
|
|
8
|
-
* @property {string} target
|
|
9
|
-
* @property {string} [description]
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {object} StateNode
|
|
13
|
-
* @property {string} description
|
|
14
|
-
* @property {string} [type]
|
|
15
|
-
* @property {string} [initial]
|
|
16
|
-
* @property {Record<string, StateNode>} [states]
|
|
17
|
-
* @property {Record<string, TransitionTarget | TransitionTarget[]>} [on]
|
|
18
|
-
* @property {TransitionTarget} [onDone]
|
|
19
|
-
* @property {TransitionTarget} [onError]
|
|
20
|
-
* @property {Record<string, TransitionTarget>} [after]
|
|
21
|
-
* @property {string[]} [entry]
|
|
22
|
-
* @property {string[]} [exit]
|
|
23
|
-
* @property {string[]} [tags]
|
|
24
|
-
* @property {{ wayMachines?: string[] } & Record<string, unknown>} [meta]
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* @typedef {object} MachineDefinition
|
|
28
|
-
* @property {string} description
|
|
29
|
-
* @property {string} [category]
|
|
30
|
-
* @property {string} initial
|
|
31
|
-
* @property {Record<string, StateNode>} states
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* @typedef {object} YmaxSpec
|
|
35
|
-
* @property {string} [version]
|
|
36
|
-
* @property {Record<string, MachineDefinition>} machines
|
|
37
|
-
*/
|
|
38
|
-
/** @type {YmaxSpec} */
|
|
39
|
-
export const ymaxMachine: YmaxSpec;
|
|
40
|
-
export default ymaxMachine;
|
|
41
|
-
export type TransitionTarget = {
|
|
42
|
-
target: string;
|
|
43
|
-
description?: string | undefined;
|
|
44
|
-
};
|
|
45
|
-
export type StateNode = {
|
|
46
|
-
description: string;
|
|
47
|
-
type?: string | undefined;
|
|
48
|
-
initial?: string | undefined;
|
|
49
|
-
states?: Record<string, StateNode> | undefined;
|
|
50
|
-
on?: Record<string, TransitionTarget | TransitionTarget[]> | undefined;
|
|
51
|
-
onDone?: TransitionTarget | undefined;
|
|
52
|
-
onError?: TransitionTarget | undefined;
|
|
53
|
-
after?: Record<string, TransitionTarget> | undefined;
|
|
54
|
-
entry?: string[] | undefined;
|
|
55
|
-
exit?: string[] | undefined;
|
|
56
|
-
tags?: string[] | undefined;
|
|
57
|
-
meta?: ({
|
|
58
|
-
wayMachines?: string[];
|
|
59
|
-
} & Record<string, unknown>) | undefined;
|
|
60
|
-
};
|
|
61
|
-
export type MachineDefinition = {
|
|
62
|
-
description: string;
|
|
63
|
-
category?: string | undefined;
|
|
64
|
-
initial: string;
|
|
65
|
-
states: Record<string, StateNode>;
|
|
66
|
-
};
|
|
67
|
-
export type YmaxSpec = {
|
|
68
|
-
version?: string | undefined;
|
|
69
|
-
machines: Record<string, MachineDefinition>;
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=ymax-machine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ymax-machine.d.ts","sourceRoot":"","sources":["ymax-machine.js"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH,uBAAuB;AACvB,0BADW,QAAQ,CA8tCjB;;;YAhwCY,MAAM;;;;iBAMN,MAAM;;;;;;;;;;;;sBAWU,MAAM,EAAE;;;;iBAKxB,MAAM;;aAEN,MAAM;YACN,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;;cAMzB,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Constants and configuration for portfolio contract deployment
|
|
3
|
-
*
|
|
4
|
-
* This module exports domain knowledge about portfolio contract deployment,
|
|
5
|
-
* including wallet store keys, control addresses, and contract names.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Wallet store key where the contract control facet is delivered
|
|
9
|
-
* @type {string}
|
|
10
|
-
*/
|
|
11
|
-
export const YMAX_CONTROL_WALLET_KEY: string;
|
|
12
|
-
/**
|
|
13
|
-
* Known portfolio contract names in agoricNames.instance
|
|
14
|
-
* @type {readonly ['ymax0', 'ymax1']}
|
|
15
|
-
*/
|
|
16
|
-
export const PORTFOLIO_CONTRACT_NAMES: readonly ["ymax0", "ymax1"];
|
|
17
|
-
/**
|
|
18
|
-
* Control account addresses per contract and network
|
|
19
|
-
* Source: https://www.mintscan.io/agoric/proposals/111 (for ymax0/main)
|
|
20
|
-
*
|
|
21
|
-
* @type {{
|
|
22
|
-
* ymax0: {
|
|
23
|
-
* main: string;
|
|
24
|
-
* devnet: string;
|
|
25
|
-
* };
|
|
26
|
-
* ymax1: {
|
|
27
|
-
* main: string;
|
|
28
|
-
* devnet: string;
|
|
29
|
-
* };
|
|
30
|
-
* }}
|
|
31
|
-
*/
|
|
32
|
-
export const CONTROL_ADDRESSES: {
|
|
33
|
-
ymax0: {
|
|
34
|
-
main: string;
|
|
35
|
-
devnet: string;
|
|
36
|
-
};
|
|
37
|
-
ymax1: {
|
|
38
|
-
main: string;
|
|
39
|
-
devnet: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export function getControlAddress(contractName: (typeof PORTFOLIO_CONTRACT_NAMES)[number], network: "main" | "devnet"): string;
|
|
43
|
-
export function isPortfolioContract(name: string): name is "ymax0" | "ymax1";
|
|
44
|
-
//# sourceMappingURL=portfolio-constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"portfolio-constants.d.ts","sourceRoot":"","sources":["portfolio-constants.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,sCAFU,MAAM,CAEqC;AAErD;;;GAGG;AACH,uCAFU,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAKlC;AAEH;;;;;;;;;;;;;;GAcG;AACH,gCAXU;IACL,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAWF;AAUK,gDALI,CAAA,OAAO,wBAAwB,EAAC,MAAM,CAAC,WACvC,MAAM,GAAG,QAAQ,GACf,MAAM,CAclB;AAQM,0CAHI,MAAM,6BAOhB"}
|
package/src/resolver.d.ts
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Statuses for published transactions. Exhaustive state machine transitions:
|
|
3
|
-
* - setup -> pending (when transaction information is assembled and sent)
|
|
4
|
-
* - pending -> success (when cross-chain operation completes successfully)
|
|
5
|
-
* - pending -> failed (when operation fails or times out)
|
|
6
|
-
*/
|
|
7
|
-
export type TxStatus = (typeof TxStatus)[keyof typeof TxStatus];
|
|
8
|
-
export namespace TxStatus {
|
|
9
|
-
let SETUP: "setup";
|
|
10
|
-
let PENDING: "pending";
|
|
11
|
-
let SUCCESS: "success";
|
|
12
|
-
let FAILED: "failed";
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Tx types for published transactions
|
|
16
|
-
*/
|
|
17
|
-
export type TxType = Readonly<(typeof TxType)[keyof typeof TxType]>;
|
|
18
|
-
/**
|
|
19
|
-
* Tx types for published transactions
|
|
20
|
-
*
|
|
21
|
-
* @enum {Readonly<(typeof TxType)[keyof typeof TxType]>}
|
|
22
|
-
*/
|
|
23
|
-
export const TxType: import("@agoric/internal").KeyMirrorResult<{
|
|
24
|
-
CCTP_TO_EVM: null;
|
|
25
|
-
GMP: null;
|
|
26
|
-
ROUTED_GMP: null;
|
|
27
|
-
CCTP_TO_AGORIC: null;
|
|
28
|
-
IBC_FROM_AGORIC: null;
|
|
29
|
-
IBC_FROM_REMOTE: null;
|
|
30
|
-
MAKE_ACCOUNT: null;
|
|
31
|
-
/**
|
|
32
|
-
* Placeholder for ProgressTracker protocols not yet recognized by the
|
|
33
|
-
* resolver client, just so they can be published to vstorage, but not
|
|
34
|
-
* processed any further. If these appear, it means the resolver client
|
|
35
|
-
* source code needs to be updated.
|
|
36
|
-
*/
|
|
37
|
-
UNKNOWN: null;
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Adapt orchestration TrafficEntry to the portfolio's PublishedTx type.
|
|
41
|
-
* - Rename 'dst' to 'dest' for consistency with portfolio-contract.
|
|
42
|
-
* - Add optional 'amount' property.
|
|
43
|
-
*/
|
|
44
|
-
export type PublishedTrafficTxDetails = Partial<Omit<TrafficEntry, "dst">> & {
|
|
45
|
-
type: TxType & ("IBC_FROM_AGORIC" | "IBC_FROM_REMOTE");
|
|
46
|
-
dest?: TrafficEntry["dst"];
|
|
47
|
-
amount?: bigint;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Represents a transaction published in vstorage at
|
|
51
|
-
* `published.${contractInstance}.pendingTxs.tx${number}`
|
|
52
|
-
* with its type, optional amount, destination, and status.
|
|
53
|
-
*/
|
|
54
|
-
export type PublishedPortfolioTxDetails = {
|
|
55
|
-
/**
|
|
56
|
-
* - The type of
|
|
57
|
-
* transaction (CCTP_TO_EVM, GMP, CCTP_TO_AGORIC, or MAKE_ACCOUNT)
|
|
58
|
-
*/
|
|
59
|
-
type: Exclude<TxType, PublishedTrafficTxDetails["type"] | "ROUTED_GMP">;
|
|
60
|
-
/**
|
|
61
|
-
* - Optional transaction amount as a bigint, currently in micro-USDC (6 decimal fixed-point)
|
|
62
|
-
*/
|
|
63
|
-
amount?: bigint | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* - The destination account
|
|
66
|
-
* identifier for the transaction
|
|
67
|
-
*/
|
|
68
|
-
destinationAddress?: `${string}:${string}:${string}` | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* - The source LCA address initiating the
|
|
71
|
-
* transaction (required for GMP and MAKE_ACCOUNT transactions)
|
|
72
|
-
*/
|
|
73
|
-
sourceAddress?: `${string}:${string}:${string}` | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* - The expected address of the EVM smart
|
|
76
|
-
* wallet to be created (only for type "MAKE_ACCOUNT")
|
|
77
|
-
*/
|
|
78
|
-
expectedAddr?: `0x${string}` | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* - The address of the EVM smart wallet
|
|
81
|
-
* factory contract responsible for creating the smart wallet (only for type
|
|
82
|
-
* "MAKE_ACCOUNT")
|
|
83
|
-
*/
|
|
84
|
-
factoryAddr?: `0x${string}` | undefined;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Core debugging details that every pending ROUTED_GMP transaction publish
|
|
88
|
-
*/
|
|
89
|
-
export type RoutedGMPTxBaseDetails = {
|
|
90
|
-
/**
|
|
91
|
-
* - The 4-byte function selector of the process instruction function
|
|
92
|
-
*/
|
|
93
|
-
instructionSelector: `0x${string}`;
|
|
94
|
-
/**
|
|
95
|
-
* - The routed instruction type
|
|
96
|
-
*/
|
|
97
|
-
instructionType: SupportedInstructions;
|
|
98
|
-
/**
|
|
99
|
-
* - The EVM address corresponding to the source LCA address
|
|
100
|
-
*/
|
|
101
|
-
expectedRemoteTargetAddress: HexAddress;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Specialized case of a transaction published in vstorage at
|
|
105
|
-
* `published.${contractInstance}.pendingTxs.tx${number}`
|
|
106
|
-
* for the ROUTED_GMP type.
|
|
107
|
-
*/
|
|
108
|
-
export type PublishedRoutedGMPTxDetails = {
|
|
109
|
-
/**
|
|
110
|
-
* - The type of transaction, always "ROUTED_GMP"
|
|
111
|
-
*/
|
|
112
|
-
type: TxType & ("ROUTED_GMP");
|
|
113
|
-
/**
|
|
114
|
-
* - The router account handling this transaction
|
|
115
|
-
*/
|
|
116
|
-
destinationAddress: AccountId;
|
|
117
|
-
/**
|
|
118
|
-
* - The source LCA address initiating the
|
|
119
|
-
* transaction (either portfolio or contract)
|
|
120
|
-
*/
|
|
121
|
-
sourceAddress: AccountId;
|
|
122
|
-
/**
|
|
123
|
-
* - Flag indicating that the initial transaction registration is incomplete and awaiting payloadHash and details update
|
|
124
|
-
*/
|
|
125
|
-
incomplete?: true | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* - The hash of the GMP Payload
|
|
128
|
-
*/
|
|
129
|
-
payloadHash?: `0x${string}` | undefined;
|
|
130
|
-
/**
|
|
131
|
-
* - Debugging details
|
|
132
|
-
*/
|
|
133
|
-
details?: (RoutedGMPTxBaseDetails & Record<string, PureData>) | undefined;
|
|
134
|
-
};
|
|
135
|
-
export type PublishedTxBase = {
|
|
136
|
-
/**
|
|
137
|
-
* - The type of transaction (CCTP_TO_EVM, GMP, CCTP_TO_AGORIC, or MAKE_ACCOUNT)
|
|
138
|
-
*/
|
|
139
|
-
type: TxType;
|
|
140
|
-
/**
|
|
141
|
-
* - Current status of the transaction (pending, success, or failed)
|
|
142
|
-
*/
|
|
143
|
-
status: TxStatus;
|
|
144
|
-
/**
|
|
145
|
-
* - Optional reason for failure (only present when status is 'failed')
|
|
146
|
-
*/
|
|
147
|
-
rejectionReason?: string | undefined;
|
|
148
|
-
/**
|
|
149
|
-
* - DEPRECATED in favor of {@link import ('./types.js').FlowStep['phases']}. Optional ID of the next transaction in a sequence
|
|
150
|
-
*/
|
|
151
|
-
nextTxId?: `tx${number}` | undefined;
|
|
152
|
-
};
|
|
153
|
-
export type PublishedTx = PublishedTxBase & (PublishedTrafficTxDetails | PublishedPortfolioTxDetails | PublishedRoutedGMPTxDetails);
|
|
154
|
-
import type { TrafficEntry } from '@agoric/orchestration';
|
|
155
|
-
import type { SupportedInstructions } from '@aglocal/portfolio-contract/src/interfaces/orch-router.js';
|
|
156
|
-
import type { HexAddress } from '@agoric/orchestration';
|
|
157
|
-
import type { AccountId } from '@agoric/orchestration';
|
|
158
|
-
import type { PureData } from '@endo/pass-style';
|
|
159
|
-
//# sourceMappingURL=resolver.d.ts.map
|
package/src/resolver.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["resolver.js"],"names":[],"mappings":";;;;;;uBAeU,CAAC,OAAO,QAAQ,EAAE,MAAM,OAAO,QAAQ,CAAC;;;;;;;;;;qBAaxC,QAAQ,CAAC,CAAC,OAAO,MAAM,EAAE,MAAM,OAAO,MAAM,CAAC,CAAC;AAHxD;;;;GAIG;AACH;;;;;;;;IAQE;;;;;OAKG;;GAEF;;;;;;wCAIU,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,GAAG;IAC7C,IAAI,EAAE,MAAM,GAAG,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;;;;;;;;;;UAYU,OAAO,CAAC,MAAM,EAAE,yBAAyB,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAkBjE,KAAK,MAAM,EAAE;;;;qBACb,qBAAqB;;;;iCACrB,UAAU;;;;;;;;;;;UASV,MAAM,GAAG,CAAC,YAAY,CAAC;;;;wBACvB,SAAS;;;;;mBACT,SAAS;;;;;;;;;;;;;;;;;;UAUT,MAAM;;;;YACN,QAAQ;;;;;;;;;;0BAMT,eAAe,GAAG,CAAC,yBAAyB,GAAG,2BAA2B,GAAG,2BAA2B,CAAC;kCA7GhE,uBAAuB;2CAErC,2DAA2D;gCAF7C,uBAAuB;+BAAvB,uBAAuB;8BADlD,kBAAkB"}
|
package/src/type-guards.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { BeefyInstrumentId, ERC4626InstrumentId } from '@aglocal/portfolio-contract/src/type-guards.js';
|
|
2
|
-
import type { InstrumentId } from './instruments.js';
|
|
3
|
-
import type { DepositFromChainRef, LocalChainAccountRef, InterChainAccountRef, WithdrawToChainRef } from './types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Without regard to supported chains, is the input plausibly a
|
|
6
|
-
* DepositFromChainRef (i.e., does it start with `+`)?
|
|
7
|
-
*/
|
|
8
|
-
export declare const isDepositFromChainRef: (ref: string) => ref is DepositFromChainRef;
|
|
9
|
-
/**
|
|
10
|
-
* Without regard to supported chains, is the input plausibly a
|
|
11
|
-
* LocalChainAccountRef (i.e., does it start with `+`)?
|
|
12
|
-
*/
|
|
13
|
-
export declare const isLocalChainAccountRef: (ref: string) => ref is LocalChainAccountRef;
|
|
14
|
-
/**
|
|
15
|
-
* Without regard to supported chains, is the input plausibly an
|
|
16
|
-
* InterChainAccountRef (i.e., does it start with `@`)?
|
|
17
|
-
*/
|
|
18
|
-
export declare const isInterChainAccountRef: (ref: string) => ref is InterChainAccountRef;
|
|
19
|
-
/**
|
|
20
|
-
* Without regard to supported chains, is the input plausibly an InstrumentId
|
|
21
|
-
* (i.e., does it start with an ASCII letter)?
|
|
22
|
-
*/
|
|
23
|
-
export declare const isInstrumentId: (ref: string) => ref is InstrumentId;
|
|
24
|
-
/**
|
|
25
|
-
* Without regard to supported chains, is the input plausibly a
|
|
26
|
-
* WithdrawToChainRef (i.e., does it start with `-`)?
|
|
27
|
-
*/
|
|
28
|
-
export declare const isWithdrawToChainRef: (ref: string) => ref is WithdrawToChainRef;
|
|
29
|
-
/**
|
|
30
|
-
* Is the input an ERC-4626 InstrumentId
|
|
31
|
-
* (i.e., does it start with 'ERC4626_')?
|
|
32
|
-
*/
|
|
33
|
-
export declare const isERC4626InstrumentId: (ref: string) => ref is ERC4626InstrumentId;
|
|
34
|
-
/**
|
|
35
|
-
* Is the input an Beefy InstrumentId
|
|
36
|
-
* (i.e., does it start with 'Beefy_')?
|
|
37
|
-
*/
|
|
38
|
-
export declare const isBeefyInstrumentId: (ref: string) => ref is BeefyInstrumentId;
|
|
39
|
-
//# sourceMappingURL=type-guards.d.ts.map
|
package/src/type-guards.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,gDAAgD,CAAC;AACxD,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;AAGtB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,KACV,GAAG,IAAI,mBAAiD,CAAC;AAG5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,iBAC/B,CAAC"}
|
package/src/types.d.ts
DELETED
|
@@ -1,296 +0,0 @@
|
|
|
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
|
package/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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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