@xyo-network/chain-orchestration 1.20.18 → 1.20.20
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 +357 -83
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/node/config/locators/actors/bridgeLocatorFromConfig.d.ts +1 -1
- package/dist/browser/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/browser/node/config/tryParseConfig.d.ts +156 -2
- package/dist/browser/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/browser/node/init/initFinalizationArchivistIfNeeded.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Api.d.ts +11 -5
- package/dist/browser/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Bridge.d.ts +11 -5
- package/dist/browser/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Mempool.d.ts +11 -5
- package/dist/browser/shared/config/actors/Mempool.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Producer.d.ts +11 -5
- package/dist/browser/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/RewardRedemption.d.ts +11 -5
- package/dist/browser/shared/config/actors/RewardRedemption.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/Validator.d.ts +11 -5
- package/dist/browser/shared/config/actors/Validator.d.ts.map +1 -1
- package/dist/browser/shared/config/actors/accountIndex.d.ts +3 -0
- package/dist/browser/shared/config/actors/accountIndex.d.ts.map +1 -0
- package/dist/browser/shared/config/mergeConfig.d.ts +1 -1
- package/dist/browser/shared/init/index.d.ts +1 -0
- package/dist/browser/shared/init/index.d.ts.map +1 -1
- package/dist/browser/shared/init/initActorAccount.d.ts.map +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 +56 -0
- package/dist/browser/shared/init/walletResolution.d.ts.map +1 -0
- package/dist/neutral/index.mjs +357 -83
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/node/config/locators/actors/bridgeLocatorFromConfig.d.ts +1 -1
- package/dist/neutral/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/neutral/node/config/tryParseConfig.d.ts +156 -2
- package/dist/neutral/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/neutral/node/init/initFinalizationArchivistIfNeeded.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Api.d.ts +11 -5
- package/dist/neutral/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Bridge.d.ts +11 -5
- package/dist/neutral/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Mempool.d.ts +11 -5
- package/dist/neutral/shared/config/actors/Mempool.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Producer.d.ts +11 -5
- package/dist/neutral/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/RewardRedemption.d.ts +11 -5
- package/dist/neutral/shared/config/actors/RewardRedemption.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/Validator.d.ts +11 -5
- package/dist/neutral/shared/config/actors/Validator.d.ts.map +1 -1
- package/dist/neutral/shared/config/actors/accountIndex.d.ts +3 -0
- package/dist/neutral/shared/config/actors/accountIndex.d.ts.map +1 -0
- package/dist/neutral/shared/config/mergeConfig.d.ts +1 -1
- package/dist/neutral/shared/init/index.d.ts +1 -0
- package/dist/neutral/shared/init/index.d.ts.map +1 -1
- package/dist/neutral/shared/init/initActorAccount.d.ts.map +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 +56 -0
- package/dist/neutral/shared/init/walletResolution.d.ts.map +1 -0
- package/dist/node/index.mjs +375 -99
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node/config/locators/actors/bridgeLocatorFromConfig.d.ts +1 -1
- package/dist/node/node/config/locators/actors/bridgeLocatorFromConfig.d.ts.map +1 -1
- package/dist/node/node/config/tryParseConfig.d.ts +156 -2
- package/dist/node/node/config/tryParseConfig.d.ts.map +1 -1
- package/dist/node/node/init/initFinalizationArchivistIfNeeded.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Api.d.ts +11 -5
- package/dist/node/shared/config/actors/Api.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Bridge.d.ts +11 -5
- package/dist/node/shared/config/actors/Bridge.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Mempool.d.ts +11 -5
- package/dist/node/shared/config/actors/Mempool.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Producer.d.ts +11 -5
- package/dist/node/shared/config/actors/Producer.d.ts.map +1 -1
- package/dist/node/shared/config/actors/RewardRedemption.d.ts +11 -5
- package/dist/node/shared/config/actors/RewardRedemption.d.ts.map +1 -1
- package/dist/node/shared/config/actors/Validator.d.ts +11 -5
- package/dist/node/shared/config/actors/Validator.d.ts.map +1 -1
- package/dist/node/shared/config/actors/accountIndex.d.ts +3 -0
- package/dist/node/shared/config/actors/accountIndex.d.ts.map +1 -0
- package/dist/node/shared/config/mergeConfig.d.ts +1 -1
- package/dist/node/shared/init/index.d.ts +1 -0
- package/dist/node/shared/init/index.d.ts.map +1 -1
- package/dist/node/shared/init/initActorAccount.d.ts.map +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 +56 -0
- package/dist/node/shared/init/walletResolution.d.ts.map +1 -0
- package/package.json +12 -13
package/dist/browser/index.mjs
CHANGED
|
@@ -53,7 +53,7 @@ var ValidatorActor = class extends ActorV3 {
|
|
|
53
53
|
await super.startHandler();
|
|
54
54
|
this.registerTimer("ValidatorActor", async () => {
|
|
55
55
|
await this.spanAsync("processPendingBlocks", async () => {
|
|
56
|
-
|
|
56
|
+
this.logger?.debug("ValidatorActor: Processing pending blocks...");
|
|
57
57
|
await processPendingBlocks({
|
|
58
58
|
blockValidationViewer: this.blockValidationViewer,
|
|
59
59
|
context: this.context,
|
|
@@ -98,13 +98,24 @@ __name(buildTelemetryConfig, "buildTelemetryConfig");
|
|
|
98
98
|
// src/shared/config/actors/Api.ts
|
|
99
99
|
import { zodAsFactory, zodIsFactory, zodToFactory } from "@xylabs/sdk-js";
|
|
100
100
|
import { BaseConfigContextZod, HostActorConfigZod } from "@xyo-network/xl1-sdk";
|
|
101
|
+
import { globalRegistry as globalRegistry2, z as z2 } from "zod";
|
|
102
|
+
|
|
103
|
+
// src/shared/config/actors/accountIndex.ts
|
|
101
104
|
import { globalRegistry, z } from "zod";
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
var ActorAccountIndexZod = /* @__PURE__ */ __name((title) => z.coerce.number().int().min(0).optional().register(globalRegistry, {
|
|
106
|
+
description: "Account index derived from the actor wallet phrase. Defaults to 0 for actor mnemonics and to the actor-specific shared index for the root mnemonic.",
|
|
107
|
+
title,
|
|
108
|
+
type: "number"
|
|
109
|
+
}), "ActorAccountIndexZod");
|
|
110
|
+
|
|
111
|
+
// src/shared/config/actors/Api.ts
|
|
112
|
+
var ApiConfigZod = HostActorConfigZod.extend(z2.object({
|
|
113
|
+
accountIndex: ActorAccountIndexZod("api.accountIndex"),
|
|
114
|
+
initRewardsCache: z2.union([
|
|
115
|
+
z2.number(),
|
|
116
|
+
z2.string(),
|
|
117
|
+
z2.boolean()
|
|
118
|
+
]).transform((v) => v !== "0" && v !== "false" && v !== false && v != 0).default(true).register(globalRegistry2, {
|
|
108
119
|
description: "Whether to initialize the rewards cache on startup",
|
|
109
120
|
title: "api.initRewardsCache",
|
|
110
121
|
type: "boolean"
|
|
@@ -123,7 +134,7 @@ var toApiConfigContext = zodToFactory(ApiConfigContext, "toApiConfigContext");
|
|
|
123
134
|
// src/shared/config/actors/Bridge.ts
|
|
124
135
|
import { AddressZod, HexZod, toAddress, toHex, zodAsFactory as zodAsFactory2, zodIsFactory as zodIsFactory2, zodToFactory as zodToFactory2 } from "@xylabs/sdk-js";
|
|
125
136
|
import { AttoXL1ConvertFactor, BaseConfigContextZod as BaseConfigContextZod2, HostActorConfigZod as HostActorConfigZod2, XL1 } from "@xyo-network/xl1-sdk";
|
|
126
|
-
import { globalRegistry as
|
|
137
|
+
import { globalRegistry as globalRegistry3, z as z3 } from "zod";
|
|
127
138
|
var DEFAULT_FIXED_FEE = toHex(XL1(1000n) * AttoXL1ConvertFactor.xl1);
|
|
128
139
|
var DEFAULT_VARIABLE_FEE_BASIS_POINTS = 300;
|
|
129
140
|
var DEFAULT_HARDHAT_BRIDGE_CONTRACT = toAddress("2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6");
|
|
@@ -132,83 +143,84 @@ var DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY = toHex("0xac0974bec39a17e36
|
|
|
132
143
|
var DEFAULT_HARDHAT_TOKEN_CONTRACT = toAddress("5FbDB2315678afecb367f032d93F642f64180aa3");
|
|
133
144
|
var DEFAULT_MAX_BRIDGE_AMOUNT = toHex(XL1(1000000n) * AttoXL1ConvertFactor.xl1);
|
|
134
145
|
var DEFAULT_MIN_BRIDGE_AMOUNT = toHex(XL1(1500n) * AttoXL1ConvertFactor.xl1);
|
|
135
|
-
var BasisPointsZod =
|
|
146
|
+
var BasisPointsZod = z3.coerce.number().int().nonnegative().max(1e4);
|
|
136
147
|
var BridgeConfigZod = HostActorConfigZod2.extend({
|
|
137
|
-
|
|
148
|
+
accountIndex: ActorAccountIndexZod("bridge.accountIndex"),
|
|
149
|
+
escrowAddress: AddressZod.optional().register(globalRegistry3, {
|
|
138
150
|
description: "Address to which bridge escrow will be sent",
|
|
139
151
|
title: "bridge.escrowAddress",
|
|
140
152
|
type: "string"
|
|
141
153
|
}),
|
|
142
|
-
feesAddress: AddressZod.optional().register(
|
|
154
|
+
feesAddress: AddressZod.optional().register(globalRegistry3, {
|
|
143
155
|
description: "Address to which bridge fees will be sent",
|
|
144
156
|
title: "bridge.feesAddress",
|
|
145
157
|
type: "string"
|
|
146
158
|
}),
|
|
147
|
-
feeFixed: HexZod.default(DEFAULT_FIXED_FEE).register(
|
|
159
|
+
feeFixed: HexZod.default(DEFAULT_FIXED_FEE).register(globalRegistry3, {
|
|
148
160
|
default: DEFAULT_FIXED_FEE,
|
|
149
161
|
description: "Fixed fee (in AttoXL1) applied to bridge transfers",
|
|
150
162
|
title: "bridge.feeFixed",
|
|
151
163
|
type: "bigint"
|
|
152
164
|
}),
|
|
153
|
-
feeRateBasisPoints: BasisPointsZod.default(DEFAULT_VARIABLE_FEE_BASIS_POINTS).register(
|
|
165
|
+
feeRateBasisPoints: BasisPointsZod.default(DEFAULT_VARIABLE_FEE_BASIS_POINTS).register(globalRegistry3, {
|
|
154
166
|
default: DEFAULT_VARIABLE_FEE_BASIS_POINTS,
|
|
155
167
|
description: "Variable rate fee (in basis points where 1 bps = 0.01%) applied to bridge transfers",
|
|
156
168
|
title: "bridge.feeRateBasisPoints",
|
|
157
169
|
type: "number"
|
|
158
170
|
}),
|
|
159
|
-
maxBridgeAmount: HexZod.default(DEFAULT_MAX_BRIDGE_AMOUNT).register(
|
|
171
|
+
maxBridgeAmount: HexZod.default(DEFAULT_MAX_BRIDGE_AMOUNT).register(globalRegistry3, {
|
|
160
172
|
default: DEFAULT_MAX_BRIDGE_AMOUNT,
|
|
161
173
|
description: "Maximum amount allowed for a bridge transfer",
|
|
162
174
|
title: "bridge.maxBridgeAmount",
|
|
163
175
|
type: "string"
|
|
164
176
|
}),
|
|
165
|
-
minBridgeAmount: HexZod.default(DEFAULT_MIN_BRIDGE_AMOUNT).register(
|
|
177
|
+
minBridgeAmount: HexZod.default(DEFAULT_MIN_BRIDGE_AMOUNT).register(globalRegistry3, {
|
|
166
178
|
default: DEFAULT_MIN_BRIDGE_AMOUNT,
|
|
167
179
|
description: "Minimum amount required for a bridge transfer",
|
|
168
180
|
title: "bridge.minBridgeAmount",
|
|
169
181
|
type: "string"
|
|
170
182
|
}),
|
|
171
|
-
redisHost:
|
|
183
|
+
redisHost: z3.string().default("localhost").register(globalRegistry3, {
|
|
172
184
|
default: "localhost",
|
|
173
185
|
description: "Host for the Bridge Redis instance",
|
|
174
186
|
title: "bridge.redisHost",
|
|
175
187
|
type: "string"
|
|
176
188
|
}),
|
|
177
|
-
redisPort:
|
|
189
|
+
redisPort: z3.coerce.number().int().positive().default(6379).register(globalRegistry3, {
|
|
178
190
|
default: 6379,
|
|
179
191
|
description: "Port for the Bridge Redis instance",
|
|
180
192
|
title: "bridge.redisPort",
|
|
181
193
|
type: "number"
|
|
182
194
|
}),
|
|
183
|
-
remoteBridgeContractAddress: AddressZod.default(DEFAULT_HARDHAT_BRIDGE_CONTRACT).register(
|
|
195
|
+
remoteBridgeContractAddress: AddressZod.default(DEFAULT_HARDHAT_BRIDGE_CONTRACT).register(globalRegistry3, {
|
|
184
196
|
default: DEFAULT_HARDHAT_BRIDGE_CONTRACT,
|
|
185
197
|
description: "Hex representation of remote token address used for bridging",
|
|
186
198
|
title: "bridge.remoteBridgeContractAddress",
|
|
187
199
|
type: "string"
|
|
188
200
|
}),
|
|
189
|
-
remoteChainId: HexZod.default(DEFAULT_HARDHAT_CHAIN_ID).register(
|
|
201
|
+
remoteChainId: HexZod.default(DEFAULT_HARDHAT_CHAIN_ID).register(globalRegistry3, {
|
|
190
202
|
default: DEFAULT_HARDHAT_CHAIN_ID,
|
|
191
203
|
description: "Remote chain ID",
|
|
192
204
|
title: "bridge.remoteChainId",
|
|
193
205
|
type: "string"
|
|
194
206
|
}),
|
|
195
|
-
remoteTokenAddress: HexZod.default(DEFAULT_HARDHAT_TOKEN_CONTRACT).register(
|
|
207
|
+
remoteTokenAddress: HexZod.default(DEFAULT_HARDHAT_TOKEN_CONTRACT).register(globalRegistry3, {
|
|
196
208
|
default: DEFAULT_HARDHAT_TOKEN_CONTRACT,
|
|
197
209
|
description: "Hex representation of remote token address used for bridging",
|
|
198
210
|
title: "bridge.remoteTokenAddress",
|
|
199
211
|
type: "string"
|
|
200
212
|
}),
|
|
201
|
-
remoteChainWalletPrivateKey: HexZod.default(DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY).register(
|
|
213
|
+
remoteChainWalletPrivateKey: HexZod.default(DEFAULT_HARDHAT_REMOTE_CHAIN_WALLET_PRIVATE_KEY).register(globalRegistry3, {
|
|
202
214
|
description: "Private key for the wallet to use for the remote chain wallet",
|
|
203
215
|
title: "bridge.remoteChainWalletPrivateKey",
|
|
204
216
|
type: "string"
|
|
205
217
|
}),
|
|
206
|
-
xl1ChainId: HexZod.optional().register(
|
|
218
|
+
xl1ChainId: HexZod.optional().register(globalRegistry3, {
|
|
207
219
|
description: "XL1 chain id used for bridging",
|
|
208
220
|
title: "bridge.xl1ChainId",
|
|
209
221
|
type: "string"
|
|
210
222
|
}),
|
|
211
|
-
xl1TokenAddress: HexZod.optional().register(
|
|
223
|
+
xl1TokenAddress: HexZod.optional().register(globalRegistry3, {
|
|
212
224
|
description: "XL1 token address used for bridging",
|
|
213
225
|
title: "bridge.xl1TokenAddress",
|
|
214
226
|
type: "string"
|
|
@@ -239,11 +251,12 @@ var toBridgeConfigContext = zodToFactory2(BridgeConfigContext, "toBridgeConfigCo
|
|
|
239
251
|
// src/shared/config/actors/Mempool.ts
|
|
240
252
|
import { zodAsFactory as zodAsFactory3, zodIsFactory as zodIsFactory3, zodToFactory as zodToFactory3 } from "@xylabs/sdk-js";
|
|
241
253
|
import { BaseConfigContextZod as BaseConfigContextZod3, HostActorConfigZod as HostActorConfigZod3 } from "@xyo-network/xl1-sdk";
|
|
242
|
-
import { globalRegistry as
|
|
254
|
+
import { globalRegistry as globalRegistry4, z as z4 } from "zod";
|
|
243
255
|
var MempoolConfigZod = HostActorConfigZod3.extend({
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
256
|
+
accountIndex: ActorAccountIndexZod("mempool.accountIndex"),
|
|
257
|
+
enabled: z4.union([
|
|
258
|
+
z4.string(),
|
|
259
|
+
z4.boolean()
|
|
247
260
|
]).default("false").transform((val, ctx) => {
|
|
248
261
|
if (typeof val === "boolean") return val;
|
|
249
262
|
const normalized = val.toLowerCase().trim();
|
|
@@ -264,8 +277,8 @@ var MempoolConfigZod = HostActorConfigZod3.extend({
|
|
|
264
277
|
expected: "boolean",
|
|
265
278
|
message: `Invalid boolean value: "${val}". Use true/false, 1/0, yes/no.`
|
|
266
279
|
});
|
|
267
|
-
return
|
|
268
|
-
}).register(
|
|
280
|
+
return z4.NEVER;
|
|
281
|
+
}).register(globalRegistry4, {
|
|
269
282
|
default: "false",
|
|
270
283
|
description: "Enable the Mempool",
|
|
271
284
|
title: "mempool.enabled",
|
|
@@ -285,42 +298,43 @@ var toMempoolConfigContext = zodToFactory3(MempoolConfigContext, "toMempoolConfi
|
|
|
285
298
|
// src/shared/config/actors/Producer.ts
|
|
286
299
|
import { AddressZod as AddressZod2, asAddress, zodAsFactory as zodAsFactory4, zodIsFactory as zodIsFactory4, zodToFactory as zodToFactory4 } from "@xylabs/sdk-js";
|
|
287
300
|
import { ActorConfigZod, BaseConfigContextZod as BaseConfigContextZod4 } from "@xyo-network/xl1-sdk";
|
|
288
|
-
import { globalRegistry as
|
|
301
|
+
import { globalRegistry as globalRegistry5, z as z5 } from "zod";
|
|
289
302
|
var DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL = 1e4;
|
|
290
|
-
var ProducerConfigZod = ActorConfigZod.extend(
|
|
291
|
-
|
|
303
|
+
var ProducerConfigZod = ActorConfigZod.extend(z5.object({
|
|
304
|
+
accountIndex: ActorAccountIndexZod("producer.accountIndex"),
|
|
305
|
+
allowlist: z5.preprocess((val) => {
|
|
292
306
|
if (typeof val === "string") {
|
|
293
307
|
return val.split(",").map((s) => asAddress(s.trim()));
|
|
294
308
|
}
|
|
295
309
|
return val;
|
|
296
|
-
},
|
|
310
|
+
}, z5.array(AddressZod2).optional().register(globalRegistry5, {
|
|
297
311
|
description: "List of allowed producer addresses, if undefined anyone can participate",
|
|
298
312
|
title: "allowlist",
|
|
299
313
|
type: "array"
|
|
300
314
|
})),
|
|
301
|
-
blockProductionCheckInterval:
|
|
315
|
+
blockProductionCheckInterval: z5.coerce.number().default(DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL).register(globalRegistry5, {
|
|
302
316
|
description: "The interval time (in milliseconds) between block production attempts",
|
|
303
317
|
title: "producer.blockProductionCheckInterval",
|
|
304
318
|
type: "number"
|
|
305
319
|
}),
|
|
306
|
-
disableIntentRedeclaration:
|
|
320
|
+
disableIntentRedeclaration: z5.boolean().optional().register(globalRegistry5, {
|
|
307
321
|
description: "Should the producer skip redeclaring their intent to continue producing blocks",
|
|
308
322
|
title: "producer.disableIntentRedeclaration",
|
|
309
323
|
type: "boolean"
|
|
310
324
|
}),
|
|
311
|
-
heartbeatInterval:
|
|
325
|
+
heartbeatInterval: z5.coerce.number().default(36e5).register(globalRegistry5, {
|
|
312
326
|
description: "The number of milliseconds between heartbeats if no blocks are produced",
|
|
313
327
|
title: "producer.heartbeatInterval",
|
|
314
328
|
type: "number"
|
|
315
329
|
}),
|
|
316
330
|
// TODO: BigInt schema
|
|
317
|
-
minStake:
|
|
331
|
+
minStake: z5.coerce.number().default(1).register(globalRegistry5, {
|
|
318
332
|
description: "Minimum stake required to be a Producer",
|
|
319
333
|
title: "producer.minStake",
|
|
320
334
|
type: "number"
|
|
321
335
|
}),
|
|
322
336
|
// TODO: Address schema
|
|
323
|
-
rewardAddress:
|
|
337
|
+
rewardAddress: z5.string().optional().register(globalRegistry5, {
|
|
324
338
|
description: "Address to receive block rewards",
|
|
325
339
|
title: "producer.rewardAddress",
|
|
326
340
|
type: "string"
|
|
@@ -339,7 +353,9 @@ var toProducerConfigContext = zodToFactory4(ProducerConfigContext, "toProducerCo
|
|
|
339
353
|
// src/shared/config/actors/RewardRedemption.ts
|
|
340
354
|
import { zodAsFactory as zodAsFactory5, zodIsFactory as zodIsFactory5, zodToFactory as zodToFactory5 } from "@xylabs/sdk-js";
|
|
341
355
|
import { BaseConfigContextZod as BaseConfigContextZod5, HostActorConfigZod as HostActorConfigZod4 } from "@xyo-network/xl1-sdk";
|
|
342
|
-
var RewardRedemptionConfigZod = HostActorConfigZod4.extend({
|
|
356
|
+
var RewardRedemptionConfigZod = HostActorConfigZod4.extend({
|
|
357
|
+
accountIndex: ActorAccountIndexZod("rewardRedemption.accountIndex")
|
|
358
|
+
});
|
|
343
359
|
var isRewardRedemptionConfig = zodIsFactory5(RewardRedemptionConfigZod);
|
|
344
360
|
var asRewardRedemptionConfig = zodAsFactory5(RewardRedemptionConfigZod, "asRewardRedemptionConfig");
|
|
345
361
|
var toRewardRedemptionConfig = zodToFactory5(RewardRedemptionConfigZod, "toRewardRedemptionConfig");
|
|
@@ -353,10 +369,11 @@ var toRewardRedemptionConfigContext = zodToFactory5(RewardRedemptionConfigContex
|
|
|
353
369
|
// src/shared/config/actors/Validator.ts
|
|
354
370
|
import { AddressZod as AddressZod3, zodAsFactory as zodAsFactory6, zodIsFactory as zodIsFactory6, zodToFactory as zodToFactory6 } from "@xylabs/sdk-js";
|
|
355
371
|
import { BaseConfigContextZod as BaseConfigContextZod6, HostActorConfigZod as HostActorConfigZod5 } from "@xyo-network/xl1-sdk";
|
|
356
|
-
import { z as
|
|
372
|
+
import { z as z6 } from "zod";
|
|
357
373
|
var ValidatorConfigZod = HostActorConfigZod5.extend({
|
|
358
|
-
|
|
359
|
-
|
|
374
|
+
accountIndex: ActorAccountIndexZod("validator.accountIndex"),
|
|
375
|
+
allowedProducers: z6.array(AddressZod3).optional(),
|
|
376
|
+
minCandidates: z6.number().int().min(0).optional()
|
|
360
377
|
});
|
|
361
378
|
var isValidatorConfig = zodIsFactory6(ValidatorConfigZod);
|
|
362
379
|
var asValidatorConfig = zodAsFactory6(ValidatorConfigZod, "asValidatorConfig");
|
|
@@ -433,26 +450,279 @@ var ServiceLifetime = {
|
|
|
433
450
|
};
|
|
434
451
|
|
|
435
452
|
// src/shared/init/initActorAccount.ts
|
|
436
|
-
import { isDefined
|
|
437
|
-
|
|
438
|
-
|
|
453
|
+
import { isDefined } from "@xylabs/sdk-js";
|
|
454
|
+
|
|
455
|
+
// src/shared/init/walletResolution.ts
|
|
456
|
+
import { DEFAULT_WALLET_PATH, generateXyoBaseWalletFromPhrase } from "@xyo-network/xl1-sdk";
|
|
457
|
+
var BUILT_IN_DEV_MNEMONIC = "crane ribbon cook cousin tobacco vital moral protect merit knock veteran hint knee ocean nurse";
|
|
458
|
+
var INSECURE_GENESIS_REWARD_MNEMONIC = "test test test test test test test test test test test junk";
|
|
459
|
+
var GENESIS_REWARD_AMOUNT = 20000000000000000000000n;
|
|
460
|
+
var ATTO_XL1_PER_XL1 = 1000000000000000000n;
|
|
461
|
+
var ROOT_WALLET_RUNTIME_ID = "_root";
|
|
462
|
+
var SHARED_ACCOUNT_REPORT_COUNT = 10;
|
|
463
|
+
var RESERVED_ACTOR_INDEX = {
|
|
464
|
+
[ROOT_WALLET_RUNTIME_ID]: 0,
|
|
465
|
+
api: 4,
|
|
466
|
+
bridge: 2,
|
|
467
|
+
mempool: 5,
|
|
468
|
+
producer: 1,
|
|
469
|
+
rewardRedemption: 3,
|
|
470
|
+
validator: 6
|
|
471
|
+
};
|
|
472
|
+
var ACTOR_LABELS = {
|
|
473
|
+
[ROOT_WALLET_RUNTIME_ID]: "root/local-node",
|
|
474
|
+
api: "api",
|
|
475
|
+
bridge: "bridge",
|
|
476
|
+
mempool: "mempool",
|
|
477
|
+
producer: "producer",
|
|
478
|
+
rewardRedemption: "rewardRedemption",
|
|
479
|
+
validator: "validator"
|
|
480
|
+
};
|
|
481
|
+
var activeWalletReport;
|
|
482
|
+
function getAccountLabel(actorName) {
|
|
483
|
+
return ACTOR_LABELS[actorName] ?? actorName;
|
|
484
|
+
}
|
|
485
|
+
__name(getAccountLabel, "getAccountLabel");
|
|
486
|
+
function clearResolvedWalletReport() {
|
|
487
|
+
activeWalletReport = void 0;
|
|
488
|
+
}
|
|
489
|
+
__name(clearResolvedWalletReport, "clearResolvedWalletReport");
|
|
490
|
+
function getReservedActorIndex(actorName) {
|
|
491
|
+
return RESERVED_ACTOR_INDEX[actorName] ?? 0;
|
|
492
|
+
}
|
|
493
|
+
__name(getReservedActorIndex, "getReservedActorIndex");
|
|
494
|
+
function getBuiltInDevMnemonic() {
|
|
495
|
+
return BUILT_IN_DEV_MNEMONIC;
|
|
496
|
+
}
|
|
497
|
+
__name(getBuiltInDevMnemonic, "getBuiltInDevMnemonic");
|
|
498
|
+
function getInsecureGenesisRewardMnemonic() {
|
|
499
|
+
return INSECURE_GENESIS_REWARD_MNEMONIC;
|
|
500
|
+
}
|
|
501
|
+
__name(getInsecureGenesisRewardMnemonic, "getInsecureGenesisRewardMnemonic");
|
|
502
|
+
function resolveRootWallet(configuration) {
|
|
503
|
+
const mnemonic = configuration.mnemonic ?? BUILT_IN_DEV_MNEMONIC;
|
|
504
|
+
const isBuiltInDevMnemonic = mnemonic === BUILT_IN_DEV_MNEMONIC;
|
|
505
|
+
return {
|
|
506
|
+
basePath: DEFAULT_WALLET_PATH,
|
|
507
|
+
isBuiltInDevMnemonic,
|
|
508
|
+
mnemonic,
|
|
509
|
+
mnemonicKind: isBuiltInDevMnemonic ? "built-in-dev" : "configured-root"
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
__name(resolveRootWallet, "resolveRootWallet");
|
|
513
|
+
async function resolveWalletMetadata({ accountIndex, actorName, mnemonic, mnemonicKind, source }) {
|
|
514
|
+
const wallet = await generateXyoBaseWalletFromPhrase(mnemonic);
|
|
515
|
+
const derivationPath = `${DEFAULT_WALLET_PATH}/${accountIndex}`;
|
|
516
|
+
const account = await wallet.derivePath(`${accountIndex}`);
|
|
517
|
+
return {
|
|
518
|
+
accountIndex,
|
|
519
|
+
actorName,
|
|
520
|
+
address: account.address,
|
|
521
|
+
derivationPath,
|
|
522
|
+
label: getAccountLabel(actorName),
|
|
523
|
+
mnemonic,
|
|
524
|
+
mnemonicKind,
|
|
525
|
+
privateKey: account.privateKey,
|
|
526
|
+
source,
|
|
527
|
+
usesBuiltInDevMnemonic: mnemonic === BUILT_IN_DEV_MNEMONIC
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
__name(resolveWalletMetadata, "resolveWalletMetadata");
|
|
531
|
+
async function resolveActorWallet(actorName, actorConfig, root) {
|
|
532
|
+
const actorMnemonic = actorConfig?.mnemonic;
|
|
533
|
+
const accountIndex = actorConfig?.accountIndex;
|
|
534
|
+
return await resolveWalletMetadata(actorMnemonic ? {
|
|
535
|
+
accountIndex: accountIndex ?? 0,
|
|
536
|
+
actorName,
|
|
537
|
+
mnemonic: actorMnemonic,
|
|
538
|
+
mnemonicKind: "configured-actor",
|
|
539
|
+
source: "actor"
|
|
540
|
+
} : {
|
|
541
|
+
accountIndex: accountIndex ?? getReservedActorIndex(actorName),
|
|
542
|
+
actorName,
|
|
543
|
+
mnemonic: root.mnemonic,
|
|
544
|
+
mnemonicKind: root.mnemonicKind,
|
|
545
|
+
source: "root"
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
__name(resolveActorWallet, "resolveActorWallet");
|
|
549
|
+
async function resolveWalletReport(requestedActors, configuration) {
|
|
550
|
+
const root = resolveRootWallet(configuration);
|
|
551
|
+
const actorConfigMap = new Map(configuration.actors.map((actor) => [
|
|
552
|
+
actor.name,
|
|
553
|
+
actor
|
|
554
|
+
]));
|
|
555
|
+
const resolvedActors = await Promise.all(requestedActors.map(async (actorName) => await resolveActorWallet(actorName, actorConfigMap.get(actorName), root)));
|
|
556
|
+
const labelMap = /* @__PURE__ */ new Map([
|
|
557
|
+
[
|
|
558
|
+
0,
|
|
559
|
+
[
|
|
560
|
+
getAccountLabel(ROOT_WALLET_RUNTIME_ID)
|
|
561
|
+
]
|
|
562
|
+
]
|
|
563
|
+
]);
|
|
564
|
+
for (const actor of resolvedActors) {
|
|
565
|
+
if (actor.source !== "root") continue;
|
|
566
|
+
const labels = labelMap.get(actor.accountIndex) ?? [];
|
|
567
|
+
labels.push(actor.label);
|
|
568
|
+
labelMap.set(actor.accountIndex, labels);
|
|
569
|
+
}
|
|
570
|
+
const sharedAccounts = await Promise.all(Array.from({
|
|
571
|
+
length: SHARED_ACCOUNT_REPORT_COUNT
|
|
572
|
+
}, (_, index) => index).map(async (accountIndex) => {
|
|
573
|
+
const account = await resolveWalletMetadata({
|
|
574
|
+
accountIndex,
|
|
575
|
+
actorName: ROOT_WALLET_RUNTIME_ID,
|
|
576
|
+
mnemonic: root.mnemonic,
|
|
577
|
+
mnemonicKind: root.mnemonicKind,
|
|
578
|
+
source: "root"
|
|
579
|
+
});
|
|
580
|
+
const labels = labelMap.get(accountIndex);
|
|
581
|
+
return {
|
|
582
|
+
...account,
|
|
583
|
+
label: labels?.join(", ") ?? `shared[${accountIndex}]`
|
|
584
|
+
};
|
|
585
|
+
}));
|
|
586
|
+
const insecureGenesisRewardAccounts = configuration.chain.genesisRewardAddress ? void 0 : await Promise.all(Array.from({
|
|
587
|
+
length: SHARED_ACCOUNT_REPORT_COUNT
|
|
588
|
+
}, (_, index) => index).map(async (accountIndex) => {
|
|
589
|
+
const account = await resolveWalletMetadata({
|
|
590
|
+
accountIndex,
|
|
591
|
+
actorName: "genesisReward",
|
|
592
|
+
mnemonic: INSECURE_GENESIS_REWARD_MNEMONIC,
|
|
593
|
+
mnemonicKind: "configured-actor",
|
|
594
|
+
source: "actor"
|
|
595
|
+
});
|
|
596
|
+
return {
|
|
597
|
+
...account,
|
|
598
|
+
label: accountIndex === 0 ? "genesisRewardAddress" : `genesisReward[${accountIndex}]`
|
|
599
|
+
};
|
|
600
|
+
}));
|
|
601
|
+
return {
|
|
602
|
+
actorSpecificAccounts: resolvedActors.filter((actor) => actor.source === "actor"),
|
|
603
|
+
insecureGenesisRewardAccounts,
|
|
604
|
+
requestedActors: [
|
|
605
|
+
...requestedActors
|
|
606
|
+
],
|
|
607
|
+
root,
|
|
608
|
+
sharedAccounts
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
__name(resolveWalletReport, "resolveWalletReport");
|
|
612
|
+
async function initializeResolvedWalletReport(requestedActors, configuration) {
|
|
613
|
+
activeWalletReport = await resolveWalletReport(requestedActors, configuration);
|
|
614
|
+
return activeWalletReport;
|
|
615
|
+
}
|
|
616
|
+
__name(initializeResolvedWalletReport, "initializeResolvedWalletReport");
|
|
617
|
+
function getResolvedWalletReport() {
|
|
618
|
+
return activeWalletReport;
|
|
619
|
+
}
|
|
620
|
+
__name(getResolvedWalletReport, "getResolvedWalletReport");
|
|
621
|
+
function formatSharedAccount(account, showPrivateKey) {
|
|
622
|
+
const lines = [
|
|
623
|
+
`[${account.accountIndex}] ${account.label}`,
|
|
624
|
+
`source: ${account.mnemonicKind === "built-in-dev" ? "built-in dev mnemonic" : "configured root mnemonic"}`,
|
|
625
|
+
`path: ${account.derivationPath}`,
|
|
626
|
+
`address: ${account.address}`
|
|
627
|
+
];
|
|
628
|
+
if (showPrivateKey) lines.push(`privateKey: ${account.privateKey ?? "unavailable"}`);
|
|
629
|
+
return lines.join("\n");
|
|
630
|
+
}
|
|
631
|
+
__name(formatSharedAccount, "formatSharedAccount");
|
|
632
|
+
function formatActorSpecificAccount(account) {
|
|
633
|
+
return [
|
|
634
|
+
account.label,
|
|
635
|
+
"source: actor mnemonic",
|
|
636
|
+
`path: ${account.derivationPath}`,
|
|
637
|
+
`address: ${account.address}`
|
|
638
|
+
].join("\n");
|
|
639
|
+
}
|
|
640
|
+
__name(formatActorSpecificAccount, "formatActorSpecificAccount");
|
|
641
|
+
function formatGenesisRewardAccount(account) {
|
|
642
|
+
const balance = account.accountIndex === 0 ? GENESIS_REWARD_AMOUNT / ATTO_XL1_PER_XL1 : 0n;
|
|
643
|
+
return [
|
|
644
|
+
`[${account.accountIndex}] ${account.label}`,
|
|
645
|
+
`path: ${account.derivationPath}`,
|
|
646
|
+
`address: ${account.address}`,
|
|
647
|
+
`privateKey: ${account.privateKey ?? "unavailable"}`,
|
|
648
|
+
`balance: ${balance.toString()} XL1`
|
|
649
|
+
].join("\n");
|
|
650
|
+
}
|
|
651
|
+
__name(formatGenesisRewardAccount, "formatGenesisRewardAccount");
|
|
652
|
+
function formatWalletReport(report) {
|
|
653
|
+
const sections = [];
|
|
654
|
+
const showSecrets = report.root.isBuiltInDevMnemonic;
|
|
655
|
+
sections.push(showSecrets ? "Development wallet detected." : "Wallet summary");
|
|
656
|
+
if (showSecrets) {
|
|
657
|
+
sections.push([
|
|
658
|
+
"DEVELOPMENT WALLET WARNING",
|
|
659
|
+
"",
|
|
660
|
+
"XL1 is using the built-in development mnemonic.",
|
|
661
|
+
"This mnemonic is fixed, public, and does not change between runs.",
|
|
662
|
+
"The addresses and private keys below are unsafe and must never be used for real funds, production systems, or shared environments.",
|
|
663
|
+
"Anyone with this information can fully control these accounts.",
|
|
664
|
+
"",
|
|
665
|
+
"Mnemonic:",
|
|
666
|
+
report.root.mnemonic
|
|
667
|
+
].join("\n"));
|
|
668
|
+
}
|
|
669
|
+
sections.push([
|
|
670
|
+
`Shared wallet accounts from ${report.root.basePath}:`,
|
|
671
|
+
"",
|
|
672
|
+
report.sharedAccounts.map((account) => formatSharedAccount(account, showSecrets)).join("\n\n")
|
|
673
|
+
].join("\n"));
|
|
674
|
+
if (report.actorSpecificAccounts.length > 0) {
|
|
675
|
+
sections.push([
|
|
676
|
+
"Actor-specific wallet accounts:",
|
|
677
|
+
"",
|
|
678
|
+
report.actorSpecificAccounts.map((account) => formatActorSpecificAccount(account)).join("\n\n")
|
|
679
|
+
].join("\n"));
|
|
680
|
+
}
|
|
681
|
+
if (report.insecureGenesisRewardAccounts) {
|
|
682
|
+
sections.push([
|
|
683
|
+
"INSECURE GENESIS REWARD WALLET WARNING",
|
|
684
|
+
"",
|
|
685
|
+
"XL1 is using a public, insecure fallback wallet for the genesis reward address.",
|
|
686
|
+
"This phrase is intentionally unsafe and must never be used for real funds, production systems, or shared environments.",
|
|
687
|
+
"Anyone with this information can fully control the genesis reward wallet.",
|
|
688
|
+
"",
|
|
689
|
+
"Genesis reward phrase:",
|
|
690
|
+
INSECURE_GENESIS_REWARD_MNEMONIC,
|
|
691
|
+
"",
|
|
692
|
+
`The genesis reward is sent to index 0 and starts with ${(GENESIS_REWARD_AMOUNT / ATTO_XL1_PER_XL1).toString()} XL1.`,
|
|
693
|
+
"",
|
|
694
|
+
`Genesis reward wallet accounts from ${DEFAULT_WALLET_PATH}:`,
|
|
695
|
+
"",
|
|
696
|
+
report.insecureGenesisRewardAccounts.map((account) => formatGenesisRewardAccount(account)).join("\n\n")
|
|
697
|
+
].join("\n"));
|
|
698
|
+
}
|
|
699
|
+
return sections.join("\n\n");
|
|
700
|
+
}
|
|
701
|
+
__name(formatWalletReport, "formatWalletReport");
|
|
702
|
+
async function resolveGenesisRewardAddress(config) {
|
|
703
|
+
if (config.chain.genesisRewardAddress) return config.chain.genesisRewardAddress;
|
|
704
|
+
const wallet = await generateXyoBaseWalletFromPhrase(INSECURE_GENESIS_REWARD_MNEMONIC);
|
|
705
|
+
const account = await wallet.derivePath("0");
|
|
706
|
+
return account.address;
|
|
707
|
+
}
|
|
708
|
+
__name(resolveGenesisRewardAddress, "resolveGenesisRewardAddress");
|
|
709
|
+
async function resolveWalletForActor(actorName, mnemonic, accountIndex) {
|
|
710
|
+
const fromReport = activeWalletReport ? actorName === ROOT_WALLET_RUNTIME_ID ? activeWalletReport.sharedAccounts.find((account) => account.accountIndex === 0) : activeWalletReport.actorSpecificAccounts.find((account) => account.actorName === actorName) ?? activeWalletReport.sharedAccounts.find((account) => account.actorName === actorName || account.label.split(", ").includes(getAccountLabel(actorName))) : void 0;
|
|
711
|
+
const resolvedMnemonic = fromReport?.mnemonic ?? mnemonic ?? BUILT_IN_DEV_MNEMONIC;
|
|
712
|
+
const resolvedAccountIndex = fromReport?.accountIndex ?? accountIndex ?? 0;
|
|
713
|
+
const wallet = await generateXyoBaseWalletFromPhrase(resolvedMnemonic);
|
|
714
|
+
return await wallet.derivePath(`${resolvedAccountIndex}`);
|
|
715
|
+
}
|
|
716
|
+
__name(resolveWalletForActor, "resolveWalletForActor");
|
|
717
|
+
|
|
718
|
+
// src/shared/init/initActorAccount.ts
|
|
439
719
|
var actorAccountSingletons = {};
|
|
440
720
|
async function initActorAccount({ config, logger }) {
|
|
441
721
|
const actorName = config.name;
|
|
442
722
|
if (isDefined(actorAccountSingletons[actorName])) return actorAccountSingletons[actorName];
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
const randomMnemonic = HDWallet.generateMnemonic();
|
|
447
|
-
logger?.warn(`[${actorName}] Using randomly generated mnemonic:
|
|
448
|
-
|
|
449
|
-
${randomMnemonic}
|
|
450
|
-
|
|
451
|
-
`);
|
|
452
|
-
walletPhrase = randomMnemonic;
|
|
453
|
-
}
|
|
454
|
-
const wallet = await generateXyoBaseWalletFromPhrase(walletPhrase);
|
|
455
|
-
const account = await wallet.derivePath(ADDRESS_INDEX.XYO);
|
|
723
|
+
const accountIndex = "accountIndex" in config && typeof config.accountIndex === "number" ? config.accountIndex : void 0;
|
|
724
|
+
const account = await resolveWalletForActor(actorName, config.mnemonic, accountIndex);
|
|
725
|
+
logger?.debug(`[${actorName}] Using wallet address ${account.address}`);
|
|
456
726
|
actorAccountSingletons[actorName] = account;
|
|
457
727
|
return actorAccountSingletons[actorName];
|
|
458
728
|
}
|
|
@@ -460,28 +730,18 @@ __name(initActorAccount, "initActorAccount");
|
|
|
460
730
|
|
|
461
731
|
// src/shared/init/initActorSeedPhrase.ts
|
|
462
732
|
import { assertEx, isString } from "@xylabs/sdk-js";
|
|
463
|
-
import { HDWallet as HDWallet2 } from "@xyo-network/sdk-js";
|
|
464
733
|
async function initActorSeedPhrase(context, bios) {
|
|
465
734
|
const { logger, config } = context;
|
|
466
735
|
const walletKind = config.name;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const
|
|
470
|
-
if (isString(
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
seedPhrase = mnemonic;
|
|
477
|
-
} else {
|
|
478
|
-
seedPhrase = HDWallet2.generateMnemonic();
|
|
479
|
-
logger?.log("[API] No mnemonic provided, using random mnemonic. This is not recommended for production use.");
|
|
480
|
-
logger?.log(`[API] Mnemonic: ${seedPhrase}`);
|
|
481
|
-
}
|
|
482
|
-
await bios.seedPhraseStore.set(walletKind, seedPhrase);
|
|
483
|
-
}
|
|
484
|
-
return assertEx(await bios.seedPhraseStore.get(walletKind), () => "Unable to acquire mnemonic from bios");
|
|
736
|
+
void bios;
|
|
737
|
+
const report = getResolvedWalletReport();
|
|
738
|
+
const account = config.name === ROOT_WALLET_RUNTIME_ID ? report?.sharedAccounts.find((entry) => entry.accountIndex === 0) : report?.actorSpecificAccounts.find((entry) => entry.actorName === config.name);
|
|
739
|
+
if (isString(account?.mnemonic)) return account.mnemonic;
|
|
740
|
+
if (isString(report?.root.mnemonic)) return report.root.mnemonic;
|
|
741
|
+
if (isString(config.mnemonic)) return config.mnemonic;
|
|
742
|
+
const fallback = getBuiltInDevMnemonic();
|
|
743
|
+
logger?.debug(`[${walletKind}] Falling back to built-in development mnemonic`);
|
|
744
|
+
return assertEx(fallback, () => "Unable to resolve mnemonic");
|
|
485
745
|
}
|
|
486
746
|
__name(initActorSeedPhrase, "initActorSeedPhrase");
|
|
487
747
|
|
|
@@ -535,13 +795,10 @@ function initStatusReporter({ logger }) {
|
|
|
535
795
|
__name(initStatusReporter, "initStatusReporter");
|
|
536
796
|
|
|
537
797
|
// src/shared/init/initWallet.ts
|
|
538
|
-
import { isDefined as isDefined2 } from "@xylabs/sdk-js";
|
|
539
|
-
import { boot } from "@xyo-network/bios";
|
|
540
|
-
import { HDWallet as HDWallet3 } from "@xyo-network/sdk-js";
|
|
541
798
|
async function initActorWallet(context, mnemonic) {
|
|
542
|
-
const
|
|
543
|
-
const
|
|
544
|
-
return await
|
|
799
|
+
const actorName = context.config.name === ROOT_WALLET_RUNTIME_ID ? ROOT_WALLET_RUNTIME_ID : context.config.name;
|
|
800
|
+
const accountIndex = "accountIndex" in context.config && typeof context.config.accountIndex === "number" ? context.config.accountIndex : void 0;
|
|
801
|
+
return await resolveWalletForActor(actorName, mnemonic ?? context.config.mnemonic, accountIndex);
|
|
545
802
|
}
|
|
546
803
|
__name(initActorWallet, "initActorWallet");
|
|
547
804
|
|
|
@@ -642,20 +899,25 @@ __name(rootLocatorFromConfig, "rootLocatorFromConfig");
|
|
|
642
899
|
export {
|
|
643
900
|
ApiConfigContext,
|
|
644
901
|
ApiConfigZod,
|
|
902
|
+
BUILT_IN_DEV_MNEMONIC,
|
|
645
903
|
BasisPointsZod,
|
|
646
904
|
BridgeConfigContext,
|
|
647
905
|
BridgeConfigZod,
|
|
648
906
|
BridgeSettingsZod,
|
|
649
907
|
DEFAULT_BLOCK_PRODUCTION_CHECK_INTERVAL,
|
|
650
908
|
DefaultServiceProvider,
|
|
909
|
+
GENESIS_REWARD_AMOUNT,
|
|
651
910
|
GenericHost,
|
|
911
|
+
INSECURE_GENESIS_REWARD_MNEMONIC,
|
|
652
912
|
MempoolConfigContext,
|
|
653
913
|
MempoolConfigZod,
|
|
654
914
|
Orchestrator,
|
|
655
915
|
ProducerConfigContext,
|
|
656
916
|
ProducerConfigZod,
|
|
917
|
+
ROOT_WALLET_RUNTIME_ID,
|
|
657
918
|
RewardRedemptionConfigContext,
|
|
658
919
|
RewardRedemptionConfigZod,
|
|
920
|
+
SHARED_ACCOUNT_REPORT_COUNT,
|
|
659
921
|
ServiceLifetime,
|
|
660
922
|
ValidatorActor,
|
|
661
923
|
ValidatorConfigContext,
|
|
@@ -675,13 +937,20 @@ export {
|
|
|
675
937
|
basicRemoteRunnerLocator,
|
|
676
938
|
basicRemoteViewerLocator,
|
|
677
939
|
buildTelemetryConfig,
|
|
940
|
+
clearResolvedWalletReport,
|
|
678
941
|
createProducerChainStakeIntentBlock,
|
|
942
|
+
formatWalletReport,
|
|
943
|
+
getBuiltInDevMnemonic,
|
|
944
|
+
getInsecureGenesisRewardMnemonic,
|
|
945
|
+
getReservedActorIndex,
|
|
946
|
+
getResolvedWalletReport,
|
|
679
947
|
initActorAccount,
|
|
680
948
|
initActorSeedPhrase,
|
|
681
949
|
initActorWallet,
|
|
682
950
|
initBridgedArchivistModule,
|
|
683
951
|
initBridgedModule,
|
|
684
952
|
initStatusReporter,
|
|
953
|
+
initializeResolvedWalletReport,
|
|
685
954
|
isApiConfig,
|
|
686
955
|
isApiConfigContext,
|
|
687
956
|
isBridgeConfig,
|
|
@@ -695,6 +964,11 @@ export {
|
|
|
695
964
|
isValidatorConfig,
|
|
696
965
|
isValidatorConfigContext,
|
|
697
966
|
mergeConfig,
|
|
967
|
+
resolveActorWallet,
|
|
968
|
+
resolveGenesisRewardAddress,
|
|
969
|
+
resolveRootWallet,
|
|
970
|
+
resolveWalletForActor,
|
|
971
|
+
resolveWalletReport,
|
|
698
972
|
rootLocatorFromConfig,
|
|
699
973
|
toApiConfig,
|
|
700
974
|
toApiConfigContext,
|