@xyo-network/xl1-protocol 1.12.53 → 1.12.55
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 +16 -12
- package/dist/neutral/interfaces/view/NetworkStakeStepReward.d.ts.map +1 -1
- package/dist/neutral/provider/permissions/XyoPermissions.d.ts +3 -3
- package/dist/neutral/provider/permissions/XyoPermissions.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/interfaces/view/NetworkStakeStepReward.ts +23 -18
- package/src/provider/permissions/XyoPermissions.ts +3 -3
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex';
|
|
2
2
|
import type { Promisable } from '@xylabs/promise';
|
|
3
|
+
export interface StepContext {
|
|
4
|
+
block: number;
|
|
5
|
+
step: number;
|
|
6
|
+
}
|
|
3
7
|
export interface NetworkStakeStepAddressRewardViewInterface {
|
|
4
|
-
networkStakeClaimedRewards(address: Address): Promisable<bigint>;
|
|
5
|
-
networkStakeStepAddressReward(address: Address, step: number, block: number): Promisable<Record<Address, bigint>>;
|
|
6
8
|
networkStakeStepRewardAddressHistory(address: Address): Promisable<Record<Address, bigint>>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
networkStakeStepRewardAddressReward(context: StepContext, address: Address): Promisable<Record<Address, bigint>>;
|
|
10
|
+
networkStakeStepRewardAddressShare(context: StepContext, address: Address): Promisable<[/* address shares */ bigint, /* total shares */ bigint]>;
|
|
11
|
+
networkStakeStepRewardWeightForAddress(context: StepContext, address: Address): Promisable<bigint>;
|
|
10
12
|
}
|
|
11
13
|
export interface NetworkStakeStepPoolRewardViewInterface {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
networkStakeStepRewardPoolRewards(context: StepContext): Promisable<Record<Address, bigint>>;
|
|
15
|
+
networkStakeStepRewardPoolShares(context: StepContext): Promisable<Record<Address, bigint>>;
|
|
14
16
|
}
|
|
15
17
|
export interface NetworkStakeStepRewardPositionViewInterface {
|
|
16
|
-
networkStakeStepRewardPositionWeight(
|
|
17
|
-
networkStakeStepRewardPotentialPositionLoss(
|
|
18
|
+
networkStakeStepRewardPositionWeight(context: StepContext, position: number): Promisable<number>;
|
|
19
|
+
networkStakeStepRewardPotentialPositionLoss(context: StepContext, position: number): Promisable<bigint>;
|
|
18
20
|
}
|
|
19
21
|
export interface NetworkStakeStepRewardViewInterface extends NetworkStakeStepPoolRewardViewInterface, NetworkStakeStepAddressRewardViewInterface, NetworkStakeStepRewardPositionViewInterface {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
networkStakeStepRewardClaimedByAddress(address: Address): Promisable<bigint>;
|
|
23
|
+
networkStakeStepRewardForStep(context: StepContext): Promisable<bigint>;
|
|
24
|
+
networkStakeStepRewardRandomizer(context: StepContext): Promisable<bigint>;
|
|
25
|
+
networkStakeStepRewardStakerCount(context: StepContext): Promisable<number>;
|
|
26
|
+
networkStakeStepRewardUnclaimedByAddress(address: Address): Promisable<bigint>;
|
|
23
27
|
}
|
|
24
28
|
//# 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,
|
|
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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AAC,OAAO,EAAE,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAGvE,gCAAgC,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAG1E,iCAAiC,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAE3E,wCAAwC,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CAC/E"}
|
|
@@ -2,7 +2,7 @@ import type { InvokerPermission, PermissionRequest, RequestedPermission } from '
|
|
|
2
2
|
/**
|
|
3
3
|
* Handles Getting Permissions
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface PermissionsGetHandler {
|
|
6
6
|
/**
|
|
7
7
|
* Returns the permissions that are currently granted
|
|
8
8
|
*
|
|
@@ -16,7 +16,7 @@ export interface XyoPermissionsGetHandler {
|
|
|
16
16
|
/**
|
|
17
17
|
* Handles Permission Requests
|
|
18
18
|
*/
|
|
19
|
-
export interface
|
|
19
|
+
export interface PermissionRequestsHandler {
|
|
20
20
|
requestPermissions(permissions: PermissionRequest[]): Promise<RequestedPermission[]>;
|
|
21
21
|
revokePermissions(permissions: PermissionRequest): Promise<RequestedPermission[]>;
|
|
22
22
|
}
|
|
@@ -25,7 +25,7 @@ export interface XyoPermissionsRequestHandler {
|
|
|
25
25
|
*
|
|
26
26
|
* See - https://eips.ethereum.org/EIPS/eip-2255
|
|
27
27
|
*/
|
|
28
|
-
export interface XyoPermissions extends
|
|
28
|
+
export interface XyoPermissions extends PermissionsGetHandler, PermissionRequestsHandler {
|
|
29
29
|
}
|
|
30
30
|
export interface PermissionsProvider extends XyoPermissions {
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoPermissions.d.ts","sourceRoot":"","sources":["../../../../src/provider/permissions/XyoPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAC1D,MAAM,wBAAwB,CAAA;AAE/B;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"XyoPermissions.d.ts","sourceRoot":"","sources":["../../../../src/provider/permissions/XyoPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAC1D,MAAM,wBAAwB,CAAA;AAE/B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,cAAc,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IAExC,kBAAkB,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAA;IAEpF,iBAAiB,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAA;CAClF;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,qBAAqB,EAAE,yBAAyB;CAEvF;AAGD,MAAM,WAAW,mBAAoB,SAAQ,cAAc;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-protocol",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.55",
|
|
5
5
|
"description": "XYO Layer One Protocol",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -49,23 +49,23 @@
|
|
|
49
49
|
"@xyo-network/boundwitness-model": "~5.1.3",
|
|
50
50
|
"@xyo-network/payload-model": "~5.1.3",
|
|
51
51
|
"@xyo-network/schema-payload-plugin": "~5.1.3",
|
|
52
|
-
"zod": "~4.1.
|
|
52
|
+
"zod": "~4.1.12"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "~24.
|
|
56
|
-
"@typescript-eslint/types": "~8.
|
|
55
|
+
"@types/node": "~24.7.0",
|
|
56
|
+
"@typescript-eslint/types": "~8.46.0",
|
|
57
57
|
"@xylabs/creatable": "~5.0.11",
|
|
58
58
|
"@xylabs/eslint-config-flat": "~7.1.8",
|
|
59
59
|
"@xylabs/ts-scripts-yarn3": "~7.1.8",
|
|
60
60
|
"@xylabs/tsconfig": "~7.1.8",
|
|
61
61
|
"@xyo-network/account-model": "~5.1.3",
|
|
62
|
-
"dependency-cruiser": "~17.0.
|
|
62
|
+
"dependency-cruiser": "~17.0.2",
|
|
63
63
|
"dotenv": "~17.2.3",
|
|
64
|
-
"eslint": "~9.
|
|
64
|
+
"eslint": "~9.37.0",
|
|
65
65
|
"eslint-import-resolver-typescript": "~4.4.4",
|
|
66
|
-
"knip": "~5.64.
|
|
66
|
+
"knip": "~5.64.2",
|
|
67
67
|
"typescript": "~5.9.3",
|
|
68
|
-
"vite": "~7.1.
|
|
68
|
+
"vite": "~7.1.9",
|
|
69
69
|
"vite-tsconfig-paths": "~5.1.4",
|
|
70
70
|
"vitest": "~3.2.4"
|
|
71
71
|
},
|
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import type { Address } from '@xylabs/hex'
|
|
2
2
|
import type { Promisable } from '@xylabs/promise'
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
networkStakeStepAddressReward(address: Address, step: number, block: number): Promisable<Record<Address, bigint>>
|
|
4
|
+
export interface StepContext {
|
|
5
|
+
block: number
|
|
6
|
+
step: number
|
|
7
|
+
}
|
|
9
8
|
|
|
9
|
+
export interface NetworkStakeStepAddressRewardViewInterface {
|
|
10
10
|
// the step rewards for a specific network stakers for all of history
|
|
11
11
|
networkStakeStepRewardAddressHistory(address: Address): Promisable<Record<Address, bigint>>
|
|
12
12
|
|
|
13
|
+
// the step rewards for a specific network stakers for a given step and block
|
|
14
|
+
networkStakeStepRewardAddressReward(context: StepContext, address: Address): Promisable<Record<Address, bigint>>
|
|
15
|
+
|
|
13
16
|
// the shares for a specific network staker for a given step and block
|
|
14
|
-
networkStakeStepRewardAddressShare(
|
|
17
|
+
networkStakeStepRewardAddressShare(context: StepContext, address: Address): Promisable<[/* address shares */bigint, /* total shares */bigint]>
|
|
15
18
|
|
|
16
19
|
// estimate the current reward weight for a given address at a given step
|
|
17
|
-
networkStakeStepRewardWeightForAddress(
|
|
18
|
-
|
|
19
|
-
networkStakeUnclaimedRewards(address: Address): Promisable<bigint>
|
|
20
|
+
networkStakeStepRewardWeightForAddress(context: StepContext, address: Address): Promisable<bigint>
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface NetworkStakeStepPoolRewardViewInterface {
|
|
23
24
|
|
|
24
|
-
// all the shares for all the network stakers for a given step and block
|
|
25
|
-
networkStakeStepPoolRewardShares(step: number, block: number): Promisable<Record<Address, bigint>>
|
|
26
|
-
|
|
27
25
|
// all the step rewards for all the network stakers for a given step and block
|
|
28
|
-
|
|
26
|
+
networkStakeStepRewardPoolRewards(context: StepContext): Promisable<Record<Address, bigint>>
|
|
27
|
+
|
|
28
|
+
// all the shares for all the network stakers for a given step and block
|
|
29
|
+
networkStakeStepRewardPoolShares(context: StepContext): Promisable<Record<Address, bigint>>
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export interface NetworkStakeStepRewardPositionViewInterface {
|
|
32
33
|
// estimate the current weight for a given position at a given step
|
|
33
|
-
networkStakeStepRewardPositionWeight(
|
|
34
|
+
networkStakeStepRewardPositionWeight(context: StepContext, position: number): Promisable<number>
|
|
34
35
|
|
|
35
36
|
// estimate the potential loss for removing a given position at a given step
|
|
36
|
-
networkStakeStepRewardPotentialPositionLoss(
|
|
37
|
+
networkStakeStepRewardPotentialPositionLoss(context: StepContext, position: number): Promisable<bigint>
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export interface NetworkStakeStepRewardViewInterface extends
|
|
@@ -41,12 +42,16 @@ export interface NetworkStakeStepRewardViewInterface extends
|
|
|
41
42
|
NetworkStakeStepAddressRewardViewInterface,
|
|
42
43
|
NetworkStakeStepRewardPositionViewInterface
|
|
43
44
|
{
|
|
45
|
+
networkStakeStepRewardClaimedByAddress(address: Address): Promisable<bigint>
|
|
46
|
+
|
|
44
47
|
// estimate the total possible block rewards for a given step
|
|
45
|
-
networkStakeStepRewardForStep(
|
|
48
|
+
networkStakeStepRewardForStep(context: StepContext): Promisable<bigint>
|
|
46
49
|
|
|
47
50
|
// the predictable random number for a given step and block
|
|
48
|
-
networkStakeStepRewardRandomizer(
|
|
51
|
+
networkStakeStepRewardRandomizer(context: StepContext): Promisable<bigint>
|
|
49
52
|
|
|
50
53
|
// the total number of stakers for a given step and block
|
|
51
|
-
networkStakeStepRewardStakerCount(
|
|
54
|
+
networkStakeStepRewardStakerCount(context: StepContext): Promisable<number>
|
|
55
|
+
|
|
56
|
+
networkStakeStepRewardUnclaimedByAddress(address: Address): Promisable<bigint>
|
|
52
57
|
}
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
/**
|
|
6
6
|
* Handles Getting Permissions
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface PermissionsGetHandler {
|
|
9
9
|
/**
|
|
10
10
|
* Returns the permissions that are currently granted
|
|
11
11
|
*
|
|
@@ -20,7 +20,7 @@ export interface XyoPermissionsGetHandler {
|
|
|
20
20
|
/**
|
|
21
21
|
* Handles Permission Requests
|
|
22
22
|
*/
|
|
23
|
-
export interface
|
|
23
|
+
export interface PermissionRequestsHandler {
|
|
24
24
|
// Given a permissions request, attempts to request the permissions from the user
|
|
25
25
|
requestPermissions(permissions: PermissionRequest[]): Promise<RequestedPermission[]>
|
|
26
26
|
// Given a permissions request, attempts to revoke the permissions from the user
|
|
@@ -32,7 +32,7 @@ export interface XyoPermissionsRequestHandler {
|
|
|
32
32
|
*
|
|
33
33
|
* See - https://eips.ethereum.org/EIPS/eip-2255
|
|
34
34
|
*/
|
|
35
|
-
export interface XyoPermissions extends
|
|
35
|
+
export interface XyoPermissions extends PermissionsGetHandler, PermissionRequestsHandler {
|
|
36
36
|
|
|
37
37
|
}
|
|
38
38
|
|