@xyo-network/xl1-protocol-sdk 1.16.9 → 1.16.11
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/neutral/SignedBigInt.d.ts +1 -1
- package/dist/neutral/SignedBigInt.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/allHashesPresent.d.ts +1 -1
- package/dist/neutral/block/hydrate/allHashesPresent.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/hydrateBlock.d.ts +1 -1
- package/dist/neutral/block/hydrate/hydrateBlock.d.ts.map +1 -1
- package/dist/neutral/block/hydrate/tryHydrateBlock.d.ts +1 -1
- package/dist/neutral/block/hydrate/tryHydrateBlock.d.ts.map +1 -1
- package/dist/neutral/block/primitives/frames/calculateFramesFromRange.d.ts.map +1 -1
- package/dist/neutral/block/primitives/hashFromBlockNumber.d.ts +1 -1
- package/dist/neutral/block/primitives/hashFromBlockNumber.d.ts.map +1 -1
- package/dist/neutral/block/primitives/payloads/ChainWindow.d.ts +1 -1
- package/dist/neutral/block/primitives/payloads/ChainWindow.d.ts.map +1 -1
- package/dist/neutral/block/primitives/transfers/transfersSummary.d.ts +1 -1
- package/dist/neutral/block/primitives/transfers/transfersSummary.d.ts.map +1 -1
- package/dist/neutral/config/Config.d.ts +3 -15
- package/dist/neutral/config/Config.d.ts.map +1 -1
- package/dist/neutral/config/Producer.d.ts +1 -5
- package/dist/neutral/config/Producer.d.ts.map +1 -1
- package/dist/neutral/config/Validation.d.ts +2 -10
- package/dist/neutral/config/Validation.d.ts.map +1 -1
- package/dist/neutral/eip-712/Payloads/EIP712Data.d.ts +1 -1
- package/dist/neutral/eip-712/Payloads/EIP712Signature.d.ts +2 -2
- package/dist/neutral/eip-712/Payloads/EIP712Signature.d.ts.map +1 -1
- package/dist/neutral/eip-712/verify.d.ts.map +1 -1
- package/dist/neutral/index.mjs +320 -103
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/instances/Address.d.ts +1 -2
- package/dist/neutral/instances/Address.d.ts.map +1 -1
- package/dist/neutral/instances/Object.d.ts +1 -1
- package/dist/neutral/instances/Signature.d.ts +1 -1
- package/dist/neutral/instances/Signature.d.ts.map +1 -1
- package/dist/neutral/instances/modifiers/BlockWindowInstance.d.ts +1 -1
- package/dist/neutral/instances/modifiers/BlockWindowInstance.d.ts.map +1 -1
- package/dist/neutral/instances/modifiers/Validatable.d.ts +1 -1
- package/dist/neutral/instances/modifiers/Validatable.d.ts.map +1 -1
- package/dist/neutral/instances/transaction/TransactionFields.d.ts +1 -1
- package/dist/neutral/instances/transaction/TransactionFields.d.ts.map +1 -1
- package/dist/neutral/map/AsynchronousMap.d.ts +1 -1
- package/dist/neutral/map/AsynchronousMap.d.ts.map +1 -1
- package/dist/neutral/model/ChainContext/ChainContext.d.ts +1 -1
- package/dist/neutral/model/ChainContext/ChainStakeContext.d.ts +4 -5
- package/dist/neutral/model/ChainContext/ChainStakeContext.d.ts.map +1 -1
- package/dist/neutral/model/ChainContext/ChainStateContext.d.ts +1 -2
- package/dist/neutral/model/ChainContext/ChainStateContext.d.ts.map +1 -1
- package/dist/neutral/model/ChainFork/ChainForkStatic.d.ts +1 -1
- package/dist/neutral/model/ChainFork/ChainForkStatic.d.ts.map +1 -1
- package/dist/neutral/model/PayloadMap.d.ts +1 -1
- package/dist/neutral/model/PayloadMap.d.ts.map +1 -1
- package/dist/neutral/model/Position.d.ts +1 -1
- package/dist/neutral/model/Position.d.ts.map +1 -1
- package/dist/neutral/model/index.d.ts +0 -2
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/dist/neutral/payloads/AddressPairPayload.d.ts +2 -2
- package/dist/neutral/payloads/AddressPairPayload.d.ts.map +1 -1
- package/dist/neutral/payloads/netBalancesForPayloads.d.ts +2 -4
- package/dist/neutral/payloads/netBalancesForPayloads.d.ts.map +1 -1
- package/dist/neutral/payloads/netTransfersForPayloads.d.ts +1 -1
- package/dist/neutral/payloads/netTransfersForPayloads.d.ts.map +1 -1
- package/dist/neutral/payloads/summary/BalancesStepSummary.d.ts +3 -3
- package/dist/neutral/payloads/summary/BalancesStepSummary.d.ts.map +1 -1
- package/dist/neutral/payloads/summary/StepSummary.d.ts +1 -2
- package/dist/neutral/payloads/summary/StepSummary.d.ts.map +1 -1
- package/dist/neutral/payloads/summary/TransfersSummary.d.ts +3 -3
- package/dist/neutral/payloads/summary/TransfersSummary.d.ts.map +1 -1
- package/dist/neutral/primitives/step/completedStepRewardAddress.d.ts +1 -1
- package/dist/neutral/primitives/step/completedStepRewardAddress.d.ts.map +1 -1
- package/dist/neutral/primitives/step/derivedReceiveAddress.d.ts +1 -1
- package/dist/neutral/primitives/step/derivedReceiveAddress.d.ts.map +1 -1
- package/dist/neutral/primitives/summary/balances/balancesSummary.d.ts +1 -1
- package/dist/neutral/primitives/summary/balances/balancesSummary.d.ts.map +1 -1
- package/dist/neutral/primitives/summary/transfers/transfersSummary.d.ts +1 -1
- package/dist/neutral/primitives/summary/transfers/transfersSummary.d.ts.map +1 -1
- package/dist/neutral/primitives/timeBudget.d.ts +1 -1
- package/dist/neutral/provider/DataLake.d.ts +1 -1
- package/dist/neutral/provider/DataLake.d.ts.map +1 -1
- package/dist/neutral/provider/TransactionSubmitter.d.ts +1 -2
- package/dist/neutral/provider/TransactionSubmitter.d.ts.map +1 -1
- package/dist/neutral/provider/XyoGateway.d.ts +1 -1
- package/dist/neutral/provider/XyoGateway.d.ts.map +1 -1
- package/dist/neutral/provider/XyoGatewayRunner.d.ts +1 -2
- package/dist/neutral/provider/XyoGatewayRunner.d.ts.map +1 -1
- package/dist/neutral/provider/XyoNetwork.d.ts +1 -1
- package/dist/neutral/provider/XyoNetwork.d.ts.map +1 -1
- package/dist/neutral/provider/XyoRunner.d.ts +1 -2
- package/dist/neutral/provider/XyoRunner.d.ts.map +1 -1
- package/dist/neutral/provider/XyoWallet.d.ts +1 -2
- package/dist/neutral/provider/XyoWallet.d.ts.map +1 -1
- package/dist/neutral/provider/permissions/InvokerPermission.d.ts +1 -1
- package/dist/neutral/provider/signer/XyoSigner.d.ts +1 -2
- package/dist/neutral/provider/signer/XyoSigner.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/NetworkStakeViewer.d.ts +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/NetworkStakeViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByStakerViewer.d.ts +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/ByStakerViewer.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/Options.d.ts +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/Options.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/MethodsTemplate.d.ts +1 -1
- package/dist/neutral/provider/viewer/NetworkStake/Rewards/templates/MethodsTemplate.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/StepViewer.d.ts +1 -2
- package/dist/neutral/provider/viewer/StepViewer.d.ts.map +1 -1
- package/dist/neutral/services/AccountTransfersService.d.ts +1 -2
- package/dist/neutral/services/AccountTransfersService.d.ts.map +1 -1
- package/dist/neutral/services/BlockRewardService.d.ts +1 -1
- package/dist/neutral/services/BlockRewardService.d.ts.map +1 -1
- package/dist/neutral/services/BlockRewardServiceV2.d.ts +1 -1
- package/dist/neutral/services/BlockRewardServiceV2.d.ts.map +1 -1
- package/dist/neutral/services/Chain/ChainHeadService.d.ts +1 -1
- package/dist/neutral/services/Chain/ChainHeadService.d.ts.map +1 -1
- package/dist/neutral/services/ChainIterator/ChainIteratorService.d.ts +1 -3
- package/dist/neutral/services/ChainIterator/ChainIteratorService.d.ts.map +1 -1
- package/dist/neutral/services/ChainIterator/ChainIteratorServiceEventData.d.ts +1 -1
- package/dist/neutral/services/Election.d.ts +1 -1
- package/dist/neutral/services/Election.d.ts.map +1 -1
- package/dist/neutral/services/Params.d.ts +1 -1
- package/dist/neutral/services/Params.d.ts.map +1 -1
- package/dist/neutral/services/PendingTransactionsService.d.ts +1 -1
- package/dist/neutral/services/PendingTransactionsService.d.ts.map +1 -1
- package/dist/neutral/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts +3 -4
- package/dist/neutral/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts.map +1 -1
- package/dist/neutral/services/StakeIntentService/StakeIntentService.d.ts +1 -1
- package/dist/neutral/services/StakeIntentService/StakeIntentService.d.ts.map +1 -1
- package/dist/neutral/simple/accountBalance/SimpleAccountBalanceViewer.d.ts +17 -0
- package/dist/neutral/simple/accountBalance/SimpleAccountBalanceViewer.d.ts.map +1 -0
- package/dist/neutral/simple/accountBalance/index.d.ts +2 -0
- package/dist/neutral/simple/accountBalance/index.d.ts.map +1 -0
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts.map +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeViewer.d.ts +1 -1
- package/dist/neutral/simple/datalake/SimpleDataLakeViewer.d.ts.map +1 -1
- package/dist/neutral/simple/gateway/SimpleXyoGateway.d.ts +1 -1
- package/dist/neutral/simple/gateway/SimpleXyoGateway.d.ts.map +1 -1
- package/dist/neutral/simple/gateway/SimpleXyoGatewayRunner.d.ts +5 -5
- package/dist/neutral/simple/gateway/SimpleXyoGatewayRunner.d.ts.map +1 -1
- package/dist/neutral/simple/index.d.ts +2 -0
- package/dist/neutral/simple/index.d.ts.map +1 -1
- package/dist/neutral/simple/runner/SimpleXyoRunner.d.ts +1 -1
- package/dist/neutral/simple/runner/SimpleXyoRunner.d.ts.map +1 -1
- package/dist/neutral/simple/signer/SimpleXyoSigner.d.ts +1 -2
- package/dist/neutral/simple/signer/SimpleXyoSigner.d.ts.map +1 -1
- package/dist/neutral/simple/timesync/SimpleTimeSyncViewer.d.ts +14 -0
- package/dist/neutral/simple/timesync/SimpleTimeSyncViewer.d.ts.map +1 -0
- package/dist/neutral/simple/timesync/index.d.ts +2 -0
- package/dist/neutral/simple/timesync/index.d.ts.map +1 -0
- package/dist/neutral/transaction/buildTransaction.d.ts +1 -1
- package/dist/neutral/transaction/buildTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/buildUnsignedTransaction.d.ts +1 -1
- package/dist/neutral/transaction/buildUnsignedTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/confirmSubmittedTransaction.d.ts +1 -1
- package/dist/neutral/transaction/confirmSubmittedTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/hydrateTransaction.d.ts +1 -1
- package/dist/neutral/transaction/hydrateTransaction.d.ts.map +1 -1
- package/dist/neutral/transaction/primitives/transactionElevatedPayloads.d.ts +1 -1
- package/dist/neutral/transaction/primitives/transactionElevatedPayloads.d.ts.map +1 -1
- package/dist/neutral/transaction/script.d.ts +1 -1
- package/dist/neutral/transaction/script.d.ts.map +1 -1
- package/dist/neutral/validation/block/BlockValidationFunction.d.ts +1 -1
- package/dist/neutral/validation/block/BlockValidationFunction.d.ts.map +1 -1
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts +1 -1
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts.map +1 -1
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts +1 -1
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts.map +1 -1
- package/dist/neutral/validation/block/error.d.ts +1 -1
- package/dist/neutral/validation/block/error.d.ts.map +1 -1
- package/dist/neutral/viewers/AccountBalance.d.ts +5 -10
- package/dist/neutral/viewers/AccountBalance.d.ts.map +1 -1
- package/dist/neutral/viewers/Block.d.ts +6 -5
- package/dist/neutral/viewers/Block.d.ts.map +1 -1
- package/dist/neutral/viewers/Chain.d.ts +1 -1
- package/dist/neutral/viewers/Chain.d.ts.map +1 -1
- package/dist/neutral/viewers/ChainContract.d.ts +1 -1
- package/dist/neutral/viewers/ChainContract.d.ts.map +1 -1
- package/dist/neutral/viewers/Fork.d.ts +1 -1
- package/dist/neutral/viewers/Fork.d.ts.map +1 -1
- package/dist/neutral/viewers/NetworkStakeStepReward.d.ts +1 -2
- package/dist/neutral/viewers/NetworkStakeStepReward.d.ts.map +1 -1
- package/dist/neutral/viewers/Stake.d.ts +22 -3
- package/dist/neutral/viewers/Stake.d.ts.map +1 -1
- package/dist/neutral/{model → viewers}/StakeEvents.d.ts +2 -4
- package/dist/neutral/viewers/StakeEvents.d.ts.map +1 -0
- package/dist/neutral/viewers/StakeTotals.d.ts +1 -2
- package/dist/neutral/viewers/StakeTotals.d.ts.map +1 -1
- package/dist/neutral/viewers/StepStake.d.ts +1 -2
- package/dist/neutral/viewers/StepStake.d.ts.map +1 -1
- package/dist/neutral/viewers/TimeSync.d.ts +2 -3
- package/dist/neutral/viewers/TimeSync.d.ts.map +1 -1
- package/dist/neutral/viewers/Transaction.d.ts +1 -2
- package/dist/neutral/viewers/Transaction.d.ts.map +1 -1
- package/dist/neutral/viewers/TransferBalance.d.ts +1 -2
- package/dist/neutral/viewers/TransferBalance.d.ts.map +1 -1
- package/dist/neutral/viewers/index.d.ts +1 -0
- package/dist/neutral/viewers/index.d.ts.map +1 -1
- package/package.json +16 -27
- package/src/SignedBigInt.ts +2 -2
- package/src/block/hydrate/allHashesPresent.ts +1 -1
- package/src/block/hydrate/blockPayloadsFromHydratedBlock.ts +1 -1
- package/src/block/hydrate/hydrateBlock.ts +2 -2
- package/src/block/hydrate/transactionsFromHydratedBlock.ts +1 -1
- package/src/block/hydrate/tryHydrateBlock.ts +2 -2
- package/src/block/primitives/blockFromBlockNumber.ts +3 -3
- package/src/block/primitives/frames/calculateFramesFromRange.ts +3 -2
- package/src/block/primitives/hashFromBlockNumber.ts +1 -1
- package/src/block/primitives/payloads/ChainWindow.ts +1 -1
- package/src/block/primitives/transfers/transfersStepSummaryFromRange.ts +2 -2
- package/src/block/primitives/transfers/transfersSummary.ts +6 -4
- package/src/config/Log.ts +2 -2
- package/src/config/Producer.ts +1 -1
- package/src/config/Validation.ts +1 -1
- package/src/config/storage/driver/Mongo.ts +1 -1
- package/src/driver/memory/MemoryMap.ts +1 -1
- package/src/eip-712/Payloads/EIP712Data.ts +1 -1
- package/src/eip-712/Payloads/EIP712Signature.ts +1 -2
- package/src/eip-712/verify.ts +1 -2
- package/src/instances/Address.ts +1 -2
- package/src/instances/Object.ts +1 -1
- package/src/instances/Signature.ts +1 -1
- package/src/instances/modifiers/BlockWindowInstance.ts +1 -1
- package/src/instances/modifiers/Validatable.ts +1 -1
- package/src/instances/transaction/TransactionFields.ts +1 -1
- package/src/map/AsynchronousMap.ts +1 -1
- package/src/model/ChainContext/ChainContext.ts +2 -2
- package/src/model/ChainContext/ChainStakeContext.ts +6 -5
- package/src/model/ChainContext/ChainStateContext.ts +1 -2
- package/src/model/ChainFork/ChainForkStatic.ts +1 -1
- package/src/model/PayloadMap.ts +1 -1
- package/src/model/Position.ts +1 -1
- package/src/model/index.ts +0 -2
- package/src/payloads/AddressPairPayload.ts +2 -2
- package/src/payloads/netBalancesForPayloads.ts +1 -1
- package/src/payloads/netTransfersForPayloads.ts +1 -1
- package/src/payloads/summary/BalancesStepSummary.ts +2 -2
- package/src/payloads/summary/StepSummary.ts +1 -2
- package/src/payloads/summary/TransfersSummary.ts +2 -2
- package/src/primitives/readPayloadMapFromStore.ts +2 -2
- package/src/primitives/step/completedStepRewardAddress.ts +1 -1
- package/src/primitives/step/derivedReceiveAddress.ts +2 -2
- package/src/primitives/step/stepBlockRange.ts +1 -1
- package/src/primitives/step/stepTransferIndex.ts +2 -2
- package/src/primitives/summary/balances/balancesStepSummaryFromRange.ts +2 -2
- package/src/primitives/summary/balances/balancesSummary.ts +6 -4
- package/src/primitives/summary/transfers/transfersStepSummaryFromRange.ts +2 -2
- package/src/primitives/summary/transfers/transfersSummary.ts +6 -4
- package/src/primitives/timeBudget.ts +1 -1
- package/src/provider/DataLake.ts +1 -1
- package/src/provider/TransactionSubmitter.ts +3 -2
- package/src/provider/XyoGateway.ts +1 -1
- package/src/provider/XyoGatewayRunner.ts +2 -3
- package/src/provider/XyoNetwork.ts +1 -1
- package/src/provider/XyoRunner.ts +1 -2
- package/src/provider/XyoWallet.ts +1 -2
- package/src/provider/permissions/InvokerPermission.ts +1 -1
- package/src/provider/signer/XyoSigner.ts +1 -2
- package/src/provider/viewer/NetworkStake/NetworkStakeViewer.ts +1 -1
- package/src/provider/viewer/NetworkStake/Rewards/ByStakerViewer.ts +1 -1
- package/src/provider/viewer/NetworkStake/Rewards/Options.ts +1 -1
- package/src/provider/viewer/NetworkStake/Rewards/templates/MethodsTemplate.ts +1 -1
- package/src/provider/viewer/StepViewer.ts +1 -2
- package/src/services/AccountTransfersService.ts +3 -2
- package/src/services/BlockRewardService.ts +1 -1
- package/src/services/BlockRewardServiceV2.ts +1 -1
- package/src/services/Chain/ChainHeadService.ts +1 -1
- package/src/services/ChainIterator/ChainIteratorService.ts +3 -3
- package/src/services/ChainIterator/ChainIteratorServiceEventData.ts +1 -1
- package/src/services/Election.ts +1 -1
- package/src/services/Params.ts +1 -1
- package/src/services/PendingTransactionsService.ts +1 -1
- package/src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts +2 -3
- package/src/services/StakeIntentService/StakeIntentService.ts +1 -1
- package/src/simple/accountBalance/SimpleAccountBalanceViewer.ts +124 -0
- package/src/simple/accountBalance/index.ts +1 -0
- package/src/simple/datalake/SimpleDataLakeRunner.ts +1 -1
- package/src/simple/datalake/SimpleDataLakeViewer.ts +1 -1
- package/src/simple/gateway/SimpleXyoGateway.ts +1 -1
- package/src/simple/gateway/SimpleXyoGatewayRunner.ts +19 -21
- package/src/simple/index.ts +2 -0
- package/src/simple/network/SimpleXyoNetwork.ts +1 -1
- package/src/simple/permissions/SimpleXyoPermissions.ts +1 -1
- package/src/simple/permissions/store/MemoryPermissions.ts +1 -1
- package/src/simple/runner/SimpleXyoRunner.ts +1 -1
- package/src/simple/signer/SimpleXyoSigner.ts +1 -2
- package/src/simple/timesync/SimpleTimeSyncViewer.ts +93 -0
- package/src/simple/timesync/index.ts +1 -0
- package/src/time/primitives/xl1BlockNumberToEthBlockNumber.ts +1 -1
- package/src/transaction/buildTransaction.ts +2 -3
- package/src/transaction/buildUnsignedTransaction.ts +2 -2
- package/src/transaction/confirmSubmittedTransaction.ts +2 -3
- package/src/transaction/hydrateTransaction.ts +2 -2
- package/src/transaction/primitives/spec/transactionBlockByteCount.spec.ts +1 -1
- package/src/transaction/primitives/transactionElevatedPayloads.ts +1 -1
- package/src/transaction/script.ts +2 -3
- package/src/transaction/signTransaction.ts +3 -3
- package/src/validation/block/BlockValidationFunction.ts +1 -1
- package/src/validation/block/HydratedBlockStateValidationFunction.ts +1 -1
- package/src/validation/block/HydratedBlockValidationFunction.ts +1 -1
- package/src/validation/block/error.spec.ts +1 -1
- package/src/validation/block/error.ts +1 -1
- package/src/viewers/AccountBalance.ts +7 -10
- package/src/viewers/Block.ts +6 -5
- package/src/viewers/Chain.ts +1 -1
- package/src/viewers/ChainContract.ts +1 -1
- package/src/viewers/Fork.ts +1 -1
- package/src/viewers/NetworkStakeStepReward.ts +1 -2
- package/src/viewers/Stake.ts +25 -4
- package/src/{model → viewers}/StakeEvents.ts +4 -4
- package/src/viewers/StakeTotals.ts +1 -2
- package/src/viewers/StepStake.ts +1 -2
- package/src/viewers/TimeSync.ts +2 -3
- package/src/viewers/Transaction.ts +1 -2
- package/src/viewers/TransferBalance.ts +1 -2
- package/src/viewers/index.ts +1 -0
- package/src/wallet/spec/paths.spec.ts +1 -1
- package/dist/neutral/model/ChainStake/ChainStakeRead.d.ts +0 -17
- package/dist/neutral/model/ChainStake/ChainStakeRead.d.ts.map +0 -1
- package/dist/neutral/model/ChainStake/ChainStakeStatic.d.ts +0 -7
- package/dist/neutral/model/ChainStake/ChainStakeStatic.d.ts.map +0 -1
- package/dist/neutral/model/ChainStake/ChainStakeWrite.d.ts +0 -6
- package/dist/neutral/model/ChainStake/ChainStakeWrite.d.ts.map +0 -1
- package/dist/neutral/model/ChainStake/index.d.ts +0 -4
- package/dist/neutral/model/ChainStake/index.d.ts.map +0 -1
- package/dist/neutral/model/StakeEvents.d.ts.map +0 -1
- package/src/model/ChainStake/ChainStakeRead.ts +0 -18
- package/src/model/ChainStake/ChainStakeStatic.ts +0 -7
- package/src/model/ChainStake/ChainStakeWrite.ts +0 -5
- package/src/model/ChainStake/index.ts +0 -3
package/src/model/PayloadMap.ts
CHANGED
package/src/model/Position.ts
CHANGED
package/src/model/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export * from './ChainContext/index.ts'
|
|
2
2
|
export * from './ChainFork/index.ts'
|
|
3
3
|
export * from './ChainIdentity.ts'
|
|
4
|
-
export * from './ChainStake/index.ts'
|
|
5
4
|
export * from './ChainStore.ts'
|
|
6
5
|
export * from './PayloadMap.ts'
|
|
7
6
|
export * from './Position.ts'
|
|
8
7
|
export * from './RecordKeyType.ts'
|
|
9
|
-
export * from './StakeEvents.ts'
|
|
10
8
|
export * from './summary.ts'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import { AsObjectFactory } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
3
3
|
import { isPayloadOfSchemaType, type Payload } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
export const AddressPairSchema = 'network.xyo.address.pair' as const
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import { AsObjectFactory } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
3
3
|
import type { Schema, WithStorageMeta } from '@xyo-network/payload-model'
|
|
4
4
|
import { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'
|
|
5
5
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/
|
|
2
|
-
import type { EmptyObject } from '@xylabs/object'
|
|
1
|
+
import type { EmptyObject, Hash } from '@xylabs/sdk-js'
|
|
3
2
|
import type { Payload, Schema } from '@xyo-network/payload-model'
|
|
4
3
|
|
|
5
4
|
export const StepSummarySchema: Schema = 'network.xyo.step.summary'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import { AsObjectFactory } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
3
3
|
import type { Schema, WithStorageMeta } from '@xyo-network/payload-model'
|
|
4
4
|
import { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/
|
|
2
|
-
import { isDefined } from '@xylabs/
|
|
1
|
+
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
+
import { isDefined } from '@xylabs/sdk-js'
|
|
3
3
|
import type { ReadArchivist } from '@xyo-network/archivist-model'
|
|
4
4
|
import type { Payload } from '@xyo-network/payload-model'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Address, toAddress } from '@xylabs/
|
|
2
|
-
import { isDefined } from '@xylabs/
|
|
1
|
+
import { type Address, toAddress } from '@xylabs/sdk-js'
|
|
2
|
+
import { isDefined } from '@xylabs/sdk-js'
|
|
3
3
|
import { keccak256 } from 'ethers'
|
|
4
4
|
|
|
5
5
|
export function derivedReceiveAddress(address: Address, scope?: string): Address {
|
|
@@ -4,5 +4,5 @@ import { asXL1BlockRange, StepSizes } from '@xyo-network/xl1-protocol'
|
|
|
4
4
|
export function stepBlockRange({ block, step }: StepIdentity): XL1BlockRange {
|
|
5
5
|
const stepSize = StepSizes[step]
|
|
6
6
|
const start = block - stepSize
|
|
7
|
-
return asXL1BlockRange([start, start + stepSize - 1],
|
|
7
|
+
return asXL1BlockRange([start, start + stepSize - 1], { name: 'stepBlockRange' })
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/
|
|
1
|
+
import { assertEx } from '@xylabs/sdk-js'
|
|
2
2
|
import { StepSizes } from '@xyo-network/xl1-protocol'
|
|
3
3
|
|
|
4
4
|
export function stepTransferIndex(block: number, step: number) {
|
|
@@ -13,6 +13,6 @@ export function stepTransferIndex(block: number, step: number) {
|
|
|
13
13
|
rewardTransferCount++
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
assertEx(rewardTransferIndex >= 0, () => `
|
|
16
|
+
assertEx(rewardTransferIndex >= 0, () => `Could not find step size for step ${step} at block ${block}`)
|
|
17
17
|
return [rewardTransferIndex, rewardTransferCount]
|
|
18
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type Address } from '@xylabs/sdk-js'
|
|
3
|
+
import { assertEx } from '@xylabs/sdk-js'
|
|
4
4
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
5
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
6
6
|
import { isAnyPayload } from '@xyo-network/payload-model'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import { asAddress } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { asAddress, isDefined } from '@xylabs/sdk-js'
|
|
3
3
|
import { spanRootAsync } from '@xylabs/telemetry'
|
|
4
|
-
import { isDefined } from '@xylabs/typeof'
|
|
5
4
|
import {
|
|
6
5
|
asBlockBoundWitnessWithStorageMeta, asXL1BlockNumber, asXL1BlockRange,
|
|
7
6
|
} from '@xyo-network/xl1-protocol'
|
|
@@ -19,7 +18,10 @@ export async function balancesSummary(
|
|
|
19
18
|
const headResult = await context.store.chainMap.get(headHash)
|
|
20
19
|
const headBoundWitness = asBlockBoundWitnessWithStorageMeta(headResult, () => `Head block not found for hash: ${headHash}`, { required: true })
|
|
21
20
|
const rangeStart = asXL1BlockNumber(isDefined(context.windowSize) ? Math.max(headBoundWitness.block - context.windowSize + 1, 0) : 0)
|
|
22
|
-
const ranges = deepCalculateFramesFromRange(asXL1BlockRange(
|
|
21
|
+
const ranges = deepCalculateFramesFromRange(asXL1BlockRange(
|
|
22
|
+
[rangeStart, headBoundWitness.block],
|
|
23
|
+
{ name: 'balancesSummary' },
|
|
24
|
+
))
|
|
23
25
|
const summaries = await Promise.all(ranges.map(range => balancesStepSummaryFromRange(context, range)))
|
|
24
26
|
const balances: Partial<Record<Address, bigint>> = {}
|
|
25
27
|
for (let summary of summaries) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type Address } from '@xylabs/sdk-js'
|
|
3
|
+
import { assertEx } from '@xylabs/sdk-js'
|
|
4
4
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
5
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
6
6
|
import { isAnyPayload } from '@xyo-network/payload-model'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import { asAddress } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
+
import { asAddress, isDefined } from '@xylabs/sdk-js'
|
|
3
3
|
import { spanRootAsync } from '@xylabs/telemetry'
|
|
4
|
-
import { isDefined } from '@xylabs/typeof'
|
|
5
4
|
import {
|
|
6
5
|
asBlockBoundWitnessWithStorageMeta, asXL1BlockNumber, asXL1BlockRange,
|
|
7
6
|
} from '@xyo-network/xl1-protocol'
|
|
@@ -20,7 +19,10 @@ export async function transfersSummary(
|
|
|
20
19
|
const headResult = await context.store.chainMap.get(headHash)
|
|
21
20
|
const headBoundWitness = asBlockBoundWitnessWithStorageMeta(headResult, () => `Head block not found for hash: ${headHash}`, { required: true })
|
|
22
21
|
const rangeStart = asXL1BlockNumber(isDefined(context.windowSize) ? Math.max(headBoundWitness.block - context.windowSize + 1, 0) : 0)
|
|
23
|
-
const ranges = deepCalculateFramesFromRange(asXL1BlockRange(
|
|
22
|
+
const ranges = deepCalculateFramesFromRange(asXL1BlockRange(
|
|
23
|
+
[rangeStart, headBoundWitness.block],
|
|
24
|
+
{ name: 'transfersSummary' },
|
|
25
|
+
))
|
|
24
26
|
const summaries = await Promise.all(ranges.map(range => transfersStepSummaryFromRange(context, range)))
|
|
25
27
|
const transfers: Partial<Record<Address, Partial<Record<Address, bigint>>>> = {}
|
|
26
28
|
for (let summary of summaries) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Logger } from '@xylabs/
|
|
1
|
+
import { type Logger } from '@xylabs/sdk-js'
|
|
2
2
|
|
|
3
3
|
export async function timeBudget<TResult>(name: string, logger: Logger | undefined, func: () => Promise<TResult>, budget: number): Promise<TResult> {
|
|
4
4
|
const start = Date.now()
|
package/src/provider/DataLake.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
Address, Hex, Promisable,
|
|
3
|
+
} from '@xylabs/sdk-js'
|
|
3
4
|
import type { Payload } from '@xyo-network/payload-model'
|
|
4
5
|
import type {
|
|
5
6
|
AllowedBlockPayload, SignedHydratedTransaction, TransactionFeesBigInt,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
Address, Hash, Hex,
|
|
3
|
-
} from '@xylabs/
|
|
4
|
-
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
Address, Hash, Hex, Promisable,
|
|
3
|
+
} from '@xylabs/sdk-js'
|
|
5
4
|
import type { Payload } from '@xyo-network/payload-model'
|
|
6
5
|
import type {
|
|
7
6
|
AllowedBlockPayload, AttoXL1, SignedHydratedTransaction, SignedHydratedTransactionWithHashMeta, TransactionFeesBigInt,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
1
|
+
import type { Address, Promisable } from '@xylabs/sdk-js'
|
|
3
2
|
import type { Signed, UnsignedBoundWitness } from '@xyo-network/boundwitness-model'
|
|
4
3
|
import type { Payload } from '@xyo-network/payload-model'
|
|
5
4
|
import type {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
1
|
+
import type { Address } from '@xylabs/sdk-js'
|
|
2
2
|
|
|
3
3
|
import type { NetworkStakeStepRewardsByStakerViewerOptions } from './Options.ts'
|
|
4
4
|
import type { NetworkStakeStepRewardsByIndexViewerMethodsTemplate } from './templates/index.ts'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
1
|
+
import type { Address, Promisable } from '@xylabs/sdk-js'
|
|
3
2
|
import type { PositionId, StepIdentity } from '@xyo-network/xl1-protocol'
|
|
4
3
|
|
|
5
4
|
import type { Position } from '../../model/index.ts'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
Address, Hash, Promisable,
|
|
3
|
+
} from '@xylabs/sdk-js'
|
|
3
4
|
import type { AttoXL1 } from '@xyo-network/xl1-protocol'
|
|
4
5
|
|
|
5
6
|
export interface AccountTransfersProvider {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
BaseEmitter, BaseParams, Hash,
|
|
3
|
+
} from '@xylabs/sdk-js'
|
|
4
4
|
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
5
5
|
import type {
|
|
6
6
|
BlockBoundWitness, ChainId, IterableRepository, ReadRepository,
|
package/src/services/Election.ts
CHANGED
package/src/services/Params.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/
|
|
2
|
-
import
|
|
3
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
1
|
+
import type { Hash, JsonValue } from '@xylabs/sdk-js'
|
|
2
|
+
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
4
3
|
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
5
4
|
import { isPayloadOfSchemaType, isStorageMeta } from '@xyo-network/payload-model'
|
|
6
5
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { Address, Hash } from '@xylabs/sdk-js'
|
|
2
|
+
import {
|
|
3
|
+
assertEx, exists, isDefined,
|
|
4
|
+
} from '@xylabs/sdk-js'
|
|
5
|
+
import { spanRootAsync } from '@xylabs/telemetry'
|
|
6
|
+
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
7
|
+
import type { WithStorageMeta } from '@xyo-network/payload-model'
|
|
8
|
+
import type {
|
|
9
|
+
BlockBoundWitness, Transfer, XL1BlockNumber, XL1BlockRange,
|
|
10
|
+
} from '@xyo-network/xl1-protocol'
|
|
11
|
+
import {
|
|
12
|
+
asRange, asXL1BlockNumber, asXL1BlockRange, AttoXL1,
|
|
13
|
+
StepSizes,
|
|
14
|
+
TransferSchema,
|
|
15
|
+
} from '@xyo-network/xl1-protocol'
|
|
16
|
+
|
|
17
|
+
import { deepCalculateFramesFromRange, transfersStepSummaryFromRange } from '../../block/index.ts'
|
|
18
|
+
import type { BalanceStepSummaryContext, TransfersStepSummaryContext } from '../../model/index.ts'
|
|
19
|
+
import type { TransfersStepSummary } from '../../payloads/index.ts'
|
|
20
|
+
import { balancesSummary } from '../../primitives/index.ts'
|
|
21
|
+
import type {
|
|
22
|
+
AccountBalanceHistoryItem, AccountBalanceViewer, BlockViewer,
|
|
23
|
+
} from '../../viewers/index.ts'
|
|
24
|
+
|
|
25
|
+
export class SimpleAccountBalanceViewer implements AccountBalanceViewer {
|
|
26
|
+
protected readonly blockViewer: BlockViewer
|
|
27
|
+
protected readonly context: BalanceStepSummaryContext
|
|
28
|
+
protected readonly transferContext: TransfersStepSummaryContext
|
|
29
|
+
|
|
30
|
+
constructor(context: BalanceStepSummaryContext, transferContext: TransfersStepSummaryContext, blockViewer: BlockViewer) {
|
|
31
|
+
this.context = context
|
|
32
|
+
this.transferContext = transferContext
|
|
33
|
+
this.blockViewer = blockViewer
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async accountBalance(address: Address, headOrRange?: XL1BlockRange | Hash): Promise<AttoXL1> {
|
|
37
|
+
const balances = await this.accountBalances([address], headOrRange)
|
|
38
|
+
return balances[address] ?? AttoXL1(0n)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async accountBalanceHistory(address: Address, headOrRange?: XL1BlockRange | Hash): Promise<AccountBalanceHistoryItem[]> {
|
|
42
|
+
const range = asRange(headOrRange)
|
|
43
|
+
const startingRange = asXL1BlockRange(range ?? [0, await this.blockViewer.currentBlockNumber()], true)
|
|
44
|
+
const blockNumbers = await this.distillTransferHistory(address, startingRange)
|
|
45
|
+
const blocks = (await Promise.all(blockNumbers.map(async bn => await this.blockViewer.blockByNumber(bn)))).filter(exists)
|
|
46
|
+
const result: AccountBalanceHistoryItem[] = []
|
|
47
|
+
for (const block of blocks) {
|
|
48
|
+
const transferIndexes = block[0].payload_schemas.map((schema, index) => schema === TransferSchema ? index : undefined).filter(exists)
|
|
49
|
+
const transfers = transferIndexes.map((index) => {
|
|
50
|
+
const hash = block[0].payload_hashes[index]
|
|
51
|
+
return assertEx(
|
|
52
|
+
block[1].find(p => p._hash === hash) as WithStorageMeta<Transfer>,
|
|
53
|
+
() => `Error: Could not find Transfer with hash ${hash} in block ${block[0]._hash}`,
|
|
54
|
+
)
|
|
55
|
+
}).filter(exists).filter(t => ((t.from === address) || (isDefined(t.transfers[address]))))
|
|
56
|
+
if (transfers.length === 0) {
|
|
57
|
+
continue
|
|
58
|
+
}
|
|
59
|
+
const pairs: [WithStorageMeta<Signed<BlockBoundWitness>>, WithStorageMeta<Transfer>][] = (transfers.map((transfer) => {
|
|
60
|
+
return [block[0], transfer]
|
|
61
|
+
}))
|
|
62
|
+
result.push(...pairs.map(([block, transfer]) => [block,
|
|
63
|
+
null,
|
|
64
|
+
transfer] satisfies AccountBalanceHistoryItem))
|
|
65
|
+
}
|
|
66
|
+
return result
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async accountBalances(address: Address[], _headOrRange?: XL1BlockRange | Hash): Promise<Partial<Record<Address, AttoXL1>>> {
|
|
70
|
+
return await spanRootAsync('balances', async () => {
|
|
71
|
+
const summary = await balancesSummary(
|
|
72
|
+
this.context,
|
|
73
|
+
)
|
|
74
|
+
const result: Record<Address, AttoXL1> = {}
|
|
75
|
+
for (const addr of address) {
|
|
76
|
+
const summaryBalance = summary[addr] ?? 0n
|
|
77
|
+
result[addr] = AttoXL1(summaryBalance < 0n ? 0n : summaryBalance)
|
|
78
|
+
}
|
|
79
|
+
return result
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
accountBalancesHistories(_addresses: Address[], _rangeOrHash?: XL1BlockRange | Hash): Promise<Partial<Record<Address, AccountBalanceHistoryItem[]>>> {
|
|
84
|
+
throw new Error('Method not implemented.')
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private async distillTransferHistory(address: Address, range: XL1BlockRange, max: number = 50): Promise<XL1BlockNumber[]> {
|
|
88
|
+
if ((range[1] - range[0]) <= StepSizes[0] || max <= 1) {
|
|
89
|
+
return Array.from({ length: range[1] - range[0] + 1 }, (_, i) => range[1] - i).slice(0, max).map(n => asXL1BlockNumber(n, true))
|
|
90
|
+
}
|
|
91
|
+
const frames = deepCalculateFramesFromRange(asXL1BlockRange(range, true))
|
|
92
|
+
const transferSummaryPairs = await Promise.all(frames.map(
|
|
93
|
+
async (frame) => {
|
|
94
|
+
return [frame, await transfersStepSummaryFromRange(this.transferContext, frame)]
|
|
95
|
+
},
|
|
96
|
+
)) as [XL1BlockRange, WithStorageMeta<TransfersStepSummary>][]
|
|
97
|
+
|
|
98
|
+
const filteredTransferSummaryPairs = transferSummaryPairs.filter(([_, summary]) => Object.keys(summary.transfers).includes(address))
|
|
99
|
+
|
|
100
|
+
// sort it latest to earliest
|
|
101
|
+
const sortedTransferSummaryPairs = filteredTransferSummaryPairs.toSorted((a, b) => {
|
|
102
|
+
return b[0][1] - a[0][1]
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
const resultBlockNumbers: Set<XL1BlockNumber> = new Set()
|
|
106
|
+
for (const [frame] of sortedTransferSummaryPairs) {
|
|
107
|
+
if ((frame[1] - frame[0] + 1) > StepSizes[0]) {
|
|
108
|
+
const values = await this.distillTransferHistory(address, asXL1BlockRange([frame[0], frame[1] - 1], true), max - resultBlockNumbers.size)
|
|
109
|
+
for (const value of values) {
|
|
110
|
+
resultBlockNumbers.add(value)
|
|
111
|
+
}
|
|
112
|
+
resultBlockNumbers.add(frame[1])
|
|
113
|
+
} else {
|
|
114
|
+
for (let i = frame[0]; i <= frame[1]; i++) {
|
|
115
|
+
resultBlockNumbers.add(i)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (resultBlockNumbers.size >= max) {
|
|
119
|
+
break
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return [...resultBlockNumbers].toSorted((a, b) => b - a).slice(0, max)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SimpleAccountBalanceViewer.ts'
|