@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/portfolio-api",
|
|
3
|
-
"version": "0.2.0",
|
|
3
|
+
"version": "0.2.1-upgrade-23-dev-bd79330.0.bd79330",
|
|
4
4
|
"description": "API for Portfolio management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -11,41 +11,36 @@
|
|
|
11
11
|
"bin": "./src/cli/bin.js",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "exit 0",
|
|
14
|
+
"prepack": "yarn run -T prepack-package",
|
|
15
|
+
"postpack": "yarn run -T postpack-package",
|
|
14
16
|
"test": "ava",
|
|
15
17
|
"test:c8": "c8 --all $C8_OPTIONS ava",
|
|
16
18
|
"test:xs": "exit 0",
|
|
17
19
|
"lint-fix": "yarn lint:eslint --fix",
|
|
18
20
|
"lint": "yarn run -T run-s --continue-on-error 'lint:*'",
|
|
19
|
-
"lint:eslint": "
|
|
20
|
-
"lint:types": "yarn run -T tsc"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"ts-blank-space": "^0.6.2"
|
|
21
|
+
"lint:eslint": "node ../../scripts/eslint-repo.mjs .",
|
|
22
|
+
"lint:types": "yarn run -T tsc",
|
|
23
|
+
"lint:mermaid": "npx tsx scripts/gen-mermaid.mts --check",
|
|
24
|
+
"lint:ymax-diagram": "npx tsx scripts/lint-ymax-state-diagram.mts",
|
|
25
|
+
"lint:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts --check",
|
|
26
|
+
"lint:visualizer-data": "npx tsx scripts/gen-visualizer-data.mts --check",
|
|
27
|
+
"generate:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@agoric/
|
|
30
|
-
"@agoric/
|
|
31
|
-
"@agoric/ertp": "0.17.0",
|
|
32
|
-
"@agoric/internal": "0.4.0",
|
|
33
|
-
"@agoric/notifier": "0.7.0",
|
|
34
|
-
"@agoric/orchestration": "0.2.0",
|
|
35
|
-
"@agoric/zoe": "0.27.0",
|
|
36
|
-
"@cosmjs/proto-signing": "^0.36.0",
|
|
37
|
-
"@cosmjs/stargate": "^0.36.0",
|
|
38
|
-
"@endo/base64": "^1.0.12",
|
|
30
|
+
"@agoric/internal": "0.4.1-upgrade-23-dev-bd79330.0.bd79330",
|
|
31
|
+
"@agoric/orchestration": "0.2.1-upgrade-23-dev-bd79330.0.bd79330",
|
|
39
32
|
"@endo/common": "^1.2.13",
|
|
40
33
|
"@endo/errors": "^1.2.13",
|
|
41
|
-
"@endo/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
34
|
+
"@endo/patterns": "^1.7.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/js-yaml": "^4",
|
|
38
|
+
"ajv": "^6.12.6",
|
|
39
|
+
"ava": "^6.4.1",
|
|
40
|
+
"c8": "^10.1.3",
|
|
41
|
+
"js-yaml": "^4.1.1",
|
|
42
|
+
"ts-blank-space": "^0.6.2",
|
|
43
|
+
"tsd": "^0.33.0"
|
|
49
44
|
},
|
|
50
45
|
"ava": {
|
|
51
46
|
"extensions": {
|
|
@@ -64,6 +59,9 @@
|
|
|
64
59
|
],
|
|
65
60
|
"timeout": "20m"
|
|
66
61
|
},
|
|
62
|
+
"typeCoverage": {
|
|
63
|
+
"atLeast": 100
|
|
64
|
+
},
|
|
67
65
|
"license": "Apache-2.0",
|
|
68
66
|
"publishConfig": {
|
|
69
67
|
"access": "public"
|
|
@@ -71,5 +69,5 @@
|
|
|
71
69
|
"engines": {
|
|
72
70
|
"node": "^20.9 || ^22.11"
|
|
73
71
|
},
|
|
74
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "bd79330f78dae2faf9cc3d8b10063567700da07b"
|
|
75
73
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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/constants.js
CHANGED
|
@@ -2,42 +2,171 @@
|
|
|
2
2
|
|
|
3
3
|
/// <reference types="ses" />
|
|
4
4
|
|
|
5
|
+
import { keyMirror } from '@agoric/internal';
|
|
6
|
+
import { M, objectMap } from '@endo/patterns';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @import {ClusterName, TypedPattern} from '@agoric/internal';
|
|
10
|
+
* @import {CaipChainId} from '@agoric/orchestration';
|
|
11
|
+
* @import {FlowConfig} from './types.js';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Configuration arguments for newly-created portfolio flows.
|
|
16
|
+
*
|
|
17
|
+
* This is only a default so that existing flows continue to behave as before
|
|
18
|
+
* for replay fidelity.
|
|
19
|
+
*
|
|
20
|
+
* @type {FlowConfig | undefined}
|
|
21
|
+
*/
|
|
22
|
+
export const DEFAULT_FLOW_CONFIG = {
|
|
23
|
+
features: {
|
|
24
|
+
/** Enable ProgressTracker support in new flows. */
|
|
25
|
+
useProgressTracker: true,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
harden(DEFAULT_FLOW_CONFIG);
|
|
29
|
+
|
|
5
30
|
/**
|
|
6
31
|
* Yield protocols for Proof of Concept.
|
|
7
32
|
*
|
|
8
33
|
* @enum {(typeof YieldProtocol)[keyof typeof YieldProtocol]}
|
|
9
34
|
*/
|
|
10
|
-
export const YieldProtocol =
|
|
11
|
-
Aave:
|
|
12
|
-
Compound:
|
|
13
|
-
USDN:
|
|
14
|
-
Beefy:
|
|
35
|
+
export const YieldProtocol = keyMirror({
|
|
36
|
+
Aave: null,
|
|
37
|
+
Compound: null,
|
|
38
|
+
USDN: null,
|
|
39
|
+
Beefy: null,
|
|
40
|
+
ERC4626: null,
|
|
15
41
|
});
|
|
16
42
|
harden(YieldProtocol);
|
|
17
43
|
|
|
44
|
+
/**
|
|
45
|
+
* EVM chain wallet operations that incur different gas costs.
|
|
46
|
+
* Supply: user is supplying assets to a yield protocol on the target chain.
|
|
47
|
+
* Withdraw: user is withdrawing assets from a yield protocol on the target chain.
|
|
48
|
+
* DepositForBurn: user is transferring assets off the target chain via CCTP.
|
|
49
|
+
*
|
|
50
|
+
* @enum {(typeof EvmWalletOperationType)[keyof typeof EvmWalletOperationType]}
|
|
51
|
+
*/
|
|
52
|
+
export const EvmWalletOperationType = /** @type {const} */ ({
|
|
53
|
+
Supply: 'supply',
|
|
54
|
+
Withdraw: 'withdraw',
|
|
55
|
+
DepositForBurn: 'depositforburn',
|
|
56
|
+
});
|
|
57
|
+
harden(EvmWalletOperationType);
|
|
58
|
+
|
|
18
59
|
/**
|
|
19
60
|
* @enum {(typeof AxelarChain)[keyof typeof AxelarChain]}
|
|
20
61
|
*/
|
|
21
|
-
export const AxelarChain =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
62
|
+
export const AxelarChain = keyMirror({
|
|
63
|
+
Arbitrum: null,
|
|
64
|
+
Avalanche: null,
|
|
65
|
+
Base: null,
|
|
66
|
+
Ethereum: null,
|
|
67
|
+
Optimism: null,
|
|
27
68
|
});
|
|
28
69
|
harden(AxelarChain);
|
|
29
70
|
|
|
71
|
+
/**
|
|
72
|
+
* cf. https://chainlist.org/
|
|
73
|
+
* XXX this probably belongs in @agoric/orchestration
|
|
74
|
+
* @type {Readonly<Record<ClusterName, Readonly<Partial<Record<AxelarChain, bigint>>>>>}
|
|
75
|
+
*/
|
|
76
|
+
export const Eip155ChainIds = {
|
|
77
|
+
mainnet: {
|
|
78
|
+
Arbitrum: 42161n,
|
|
79
|
+
Avalanche: 43114n,
|
|
80
|
+
Base: 8453n,
|
|
81
|
+
Ethereum: 1n,
|
|
82
|
+
Optimism: 10n,
|
|
83
|
+
},
|
|
84
|
+
testnet: {
|
|
85
|
+
Arbitrum: 421614n, // Sepolia
|
|
86
|
+
Avalanche: 43113n, // Fuji
|
|
87
|
+
Base: 84532n, // Sepolia
|
|
88
|
+
Ethereum: 11155111n, // Sepolia
|
|
89
|
+
Optimism: 11155420n, // Sepolia
|
|
90
|
+
},
|
|
91
|
+
local: {},
|
|
92
|
+
};
|
|
93
|
+
harden(Eip155ChainIds);
|
|
94
|
+
|
|
30
95
|
/**
|
|
31
96
|
* @enum {(typeof SupportedChain)[keyof typeof SupportedChain]}
|
|
32
97
|
*/
|
|
33
|
-
export const SupportedChain =
|
|
34
|
-
...AxelarChain
|
|
98
|
+
export const SupportedChain = keyMirror({
|
|
99
|
+
// ...AxelarChain works locally but gets lost in .d.ts generation
|
|
100
|
+
Arbitrum: 'Arbitrum',
|
|
101
|
+
Avalanche: 'Avalanche',
|
|
102
|
+
Base: 'Base',
|
|
103
|
+
Ethereum: 'Ethereum',
|
|
104
|
+
Optimism: 'Optimism',
|
|
105
|
+
// Unique to this object
|
|
35
106
|
agoric: 'agoric',
|
|
36
107
|
noble: 'noble',
|
|
37
108
|
// XXX: check privateArgs for chainInfo for all of these
|
|
38
109
|
});
|
|
39
110
|
harden(SupportedChain);
|
|
40
111
|
|
|
112
|
+
/** @type {(eip155ChainId: bigint) => CaipChainId} */
|
|
113
|
+
const caipChainIdFromEip155 = chainId => `eip155:${chainId}`;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* cf. https://standards.chainagnostic.org/CAIPs/caip-2
|
|
117
|
+
* Please keep in sync with ../../../services/ymax-planner/src/support.ts `spectrumChainIds`
|
|
118
|
+
*
|
|
119
|
+
* XXX this probably belongs in @agoric/orchestration
|
|
120
|
+
*
|
|
121
|
+
* @type {Readonly<Record<ClusterName, Readonly<Partial<Record<SupportedChain, CaipChainId>>>>>}
|
|
122
|
+
*/
|
|
123
|
+
export const CaipChainIds = {
|
|
124
|
+
mainnet: {
|
|
125
|
+
...objectMap(Eip155ChainIds.mainnet, caipChainIdFromEip155),
|
|
126
|
+
agoric: 'cosmos:agoric-3',
|
|
127
|
+
noble: 'cosmos:noble-1',
|
|
128
|
+
},
|
|
129
|
+
testnet: {
|
|
130
|
+
...objectMap(Eip155ChainIds.testnet, caipChainIdFromEip155),
|
|
131
|
+
agoric: 'cosmos:agoricdev-25',
|
|
132
|
+
noble: 'cosmos:grand-1',
|
|
133
|
+
},
|
|
134
|
+
local: {
|
|
135
|
+
...objectMap(Eip155ChainIds.local, caipChainIdFromEip155),
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
harden(CaipChainIds);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* cf. https://developers.circle.com/stablecoins/usdc-contract-addresses
|
|
142
|
+
* XXX this might belong in @agoric/orchestration
|
|
143
|
+
* @type {Readonly<Record<ClusterName, Readonly<Partial<Record<SupportedChain, string>>>>>}
|
|
144
|
+
*/
|
|
145
|
+
export const UsdcTokenIds = {
|
|
146
|
+
mainnet: {
|
|
147
|
+
Arbitrum: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
|
|
148
|
+
Avalanche: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E',
|
|
149
|
+
Base: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
150
|
+
Ethereum: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
|
|
151
|
+
Optimism: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
|
|
152
|
+
agoric:
|
|
153
|
+
'ibc/FE98AAD68F02F03565E9FA39A5E627946699B2B07115889ED812D8BA639576A9',
|
|
154
|
+
noble: 'usdc',
|
|
155
|
+
},
|
|
156
|
+
testnet: {
|
|
157
|
+
Arbitrum: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // Sepolia
|
|
158
|
+
Avalanche: '0x5425890298aed601595a70AB815c96711a31Bc65', // Fuji
|
|
159
|
+
Base: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // Sepolia
|
|
160
|
+
Ethereum: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // Sepolia
|
|
161
|
+
Optimism: '0x5fd84259d66Cd46123540766Be93DFE6D43130D7', // Sepolia
|
|
162
|
+
agoric:
|
|
163
|
+
'ibc/75F84596DDE9EE93010620701FFED959F3FFA1D0979F6773DE994FFEEA7D32F3',
|
|
164
|
+
noble: 'usdc',
|
|
165
|
+
},
|
|
166
|
+
local: {},
|
|
167
|
+
};
|
|
168
|
+
harden(UsdcTokenIds);
|
|
169
|
+
|
|
41
170
|
/**
|
|
42
171
|
* Strategies for portfolio rebalancing of bulk deposits.
|
|
43
172
|
*
|
|
@@ -56,3 +185,31 @@ export const RebalanceStrategy = /** @type {const} */ ({
|
|
|
56
185
|
PreserveExistingProportions: 'pep',
|
|
57
186
|
});
|
|
58
187
|
harden(RebalanceStrategy);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Treat account deltas smaller than this value (in micro-units) as dust.
|
|
191
|
+
* This corresponds to 100 uusdc, i.e., $0.0001 for USDC.
|
|
192
|
+
*/
|
|
193
|
+
export const ACCOUNT_DUST_EPSILON = 100n;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Feature flags to handle contract upgrade flow compatibility.
|
|
197
|
+
* @type {TypedPattern<FlowConfig['features']>}
|
|
198
|
+
*/
|
|
199
|
+
export const FlowFeaturesShape = M.splitRecord(
|
|
200
|
+
{},
|
|
201
|
+
{
|
|
202
|
+
useProgressTracker: M.boolean(),
|
|
203
|
+
},
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Configuration options for flows.
|
|
208
|
+
* @type {TypedPattern<FlowConfig>}
|
|
209
|
+
*/
|
|
210
|
+
export const FlowConfigShape = M.splitRecord(
|
|
211
|
+
{},
|
|
212
|
+
{
|
|
213
|
+
features: FlowFeaturesShape,
|
|
214
|
+
},
|
|
215
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|