@xyo-network/xl1-cli-lib 1.16.4 → 1.16.6
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/node/index.mjs +15 -14
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/orchestration/actor/implementation/BalanceActor.d.ts +1 -1
- package/dist/node/orchestration/actor/implementation/BalanceActor.d.ts.map +1 -1
- package/dist/node/orchestration/actor/implementation/ProducerActor.d.ts +1 -1
- package/dist/node/orchestration/actor/implementation/ProducerActor.d.ts.map +1 -1
- package/dist/node/orchestration/actor/implementation/ValidatorActor.d.ts +1 -1
- package/dist/node/orchestration/actor/implementation/ValidatorActor.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/balance.d.ts +3 -3
- package/dist/node/orchestration/services/implementation/balance.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/chain/evm.d.ts +2 -2
- package/dist/node/orchestration/services/implementation/chain/evm.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/chain/index.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/chain/index.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/iterator.d.ts +2 -1
- package/dist/node/orchestration/services/implementation/iterator.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/pendingTransactions.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/pendingTransactions.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/producer.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/producer.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/reward.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/reward.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/time.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/time.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/transfer.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/transfer.d.ts.map +1 -1
- package/dist/node/orchestration/services/implementation/validator.d.ts +1 -1
- package/dist/node/orchestration/services/implementation/validator.d.ts.map +1 -1
- package/dist/node/xl1.mjs +15 -14
- package/dist/node/xl1.mjs.map +1 -1
- package/package.json +24 -22
- package/src/orchestration/actor/implementation/BalanceActor.ts +1 -1
- package/src/orchestration/actor/implementation/ProducerActor.ts +3 -2
- package/src/orchestration/initServices.ts +1 -1
- package/src/orchestration/services/implementation/balance.ts +5 -6
- package/src/orchestration/services/implementation/chain/evm.ts +2 -2
- package/src/orchestration/services/implementation/chain/index.ts +1 -2
- package/src/orchestration/services/implementation/iterator.ts +6 -9
- package/src/orchestration/services/implementation/pendingTransactions.ts +1 -2
- package/src/orchestration/services/implementation/producer.ts +1 -2
- package/src/orchestration/services/implementation/reward.ts +3 -2
- package/src/orchestration/services/implementation/time.ts +1 -2
- package/src/orchestration/services/implementation/transfer.ts +1 -2
- package/src/orchestration/services/implementation/validator.ts +1 -1
- package/src/spec/BootstrapChain.spec.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/xl1-cli-lib",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.6",
|
|
4
4
|
"description": "XYO Layer One CLI Library",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -41,32 +41,33 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@opentelemetry/api": "~1.9.0",
|
|
44
|
-
"@xylabs/array": "~5.0.
|
|
45
|
-
"@xylabs/assert": "~5.0.
|
|
46
|
-
"@xylabs/base": "~5.0.
|
|
47
|
-
"@xylabs/creatable": "~5.0.
|
|
48
|
-
"@xylabs/delay": "~5.0.
|
|
49
|
-
"@xylabs/hex": "~5.0.
|
|
50
|
-
"@xylabs/logger": "~5.0.
|
|
51
|
-
"@xylabs/object": "~5.0.
|
|
52
|
-
"@xylabs/promise": "~5.0.
|
|
53
|
-
"@xylabs/telemetry": "~5.0.
|
|
54
|
-
"@xylabs/typeof": "~5.0.
|
|
44
|
+
"@xylabs/array": "~5.0.24",
|
|
45
|
+
"@xylabs/assert": "~5.0.24",
|
|
46
|
+
"@xylabs/base": "~5.0.24",
|
|
47
|
+
"@xylabs/creatable": "~5.0.24",
|
|
48
|
+
"@xylabs/delay": "~5.0.24",
|
|
49
|
+
"@xylabs/hex": "~5.0.24",
|
|
50
|
+
"@xylabs/logger": "~5.0.24",
|
|
51
|
+
"@xylabs/object": "~5.0.24",
|
|
52
|
+
"@xylabs/promise": "~5.0.24",
|
|
53
|
+
"@xylabs/telemetry": "~5.0.24",
|
|
54
|
+
"@xylabs/typeof": "~5.0.24",
|
|
55
55
|
"@xyo-network/archivist-lmdb": "~5.1.19",
|
|
56
56
|
"@xyo-network/archivist-memory": "~5.1.19",
|
|
57
57
|
"@xyo-network/archivist-model": "~5.1.19",
|
|
58
|
-
"@xyo-network/chain-api": "~1.16.
|
|
59
|
-
"@xyo-network/chain-bridge": "~1.16.
|
|
60
|
-
"@xyo-network/chain-mempool": "~1.16.
|
|
61
|
-
"@xyo-network/chain-reward-redemption": "~1.16.
|
|
62
|
-
"@xyo-network/chain-sdk": "~1.16.
|
|
58
|
+
"@xyo-network/chain-api": "~1.16.6",
|
|
59
|
+
"@xyo-network/chain-bridge": "~1.16.6",
|
|
60
|
+
"@xyo-network/chain-mempool": "~1.16.6",
|
|
61
|
+
"@xyo-network/chain-reward-redemption": "~1.16.6",
|
|
62
|
+
"@xyo-network/chain-sdk": "~1.16.6",
|
|
63
|
+
"@xyo-network/chain-services": "~1.16.6",
|
|
63
64
|
"@xyo-network/payload-builder": "~5.1.19",
|
|
64
65
|
"@xyo-network/payload-model": "~5.1.19",
|
|
65
66
|
"@xyo-network/wallet": "~5.1.19",
|
|
66
67
|
"@xyo-network/wallet-model": "~5.1.19",
|
|
67
|
-
"@xyo-network/xl1-protocol": "~1.13.
|
|
68
|
-
"@xyo-network/xl1-protocol-sdk": "~1.16.
|
|
69
|
-
"@xyo-network/xl1-validation": "~1.16.
|
|
68
|
+
"@xyo-network/xl1-protocol": "~1.13.5",
|
|
69
|
+
"@xyo-network/xl1-protocol-sdk": "~1.16.6",
|
|
70
|
+
"@xyo-network/xl1-validation": "~1.16.6",
|
|
70
71
|
"async-mutex": "~0.5.0",
|
|
71
72
|
"cosmiconfig": "~9.0.0",
|
|
72
73
|
"dotenv": "~17.2.3",
|
|
@@ -77,11 +78,12 @@
|
|
|
77
78
|
"devDependencies": {
|
|
78
79
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
79
80
|
"@xylabs/tsconfig": "~7.2.8",
|
|
80
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
81
|
+
"@xylabs/vitest-extended": "~5.0.24",
|
|
81
82
|
"@xyo-network/account-model": "~5.1.19",
|
|
83
|
+
"@xyo-network/chain-test": "~1.16.6",
|
|
82
84
|
"eslint": "^9.39.1",
|
|
83
85
|
"lmdb": "~3.4.4",
|
|
84
|
-
"nodemon": "~3.1.
|
|
86
|
+
"nodemon": "~3.1.11",
|
|
85
87
|
"rimraf": "~6.1.0",
|
|
86
88
|
"tslib": "~2.8.1",
|
|
87
89
|
"typescript": "~5.9.3",
|
|
@@ -44,7 +44,7 @@ export class BalanceActor extends Actor<BalanceActorParams> {
|
|
|
44
44
|
if (this._updateMutex.isLocked()) return
|
|
45
45
|
await this._updateMutex.runExclusive(async () => {
|
|
46
46
|
const head = await PayloadBuilder.hash(await this.chainIterator.head())
|
|
47
|
-
await this.balanceService.
|
|
47
|
+
await this.balanceService.accountBalances([], head)
|
|
48
48
|
})
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -2,7 +2,8 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import { toHex } from '@xylabs/hex'
|
|
3
3
|
import type { Promisable } from '@xylabs/promise'
|
|
4
4
|
import { isDefined, isUndefined } from '@xylabs/typeof'
|
|
5
|
-
import {
|
|
5
|
+
import { createDeclarationIntent } from '@xyo-network/chain-sdk'
|
|
6
|
+
import { BaseBlockProducerService } from '@xyo-network/chain-services'
|
|
6
7
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
7
8
|
import type { PayloadBundle } from '@xyo-network/payload-model'
|
|
8
9
|
import { PayloadBundleSchema } from '@xyo-network/payload-model'
|
|
@@ -236,7 +237,7 @@ export class ProducerActor extends Actor<ProducerActorParams> {
|
|
|
236
237
|
// Check if we have a valid balance before declaring intent
|
|
237
238
|
const head = this._lastProducedBlock?.[0]._hash
|
|
238
239
|
if (isDefined(head)) {
|
|
239
|
-
const balances = await this.balanceService.
|
|
240
|
+
const balances = await this.balanceService.accountBalances([this.account.address], head)
|
|
240
241
|
const currentBalance = balances[this.account.address] ?? 0n
|
|
241
242
|
if (currentBalance <= 0n) {
|
|
242
243
|
this.logger?.error(`Producer ${this.account.address} has no balance.`)
|
|
@@ -5,10 +5,10 @@ import type { Address } from '@xylabs/hex'
|
|
|
5
5
|
import { asAddress } from '@xylabs/hex'
|
|
6
6
|
import type { Logger } from '@xylabs/logger'
|
|
7
7
|
import { isDefined } from '@xylabs/typeof'
|
|
8
|
-
import type { BaseBlockProducerServiceParams, XyoValidatorParams } from '@xyo-network/chain-sdk'
|
|
9
8
|
import {
|
|
10
9
|
initTelemetry, startupSpanAsync, StepSizes, validateHydratedBlockState,
|
|
11
10
|
} from '@xyo-network/chain-sdk'
|
|
11
|
+
import type { BaseBlockProducerServiceParams, XyoValidatorParams } from '@xyo-network/chain-services'
|
|
12
12
|
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
13
13
|
import {
|
|
14
14
|
type ChainServiceCollectionV2, type Config, readPayloadMapFromStore,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type
|
|
3
|
-
import { BaseAccountBalanceService } from '@xyo-network/chain-sdk'
|
|
2
|
+
import { BaseAccountBalanceService, type BaseAccountBalanceServiceParams } from '@xyo-network/chain-services'
|
|
4
3
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
5
|
-
import type {
|
|
4
|
+
import type { AccountBalanceService } from '@xyo-network/xl1-protocol-sdk'
|
|
6
5
|
|
|
7
|
-
let balanceServiceSingleton: Promisable<
|
|
6
|
+
let balanceServiceSingleton: Promisable<AccountBalanceService> | undefined
|
|
8
7
|
|
|
9
|
-
export const initBalanceService: Initializable<BaseAccountBalanceServiceParams,
|
|
10
|
-
= async (params): Promise<
|
|
8
|
+
export const initBalanceService: Initializable<BaseAccountBalanceServiceParams, AccountBalanceService>
|
|
9
|
+
= async (params): Promise<AccountBalanceService> => {
|
|
11
10
|
if (balanceServiceSingleton) return balanceServiceSingleton
|
|
12
11
|
balanceServiceSingleton = await BaseAccountBalanceService.create(params)
|
|
13
12
|
return balanceServiceSingleton
|
|
@@ -3,8 +3,8 @@ import type { Address } from '@xylabs/hex'
|
|
|
3
3
|
import { asAddress, ZERO_ADDRESS } from '@xylabs/hex'
|
|
4
4
|
import type { Promisable } from '@xylabs/promise'
|
|
5
5
|
import { isDefined } from '@xylabs/typeof'
|
|
6
|
-
import type { BaseAccountableServiceParams } from '@xyo-network/chain-
|
|
7
|
-
import { EvmChainService } from '@xyo-network/chain-
|
|
6
|
+
import type { BaseAccountableServiceParams } from '@xyo-network/chain-services'
|
|
7
|
+
import { EvmChainService } from '@xyo-network/chain-services'
|
|
8
8
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
9
9
|
import type { Config } from '@xyo-network/xl1-protocol-sdk'
|
|
10
10
|
import type { ContractRunner } from 'ethers'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CreatableName } from '@xylabs/creatable'
|
|
2
2
|
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
import type
|
|
4
|
-
import { MemoryChainService } from '@xyo-network/chain-sdk'
|
|
3
|
+
import { type BaseAccountableServiceParams, MemoryChainService } from '@xyo-network/chain-services'
|
|
5
4
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
6
5
|
import type { ChainService } from '@xyo-network/xl1-protocol-sdk'
|
|
7
6
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BaseElectionServicesParams,
|
|
3
|
-
Initializable,
|
|
4
|
-
XyoChainIteratorParams,
|
|
5
|
-
XyoStakeIntentServiceParams,
|
|
6
|
-
} from '@xyo-network/chain-sdk'
|
|
1
|
+
import type { Initializable } from '@xyo-network/chain-sdk'
|
|
7
2
|
import {
|
|
8
|
-
BaseElectionService,
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
BaseElectionService,
|
|
4
|
+
type BaseElectionServicesParams,
|
|
5
|
+
ChainBlockNumberIterationService,
|
|
6
|
+
type XyoChainIteratorParams, XyoStakeIntentService, type XyoStakeIntentServiceParams,
|
|
7
|
+
} from '@xyo-network/chain-services'
|
|
11
8
|
import type {
|
|
12
9
|
ElectionService, EventingChainBlockNumberIteratorService, StakeIntentService,
|
|
13
10
|
} from '@xyo-network/xl1-protocol-sdk'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type
|
|
3
|
-
import { BasePendingTransactionsService } from '@xyo-network/chain-sdk'
|
|
2
|
+
import { BasePendingTransactionsService, type BasePendingTransactionsServiceParams } from '@xyo-network/chain-services'
|
|
4
3
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
5
4
|
import type { PendingTransactionsService } from '@xyo-network/xl1-protocol-sdk'
|
|
6
5
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type
|
|
3
|
-
import { BaseBlockProducerService } from '@xyo-network/chain-sdk'
|
|
2
|
+
import { BaseBlockProducerService, type BaseBlockProducerServiceParams } from '@xyo-network/chain-services'
|
|
4
3
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
5
4
|
import type { BlockProducerService } from '@xyo-network/xl1-protocol-sdk'
|
|
6
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
type BaseBlockRewardServiceParams, EvmBlockRewardService, type EvmBlockRewardServiceParams, MemoryBlockRewardService,
|
|
4
|
+
} from '@xyo-network/chain-services'
|
|
4
5
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
5
6
|
import type { BlockRewardService, Config } from '@xyo-network/xl1-protocol-sdk'
|
|
6
7
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type
|
|
3
|
-
import { BaseTimeSyncService } from '@xyo-network/chain-sdk'
|
|
2
|
+
import { type BaseTimeServiceParams, BaseTimeSyncService } from '@xyo-network/chain-services'
|
|
4
3
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
5
4
|
import type { TimeSyncService } from '@xyo-network/xl1-protocol-sdk'
|
|
6
5
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type
|
|
3
|
-
import { BaseAccountTransfersService } from '@xyo-network/chain-sdk'
|
|
2
|
+
import { type BaseAccountTransferServiceParams, BaseAccountTransfersService } from '@xyo-network/chain-services'
|
|
4
3
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
5
4
|
import type { AccountTransfersService } from '@xyo-network/xl1-protocol-sdk'
|
|
6
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
import type { BaseBlockProducerServiceParams } from '@xyo-network/chain-
|
|
2
|
+
import type { BaseBlockProducerServiceParams } from '@xyo-network/chain-services'
|
|
3
3
|
import type { Initializable } from '@xyo-network/xl1-protocol'
|
|
4
4
|
import type { BlockProducerService } from '@xyo-network/xl1-protocol-sdk'
|
|
5
5
|
|
|
@@ -6,12 +6,12 @@ import { assertEx } from '@xylabs/assert'
|
|
|
6
6
|
import { delay } from '@xylabs/delay'
|
|
7
7
|
import type { Address } from '@xylabs/hex'
|
|
8
8
|
import { asAddress, hexFromBigInt } from '@xylabs/hex'
|
|
9
|
+
import { EvmChainService } from '@xyo-network/chain-services'
|
|
9
10
|
import {
|
|
10
11
|
approveTestStakeChainAddress,
|
|
11
12
|
createTestChainContract, createTestErc20, createTestGenesisBlock,
|
|
12
|
-
EvmChainService,
|
|
13
13
|
startGanache, stopGanache, transferTestTokens,
|
|
14
|
-
} from '@xyo-network/chain-
|
|
14
|
+
} from '@xyo-network/chain-test'
|
|
15
15
|
import { HDWallet } from '@xyo-network/wallet'
|
|
16
16
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
17
17
|
import type { ChainServiceCollectionV2 } from '@xyo-network/xl1-protocol-sdk'
|