@xyo-network/xl1-protocol 1.12.108 → 1.13.0
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/index.d.ts +0 -3
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +0 -57
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/GatewayName.d.ts +4 -0
- package/dist/neutral/model/GatewayName.d.ts.map +1 -0
- package/dist/neutral/model/index.d.ts +1 -0
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/dist/neutral/network/NetworkId.d.ts +1 -1
- package/dist/neutral/network/NetworkId.d.ts.map +1 -1
- package/dist/neutral/validation/index.d.ts +0 -1
- package/dist/neutral/validation/index.d.ts.map +1 -1
- package/package.json +1 -3
- package/src/index.ts +0 -3
- package/src/model/GatewayName.ts +1 -0
- package/src/model/index.ts +1 -0
- package/src/network/NetworkId.ts +1 -1
- package/src/validation/index.ts +0 -1
- package/dist/neutral/interfaces/index.d.ts +0 -2
- package/dist/neutral/interfaces/index.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/AccountBalance.d.ts +0 -22
- package/dist/neutral/interfaces/viewers/AccountBalance.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/Block.d.ts +0 -12
- package/dist/neutral/interfaces/viewers/Block.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/Chain.d.ts +0 -6
- package/dist/neutral/interfaces/viewers/Chain.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/ChainContract.d.ts +0 -10
- package/dist/neutral/interfaces/viewers/ChainContract.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/Fork.d.ts +0 -8
- package/dist/neutral/interfaces/viewers/Fork.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeStepReward.d.ts +0 -30
- package/dist/neutral/interfaces/viewers/NetworkStakeStepReward.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/NetworkStakeViewer.d.ts +0 -10
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/NetworkStakeViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RecordKeyType.d.ts +0 -2
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RecordKeyType.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.d.ts +0 -6
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.d.ts +0 -7
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.d.ts +0 -8
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.d.ts +0 -8
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.d.ts +0 -8
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.d.ts +0 -9
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.d.ts +0 -15
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.d.ts +0 -13
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepViewer.d.ts +0 -26
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/index.d.ts +0 -12
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/index.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/Stake.d.ts +0 -14
- package/dist/neutral/interfaces/viewers/Stake.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/StakeTotalsViewer.d.ts +0 -12
- package/dist/neutral/interfaces/viewers/StakeTotalsViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/StakeViewer.d.ts +0 -11
- package/dist/neutral/interfaces/viewers/StakeViewer.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/StepStake.d.ts +0 -8
- package/dist/neutral/interfaces/viewers/StepStake.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/TimeSync.d.ts +0 -16
- package/dist/neutral/interfaces/viewers/TimeSync.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/Transaction.d.ts +0 -9
- package/dist/neutral/interfaces/viewers/Transaction.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/TransferBalance.d.ts +0 -27
- package/dist/neutral/interfaces/viewers/TransferBalance.d.ts.map +0 -1
- package/dist/neutral/interfaces/viewers/index.d.ts +0 -15
- package/dist/neutral/interfaces/viewers/index.d.ts.map +0 -1
- package/dist/neutral/provider/TransactionHelper.d.ts +0 -8
- package/dist/neutral/provider/TransactionHelper.d.ts.map +0 -1
- package/dist/neutral/provider/TransactionSubmitter.d.ts +0 -19
- package/dist/neutral/provider/TransactionSubmitter.d.ts.map +0 -1
- package/dist/neutral/provider/XyoClient.d.ts +0 -19
- package/dist/neutral/provider/XyoClient.d.ts.map +0 -1
- package/dist/neutral/provider/XyoConnection.d.ts +0 -36
- package/dist/neutral/provider/XyoConnection.d.ts.map +0 -1
- package/dist/neutral/provider/XyoDataLake.d.ts +0 -18
- package/dist/neutral/provider/XyoDataLake.d.ts.map +0 -1
- package/dist/neutral/provider/XyoGateway.d.ts +0 -19
- package/dist/neutral/provider/XyoGateway.d.ts.map +0 -1
- package/dist/neutral/provider/XyoGatewayHelpers.d.ts +0 -17
- package/dist/neutral/provider/XyoGatewayHelpers.d.ts.map +0 -1
- package/dist/neutral/provider/XyoNetwork.d.ts +0 -6
- package/dist/neutral/provider/XyoNetwork.d.ts.map +0 -1
- package/dist/neutral/provider/XyoRunner.d.ts +0 -7
- package/dist/neutral/provider/XyoRunner.d.ts.map +0 -1
- package/dist/neutral/provider/XyoSigner.d.ts +0 -16
- package/dist/neutral/provider/XyoSigner.d.ts.map +0 -1
- package/dist/neutral/provider/XyoViewer.d.ts +0 -7
- package/dist/neutral/provider/XyoViewer.d.ts.map +0 -1
- package/dist/neutral/provider/XyoWallet.d.ts +0 -15
- package/dist/neutral/provider/XyoWallet.d.ts.map +0 -1
- package/dist/neutral/provider/index.d.ts +0 -13
- package/dist/neutral/provider/index.d.ts.map +0 -1
- package/dist/neutral/provider/permissions/InvokerPermission.d.ts +0 -51
- package/dist/neutral/provider/permissions/InvokerPermission.d.ts.map +0 -1
- package/dist/neutral/provider/permissions/XyoPermissions.d.ts +0 -32
- package/dist/neutral/provider/permissions/XyoPermissions.d.ts.map +0 -1
- package/dist/neutral/provider/permissions/index.d.ts +0 -3
- package/dist/neutral/provider/permissions/index.d.ts.map +0 -1
- package/dist/neutral/services/AccountBalanceService.d.ts +0 -16
- package/dist/neutral/services/AccountBalanceService.d.ts.map +0 -1
- package/dist/neutral/services/AccountTransfersService.d.ts +0 -11
- package/dist/neutral/services/AccountTransfersService.d.ts.map +0 -1
- package/dist/neutral/services/BlockProducerService.d.ts +0 -8
- package/dist/neutral/services/BlockProducerService.d.ts.map +0 -1
- package/dist/neutral/services/BlockRewardService.d.ts +0 -6
- package/dist/neutral/services/BlockRewardService.d.ts.map +0 -1
- package/dist/neutral/services/BlockRewardServiceV2.d.ts +0 -6
- package/dist/neutral/services/BlockRewardServiceV2.d.ts.map +0 -1
- package/dist/neutral/services/Chain/BaseChainService.d.ts +0 -6
- package/dist/neutral/services/Chain/BaseChainService.d.ts.map +0 -1
- package/dist/neutral/services/Chain/ChainHeadService.d.ts +0 -6
- package/dist/neutral/services/Chain/ChainHeadService.d.ts.map +0 -1
- package/dist/neutral/services/Chain/ChainService.d.ts +0 -5
- package/dist/neutral/services/Chain/ChainService.d.ts.map +0 -1
- package/dist/neutral/services/Chain/index.d.ts +0 -5
- package/dist/neutral/services/Chain/index.d.ts.map +0 -1
- package/dist/neutral/services/Chain/interfaces/ChainContractViewer.d.ts +0 -4
- package/dist/neutral/services/Chain/interfaces/ChainContractViewer.d.ts.map +0 -1
- package/dist/neutral/services/Chain/interfaces/ChainStakeViewer.d.ts +0 -5
- package/dist/neutral/services/Chain/interfaces/ChainStakeViewer.d.ts.map +0 -1
- package/dist/neutral/services/Chain/interfaces/ChainStaker.d.ts +0 -6
- package/dist/neutral/services/Chain/interfaces/ChainStaker.d.ts.map +0 -1
- package/dist/neutral/services/Chain/interfaces/index.d.ts +0 -4
- package/dist/neutral/services/Chain/interfaces/index.d.ts.map +0 -1
- package/dist/neutral/services/ChainIterator/ChainIteratorService.d.ts +0 -25
- package/dist/neutral/services/ChainIterator/ChainIteratorService.d.ts.map +0 -1
- package/dist/neutral/services/ChainIterator/ChainIteratorServiceEventData.d.ts +0 -11
- package/dist/neutral/services/ChainIterator/ChainIteratorServiceEventData.d.ts.map +0 -1
- package/dist/neutral/services/ChainIterator/index.d.ts +0 -3
- package/dist/neutral/services/ChainIterator/index.d.ts.map +0 -1
- package/dist/neutral/services/Election.d.ts +0 -12
- package/dist/neutral/services/Election.d.ts.map +0 -1
- package/dist/neutral/services/NetworkStakeService.d.ts +0 -5
- package/dist/neutral/services/NetworkStakeService.d.ts.map +0 -1
- package/dist/neutral/services/Params.d.ts +0 -9
- package/dist/neutral/services/Params.d.ts.map +0 -1
- package/dist/neutral/services/PendingTransactionsService.d.ts +0 -7
- package/dist/neutral/services/PendingTransactionsService.d.ts.map +0 -1
- package/dist/neutral/services/Service.d.ts +0 -5
- package/dist/neutral/services/Service.d.ts.map +0 -1
- package/dist/neutral/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts +0 -32
- package/dist/neutral/services/StakeIntentService/ChainIndexingServiceStateSchema.d.ts.map +0 -1
- package/dist/neutral/services/StakeIntentService/StakeIntentService.d.ts +0 -31
- package/dist/neutral/services/StakeIntentService/StakeIntentService.d.ts.map +0 -1
- package/dist/neutral/services/StakeIntentService/index.d.ts +0 -3
- package/dist/neutral/services/StakeIntentService/index.d.ts.map +0 -1
- package/dist/neutral/services/StepStakeService.d.ts +0 -5
- package/dist/neutral/services/StepStakeService.d.ts.map +0 -1
- package/dist/neutral/services/TimeSyncService.d.ts +0 -7
- package/dist/neutral/services/TimeSyncService.d.ts.map +0 -1
- package/dist/neutral/services/index.d.ts +0 -15
- package/dist/neutral/services/index.d.ts.map +0 -1
- package/dist/neutral/validation/block/BlockValidationFunction.d.ts +0 -6
- package/dist/neutral/validation/block/BlockValidationFunction.d.ts.map +0 -1
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts +0 -19
- package/dist/neutral/validation/block/HydratedBlockStateValidationFunction.d.ts.map +0 -1
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts +0 -12
- package/dist/neutral/validation/block/HydratedBlockValidationFunction.d.ts.map +0 -1
- package/dist/neutral/validation/block/error.d.ts +0 -16
- package/dist/neutral/validation/block/error.d.ts.map +0 -1
- package/dist/neutral/validation/block/error.spec.d.ts +0 -2
- package/dist/neutral/validation/block/error.spec.d.ts.map +0 -1
- package/dist/neutral/validation/block/index.d.ts +0 -5
- package/dist/neutral/validation/block/index.d.ts.map +0 -1
- package/src/interfaces/index.ts +0 -1
- package/src/interfaces/viewers/AccountBalance.ts +0 -25
- package/src/interfaces/viewers/Block.ts +0 -14
- package/src/interfaces/viewers/Chain.ts +0 -7
- package/src/interfaces/viewers/ChainContract.ts +0 -10
- package/src/interfaces/viewers/Fork.ts +0 -10
- package/src/interfaces/viewers/NetworkStakeStepReward.ts +0 -70
- package/src/interfaces/viewers/NetworkStakeViewer/NetworkStakeViewer.ts +0 -12
- package/src/interfaces/viewers/NetworkStakeViewer/RecordKeyType.ts +0 -2
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.ts +0 -6
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.ts +0 -7
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.ts +0 -9
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.ts +0 -8
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.ts +0 -8
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.ts +0 -9
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.ts +0 -19
- package/src/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.ts +0 -13
- package/src/interfaces/viewers/NetworkStakeViewer/StepViewer.ts +0 -42
- package/src/interfaces/viewers/NetworkStakeViewer/index.ts +0 -13
- package/src/interfaces/viewers/Stake.ts +0 -23
- package/src/interfaces/viewers/StakeTotalsViewer.ts +0 -12
- package/src/interfaces/viewers/StakeViewer.ts +0 -13
- package/src/interfaces/viewers/StepStake.ts +0 -20
- package/src/interfaces/viewers/TimeSync.ts +0 -20
- package/src/interfaces/viewers/Transaction.ts +0 -10
- package/src/interfaces/viewers/TransferBalance.ts +0 -30
- package/src/interfaces/viewers/index.ts +0 -14
- package/src/provider/TransactionHelper.ts +0 -15
- package/src/provider/TransactionSubmitter.ts +0 -26
- package/src/provider/XyoClient.ts +0 -21
- package/src/provider/XyoConnection.ts +0 -54
- package/src/provider/XyoDataLake.ts +0 -43
- package/src/provider/XyoGateway.ts +0 -21
- package/src/provider/XyoGatewayHelpers.ts +0 -30
- package/src/provider/XyoNetwork.ts +0 -7
- package/src/provider/XyoRunner.ts +0 -8
- package/src/provider/XyoSigner.ts +0 -29
- package/src/provider/XyoViewer.ts +0 -17
- package/src/provider/XyoWallet.ts +0 -16
- package/src/provider/index.ts +0 -12
- package/src/provider/permissions/InvokerPermission.ts +0 -56
- package/src/provider/permissions/XyoPermissions.ts +0 -40
- package/src/provider/permissions/index.ts +0 -2
- package/src/services/AccountBalanceService.ts +0 -22
- package/src/services/AccountTransfersService.ts +0 -12
- package/src/services/BlockProducerService.ts +0 -8
- package/src/services/BlockRewardService.ts +0 -8
- package/src/services/BlockRewardServiceV2.ts +0 -8
- package/src/services/Chain/BaseChainService.ts +0 -6
- package/src/services/Chain/ChainHeadService.ts +0 -7
- package/src/services/Chain/ChainService.ts +0 -6
- package/src/services/Chain/index.ts +0 -4
- package/src/services/Chain/interfaces/ChainContractViewer.ts +0 -5
- package/src/services/Chain/interfaces/ChainStakeViewer.ts +0 -6
- package/src/services/Chain/interfaces/ChainStaker.ts +0 -5
- package/src/services/Chain/interfaces/index.ts +0 -3
- package/src/services/ChainIterator/ChainIteratorService.ts +0 -45
- package/src/services/ChainIterator/ChainIteratorServiceEventData.ts +0 -14
- package/src/services/ChainIterator/index.ts +0 -2
- package/src/services/Election.ts +0 -15
- package/src/services/NetworkStakeService.ts +0 -4
- package/src/services/Params.ts +0 -12
- package/src/services/PendingTransactionsService.ts +0 -8
- package/src/services/Service.ts +0 -5
- package/src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts +0 -43
- package/src/services/StakeIntentService/StakeIntentService.ts +0 -36
- package/src/services/StakeIntentService/index.ts +0 -2
- package/src/services/StepStakeService.ts +0 -4
- package/src/services/TimeSyncService.ts +0 -6
- package/src/services/index.ts +0 -14
- package/src/validation/block/BlockValidationFunction.ts +0 -10
- package/src/validation/block/HydratedBlockStateValidationFunction.ts +0 -25
- package/src/validation/block/HydratedBlockValidationFunction.ts +0 -16
- package/src/validation/block/error.spec.ts +0 -20
- package/src/validation/block/error.ts +0 -44
- package/src/validation/block/index.ts +0 -4
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
export interface StakeTotalsViewer {
|
|
5
|
-
active(): Promisable<bigint>
|
|
6
|
-
activeByStaked(staked: Address): Promisable<bigint>
|
|
7
|
-
activeByStaker(address: Address): Promisable<bigint>
|
|
8
|
-
pending(): Promisable<bigint>
|
|
9
|
-
pendingByStaker(staker: Address): Promisable<bigint>
|
|
10
|
-
withdrawn(): Promisable<bigint>
|
|
11
|
-
withdrawnByStaker(staker: Address): Promisable<bigint>
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { Position } from './Stake.ts'
|
|
5
|
-
|
|
6
|
-
export interface StakeViewer {
|
|
7
|
-
stakeById(id: number): Promisable<Position>
|
|
8
|
-
stakeByStaker(staker: Address, slot: number): Promisable<Position>
|
|
9
|
-
/* @deprecated use stakesByStaker */
|
|
10
|
-
stakedByStaker(staker: Address): Promisable<Address[]>
|
|
11
|
-
stakesByStaked(staked: Address): Promisable<Position[]>
|
|
12
|
-
stakesByStaker(staker: Address): Promisable<Position[]>
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { StepIdentity } from '../../model/index.ts'
|
|
5
|
-
|
|
6
|
-
export interface StepStakeViewInterface {
|
|
7
|
-
// this is the prorated stake for all addresses in the step
|
|
8
|
-
stepStake: (step: StepIdentity) => Promisable<Record<Address, bigint>>
|
|
9
|
-
|
|
10
|
-
// this is the prorated stake for a specific address in the step
|
|
11
|
-
stepStakeForAddress: (address: Address, step: StepIdentity) => Promisable<bigint>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* Prorated stake is the amount of stake that is allocated to a specific step
|
|
15
|
-
based on the total stake and the number of steps. This is used to ensure
|
|
16
|
-
that the stake is distributed fairly among all steps.
|
|
17
|
-
|
|
18
|
-
The simplest way to calculate it is to enumerate every XL1 block in the step add the current stake at that point to a counter.
|
|
19
|
-
For example, if an Address had a stake of 100 for the entire time, then the prorated stake would be 100 * number of blocks in the step.
|
|
20
|
-
*/
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { TimeDomain, TimePayload } from '../../payload/index.ts'
|
|
5
|
-
|
|
6
|
-
export interface TimeSyncViewInterface {
|
|
7
|
-
/** Convert time between different domains */
|
|
8
|
-
convertTime(fromDomain: TimeDomain, toDomain: TimeDomain, from: number): Promisable<number>
|
|
9
|
-
|
|
10
|
-
/** Get the current time for a given domain */
|
|
11
|
-
currentTime(domain: TimeDomain): Promisable<[string, number]>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface TimeSyncViewInterfaceV2 extends TimeSyncViewInterface {
|
|
15
|
-
/** Get the current time for a given domain */
|
|
16
|
-
currentTimeAndHash(domain: TimeDomain): Promisable<[number, Hash | null]>
|
|
17
|
-
|
|
18
|
-
/** Create a TimePayload with the current time from all configured domains */
|
|
19
|
-
currentTimePayload(): Promisable<TimePayload>
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { SignedHydratedTransaction } from '../../transaction/index.ts'
|
|
5
|
-
|
|
6
|
-
export interface TransactionViewInterface {
|
|
7
|
-
transactionByBlockHashAndIndex(blockHash: Hash, transactionIndex: number): Promisable<SignedHydratedTransaction | null>
|
|
8
|
-
transactionByBlockNumberAndIndex(blockNumber: number, transactionIndex: number): Promisable<SignedHydratedTransaction | null>
|
|
9
|
-
transactionByHash(transactionHash: Hash): Promisable<SignedHydratedTransaction | null>
|
|
10
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
4
|
-
|
|
5
|
-
import type { BlockBoundWitness } from '../../block/index.ts'
|
|
6
|
-
import type { XL1BlockRange } from '../../model/index.ts'
|
|
7
|
-
import type { Transfer } from '../../payload/index.ts'
|
|
8
|
-
import type { TransactionBoundWitness } from '../../transaction/index.ts'
|
|
9
|
-
import type { AttoXL1 } from '../../xl1/index.ts'
|
|
10
|
-
|
|
11
|
-
export type TransferBalanceHistoryItem = [
|
|
12
|
-
Signed<BlockBoundWitness> /* block */,
|
|
13
|
-
Signed<TransactionBoundWitness> | null,
|
|
14
|
-
Transfer, /* the actual transfer payload */
|
|
15
|
-
]
|
|
16
|
-
export type TransferPair = [/* from */ Address, /* to */Address]
|
|
17
|
-
|
|
18
|
-
export interface TransferBalancesViewInterface {
|
|
19
|
-
transferBalances(address: Address[]): Promisable<Partial<Record<Address, Record<Address, AttoXL1>>>>
|
|
20
|
-
transferBalancesHistories(address: Address[]): Promisable<Partial<Record<Address, Record<Address, TransferBalanceHistoryItem[]>>>>
|
|
21
|
-
transferPairBalances(address: TransferPair[]): Promisable<Partial<Record<Address, Record<Address, AttoXL1>>>>
|
|
22
|
-
transferPairBalancesHistories(address: TransferPair[]): Promisable<Partial<Record<Address, Record<Address, TransferBalanceHistoryItem[]>>>>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TransferBalanceViewInterface {
|
|
26
|
-
transferBalance(address: Address): Promisable<AttoXL1>
|
|
27
|
-
transferBalanceHistory(address: Address, range?: XL1BlockRange): Promisable<TransferBalanceHistoryItem[]>
|
|
28
|
-
transferPairBalance(address: TransferPair): Promisable<AttoXL1>
|
|
29
|
-
transferPairBalanceHistory(address: TransferPair): Promisable<TransferBalanceHistoryItem[]>
|
|
30
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './AccountBalance.ts'
|
|
2
|
-
export * from './Block.ts'
|
|
3
|
-
export * from './Chain.ts'
|
|
4
|
-
export * from './ChainContract.ts'
|
|
5
|
-
export * from './Fork.ts'
|
|
6
|
-
export * from './NetworkStakeStepReward.ts'
|
|
7
|
-
export * from './NetworkStakeViewer/index.ts'
|
|
8
|
-
export * from './Stake.ts'
|
|
9
|
-
export * from './StakeTotalsViewer.ts'
|
|
10
|
-
export * from './StakeViewer.ts'
|
|
11
|
-
export * from './StepStake.ts'
|
|
12
|
-
export * from './TimeSync.ts'
|
|
13
|
-
export * from './Transaction.ts'
|
|
14
|
-
export * from './TransferBalance.ts'
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/member-ordering */
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
3
|
-
|
|
4
|
-
import type { UnsignedHydratedTransaction } from '../transaction/index.ts'
|
|
5
|
-
|
|
6
|
-
export interface TransactionHelper {
|
|
7
|
-
// build tx, sign tx, send tx
|
|
8
|
-
addPayloadsToChain(onChain: Payload[], offChain: Payload[]): void
|
|
9
|
-
|
|
10
|
-
// sign tx, send tx
|
|
11
|
-
addUnsignedTransactionToChain(tx: UnsignedHydratedTransaction): void
|
|
12
|
-
|
|
13
|
-
// send tx (primitive)
|
|
14
|
-
addSignedTransactionToChain(tx: UnsignedHydratedTransaction): void
|
|
15
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
-
|
|
5
|
-
import type { AllowedBlockPayload } from '../block/index.ts'
|
|
6
|
-
import type { SignedHydratedTransaction, TransactionFeesBigInt } from '../transaction/index.ts'
|
|
7
|
-
|
|
8
|
-
/** @deprecated use TransactionOptions instead */
|
|
9
|
-
export interface TransactionSubmitterOptions {
|
|
10
|
-
chain?: Hex
|
|
11
|
-
exp?: number
|
|
12
|
-
fees?: TransactionFeesBigInt
|
|
13
|
-
from?: Address
|
|
14
|
-
nbf?: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** @deprecated use XyoGatewayHelpers instead */
|
|
18
|
-
export interface TransactionSubmitter {
|
|
19
|
-
/** @deprecated use runner.broadcastTransaction */
|
|
20
|
-
submitTransaction(
|
|
21
|
-
elevatedPayloads: AllowedBlockPayload[],
|
|
22
|
-
additionalPayloads: Payload[],
|
|
23
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
24
|
-
options?: TransactionSubmitterOptions
|
|
25
|
-
): Promisable<SignedHydratedTransaction>
|
|
26
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { XyoPermissions } from './permissions/index.ts'
|
|
2
|
-
import type { XyoGatewayProvider } from './XyoGateway.ts'
|
|
3
|
-
|
|
4
|
-
export type GatewayName = string & { __gatewayName: true }
|
|
5
|
-
|
|
6
|
-
export interface XyoGatewayConfig {
|
|
7
|
-
name: GatewayName
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface XyoRpcGatewayConfig extends XyoGatewayConfig {
|
|
11
|
-
dataLakeEndpoint: string
|
|
12
|
-
networkEndpoint: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface XyoClient {
|
|
16
|
-
gateways: Readonly<Record<GatewayName, XyoGatewayProvider>>
|
|
17
|
-
permissions: XyoPermissions
|
|
18
|
-
|
|
19
|
-
addGateway?(providerOrConfig: XyoGatewayConfig | XyoRpcGatewayConfig | XyoGatewayProvider): Promise<XyoGatewayProvider>
|
|
20
|
-
removeGateway?(name: GatewayName): Promise<void>
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from '@xylabs/hex'
|
|
2
|
-
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
-
|
|
5
|
-
import type { AllowedBlockPayload } from '../block/index.ts'
|
|
6
|
-
import type { NetworkStakeViewer } from '../interfaces/index.ts'
|
|
7
|
-
import type { TransactionBoundWitness, TransactionFeesBigInt } from '../transaction/index.ts'
|
|
8
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
9
|
-
import type { TransactionSubmitter } from './TransactionSubmitter.ts'
|
|
10
|
-
import type { XyoDataLake, XyoDataLakeViewer } from './XyoDataLake.ts'
|
|
11
|
-
import type { XyoNetwork } from './XyoNetwork.ts'
|
|
12
|
-
import type { XyoRunner } from './XyoRunner.ts'
|
|
13
|
-
import type { XyoSigner } from './XyoSigner.ts'
|
|
14
|
-
import type { XyoViewer } from './XyoViewer.ts'
|
|
15
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
16
|
-
import type { XyoWallet } from './XyoWallet.ts'
|
|
17
|
-
|
|
18
|
-
/** @deprecated use XyoConnectionProvider instead */
|
|
19
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
20
|
-
export interface XyoConnectionProviderDeprecated extends TransactionSubmitter {
|
|
21
|
-
|
|
22
|
-
/** @deprecated - use from gateway instead */
|
|
23
|
-
signer: XyoSigner
|
|
24
|
-
|
|
25
|
-
/** @deprecated - use host instead */
|
|
26
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
27
|
-
wallet: XyoWallet
|
|
28
|
-
|
|
29
|
-
/** @deprecated - use submitTransaction instead */
|
|
30
|
-
send(
|
|
31
|
-
elevatedPayloads: AllowedBlockPayload[],
|
|
32
|
-
additionalPayloads: Payload[],
|
|
33
|
-
chain?: Hex,
|
|
34
|
-
nbf?: number,
|
|
35
|
-
exp?: number,
|
|
36
|
-
from?: Address,
|
|
37
|
-
fees?: TransactionFeesBigInt,
|
|
38
|
-
): Promise<Signed<TransactionBoundWitness>>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// eslint-disable-next-line sonarjs/deprecation
|
|
42
|
-
export interface XyoConnection extends Partial<XyoConnectionProviderDeprecated> {
|
|
43
|
-
network?: XyoNetwork
|
|
44
|
-
networkStake?: NetworkStakeViewer
|
|
45
|
-
runner?: XyoRunner
|
|
46
|
-
storage?: XyoDataLake | XyoDataLakeViewer
|
|
47
|
-
viewer?: XyoViewer
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** @deprecated use XyoConnectionProvider */
|
|
51
|
-
export interface XyoConnectionProvider extends XyoConnection {}
|
|
52
|
-
|
|
53
|
-
/** @deprecated use XyoConnectionProvider */
|
|
54
|
-
export interface XyoProvider extends XyoConnection {}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
-
|
|
5
|
-
export type DataLakeData = Payload | ArrayBuffer
|
|
6
|
-
|
|
7
|
-
export interface XyoDataLakeViewer {
|
|
8
|
-
// if resolves to hash payload, keep going until hitting a non-payload or maxDepth, or unable to find
|
|
9
|
-
fetch(hashes: Hash[], maxDepth?: number): Promisable<DataLakeData[]>
|
|
10
|
-
// same as fetch but never follows hash payloads
|
|
11
|
-
get(hashes: Hash[]): Promisable<DataLakeData[]>
|
|
12
|
-
// same as fetch, except returns each step in tuple containing the result and the steps
|
|
13
|
-
trace(hash: Hash): Promisable<[DataLakeData | undefined, Payload[]]>
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface XyoDataLake extends XyoDataLakeViewer {
|
|
17
|
-
add(items: DataLakeData[]): Promisable<DataLakeData[]>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** @deprecated use XyoDataLake instead */
|
|
21
|
-
export interface XyoDataLakeProvider extends XyoDataLake {
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const isDataLakeViewer = (value: unknown): value is XyoDataLakeViewer => {
|
|
25
|
-
return (
|
|
26
|
-
typeof value === 'object'
|
|
27
|
-
&& value !== null
|
|
28
|
-
&& 'fetch' in value
|
|
29
|
-
&& typeof (value as XyoDataLakeViewer).fetch === 'function'
|
|
30
|
-
&& 'get' in value
|
|
31
|
-
&& typeof (value as XyoDataLakeViewer).get === 'function'
|
|
32
|
-
&& 'trace' in value
|
|
33
|
-
&& typeof (value as XyoDataLakeViewer).trace === 'function'
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const isDataLakeProvider = (value: unknown): value is XyoDataLake => {
|
|
38
|
-
return (
|
|
39
|
-
isDataLakeViewer(value)
|
|
40
|
-
&& 'add' in value
|
|
41
|
-
&& typeof (value as XyoDataLake).add === 'function'
|
|
42
|
-
)
|
|
43
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
|
|
3
|
-
import type { XyoConnection } from './XyoConnection.ts'
|
|
4
|
-
import type { XyoGatewayHelpers } from './XyoGatewayHelpers.ts'
|
|
5
|
-
import type { XyoSigner } from './XyoSigner.ts'
|
|
6
|
-
|
|
7
|
-
/** @deprecated use XyoConnectionConfig instead */
|
|
8
|
-
export interface XyoConnectionConfigDeprecated {
|
|
9
|
-
name: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface XyoGatewayProvider extends Partial<XyoGatewayHelpers> {
|
|
13
|
-
/**
|
|
14
|
-
* Returns the connection provider for this gateway.
|
|
15
|
-
*/
|
|
16
|
-
connection(): Promisable<XyoConnection>
|
|
17
|
-
/**
|
|
18
|
-
* Returns the signer for this gateway.
|
|
19
|
-
*/
|
|
20
|
-
signer(): Promisable<XyoSigner>
|
|
21
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Address, Hash, Hex,
|
|
3
|
-
} from '@xylabs/hex'
|
|
4
|
-
import type { Promisable } from '@xylabs/promise'
|
|
5
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
6
|
-
|
|
7
|
-
import type { AllowedBlockPayload } from '../block/index.ts'
|
|
8
|
-
import type { TransactionBoundWitness, TransactionFeesBigInt } from '../transaction/index.ts'
|
|
9
|
-
|
|
10
|
-
export interface TransactionOptions {
|
|
11
|
-
chain?: Hex
|
|
12
|
-
exp?: number
|
|
13
|
-
fees?: TransactionFeesBigInt
|
|
14
|
-
from?: Address
|
|
15
|
-
nbf?: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface XyoGatewayHelpers {
|
|
19
|
-
|
|
20
|
-
addPayloadsToChain(
|
|
21
|
-
onChain: AllowedBlockPayload[],
|
|
22
|
-
offChain: Payload[],
|
|
23
|
-
options?: TransactionOptions
|
|
24
|
-
): Promisable<[Hash, [TransactionBoundWitness, Payload[]]]>
|
|
25
|
-
|
|
26
|
-
addTransactionToChain(
|
|
27
|
-
tx: [TransactionBoundWitness, Payload[]],
|
|
28
|
-
): Promisable<Hash>
|
|
29
|
-
|
|
30
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { SignedHydratedTransaction } from '../transaction/index.ts'
|
|
5
|
-
|
|
6
|
-
export interface XyoRunner {
|
|
7
|
-
broadcastTransaction(transaction: SignedHydratedTransaction): Promisable<Hash>
|
|
8
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
import type { Signed, UnsignedBoundWitness } from '@xyo-network/boundwitness-model'
|
|
4
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
5
|
-
|
|
6
|
-
import type { AllowedBlockPayload } from '../block/index.ts'
|
|
7
|
-
import type { ChainId } from '../model/index.ts'
|
|
8
|
-
import type { TransactionBoundWitness, TransactionFeesBigInt } from '../transaction/index.ts'
|
|
9
|
-
|
|
10
|
-
export interface XyoSigner {
|
|
11
|
-
address(): Promisable<Address>
|
|
12
|
-
// The tx passed in must have all the payloads (on and off chain) in the payloads array
|
|
13
|
-
// Returns the signed transaction and the payloads array excluding the off-chain payloads.
|
|
14
|
-
// The return value is ready to be broadcast to block producers
|
|
15
|
-
signTransaction(tx: [UnsignedBoundWitness<TransactionBoundWitness>, Payload[]]): Promisable<[Signed<TransactionBoundWitness>, Payload[]]>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface XyoSignerDeprecated {
|
|
19
|
-
/** @deprecated use signTransaction instead */
|
|
20
|
-
createSignedTransaction(
|
|
21
|
-
chain: ChainId,
|
|
22
|
-
elevatedPayloads: AllowedBlockPayload[],
|
|
23
|
-
additionalPayloads: Payload[],
|
|
24
|
-
nbf: number,
|
|
25
|
-
exp: number,
|
|
26
|
-
fees: TransactionFeesBigInt,
|
|
27
|
-
from?: Address,
|
|
28
|
-
): Promisable<Signed<TransactionBoundWitness>>
|
|
29
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AccountBalanceViewInterface, BlockViewInterface, ChainViewInterface,
|
|
3
|
-
ForkViewer,
|
|
4
|
-
NetworkStakeStepRewardViewInterface,
|
|
5
|
-
NetworkStakeViewer,
|
|
6
|
-
StakeViewer,
|
|
7
|
-
TransactionViewInterface, TransferBalanceViewInterface,
|
|
8
|
-
} from '../interfaces/index.ts'
|
|
9
|
-
|
|
10
|
-
export interface XyoViewerMethods extends AccountBalanceViewInterface, TransferBalanceViewInterface,
|
|
11
|
-
NetworkStakeStepRewardViewInterface,
|
|
12
|
-
ChainViewInterface, BlockViewInterface, TransactionViewInterface, StakeViewer, ForkViewer {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface XyoViewer extends XyoViewerMethods {
|
|
16
|
-
networkStakeViewer?: NetworkStakeViewer
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { ChainId } from '../model/index.ts'
|
|
5
|
-
|
|
6
|
-
/** @deprecated - use XyoClient instead */
|
|
7
|
-
export interface XyoWallet {
|
|
8
|
-
accounts(): Promisable<Address[]>
|
|
9
|
-
addChain(chain: ChainId, name?: string): Promisable<object>
|
|
10
|
-
chain(): Promisable<ChainId>
|
|
11
|
-
chains(): Promisable<object>
|
|
12
|
-
permissions(): Promisable<Record<string, object>>
|
|
13
|
-
requestPermissions(permissions: object): Promisable<object>
|
|
14
|
-
revokePermissions(permissions: object): Promisable<object>
|
|
15
|
-
switchChain(chain: ChainId): Promisable<void>
|
|
16
|
-
}
|
package/src/provider/index.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './permissions/index.ts'
|
|
2
|
-
export * from './TransactionSubmitter.ts'
|
|
3
|
-
export * from './XyoClient.ts'
|
|
4
|
-
export * from './XyoConnection.ts'
|
|
5
|
-
export * from './XyoDataLake.ts'
|
|
6
|
-
export * from './XyoGateway.ts'
|
|
7
|
-
export * from './XyoGatewayHelpers.ts'
|
|
8
|
-
export * from './XyoNetwork.ts'
|
|
9
|
-
export * from './XyoRunner.ts'
|
|
10
|
-
export * from './XyoSigner.ts'
|
|
11
|
-
export * from './XyoViewer.ts'
|
|
12
|
-
export * from './XyoWallet.ts'
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from '@xylabs/object'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Modeled after EIP-2255
|
|
5
|
-
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
6
|
-
*
|
|
7
|
-
* NOTE: In order to send multiple permission requests at once, do not send multiple parentCapability keys.
|
|
8
|
-
* Instead, send multiple PermissionRequest objects in the params array of the rpc call.
|
|
9
|
-
*/
|
|
10
|
-
export interface PermissionRequest {
|
|
11
|
-
[parentCapability: string]: {
|
|
12
|
-
[caveatName: string]: JsonValue
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Modeled after EIP-2255
|
|
18
|
-
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
19
|
-
*/
|
|
20
|
-
export interface RequestedPermission {
|
|
21
|
-
/** Optional timestamp for when the permission was granted */
|
|
22
|
-
date?: number
|
|
23
|
-
/** Permission identifier (i.e. RPC method, action, etc.) */
|
|
24
|
-
parentCapability: string
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type CaveatTypes = 'chain' | 'expiration' | 'filteredResponse' | 'rateLimit' | 'restrictReturnedAccounts'
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Modeled after EIP-2255
|
|
31
|
-
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
32
|
-
*/
|
|
33
|
-
export interface Caveats {
|
|
34
|
-
/** Type of caveat */
|
|
35
|
-
type: CaveatTypes
|
|
36
|
-
/** Value for the caveat (i.e. chain id, subset of accounts, expiration, max request per minute, etc.) */
|
|
37
|
-
value: JsonValue
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Modeled after EIP-2255
|
|
42
|
-
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
43
|
-
*/
|
|
44
|
-
export interface Permission {
|
|
45
|
-
/** Caveats for the permission, if applicable (i.e. allowed accounts, signing, etc.) */
|
|
46
|
-
caveats?: Caveats[]
|
|
47
|
-
/** Invoker for the given permission (URI, domain, webpage, address, etc.) */
|
|
48
|
-
invoker: string
|
|
49
|
-
/** Permission identifier (i.e. RPC method, action, etc.) */
|
|
50
|
-
parentCapability: string
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface InvokerPermission extends Permission {
|
|
54
|
-
/** Time at which the permission was granted */
|
|
55
|
-
date?: number
|
|
56
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
InvokerPermission, PermissionRequest, RequestedPermission,
|
|
3
|
-
} from './InvokerPermission.ts'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Handles Getting Permissions
|
|
7
|
-
*/
|
|
8
|
-
export interface PermissionsGetHandler {
|
|
9
|
-
/**
|
|
10
|
-
* Returns the permissions that are currently granted
|
|
11
|
-
*
|
|
12
|
-
* Per the spec - "The wallet_getPermissions method is used for getting an array of current permissions
|
|
13
|
-
* (empty by default). It takes no parameters and returns an array of Permission objects."
|
|
14
|
-
*
|
|
15
|
-
* See - https://eips.ethereum.org/EIPS/eip-2255#specification
|
|
16
|
-
*/
|
|
17
|
-
getPermissions(): Promise<InvokerPermission[]>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Handles Permission Requests
|
|
22
|
-
*/
|
|
23
|
-
export interface PermissionRequestsHandler {
|
|
24
|
-
// Given a permissions request, attempts to request the permissions from the user
|
|
25
|
-
requestPermissions(permissions: PermissionRequest[]): Promise<RequestedPermission[]>
|
|
26
|
-
// Given a permissions request, attempts to revoke the permissions from the user
|
|
27
|
-
revokePermissions(permissions: PermissionRequest): Promise<RequestedPermission[]>
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Interface for getting, requesting and revoking permissions
|
|
32
|
-
*
|
|
33
|
-
* See - https://eips.ethereum.org/EIPS/eip-2255
|
|
34
|
-
*/
|
|
35
|
-
export interface XyoPermissions extends PermissionsGetHandler, PermissionRequestsHandler {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// @deprecated - use XyoPermissions instead
|
|
40
|
-
export interface PermissionsProvider extends XyoPermissions {}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Address, Hash, Hex,
|
|
3
|
-
} from '@xylabs/hex'
|
|
4
|
-
import type { Promisable } from '@xylabs/promise'
|
|
5
|
-
|
|
6
|
-
import type { AttoXL1 } from '../xl1/index.ts'
|
|
7
|
-
import type { ServiceInterface } from './Service.ts'
|
|
8
|
-
|
|
9
|
-
export interface AccountBalanceProvider {
|
|
10
|
-
getBalanceValue: (address: Address) => bigint
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface AccountBalanceService extends AccountBalanceProvider, ServiceInterface {
|
|
14
|
-
getBalanceValues?: Record<Address, bigint>
|
|
15
|
-
|
|
16
|
-
getBalance(address: Address): Hex
|
|
17
|
-
getBalances(): Record<Address, Hex>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface AccountBalanceServiceV2 extends ServiceInterface {
|
|
21
|
-
balances(head: Hash, addresses: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>
|
|
22
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Address, Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { AttoXL1 } from '../xl1/index.ts'
|
|
5
|
-
import type { ServiceInterface } from './Service.ts'
|
|
6
|
-
|
|
7
|
-
export interface AccountTransfersProvider {
|
|
8
|
-
transfer(head: Hash, account: Address): Promisable<AttoXL1>
|
|
9
|
-
transfers(head: Hash, accounts: Address[]): Promisable<Partial<Record<Address, AttoXL1>>>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface AccountTransfersService extends AccountTransfersProvider, ServiceInterface {}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BlockBoundWitness, HydratedBlock } from '../block/index.ts'
|
|
2
|
-
import type { Addressable } from '../fields/index.ts'
|
|
3
|
-
import type { IterableRepository } from '../repository/index.ts'
|
|
4
|
-
import type { ServiceInterface } from './Service.ts'
|
|
5
|
-
|
|
6
|
-
export type NextBlockProducer = IterableRepository<BlockBoundWitness, HydratedBlock | undefined>
|
|
7
|
-
|
|
8
|
-
export interface BlockProducerService extends Addressable, NextBlockProducer, ServiceInterface {}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
|
|
3
|
-
import type { ServiceInterface } from './Service.ts'
|
|
4
|
-
|
|
5
|
-
export interface BlockRewardService extends ServiceInterface {
|
|
6
|
-
// The amount of xl1 to send to the producer from the block reward
|
|
7
|
-
getRewardForBlock(block: bigint): Promisable<bigint>
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/promise'
|
|
2
|
-
|
|
3
|
-
import type { BlockRewardService } from './BlockRewardService.ts'
|
|
4
|
-
|
|
5
|
-
export interface BlockRewardServiceV2 extends BlockRewardService {
|
|
6
|
-
// The amount of xl1 to send to the step pool from the block reward
|
|
7
|
-
getRewardForStepPool(block: bigint): Promisable<bigint>
|
|
8
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BaseChainService } from './BaseChainService.ts'
|
|
2
|
-
import type {
|
|
3
|
-
ChainContractViewer, ChainStaker, ChainStakeViewer,
|
|
4
|
-
} from './interfaces/index.ts'
|
|
5
|
-
|
|
6
|
-
export interface ChainService extends ChainContractViewer, ChainStakeViewer, ChainStaker, BaseChainService {}
|