@xyo-network/xl1-protocol-sdk 1.26.12 → 1.26.13
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/simple/accountBalance/SimpleAccountBalanceViewer.d.ts +2 -2
- package/dist/neutral/simple/block/SimpleBlockViewer.d.ts +2 -2
- package/dist/neutral/simple/datalake/SimpleDataLakeRunner.d.ts +1 -1
- package/dist/neutral/simple/finalization/SimpleFinalizationViewer.d.ts +1 -1
- package/dist/neutral/simple/windowedBlock/SimpleWindowedBlockViewer.d.ts +10 -10
- package/dist/neutral/transaction/TransactionBuilder.d.ts +4 -4
- package/dist/neutral/transaction/signTransaction.d.ts +1 -1
- package/package.json +24 -14
- package/src/ChainContextHelpers.ts +0 -50
- package/src/CreatableProvider/AbstractCreatableProvider.ts +0 -97
- package/src/CreatableProvider/CreatableProvider.ts +0 -102
- package/src/CreatableProvider/CreatableProviderRegistry.ts +0 -94
- package/src/CreatableProvider/GetInstanceOptions.ts +0 -11
- package/src/CreatableProvider/LabeledCreatableProviderFactory.ts +0 -24
- package/src/CreatableProvider/ProviderFactory.ts +0 -138
- package/src/CreatableProvider/ProviderFactoryLocator.ts +0 -170
- package/src/CreatableProvider/ProviderFactoryLocatorInstance.ts +0 -70
- package/src/CreatableProvider/index.ts +0 -8
- package/src/SignedBigInt.ts +0 -59
- package/src/_internal/context/getTestProviderContext.ts +0 -13
- package/src/_internal/context/index.ts +0 -1
- package/src/_internal/index.ts +0 -2
- package/src/actor/ActorV3.ts +0 -177
- package/src/actor/index.ts +0 -1
- package/src/amount/ShiftedBigInt.ts +0 -73
- package/src/amount/XL1Amount.ts +0 -103
- package/src/amount/index.ts +0 -4
- package/src/amount/splitOnDecimal.ts +0 -6
- package/src/amount/splitOnDecimalToString.ts +0 -40
- package/src/block/hydrate/allHashesPresent.ts +0 -8
- package/src/block/hydrate/blockPayloadsFromHydratedBlock.ts +0 -12
- package/src/block/hydrate/flattenHydratedBlock.ts +0 -28
- package/src/block/hydrate/flattenHydratedBlocks.ts +0 -7
- package/src/block/hydrate/hydrateBlock.ts +0 -43
- package/src/block/hydrate/index.ts +0 -7
- package/src/block/hydrate/transactionsFromHydratedBlock.ts +0 -7
- package/src/block/hydrate/tryHydrateBlock.ts +0 -26
- package/src/block/index.ts +0 -2
- package/src/block/primitives/blockFromBlockNumber.ts +0 -69
- package/src/block/primitives/frames/calculateFramesFromRange.ts +0 -30
- package/src/block/primitives/frames/deepCalculateFramesFromRange.ts +0 -28
- package/src/block/primitives/frames/index.ts +0 -2
- package/src/block/primitives/hashFromBlockNumber.ts +0 -9
- package/src/block/primitives/index.ts +0 -7
- package/src/block/primitives/model.ts +0 -18
- package/src/block/primitives/payloads/ChainWindow.ts +0 -7
- package/src/block/primitives/payloads/index.ts +0 -1
- package/src/block/primitives/toStepIdentityString.ts +0 -6
- package/src/block/primitives/validateTransactionOpcodes.ts +0 -45
- package/src/config/Actor.ts +0 -32
- package/src/config/Actors.ts +0 -9
- package/src/config/Base.ts +0 -27
- package/src/config/Chain.ts +0 -23
- package/src/config/Config.ts +0 -24
- package/src/config/DataLake/DataLake.ts +0 -12
- package/src/config/DataLake/DataLakeRemoteConfig.ts +0 -11
- package/src/config/DataLake/RestDataLakeConfig.ts +0 -18
- package/src/config/DataLake/RouterDataLakeConfig.ts +0 -22
- package/src/config/DataLake/index.ts +0 -4
- package/src/config/DeepPartial.ts +0 -4
- package/src/config/Evm.ts +0 -38
- package/src/config/HostActor.ts +0 -32
- package/src/config/Log.ts +0 -25
- package/src/config/Provider.ts +0 -20
- package/src/config/Providers.ts +0 -9
- package/src/config/Remote.ts +0 -59
- package/src/config/Telemetry.ts +0 -49
- package/src/config/UsageMeta.ts +0 -46
- package/src/config/Validation.ts +0 -29
- package/src/config/index.ts +0 -12
- package/src/config/storage/Storage.ts +0 -16
- package/src/config/storage/driver/Mongo.ts +0 -53
- package/src/config/storage/driver/index.ts +0 -1
- package/src/config/storage/index.ts +0 -2
- package/src/constants.ts +0 -4
- package/src/context/Actor.ts +0 -20
- package/src/context/HostActor.ts +0 -20
- package/src/context/getEmptyProviderContext.ts +0 -19
- package/src/context/index.ts +0 -3
- package/src/createDeclarationPayload.ts +0 -15
- package/src/createTransferPayload.ts +0 -16
- package/src/driver/cache/LruCacheMap.ts +0 -48
- package/src/driver/cache/index.ts +0 -1
- package/src/driver/index.ts +0 -2
- package/src/driver/memory/MemoryMap.ts +0 -48
- package/src/driver/memory/index.ts +0 -1
- package/src/eip-712/Payloads/EIP712Data.ts +0 -35
- package/src/eip-712/Payloads/EIP712Signature.ts +0 -32
- package/src/eip-712/Payloads/index.ts +0 -2
- package/src/eip-712/Types.ts +0 -41
- package/src/eip-712/index.ts +0 -4
- package/src/eip-712/sign.ts +0 -19
- package/src/eip-712/spec/fixtures.ts +0 -27
- package/src/eip-712/verify.ts +0 -20
- package/src/getFileConfig.ts +0 -36
- package/src/index.ts +0 -27
- package/src/instances/Address.ts +0 -16
- package/src/instances/BoundWitness.ts +0 -13
- package/src/instances/Data.ts +0 -4
- package/src/instances/Fees.ts +0 -9
- package/src/instances/HydratedBoundWitness.ts +0 -16
- package/src/instances/Object.ts +0 -6
- package/src/instances/Payload.ts +0 -7
- package/src/instances/Signature.ts +0 -12
- package/src/instances/block/BlockFields.ts +0 -18
- package/src/instances/block/HydratedBlock.ts +0 -10
- package/src/instances/block/index.ts +0 -1
- package/src/instances/index.ts +0 -10
- package/src/instances/modifiers/BlockWindowInstance.ts +0 -8
- package/src/instances/modifiers/BlockWindowState.ts +0 -6
- package/src/instances/modifiers/Signed.ts +0 -9
- package/src/instances/modifiers/Validatable.ts +0 -6
- package/src/instances/modifiers/index.ts +0 -4
- package/src/instances/transaction/HydratedTransaction.ts +0 -9
- package/src/instances/transaction/TransactionFields.ts +0 -22
- package/src/instances/transaction/index.ts +0 -1
- package/src/isInternetAvailable.ts +0 -11
- package/src/model/ChainFork/ChainForkStatic.ts +0 -9
- package/src/model/ChainFork/index.ts +0 -1
- package/src/model/ChainIdentity.ts +0 -6
- package/src/model/ChainStore.ts +0 -16
- package/src/model/CreatableProviderContext.ts +0 -6
- package/src/model/CreatableProviderContext.zod.ts +0 -55
- package/src/model/PayloadBundle/bundledPayloadToHydratedBlock.ts +0 -15
- package/src/model/PayloadBundle/bundledPayloadToHydratedTransaction.ts +0 -15
- package/src/model/PayloadBundle/hydratedBlockToPayloadBundle.ts +0 -19
- package/src/model/PayloadBundle/hydratedTransactionToPayloadBundle.ts +0 -19
- package/src/model/PayloadBundle/index.ts +0 -4
- package/src/model/index.ts +0 -6
- package/src/multipliers.ts +0 -18
- package/src/payloads/AddressPairPayload.ts +0 -27
- package/src/payloads/index.ts +0 -4
- package/src/payloads/netBalancesForPayloads.ts +0 -24
- package/src/payloads/netSchemasForPayloads.ts +0 -24
- package/src/payloads/netTransfersForPayloads.ts +0 -27
- package/src/primitives/block/index.ts +0 -2
- package/src/primitives/block/range/blockRangeSteps.ts +0 -23
- package/src/primitives/block/range/index.ts +0 -1
- package/src/primitives/block/rate/blockRate.ts +0 -77
- package/src/primitives/block/rate/index.ts +0 -4
- package/src/primitives/block/rate/stepRate.ts +0 -37
- package/src/primitives/block/rate/timeHelpers.ts +0 -61
- package/src/primitives/block/rate/timeRate.ts +0 -121
- package/src/primitives/chain/getWindowedChain.ts +0 -50
- package/src/primitives/chain/index.ts +0 -3
- package/src/primitives/chain/step/chainStepRewardAddress.ts +0 -30
- package/src/primitives/chain/step/index.ts +0 -4
- package/src/primitives/chain/step/stepRewardBlock.ts +0 -13
- package/src/primitives/chain/step/stepRewardTotal.ts +0 -46
- package/src/primitives/chain/step/stepsRewardTotal.ts +0 -37
- package/src/primitives/chain/time/externalBlockNumberFromXL1BlockNumber.ts +0 -32
- package/src/primitives/chain/time/externalBlockRangeFromStep.ts +0 -21
- package/src/primitives/chain/time/externalBlockRangeFromXL1BlockRange.ts +0 -17
- package/src/primitives/chain/time/index.ts +0 -3
- package/src/primitives/datalake/addDataLakePayloads.ts +0 -18
- package/src/primitives/datalake/addDataLakePayloadsToPayloads.ts +0 -24
- package/src/primitives/datalake/index.ts +0 -2
- package/src/primitives/index.ts +0 -13
- package/src/primitives/mapToMapType.ts +0 -35
- package/src/primitives/payload/index.ts +0 -1
- package/src/primitives/payload/mergeTransfers.ts +0 -16
- package/src/primitives/readPayloadMapFromStore.ts +0 -58
- package/src/primitives/rewardFromBlockNumber.ts +0 -19
- package/src/primitives/rewards/index.ts +0 -1
- package/src/primitives/rewards/networkStakeStepRewardPositionWeight.ts +0 -26
- package/src/primitives/stake/activeStakeAtTimeByAddress.ts +0 -27
- package/src/primitives/stake/activeStakeAtTimeByPosition.ts +0 -25
- package/src/primitives/stake/allStakersForRange.ts +0 -32
- package/src/primitives/stake/allStakersForStep.ts +0 -24
- package/src/primitives/stake/index.ts +0 -6
- package/src/primitives/stake/mergedAddRemoveStakeEventsByPosition.ts +0 -15
- package/src/primitives/stake/mergedAddRemoveStakeEventsByStaker.ts +0 -17
- package/src/primitives/stake/weightedStakeForRangeByPosition.ts +0 -69
- package/src/primitives/state/findMostRecentBlock.ts +0 -44
- package/src/primitives/state/hydratedBlockByNumber.ts +0 -25
- package/src/primitives/state/index.ts +0 -2
- package/src/primitives/step/completedStepRewardAddress.ts +0 -10
- package/src/primitives/step/derivedReceiveAddress.ts +0 -9
- package/src/primitives/step/index.ts +0 -4
- package/src/primitives/step/stepBlockRange.ts +0 -9
- package/src/primitives/step/stepTransferIndex.ts +0 -19
- package/src/primitives/transaction/elevatedPayloads.ts +0 -24
- package/src/primitives/transaction/index.ts +0 -1
- package/src/primitives/uncle/findBestUncle.ts +0 -9
- package/src/primitives/uncle/findUncles.ts +0 -75
- package/src/primitives/uncle/index.ts +0 -3
- package/src/primitives/uncle/scoreUncle.ts +0 -7
- package/src/services/AccountTransfersService.ts +0 -13
- package/src/services/BlockProducerService.ts +0 -11
- package/src/services/Chain/BaseChainService.ts +0 -4
- package/src/services/Chain/ChainHeadService.ts +0 -8
- package/src/services/Chain/ChainService.ts +0 -6
- package/src/services/Chain/index.ts +0 -3
- package/src/services/Election.ts +0 -14
- package/src/services/NetworkStakeService.ts +0 -4
- package/src/services/Params.ts +0 -13
- package/src/services/PendingTransactionsService.ts +0 -7
- package/src/services/SchemasService.ts +0 -11
- package/src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts +0 -50
- package/src/services/StakeIntentService/StakeIntentService.ts +0 -35
- package/src/services/StakeIntentService/index.ts +0 -2
- package/src/services/index.ts +0 -8
- package/src/simple/StakeEventsViewer/SimpleStakeEventsViewer.ts +0 -93
- package/src/simple/StakeEventsViewer/index.ts +0 -1
- package/src/simple/StakeTotalsViewer/SimpleStakeTotalsViewer.ts +0 -116
- package/src/simple/StakeTotalsViewer/index.ts +0 -1
- package/src/simple/StakeViewer/SimpleStakeViewer.ts +0 -164
- package/src/simple/StakeViewer/index.ts +0 -1
- package/src/simple/TransactionViewer/SimpleTransactionViewer.ts +0 -100
- package/src/simple/TransactionViewer/index.ts +0 -1
- package/src/simple/accountBalance/SimpleAccountBalanceViewer.ts +0 -271
- package/src/simple/accountBalance/index.ts +0 -1
- package/src/simple/block/SimpleBlockViewer.ts +0 -231
- package/src/simple/block/index.ts +0 -1
- package/src/simple/blockInvalidation/SimpleBlockInvalidationViewer.ts +0 -197
- package/src/simple/blockInvalidation/index.ts +0 -1
- package/src/simple/blockReward/SimpleBlockRewardViewer.ts +0 -27
- package/src/simple/blockReward/index.ts +0 -1
- package/src/simple/blockValidation/SimpleBlockValidationViewer.ts +0 -194
- package/src/simple/blockValidation/index.ts +0 -1
- package/src/simple/chainContractViewer/SimpleChainContractViewer.ts +0 -92
- package/src/simple/chainContractViewer/index.ts +0 -1
- package/src/simple/client/SimpleXyoClient.ts +0 -14
- package/src/simple/client/index.ts +0 -1
- package/src/simple/datalake/AbstractRestDataLake.ts +0 -70
- package/src/simple/datalake/AbstractSimpleDataLake.ts +0 -62
- package/src/simple/datalake/RestDataLakeRunner.ts +0 -54
- package/src/simple/datalake/RestDataLakeViewer.ts +0 -22
- package/src/simple/datalake/SimpleDataLakeRunner.ts +0 -44
- package/src/simple/datalake/SimpleDataLakeViewer.ts +0 -24
- package/src/simple/datalake/index.ts +0 -4
- package/src/simple/finalization/SimpleFinalizationRunner.ts +0 -45
- package/src/simple/finalization/SimpleFinalizationViewer.ts +0 -123
- package/src/simple/finalization/index.ts +0 -2
- package/src/simple/gateway/SimpleXyoGateway.ts +0 -30
- package/src/simple/gateway/SimpleXyoGatewayRunner.ts +0 -137
- package/src/simple/gateway/index.ts +0 -2
- package/src/simple/index.ts +0 -22
- package/src/simple/mempool/SimpleMempoolRunner.ts +0 -390
- package/src/simple/mempool/SimpleMempoolViewer.ts +0 -215
- package/src/simple/mempool/index.ts +0 -2
- package/src/simple/network/SimpleXyoNetwork.ts +0 -48
- package/src/simple/network/index.ts +0 -1
- package/src/simple/network/lib/FailedNetworkStatusPayloads.ts +0 -16
- package/src/simple/network/lib/StatusNetworks.ts +0 -32
- package/src/simple/network/lib/index.ts +0 -2
- package/src/simple/permissions/SimpleXyoPermissions.ts +0 -82
- package/src/simple/permissions/index.ts +0 -2
- package/src/simple/permissions/store/MemoryPermissions.ts +0 -32
- package/src/simple/permissions/store/PermissionsStore.ts +0 -17
- package/src/simple/permissions/store/index.ts +0 -2
- package/src/simple/runner/SimpleXyoRunner.ts +0 -41
- package/src/simple/runner/index.ts +0 -1
- package/src/simple/signer/SimpleXyoSigner.ts +0 -78
- package/src/simple/signer/index.ts +0 -1
- package/src/simple/timeSync2/SimpleTimeSyncViewer.ts +0 -132
- package/src/simple/timeSync2/index.ts +0 -1
- package/src/simple/transactionInvalidation/SimpleTransactionInvalidationViewer.ts +0 -197
- package/src/simple/transactionInvalidation/index.ts +0 -1
- package/src/simple/transactionValidation/SimpleTransactionValidationViewer.ts +0 -173
- package/src/simple/transactionValidation/index.ts +0 -1
- package/src/simple/windowedBlock/SimpleWindowedBlockViewer.ts +0 -207
- package/src/simple/windowedBlock/index.ts +0 -1
- package/src/status/RuntimeStatusMonitor.ts +0 -120
- package/src/status/ServiceStatus.ts +0 -21
- package/src/status/index.ts +0 -2
- package/src/summary/index.ts +0 -2
- package/src/summary/model/BalancesStepSummary.ts +0 -35
- package/src/summary/model/SchemasStepSummary.ts +0 -33
- package/src/summary/model/StepSummary.ts +0 -20
- package/src/summary/model/TransfersSummary.ts +0 -36
- package/src/summary/model/index.ts +0 -4
- package/src/summary/primitives/balances/balancesStepSummaryFromRange.ts +0 -94
- package/src/summary/primitives/balances/balancesSummary.ts +0 -48
- package/src/summary/primitives/balances/index.ts +0 -2
- package/src/summary/primitives/index.ts +0 -3
- package/src/summary/primitives/schemas/index.ts +0 -2
- package/src/summary/primitives/schemas/schemasStepSummaryFromRange.ts +0 -86
- package/src/summary/primitives/schemas/schemasSummary.ts +0 -44
- package/src/summary/primitives/transfers/index.ts +0 -2
- package/src/summary/primitives/transfers/transfersStepSummaryFromRange.ts +0 -109
- package/src/summary/primitives/transfers/transfersSummary.ts +0 -52
- package/src/test/BuildBlockOptions.ts +0 -81
- package/src/test/buildBlock.ts +0 -105
- package/src/test/buildGenesisBlock.ts +0 -29
- package/src/test/buildNextBlock.ts +0 -37
- package/src/test/buildRandomChain.ts +0 -92
- package/src/test/buildRandomGenesisBlock.ts +0 -47
- package/src/test/createGenesisBlock.ts +0 -41
- package/src/test/createProducerChainStakeIntentTransaction.ts +0 -48
- package/src/test/getSimpleBlockViewerLocator.ts +0 -41
- package/src/test/getTestProviderContext.ts +0 -8
- package/src/test/index.ts +0 -2
- package/src/time/index.ts +0 -1
- package/src/time/primitives/index.ts +0 -1
- package/src/time/primitives/xl1BlockNumberToEthBlockNumber.ts +0 -13
- package/src/transaction/TransactionBuilder.ts +0 -164
- package/src/transaction/buildRandomTransaction.ts +0 -38
- package/src/transaction/buildTransaction.ts +0 -68
- package/src/transaction/buildUnsignedTransaction.ts +0 -56
- package/src/transaction/confirmSubmittedTransaction.ts +0 -42
- package/src/transaction/hydrateTransaction.ts +0 -117
- package/src/transaction/index.ts +0 -9
- package/src/transaction/primitives/index.ts +0 -4
- package/src/transaction/primitives/transactionBlockByteCount.ts +0 -10
- package/src/transaction/primitives/transactionElevatedPayloads.ts +0 -18
- package/src/transaction/primitives/transactionOperations.ts +0 -13
- package/src/transaction/primitives/transactionRequiredGas.ts +0 -22
- package/src/transaction/script.ts +0 -48
- package/src/transaction/signTransaction.ts +0 -32
- package/src/utils/HydratedCache.ts +0 -39
- package/src/utils/index.ts +0 -2
- package/src/utils/isZodError.ts +0 -11
- package/src/validation/index.ts +0 -2
- package/src/validation/lib/getUrl.ts +0 -7
- package/src/validation/lib/index.ts +0 -2
- package/src/validation/lib/isLocalhost.ts +0 -9
- package/src/validation/schema/Address.ts +0 -2
- package/src/validation/schema/Mnemonic.ts +0 -21
- package/src/validation/schema/index.ts +0 -2
- package/src/wallet/generateXyoBaseWalletFromPhrase.ts +0 -13
- package/src/wallet/index.ts +0 -2
- package/src/wallet/paths.ts +0 -17
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/sdk-js'
|
|
2
|
-
import { isDefined } from '@xylabs/sdk-js'
|
|
3
|
-
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
4
|
-
import {
|
|
5
|
-
type ChainStakeIntent, ChainStakeIntentSchema, type Intent,
|
|
6
|
-
} from '@xyo-network/xl1-protocol-lib'
|
|
7
|
-
|
|
8
|
-
/** createDeclarationIntent constant. */
|
|
9
|
-
export const createDeclarationIntent = (address: Address, intent: Intent, nbf: number, exp?: number): ChainStakeIntent => {
|
|
10
|
-
const expiration = isDefined(exp) ? exp : nbf + 10_000
|
|
11
|
-
const redeclarationIntent = new PayloadBuilder<ChainStakeIntent>({ schema: ChainStakeIntentSchema }).fields({
|
|
12
|
-
from: address, intent, nbf, exp: expiration,
|
|
13
|
-
}).build()
|
|
14
|
-
return redeclarationIntent
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Address, JsonObject } from '@xylabs/sdk-js'
|
|
2
|
-
import { toHex } from '@xylabs/sdk-js'
|
|
3
|
-
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
4
|
-
import type { Transfer } from '@xyo-network/xl1-protocol-lib'
|
|
5
|
-
import { TransferSchema } from '@xyo-network/xl1-protocol-lib'
|
|
6
|
-
|
|
7
|
-
/** Creates a TransferPayload instance. */
|
|
8
|
-
export function createTransferPayload(from: Address, transfers: Record<Address, bigint>, context?: JsonObject): Transfer {
|
|
9
|
-
return new PayloadBuilder<Transfer>({ schema: TransferSchema })
|
|
10
|
-
.fields({
|
|
11
|
-
epoch: Date.now(),
|
|
12
|
-
from,
|
|
13
|
-
transfers: Object.fromEntries(Object.entries(transfers).map(([k, v]) => [k, toHex(v)])),
|
|
14
|
-
context,
|
|
15
|
-
}).build()
|
|
16
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { SyncMap } from '@xyo-network/xl1-protocol-lib'
|
|
2
|
-
import { LRUCache } from 'lru-cache'
|
|
3
|
-
|
|
4
|
-
/** LruCacheMap implementation. */
|
|
5
|
-
export class LruCacheMap<K extends {}, V extends {} | string | number | bigint, FC = () => void> implements SyncMap<K, V> {
|
|
6
|
-
private lruCache: LRUCache<K, V, FC>
|
|
7
|
-
|
|
8
|
-
constructor(options?: LRUCache.Options<K, V, FC>) {
|
|
9
|
-
this.lruCache = new LRUCache<K, V, FC>(options ?? { max: 5000 })
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
clear(): void {
|
|
13
|
-
this.lruCache.clear()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
delete(id: K): boolean {
|
|
17
|
-
return this.lruCache.delete(id)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get(id: K): V | undefined {
|
|
21
|
-
return this.lruCache.get(id)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getMany(id: K[]): V[] {
|
|
25
|
-
const results: V[] = []
|
|
26
|
-
for (const key of id) {
|
|
27
|
-
const value = this.lruCache.get(key)
|
|
28
|
-
if (value !== undefined) {
|
|
29
|
-
results.push(value)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return results
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
has(id: K): boolean {
|
|
36
|
-
return this.lruCache.has(id)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
set(id: K, data: V) {
|
|
40
|
-
this.lruCache.set(id, data)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
setMany(entries: [K, V][]): void {
|
|
44
|
-
for (const [key, value] of entries) {
|
|
45
|
-
this.lruCache.set(key, value)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './LruCacheMap.ts'
|
package/src/driver/index.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { isDefined } from '@xylabs/sdk-js'
|
|
2
|
-
import type { SyncMap } from '@xyo-network/xl1-protocol-lib'
|
|
3
|
-
|
|
4
|
-
/** MemoryMap implementation. */
|
|
5
|
-
export class MemoryMap<K extends {}, V = {}> implements SyncMap<K, V> {
|
|
6
|
-
private map: Map<K, V>
|
|
7
|
-
|
|
8
|
-
constructor() {
|
|
9
|
-
this.map = new Map<K, V>()
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
clear(): void {
|
|
13
|
-
this.map.clear()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
delete(id: K): boolean {
|
|
17
|
-
return this.map.delete(id)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
get(id: K): V | undefined {
|
|
21
|
-
return this.map.get(id)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getMany(ids: K[]): V[] {
|
|
25
|
-
const results: V[] = []
|
|
26
|
-
for (const id of ids) {
|
|
27
|
-
const data = this.map.get(id)
|
|
28
|
-
if (isDefined(data)) {
|
|
29
|
-
results.push(data)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return results
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
has(id: K): boolean {
|
|
36
|
-
return this.map.has(id)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
set(id: K, data: V) {
|
|
40
|
-
this.map.set(id, data)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
setMany(entries: [K, V][]): void {
|
|
44
|
-
for (const [key, value] of entries) {
|
|
45
|
-
this.map.set(key, value)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './MemoryMap.ts'
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AsObjectFactory } from '@xylabs/sdk-js'
|
|
2
|
-
import {
|
|
3
|
-
asSchema, isPayloadOfZodType, type Payload,
|
|
4
|
-
} from '@xyo-network/sdk-js'
|
|
5
|
-
import { z } from 'zod'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
TypedDataDomainZod, TypedDataTypesZod, TypedDataValueZod,
|
|
9
|
-
} from '../Types.ts'
|
|
10
|
-
|
|
11
|
-
/** EIP712DataPayloadFieldsZod constant. */
|
|
12
|
-
export const EIP712DataPayloadFieldsZod = z.object({
|
|
13
|
-
domain: TypedDataDomainZod,
|
|
14
|
-
types: TypedDataTypesZod,
|
|
15
|
-
values: TypedDataValueZod,
|
|
16
|
-
})
|
|
17
|
-
/** EIP712DataPayloadFields type. */
|
|
18
|
-
export type EIP712DataPayloadFields = z.infer<typeof EIP712DataPayloadFieldsZod>
|
|
19
|
-
|
|
20
|
-
/** Schema identifier for EIP712DataPayload payloads. */
|
|
21
|
-
export const EIP712DataPayloadSchema = asSchema('network.xyo.chains.ethereum.eip712.data', true)
|
|
22
|
-
/** Schema type for EIP712DataPayload payloads. */
|
|
23
|
-
export type EIP712DataPayloadSchema = typeof EIP712DataPayloadSchema
|
|
24
|
-
|
|
25
|
-
/** EIP712DataPayload type. */
|
|
26
|
-
export type EIP712DataPayload = Payload<EIP712DataPayloadFields, EIP712DataPayloadSchema>
|
|
27
|
-
|
|
28
|
-
/** Type guard that checks if a value is a valid EIP712DataPayload. */
|
|
29
|
-
export const isEIP712DataPayload = isPayloadOfZodType<EIP712DataPayload>(
|
|
30
|
-
EIP712DataPayloadFieldsZod,
|
|
31
|
-
EIP712DataPayloadSchema,
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
/** Converts a value to EIP712DataPayload, throwing if invalid. */
|
|
35
|
-
export const asEIP712DataPayload = AsObjectFactory.create(isEIP712DataPayload)
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AsObjectFactory, HashZod } from '@xylabs/sdk-js'
|
|
2
|
-
import {
|
|
3
|
-
asSchema, isPayloadOfZodType, type Payload,
|
|
4
|
-
} from '@xyo-network/sdk-js'
|
|
5
|
-
import { z } from 'zod'
|
|
6
|
-
|
|
7
|
-
/** EIP712SignaturePayloadFieldsZod constant. */
|
|
8
|
-
export const EIP712SignaturePayloadFieldsZod = z.object({
|
|
9
|
-
address: z.string(),
|
|
10
|
-
hash: HashZod,
|
|
11
|
-
signature: z.string(),
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
/** EIP712SignaturePayloadFields type. */
|
|
15
|
-
export type EIP712SignaturePayloadFields = z.infer<typeof EIP712SignaturePayloadFieldsZod>
|
|
16
|
-
|
|
17
|
-
/** Schema identifier for EIP712SignaturePayload payloads. */
|
|
18
|
-
export const EIP712SignaturePayloadSchema = asSchema('network.xyo.chains.ethereum.eip712.signature', true)
|
|
19
|
-
/** Schema type for EIP712SignaturePayload payloads. */
|
|
20
|
-
export type EIP712SignaturePayloadSchema = typeof EIP712SignaturePayloadSchema
|
|
21
|
-
|
|
22
|
-
/** EIP712SignaturePayload type. */
|
|
23
|
-
export type EIP712SignaturePayload = Payload<EIP712SignaturePayloadFields, EIP712SignaturePayloadSchema>
|
|
24
|
-
|
|
25
|
-
/** Type guard that checks if a value is a valid EIP712SignaturePayload. */
|
|
26
|
-
export const isEIP712SignaturePayload = isPayloadOfZodType<EIP712SignaturePayload>(
|
|
27
|
-
EIP712SignaturePayloadFieldsZod,
|
|
28
|
-
EIP712SignaturePayloadSchema,
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
/** Converts a value to EIP712SignaturePayload, throwing if invalid. */
|
|
32
|
-
export const asEIP712SignaturePayload = AsObjectFactory.create(isEIP712SignaturePayload)
|
package/src/eip-712/Types.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// import type { Signer } from 'ethers/providers'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Typed Data Types
|
|
6
|
-
* Re-exposing the types from ethers for convenience and to ensure
|
|
7
|
-
* we can fix in one place if they change
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// export type TypedDataDomain = Parameters<Signer['signTypedData']>[0]
|
|
11
|
-
// export type TypedDataTypes = Parameters<Signer['signTypedData']>[1]
|
|
12
|
-
// export type TypedDataValues = Parameters<Signer['signTypedData']>[2]
|
|
13
|
-
|
|
14
|
-
/** TypedDataDomainZod constant. */
|
|
15
|
-
export const TypedDataDomainZod = z.object({
|
|
16
|
-
name: z.string().nullable().optional(),
|
|
17
|
-
version: z.string().nullable().optional(),
|
|
18
|
-
chainId: z.union([z.string(), z.number(), z.bigint()]).nullable().optional(),
|
|
19
|
-
verifyingContract: z.string().nullable().optional(),
|
|
20
|
-
salt: z.union([z.string(), z.instanceof(Uint8Array)]).nullable().optional(),
|
|
21
|
-
})
|
|
22
|
-
/** TypedDataDomain type. */
|
|
23
|
-
export type TypedDataDomain = z.infer<typeof TypedDataDomainZod>
|
|
24
|
-
|
|
25
|
-
/** TypedDataFieldZod constant. */
|
|
26
|
-
export const TypedDataFieldZod = z.object({
|
|
27
|
-
name: z.string(),
|
|
28
|
-
type: z.string(),
|
|
29
|
-
})
|
|
30
|
-
/** TypedDataField type. */
|
|
31
|
-
export type TypedDataField = z.infer<typeof TypedDataFieldZod>
|
|
32
|
-
|
|
33
|
-
/** TypedDataTypesZod constant. */
|
|
34
|
-
export const TypedDataTypesZod = z.record(z.string(), z.array(TypedDataFieldZod))
|
|
35
|
-
/** TypedDataTypes type. */
|
|
36
|
-
export type TypedDataTypes = z.infer<typeof TypedDataTypesZod>
|
|
37
|
-
|
|
38
|
-
/** TypedDataValueZod constant. */
|
|
39
|
-
export const TypedDataValueZod = z.record(z.string(), z.any())
|
|
40
|
-
/** TypedDataValues type. */
|
|
41
|
-
export type TypedDataValues = z.infer<typeof TypedDataValueZod>
|
package/src/eip-712/index.ts
DELETED
package/src/eip-712/sign.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
2
|
-
import type { Signer } from 'ethers'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
type EIP712DataPayload, type EIP712SignaturePayload, EIP712SignaturePayloadSchema,
|
|
6
|
-
} from './Payloads/index.ts'
|
|
7
|
-
|
|
8
|
-
/** signEIP712Message constant. */
|
|
9
|
-
export const signEIP712Message = async (signer: Signer, data: EIP712DataPayload): Promise<EIP712SignaturePayload> => {
|
|
10
|
-
const {
|
|
11
|
-
domain, types, values,
|
|
12
|
-
} = data
|
|
13
|
-
const signature = await signer.signTypedData(domain, types, values)
|
|
14
|
-
const hash = await PayloadBuilder.hash(data)
|
|
15
|
-
const address = await signer.getAddress()
|
|
16
|
-
return {
|
|
17
|
-
address, hash, schema: EIP712SignaturePayloadSchema, signature,
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Wallet } from 'ethers'
|
|
2
|
-
|
|
3
|
-
import type { EIP712DataPayload } from '../Payloads/index.ts'
|
|
4
|
-
import { EIP712DataPayloadSchema } from '../Payloads/index.ts'
|
|
5
|
-
|
|
6
|
-
const mnemonic = 'test test test test test test test test test test test junk'
|
|
7
|
-
|
|
8
|
-
export const wallet = Wallet.fromPhrase(mnemonic)
|
|
9
|
-
|
|
10
|
-
export const samplePayload: EIP712DataPayload = {
|
|
11
|
-
schema: EIP712DataPayloadSchema,
|
|
12
|
-
domain: {
|
|
13
|
-
name: 'MyDApp',
|
|
14
|
-
version: '1',
|
|
15
|
-
chainId: 1,
|
|
16
|
-
},
|
|
17
|
-
types: {
|
|
18
|
-
Payload: [
|
|
19
|
-
{ name: 'hash', type: 'string' },
|
|
20
|
-
{ name: 'schema', type: 'string' },
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
values: {
|
|
24
|
-
hash: '0x1234567890abcdef',
|
|
25
|
-
schema: EIP712DataPayloadSchema,
|
|
26
|
-
},
|
|
27
|
-
}
|
package/src/eip-712/verify.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { asHash, isUndefined } from '@xylabs/sdk-js'
|
|
2
|
-
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
3
|
-
import { verifyTypedData } from 'ethers'
|
|
4
|
-
|
|
5
|
-
import type { EIP712DataPayload, EIP712SignaturePayload } from './Payloads/index.ts'
|
|
6
|
-
|
|
7
|
-
/** verifyEIP712Message constant. */
|
|
8
|
-
export const verifyEIP712Message = async (data: EIP712DataPayload, sig: EIP712SignaturePayload): Promise<boolean> => {
|
|
9
|
-
const {
|
|
10
|
-
address, signature, hash,
|
|
11
|
-
} = sig
|
|
12
|
-
const { schema, ...fields } = data
|
|
13
|
-
const signedHash = asHash(hash)
|
|
14
|
-
// If there is no valid hash in the signature, or it doesn't match the calculated hash, return false
|
|
15
|
-
if (isUndefined(signedHash) || signedHash !== await PayloadBuilder.hash(data)) return false
|
|
16
|
-
// Recover the address from the signature
|
|
17
|
-
const recoveredAddress = verifyTypedData(fields.domain, fields.types, fields.values, signature)
|
|
18
|
-
// Verify it matches the expected address
|
|
19
|
-
return recoveredAddress.toLowerCase() === address.toLowerCase()
|
|
20
|
-
}
|
package/src/getFileConfig.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { isDefined, isNull } from '@xylabs/sdk-js'
|
|
2
|
-
import { cosmiconfig } from 'cosmiconfig'
|
|
3
|
-
|
|
4
|
-
import { ConfigZod } from './config/index.ts'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The name of the configuration file to search for.
|
|
8
|
-
*/
|
|
9
|
-
const configName = 'xyo'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The name of the section within the configuration file to parse.
|
|
13
|
-
*/
|
|
14
|
-
const configSection = 'xl1' // Default section in the config file
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Attempts to parse the configuration from a file using cosmiconfig.
|
|
18
|
-
* @returns The parsed configuration object if found and valid, otherwise undefined.
|
|
19
|
-
*/
|
|
20
|
-
export async function getFileConfig(searchPlaces?: string[]) {
|
|
21
|
-
const explorer = cosmiconfig(
|
|
22
|
-
configName,
|
|
23
|
-
{
|
|
24
|
-
cache: true,
|
|
25
|
-
searchPlaces,
|
|
26
|
-
},
|
|
27
|
-
)
|
|
28
|
-
const result = (await explorer.search())?.config
|
|
29
|
-
if (!isNull(result)) {
|
|
30
|
-
const section = result[configSection]
|
|
31
|
-
if (isDefined(section) && typeof section === 'object') {
|
|
32
|
-
return ConfigZod.loose().parse(section)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return ConfigZod.parse({})
|
|
36
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export * from './actor/index.ts'
|
|
2
|
-
export * from './amount/index.ts'
|
|
3
|
-
export * from './block/index.ts'
|
|
4
|
-
export * from './ChainContextHelpers.ts'
|
|
5
|
-
export * from './config/index.ts'
|
|
6
|
-
export * from './constants.ts'
|
|
7
|
-
export * from './context/index.ts'
|
|
8
|
-
export * from './CreatableProvider/index.ts'
|
|
9
|
-
export * from './createDeclarationPayload.ts'
|
|
10
|
-
export * from './createTransferPayload.ts'
|
|
11
|
-
export * from './driver/index.ts'
|
|
12
|
-
export * from './eip-712/index.ts'
|
|
13
|
-
export * from './instances/index.ts'
|
|
14
|
-
export * from './model/index.ts'
|
|
15
|
-
export * from './multipliers.ts'
|
|
16
|
-
export * from './payloads/index.ts'
|
|
17
|
-
export * from './primitives/index.ts'
|
|
18
|
-
export * from './services/index.ts'
|
|
19
|
-
export * from './SignedBigInt.ts'
|
|
20
|
-
export * from './simple/index.ts'
|
|
21
|
-
export * from './status/index.ts'
|
|
22
|
-
export * from './summary/index.ts'
|
|
23
|
-
export * from './time/index.ts'
|
|
24
|
-
export * from './transaction/index.ts'
|
|
25
|
-
export * from './utils/index.ts'
|
|
26
|
-
export * from './validation/index.ts'
|
|
27
|
-
export * from './wallet/index.ts'
|
package/src/instances/Address.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Address, Promisable } from '@xylabs/sdk-js'
|
|
2
|
-
import type { XL1AmountInstance } from '@xyo-network/xl1-protocol-lib'
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
BlockWindowInstance, BlockWindowStateInstance, ValidatableInstance,
|
|
6
|
-
} from './modifiers/index.ts'
|
|
7
|
-
|
|
8
|
-
/** Interface for Address instances. */
|
|
9
|
-
export interface AddressInstance extends ValidatableInstance {
|
|
10
|
-
address: Address
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** Interface for AddressState instances. */
|
|
14
|
-
export interface AddressStateInstance extends AddressInstance, BlockWindowStateInstance {
|
|
15
|
-
balance(): Promisable<[XL1AmountInstance, BlockWindowInstance]>
|
|
16
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { BoundWitness, Payload } from '@xyo-network/sdk-js'
|
|
2
|
-
|
|
3
|
-
import type { PayloadInstance } from './Payload.ts'
|
|
4
|
-
|
|
5
|
-
/** Interface for BoundWitness instances. */
|
|
6
|
-
export interface BoundWitnessInstance<TBoundWitness extends BoundWitness = BoundWitness,
|
|
7
|
-
TPayload extends Payload = Payload> extends PayloadInstance<TBoundWitness> {
|
|
8
|
-
|
|
9
|
-
payloadCount: number
|
|
10
|
-
payloads: PayloadInstance<TPayload>[]
|
|
11
|
-
|
|
12
|
-
payload(index: number): PayloadInstance<TPayload> | undefined
|
|
13
|
-
}
|
package/src/instances/Data.ts
DELETED
package/src/instances/Fees.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ValidatableInstance } from './modifiers/index.ts'
|
|
2
|
-
|
|
3
|
-
/** Interface for TransactionFees instances. */
|
|
4
|
-
export interface TransactionFeesInstance extends ValidatableInstance {
|
|
5
|
-
base: bigint
|
|
6
|
-
gasLimit: bigint
|
|
7
|
-
gasPrice: bigint
|
|
8
|
-
priority: bigint
|
|
9
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { HydratedBoundWitness } from '@xyo-network/sdk-js'
|
|
2
|
-
|
|
3
|
-
import type { DataInstance } from './Data.ts'
|
|
4
|
-
import type { ValidatableInstance } from './modifiers/index.ts'
|
|
5
|
-
|
|
6
|
-
/** Interface for HydratedBoundWitness instances. */
|
|
7
|
-
export interface HydratedBoundWitnessInstance<T extends HydratedBoundWitness = HydratedBoundWitness>
|
|
8
|
-
extends ValidatableInstance, DataInstance<T> {
|
|
9
|
-
|
|
10
|
-
boundWitness: T[0]
|
|
11
|
-
|
|
12
|
-
payloadCount: number
|
|
13
|
-
payloads: T[1][number][]
|
|
14
|
-
|
|
15
|
-
payload(index: number): T[1][number] | undefined
|
|
16
|
-
}
|
package/src/instances/Object.ts
DELETED
package/src/instances/Payload.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Payload } from '@xyo-network/sdk-js'
|
|
2
|
-
|
|
3
|
-
import type { ValidatableInstance } from './modifiers/index.ts'
|
|
4
|
-
import type { ObjectInstance } from './Object.ts'
|
|
5
|
-
|
|
6
|
-
/** Interface for Payload instances. */
|
|
7
|
-
export interface PayloadInstance<TPayload extends Payload = Payload> extends ObjectInstance<TPayload>, ValidatableInstance {}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Address, Hash, Hex,
|
|
3
|
-
} from '@xylabs/sdk-js'
|
|
4
|
-
|
|
5
|
-
import type { ValidatableInstance } from './modifiers/index.ts'
|
|
6
|
-
|
|
7
|
-
/** Interface for Signature instances. */
|
|
8
|
-
export interface SignatureInstance extends ValidatableInstance {
|
|
9
|
-
address: Address
|
|
10
|
-
hash: Hash
|
|
11
|
-
signature: Hex
|
|
12
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { SignatureInstance } from '../Signature.ts'
|
|
2
|
-
|
|
3
|
-
/** Interface for BlockFields instances. */
|
|
4
|
-
export interface BlockFieldsInstance<TTransactionResult> {
|
|
5
|
-
reward: bigint
|
|
6
|
-
|
|
7
|
-
signatureCount: number
|
|
8
|
-
|
|
9
|
-
signatures: SignatureInstance[]
|
|
10
|
-
|
|
11
|
-
transactionCount: number
|
|
12
|
-
|
|
13
|
-
transactions: TTransactionResult[]
|
|
14
|
-
|
|
15
|
-
signature(index: number): SignatureInstance | undefined
|
|
16
|
-
|
|
17
|
-
transaction(index: number): TTransactionResult | undefined
|
|
18
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HydratedBlock } from '@xyo-network/xl1-protocol-lib'
|
|
2
|
-
|
|
3
|
-
import type { HydratedBoundWitnessInstance } from '../HydratedBoundWitness.ts'
|
|
4
|
-
import type { SignedInstance } from '../modifiers/index.ts'
|
|
5
|
-
import type { HydratedTransactionInstance } from '../transaction/index.ts'
|
|
6
|
-
import type { BlockFieldsInstance } from './BlockFields.ts'
|
|
7
|
-
|
|
8
|
-
/** Interface for HydratedBlock instances. */
|
|
9
|
-
export interface HydratedBlockInstance<T extends HydratedBlock = HydratedBlock> extends
|
|
10
|
-
BlockFieldsInstance<HydratedTransactionInstance>, HydratedBoundWitnessInstance<T>, SignedInstance {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './HydratedBlock.ts'
|
package/src/instances/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './Address.ts'
|
|
2
|
-
export * from './block/index.ts'
|
|
3
|
-
export * from './BoundWitness.ts'
|
|
4
|
-
export * from './Data.ts'
|
|
5
|
-
export * from './Fees.ts'
|
|
6
|
-
export * from './modifiers/index.ts'
|
|
7
|
-
export * from './Object.ts'
|
|
8
|
-
export * from './Payload.ts'
|
|
9
|
-
export * from './Signature.ts'
|
|
10
|
-
export * from './transaction/index.ts'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AllowedBlockPayload, HydratedTransaction } from '@xyo-network/xl1-protocol-lib'
|
|
2
|
-
|
|
3
|
-
import type { HydratedBoundWitnessInstance } from '../HydratedBoundWitness.ts'
|
|
4
|
-
import type { TransactionFieldsInstance } from './TransactionFields.ts'
|
|
5
|
-
|
|
6
|
-
/** Interface for HydratedTransaction instances. */
|
|
7
|
-
export interface HydratedTransactionInstance<T extends HydratedTransaction = HydratedTransaction>
|
|
8
|
-
extends TransactionFieldsInstance<T[1][number] & AllowedBlockPayload>, HydratedBoundWitnessInstance<T> {
|
|
9
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import type { Payload, Schema } from '@xyo-network/sdk-js'
|
|
3
|
-
import type { AllowedBlockPayload } from '@xyo-network/xl1-protocol-lib'
|
|
4
|
-
|
|
5
|
-
import type { TransactionFeesInstance } from '../Fees.ts'
|
|
6
|
-
|
|
7
|
-
/** Interface for TransactionFields instances. */
|
|
8
|
-
export interface TransactionFieldsInstance<TBlockPayload extends AllowedBlockPayload = AllowedBlockPayload> {
|
|
9
|
-
elevatedPayloadCount: number
|
|
10
|
-
elevatedPayloads: TBlockPayload[]
|
|
11
|
-
externalPayloads: Record<Hash, Schema | Payload>
|
|
12
|
-
|
|
13
|
-
fees: TransactionFeesInstance
|
|
14
|
-
|
|
15
|
-
privateExternalPayloads: Record<Hash, Schema>
|
|
16
|
-
publicExternalPayloads: Payload[]
|
|
17
|
-
|
|
18
|
-
signatureCount: number
|
|
19
|
-
|
|
20
|
-
elevatedPayload(index: number): TBlockPayload | undefined
|
|
21
|
-
reward(): bigint
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './HydratedTransaction.ts'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import ky from 'ky'
|
|
2
|
-
|
|
3
|
-
/** Type guard that checks if a value is a valid InternetAvailable. */
|
|
4
|
-
export const isInternetAvailable = async (): Promise<boolean> => {
|
|
5
|
-
try {
|
|
6
|
-
await ky('https://cloudflare.com/cdn-cgi/trace', { signal: AbortSignal.timeout(2000) })
|
|
7
|
-
return true
|
|
8
|
-
} catch {
|
|
9
|
-
return false
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ChainForkStatic.ts'
|