@xyo-network/xl1-protocol 1.12.27 → 1.12.29
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/view/NetworkStakeStepReward.d.ts +7 -1
- package/dist/neutral/interfaces/view/NetworkStakeStepReward.d.ts.map +1 -1
- package/dist/neutral/services/NetworkStakeService.d.ts +2 -5
- package/dist/neutral/services/NetworkStakeService.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/interfaces/view/NetworkStakeStepReward.ts +19 -1
- package/src/services/NetworkStakeService.ts +2 -7
|
@@ -5,13 +5,19 @@ export interface NetworkStakeStepAddressRewardViewInterface {
|
|
|
5
5
|
networkStakeStepAddressReward(address: Address, step: number, block: number): Promisable<Record<Address, bigint>>;
|
|
6
6
|
networkStakeStepRewardAddressHistory(address: Address): Promisable<Record<Address, bigint>>;
|
|
7
7
|
networkStakeStepRewardAddressShare(address: Address, step: number, block: number): Promisable<[/* address shares */ bigint, /* total shares */ bigint]>;
|
|
8
|
+
networkStakeStepRewardWeightForAddress?(address: Address, step: number): Promisable<bigint>;
|
|
8
9
|
unclaimedRewards(address: Address): Promisable<bigint>;
|
|
9
10
|
}
|
|
10
11
|
export interface NetworkStakeStepPoolRewardViewInterface {
|
|
11
12
|
networkStakeStepPoolRewardShares(step: number, block: number): Promisable<Record<Address, bigint>>;
|
|
12
13
|
networkStakeStepPoolRewards(step: number, block: number): Promisable<Record<Address, bigint>>;
|
|
13
14
|
}
|
|
14
|
-
export interface
|
|
15
|
+
export interface NetworkStakeStepRewardPositionViewInterface {
|
|
16
|
+
networkStakeStepRewardPositionWeight?(position: bigint, step: number): Promisable<number>;
|
|
17
|
+
networkStakeStepRewardPotentialPositionLoss?(position: bigint, step: number): Promisable<bigint>;
|
|
18
|
+
}
|
|
19
|
+
export interface NetworkStakeStepRewardViewInterface extends NetworkStakeStepPoolRewardViewInterface, NetworkStakeStepAddressRewardViewInterface, NetworkStakeStepRewardPositionViewInterface {
|
|
20
|
+
networkStakeStepRewardForStep?(step: number): Promisable<bigint>;
|
|
15
21
|
networkStakeStepRewardRandomizer(step: number, block: number): Promisable<bigint>;
|
|
16
22
|
}
|
|
17
23
|
//# sourceMappingURL=NetworkStakeStepReward.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkStakeStepReward.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/view/NetworkStakeStepReward.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,0CAA0C;IACzD,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAGpD,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;IAGjH,oCAAoC,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;IAG3F,kCAAkC,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,oBAAoB,CAAA,MAAM,EAAE,kBAAkB,CAAA,MAAM,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"NetworkStakeStepReward.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/view/NetworkStakeStepReward.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,0CAA0C;IACzD,cAAc,CAAC,OAAO,EAAE,O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nD,uCAAuC,EACvC,0CAA0C,EAC1C,2CAA2C;IAG3C,6BAA6B,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAGhE,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CAClF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Promisable } from '@xylabs/promise';
|
|
3
|
-
import type { CompletedStep } from '../model.ts';
|
|
1
|
+
import type { NetworkStakeStepRewardViewInterface } from '../interfaces/index.ts';
|
|
4
2
|
import type { ServiceInterface } from './Service.ts';
|
|
5
|
-
export interface
|
|
6
|
-
stepStakeForAddress: (address: Address, step: CompletedStep) => Promisable<bigint>;
|
|
3
|
+
export interface NetworkStakeStepRewardService extends NetworkStakeStepRewardViewInterface, ServiceInterface {
|
|
7
4
|
}
|
|
8
5
|
//# sourceMappingURL=NetworkStakeService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkStakeService.d.ts","sourceRoot":"","sources":["../../../src/services/NetworkStakeService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NetworkStakeService.d.ts","sourceRoot":"","sources":["../../../src/services/NetworkStakeService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAA;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,WAAW,6BAA8B,SAAQ,mCAAmC,EAAE,gBAAgB;CAAG"}
|
package/package.json
CHANGED
|
@@ -13,6 +13,9 @@ export interface NetworkStakeStepAddressRewardViewInterface {
|
|
|
13
13
|
// the shares for a specific network staker for a given step and block
|
|
14
14
|
networkStakeStepRewardAddressShare(address: Address, step: number, block: number): Promisable<[/* address shares */bigint, /* total shares */bigint]>
|
|
15
15
|
|
|
16
|
+
// estimate the current reward weight for a given address at a given step
|
|
17
|
+
networkStakeStepRewardWeightForAddress?(address: Address, step: number): Promisable<bigint>
|
|
18
|
+
|
|
16
19
|
unclaimedRewards(address: Address): Promisable<bigint>
|
|
17
20
|
}
|
|
18
21
|
|
|
@@ -25,7 +28,22 @@ export interface NetworkStakeStepPoolRewardViewInterface {
|
|
|
25
28
|
networkStakeStepPoolRewards(step: number, block: number): Promisable<Record<Address, bigint>>
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
export interface
|
|
31
|
+
export interface NetworkStakeStepRewardPositionViewInterface {
|
|
32
|
+
// estimate the current weight for a given position at a given step
|
|
33
|
+
networkStakeStepRewardPositionWeight?(position: bigint, step: number): Promisable<number>
|
|
34
|
+
|
|
35
|
+
// estimate the potential loss for removing a given position at a given step
|
|
36
|
+
networkStakeStepRewardPotentialPositionLoss?(position: bigint, step: number): Promisable<bigint>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface NetworkStakeStepRewardViewInterface extends
|
|
40
|
+
NetworkStakeStepPoolRewardViewInterface,
|
|
41
|
+
NetworkStakeStepAddressRewardViewInterface,
|
|
42
|
+
NetworkStakeStepRewardPositionViewInterface
|
|
43
|
+
{
|
|
44
|
+
// estimate the total possible block rewards for a given step
|
|
45
|
+
networkStakeStepRewardForStep?(step: number): Promisable<bigint>
|
|
46
|
+
|
|
29
47
|
// the predictable random number for a given step and block
|
|
30
48
|
networkStakeStepRewardRandomizer(step: number, block: number): Promisable<bigint>
|
|
31
49
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Promisable } from '@xylabs/promise'
|
|
3
|
-
|
|
4
|
-
import type { CompletedStep } from '../model.ts'
|
|
1
|
+
import type { NetworkStakeStepRewardViewInterface } from '../interfaces/index.ts'
|
|
5
2
|
import type { ServiceInterface } from './Service.ts'
|
|
6
3
|
|
|
7
|
-
export interface
|
|
8
|
-
stepStakeForAddress: (address: Address, step: CompletedStep) => Promisable<bigint>
|
|
9
|
-
}
|
|
4
|
+
export interface NetworkStakeStepRewardService extends NetworkStakeStepRewardViewInterface, ServiceInterface {}
|