@agoric/portfolio-api 0.1.1-dev-a06b4b8.0.a06b4b8 → 0.1.1-dev-b5701cc.0.b5701cc
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/evm/types.d.ts +17 -0
- package/src/evm/types.d.ts.map +1 -0
- package/src/evm/types.ts +22 -0
- package/src/evm-wallet/message-handler-helpers.d.ts +22 -12
- package/src/evm-wallet/message-handler-helpers.d.ts.map +1 -1
- package/src/evm-wallet/message-handler-helpers.ts +72 -24
- package/src/types.d.ts +4 -0
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +4 -0
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-b5701cc.0.b5701cc",
|
|
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.3.3-dev-
|
|
31
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
30
|
+
"@agoric/internal": "0.3.3-dev-b5701cc.0.b5701cc",
|
|
31
|
+
"@agoric/orchestration": "0.1.1-dev-b5701cc.0.b5701cc",
|
|
32
32
|
"@endo/common": "^1.2.13",
|
|
33
33
|
"@endo/patterns": "^1.7.0"
|
|
34
34
|
},
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": "^20.9 || ^22.11"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "b5701cce70cc42c0e230240bc6ca7ad7b20a24a5"
|
|
69
69
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type PortfolioPath = `published.ymax${0 | 1}.portfolios.portfolio${number}`;
|
|
2
|
+
export type EIPMessageUpdate = {
|
|
3
|
+
updated: 'messageUpdate';
|
|
4
|
+
nonce: bigint;
|
|
5
|
+
status: 'pending';
|
|
6
|
+
} | {
|
|
7
|
+
updated: 'messageUpdate';
|
|
8
|
+
nonce: bigint;
|
|
9
|
+
error: string;
|
|
10
|
+
status: 'error';
|
|
11
|
+
} | {
|
|
12
|
+
updated: 'messageUpdate';
|
|
13
|
+
nonce: bigint;
|
|
14
|
+
status: 'ok';
|
|
15
|
+
};
|
|
16
|
+
export type EVMWalletUpdate = EIPMessageUpdate | never;
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACvB,iBAAiB,CAAC,GAAG,CAAC,wBAAwB,MAAM,EAAE,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GACxB;IACE,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;CACnB,GACD;IACE,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB,GACD;IACE,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEN,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,KAAK,CAAC"}
|
package/src/evm/types.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PortfolioPath =
|
|
2
|
+
`published.ymax${0 | 1}.portfolios.portfolio${number}`;
|
|
3
|
+
|
|
4
|
+
export type EIPMessageUpdate =
|
|
5
|
+
| {
|
|
6
|
+
updated: 'messageUpdate';
|
|
7
|
+
nonce: bigint;
|
|
8
|
+
status: 'pending';
|
|
9
|
+
}
|
|
10
|
+
| {
|
|
11
|
+
updated: 'messageUpdate';
|
|
12
|
+
nonce: bigint;
|
|
13
|
+
error: string;
|
|
14
|
+
status: 'error';
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
updated: 'messageUpdate';
|
|
18
|
+
nonce: bigint;
|
|
19
|
+
status: 'ok';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type EVMWalletUpdate = EIPMessageUpdate | never;
|
|
@@ -5,31 +5,41 @@
|
|
|
5
5
|
* The viem runtime dependency is expected as a power to make this usable both
|
|
6
6
|
* on chain and in off-chain services.
|
|
7
7
|
*/
|
|
8
|
-
import type { Address, TypedDataDomain } from 'abitype';
|
|
9
|
-
import type {
|
|
10
|
-
import type { hashStruct, recoverTypedDataAddress, validateTypedData } from 'viem/utils';
|
|
8
|
+
import type { AbiParameterToPrimitiveType, Address, TypedDataDomain } from 'abitype';
|
|
9
|
+
import type { hashStruct, isHex, recoverTypedDataAddress, validateTypedData } from 'viem/utils';
|
|
11
10
|
import { encodeType, type WithSignature } from '@agoric/orchestration/src/utils/viem.ts';
|
|
12
|
-
import { type
|
|
11
|
+
import { type PermitWitnessTransferFromInputComponents } from '@agoric/orchestration/src/utils/permit2.ts';
|
|
13
12
|
import { type OperationTypeNames, type YmaxStandaloneOperationData, type YmaxPermitWitnessTransferFromData, type YmaxOperationType } from './eip712-messages.ts';
|
|
14
|
-
export type YmaxOperationDetails<T extends OperationTypeNames> = {
|
|
13
|
+
export type YmaxOperationDetails<T extends OperationTypeNames = OperationTypeNames> = {
|
|
15
14
|
[P in T]: {
|
|
16
15
|
operation: P;
|
|
17
16
|
data: YmaxOperationType<P>;
|
|
18
17
|
};
|
|
19
18
|
}[T];
|
|
20
|
-
export type
|
|
19
|
+
export type PermitWitnessTransferFromPayload = AbiParameterToPrimitiveType<{
|
|
20
|
+
type: 'tuple';
|
|
21
|
+
components: typeof PermitWitnessTransferFromInputComponents;
|
|
22
|
+
}>;
|
|
23
|
+
export type PermitDetails = {
|
|
21
24
|
chainId: NonNullable<TypedDataDomain['chainId']>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
token: Address;
|
|
26
|
+
amount: bigint;
|
|
27
|
+
spender: Address;
|
|
28
|
+
permit2Payload: Omit<PermitWitnessTransferFromPayload, 'transferDetails'>;
|
|
25
29
|
};
|
|
26
30
|
export type FullMessageDetails<T extends OperationTypeNames = OperationTypeNames> = YmaxOperationDetails<T> & {
|
|
27
|
-
|
|
31
|
+
permitDetails?: PermitDetails;
|
|
28
32
|
evmWalletAddress: Address;
|
|
29
33
|
nonce: bigint;
|
|
30
34
|
deadline: bigint;
|
|
31
35
|
};
|
|
32
|
-
|
|
36
|
+
/**
|
|
37
|
+
* EVM Message handler utils that depend on 'viem' utils for their
|
|
38
|
+
* implementation. Since on-chain we cannot directly import from 'viem',
|
|
39
|
+
* use a maker pattern to create these utils.
|
|
40
|
+
*/
|
|
41
|
+
export declare const makeEVMHandlerUtils: (viemUtils: {
|
|
42
|
+
isHex: typeof isHex;
|
|
33
43
|
hashStruct: typeof hashStruct;
|
|
34
44
|
recoverTypedDataAddress: typeof recoverTypedDataAddress;
|
|
35
45
|
validateTypedData: typeof validateTypedData;
|
|
@@ -37,7 +47,7 @@ export declare const makeEVMHandlerUtils: (powers: {
|
|
|
37
47
|
}) => {
|
|
38
48
|
extractOperationDetailsFromStandaloneData: <T extends OperationTypeNames>(data: YmaxStandaloneOperationData<T>) => YmaxOperationDetails<T>;
|
|
39
49
|
extractOperationDetailsFromPermit2WitnessData: <T extends OperationTypeNames>(data: YmaxPermitWitnessTransferFromData<T>) => YmaxOperationDetails<T>;
|
|
40
|
-
|
|
50
|
+
extractPermitDetails: <T extends OperationTypeNames>(data: YmaxPermitWitnessTransferFromData<T>, owner: Address, signature: WithSignature<object>["signature"]) => PermitDetails;
|
|
41
51
|
extractOperationDetailsFromSignedData: <T extends OperationTypeNames = "Deposit" | "Rebalance" | "OpenPortfolio">(signedData: WithSignature<YmaxPermitWitnessTransferFromData<T> | YmaxStandaloneOperationData<T>>) => Promise<FullMessageDetails<T>>;
|
|
42
52
|
};
|
|
43
53
|
//# sourceMappingURL=message-handler-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-handler-helpers.d.ts","sourceRoot":"","sources":["message-handler-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
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,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,uBAAuB,EAEvB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EACnB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAIL,KAAK,wCAAwC,EAC9C,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,iBAAiB,EAKvB,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,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;AA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AAC,CAAC,CAAC,CAAC;CAkDlC,CAAC"}
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
* on chain and in off-chain services.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
9
|
+
import type {
|
|
10
|
+
AbiParameterToPrimitiveType,
|
|
11
|
+
Address,
|
|
12
|
+
TypedDataDomain,
|
|
13
|
+
} from 'abitype';
|
|
11
14
|
import type {
|
|
12
15
|
hashStruct,
|
|
16
|
+
isHex,
|
|
13
17
|
recoverTypedDataAddress,
|
|
14
18
|
RecoverTypedDataAddressParameters,
|
|
15
19
|
validateTypedData,
|
|
@@ -22,7 +26,7 @@ import {
|
|
|
22
26
|
extractWitnessFieldFromTypes,
|
|
23
27
|
isPermit2MessageType,
|
|
24
28
|
makeWitnessTypeStringExtractor,
|
|
25
|
-
type
|
|
29
|
+
type PermitWitnessTransferFromInputComponents,
|
|
26
30
|
} from '@agoric/orchestration/src/utils/permit2.ts';
|
|
27
31
|
import {
|
|
28
32
|
type OperationTypeNames,
|
|
@@ -35,37 +39,56 @@ import {
|
|
|
35
39
|
getYmaxOperationTypes,
|
|
36
40
|
} from './eip712-messages.ts';
|
|
37
41
|
|
|
38
|
-
export type YmaxOperationDetails<
|
|
42
|
+
export type YmaxOperationDetails<
|
|
43
|
+
T extends OperationTypeNames = OperationTypeNames,
|
|
44
|
+
> = {
|
|
39
45
|
[P in T]: {
|
|
40
46
|
operation: P;
|
|
41
47
|
data: YmaxOperationType<P>;
|
|
42
48
|
};
|
|
43
49
|
}[T];
|
|
44
50
|
|
|
45
|
-
export type
|
|
51
|
+
export type PermitWitnessTransferFromPayload = AbiParameterToPrimitiveType<{
|
|
52
|
+
type: 'tuple';
|
|
53
|
+
components: typeof PermitWitnessTransferFromInputComponents;
|
|
54
|
+
}>;
|
|
55
|
+
|
|
56
|
+
export type PermitDetails = {
|
|
46
57
|
chainId: NonNullable<TypedDataDomain['chainId']>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
token: Address;
|
|
59
|
+
amount: bigint;
|
|
60
|
+
spender: Address;
|
|
61
|
+
permit2Payload: Omit<PermitWitnessTransferFromPayload, 'transferDetails'>;
|
|
50
62
|
};
|
|
51
63
|
|
|
52
64
|
export type FullMessageDetails<
|
|
53
65
|
T extends OperationTypeNames = OperationTypeNames,
|
|
54
66
|
> = YmaxOperationDetails<T> & {
|
|
55
|
-
|
|
67
|
+
permitDetails?: PermitDetails;
|
|
56
68
|
evmWalletAddress: Address;
|
|
57
69
|
nonce: bigint;
|
|
58
70
|
deadline: bigint;
|
|
59
71
|
};
|
|
60
72
|
|
|
61
|
-
|
|
73
|
+
/**
|
|
74
|
+
* EVM Message handler utils that depend on 'viem' utils for their
|
|
75
|
+
* implementation. Since on-chain we cannot directly import from 'viem',
|
|
76
|
+
* use a maker pattern to create these utils.
|
|
77
|
+
*/
|
|
78
|
+
export const makeEVMHandlerUtils = (viemUtils: {
|
|
79
|
+
isHex: typeof isHex;
|
|
62
80
|
hashStruct: typeof hashStruct;
|
|
63
81
|
recoverTypedDataAddress: typeof recoverTypedDataAddress;
|
|
64
82
|
validateTypedData: typeof validateTypedData;
|
|
65
83
|
encodeType: typeof encodeType;
|
|
66
84
|
}) => {
|
|
67
|
-
const {
|
|
68
|
-
|
|
85
|
+
const {
|
|
86
|
+
isHex,
|
|
87
|
+
hashStruct,
|
|
88
|
+
recoverTypedDataAddress,
|
|
89
|
+
validateTypedData,
|
|
90
|
+
encodeType,
|
|
91
|
+
} = viemUtils;
|
|
69
92
|
/**
|
|
70
93
|
* Extract operation type name and data from an EIP-712 standalone Ymax typed data
|
|
71
94
|
*
|
|
@@ -128,17 +151,27 @@ export const makeEVMHandlerUtils = (powers: {
|
|
|
128
151
|
* Extract the data that can be used as partial arguments to permit2's
|
|
129
152
|
* permitWitnessTransferFrom
|
|
130
153
|
*
|
|
154
|
+
* This does not verify the signature; that is expected to be done by the caller.
|
|
155
|
+
*
|
|
131
156
|
* @param data permit2 message with witness data to summarize
|
|
157
|
+
* @param owner address of the permit2 message signer
|
|
158
|
+
* @param signature signature of the permit2 message
|
|
132
159
|
*/
|
|
133
|
-
const
|
|
160
|
+
const extractPermitDetails = <T extends OperationTypeNames>(
|
|
134
161
|
data: YmaxPermitWitnessTransferFromData<T>,
|
|
135
|
-
|
|
162
|
+
owner: Address,
|
|
163
|
+
signature: WithSignature<object>['signature'],
|
|
164
|
+
): PermitDetails => {
|
|
136
165
|
const witnessTypeStringExtractor = makeWitnessTypeStringExtractor({
|
|
137
166
|
encodeType,
|
|
138
167
|
});
|
|
139
168
|
// @ts-expect-error generic/union type compatibility
|
|
140
169
|
const permitData: YmaxPermitWitnessTransferFromData = data;
|
|
141
170
|
|
|
171
|
+
if (!isHex(signature)) {
|
|
172
|
+
throw new Error(`Invalid signature format: ${signature}`);
|
|
173
|
+
}
|
|
174
|
+
|
|
142
175
|
const witnessField = extractWitnessFieldFromTypes(permitData.types);
|
|
143
176
|
const { [witnessField.name]: witnessData, ...permit } = permitData.message;
|
|
144
177
|
const witness = hashStruct({
|
|
@@ -148,14 +181,28 @@ export const makeEVMHandlerUtils = (powers: {
|
|
|
148
181
|
});
|
|
149
182
|
const witnessTypeString = witnessTypeStringExtractor(permitData.types);
|
|
150
183
|
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
184
|
+
const { spender, ...permitStruct } = permit;
|
|
185
|
+
|
|
186
|
+
const permit2Payload: Omit<
|
|
187
|
+
PermitWitnessTransferFromPayload,
|
|
188
|
+
'transferDetails'
|
|
189
|
+
> = {
|
|
190
|
+
permit: permitStruct,
|
|
191
|
+
owner,
|
|
154
192
|
witness,
|
|
155
193
|
witnessTypeString,
|
|
194
|
+
signature,
|
|
156
195
|
};
|
|
157
196
|
|
|
158
|
-
|
|
197
|
+
const details: PermitDetails = {
|
|
198
|
+
chainId: permitData.domain!.chainId!,
|
|
199
|
+
token: permit.permitted.token,
|
|
200
|
+
amount: permit.permitted.amount,
|
|
201
|
+
permit2Payload,
|
|
202
|
+
spender,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
return details;
|
|
159
206
|
};
|
|
160
207
|
|
|
161
208
|
/**
|
|
@@ -185,16 +232,17 @@ export const makeEVMHandlerUtils = (powers: {
|
|
|
185
232
|
const permit2Data =
|
|
186
233
|
signedData as unknown as YmaxPermitWitnessTransferFromData<T>;
|
|
187
234
|
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
235
|
+
const permitDetails = extractPermitDetails(
|
|
236
|
+
permit2Data,
|
|
237
|
+
tokenOwner,
|
|
238
|
+
signedData.signature,
|
|
239
|
+
);
|
|
192
240
|
const operationDetails =
|
|
193
241
|
extractOperationDetailsFromPermit2WitnessData(permit2Data);
|
|
194
242
|
|
|
195
243
|
return {
|
|
196
244
|
...operationDetails,
|
|
197
|
-
|
|
245
|
+
permitDetails,
|
|
198
246
|
evmWalletAddress: tokenOwner,
|
|
199
247
|
nonce,
|
|
200
248
|
deadline,
|
|
@@ -217,7 +265,7 @@ export const makeEVMHandlerUtils = (powers: {
|
|
|
217
265
|
return {
|
|
218
266
|
extractOperationDetailsFromStandaloneData,
|
|
219
267
|
extractOperationDetailsFromPermit2WitnessData,
|
|
220
|
-
|
|
268
|
+
extractPermitDetails,
|
|
221
269
|
extractOperationDetailsFromSignedData,
|
|
222
270
|
};
|
|
223
271
|
};
|
package/src/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type AccountId, type Bech32Address, type CosmosChainAddress, type Traff
|
|
|
3
3
|
import type { AxelarChain, SupportedChain, YieldProtocol } from './constants.js';
|
|
4
4
|
import type { InstrumentId } from './instruments.js';
|
|
5
5
|
import type { PublishedTx } from './resolver.js';
|
|
6
|
+
import type { EVMWalletUpdate, PortfolioPath } from './evm/types.ts';
|
|
6
7
|
/**
|
|
7
8
|
* Feature flags to handle contract upgrade flow compatibility.
|
|
8
9
|
*/
|
|
@@ -161,8 +162,11 @@ export type FlowKey = `flow${number}`;
|
|
|
161
162
|
export type StatusFor = {
|
|
162
163
|
contract: {
|
|
163
164
|
contractAccount: CosmosChainAddress['value'];
|
|
165
|
+
depositFactoryAddresses?: Record<AxelarChain, AccountId>;
|
|
164
166
|
};
|
|
165
167
|
pendingTx: PublishedTx;
|
|
168
|
+
evmWallet: EVMWalletUpdate;
|
|
169
|
+
evmWalletPortfolios: PortfolioPath[];
|
|
166
170
|
portfolios: {
|
|
167
171
|
addPortfolio: PortfolioKey;
|
|
168
172
|
};
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EA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,eAAe,CAAC;IAC3B,mBAAmB,EAAE,aAAa,EAAE,CAAC;IACrC,UAAU,EAAE;QACV,YAAY,EAAE,YAAY,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE;QACT,YAAY,EAAE,YAAY,EAAE,CAAC;QAC7B,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;QAC7D,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;QACnC,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,0FAA0F;QAC1F,sBAAsB,CAAC,EAAE,aAAa,CAAC;QACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QACpC,6GAA6G;QAC7G,aAAa,EAAE,MAAM,CAAC;QACtB,yGAAyG;QACzG,cAAc,EAAE,MAAM,CAAC;QACvB,2CAA2C;QAC3C,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;KAC5C,CAAC;IACF,QAAQ,EAAE;QACR,QAAQ,EAAE,aAAa,CAAC;QACxB,SAAS,EAAE,SAAS,CAAC;QACrB,OAAO,EAAE,SAAS,CAAC;QACnB,QAAQ,EAAE,SAAS,CAAC;KACrB,CAAC;IACF,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAC1C,SAAS,GACT,UAAU,GACV,WAAW,GACX,iBAAiB,CAAC"}
|
package/src/types.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
} from './constants.js';
|
|
18
18
|
import type { InstrumentId } from './instruments.js';
|
|
19
19
|
import type { PublishedTx } from './resolver.js';
|
|
20
|
+
import type { EVMWalletUpdate, PortfolioPath } from './evm/types.ts';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Feature flags to handle contract upgrade flow compatibility.
|
|
@@ -173,8 +174,11 @@ export type FlowKey = `flow${number}`;
|
|
|
173
174
|
export type StatusFor = {
|
|
174
175
|
contract: {
|
|
175
176
|
contractAccount: CosmosChainAddress['value'];
|
|
177
|
+
depositFactoryAddresses?: Record<AxelarChain, AccountId>;
|
|
176
178
|
};
|
|
177
179
|
pendingTx: PublishedTx;
|
|
180
|
+
evmWallet: EVMWalletUpdate;
|
|
181
|
+
evmWalletPortfolios: PortfolioPath[];
|
|
178
182
|
portfolios: {
|
|
179
183
|
addPortfolio: PortfolioKey;
|
|
180
184
|
};
|