@hyperlane-xyz/sdk 14.4.0 → 16.0.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/dist/aws/s3.d.ts.map +1 -1
- package/dist/aws/s3.js.map +1 -1
- package/dist/consts/multisigIsm.d.ts.map +1 -1
- package/dist/consts/multisigIsm.js +20 -6
- package/dist/consts/multisigIsm.js.map +1 -1
- package/dist/consts/testChains.d.ts +1 -0
- package/dist/consts/testChains.d.ts.map +1 -1
- package/dist/consts/testChains.js +8 -0
- package/dist/consts/testChains.js.map +1 -1
- package/dist/deploy/warp.d.ts +2 -1
- package/dist/deploy/warp.d.ts.map +1 -1
- package/dist/deploy/warp.js.map +1 -1
- package/dist/gas/token-prices.test.js +5 -7
- package/dist/gas/token-prices.test.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/ism/metadata/builder.hardhat-test.js +1 -1
- package/dist/ism/metadata/builder.hardhat-test.js.map +1 -1
- package/dist/ism/metadata/multisig.test.js +1 -1
- package/dist/ism/metadata/multisig.test.js.map +1 -1
- package/dist/metadata/customZodTypes.d.ts +2 -0
- package/dist/metadata/customZodTypes.d.ts.map +1 -1
- package/dist/metadata/customZodTypes.js +9 -0
- package/dist/metadata/customZodTypes.js.map +1 -1
- package/dist/middleware/account/InterchainAccount.d.ts +3 -4
- package/dist/middleware/account/InterchainAccount.d.ts.map +1 -1
- package/dist/middleware/account/InterchainAccount.js +8 -8
- package/dist/middleware/account/InterchainAccount.js.map +1 -1
- package/dist/middleware/query/queries.hardhat-test.js +1 -1
- package/dist/middleware/query/queries.hardhat-test.js.map +1 -1
- package/dist/providers/MultiProvider.d.ts +2 -2
- package/dist/providers/MultiProvider.d.ts.map +1 -1
- package/dist/providers/MultiProvider.js +4 -2
- package/dist/providers/MultiProvider.js.map +1 -1
- package/dist/providers/transactions/submitter/IcaTxSubmitter.d.ts +3 -3
- package/dist/providers/transactions/submitter/IcaTxSubmitter.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/IcaTxSubmitter.js +4 -5
- package/dist/providers/transactions/submitter/IcaTxSubmitter.js.map +1 -1
- package/dist/providers/transactions/submitter/TxSubmitterInterface.d.ts +2 -2
- package/dist/providers/transactions/submitter/TxSubmitterInterface.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/TxSubmitterTypes.d.ts +2 -1
- package/dist/providers/transactions/submitter/TxSubmitterTypes.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/TxSubmitterTypes.js +1 -0
- package/dist/providers/transactions/submitter/TxSubmitterTypes.js.map +1 -1
- package/dist/providers/transactions/submitter/builder/types.d.ts +23 -451
- package/dist/providers/transactions/submitter/builder/types.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/builder/types.js +67 -35
- package/dist/providers/transactions/submitter/builder/types.js.map +1 -1
- package/dist/providers/transactions/submitter/builder/types.test.js +40 -0
- package/dist/providers/transactions/submitter/builder/types.test.js.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.js +5 -2
- package/dist/providers/transactions/submitter/ethersV5/EV5ImpersonatedAccountTxSubmitter.js.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/EV5TimelockSubmitter.d.ts +21 -0
- package/dist/providers/transactions/submitter/ethersV5/EV5TimelockSubmitter.d.ts.map +1 -0
- package/dist/providers/transactions/submitter/ethersV5/EV5TimelockSubmitter.js +86 -0
- package/dist/providers/transactions/submitter/ethersV5/EV5TimelockSubmitter.js.map +1 -0
- package/dist/providers/transactions/submitter/ethersV5/types.d.ts +26 -2
- package/dist/providers/transactions/submitter/ethersV5/types.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/ethersV5/types.js +28 -2
- package/dist/providers/transactions/submitter/ethersV5/types.js.map +1 -1
- package/dist/providers/transactions/submitter/submitterBuilderGetter.d.ts +7 -7
- package/dist/providers/transactions/submitter/submitterBuilderGetter.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/submitterBuilderGetter.js +12 -7
- package/dist/providers/transactions/submitter/submitterBuilderGetter.js.map +1 -1
- package/dist/providers/transactions/submitter/types.d.ts +16 -262
- package/dist/providers/transactions/submitter/types.d.ts.map +1 -1
- package/dist/providers/transactions/submitter/types.js +1 -17
- package/dist/providers/transactions/submitter/types.js.map +1 -1
- package/dist/test/testUtils.d.ts +1 -0
- package/dist/test/testUtils.d.ts.map +1 -1
- package/dist/test/testUtils.js +6 -0
- package/dist/test/testUtils.js.map +1 -1
- package/dist/timelock/evm/EvmTimelockDeployer.d.ts +12 -0
- package/dist/timelock/evm/EvmTimelockDeployer.d.ts.map +1 -0
- package/dist/timelock/evm/EvmTimelockDeployer.hardhat-test.d.ts +2 -0
- package/dist/timelock/evm/EvmTimelockDeployer.hardhat-test.d.ts.map +1 -0
- package/dist/timelock/evm/EvmTimelockDeployer.hardhat-test.js +210 -0
- package/dist/timelock/evm/EvmTimelockDeployer.hardhat-test.js.map +1 -0
- package/dist/timelock/evm/EvmTimelockDeployer.js +68 -0
- package/dist/timelock/evm/EvmTimelockDeployer.js.map +1 -0
- package/dist/timelock/evm/constants.d.ts +5 -0
- package/dist/timelock/evm/constants.d.ts.map +1 -0
- package/dist/timelock/evm/constants.js +6 -0
- package/dist/timelock/evm/constants.js.map +1 -0
- package/dist/timelock/evm/contracts.d.ts +6 -0
- package/dist/timelock/evm/contracts.d.ts.map +1 -0
- package/dist/timelock/evm/contracts.js +5 -0
- package/dist/timelock/evm/contracts.js.map +1 -0
- package/dist/timelock/types.d.ts +42 -0
- package/dist/timelock/types.d.ts.map +1 -0
- package/dist/timelock/types.js +11 -0
- package/dist/timelock/types.js.map +1 -0
- package/dist/token/TokenStandard.d.ts.map +1 -1
- package/dist/token/TokenStandard.js +1 -0
- package/dist/token/TokenStandard.js.map +1 -1
- package/dist/token/adapters/EvmTokenAdapter.d.ts +3 -2
- package/dist/token/adapters/EvmTokenAdapter.d.ts.map +1 -1
- package/dist/token/adapters/EvmTokenAdapter.js +7 -1
- package/dist/token/adapters/EvmTokenAdapter.js.map +1 -1
- package/dist/token/adapters/ITokenAdapter.d.ts +3 -0
- package/dist/token/adapters/ITokenAdapter.d.ts.map +1 -1
- package/dist/token/adapters/StarknetTokenAdapter.js +1 -1
- package/dist/token/adapters/StarknetTokenAdapter.js.map +1 -1
- package/dist/token/types.d.ts +1 -1
- package/dist/utils/fork.d.ts +7 -3
- package/dist/utils/fork.d.ts.map +1 -1
- package/dist/utils/fork.js +7 -7
- package/dist/utils/fork.js.map +1 -1
- package/dist/utils/ism.d.ts +2 -1
- package/dist/utils/ism.d.ts.map +1 -1
- package/dist/utils/ism.js.map +1 -1
- package/dist/warp/WarpCore.d.ts.map +1 -1
- package/dist/warp/WarpCore.js +11 -3
- package/dist/warp/WarpCore.js.map +1 -1
- package/dist/warp/WarpCore.test.js +9 -0
- package/dist/warp/WarpCore.test.js.map +1 -1
- package/package.json +7 -12
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { ChainMap } from '../../../../types.js';
|
|
2
3
|
import { TxSubmitterType } from '../TxSubmitterTypes.js';
|
|
4
|
+
import { EvmIcaTxSubmitterProps } from '../ethersV5/types.js';
|
|
3
5
|
export declare const SubmissionStrategySchema: z.ZodObject<{
|
|
4
|
-
submitter: z.ZodUnion<[z.
|
|
6
|
+
submitter: z.ZodUnion<[z.ZodObject<{
|
|
5
7
|
chain: z.ZodString;
|
|
6
8
|
userAddress: z.ZodOptional<z.ZodString>;
|
|
7
9
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
@@ -58,129 +60,7 @@ export declare const SubmissionStrategySchema: z.ZodObject<{
|
|
|
58
60
|
chain: string;
|
|
59
61
|
safeAddress: string;
|
|
60
62
|
version?: string | undefined;
|
|
61
|
-
}
|
|
62
|
-
type: z.ZodLiteral<TxSubmitterType.INTERCHAIN_ACCOUNT>;
|
|
63
|
-
chain: z.ZodString;
|
|
64
|
-
owner: z.ZodString;
|
|
65
|
-
destinationChain: z.ZodString;
|
|
66
|
-
originInterchainAccountRouter: z.ZodOptional<z.ZodString>;
|
|
67
|
-
destinationInterchainAccountRouter: z.ZodOptional<z.ZodString>;
|
|
68
|
-
interchainSecurityModule: z.ZodOptional<z.ZodString>;
|
|
69
|
-
internalSubmitter: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
70
|
-
chain: z.ZodString;
|
|
71
|
-
userAddress: z.ZodOptional<z.ZodString>;
|
|
72
|
-
privateKey: z.ZodOptional<z.ZodString>;
|
|
73
|
-
type: z.ZodLiteral<TxSubmitterType.JSON_RPC>;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
type: TxSubmitterType.JSON_RPC;
|
|
76
|
-
chain: string;
|
|
77
|
-
userAddress?: string | undefined;
|
|
78
|
-
privateKey?: string | undefined;
|
|
79
|
-
}, {
|
|
80
|
-
type: TxSubmitterType.JSON_RPC;
|
|
81
|
-
chain: string;
|
|
82
|
-
userAddress?: string | undefined;
|
|
83
|
-
privateKey?: string | undefined;
|
|
84
|
-
}>, z.ZodObject<{
|
|
85
|
-
chain: z.ZodString;
|
|
86
|
-
privateKey: z.ZodOptional<z.ZodString>;
|
|
87
|
-
userAddress: z.ZodString;
|
|
88
|
-
type: z.ZodLiteral<TxSubmitterType.IMPERSONATED_ACCOUNT>;
|
|
89
|
-
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
91
|
-
chain: string;
|
|
92
|
-
userAddress: string;
|
|
93
|
-
privateKey?: string | undefined;
|
|
94
|
-
}, {
|
|
95
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
96
|
-
chain: string;
|
|
97
|
-
userAddress: string;
|
|
98
|
-
privateKey?: string | undefined;
|
|
99
|
-
}>, z.ZodObject<{
|
|
100
|
-
chain: z.ZodString;
|
|
101
|
-
safeAddress: z.ZodString;
|
|
102
|
-
type: z.ZodLiteral<TxSubmitterType.GNOSIS_SAFE>;
|
|
103
|
-
}, "strip", z.ZodTypeAny, {
|
|
104
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
105
|
-
chain: string;
|
|
106
|
-
safeAddress: string;
|
|
107
|
-
}, {
|
|
108
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
109
|
-
chain: string;
|
|
110
|
-
safeAddress: string;
|
|
111
|
-
}>, z.ZodObject<{
|
|
112
|
-
version: z.ZodDefault<z.ZodString>;
|
|
113
|
-
chain: z.ZodString;
|
|
114
|
-
safeAddress: z.ZodString;
|
|
115
|
-
type: z.ZodLiteral<TxSubmitterType.GNOSIS_TX_BUILDER>;
|
|
116
|
-
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
118
|
-
chain: string;
|
|
119
|
-
version: string;
|
|
120
|
-
safeAddress: string;
|
|
121
|
-
}, {
|
|
122
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
123
|
-
chain: string;
|
|
124
|
-
safeAddress: string;
|
|
125
|
-
version?: string | undefined;
|
|
126
|
-
}>]>;
|
|
127
|
-
}, "strip", z.ZodTypeAny, {
|
|
128
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
129
|
-
chain: string;
|
|
130
|
-
owner: string;
|
|
131
|
-
destinationChain: string;
|
|
132
|
-
internalSubmitter: {
|
|
133
|
-
type: TxSubmitterType.JSON_RPC;
|
|
134
|
-
chain: string;
|
|
135
|
-
userAddress?: string | undefined;
|
|
136
|
-
privateKey?: string | undefined;
|
|
137
|
-
} | {
|
|
138
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
139
|
-
chain: string;
|
|
140
|
-
userAddress: string;
|
|
141
|
-
privateKey?: string | undefined;
|
|
142
|
-
} | {
|
|
143
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
144
|
-
chain: string;
|
|
145
|
-
safeAddress: string;
|
|
146
|
-
} | {
|
|
147
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
148
|
-
chain: string;
|
|
149
|
-
version: string;
|
|
150
|
-
safeAddress: string;
|
|
151
|
-
};
|
|
152
|
-
originInterchainAccountRouter?: string | undefined;
|
|
153
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
154
|
-
interchainSecurityModule?: string | undefined;
|
|
155
|
-
}, {
|
|
156
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
157
|
-
chain: string;
|
|
158
|
-
owner: string;
|
|
159
|
-
destinationChain: string;
|
|
160
|
-
internalSubmitter: {
|
|
161
|
-
type: TxSubmitterType.JSON_RPC;
|
|
162
|
-
chain: string;
|
|
163
|
-
userAddress?: string | undefined;
|
|
164
|
-
privateKey?: string | undefined;
|
|
165
|
-
} | {
|
|
166
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
167
|
-
chain: string;
|
|
168
|
-
userAddress: string;
|
|
169
|
-
privateKey?: string | undefined;
|
|
170
|
-
} | {
|
|
171
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
172
|
-
chain: string;
|
|
173
|
-
safeAddress: string;
|
|
174
|
-
} | {
|
|
175
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
176
|
-
chain: string;
|
|
177
|
-
safeAddress: string;
|
|
178
|
-
version?: string | undefined;
|
|
179
|
-
};
|
|
180
|
-
originInterchainAccountRouter?: string | undefined;
|
|
181
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
182
|
-
interchainSecurityModule?: string | undefined;
|
|
183
|
-
}>]>;
|
|
63
|
+
}>, z.ZodType<EvmIcaTxSubmitterProps, z.ZodTypeDef, EvmIcaTxSubmitterProps>, z.ZodType<import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps, z.ZodTypeDef, import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps>]>;
|
|
184
64
|
}, "strict", z.ZodTypeAny, {
|
|
185
65
|
submitter: {
|
|
186
66
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -201,35 +81,7 @@ export declare const SubmissionStrategySchema: z.ZodObject<{
|
|
|
201
81
|
chain: string;
|
|
202
82
|
version: string;
|
|
203
83
|
safeAddress: string;
|
|
204
|
-
} |
|
|
205
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
206
|
-
chain: string;
|
|
207
|
-
owner: string;
|
|
208
|
-
destinationChain: string;
|
|
209
|
-
internalSubmitter: {
|
|
210
|
-
type: TxSubmitterType.JSON_RPC;
|
|
211
|
-
chain: string;
|
|
212
|
-
userAddress?: string | undefined;
|
|
213
|
-
privateKey?: string | undefined;
|
|
214
|
-
} | {
|
|
215
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
216
|
-
chain: string;
|
|
217
|
-
userAddress: string;
|
|
218
|
-
privateKey?: string | undefined;
|
|
219
|
-
} | {
|
|
220
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
221
|
-
chain: string;
|
|
222
|
-
safeAddress: string;
|
|
223
|
-
} | {
|
|
224
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
225
|
-
chain: string;
|
|
226
|
-
version: string;
|
|
227
|
-
safeAddress: string;
|
|
228
|
-
};
|
|
229
|
-
originInterchainAccountRouter?: string | undefined;
|
|
230
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
231
|
-
interchainSecurityModule?: string | undefined;
|
|
232
|
-
};
|
|
84
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
233
85
|
}, {
|
|
234
86
|
submitter: {
|
|
235
87
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -250,39 +102,21 @@ export declare const SubmissionStrategySchema: z.ZodObject<{
|
|
|
250
102
|
chain: string;
|
|
251
103
|
safeAddress: string;
|
|
252
104
|
version?: string | undefined;
|
|
253
|
-
} |
|
|
254
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
255
|
-
chain: string;
|
|
256
|
-
owner: string;
|
|
257
|
-
destinationChain: string;
|
|
258
|
-
internalSubmitter: {
|
|
259
|
-
type: TxSubmitterType.JSON_RPC;
|
|
260
|
-
chain: string;
|
|
261
|
-
userAddress?: string | undefined;
|
|
262
|
-
privateKey?: string | undefined;
|
|
263
|
-
} | {
|
|
264
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
265
|
-
chain: string;
|
|
266
|
-
userAddress: string;
|
|
267
|
-
privateKey?: string | undefined;
|
|
268
|
-
} | {
|
|
269
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
270
|
-
chain: string;
|
|
271
|
-
safeAddress: string;
|
|
272
|
-
} | {
|
|
273
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
274
|
-
chain: string;
|
|
275
|
-
safeAddress: string;
|
|
276
|
-
version?: string | undefined;
|
|
277
|
-
};
|
|
278
|
-
originInterchainAccountRouter?: string | undefined;
|
|
279
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
280
|
-
interchainSecurityModule?: string | undefined;
|
|
281
|
-
};
|
|
105
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
282
106
|
}>;
|
|
283
107
|
export type SubmissionStrategy = z.infer<typeof SubmissionStrategySchema>;
|
|
108
|
+
export declare function preprocessChainSubmissionStrategy<T extends {
|
|
109
|
+
submitter: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
}>(value: unknown): ChainMap<T>;
|
|
113
|
+
export declare function refineChainSubmissionStrategy<T extends {
|
|
114
|
+
submitter: {
|
|
115
|
+
type: string;
|
|
116
|
+
};
|
|
117
|
+
}>(value: Record<string, T>, ctx: z.RefinementCtx): void;
|
|
284
118
|
export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
285
|
-
submitter: z.ZodUnion<[z.
|
|
119
|
+
submitter: z.ZodUnion<[z.ZodObject<{
|
|
286
120
|
chain: z.ZodString;
|
|
287
121
|
userAddress: z.ZodOptional<z.ZodString>;
|
|
288
122
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
@@ -339,129 +173,7 @@ export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.
|
|
|
339
173
|
chain: string;
|
|
340
174
|
safeAddress: string;
|
|
341
175
|
version?: string | undefined;
|
|
342
|
-
}
|
|
343
|
-
type: z.ZodLiteral<TxSubmitterType.INTERCHAIN_ACCOUNT>;
|
|
344
|
-
chain: z.ZodString;
|
|
345
|
-
owner: z.ZodString;
|
|
346
|
-
destinationChain: z.ZodString;
|
|
347
|
-
originInterchainAccountRouter: z.ZodOptional<z.ZodString>;
|
|
348
|
-
destinationInterchainAccountRouter: z.ZodOptional<z.ZodString>;
|
|
349
|
-
interchainSecurityModule: z.ZodOptional<z.ZodString>;
|
|
350
|
-
internalSubmitter: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
351
|
-
chain: z.ZodString;
|
|
352
|
-
userAddress: z.ZodOptional<z.ZodString>;
|
|
353
|
-
privateKey: z.ZodOptional<z.ZodString>;
|
|
354
|
-
type: z.ZodLiteral<TxSubmitterType.JSON_RPC>;
|
|
355
|
-
}, "strip", z.ZodTypeAny, {
|
|
356
|
-
type: TxSubmitterType.JSON_RPC;
|
|
357
|
-
chain: string;
|
|
358
|
-
userAddress?: string | undefined;
|
|
359
|
-
privateKey?: string | undefined;
|
|
360
|
-
}, {
|
|
361
|
-
type: TxSubmitterType.JSON_RPC;
|
|
362
|
-
chain: string;
|
|
363
|
-
userAddress?: string | undefined;
|
|
364
|
-
privateKey?: string | undefined;
|
|
365
|
-
}>, z.ZodObject<{
|
|
366
|
-
chain: z.ZodString;
|
|
367
|
-
privateKey: z.ZodOptional<z.ZodString>;
|
|
368
|
-
userAddress: z.ZodString;
|
|
369
|
-
type: z.ZodLiteral<TxSubmitterType.IMPERSONATED_ACCOUNT>;
|
|
370
|
-
}, "strip", z.ZodTypeAny, {
|
|
371
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
372
|
-
chain: string;
|
|
373
|
-
userAddress: string;
|
|
374
|
-
privateKey?: string | undefined;
|
|
375
|
-
}, {
|
|
376
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
377
|
-
chain: string;
|
|
378
|
-
userAddress: string;
|
|
379
|
-
privateKey?: string | undefined;
|
|
380
|
-
}>, z.ZodObject<{
|
|
381
|
-
chain: z.ZodString;
|
|
382
|
-
safeAddress: z.ZodString;
|
|
383
|
-
type: z.ZodLiteral<TxSubmitterType.GNOSIS_SAFE>;
|
|
384
|
-
}, "strip", z.ZodTypeAny, {
|
|
385
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
386
|
-
chain: string;
|
|
387
|
-
safeAddress: string;
|
|
388
|
-
}, {
|
|
389
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
390
|
-
chain: string;
|
|
391
|
-
safeAddress: string;
|
|
392
|
-
}>, z.ZodObject<{
|
|
393
|
-
version: z.ZodDefault<z.ZodString>;
|
|
394
|
-
chain: z.ZodString;
|
|
395
|
-
safeAddress: z.ZodString;
|
|
396
|
-
type: z.ZodLiteral<TxSubmitterType.GNOSIS_TX_BUILDER>;
|
|
397
|
-
}, "strip", z.ZodTypeAny, {
|
|
398
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
399
|
-
chain: string;
|
|
400
|
-
version: string;
|
|
401
|
-
safeAddress: string;
|
|
402
|
-
}, {
|
|
403
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
404
|
-
chain: string;
|
|
405
|
-
safeAddress: string;
|
|
406
|
-
version?: string | undefined;
|
|
407
|
-
}>]>;
|
|
408
|
-
}, "strip", z.ZodTypeAny, {
|
|
409
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
410
|
-
chain: string;
|
|
411
|
-
owner: string;
|
|
412
|
-
destinationChain: string;
|
|
413
|
-
internalSubmitter: {
|
|
414
|
-
type: TxSubmitterType.JSON_RPC;
|
|
415
|
-
chain: string;
|
|
416
|
-
userAddress?: string | undefined;
|
|
417
|
-
privateKey?: string | undefined;
|
|
418
|
-
} | {
|
|
419
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
420
|
-
chain: string;
|
|
421
|
-
userAddress: string;
|
|
422
|
-
privateKey?: string | undefined;
|
|
423
|
-
} | {
|
|
424
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
425
|
-
chain: string;
|
|
426
|
-
safeAddress: string;
|
|
427
|
-
} | {
|
|
428
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
429
|
-
chain: string;
|
|
430
|
-
version: string;
|
|
431
|
-
safeAddress: string;
|
|
432
|
-
};
|
|
433
|
-
originInterchainAccountRouter?: string | undefined;
|
|
434
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
435
|
-
interchainSecurityModule?: string | undefined;
|
|
436
|
-
}, {
|
|
437
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
438
|
-
chain: string;
|
|
439
|
-
owner: string;
|
|
440
|
-
destinationChain: string;
|
|
441
|
-
internalSubmitter: {
|
|
442
|
-
type: TxSubmitterType.JSON_RPC;
|
|
443
|
-
chain: string;
|
|
444
|
-
userAddress?: string | undefined;
|
|
445
|
-
privateKey?: string | undefined;
|
|
446
|
-
} | {
|
|
447
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
448
|
-
chain: string;
|
|
449
|
-
userAddress: string;
|
|
450
|
-
privateKey?: string | undefined;
|
|
451
|
-
} | {
|
|
452
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
453
|
-
chain: string;
|
|
454
|
-
safeAddress: string;
|
|
455
|
-
} | {
|
|
456
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
457
|
-
chain: string;
|
|
458
|
-
safeAddress: string;
|
|
459
|
-
version?: string | undefined;
|
|
460
|
-
};
|
|
461
|
-
originInterchainAccountRouter?: string | undefined;
|
|
462
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
463
|
-
interchainSecurityModule?: string | undefined;
|
|
464
|
-
}>]>;
|
|
176
|
+
}>, z.ZodType<EvmIcaTxSubmitterProps, z.ZodTypeDef, EvmIcaTxSubmitterProps>, z.ZodType<import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps, z.ZodTypeDef, import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps>]>;
|
|
465
177
|
}, "strict", z.ZodTypeAny, {
|
|
466
178
|
submitter: {
|
|
467
179
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -482,35 +194,7 @@ export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.
|
|
|
482
194
|
chain: string;
|
|
483
195
|
version: string;
|
|
484
196
|
safeAddress: string;
|
|
485
|
-
} |
|
|
486
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
487
|
-
chain: string;
|
|
488
|
-
owner: string;
|
|
489
|
-
destinationChain: string;
|
|
490
|
-
internalSubmitter: {
|
|
491
|
-
type: TxSubmitterType.JSON_RPC;
|
|
492
|
-
chain: string;
|
|
493
|
-
userAddress?: string | undefined;
|
|
494
|
-
privateKey?: string | undefined;
|
|
495
|
-
} | {
|
|
496
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
497
|
-
chain: string;
|
|
498
|
-
userAddress: string;
|
|
499
|
-
privateKey?: string | undefined;
|
|
500
|
-
} | {
|
|
501
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
502
|
-
chain: string;
|
|
503
|
-
safeAddress: string;
|
|
504
|
-
} | {
|
|
505
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
506
|
-
chain: string;
|
|
507
|
-
version: string;
|
|
508
|
-
safeAddress: string;
|
|
509
|
-
};
|
|
510
|
-
originInterchainAccountRouter?: string | undefined;
|
|
511
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
512
|
-
interchainSecurityModule?: string | undefined;
|
|
513
|
-
};
|
|
197
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
514
198
|
}, {
|
|
515
199
|
submitter: {
|
|
516
200
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -531,35 +215,7 @@ export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.
|
|
|
531
215
|
chain: string;
|
|
532
216
|
safeAddress: string;
|
|
533
217
|
version?: string | undefined;
|
|
534
|
-
} |
|
|
535
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
536
|
-
chain: string;
|
|
537
|
-
owner: string;
|
|
538
|
-
destinationChain: string;
|
|
539
|
-
internalSubmitter: {
|
|
540
|
-
type: TxSubmitterType.JSON_RPC;
|
|
541
|
-
chain: string;
|
|
542
|
-
userAddress?: string | undefined;
|
|
543
|
-
privateKey?: string | undefined;
|
|
544
|
-
} | {
|
|
545
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
546
|
-
chain: string;
|
|
547
|
-
userAddress: string;
|
|
548
|
-
privateKey?: string | undefined;
|
|
549
|
-
} | {
|
|
550
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
551
|
-
chain: string;
|
|
552
|
-
safeAddress: string;
|
|
553
|
-
} | {
|
|
554
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
555
|
-
chain: string;
|
|
556
|
-
safeAddress: string;
|
|
557
|
-
version?: string | undefined;
|
|
558
|
-
};
|
|
559
|
-
originInterchainAccountRouter?: string | undefined;
|
|
560
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
561
|
-
interchainSecurityModule?: string | undefined;
|
|
562
|
-
};
|
|
218
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
563
219
|
}>>, Record<string, {
|
|
564
220
|
submitter: {
|
|
565
221
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -580,35 +236,7 @@ export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.
|
|
|
580
236
|
chain: string;
|
|
581
237
|
version: string;
|
|
582
238
|
safeAddress: string;
|
|
583
|
-
} |
|
|
584
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
585
|
-
chain: string;
|
|
586
|
-
owner: string;
|
|
587
|
-
destinationChain: string;
|
|
588
|
-
internalSubmitter: {
|
|
589
|
-
type: TxSubmitterType.JSON_RPC;
|
|
590
|
-
chain: string;
|
|
591
|
-
userAddress?: string | undefined;
|
|
592
|
-
privateKey?: string | undefined;
|
|
593
|
-
} | {
|
|
594
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
595
|
-
chain: string;
|
|
596
|
-
userAddress: string;
|
|
597
|
-
privateKey?: string | undefined;
|
|
598
|
-
} | {
|
|
599
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
600
|
-
chain: string;
|
|
601
|
-
safeAddress: string;
|
|
602
|
-
} | {
|
|
603
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
604
|
-
chain: string;
|
|
605
|
-
version: string;
|
|
606
|
-
safeAddress: string;
|
|
607
|
-
};
|
|
608
|
-
originInterchainAccountRouter?: string | undefined;
|
|
609
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
610
|
-
interchainSecurityModule?: string | undefined;
|
|
611
|
-
};
|
|
239
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
612
240
|
}>, Record<string, {
|
|
613
241
|
submitter: {
|
|
614
242
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -629,35 +257,7 @@ export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.
|
|
|
629
257
|
chain: string;
|
|
630
258
|
safeAddress: string;
|
|
631
259
|
version?: string | undefined;
|
|
632
|
-
} |
|
|
633
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
634
|
-
chain: string;
|
|
635
|
-
owner: string;
|
|
636
|
-
destinationChain: string;
|
|
637
|
-
internalSubmitter: {
|
|
638
|
-
type: TxSubmitterType.JSON_RPC;
|
|
639
|
-
chain: string;
|
|
640
|
-
userAddress?: string | undefined;
|
|
641
|
-
privateKey?: string | undefined;
|
|
642
|
-
} | {
|
|
643
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
644
|
-
chain: string;
|
|
645
|
-
userAddress: string;
|
|
646
|
-
privateKey?: string | undefined;
|
|
647
|
-
} | {
|
|
648
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
649
|
-
chain: string;
|
|
650
|
-
safeAddress: string;
|
|
651
|
-
} | {
|
|
652
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
653
|
-
chain: string;
|
|
654
|
-
safeAddress: string;
|
|
655
|
-
version?: string | undefined;
|
|
656
|
-
};
|
|
657
|
-
originInterchainAccountRouter?: string | undefined;
|
|
658
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
659
|
-
interchainSecurityModule?: string | undefined;
|
|
660
|
-
};
|
|
260
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
661
261
|
}>>, Record<string, {
|
|
662
262
|
submitter: {
|
|
663
263
|
type: TxSubmitterType.JSON_RPC;
|
|
@@ -678,35 +278,7 @@ export declare const ChainSubmissionStrategySchema: z.ZodEffects<z.ZodEffects<z.
|
|
|
678
278
|
chain: string;
|
|
679
279
|
version: string;
|
|
680
280
|
safeAddress: string;
|
|
681
|
-
} |
|
|
682
|
-
type: TxSubmitterType.INTERCHAIN_ACCOUNT;
|
|
683
|
-
chain: string;
|
|
684
|
-
owner: string;
|
|
685
|
-
destinationChain: string;
|
|
686
|
-
internalSubmitter: {
|
|
687
|
-
type: TxSubmitterType.JSON_RPC;
|
|
688
|
-
chain: string;
|
|
689
|
-
userAddress?: string | undefined;
|
|
690
|
-
privateKey?: string | undefined;
|
|
691
|
-
} | {
|
|
692
|
-
type: TxSubmitterType.IMPERSONATED_ACCOUNT;
|
|
693
|
-
chain: string;
|
|
694
|
-
userAddress: string;
|
|
695
|
-
privateKey?: string | undefined;
|
|
696
|
-
} | {
|
|
697
|
-
type: TxSubmitterType.GNOSIS_SAFE;
|
|
698
|
-
chain: string;
|
|
699
|
-
safeAddress: string;
|
|
700
|
-
} | {
|
|
701
|
-
type: TxSubmitterType.GNOSIS_TX_BUILDER;
|
|
702
|
-
chain: string;
|
|
703
|
-
version: string;
|
|
704
|
-
safeAddress: string;
|
|
705
|
-
};
|
|
706
|
-
originInterchainAccountRouter?: string | undefined;
|
|
707
|
-
destinationInterchainAccountRouter?: string | undefined;
|
|
708
|
-
interchainSecurityModule?: string | undefined;
|
|
709
|
-
};
|
|
281
|
+
} | EvmIcaTxSubmitterProps | import("../ethersV5/types.js").EvmTimelockControllerSubmitterProps;
|
|
710
282
|
}>, unknown>;
|
|
711
283
|
export type ChainSubmissionStrategy = z.infer<typeof ChainSubmissionStrategySchema>;
|
|
712
284
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/providers/transactions/submitter/builder/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/providers/transactions/submitter/builder/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI1B,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,wBAAgB,iCAAiC,CAC/C,CAAC,SAAS;IAAE,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EACzC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAa7B;AAED,wBAAgB,6BAA6B,CAC3C,CAAC,SAAS;IAAE,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,QAmB/C;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKzC,CAAC;AAkGF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { eqAddress, objMap } from '@hyperlane-xyz/utils';
|
|
2
|
+
import { assert, eqAddress, objMap } from '@hyperlane-xyz/utils';
|
|
3
3
|
import { ZChainName } from '../../../../metadata/customZodTypes.js';
|
|
4
4
|
import { TxSubmitterType } from '../TxSubmitterTypes.js';
|
|
5
5
|
import { SubmitterMetadataSchema } from '../types.js';
|
|
@@ -8,49 +8,22 @@ export const SubmissionStrategySchema = z
|
|
|
8
8
|
submitter: SubmitterMetadataSchema,
|
|
9
9
|
})
|
|
10
10
|
.strict();
|
|
11
|
-
export
|
|
12
|
-
// Add the chain property to the internal submitter config before validation
|
|
13
|
-
// to avoid having to set the field manually when writing the config
|
|
14
|
-
(value) => {
|
|
11
|
+
export function preprocessChainSubmissionStrategy(value) {
|
|
15
12
|
const castedValued = value;
|
|
16
13
|
const parsedValue = objMap(castedValued, (chainName, strategy) => {
|
|
17
|
-
if (strategy.submitter.type !== TxSubmitterType.INTERCHAIN_ACCOUNT) {
|
|
18
|
-
return strategy;
|
|
19
|
-
}
|
|
20
|
-
// Setting the default internal submitter config for interchain accounts here
|
|
21
|
-
// instead of using zod's default() modifier because we require the chain property to be set
|
|
22
|
-
const { internalSubmitter = {
|
|
23
|
-
type: TxSubmitterType.JSON_RPC,
|
|
24
|
-
chain: strategy.submitter.chain,
|
|
25
|
-
}, destinationChain, } = strategy.submitter;
|
|
26
|
-
const formattedInternalSubmitter = {
|
|
27
|
-
...internalSubmitter,
|
|
28
|
-
chain: strategy.submitter.chain,
|
|
29
|
-
};
|
|
30
|
-
// When the internal submitter of the interchain account is a Multisig, the owner address and the multisig address need to match
|
|
31
|
-
if (formattedInternalSubmitter.type === TxSubmitterType.GNOSIS_SAFE ||
|
|
32
|
-
formattedInternalSubmitter.type === TxSubmitterType.GNOSIS_TX_BUILDER) {
|
|
33
|
-
strategy.submitter.owner =
|
|
34
|
-
strategy.submitter.owner ?? formattedInternalSubmitter.safeAddress;
|
|
35
|
-
}
|
|
36
14
|
return {
|
|
37
|
-
|
|
38
|
-
submitter: {
|
|
39
|
-
...strategy.submitter,
|
|
40
|
-
// Setting the destinationChain here so that it can be omitted in the input config
|
|
41
|
-
// as its value should be the same as the key value in the mapping
|
|
42
|
-
destinationChain: destinationChain ?? chainName,
|
|
43
|
-
internalSubmitter: formattedInternalSubmitter,
|
|
44
|
-
},
|
|
15
|
+
submitter: preprocessSubmissionStrategy(chainName, strategy.submitter),
|
|
45
16
|
};
|
|
46
17
|
});
|
|
47
18
|
return parsedValue;
|
|
48
|
-
}
|
|
19
|
+
}
|
|
20
|
+
export function refineChainSubmissionStrategy(value, ctx) {
|
|
49
21
|
Object.entries(value).forEach(([chain, config]) => {
|
|
50
22
|
if (config.submitter.type !== TxSubmitterType.INTERCHAIN_ACCOUNT) {
|
|
51
23
|
return;
|
|
52
24
|
}
|
|
53
|
-
const
|
|
25
|
+
const submitter = config.submitter;
|
|
26
|
+
const { owner, internalSubmitter } = submitter;
|
|
54
27
|
if ((internalSubmitter.type === TxSubmitterType.GNOSIS_SAFE ||
|
|
55
28
|
internalSubmitter.type === TxSubmitterType.GNOSIS_TX_BUILDER) &&
|
|
56
29
|
!eqAddress(owner, internalSubmitter.safeAddress)) {
|
|
@@ -60,5 +33,64 @@ export const ChainSubmissionStrategySchema = z.preprocess(
|
|
|
60
33
|
});
|
|
61
34
|
}
|
|
62
35
|
});
|
|
63
|
-
}
|
|
36
|
+
}
|
|
37
|
+
export const ChainSubmissionStrategySchema = z.preprocess(preprocessChainSubmissionStrategy, z
|
|
38
|
+
.record(ZChainName, SubmissionStrategySchema)
|
|
39
|
+
.superRefine(refineChainSubmissionStrategy));
|
|
40
|
+
function preprocessSubmissionStrategy(chainName, strategy) {
|
|
41
|
+
if (strategy.type === TxSubmitterType.INTERCHAIN_ACCOUNT) {
|
|
42
|
+
return preprocessIcaSubmitter(chainName, strategy);
|
|
43
|
+
}
|
|
44
|
+
else if (strategy.type === TxSubmitterType.TIMELOCK_CONTROLLER) {
|
|
45
|
+
return preprocessTimelockSubmitter(chainName, strategy);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
...strategy,
|
|
49
|
+
// If the chain was not set use the current key to set it
|
|
50
|
+
// to avoid having to set it again in the source config
|
|
51
|
+
chain: strategy.chain ?? chainName,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const preprocessIcaSubmitter = (chainName, strategy) => {
|
|
55
|
+
assert(strategy.type === TxSubmitterType.INTERCHAIN_ACCOUNT, `[ChainSubmissionStrategy] Expected ${TxSubmitterType.INTERCHAIN_ACCOUNT} strategy but got ${strategy.type}`);
|
|
56
|
+
// Setting the default internal submitter config for interchain accounts here
|
|
57
|
+
// instead of using zod's default() modifier because we require the chain property to be set
|
|
58
|
+
const { internalSubmitter = {
|
|
59
|
+
type: TxSubmitterType.JSON_RPC,
|
|
60
|
+
chain: strategy.chain,
|
|
61
|
+
}, destinationChain, } = strategy;
|
|
62
|
+
const formattedInternalSubmitter = {
|
|
63
|
+
...internalSubmitter,
|
|
64
|
+
chain: internalSubmitter.chain ?? strategy.chain,
|
|
65
|
+
};
|
|
66
|
+
// When the internal submitter of the interchain account is a Multisig, the owner address and the multisig address need to match
|
|
67
|
+
if (formattedInternalSubmitter.type === TxSubmitterType.GNOSIS_SAFE ||
|
|
68
|
+
formattedInternalSubmitter.type === TxSubmitterType.GNOSIS_TX_BUILDER) {
|
|
69
|
+
strategy.owner = strategy.owner ?? formattedInternalSubmitter.safeAddress;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
...strategy,
|
|
73
|
+
// Setting the destinationChain here so that it can be omitted in the input config
|
|
74
|
+
// as its value should be the same as the key value in the mapping
|
|
75
|
+
destinationChain: destinationChain ?? chainName,
|
|
76
|
+
internalSubmitter: preprocessSubmissionStrategy(
|
|
77
|
+
// Here the chain changes to the one of the ICA because transactions
|
|
78
|
+
// are sent to the destination chain from another one
|
|
79
|
+
strategy.chain, formattedInternalSubmitter),
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const preprocessTimelockSubmitter = (chainName, strategy) => {
|
|
83
|
+
assert(strategy.type === TxSubmitterType.TIMELOCK_CONTROLLER, `[ChainSubmissionStrategy] Expected ${TxSubmitterType.TIMELOCK_CONTROLLER} strategy but got ${strategy.type}`);
|
|
84
|
+
const { proposerSubmitter = { type: TxSubmitterType.JSON_RPC, chain: chainName }, } = strategy;
|
|
85
|
+
const formattedProposerSubmitter = {
|
|
86
|
+
...proposerSubmitter,
|
|
87
|
+
// Override the chain if it hasn't been set
|
|
88
|
+
chain: proposerSubmitter.chain ?? chainName,
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
...strategy,
|
|
92
|
+
chain: strategy.chain ?? chainName,
|
|
93
|
+
proposerSubmitter: preprocessSubmissionStrategy(chainName, formattedProposerSubmitter),
|
|
94
|
+
};
|
|
95
|
+
};
|
|
64
96
|
//# sourceMappingURL=types.js.map
|