@galacticcouncil/sdk-next 0.8.0 → 0.9.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.
@@ -1,46 +1,52 @@
1
1
  import Big from 'big.js';
2
+ import { BalanceClient } from '../client';
3
+ import { Balance } from '../types';
4
+ import { TVote } from './types';
2
5
  import { StakingClient } from './StakingClient';
3
- import { BalanceClient } from 'client';
4
6
  export declare const BIG_10: Big.Big;
5
7
  export declare const BIG_BILL: Big.Big;
6
8
  export declare class StakingApi {
7
9
  private readonly client;
8
10
  private readonly balanceClient;
9
11
  constructor(client: StakingClient, balanceClient: BalanceClient);
10
- getFreePotBalance(): Promise<bigint>;
12
+ getPotBalance(): Promise<Balance>;
11
13
  getStakingPosition(id: bigint): Promise<{
12
- stake: bigint | undefined;
13
- rewardPerStake: bigint | undefined;
14
- createdAt: number | undefined;
15
- actionPoints: bigint | undefined;
16
- accumulatedUnpaidRewards: bigint | undefined;
17
- accumulatedSlashPoints: bigint | undefined;
18
- accumulatedLockedRewards: bigint | undefined;
19
- votes: {
20
- id: number;
21
- amount: bigint;
22
- conviction: string;
23
- }[];
24
- }>;
14
+ stake: bigint;
15
+ rewardPerStake: bigint;
16
+ createdAt: number;
17
+ actionPoints: bigint;
18
+ accumulatedUnpaidRewards: bigint;
19
+ accumulatedSlashPoints: bigint;
20
+ accumulatedLockedRewards: bigint;
21
+ votes: TVote[];
22
+ } | undefined>;
25
23
  getStake(address: string): Promise<{
26
24
  totalStake: bigint;
27
25
  accumulatedRewardPerStake: bigint;
28
26
  potReservedBalance: bigint;
29
27
  positionId: bigint | undefined;
30
28
  stakePosition: {
31
- stake: bigint | undefined;
32
- rewardPerStake: bigint | undefined;
33
- createdAt: number | undefined;
34
- actionPoints: bigint | undefined;
35
- accumulatedUnpaidRewards: bigint | undefined;
36
- accumulatedSlashPoints: bigint | undefined;
37
- accumulatedLockedRewards: bigint | undefined;
38
- votes: {
39
- id: number;
40
- amount: bigint;
41
- conviction: string;
42
- }[];
29
+ stake: bigint;
30
+ rewardPerStake: bigint;
31
+ createdAt: number;
32
+ actionPoints: bigint;
33
+ accumulatedUnpaidRewards: bigint;
34
+ accumulatedSlashPoints: bigint;
35
+ accumulatedLockedRewards: bigint;
36
+ votes: TVote[];
43
37
  } | undefined;
44
38
  }>;
45
- getRewards(account: string, blockNumber: string): Promise<string | undefined>;
39
+ getCurrentActionPoints(votes: TVote[], initialActionPoints: bigint, stakePosition: bigint, activeReferendaIds: string[]): {
40
+ currentActionPoints: string;
41
+ maxActionPoints: string;
42
+ };
43
+ getRewards(account: string, activeReferendaIds: Array<string>, blockNumber: string): Promise<{
44
+ rewards: string;
45
+ maxRewards?: undefined;
46
+ allocatedRewardsPercentage?: undefined;
47
+ } | {
48
+ rewards: string;
49
+ maxRewards: string;
50
+ allocatedRewardsPercentage: number;
51
+ } | undefined>;
46
52
  }
@@ -111,5 +111,8 @@ export declare class StakingClient extends Papi {
111
111
  } | undefined];
112
112
  Killed: number;
113
113
  }> | undefined>;
114
+ getTimePointsPerPeriod(): Promise<number>;
115
+ getTimePointsWeight(): Promise<number>;
116
+ getActionPointsWeight(): Promise<number>;
114
117
  getSixBlockSince(): Promise<string>;
115
118
  }
@@ -0,0 +1,16 @@
1
+ export declare const CONVICTIONS: {
2
+ readonly none: 0.1;
3
+ readonly locked1x: 1;
4
+ readonly locked2x: 2;
5
+ readonly locked3x: 3;
6
+ readonly locked4x: 4;
7
+ readonly locked5x: 5;
8
+ readonly locked6x: 6;
9
+ };
10
+ export type TConviction = keyof typeof CONVICTIONS;
11
+ export type TVote = {
12
+ id: number;
13
+ amount: bigint;
14
+ conviction: TConviction;
15
+ };
16
+ export declare const isConviction: (conviction: string) => conviction is TConviction;
@@ -0,0 +1 @@
1
+ export declare function getAccountAddress(seed: string): import("polkadot-api").SS58String;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacticcouncil/sdk-next",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Galactic next gen sdk (papi)",
5
5
  "author": "GalacticCouncil",
6
6
  "repository": {