@xyo-network/xl1-protocol 1.12.92 → 1.12.94
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/NetworkStakeViewer.d.ts +9 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/NetworkStakeViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RecordKeyType.d.ts +2 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RecordKeyType.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.d.ts +6 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.d.ts +7 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.d.ts +8 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.d.ts +8 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.d.ts +8 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.d.ts +9 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.d.ts +15 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.d.ts +14 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepViewer.d.ts +13 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/StepViewer.d.ts.map +1 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/index.d.ts +12 -0
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer/index.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/package.json +1 -1
- package/src/interfaces/viewers/NetworkStakeViewer/NetworkStakeViewer.ts +11 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RecordKeyType.ts +2 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.ts +6 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.ts +7 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.ts +9 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.ts +8 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.ts +8 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.ts +9 -0
- package/src/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.ts +19 -0
- package/src/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.ts +15 -0
- package/src/interfaces/viewers/NetworkStakeViewer/StepViewer.ts +24 -0
- package/src/interfaces/viewers/NetworkStakeViewer/index.ts +13 -0
- package/src/interfaces/viewers/index.ts +1 -1
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer.d.ts +0 -54
- package/dist/neutral/interfaces/viewers/NetworkStakeViewer.d.ts.map +0 -1
- package/src/interfaces/viewers/NetworkStakeViewer.ts +0 -74
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise';
|
|
2
|
+
import type { StepRewardsViewer } from './StepRewardsViewer.ts';
|
|
3
|
+
export interface NetworkStakeViewerMethods {
|
|
4
|
+
stake(blockNumber?: number): Promisable<bigint>;
|
|
5
|
+
}
|
|
6
|
+
export interface NetworkStakeViewer extends NetworkStakeViewerMethods {
|
|
7
|
+
stepRewards(): Promisable<StepRewardsViewer>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=NetworkStakeViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkStakeViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/NetworkStakeViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CAChD;AAED,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,WAAW,IAAI,UAAU,CAAC,iBAAiB,CAAC,CAAA;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordKeyType.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RecordKeyType.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS,MAAM,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA"}
|
package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AttoXL1 } from '../../../xl1/index.ts';
|
|
2
|
+
import type { RecordKeyType } from './RecordKeyType.ts';
|
|
3
|
+
import type { RewardsViewerMethodsTemplate } from './RewardsViewerMethodsTemplate.ts';
|
|
4
|
+
export interface RewardsByIndexViewerMethodsTemplate<TOptions, TResultIndex extends RecordKeyType> extends RewardsViewerMethodsTemplate<TOptions, Record<TResultIndex, AttoXL1>> {
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=RewardsByIndexViewerMethodsTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsByIndexViewerMethodsTemplate.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsByIndexViewerMethodsTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAErF,MAAM,WAAW,mCAAmC,CAAC,QAAQ,EAAE,YAAY,SAAS,aAAa,CAC/F,SAAQ,4BAA4B,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RewardsByIndexViewerMethodsTemplate } from './RewardsByIndexViewerMethodsTemplate.ts';
|
|
2
|
+
import type { RewardsByPositionViewerOptions } from './RewardsViewerOptions.ts';
|
|
3
|
+
export interface RewardsByPositionViewerMethods extends RewardsByIndexViewerMethodsTemplate<RewardsByPositionViewerOptions, number> {
|
|
4
|
+
}
|
|
5
|
+
export interface RewardsByPositionViewer extends RewardsByPositionViewerMethods {
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=RewardsByPositionViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsByPositionViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsByPositionViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAA;AACnG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;AAI/E,MAAM,WAAW,8BAA+B,SAAQ,mCAAmC,CAAC,8BAA8B,EAAE,MAAM,CAAC;CAAG;AACtI,MAAM,WAAW,uBAAwB,SAAQ,8BAA8B;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex';
|
|
2
|
+
import type { RewardsByIndexViewerMethodsTemplate } from './RewardsByIndexViewerMethodsTemplate.ts';
|
|
3
|
+
import type { RewardsByStakerViewerOptions } from './RewardsViewerOptions.ts';
|
|
4
|
+
export interface RewardsByStakerViewerMethods extends RewardsByIndexViewerMethodsTemplate<RewardsByStakerViewerOptions, Address> {
|
|
5
|
+
}
|
|
6
|
+
export interface RewardsByStakerViewer extends RewardsByStakerViewerMethods {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=RewardsByStakerViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsByStakerViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsByStakerViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAA;AACnG,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAI7E,MAAM,WAAW,4BAA6B,SAAQ,mCAAmC,CAAC,4BAA4B,EAAE,OAAO,CAAC;CAAG;AACnI,MAAM,WAAW,qBAAsB,SAAQ,4BAA4B;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StepIdentityString } from '../../../model/index.ts';
|
|
2
|
+
import type { RewardsByIndexViewerMethodsTemplate } from './RewardsByIndexViewerMethodsTemplate.ts';
|
|
3
|
+
import type { RewardsByStepViewerOptions } from './RewardsViewerOptions.ts';
|
|
4
|
+
export interface RewardsByStepViewerMethods extends RewardsByIndexViewerMethodsTemplate<RewardsByStepViewerOptions, StepIdentityString> {
|
|
5
|
+
}
|
|
6
|
+
export interface RewardsByStepViewer extends RewardsByStepViewerMethods {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=RewardsByStepViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsByStepViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsByStepViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAA;AACnG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAI3E,MAAM,WAAW,0BAA2B,SAAQ,mCAAmC,CAAC,0BAA0B,EAAE,kBAAkB,CAAC;CAAG;AAC1I,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AttoXL1 } from '../../../xl1/index.ts';
|
|
2
|
+
import type { RewardsViewerMethodsTemplate } from './RewardsViewerMethodsTemplate.ts';
|
|
3
|
+
import type { RewardsRangeOptions } from './RewardsViewerOptions.ts';
|
|
4
|
+
export interface RewardsTotalViewerMethods extends RewardsViewerMethodsTemplate<RewardsRangeOptions, AttoXL1> {
|
|
5
|
+
}
|
|
6
|
+
export interface RewardsTotalViewer extends RewardsTotalViewerMethods {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=RewardsTotalViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsTotalViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsTotalViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAIpE,MAAM,WAAW,yBAA0B,SAAQ,4BAA4B,CAAC,mBAAmB,EAAE,OAAO,CAAC;CAAG;AAChH,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise';
|
|
2
|
+
export interface RewardsViewerMethodsTemplate<TOptions, TResult> {
|
|
3
|
+
bonus(options?: TOptions): Promisable<TResult>;
|
|
4
|
+
claimed(options?: TOptions): Promisable<TResult>;
|
|
5
|
+
earned(options?: TOptions): Promisable<TResult>;
|
|
6
|
+
total(options?: TOptions): Promisable<TResult>;
|
|
7
|
+
unclaimed(options?: TOptions): Promisable<TResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=RewardsViewerMethodsTemplate.d.ts.map
|
package/dist/neutral/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsViewerMethodsTemplate.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsViewerMethodsTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,4BAA4B,CAAC,QAAQ,EAAE,OAAO;IAC7D,KAAK,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAC9C,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAChD,MAAM,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAC/C,KAAK,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAC9C,SAAS,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;CACnD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex';
|
|
2
|
+
import type { BlockRange, StepIdentity } from '../../../model/index.ts';
|
|
3
|
+
export interface RewardsRangeOptions {
|
|
4
|
+
range?: BlockRange;
|
|
5
|
+
}
|
|
6
|
+
export interface RewardsByStepViewerOptions extends RewardsRangeOptions {
|
|
7
|
+
steps?: StepIdentity[];
|
|
8
|
+
}
|
|
9
|
+
export interface RewardsByStakerViewerOptions extends RewardsRangeOptions {
|
|
10
|
+
stakers?: Address[];
|
|
11
|
+
}
|
|
12
|
+
export interface RewardsByPositionViewerOptions extends RewardsRangeOptions {
|
|
13
|
+
positions?: number[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=RewardsViewerOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RewardsViewerOptions.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/RewardsViewerOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEvE,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACvE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,8BAA+B,SAAQ,mBAAmB;IACzE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise';
|
|
2
|
+
import type { RewardsByPositionViewer } from './RewardsByPositionViewer.ts';
|
|
3
|
+
import type { RewardsByStakerViewer } from './RewardsByStakerViewer.ts';
|
|
4
|
+
import type { RewardsByStepViewer } from './RewardsByStepViewer.ts';
|
|
5
|
+
import type { RewardsTotalViewer } from './RewardsTotalViewer.ts';
|
|
6
|
+
export interface StepRewardsViewerMethods {
|
|
7
|
+
}
|
|
8
|
+
export interface StepRewardsViewer extends StepRewardsViewerMethods {
|
|
9
|
+
position(): Promisable<RewardsByPositionViewer>;
|
|
10
|
+
staker(): Promisable<RewardsByStakerViewer>;
|
|
11
|
+
step(): Promisable<RewardsByStepViewer>;
|
|
12
|
+
total(): Promisable<RewardsTotalViewer>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=StepRewardsViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepRewardsViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/StepRewardsViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,MAAM,WAAW,wBAAwB;CAAG;AAE5C,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,QAAQ,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAA;IAC/C,MAAM,IAAI,UAAU,CAAC,qBAAqB,CAAC,CAAA;IAC3C,IAAI,IAAI,UAAU,CAAC,mBAAmB,CAAC,CAAA;IACvC,KAAK,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAAA;CACxC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex';
|
|
2
|
+
import type { Promisable } from '@xylabs/promise';
|
|
3
|
+
import type { RewardShare, StepIdentity } from '../../../model/index.ts';
|
|
4
|
+
export interface StepViewerMethods {
|
|
5
|
+
randomizer(step: StepIdentity): Promisable<bigint>;
|
|
6
|
+
rewards(step: StepIdentity): Promisable<Record<Address, RewardShare>>;
|
|
7
|
+
stake(step: StepIdentity): Promisable<bigint>;
|
|
8
|
+
stakers(step: StepIdentity): Promisable<Address[]>;
|
|
9
|
+
weight(step: StepIdentity): Promisable<bigint>;
|
|
10
|
+
}
|
|
11
|
+
export interface StepViewer extends StepViewerMethods {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=StepViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepViewer.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/StepViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAExE,MAAM,WAAW,iBAAiB;IAGhC,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAGlD,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;IAGrE,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;IAG7C,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;IAGlD,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;CAC/C;AAED,MAAM,WAAW,UAAW,SAAQ,iBAAiB;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './NetworkStakeViewer.ts';
|
|
2
|
+
export * from './RecordKeyType.ts';
|
|
3
|
+
export * from './RewardsByIndexViewerMethodsTemplate.ts';
|
|
4
|
+
export * from './RewardsByPositionViewer.ts';
|
|
5
|
+
export * from './RewardsByStakerViewer.ts';
|
|
6
|
+
export * from './RewardsByStepViewer.ts';
|
|
7
|
+
export * from './RewardsTotalViewer.ts';
|
|
8
|
+
export * from './RewardsViewerMethodsTemplate.ts';
|
|
9
|
+
export * from './RewardsViewerOptions.ts';
|
|
10
|
+
export * from './StepRewardsViewer.ts';
|
|
11
|
+
export * from './StepViewer.ts';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interfaces/viewers/NetworkStakeViewer/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0CAA0C,CAAA;AACxD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mCAAmC,CAAA;AACjD,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA"}
|
|
@@ -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 './NetworkStakeViewer.ts';
|
|
7
|
+
export * from './NetworkStakeViewer/index.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,+BAA+B,CAAA;AAC7C,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"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
import type { StepRewardsViewer } from './StepRewardsViewer.ts'
|
|
4
|
+
|
|
5
|
+
export interface NetworkStakeViewerMethods {
|
|
6
|
+
stake(blockNumber?: number): Promisable<bigint>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface NetworkStakeViewer extends NetworkStakeViewerMethods {
|
|
10
|
+
stepRewards(): Promisable<StepRewardsViewer>
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AttoXL1 } from '../../../xl1/index.ts'
|
|
2
|
+
import type { RecordKeyType } from './RecordKeyType.ts'
|
|
3
|
+
import type { RewardsViewerMethodsTemplate } from './RewardsViewerMethodsTemplate.ts'
|
|
4
|
+
|
|
5
|
+
export interface RewardsByIndexViewerMethodsTemplate<TOptions, TResultIndex extends RecordKeyType>
|
|
6
|
+
extends RewardsViewerMethodsTemplate<TOptions, Record<TResultIndex, AttoXL1>> {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RewardsByIndexViewerMethodsTemplate } from './RewardsByIndexViewerMethodsTemplate.ts'
|
|
2
|
+
import type { RewardsByPositionViewerOptions } from './RewardsViewerOptions.ts'
|
|
3
|
+
|
|
4
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
5
|
+
|
|
6
|
+
export interface RewardsByPositionViewerMethods extends RewardsByIndexViewerMethodsTemplate<RewardsByPositionViewerOptions, number> {}
|
|
7
|
+
export interface RewardsByPositionViewer extends RewardsByPositionViewerMethods {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
|
|
3
|
+
import type { RewardsByIndexViewerMethodsTemplate } from './RewardsByIndexViewerMethodsTemplate.ts'
|
|
4
|
+
import type { RewardsByStakerViewerOptions } from './RewardsViewerOptions.ts'
|
|
5
|
+
|
|
6
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
7
|
+
|
|
8
|
+
export interface RewardsByStakerViewerMethods extends RewardsByIndexViewerMethodsTemplate<RewardsByStakerViewerOptions, Address> {}
|
|
9
|
+
export interface RewardsByStakerViewer extends RewardsByStakerViewerMethods {}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StepIdentityString } from '../../../model/index.ts'
|
|
2
|
+
import type { RewardsByIndexViewerMethodsTemplate } from './RewardsByIndexViewerMethodsTemplate.ts'
|
|
3
|
+
import type { RewardsByStepViewerOptions } from './RewardsViewerOptions.ts'
|
|
4
|
+
|
|
5
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
6
|
+
|
|
7
|
+
export interface RewardsByStepViewerMethods extends RewardsByIndexViewerMethodsTemplate<RewardsByStepViewerOptions, StepIdentityString> {}
|
|
8
|
+
export interface RewardsByStepViewer extends RewardsByStepViewerMethods {}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AttoXL1 } from '../../../xl1/index.ts'
|
|
2
|
+
import type { RewardsViewerMethodsTemplate } from './RewardsViewerMethodsTemplate.ts'
|
|
3
|
+
import type { RewardsRangeOptions } from './RewardsViewerOptions.ts'
|
|
4
|
+
|
|
5
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
6
|
+
|
|
7
|
+
export interface RewardsTotalViewerMethods extends RewardsViewerMethodsTemplate<RewardsRangeOptions, AttoXL1> {}
|
|
8
|
+
export interface RewardsTotalViewer extends RewardsTotalViewerMethods {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
export interface RewardsViewerMethodsTemplate<TOptions, TResult> {
|
|
4
|
+
bonus(options?: TOptions): Promisable<TResult>
|
|
5
|
+
claimed(options?: TOptions): Promisable<TResult>
|
|
6
|
+
earned(options?: TOptions): Promisable<TResult>
|
|
7
|
+
total(options?: TOptions): Promisable<TResult>
|
|
8
|
+
unclaimed(options?: TOptions): Promisable<TResult>
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
|
|
3
|
+
import type { BlockRange, StepIdentity } from '../../../model/index.ts'
|
|
4
|
+
|
|
5
|
+
export interface RewardsRangeOptions {
|
|
6
|
+
range?: BlockRange
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface RewardsByStepViewerOptions extends RewardsRangeOptions {
|
|
10
|
+
steps?: StepIdentity[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RewardsByStakerViewerOptions extends RewardsRangeOptions {
|
|
14
|
+
stakers?: Address[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RewardsByPositionViewerOptions extends RewardsRangeOptions {
|
|
18
|
+
positions?: number[]
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Promisable } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
import type { RewardsByPositionViewer } from './RewardsByPositionViewer.ts'
|
|
4
|
+
import type { RewardsByStakerViewer } from './RewardsByStakerViewer.ts'
|
|
5
|
+
import type { RewardsByStepViewer } from './RewardsByStepViewer.ts'
|
|
6
|
+
import type { RewardsTotalViewer } from './RewardsTotalViewer.ts'
|
|
7
|
+
|
|
8
|
+
export interface StepRewardsViewerMethods {}
|
|
9
|
+
|
|
10
|
+
export interface StepRewardsViewer extends StepRewardsViewerMethods {
|
|
11
|
+
position(): Promisable<RewardsByPositionViewer>
|
|
12
|
+
staker(): Promisable<RewardsByStakerViewer>
|
|
13
|
+
step(): Promisable<RewardsByStepViewer>
|
|
14
|
+
total(): Promisable<RewardsTotalViewer>
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Promisable } from '@xylabs/promise'
|
|
3
|
+
|
|
4
|
+
import type { RewardShare, StepIdentity } from '../../../model/index.ts'
|
|
5
|
+
|
|
6
|
+
export interface StepViewerMethods {
|
|
7
|
+
|
|
8
|
+
// the predictable random number for a given step and block
|
|
9
|
+
randomizer(step: StepIdentity): Promisable<bigint>
|
|
10
|
+
|
|
11
|
+
// all the step rewards for all the network stakers for a given step
|
|
12
|
+
rewards(step: StepIdentity): Promisable<Record<Address, RewardShare>>
|
|
13
|
+
|
|
14
|
+
// total amount staked during a given step
|
|
15
|
+
stake(step: StepIdentity): Promisable<bigint>
|
|
16
|
+
|
|
17
|
+
// the total number of stakers for a given step and block
|
|
18
|
+
stakers(step: StepIdentity): Promisable<Address[]>
|
|
19
|
+
|
|
20
|
+
// total weight of all stakers during a given step
|
|
21
|
+
weight(step: StepIdentity): Promisable<bigint>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface StepViewer extends StepViewerMethods {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './NetworkStakeViewer.ts'
|
|
2
|
+
export * from './RecordKeyType.ts'
|
|
3
|
+
export * from './RewardsByIndexViewerMethodsTemplate.ts'
|
|
4
|
+
export * from './RewardsByPositionViewer.ts'
|
|
5
|
+
export * from './RewardsByStakerViewer.ts'
|
|
6
|
+
export * from './RewardsByStepViewer.ts'
|
|
7
|
+
export * from './RewardsTotalViewer.ts'
|
|
8
|
+
export * from './RewardsViewerMethodsTemplate.ts'
|
|
9
|
+
export * from './RewardsViewerOptions.ts'
|
|
10
|
+
export * from './StepRewardsViewer.ts'
|
|
11
|
+
export * from './StepViewer.ts'
|
|
12
|
+
|
|
13
|
+
// Note: Viewers are client objects that can nest other viewers and ViewerMethods objects consist only of methods that return data.
|
|
@@ -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 './NetworkStakeViewer.ts'
|
|
7
|
+
export * from './NetworkStakeViewer/index.ts'
|
|
8
8
|
export * from './Stake.ts'
|
|
9
9
|
export * from './StakeTotalsViewer.ts'
|
|
10
10
|
export * from './StakeViewer.ts'
|
|
@@ -1,54 +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
|
-
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 NetworkStakeViewerMethods {
|
|
49
|
-
stake(blockNumber?: number): Promisable<bigint>;
|
|
50
|
-
}
|
|
51
|
-
export interface NetworkStakeViewer extends NetworkStakeViewerMethods {
|
|
52
|
-
stepRewards(): Promisable<StepRewardsViewer>;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=NetworkStakeViewer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkStakeViewer.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/viewers/NetworkStakeViewer.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,74 +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
|
-
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 NetworkStakeViewerMethods {
|
|
69
|
-
stake(blockNumber?: number): Promisable<bigint>
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface NetworkStakeViewer extends NetworkStakeViewerMethods {
|
|
73
|
-
stepRewards(): Promisable<StepRewardsViewer>
|
|
74
|
-
}
|