@agoric/portfolio-api 0.1.1-dev-0e3d0e8.0.0e3d0e8 → 0.1.1-dev-a1aec5d.0.a1aec5d
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/README.md +38 -0
- package/package.json +19 -4
- package/src/evm-wallet/eip712-messages.d.ts +48 -0
- package/src/evm-wallet/eip712-messages.d.ts.map +1 -1
- package/src/evm-wallet/eip712-messages.js +16 -0
- package/src/evm-wallet/message-handler-helpers.d.ts +2 -2
- package/src/evm-wallet/message-handler-helpers.d.ts.map +1 -1
- package/src/main.d.ts +3 -0
- package/src/main.js +3 -0
- package/src/network/network-spec.d.ts +88 -0
- package/src/network/network-spec.d.ts.map +1 -0
- package/src/network/network-spec.js +115 -0
- package/src/network/prod-network.d.ts +4 -0
- package/src/network/prod-network.d.ts.map +1 -0
- package/src/network/prod-network.js +399 -0
- package/src/places.d.ts +289 -0
- package/src/places.d.ts.map +1 -0
- package/src/places.js +190 -0
- package/src/portfolio-permissions.d.ts +29 -0
- package/src/portfolio-permissions.d.ts.map +1 -0
- package/src/portfolio-permissions.js +33 -0
- package/src/target-balances.d.ts +42 -0
- package/src/target-balances.d.ts.map +1 -0
- package/src/target-balances.js +394 -0
- package/src/type-guards.d.ts +6 -8
- package/src/type-guards.d.ts.map +1 -1
- package/src/type-guards.js +17 -13
- package/src/types-index.d.ts +2 -0
- package/src/types.d.ts +22 -0
- package/src/types.d.ts.map +1 -1
- package/src/types.js +29 -0
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
1
|
# Portfolio management API
|
|
2
2
|
|
|
3
3
|
API shared between on-chain contract and external clients
|
|
4
|
+
|
|
5
|
+
## YDS Target Balances
|
|
6
|
+
|
|
7
|
+
The YMax Data Service (YDS) should import the shared target-balance helper and
|
|
8
|
+
production network data from this public package. `@agoric/portfolio-api`
|
|
9
|
+
participates in the repo's after-merge canary publish flow, so production
|
|
10
|
+
network changes can propagate without waiting for `@aglocal/portfolio-contract`
|
|
11
|
+
packaging.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { computeTargetBalances } from '@agoric/portfolio-api/src/target-balances.js';
|
|
15
|
+
import { PROD_NETWORK } from '@agoric/portfolio-api/src/network/prod-network.js';
|
|
16
|
+
|
|
17
|
+
const changedTargets = computeTargetBalances({
|
|
18
|
+
brand: usdcBrand,
|
|
19
|
+
currentBalances,
|
|
20
|
+
balanceDelta,
|
|
21
|
+
targetAllocation,
|
|
22
|
+
network: PROD_NETWORK,
|
|
23
|
+
depositFromChain,
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`changedTargets` contains only balances that need to change. Use signed
|
|
28
|
+
minor-unit deltas: positive for deposits, negative for withdrawals, and `0n` for
|
|
29
|
+
rebalances.
|
|
30
|
+
|
|
31
|
+
Relevant explicit `package.json` subpath exports are:
|
|
32
|
+
|
|
33
|
+
- `./src/target-balances.js`
|
|
34
|
+
- `./src/network/prod-network.js`
|
|
35
|
+
- `./src/network/network-spec.js`
|
|
36
|
+
- `./src/places.js`
|
|
37
|
+
- `./src/type-guards.js`
|
|
38
|
+
- `./src/evm-wallet/eip712-messages.js`
|
|
39
|
+
- `./src/evm-wallet/message-handler-helpers.js`
|
|
40
|
+
|
|
41
|
+
Keep importing the `.js` subpaths so the same source works after packaging.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/portfolio-api",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-a1aec5d.0.a1aec5d",
|
|
4
4
|
"description": "API for Portfolio management",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,6 +12,21 @@
|
|
|
12
12
|
"tools"
|
|
13
13
|
],
|
|
14
14
|
"main": "src/main.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./src/main.js",
|
|
17
|
+
"./src/constants.js": "./src/constants.js",
|
|
18
|
+
"./src/evm-wallet/eip712-messages.js": "./src/evm-wallet/eip712-messages.js",
|
|
19
|
+
"./src/evm-wallet/message-handler-helpers.js": "./src/evm-wallet/message-handler-helpers.js",
|
|
20
|
+
"./src/network/network-spec.js": "./src/network/network-spec.js",
|
|
21
|
+
"./src/network/prod-network.js": "./src/network/prod-network.js",
|
|
22
|
+
"./src/places.js": "./src/places.js",
|
|
23
|
+
"./src/portfolio-permissions.js": "./src/portfolio-permissions.js",
|
|
24
|
+
"./src/portfolio-constants.js": "./src/portfolio-constants.js",
|
|
25
|
+
"./src/resolver.js": "./src/resolver.js",
|
|
26
|
+
"./src/target-balances.js": "./src/target-balances.js",
|
|
27
|
+
"./src/type-guards.js": "./src/type-guards.js",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
15
30
|
"bin": "./src/cli/bin.js",
|
|
16
31
|
"scripts": {
|
|
17
32
|
"build": "exit 0",
|
|
@@ -31,8 +46,8 @@
|
|
|
31
46
|
"generate:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts"
|
|
32
47
|
},
|
|
33
48
|
"dependencies": {
|
|
34
|
-
"@agoric/internal": "0.3.3-dev-
|
|
35
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
49
|
+
"@agoric/internal": "0.3.3-dev-a1aec5d.0.a1aec5d",
|
|
50
|
+
"@agoric/orchestration": "0.1.1-dev-a1aec5d.0.a1aec5d",
|
|
36
51
|
"@endo/common": "^1.2.13",
|
|
37
52
|
"@endo/errors": "^1.2.13",
|
|
38
53
|
"@endo/patterns": "^1.7.0"
|
|
@@ -73,5 +88,5 @@
|
|
|
73
88
|
"engines": {
|
|
74
89
|
"node": "^20.9 || ^22.11"
|
|
75
90
|
},
|
|
76
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "a1aec5d051c63a8e50dc28e6137b3b3a50b0902c"
|
|
77
92
|
}
|
|
@@ -84,6 +84,25 @@ declare const OperationTypes: {
|
|
|
84
84
|
readonly name: "portfolio";
|
|
85
85
|
readonly type: "uint256";
|
|
86
86
|
}];
|
|
87
|
+
/**
|
|
88
|
+
* Grant portfolio permissions on a portfolio to another Agoric address
|
|
89
|
+
* (e.g. an automation agent). The contract delivers an invitation whose
|
|
90
|
+
* redeemed result can be saved in the grantee's wallet store and used via
|
|
91
|
+
* wallet invocation.
|
|
92
|
+
*
|
|
93
|
+
* - accountHolder: bech32 Agoric address that will receive the invitation
|
|
94
|
+
* - permissions: encoded portfolio permissions (see PortfolioPermissions)
|
|
95
|
+
*/
|
|
96
|
+
readonly Grant: readonly [{
|
|
97
|
+
readonly name: "accountHolder";
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
}, {
|
|
100
|
+
readonly name: "permissions";
|
|
101
|
+
readonly type: "PortfolioPermissions";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "portfolio";
|
|
104
|
+
readonly type: "uint256";
|
|
105
|
+
}];
|
|
87
106
|
};
|
|
88
107
|
type OperationTypes = typeof OperationTypes;
|
|
89
108
|
export type OperationTypeNames = keyof OperationTypes;
|
|
@@ -102,6 +121,11 @@ declare const OperationSubTypes: {
|
|
|
102
121
|
readonly name: "amount";
|
|
103
122
|
readonly type: "uint256";
|
|
104
123
|
}];
|
|
124
|
+
/** @see {@link PortfolioPermissions} */
|
|
125
|
+
readonly PortfolioPermissions: readonly [{
|
|
126
|
+
readonly name: "allocation";
|
|
127
|
+
readonly type: "bool";
|
|
128
|
+
}];
|
|
105
129
|
};
|
|
106
130
|
/**
|
|
107
131
|
* Target allocation for portfolio positions.
|
|
@@ -175,6 +199,25 @@ export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(opera
|
|
|
175
199
|
readonly name: "portfolio";
|
|
176
200
|
readonly type: "uint256";
|
|
177
201
|
}];
|
|
202
|
+
/**
|
|
203
|
+
* Grant portfolio permissions on a portfolio to another Agoric address
|
|
204
|
+
* (e.g. an automation agent). The contract delivers an invitation whose
|
|
205
|
+
* redeemed result can be saved in the grantee's wallet store and used via
|
|
206
|
+
* wallet invocation.
|
|
207
|
+
*
|
|
208
|
+
* - accountHolder: bech32 Agoric address that will receive the invitation
|
|
209
|
+
* - permissions: encoded portfolio permissions (see PortfolioPermissions)
|
|
210
|
+
*/
|
|
211
|
+
readonly Grant: readonly [{
|
|
212
|
+
readonly name: "accountHolder";
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
}, {
|
|
215
|
+
readonly name: "permissions";
|
|
216
|
+
readonly type: "PortfolioPermissions";
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "portfolio";
|
|
219
|
+
readonly type: "uint256";
|
|
220
|
+
}];
|
|
178
221
|
}[K]; } & {
|
|
179
222
|
readonly Allocation: readonly [{
|
|
180
223
|
readonly name: "instrument";
|
|
@@ -190,6 +233,11 @@ export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(opera
|
|
|
190
233
|
readonly name: "amount";
|
|
191
234
|
readonly type: "uint256";
|
|
192
235
|
}];
|
|
236
|
+
/** @see {@link PortfolioPermissions} */
|
|
237
|
+
readonly PortfolioPermissions: readonly [{
|
|
238
|
+
readonly name: "allocation";
|
|
239
|
+
readonly type: "bool";
|
|
240
|
+
}];
|
|
193
241
|
};
|
|
194
242
|
export declare const getYmaxWitness: <T extends OperationTypeNames>(operation: T, data: NoInfer<YmaxWitnessData<T>>) => Witness<YmaxWitnessTypes<T>, YmaxWitnessTypeParam<T>>;
|
|
195
243
|
export declare const getYmaxStandaloneDomain: (chainId: bigint | number, verifyingContract: Address) => YmaxFullDomain;
|
|
@@ -1 +1 @@
|
|
|
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;AAChD,OAAO,KAAK,EAAE,kBA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tB,OAAO,CAAC,MAAM,IAAI,OAAO,wBAAwB,CAWnD;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,sBAAsB,CAAC,EACnB,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC,GACzC,SAAS,GACZ,OAAO,CAAC,MAAM,IAAI,cAAc,CA+BlC;AAED,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,kBAAkB,EACxE,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,IAAI,CAAC,CAMvB;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,kBAAkB,EAChE,WAAW,GAAG,OAAO,gBAAgB,IAAI,OAAO,mBAAmB,GAAG,CAAC,EAAE;;;;;;CAqB1E,CAAC"}
|
|
@@ -84,6 +84,20 @@ const OperationTypes = {
|
|
|
84
84
|
* - token: ERC-20 token contract address (must be USDC contract on the destination chain)
|
|
85
85
|
*/
|
|
86
86
|
Withdraw: [{ name: 'withdraw', type: 'Asset' }, PortfolioIdParam],
|
|
87
|
+
/**
|
|
88
|
+
* Grant portfolio permissions on a portfolio to another Agoric address
|
|
89
|
+
* (e.g. an automation agent). The contract delivers an invitation whose
|
|
90
|
+
* redeemed result can be saved in the grantee's wallet store and used via
|
|
91
|
+
* wallet invocation.
|
|
92
|
+
*
|
|
93
|
+
* - accountHolder: bech32 Agoric address that will receive the invitation
|
|
94
|
+
* - permissions: encoded portfolio permissions (see PortfolioPermissions)
|
|
95
|
+
*/
|
|
96
|
+
Grant: [
|
|
97
|
+
{ name: 'accountHolder', type: 'string' },
|
|
98
|
+
{ name: 'permissions', type: 'PortfolioPermissions' },
|
|
99
|
+
PortfolioIdParam,
|
|
100
|
+
],
|
|
87
101
|
} ;
|
|
88
102
|
;
|
|
89
103
|
;
|
|
@@ -94,6 +108,8 @@ const OperationSubTypes = {
|
|
|
94
108
|
{ name: 'portion', type: 'uint256' },
|
|
95
109
|
],
|
|
96
110
|
Asset: TokenPermissionsComponents,
|
|
111
|
+
/** @see {@link PortfolioPermissions} */
|
|
112
|
+
PortfolioPermissions: [{ name: 'allocation', type: 'bool' }],
|
|
97
113
|
} ;
|
|
98
114
|
|
|
99
115
|
/**
|
|
@@ -64,13 +64,13 @@ export declare const makeEVMHandlerUtils: (viemUtils: {
|
|
|
64
64
|
domain: Permit2Domain;
|
|
65
65
|
}, owner: Address, signature: WithSignature<object>["signature"]): PermitDetails;
|
|
66
66
|
};
|
|
67
|
-
extractOperationDetailsFromDataWithAddress: <T extends OperationTypeNames = "Withdraw" | "Deposit" | "Rebalance" | "OpenPortfolio" | "SetTargetAllocation">(data: (WithSignature<YmaxPermitWitnessTransferFromData<T>> | YmaxStandaloneOperationData<T>) & {
|
|
67
|
+
extractOperationDetailsFromDataWithAddress: <T extends OperationTypeNames = "Withdraw" | "Deposit" | "Rebalance" | "OpenPortfolio" | "SetTargetAllocation" | "Grant">(data: (WithSignature<YmaxPermitWitnessTransferFromData<T>> | YmaxStandaloneOperationData<T>) & {
|
|
68
68
|
address: Address;
|
|
69
69
|
}, contractAddresses?: {
|
|
70
70
|
permit2?: Partial<Record<number | string, Address>>;
|
|
71
71
|
ymaxRepresentative?: Partial<Record<number | string, Address>>;
|
|
72
72
|
}) => FullMessageDetails<T>;
|
|
73
|
-
extractOperationDetailsFromSignedData: <T extends OperationTypeNames = "Withdraw" | "Deposit" | "Rebalance" | "OpenPortfolio" | "SetTargetAllocation">(signedData: WithSignature<YmaxPermitWitnessTransferFromData<T> | YmaxStandaloneOperationData<T>> & {
|
|
73
|
+
extractOperationDetailsFromSignedData: <T extends OperationTypeNames = "Withdraw" | "Deposit" | "Rebalance" | "OpenPortfolio" | "SetTargetAllocation" | "Grant">(signedData: WithSignature<YmaxPermitWitnessTransferFromData<T> | YmaxStandaloneOperationData<T>> & {
|
|
74
74
|
address?: Address;
|
|
75
75
|
}, validYmaxRepresentativeContractAddresses?: Partial<Record<number | string, Address>>) => Promise<FullMessageDetails<T>>;
|
|
76
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-handler-helpers.d.ts","sourceRoot":"","sources":["message-handler-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,uBAAuB,EAEvB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,wCAAwC,EAC9C,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,iBAAiB,EAKtB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,oBAAoB,CAC9B,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IAC/C;KACD,CAAC,IAAI,CAAC,GAAG;QACR,SAAS,EAAE,CAAC,CAAC;QACb,MAAM,EAAE,cAAc,CAAC;QACvB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;KAC5B;CACF,CAAC,CAAC,CAAC,CAAC;AAEL,MAAM,MAAM,gCAAgC,GAAG,2BAA2B,CAAC;IACzE,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,wCAAwC,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,IAAI,CAAC,gCAAgC,EAAE,iBAA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AAE,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC;SAC/C,GACA,aAAa;SACf,CAAC,SAAS,kBAAkB,QACrB,IAAI,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;YAC3D,MAAM,EAAE,aAAa,CAAC;SACvB,SACM,OAAO,aACH,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,GAC5C,aAAa;;iDA+FhB,CAAC,SAAS,kBAAkB,mGAEtB,CACF,aAAa,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC,GACnD,2BAA2B,CAAC,CAAC,CAAC,CACjC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,sBACL;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAChE,KACA,kBAAkB,CAAC,CAAC,CAAC;4CAiGtB,CAAC,SAAS,kBAAkB,yGAEhB,aAAa,CACvB,iCAAiC,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,CACtE,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,6CACkB,OAAO,CAChD,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CACjC,KACA,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CA0BlC,CAAC"}
|
package/src/main.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from "./constants.js";
|
|
2
2
|
export * from "./instruments.js";
|
|
3
|
+
export * from "./network/prod-network.js";
|
|
4
|
+
export * from "./portfolio-permissions.js";
|
|
3
5
|
export * from "./resolver.js";
|
|
6
|
+
export * from "./target-balances.js";
|
|
4
7
|
export * from "./type-guards.js";
|
|
5
8
|
export * from "./types-index.js";
|
|
6
9
|
//# sourceMappingURL=main.d.ts.map
|
package/src/main.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './constants.js';
|
|
2
2
|
export * from './instruments.js';
|
|
3
|
+
export * from './network/prod-network.js';
|
|
4
|
+
export * from './portfolio-permissions.js';
|
|
3
5
|
export * from './resolver.js';
|
|
6
|
+
export * from './target-balances.js';
|
|
4
7
|
export * from './type-guards.js';
|
|
5
8
|
|
|
6
9
|
// eslint-disable-next-line import/export -- just types
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { NatValue } from '@agoric/ertp';
|
|
2
|
+
import type { SupportedChain, YieldProtocol } from '../constants.js';
|
|
3
|
+
import type { InstrumentId } from '../instruments.js';
|
|
4
|
+
import type { AssetPlaceRef } from '../types.js';
|
|
5
|
+
export type ControlProtocol = 'ibc' | 'axelar' | 'local';
|
|
6
|
+
export type TransferProtocol = 'ibc' | 'fastusdc' | 'cctpFromNoble' | 'cctpToNoble' | 'cctpV2' | 'local';
|
|
7
|
+
/**
|
|
8
|
+
* Link to Factory and Wallet contracts:
|
|
9
|
+
* https://github.com/agoric-labs/agoric-to-axelar-local/blob/cd6087fa44de3b019b2cdac6962bb49b6a2bc1ca/packages/axelar-local-dev-cosmos/src/__tests__/contracts/Factory.sol
|
|
10
|
+
*
|
|
11
|
+
* Steps submitted to the contract are expected to include fee/gas payment
|
|
12
|
+
* details which vary by the traversed link.
|
|
13
|
+
* - toUSDN: transferring into USDN transfer reduces the *payload* (e.g., $10k
|
|
14
|
+
* might get reduced to $9995)
|
|
15
|
+
* - makeEvmAccount: the fee for executing the Factory contract to create a new
|
|
16
|
+
* remote wallet
|
|
17
|
+
* - evmToNoble: the fee for running the tx to send tokens from the remote
|
|
18
|
+
* wallet to Noble
|
|
19
|
+
* - evmToPool: the fee for sending and executing a tx on the Wallet contract
|
|
20
|
+
* to supply tokens to a specified pool
|
|
21
|
+
* - poolToEvm: the fee for sending and executing a tx on the Wallet contract
|
|
22
|
+
* to withdraw tokens from a specified pool
|
|
23
|
+
*/
|
|
24
|
+
export type FeeMode = 'toUSDN' | 'makeEvmAccount' | 'evmToNoble' | 'evmToPool' | 'poolToEvm' | 'evmToEvm';
|
|
25
|
+
export interface ChainSpec {
|
|
26
|
+
readonly name: SupportedChain;
|
|
27
|
+
/** how agoric reaches this chain: 'ibc' (noble) or 'axelar' (EVM) or 'local' */
|
|
28
|
+
readonly control: ControlProtocol;
|
|
29
|
+
/** minimum delta amount for planned moves involving this chain */
|
|
30
|
+
readonly deltaSoftMin?: NatValue;
|
|
31
|
+
}
|
|
32
|
+
type BlockWithdrawReason = 'LOW_LIQUIDITY';
|
|
33
|
+
type BlockDepositReason = BlockWithdrawReason | 'AT_CAPACITY';
|
|
34
|
+
export type PoolKey = InstrumentId;
|
|
35
|
+
export interface PoolSpec {
|
|
36
|
+
readonly pool: PoolKey;
|
|
37
|
+
/** host chain of the corresponding instrument */
|
|
38
|
+
readonly chain: SupportedChain;
|
|
39
|
+
/** protocol of the corresponding instrument */
|
|
40
|
+
readonly protocol: YieldProtocol;
|
|
41
|
+
/** when increases are unavailable, the (primary) reason why */
|
|
42
|
+
readonly blockDepositReason?: BlockDepositReason;
|
|
43
|
+
/** when decreases are unavailable, the (primary) reason why */
|
|
44
|
+
readonly blockWithdrawReason?: BlockWithdrawReason;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A +agoric local account or <Deposit>/<Cash> Agoric blockchain contract seat.
|
|
48
|
+
*/
|
|
49
|
+
export interface LocalPlaceSpec {
|
|
50
|
+
readonly id: '<Deposit>' | '<Cash>' | '+agoric';
|
|
51
|
+
readonly chain: 'agoric';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A directed edge from one place to another, usually having at least one hub
|
|
55
|
+
* endpoint.
|
|
56
|
+
*/
|
|
57
|
+
export interface LinkSpec {
|
|
58
|
+
readonly src: AssetPlaceRef;
|
|
59
|
+
readonly dest: AssetPlaceRef;
|
|
60
|
+
/**
|
|
61
|
+
* variable transfer fee in basis points to be applied against the transferred
|
|
62
|
+
* amount of major units (e.g., USDC)
|
|
63
|
+
*/
|
|
64
|
+
readonly variableFeeBps: number;
|
|
65
|
+
/** flat-rate transfer fee in minor units (e.g., uusdc) */
|
|
66
|
+
readonly flatFee?: NatValue;
|
|
67
|
+
/** expected transfer settlement time in seconds */
|
|
68
|
+
readonly timeSec: number;
|
|
69
|
+
/** inclusive maximum transfer amount in minor units (e.g., uusdc) */
|
|
70
|
+
readonly capacity?: NatValue;
|
|
71
|
+
/** inclusive minimum transfer amount in minor units (e.g., uusdc) */
|
|
72
|
+
readonly min?: NatValue;
|
|
73
|
+
/** mechanism by which the transfer occurs */
|
|
74
|
+
readonly transfer: TransferProtocol;
|
|
75
|
+
/** designator for how fees apply to transactions over this link */
|
|
76
|
+
readonly feeMode?: FeeMode;
|
|
77
|
+
}
|
|
78
|
+
/** Details of how chains/pools/etc. and how they connect. */
|
|
79
|
+
export interface NetworkSpec {
|
|
80
|
+
readonly debug?: boolean;
|
|
81
|
+
readonly environment?: 'dev' | 'test' | 'prod';
|
|
82
|
+
readonly chains: ChainSpec[];
|
|
83
|
+
readonly pools: PoolSpec[];
|
|
84
|
+
readonly localPlaces?: LocalPlaceSpec[];
|
|
85
|
+
readonly links: LinkSpec[];
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=network-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-spec.d.ts","sourceRoot":"","sources":["network-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,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AC,IAAI,EAAE,aAAa,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAE5B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;IAExB,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,6DAA6D;AAC7D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IAE/C,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// Control and transfer planes
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Link to Factory and Wallet contracts:
|
|
17
|
+
* https://github.com/agoric-labs/agoric-to-axelar-local/blob/cd6087fa44de3b019b2cdac6962bb49b6a2bc1ca/packages/axelar-local-dev-cosmos/src/__tests__/contracts/Factory.sol
|
|
18
|
+
*
|
|
19
|
+
* Steps submitted to the contract are expected to include fee/gas payment
|
|
20
|
+
* details which vary by the traversed link.
|
|
21
|
+
* - toUSDN: transferring into USDN transfer reduces the *payload* (e.g., $10k
|
|
22
|
+
* might get reduced to $9995)
|
|
23
|
+
* - makeEvmAccount: the fee for executing the Factory contract to create a new
|
|
24
|
+
* remote wallet
|
|
25
|
+
* - evmToNoble: the fee for running the tx to send tokens from the remote
|
|
26
|
+
* wallet to Noble
|
|
27
|
+
* - evmToPool: the fee for sending and executing a tx on the Wallet contract
|
|
28
|
+
* to supply tokens to a specified pool
|
|
29
|
+
* - poolToEvm: the fee for sending and executing a tx on the Wallet contract
|
|
30
|
+
* to withdraw tokens from a specified pool
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// Chains (hubs)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// Any reason to block withdrawal is by extension also a reason to block
|
|
50
|
+
// deposit.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// Pools (leaves)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A +agoric local account or <Deposit>/<Cash> Agoric blockchain contract seat.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A directed edge from one place to another, usually having at least one hub
|
|
79
|
+
* endpoint.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
/** Details of how chains/pools/etc. and how they connect. */
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prod-network.d.ts","sourceRoot":"","sources":["prod-network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAerD,eAAO,MAAM,YAAY,EAAE,WA6XzB,CAAC;AAEH,eAAe,YAAY,CAAC"}
|