@xyo-network/xl1-protocol 1.12.85 → 1.12.87
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/interfaces/viewers/NetworkStakeViewer.d.ts +51 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/index.d.ts +1 -1
- package/dist/neutral/interfaces/viewers/index.d.ts.map +1 -1
- package/dist/neutral/provider/XyoConnection.d.ts +2 -0
- package/dist/neutral/provider/XyoConnection.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/interfaces/viewers/NetworkStakeViewer.ts +70 -0
- package/src/interfaces/viewers/index.ts +1 -1
- package/src/provider/XyoConnection.ts +2 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeStepRewardsViewer.d.ts +0 -35
- package/dist/neutral/interfaces/viewers/NetworkStakeStepRewardsViewer.d.ts.map +0 -1
- package/src/interfaces/viewers/NetworkStakeStepRewardsViewer.ts +0 -70
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex';
|
|
2
|
+
import type { Promisable } from '@xylabs/promise';
|
|
3
|
+
import type { BlockRange, RewardShare, StepIdentity, StepIdentityString } from '../../model/index.ts';
|
|
4
|
+
import type { AttoXL1 } from '../../xl1/index.ts';
|
|
5
|
+
export type RecordKeyType<T = keyof any> = T extends keyof any ? T : never;
|
|
6
|
+
export interface RewardsViewerTemplate<TOptions, TResult> {
|
|
7
|
+
bonus(options?: TOptions): Promisable<TResult>;
|
|
8
|
+
claimed(options?: TOptions): Promisable<TResult>;
|
|
9
|
+
earned(options?: TOptions): Promisable<TResult>;
|
|
10
|
+
total(options?: TOptions): Promisable<TResult>;
|
|
11
|
+
unclaimed(options?: TOptions): Promisable<TResult>;
|
|
12
|
+
}
|
|
13
|
+
export interface RewardsByIndexViewer<TOptions, TResultIndex extends RecordKeyType> extends RewardsViewerTemplate<TOptions, Record<TResultIndex, AttoXL1>> {
|
|
14
|
+
}
|
|
15
|
+
export interface RewardsRangeOptions {
|
|
16
|
+
range?: BlockRange;
|
|
17
|
+
}
|
|
18
|
+
export interface RewardsByStepViewerOptions extends RewardsRangeOptions {
|
|
19
|
+
steps?: StepIdentity[];
|
|
20
|
+
}
|
|
21
|
+
export interface RewardsByStakerViewerOptions extends RewardsRangeOptions {
|
|
22
|
+
stakers?: Address[];
|
|
23
|
+
}
|
|
24
|
+
export interface RewardsByPositionViewerOptions extends RewardsRangeOptions {
|
|
25
|
+
positions?: number[];
|
|
26
|
+
}
|
|
27
|
+
export interface RewardsByStepViewer extends RewardsByIndexViewer<RewardsByStepViewerOptions, StepIdentityString> {
|
|
28
|
+
}
|
|
29
|
+
export interface RewardsByStakerViewer extends RewardsByIndexViewer<RewardsByStakerViewerOptions, Address> {
|
|
30
|
+
}
|
|
31
|
+
export interface RewardsByPositionViewer extends RewardsByIndexViewer<RewardsByPositionViewerOptions, number> {
|
|
32
|
+
}
|
|
33
|
+
export interface RewardsTotalViewer extends RewardsViewerTemplate<RewardsRangeOptions, AttoXL1> {
|
|
34
|
+
}
|
|
35
|
+
export interface StepViewer {
|
|
36
|
+
randomizer(step: StepIdentity): Promisable<bigint>;
|
|
37
|
+
rewards(step: StepIdentity): Promisable<Record<Address, RewardShare>>;
|
|
38
|
+
stake(step: StepIdentity): Promisable<bigint>;
|
|
39
|
+
stakers(step: StepIdentity): Promisable<Address[]>;
|
|
40
|
+
weight(step: StepIdentity): Promisable<bigint>;
|
|
41
|
+
}
|
|
42
|
+
export interface StepRewardsViewer {
|
|
43
|
+
position(): Promisable<RewardsByPositionViewer>;
|
|
44
|
+
staker(): Promisable<RewardsByStakerViewer>;
|
|
45
|
+
step(): Promisable<RewardsByStepViewer>;
|
|
46
|
+
total(): Promisable<RewardsTotalViewer>;
|
|
47
|
+
}
|
|
48
|
+
export interface NetworkStakeViewer {
|
|
49
|
+
stepRewards(): Promisable<StepRewardsViewer>;
|
|
50
|
+
}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AI,UAAU,CAAC,kBAAkB,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,IAAI,UAAU,CAAC,iBAAiB,CAAC,CAAA;CAC7C"}
|
|
@@ -4,7 +4,7 @@ export * from './Chain.ts';
|
|
|
4
4
|
export * from './ChainContract.ts';
|
|
5
5
|
export * from './Fork.ts';
|
|
6
6
|
export * from './NetworkStakeStepReward.ts';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './NetworkStakeViewer.ts';
|
|
8
8
|
export * from './Stake.ts';
|
|
9
9
|
export * from './StakeTotalsViewer.ts';
|
|
10
10
|
export * from './StakeViewer.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/viewers/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/viewers/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA"}
|
|
@@ -2,6 +2,7 @@ import type { Address, Hex } from '@xylabs/hex';
|
|
|
2
2
|
import type { Signed } from '@xyo-network/boundwitness-model';
|
|
3
3
|
import type { Payload } from '@xyo-network/payload-model';
|
|
4
4
|
import type { AllowedBlockPayload } from '../block/index.ts';
|
|
5
|
+
import type { NetworkStakeViewer } from '../interfaces/index.ts';
|
|
5
6
|
import type { TransactionBoundWitness, TransactionFeesBigInt } from '../transaction/index.ts';
|
|
6
7
|
import type { TransactionSubmitter } from './TransactionSubmitter.ts';
|
|
7
8
|
import type { XyoDataLake, XyoDataLakeViewer } from './XyoDataLake.ts';
|
|
@@ -21,6 +22,7 @@ export interface XyoConnectionProviderDeprecated extends TransactionSubmitter {
|
|
|
21
22
|
}
|
|
22
23
|
export interface XyoConnection extends Partial<XyoConnectionProviderDeprecated> {
|
|
23
24
|
network?: XyoNetwork;
|
|
25
|
+
networkStake?: NetworkStakeViewer;
|
|
24
26
|
runner?: XyoRunner;
|
|
25
27
|
storage?: XyoDataLake | XyoDataLakeViewer;
|
|
26
28
|
viewer?: XyoViewer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoConnection.d.ts","sourceRoot":"","sources":["../../../src/provider/XyoConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,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BAAkB,CAAA;IACjC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAAA;IACzC,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,4CAA4C;AAC5C,MAAM,WAAW,qBAAsB,SAAQ,aAAa;CAAG;AAE/D,4CAA4C;AAC5C,MAAM,WAAW,WAAY,SAAQ,aAAa;CAAG"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Promisable } from '@xylabs/promise'
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
BlockRange, RewardShare, StepIdentity, StepIdentityString,
|
|
6
|
+
} from '../../model/index.ts'
|
|
7
|
+
import type { AttoXL1 } from '../../xl1/index.ts'
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
export type RecordKeyType<T = keyof any> = T extends keyof any ? T : never
|
|
11
|
+
|
|
12
|
+
export interface RewardsViewerTemplate<TOptions, TResult> {
|
|
13
|
+
bonus(options?: TOptions): Promisable<TResult>
|
|
14
|
+
claimed(options?: TOptions): Promisable<TResult>
|
|
15
|
+
earned(options?: TOptions): Promisable<TResult>
|
|
16
|
+
total(options?: TOptions): Promisable<TResult>
|
|
17
|
+
unclaimed(options?: TOptions): Promisable<TResult>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface RewardsByIndexViewer<TOptions, TResultIndex extends RecordKeyType> extends RewardsViewerTemplate<TOptions, Record<TResultIndex, AttoXL1>> {}
|
|
21
|
+
|
|
22
|
+
export interface RewardsRangeOptions {
|
|
23
|
+
range?: BlockRange
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface RewardsByStepViewerOptions extends RewardsRangeOptions {
|
|
27
|
+
steps?: StepIdentity[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RewardsByStakerViewerOptions extends RewardsRangeOptions {
|
|
31
|
+
stakers?: Address[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RewardsByPositionViewerOptions extends RewardsRangeOptions {
|
|
35
|
+
positions?: number[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface RewardsByStepViewer extends RewardsByIndexViewer<RewardsByStepViewerOptions, StepIdentityString> {}
|
|
39
|
+
export interface RewardsByStakerViewer extends RewardsByIndexViewer<RewardsByStakerViewerOptions, Address> {}
|
|
40
|
+
export interface RewardsByPositionViewer extends RewardsByIndexViewer<RewardsByPositionViewerOptions, number> {}
|
|
41
|
+
export interface RewardsTotalViewer extends RewardsViewerTemplate<RewardsRangeOptions, AttoXL1> {}
|
|
42
|
+
|
|
43
|
+
export interface StepViewer {
|
|
44
|
+
|
|
45
|
+
// the predictable random number for a given step and block
|
|
46
|
+
randomizer(step: StepIdentity): Promisable<bigint>
|
|
47
|
+
|
|
48
|
+
// all the step rewards for all the network stakers for a given step
|
|
49
|
+
rewards(step: StepIdentity): Promisable<Record<Address, RewardShare>>
|
|
50
|
+
|
|
51
|
+
// total amount staked during a given step
|
|
52
|
+
stake(step: StepIdentity): Promisable<bigint>
|
|
53
|
+
|
|
54
|
+
// the total number of stakers for a given step and block
|
|
55
|
+
stakers(step: StepIdentity): Promisable<Address[]>
|
|
56
|
+
|
|
57
|
+
// total weight of all stakers during a given step
|
|
58
|
+
weight(step: StepIdentity): Promisable<bigint>
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface StepRewardsViewer {
|
|
62
|
+
position(): Promisable<RewardsByPositionViewer>
|
|
63
|
+
staker(): Promisable<RewardsByStakerViewer>
|
|
64
|
+
step(): Promisable<RewardsByStepViewer>
|
|
65
|
+
total(): Promisable<RewardsTotalViewer>
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface NetworkStakeViewer {
|
|
69
|
+
stepRewards(): Promisable<StepRewardsViewer>
|
|
70
|
+
}
|
|
@@ -4,7 +4,7 @@ export * from './Chain.ts'
|
|
|
4
4
|
export * from './ChainContract.ts'
|
|
5
5
|
export * from './Fork.ts'
|
|
6
6
|
export * from './NetworkStakeStepReward.ts'
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './NetworkStakeViewer.ts'
|
|
8
8
|
export * from './Stake.ts'
|
|
9
9
|
export * from './StakeTotalsViewer.ts'
|
|
10
10
|
export * from './StakeViewer.ts'
|
|
@@ -3,6 +3,7 @@ import type { Signed } from '@xyo-network/boundwitness-model'
|
|
|
3
3
|
import type { Payload } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
import type { AllowedBlockPayload } from '../block/index.ts'
|
|
6
|
+
import type { NetworkStakeViewer } from '../interfaces/index.ts'
|
|
6
7
|
import type { TransactionBoundWitness, TransactionFeesBigInt } from '../transaction/index.ts'
|
|
7
8
|
// eslint-disable-next-line sonarjs/deprecation
|
|
8
9
|
import type { TransactionSubmitter } from './TransactionSubmitter.ts'
|
|
@@ -40,6 +41,7 @@ export interface XyoConnectionProviderDeprecated extends TransactionSubmitter {
|
|
|
40
41
|
// eslint-disable-next-line sonarjs/deprecation
|
|
41
42
|
export interface XyoConnection extends Partial<XyoConnectionProviderDeprecated> {
|
|
42
43
|
network?: XyoNetwork
|
|
44
|
+
networkStake?: NetworkStakeViewer
|
|
43
45
|
runner?: XyoRunner
|
|
44
46
|
storage?: XyoDataLake | XyoDataLakeViewer
|
|
45
47
|
viewer?: XyoViewer
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex';
|
|
2
|
-
import type { Promisable } from '@xylabs/promise';
|
|
3
|
-
import type { BlockRange, RewardShare, StepIdentity, StepIdentityString } from '../../model/index.ts';
|
|
4
|
-
export interface NetworkStakeStepRewardsStakerViewer {
|
|
5
|
-
claimed(staker: Address, range?: BlockRange): Promisable<bigint>;
|
|
6
|
-
reward(staker: Address, step: StepIdentity): Promisable<RewardShare>;
|
|
7
|
-
rewards(staker: Address, range?: BlockRange): Promisable<Record<StepIdentityString, RewardShare>>;
|
|
8
|
-
unclaimed(staker: Address, range?: BlockRange): Promisable<bigint>;
|
|
9
|
-
}
|
|
10
|
-
export interface NetworkStakeStepRewardsStepViewer {
|
|
11
|
-
randomizer(step: StepIdentity): Promisable<bigint>;
|
|
12
|
-
rewards(step: StepIdentity): Promisable<Record<Address, RewardShare>>;
|
|
13
|
-
stake(step: StepIdentity): Promisable<bigint>;
|
|
14
|
-
stakers(step: StepIdentity): Promisable<Address[]>;
|
|
15
|
-
weight(step: StepIdentity): Promisable<bigint>;
|
|
16
|
-
}
|
|
17
|
-
export interface NetworkStakeStepRewardsPositionViewer {
|
|
18
|
-
claimed(position: number, range?: BlockRange): Promisable<bigint>;
|
|
19
|
-
potentialLoss(position: number, step: StepIdentity): Promisable<bigint>;
|
|
20
|
-
reward(position: number, step: StepIdentity): Promisable<RewardShare>;
|
|
21
|
-
unclaimed(position: number, range?: BlockRange): Promisable<bigint>;
|
|
22
|
-
}
|
|
23
|
-
export interface NetworkStakeStepRewardsTotalViewer {
|
|
24
|
-
available(range?: BlockRange): Promisable<bigint>;
|
|
25
|
-
claimed(range?: BlockRange): Promisable<bigint>;
|
|
26
|
-
unclaimed(range?: BlockRange): Promisable<bigint>;
|
|
27
|
-
unclaimedByStaker(address: Address, range?: BlockRange): Promisable<bigint>;
|
|
28
|
-
}
|
|
29
|
-
export interface NetworkStakeStepRewardsViewer extends NetworkStakeStepRewardsPositionViewer {
|
|
30
|
-
position(): Promisable<NetworkStakeStepRewardsPositionViewer>;
|
|
31
|
-
staker(): Promisable<NetworkStakeStepRewardsStakerViewer>;
|
|
32
|
-
step(): Promisable<NetworkStakeStepRewardsStepViewer>;
|
|
33
|
-
total(): Promisable<NetworkStakeStepRewardsTotalViewer>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=NetworkStakeStepRewardsViewer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkStakeStepReward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,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAGjE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAGvE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAGrE,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CACpE;AAED,MAAM,WAAW,kCAAkC;IAEjD,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IACjD,OAAO,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAC/C,SAAS,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IACjD,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CAC5E;AAED,MAAM,WAAW,6BAA8B,SAC7C,qCAAqC;IAErC,QAAQ,IAAI,UAAU,CAAC,qCAAqC,CAAC,CAAA;IAC7D,MAAM,IAAI,UAAU,CAAC,mCAAmC,CAAC,CAAA;IACzD,IAAI,IAAI,UAAU,CAAC,iCAAiC,CAAC,CAAA;IACrD,KAAK,IAAI,UAAU,CAAC,kCAAkC,CAAC,CAAA;CACxD"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
BlockRange, RewardShare, StepIdentity, StepIdentityString,
|
|
6
|
-
} from '../../model/index.ts'
|
|
7
|
-
|
|
8
|
-
export interface NetworkStakeStepRewardsStakerViewer {
|
|
9
|
-
// total amount claimed by a given staker for a given range
|
|
10
|
-
claimed(staker: Address, range?: BlockRange): Promisable<bigint>
|
|
11
|
-
|
|
12
|
-
// the step rewards for a specific network stakers for all of history
|
|
13
|
-
reward(staker: Address, step: StepIdentity): Promisable<RewardShare>
|
|
14
|
-
|
|
15
|
-
// the step rewards for a specific network stakers for all of history
|
|
16
|
-
rewards(staker: Address, range?: BlockRange): Promisable<Record<StepIdentityString, RewardShare>>
|
|
17
|
-
|
|
18
|
-
// total amount unclaimed by a given staker for a given range
|
|
19
|
-
unclaimed(staker: Address, range?: BlockRange): Promisable<bigint>
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface NetworkStakeStepRewardsStepViewer {
|
|
23
|
-
|
|
24
|
-
// the predictable random number for a given step and block
|
|
25
|
-
randomizer(step: StepIdentity): Promisable<bigint>
|
|
26
|
-
|
|
27
|
-
// all the step rewards for all the network stakers for a given step
|
|
28
|
-
rewards(step: StepIdentity): Promisable<Record<Address, RewardShare>>
|
|
29
|
-
|
|
30
|
-
// total amount staked during a given step
|
|
31
|
-
stake(step: StepIdentity): Promisable<bigint>
|
|
32
|
-
|
|
33
|
-
// the total number of stakers for a given step and block
|
|
34
|
-
stakers(step: StepIdentity): Promisable<Address[]>
|
|
35
|
-
|
|
36
|
-
// total weight of all stakers during a given step
|
|
37
|
-
weight(step: StepIdentity): Promisable<bigint>
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface NetworkStakeStepRewardsPositionViewer {
|
|
41
|
-
|
|
42
|
-
// total amount claimed by a given position for a given range
|
|
43
|
-
claimed(position: number, range?: BlockRange): Promisable<bigint>
|
|
44
|
-
|
|
45
|
-
// estimate the potential loss for removing a given position at a given step
|
|
46
|
-
potentialLoss(position: number, step: StepIdentity): Promisable<bigint>
|
|
47
|
-
|
|
48
|
-
// estimate the current reward for a given position at a given step
|
|
49
|
-
reward(position: number, step: StepIdentity): Promisable<RewardShare>
|
|
50
|
-
|
|
51
|
-
// total amount unclaimed by a given position for a given range
|
|
52
|
-
unclaimed(position: number, range?: BlockRange): Promisable<bigint>
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface NetworkStakeStepRewardsTotalViewer {
|
|
56
|
-
// the available tokens in the overall reward pool
|
|
57
|
-
available(range?: BlockRange): Promisable<bigint>
|
|
58
|
-
claimed(range?: BlockRange): Promisable<bigint>
|
|
59
|
-
unclaimed(range?: BlockRange): Promisable<bigint>
|
|
60
|
-
unclaimedByStaker(address: Address, range?: BlockRange): Promisable<bigint>
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface NetworkStakeStepRewardsViewer extends
|
|
64
|
-
NetworkStakeStepRewardsPositionViewer
|
|
65
|
-
{
|
|
66
|
-
position(): Promisable<NetworkStakeStepRewardsPositionViewer>
|
|
67
|
-
staker(): Promisable<NetworkStakeStepRewardsStakerViewer>
|
|
68
|
-
step(): Promisable<NetworkStakeStepRewardsStepViewer>
|
|
69
|
-
total(): Promisable<NetworkStakeStepRewardsTotalViewer>
|
|
70
|
-
}
|