@xyo-network/chain-orchestration 1.20.22 → 1.20.24
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/browser/index.mjs +181 -166
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/node/config/tryParseConfig.d.ts +3 -3
- package/dist/browser/shared/config/actors/Api.d.ts +11 -17
- package/dist/browser/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Bridge.d.ts +11 -17
- package/dist/browser/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Finalizer.d.ts +11 -17
- package/dist/browser/shared/config/actors/Finalizer.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Mempool.d.ts +11 -17
- package/dist/browser/shared/config/actors/Mempool.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Producer.d.ts +11 -17
- package/dist/browser/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/RewardRedemption.d.ts +11 -17
- package/dist/browser/shared/config/actors/RewardRedemption.d.ts.map +1 -1
- package/dist/browser/shared/config/mergeConfig.d.ts +1 -1
- package/dist/browser/shared/init/initActorSeedPhrase.d.ts.map +1 -1
- package/dist/browser/shared/init/initWallet.d.ts +1 -1
- package/dist/browser/shared/init/initWallet.d.ts.map +1 -1
- package/dist/browser/shared/init/walletResolution.d.ts +38 -10
- package/dist/browser/shared/init/walletResolution.d.ts.map +1 -1
- package/dist/neutral/index.mjs +181 -166
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/node/config/tryParseConfig.d.ts +3 -3
- package/dist/neutral/shared/config/actors/Api.d.ts +11 -17
- package/dist/neutral/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Bridge.d.ts +11 -17
- package/dist/neutral/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Finalizer.d.ts +11 -17
- package/dist/neutral/shared/config/actors/Finalizer.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Mempool.d.ts +11 -17
- package/dist/neutral/shared/config/actors/Mempool.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Producer.d.ts +11 -17
- package/dist/neutral/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/RewardRedemption.d.ts +11 -17
- package/dist/neutral/shared/config/actors/RewardRedemption.d.ts.map +1 -1
- package/dist/neutral/shared/config/mergeConfig.d.ts +1 -1
- package/dist/neutral/shared/init/initActorSeedPhrase.d.ts.map +1 -1
- package/dist/neutral/shared/init/initWallet.d.ts +1 -1
- package/dist/neutral/shared/init/initWallet.d.ts.map +1 -1
- package/dist/neutral/shared/init/walletResolution.d.ts +38 -10
- package/dist/neutral/shared/init/walletResolution.d.ts.map +1 -1
- package/dist/node/index.mjs +181 -166
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node/config/tryParseConfig.d.ts +3 -3
- package/dist/node/shared/config/actors/Api.d.ts +11 -17
- package/dist/node/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Bridge.d.ts +11 -17
- package/dist/node/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Finalizer.d.ts +11 -17
- package/dist/node/shared/config/actors/Finalizer.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Mempool.d.ts +11 -17
- package/dist/node/shared/config/actors/Mempool.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Producer.d.ts +11 -17
- package/dist/node/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/node/shared/config/actors/RewardRedemption.d.ts +11 -17
- package/dist/node/shared/config/actors/RewardRedemption.d.ts.map +1 -1
- package/dist/node/shared/config/mergeConfig.d.ts +1 -1
- package/dist/node/shared/init/initActorSeedPhrase.d.ts.map +1 -1
- package/dist/node/shared/init/initWallet.d.ts +1 -1
- package/dist/node/shared/init/initWallet.d.ts.map +1 -1
- package/dist/node/shared/init/walletResolution.d.ts +38 -10
- package/dist/node/shared/init/walletResolution.d.ts.map +1 -1
- package/package.json +13 -13
- package/dist/browser/shared/config/actors/accountIndex.d.ts +0 -3
- package/dist/browser/shared/config/actors/accountIndex.d.ts.map +0 -1
- package/dist/neutral/shared/config/actors/accountIndex.d.ts +0 -3
- package/dist/neutral/shared/config/actors/accountIndex.d.ts.map +0 -1
- package/dist/node/shared/config/actors/accountIndex.d.ts +0 -3
- package/dist/node/shared/config/actors/accountIndex.d.ts.map +0 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -96,24 +96,13 @@ __name(buildTelemetryConfig, "buildTelemetryConfig");
|
|
|
96
96
|
// src/shared/config/actors/Api.ts
|
|
97
97
|
import { zodAsFactory, zodIsFactory, zodToFactory } from "@xylabs/sdk-js";
|
|
98
98
|
import { BaseConfigContextZod, HostActorConfigZod } from "@xyo-network/xl1-sdk";
|
|
99
|
-
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
100
|
-
|
|
101
|
-
// src/shared/config/actors/accountIndex.ts
|
|
102
99
|
import { globalRegistry, z } from "zod";
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// src/shared/config/actors/Api.ts
|
|
110
|
-
var ApiConfigZod = HostActorConfigZod.extend(z2.object({
|
|
111
|
-
accountIndex: ActorAccountIndexZod("api.accountIndex"),
|
|
112
|
-
initRewardsCache: z2.union([
|
|
113
|
-
z2.number(),
|
|
114
|
-
z2.string(),
|
|
115
|
-
z2.boolean()
|
|
116
|
-
]).transform((v) => v !== "0" && v !== "false" && v !== false && v != 0).default(true).register(globalRegistry2, {
|
|
100
|
+
var ApiConfigZod = HostActorConfigZod.extend(z.object({
|
|
101
|
+
initRewardsCache: z.union([
|
|
102
|
+
z.number(),
|
|
103
|
+
z.string(),
|
|
104
|
+
z.boolean()
|
|
105
|
+
]).transform((v) => v !== "0" && v !== "false" && v !== false && v != 0).default(true).register(globalRegistry, {
|
|
117
106
|
description: "Whether to initialize the rewards cache on startup",
|
|
118
107
|
title: "api.initRewardsCache",
|
|
119
108
|
type: "boolean"
|
|
@@ -132,7 +121,7 @@ var toApiConfigContext = zodToFactory(ApiConfigContext, "toApiConfigContext");
|
|
|
132
121
|
// src/shared/config/actors/Bridge.ts
|
|
133
122
|
import { AddressZod, HexZod, toAddress, toHex, zodAsFactory as zodAsFactory2, zodIsFactory as zodIsFactory2, zodToFactory as zodToFactory2 } from "@xylabs/sdk-js";
|
|
134
123
|
import { AttoXL1ConvertFactor, BaseConfigContextZod as BaseConfigContextZod2, HostActorConfigZod as HostActorConfigZod2, XL1 } from "@xyo-network/xl1-sdk";
|
|
135
|
-
import { globalRegistry as
|
|
124
|
+
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
136
125
|
var DEFAULT_FIXED_FEE = toHex(XL1(1000n) * AttoXL1ConvertFactor.xl1);
|
|
137
126
|
var DEFAULT_VARIABLE_FEE_BASIS_POINTS = 300;
|
|
138
127
|
var DEFAULT_HARDHAT_BRIDGE_CONTRACT = toAddress("2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6");
|
|
@@ -141,84 +130,83 @@ var DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY = toHex("0xac0974bec39a17e36
|
|
|
141
130
|
var DEFAULT_HARDHAT_TOKEN_CONTRACT = toAddress("5FbDB2315678afecb367f032d93F642f64180aa3");
|
|
142
131
|
var DEFAULT_MAX_BRIDGE_AMOUNT = toHex(XL1(1000000n) * AttoXL1ConvertFactor.xl1);
|
|
143
132
|
var DEFAULT_MIN_BRIDGE_AMOUNT = toHex(XL1(1500n) * AttoXL1ConvertFactor.xl1);
|
|
144
|
-
var BasisPointsZod =
|
|
133
|
+
var BasisPointsZod = z2.coerce.number().int().nonnegative().max(1e4);
|
|
145
134
|
var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
146
|
-
|
|
147
|
-
escrowAddress: AddressZod.optional().register(globalRegistry3, {
|
|
135
|
+
escrowAddress: AddressZod.optional().register(globalRegistry2, {
|
|
148
136
|
description: "Address to which bridge escrow will be sent",
|
|
149
137
|
title: "bridge.escrowAddress",
|
|
150
138
|
type: "string"
|
|
151
139
|
}),
|
|
152
|
-
feesAddress: AddressZod.optional().register(
|
|
140
|
+
feesAddress: AddressZod.optional().register(globalRegistry2, {
|
|
153
141
|
description: "Address to which bridge fees will be sent",
|
|
154
142
|
title: "bridge.feesAddress",
|
|
155
143
|
type: "string"
|
|
156
144
|
}),
|
|
157
|
-
feeFixed: HexZod.default(DEFAULT_FIXED_FEE).register(
|
|
145
|
+
feeFixed: HexZod.default(DEFAULT_FIXED_FEE).register(globalRegistry2, {
|
|
158
146
|
default: DEFAULT_FIXED_FEE,
|
|
159
147
|
description: "Fixed fee (in AttoXL1) applied to bridge transfers",
|
|
160
148
|
title: "bridge.feeFixed",
|
|
161
149
|
type: "bigint"
|
|
162
150
|
}),
|
|
163
|
-
feeRateBasisPoints: BasisPointsZod.default(DEFAULT_VARIABLE_FEE_BASIS_POINTS).register(
|
|
151
|
+
feeRateBasisPoints: BasisPointsZod.default(DEFAULT_VARIABLE_FEE_BASIS_POINTS).register(globalRegistry2, {
|
|
164
152
|
default: DEFAULT_VARIABLE_FEE_BASIS_POINTS,
|
|
165
153
|
description: "Variable rate fee (in basis points where 1 bps = 0.01%) applied to bridge transfers",
|
|
166
154
|
title: "bridge.feeRateBasisPoints",
|
|
167
155
|
type: "number"
|
|
168
156
|
}),
|
|
169
|
-
maxBridgeAmount: HexZod.default(DEFAULT_MAX_BRIDGE_AMOUNT).register(
|
|
157
|
+
maxBridgeAmount: HexZod.default(DEFAULT_MAX_BRIDGE_AMOUNT).register(globalRegistry2, {
|
|
170
158
|
default: DEFAULT_MAX_BRIDGE_AMOUNT,
|
|
171
159
|
description: "Maximum amount allowed for a bridge transfer",
|
|
172
160
|
title: "bridge.maxBridgeAmount",
|
|
173
161
|
type: "string"
|
|
174
162
|
}),
|
|
175
|
-
minBridgeAmount: HexZod.default(DEFAULT_MIN_BRIDGE_AMOUNT).register(
|
|
163
|
+
minBridgeAmount: HexZod.default(DEFAULT_MIN_BRIDGE_AMOUNT).register(globalRegistry2, {
|
|
176
164
|
default: DEFAULT_MIN_BRIDGE_AMOUNT,
|
|
177
165
|
description: "Minimum amount required for a bridge transfer",
|
|
178
166
|
title: "bridge.minBridgeAmount",
|
|
179
167
|
type: "string"
|
|
180
168
|
}),
|
|
181
|
-
redisHost:
|
|
169
|
+
redisHost: z2.string().default("localhost").register(globalRegistry2, {
|
|
182
170
|
default: "localhost",
|
|
183
171
|
description: "Host for the Bridge Redis instance",
|
|
184
172
|
title: "bridge.redisHost",
|
|
185
173
|
type: "string"
|
|
186
174
|
}),
|
|
187
|
-
redisPort:
|
|
175
|
+
redisPort: z2.coerce.number().int().positive().default(6379).register(globalRegistry2, {
|
|
188
176
|
default: 6379,
|
|
189
177
|
description: "Port for the Bridge Redis instance",
|
|
190
178
|
title: "bridge.redisPort",
|
|
191
179
|
type: "number"
|
|
192
180
|
}),
|
|
193
|
-
remoteBridgeContractAddress: AddressZod.default(DEFAULT_HARDHAT_BRIDGE_CONTRACT).register(
|
|
181
|
+
remoteBridgeContractAddress: AddressZod.default(DEFAULT_HARDHAT_BRIDGE_CONTRACT).register(globalRegistry2, {
|
|
194
182
|
default: DEFAULT_HARDHAT_BRIDGE_CONTRACT,
|
|
195
183
|
description: "Hex representation of remote token address used for bridging",
|
|
196
184
|
title: "bridge.remoteBridgeContractAddress",
|
|
197
185
|
type: "string"
|
|
198
186
|
}),
|
|
199
|
-
remoteChainId: HexZod.default(DEFAULT_HARDHAT_CHAIN_ID).register(
|
|
187
|
+
remoteChainId: HexZod.default(DEFAULT_HARDHAT_CHAIN_ID).register(globalRegistry2, {
|
|
200
188
|
default: DEFAULT_HARDHAT_CHAIN_ID,
|
|
201
189
|
description: "Remote chain ID",
|
|
202
190
|
title: "bridge.remoteChainId",
|
|
203
191
|
type: "string"
|
|
204
192
|
}),
|
|
205
|
-
remoteTokenAddress: HexZod.default(DEFAULT_HARDHAT_TOKEN_CONTRACT).register(
|
|
193
|
+
remoteTokenAddress: HexZod.default(DEFAULT_HARDHAT_TOKEN_CONTRACT).register(globalRegistry2, {
|
|
206
194
|
default: DEFAULT_HARDHAT_TOKEN_CONTRACT,
|
|
207
195
|
description: "Hex representation of remote token address used for bridging",
|
|
208
196
|
title: "bridge.remoteTokenAddress",
|
|
209
197
|
type: "string"
|
|
210
198
|
}),
|
|
211
|
-
remoteChainWalletPrivateKey: HexZod.default(DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY).register(
|
|
199
|
+
remoteChainWalletPrivateKey: HexZod.default(DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY).register(globalRegistry2, {
|
|
212
200
|
description: "Private key for the wallet to use for the remote chain wallet",
|
|
213
201
|
title: "bridge.remoteChainWalletPrivateKey",
|
|
214
202
|
type: "string"
|
|
215
203
|
}),
|
|
216
|
-
xl1ChainId: HexZod.optional().register(
|
|
204
|
+
xl1ChainId: HexZod.optional().register(globalRegistry2, {
|
|
217
205
|
description: "XL1 chain id used for bridging",
|
|
218
206
|
title: "bridge.xl1ChainId",
|
|
219
207
|
type: "string"
|
|
220
208
|
}),
|
|
221
|
-
xl1TokenAddress: HexZod.optional().register(
|
|
209
|
+
xl1TokenAddress: HexZod.optional().register(globalRegistry2, {
|
|
222
210
|
description: "XL1 token address used for bridging",
|
|
223
211
|
title: "bridge.xl1TokenAddress",
|
|
224
212
|
type: "string"
|
|
@@ -248,12 +236,11 @@ var toBridgeConfigContext = zodToFactory2(BridgeConfigContext, "toBridgeConfigCo
|
|
|
248
236
|
|
|
249
237
|
// src/shared/config/actors/Finalizer.ts
|
|
250
238
|
import { AddressZod as AddressZod2, zodAsFactory as zodAsFactory3, zodIsFactory as zodIsFactory3, zodToFactory as zodToFactory3 } from "@xylabs/sdk-js";
|
|
251
|
-
import { BaseConfigContextZod as BaseConfigContextZod3, HostActorConfigZod as HostActorConfigZod3 } from "@xyo-network/xl1-sdk";
|
|
252
|
-
import { z as
|
|
239
|
+
import { BaseConfigContextZod as BaseConfigContextZod3, DEFAULT_MIN_CANDIDATES, HostActorConfigZod as HostActorConfigZod3 } from "@xyo-network/xl1-sdk";
|
|
240
|
+
import { z as z3 } from "zod";
|
|
253
241
|
var FinalizerConfigZod = HostActorConfigZod3.extend({
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
minCandidates: z4.number().int().min(0).default(1)
|
|
242
|
+
allowedProducers: z3.array(AddressZod2).optional(),
|
|
243
|
+
minCandidates: z3.number().int().min(0).default(DEFAULT_MIN_CANDIDATES)
|
|
257
244
|
});
|
|
258
245
|
var isFinalizerConfig = zodIsFactory3(FinalizerConfigZod);
|
|
259
246
|
var asFinalizerConfig = zodAsFactory3(FinalizerConfigZod, "asFinalizerConfig");
|
|
@@ -268,14 +255,13 @@ var toFinalizerConfigContext = zodToFactory3(FinalizerConfigContext, "toFinalize
|
|
|
268
255
|
// src/shared/config/actors/Mempool.ts
|
|
269
256
|
import { zodAsFactory as zodAsFactory4, zodIsFactory as zodIsFactory4, zodToFactory as zodToFactory4 } from "@xylabs/sdk-js";
|
|
270
257
|
import { BaseConfigContextZod as BaseConfigContextZod4, HostActorConfigZod as HostActorConfigZod4 } from "@xyo-network/xl1-sdk";
|
|
271
|
-
import { globalRegistry as
|
|
258
|
+
import { globalRegistry as globalRegistry3, z as z4 } from "zod";
|
|
272
259
|
var DEFAULT_MEMPOOL_BLOCK_PRUNE_INTERVAL = 1e3;
|
|
273
260
|
var DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL = 1e3;
|
|
274
261
|
var MempoolConfigZod = HostActorConfigZod4.extend({
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
z5.boolean()
|
|
262
|
+
enabled: z4.union([
|
|
263
|
+
z4.string(),
|
|
264
|
+
z4.boolean()
|
|
279
265
|
]).default("false").transform((val, ctx) => {
|
|
280
266
|
if (typeof val === "boolean") return val;
|
|
281
267
|
const normalized = val.toLowerCase().trim();
|
|
@@ -296,19 +282,19 @@ var MempoolConfigZod = HostActorConfigZod4.extend({
|
|
|
296
282
|
expected: "boolean",
|
|
297
283
|
message: `Invalid boolean value: "${val}". Use true/false, 1/0, yes/no.`
|
|
298
284
|
});
|
|
299
|
-
return
|
|
300
|
-
}).register(
|
|
285
|
+
return z4.NEVER;
|
|
286
|
+
}).register(globalRegistry3, {
|
|
301
287
|
default: "false",
|
|
302
288
|
description: "Enable the Mempool",
|
|
303
289
|
title: "mempool.enabled",
|
|
304
290
|
type: "boolean"
|
|
305
291
|
}),
|
|
306
|
-
blockPruneInterval:
|
|
292
|
+
blockPruneInterval: z4.coerce.number().default(DEFAULT_MEMPOOL_BLOCK_PRUNE_INTERVAL).register(globalRegistry3, {
|
|
307
293
|
description: "The interval time (in milliseconds) between pending block prune attempts",
|
|
308
294
|
title: "mempool.blockPruneInterval",
|
|
309
295
|
type: "number"
|
|
310
296
|
}),
|
|
311
|
-
transactionPruneInterval:
|
|
297
|
+
transactionPruneInterval: z4.coerce.number().default(DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL).register(globalRegistry3, {
|
|
312
298
|
description: "The interval time (in milliseconds) between pending transaction prune attempts",
|
|
313
299
|
title: "mempool.transactionPruneInterval",
|
|
314
300
|
type: "number"
|
|
@@ -327,43 +313,42 @@ var toMempoolConfigContext = zodToFactory4(MempoolConfigContext, "toMempoolConfi
|
|
|
327
313
|
// src/shared/config/actors/Producer.ts
|
|
328
314
|
import { AddressZod as AddressZod3, asAddress, zodAsFactory as zodAsFactory5, zodIsFactory as zodIsFactory5, zodToFactory as zodToFactory5 } from "@xylabs/sdk-js";
|
|
329
315
|
import { ActorConfigZod, BaseConfigContextZod as BaseConfigContextZod5 } from "@xyo-network/xl1-sdk";
|
|
330
|
-
import { globalRegistry as
|
|
316
|
+
import { globalRegistry as globalRegistry4, z as z5 } from "zod";
|
|
331
317
|
var DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL = 1e4;
|
|
332
|
-
var ProducerConfigZod = ActorConfigZod.extend(
|
|
333
|
-
|
|
334
|
-
allowlist: z6.preprocess((val) => {
|
|
318
|
+
var ProducerConfigZod = ActorConfigZod.extend(z5.object({
|
|
319
|
+
allowlist: z5.preprocess((val) => {
|
|
335
320
|
if (typeof val === "string") {
|
|
336
321
|
return val.split(",").map((s) => asAddress(s.trim()));
|
|
337
322
|
}
|
|
338
323
|
return val;
|
|
339
|
-
},
|
|
324
|
+
}, z5.array(AddressZod3).optional().register(globalRegistry4, {
|
|
340
325
|
description: "List of allowed producer addresses, if undefined anyone can participate",
|
|
341
326
|
title: "allowlist",
|
|
342
327
|
type: "array"
|
|
343
328
|
})),
|
|
344
|
-
blockProductionCheckInterval:
|
|
329
|
+
blockProductionCheckInterval: z5.coerce.number().default(DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL).register(globalRegistry4, {
|
|
345
330
|
description: "The interval time (in milliseconds) between block production attempts",
|
|
346
331
|
title: "producer.blockProductionCheckInterval",
|
|
347
332
|
type: "number"
|
|
348
333
|
}),
|
|
349
|
-
disableIntentRedeclaration:
|
|
334
|
+
disableIntentRedeclaration: z5.boolean().optional().register(globalRegistry4, {
|
|
350
335
|
description: "Should the producer skip redeclaring their intent to continue producing blocks",
|
|
351
336
|
title: "producer.disableIntentRedeclaration",
|
|
352
337
|
type: "boolean"
|
|
353
338
|
}),
|
|
354
|
-
heartbeatInterval:
|
|
339
|
+
heartbeatInterval: z5.coerce.number().default(36e5).register(globalRegistry4, {
|
|
355
340
|
description: "The number of milliseconds between heartbeats if no blocks are produced",
|
|
356
341
|
title: "producer.heartbeatInterval",
|
|
357
342
|
type: "number"
|
|
358
343
|
}),
|
|
359
344
|
// TODO: BigInt schema
|
|
360
|
-
minStake:
|
|
345
|
+
minStake: z5.coerce.number().default(1).register(globalRegistry4, {
|
|
361
346
|
description: "Minimum stake required to be a Producer",
|
|
362
347
|
title: "producer.minStake",
|
|
363
348
|
type: "number"
|
|
364
349
|
}),
|
|
365
350
|
// TODO: Address schema
|
|
366
|
-
rewardAddress:
|
|
351
|
+
rewardAddress: z5.string().optional().register(globalRegistry4, {
|
|
367
352
|
description: "Address to receive block rewards",
|
|
368
353
|
title: "producer.rewardAddress",
|
|
369
354
|
type: "string"
|
|
@@ -382,9 +367,7 @@ var toProducerConfigContext = zodToFactory5(ProducerConfigContext, "toProducerCo
|
|
|
382
367
|
// src/shared/config/actors/RewardRedemption.ts
|
|
383
368
|
import { zodAsFactory as zodAsFactory6, zodIsFactory as zodIsFactory6, zodToFactory as zodToFactory6 } from "@xylabs/sdk-js";
|
|
384
369
|
import { BaseConfigContextZod as BaseConfigContextZod6, HostActorConfigZod as HostActorConfigZod5 } from "@xyo-network/xl1-sdk";
|
|
385
|
-
var RewardRedemptionConfigZod = HostActorConfigZod5.extend({
|
|
386
|
-
accountIndex: ActorAccountIndexZod("rewardRedemption.accountIndex")
|
|
387
|
-
});
|
|
370
|
+
var RewardRedemptionConfigZod = HostActorConfigZod5.extend({});
|
|
388
371
|
var isRewardRedemptionConfig = zodIsFactory6(RewardRedemptionConfigZod);
|
|
389
372
|
var asRewardRedemptionConfig = zodAsFactory6(RewardRedemptionConfigZod, "asRewardRedemptionConfig");
|
|
390
373
|
var toRewardRedemptionConfig = zodToFactory6(RewardRedemptionConfigZod, "toRewardRedemptionConfig");
|
|
@@ -463,22 +446,23 @@ var ServiceLifetime = {
|
|
|
463
446
|
import { isDefined } from "@xylabs/sdk-js";
|
|
464
447
|
|
|
465
448
|
// src/shared/init/walletResolution.ts
|
|
449
|
+
import { HDWallet } from "@xyo-network/sdk-js";
|
|
466
450
|
import { DEFAULT_WALLET_PATH, generateXyoBaseWalletFromPhrase } from "@xyo-network/xl1-sdk";
|
|
451
|
+
import { HDNodeWallet, Mnemonic } from "ethers";
|
|
452
|
+
var DEFAULT_ACTOR_ACCOUNT_PATH = {
|
|
453
|
+
api: "3",
|
|
454
|
+
bridge: "1",
|
|
455
|
+
finalizer: "5",
|
|
456
|
+
mempool: "4",
|
|
457
|
+
producer: "0",
|
|
458
|
+
rewardRedemption: "2"
|
|
459
|
+
};
|
|
467
460
|
var BUILT_IN_DEV_MNEMONIC = "crane ribbon cook cousin tobacco vital moral protect merit knock veteran hint knee ocean nurse";
|
|
468
461
|
var INSECURE_GENESIS_REWARD_MNEMONIC = "test test test test test test test test test test test junk";
|
|
469
462
|
var GENESIS_REWARD_AMOUNT = 20000000000000000000000n;
|
|
470
463
|
var ATTO_XL1_PER_XL1 = 1000000000000000000n;
|
|
471
464
|
var ROOT_WALLET_RUNTIME_ID = "_root";
|
|
472
465
|
var SHARED_ACCOUNT_REPORT_COUNT = 10;
|
|
473
|
-
var RESERVED_ACTOR_INDEX = {
|
|
474
|
-
[ROOT_WALLET_RUNTIME_ID]: 0,
|
|
475
|
-
api: 4,
|
|
476
|
-
bridge: 2,
|
|
477
|
-
finalizer: 6,
|
|
478
|
-
mempool: 5,
|
|
479
|
-
producer: 1,
|
|
480
|
-
rewardRedemption: 3
|
|
481
|
-
};
|
|
482
466
|
var ACTOR_LABELS = {
|
|
483
467
|
[ROOT_WALLET_RUNTIME_ID]: "root/local-node",
|
|
484
468
|
api: "api",
|
|
@@ -497,10 +481,30 @@ function clearResolvedWalletReport() {
|
|
|
497
481
|
activeWalletReport = void 0;
|
|
498
482
|
}
|
|
499
483
|
__name(clearResolvedWalletReport, "clearResolvedWalletReport");
|
|
500
|
-
function
|
|
501
|
-
|
|
484
|
+
function resolveActorAccountPath(actorName, actorConfig) {
|
|
485
|
+
if (actorConfig?.accountPath !== void 0) return actorConfig.accountPath;
|
|
486
|
+
return DEFAULT_ACTOR_ACCOUNT_PATH[actorName] ?? "0";
|
|
502
487
|
}
|
|
503
|
-
__name(
|
|
488
|
+
__name(resolveActorAccountPath, "resolveActorAccountPath");
|
|
489
|
+
function isAbsoluteAccountPath(accountPath) {
|
|
490
|
+
return accountPath.startsWith("m/");
|
|
491
|
+
}
|
|
492
|
+
__name(isAbsoluteAccountPath, "isAbsoluteAccountPath");
|
|
493
|
+
function expandAccountPath(accountPath, basePath = DEFAULT_WALLET_PATH) {
|
|
494
|
+
return isAbsoluteAccountPath(accountPath) ? accountPath : `${basePath}/${accountPath}`;
|
|
495
|
+
}
|
|
496
|
+
__name(expandAccountPath, "expandAccountPath");
|
|
497
|
+
async function deriveWalletAtPath(mnemonic, accountPath) {
|
|
498
|
+
if (isAbsoluteAccountPath(accountPath)) {
|
|
499
|
+
const seed = Mnemonic.fromPhrase(mnemonic).computeSeed();
|
|
500
|
+
const rootNode = HDNodeWallet.fromSeed(seed);
|
|
501
|
+
const derivedNode = rootNode.derivePath(accountPath);
|
|
502
|
+
return await HDWallet.createFromNode(derivedNode);
|
|
503
|
+
}
|
|
504
|
+
const baseWallet = await generateXyoBaseWalletFromPhrase(mnemonic);
|
|
505
|
+
return await baseWallet.derivePath(accountPath);
|
|
506
|
+
}
|
|
507
|
+
__name(deriveWalletAtPath, "deriveWalletAtPath");
|
|
504
508
|
function getBuiltInDevMnemonic() {
|
|
505
509
|
return BUILT_IN_DEV_MNEMONIC;
|
|
506
510
|
}
|
|
@@ -522,83 +526,115 @@ function resolveRootWallet(configuration) {
|
|
|
522
526
|
};
|
|
523
527
|
}
|
|
524
528
|
__name(resolveRootWallet, "resolveRootWallet");
|
|
525
|
-
async function resolveWalletMetadata({
|
|
526
|
-
const
|
|
527
|
-
const derivationPath = `${DEFAULT_WALLET_PATH}/${accountIndex}`;
|
|
528
|
-
const account = await wallet.derivePath(`${accountIndex}`);
|
|
529
|
+
async function resolveWalletMetadata({ accountPath, actorName, mnemonic, mnemonicKind }) {
|
|
530
|
+
const account = await deriveWalletAtPath(mnemonic, accountPath);
|
|
529
531
|
return {
|
|
530
|
-
|
|
532
|
+
accountPath,
|
|
531
533
|
actorName,
|
|
532
534
|
address: account.address,
|
|
533
|
-
derivationPath,
|
|
535
|
+
derivationPath: expandAccountPath(accountPath),
|
|
534
536
|
label: getAccountLabel(actorName),
|
|
535
537
|
mnemonic,
|
|
536
538
|
mnemonicKind,
|
|
537
539
|
privateKey: account.privateKey,
|
|
538
|
-
source,
|
|
539
540
|
usesBuiltInDevMnemonic: mnemonic === BUILT_IN_DEV_MNEMONIC
|
|
540
541
|
};
|
|
541
542
|
}
|
|
542
543
|
__name(resolveWalletMetadata, "resolveWalletMetadata");
|
|
543
544
|
async function resolveActorWallet(actorName, actorConfig, root) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
return await resolveWalletMetadata(actorMnemonic ? {
|
|
547
|
-
accountIndex: accountIndex ?? 0,
|
|
548
|
-
actorName,
|
|
549
|
-
mnemonic: actorMnemonic,
|
|
550
|
-
mnemonicKind: "configured-actor",
|
|
551
|
-
source: "actor"
|
|
552
|
-
} : {
|
|
553
|
-
accountIndex: accountIndex ?? getReservedActorIndex(actorName),
|
|
545
|
+
return await resolveWalletMetadata({
|
|
546
|
+
accountPath: resolveActorAccountPath(actorName, actorConfig),
|
|
554
547
|
actorName,
|
|
555
548
|
mnemonic: root.mnemonic,
|
|
556
|
-
mnemonicKind: root.mnemonicKind
|
|
557
|
-
source: "root"
|
|
549
|
+
mnemonicKind: root.mnemonicKind
|
|
558
550
|
});
|
|
559
551
|
}
|
|
560
552
|
__name(resolveActorWallet, "resolveActorWallet");
|
|
553
|
+
var ActorMnemonicNotAllowedError = class extends Error {
|
|
554
|
+
static {
|
|
555
|
+
__name(this, "ActorMnemonicNotAllowedError");
|
|
556
|
+
}
|
|
557
|
+
actors;
|
|
558
|
+
constructor(actors) {
|
|
559
|
+
super([
|
|
560
|
+
`Per-actor mnemonics are no longer allowed (found on: ${actors.join(", ")}).`,
|
|
561
|
+
'Move the mnemonic to the root (XL1_MNEMONIC, --mnemonic, or config file "xl1.mnemonic") and give each actor a distinct accountPath.'
|
|
562
|
+
].join("\n"));
|
|
563
|
+
this.name = "ActorMnemonicNotAllowedError";
|
|
564
|
+
this.actors = actors;
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
function assertNoActorMnemonics(configuration) {
|
|
568
|
+
const offenders = configuration.actors.filter((actor) => typeof actor.mnemonic === "string").map((actor) => actor.name);
|
|
569
|
+
if (offenders.length > 0) throw new ActorMnemonicNotAllowedError(offenders);
|
|
570
|
+
}
|
|
571
|
+
__name(assertNoActorMnemonics, "assertNoActorMnemonics");
|
|
572
|
+
var DerivationPathCollisionError = class extends Error {
|
|
573
|
+
static {
|
|
574
|
+
__name(this, "DerivationPathCollisionError");
|
|
575
|
+
}
|
|
576
|
+
collisions;
|
|
577
|
+
constructor(collisions) {
|
|
578
|
+
const lines = Object.entries(collisions).map(([path, actors]) => ` - ${actors.join(", ")} \u2192 ${path}`);
|
|
579
|
+
super([
|
|
580
|
+
"Two or more actors resolve to the same wallet derivation path:",
|
|
581
|
+
...lines,
|
|
582
|
+
"Change each actor's accountPath so every actor has a distinct path."
|
|
583
|
+
].join("\n"));
|
|
584
|
+
this.name = "DerivationPathCollisionError";
|
|
585
|
+
this.collisions = collisions;
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
function detectDerivationPathCollisions(requestedActors, configuration) {
|
|
589
|
+
const actorConfigMap = new Map(configuration.actors.map((actor) => [
|
|
590
|
+
actor.name,
|
|
591
|
+
actor
|
|
592
|
+
]));
|
|
593
|
+
const bucketsByPath = /* @__PURE__ */ new Map();
|
|
594
|
+
for (const actorName of requestedActors) {
|
|
595
|
+
const accountPath = resolveActorAccountPath(actorName, actorConfigMap.get(actorName));
|
|
596
|
+
const fullPath = expandAccountPath(accountPath);
|
|
597
|
+
const bucket = bucketsByPath.get(fullPath) ?? [];
|
|
598
|
+
bucket.push(actorName);
|
|
599
|
+
bucketsByPath.set(fullPath, bucket);
|
|
600
|
+
}
|
|
601
|
+
const collisions = {};
|
|
602
|
+
for (const [path, actors] of bucketsByPath) {
|
|
603
|
+
if (actors.length > 1) collisions[path] = actors;
|
|
604
|
+
}
|
|
605
|
+
if (Object.keys(collisions).length === 0) return void 0;
|
|
606
|
+
return new DerivationPathCollisionError(collisions);
|
|
607
|
+
}
|
|
608
|
+
__name(detectDerivationPathCollisions, "detectDerivationPathCollisions");
|
|
561
609
|
async function resolveWalletReport(requestedActors, configuration) {
|
|
562
610
|
const root = resolveRootWallet(configuration);
|
|
563
611
|
const actorConfigMap = new Map(configuration.actors.map((actor) => [
|
|
564
612
|
actor.name,
|
|
565
613
|
actor
|
|
566
614
|
]));
|
|
567
|
-
const isRootRequired = requestedActors.some((actorName) => !actorConfigMap.get(actorName)?.mnemonic);
|
|
568
615
|
const resolvedActors = await Promise.all(requestedActors.map(async (actorName) => await resolveActorWallet(actorName, actorConfigMap.get(actorName), root)));
|
|
569
|
-
const labelMap = /* @__PURE__ */ new Map(
|
|
570
|
-
[
|
|
571
|
-
0,
|
|
572
|
-
[
|
|
573
|
-
getAccountLabel(ROOT_WALLET_RUNTIME_ID)
|
|
574
|
-
]
|
|
575
|
-
]
|
|
576
|
-
]);
|
|
616
|
+
const labelMap = /* @__PURE__ */ new Map();
|
|
577
617
|
for (const actor of resolvedActors) {
|
|
578
|
-
|
|
579
|
-
const labels = labelMap.get(actor.accountIndex) ?? [];
|
|
618
|
+
const labels = labelMap.get(actor.derivationPath) ?? [];
|
|
580
619
|
labels.push(actor.label);
|
|
581
|
-
labelMap.set(actor.
|
|
620
|
+
labelMap.set(actor.derivationPath, labels);
|
|
582
621
|
}
|
|
583
622
|
const sharedAccounts = await Promise.all(Array.from({
|
|
584
623
|
length: SHARED_ACCOUNT_REPORT_COUNT
|
|
585
|
-
}, (_, index) => index).map(async (
|
|
624
|
+
}, (_, index) => index).map(async (sharedIndex) => {
|
|
586
625
|
const account = await resolveWalletMetadata({
|
|
587
|
-
|
|
626
|
+
accountPath: `${sharedIndex}`,
|
|
588
627
|
actorName: ROOT_WALLET_RUNTIME_ID,
|
|
589
628
|
mnemonic: root.mnemonic,
|
|
590
|
-
mnemonicKind: root.mnemonicKind
|
|
591
|
-
source: "root"
|
|
629
|
+
mnemonicKind: root.mnemonicKind
|
|
592
630
|
});
|
|
593
|
-
const labels = labelMap.get(
|
|
631
|
+
const labels = labelMap.get(account.derivationPath);
|
|
594
632
|
return {
|
|
595
633
|
...account,
|
|
596
|
-
label: labels?.join(", ") ?? `shared[${
|
|
634
|
+
label: labels?.join(", ") ?? `shared[${sharedIndex}]`
|
|
597
635
|
};
|
|
598
636
|
}));
|
|
599
637
|
return {
|
|
600
|
-
actorSpecificAccounts: resolvedActors.filter((actor) => actor.source === "actor"),
|
|
601
|
-
isRootRequired,
|
|
602
638
|
requestedActors: [
|
|
603
639
|
...requestedActors
|
|
604
640
|
],
|
|
@@ -610,17 +646,16 @@ __name(resolveWalletReport, "resolveWalletReport");
|
|
|
610
646
|
async function buildInsecureGenesisRewardAccounts() {
|
|
611
647
|
const accounts = await Promise.all(Array.from({
|
|
612
648
|
length: SHARED_ACCOUNT_REPORT_COUNT
|
|
613
|
-
}, (_, index) => index).map(async (
|
|
649
|
+
}, (_, index) => index).map(async (sharedIndex) => {
|
|
614
650
|
const account = await resolveWalletMetadata({
|
|
615
|
-
|
|
651
|
+
accountPath: `${sharedIndex}`,
|
|
616
652
|
actorName: "genesisReward",
|
|
617
653
|
mnemonic: INSECURE_GENESIS_REWARD_MNEMONIC,
|
|
618
|
-
mnemonicKind: "
|
|
619
|
-
source: "actor"
|
|
654
|
+
mnemonicKind: "insecure-genesis-reward"
|
|
620
655
|
});
|
|
621
656
|
return {
|
|
622
657
|
...account,
|
|
623
|
-
label:
|
|
658
|
+
label: sharedIndex === 0 ? "genesisRewardAddress" : `genesisReward[${sharedIndex}]`
|
|
624
659
|
};
|
|
625
660
|
}));
|
|
626
661
|
return accounts;
|
|
@@ -637,7 +672,7 @@ function getResolvedWalletReport() {
|
|
|
637
672
|
__name(getResolvedWalletReport, "getResolvedWalletReport");
|
|
638
673
|
function formatSharedAccount(account, showPrivateKey) {
|
|
639
674
|
const lines = [
|
|
640
|
-
`[${account.
|
|
675
|
+
`[${account.accountPath}] ${account.label}`,
|
|
641
676
|
`source: ${account.mnemonicKind === "built-in-dev" ? "built-in dev mnemonic" : "configured root mnemonic"}`,
|
|
642
677
|
`path: ${account.derivationPath}`,
|
|
643
678
|
`address: ${account.address}`
|
|
@@ -646,19 +681,10 @@ function formatSharedAccount(account, showPrivateKey) {
|
|
|
646
681
|
return lines.join("\n");
|
|
647
682
|
}
|
|
648
683
|
__name(formatSharedAccount, "formatSharedAccount");
|
|
649
|
-
function formatActorSpecificAccount(account) {
|
|
650
|
-
return [
|
|
651
|
-
account.label,
|
|
652
|
-
"source: actor mnemonic",
|
|
653
|
-
`path: ${account.derivationPath}`,
|
|
654
|
-
`address: ${account.address}`
|
|
655
|
-
].join("\n");
|
|
656
|
-
}
|
|
657
|
-
__name(formatActorSpecificAccount, "formatActorSpecificAccount");
|
|
658
684
|
function formatGenesisRewardAccount(account) {
|
|
659
|
-
const balance = account.
|
|
685
|
+
const balance = account.accountPath === "0" ? GENESIS_REWARD_AMOUNT / ATTO_XL1_PER_XL1 : 0n;
|
|
660
686
|
return [
|
|
661
|
-
`[${account.
|
|
687
|
+
`[${account.accountPath}] ${account.label}`,
|
|
662
688
|
`path: ${account.derivationPath}`,
|
|
663
689
|
`address: ${account.address}`,
|
|
664
690
|
`privateKey: ${account.privateKey ?? "unavailable"}`,
|
|
@@ -668,13 +694,8 @@ function formatGenesisRewardAccount(account) {
|
|
|
668
694
|
__name(formatGenesisRewardAccount, "formatGenesisRewardAccount");
|
|
669
695
|
function formatWalletReport(report) {
|
|
670
696
|
const sections = [];
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
if (showRootSection) {
|
|
674
|
-
sections.push(showSecrets ? "Development wallet detected." : "Wallet summary");
|
|
675
|
-
} else {
|
|
676
|
-
sections.push("Wallet summary (root wallet not required \u2014 every requested actor has its own mnemonic)");
|
|
677
|
-
}
|
|
697
|
+
const showSecrets = report.root.isBuiltInDevMnemonic;
|
|
698
|
+
sections.push(showSecrets ? "Development wallet detected." : "Wallet summary");
|
|
678
699
|
if (showSecrets) {
|
|
679
700
|
sections.push([
|
|
680
701
|
"DEVELOPMENT WALLET WARNING",
|
|
@@ -688,20 +709,11 @@ function formatWalletReport(report) {
|
|
|
688
709
|
report.root.mnemonic
|
|
689
710
|
].join("\n"));
|
|
690
711
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
].join("\n"));
|
|
697
|
-
}
|
|
698
|
-
if (report.actorSpecificAccounts.length > 0) {
|
|
699
|
-
sections.push([
|
|
700
|
-
"Actor-specific wallet accounts:",
|
|
701
|
-
"",
|
|
702
|
-
report.actorSpecificAccounts.map((account) => formatActorSpecificAccount(account)).join("\n\n")
|
|
703
|
-
].join("\n"));
|
|
704
|
-
}
|
|
712
|
+
sections.push([
|
|
713
|
+
`Shared wallet accounts from ${report.root.basePath}:`,
|
|
714
|
+
"",
|
|
715
|
+
report.sharedAccounts.map((account) => formatSharedAccount(account, showSecrets)).join("\n\n")
|
|
716
|
+
].join("\n"));
|
|
705
717
|
return sections.join("\n\n");
|
|
706
718
|
}
|
|
707
719
|
__name(formatWalletReport, "formatWalletReport");
|
|
@@ -731,12 +743,11 @@ async function resolveGenesisRewardAddress(config) {
|
|
|
731
743
|
return account.address;
|
|
732
744
|
}
|
|
733
745
|
__name(resolveGenesisRewardAddress, "resolveGenesisRewardAddress");
|
|
734
|
-
async function resolveWalletForActor(actorName,
|
|
735
|
-
const
|
|
736
|
-
const
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
return await wallet.derivePath(`${resolvedAccountIndex}`);
|
|
746
|
+
async function resolveWalletForActor(actorName, accountPath) {
|
|
747
|
+
const report = activeWalletReport;
|
|
748
|
+
const mnemonic = report?.root.mnemonic ?? BUILT_IN_DEV_MNEMONIC;
|
|
749
|
+
const resolvedAccountPath = accountPath ?? resolveActorAccountPath(actorName);
|
|
750
|
+
return await deriveWalletAtPath(mnemonic, resolvedAccountPath);
|
|
740
751
|
}
|
|
741
752
|
__name(resolveWalletForActor, "resolveWalletForActor");
|
|
742
753
|
|
|
@@ -745,8 +756,8 @@ var actorAccountSingletons = {};
|
|
|
745
756
|
async function initActorAccount({ config, logger }) {
|
|
746
757
|
const actorName = config.name;
|
|
747
758
|
if (isDefined(actorAccountSingletons[actorName])) return actorAccountSingletons[actorName];
|
|
748
|
-
const
|
|
749
|
-
const account = await resolveWalletForActor(actorName,
|
|
759
|
+
const accountPath = typeof config.accountPath === "string" ? config.accountPath : void 0;
|
|
760
|
+
const account = await resolveWalletForActor(actorName, accountPath);
|
|
750
761
|
logger?.debug(`[${actorName}] Using wallet address ${account.address}`);
|
|
751
762
|
actorAccountSingletons[actorName] = account;
|
|
752
763
|
return actorAccountSingletons[actorName];
|
|
@@ -760,10 +771,7 @@ async function initActorSeedPhrase(context, bios) {
|
|
|
760
771
|
const walletKind = config.name;
|
|
761
772
|
void bios;
|
|
762
773
|
const report = getResolvedWalletReport();
|
|
763
|
-
const account = config.name === ROOT_WALLET_RUNTIME_ID ? report?.sharedAccounts.find((entry) => entry.accountIndex === 0) : report?.actorSpecificAccounts.find((entry) => entry.actorName === config.name);
|
|
764
|
-
if (isString(account?.mnemonic)) return account.mnemonic;
|
|
765
774
|
if (isString(report?.root.mnemonic)) return report.root.mnemonic;
|
|
766
|
-
if (isString(config.mnemonic)) return config.mnemonic;
|
|
767
775
|
const fallback = getBuiltInDevMnemonic();
|
|
768
776
|
logger?.debug(`[${walletKind}] Falling back to built-in development mnemonic`);
|
|
769
777
|
return assertEx(fallback, () => "Unable to resolve mnemonic");
|
|
@@ -820,10 +828,10 @@ function initStatusReporter({ logger }) {
|
|
|
820
828
|
__name(initStatusReporter, "initStatusReporter");
|
|
821
829
|
|
|
822
830
|
// src/shared/init/initWallet.ts
|
|
823
|
-
async function initActorWallet(context
|
|
824
|
-
const actorName = context.config.name
|
|
825
|
-
const
|
|
826
|
-
return await resolveWalletForActor(actorName,
|
|
831
|
+
async function initActorWallet(context) {
|
|
832
|
+
const actorName = context.config.name;
|
|
833
|
+
const accountPath = typeof context.config.accountPath === "string" ? context.config.accountPath : void 0;
|
|
834
|
+
return await resolveWalletForActor(actorName, accountPath);
|
|
827
835
|
}
|
|
828
836
|
__name(initActorWallet, "initActorWallet");
|
|
829
837
|
|
|
@@ -957,6 +965,7 @@ async function rootLocatorFromConfig(context, validateDepsOnRegister = false) {
|
|
|
957
965
|
}
|
|
958
966
|
__name(rootLocatorFromConfig, "rootLocatorFromConfig");
|
|
959
967
|
export {
|
|
968
|
+
ActorMnemonicNotAllowedError,
|
|
960
969
|
ApiConfigContext,
|
|
961
970
|
ApiConfigZod,
|
|
962
971
|
BUILT_IN_DEV_MNEMONIC,
|
|
@@ -964,10 +973,12 @@ export {
|
|
|
964
973
|
BridgeConfigContext,
|
|
965
974
|
BridgeConfigZod,
|
|
966
975
|
BridgeSettingsZod,
|
|
976
|
+
DEFAULT_ACTOR_ACCOUNT_PATH,
|
|
967
977
|
DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL,
|
|
968
978
|
DEFAULT_MEMPOOL_BLOCK_PRUNE_INTERVAL,
|
|
969
979
|
DEFAULT_MEMPOOL_TRANSACTION_PRUNE_INTERVAL,
|
|
970
980
|
DefaultServiceProvider,
|
|
981
|
+
DerivationPathCollisionError,
|
|
971
982
|
FinalizerActor,
|
|
972
983
|
FinalizerConfigContext,
|
|
973
984
|
FinalizerConfigZod,
|
|
@@ -998,17 +1009,19 @@ export {
|
|
|
998
1009
|
asProducerConfigContext,
|
|
999
1010
|
asRewardRedemptionConfig,
|
|
1000
1011
|
asRewardRedemptionConfigContext,
|
|
1012
|
+
assertNoActorMnemonics,
|
|
1001
1013
|
basicRemoteRunnerLocator,
|
|
1002
1014
|
basicRemoteViewerLocator,
|
|
1003
1015
|
buildInsecureGenesisRewardAccounts,
|
|
1004
1016
|
buildTelemetryConfig,
|
|
1005
1017
|
clearResolvedWalletReport,
|
|
1006
1018
|
createProducerChainStakeIntentBlock,
|
|
1019
|
+
detectDerivationPathCollisions,
|
|
1020
|
+
expandAccountPath,
|
|
1007
1021
|
formatInsecureGenesisRewardWarning,
|
|
1008
1022
|
formatWalletReport,
|
|
1009
1023
|
getBuiltInDevMnemonic,
|
|
1010
1024
|
getInsecureGenesisRewardMnemonic,
|
|
1011
|
-
getReservedActorIndex,
|
|
1012
1025
|
getResolvedWalletReport,
|
|
1013
1026
|
initActorAccount,
|
|
1014
1027
|
initActorSeedPhrase,
|
|
@@ -1017,6 +1030,7 @@ export {
|
|
|
1017
1030
|
initBridgedModule,
|
|
1018
1031
|
initStatusReporter,
|
|
1019
1032
|
initializeResolvedWalletReport,
|
|
1033
|
+
isAbsoluteAccountPath,
|
|
1020
1034
|
isApiConfig,
|
|
1021
1035
|
isApiConfigContext,
|
|
1022
1036
|
isBridgeConfig,
|
|
@@ -1030,6 +1044,7 @@ export {
|
|
|
1030
1044
|
isRewardRedemptionConfig,
|
|
1031
1045
|
isRewardRedemptionConfigContext,
|
|
1032
1046
|
mergeConfig,
|
|
1047
|
+
resolveActorAccountPath,
|
|
1033
1048
|
resolveActorWallet,
|
|
1034
1049
|
resolveGenesisRewardAddress,
|
|
1035
1050
|
resolveRootWallet,
|