Skip to content

Commit 22c2b2a

Browse files
authored
refactor(experimental): type reconciliation: GetInflationRewardApi (#2879)
1 parent 26c34cd commit 22c2b2a

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

packages/rpc-api/src/getInflationReward.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@ import type {
77
U64UnsafeBeyond2Pow53Minus1,
88
} from '@solana/rpc-types';
99

10-
type GetInflationRewardApiResponse = Readonly<{
10+
type GetInflationRewardApiConfig = Readonly<{
11+
// Defaults to `finalized`
12+
commitment?: Commitment;
13+
// An epoch for which the reward occurs.
14+
// If omitted, the previous epoch will be used
15+
epoch?: U64UnsafeBeyond2Pow53Minus1;
16+
// The minimum slot that the request can be evaluated at
17+
minContextSlot?: Slot;
18+
}>;
19+
20+
type InflationReward = Readonly<{
1121
// Reward amount in lamports
1222
amount: LamportsUnsafeBeyond2Pow53Minus1;
1323
// Vote account commission when the reward was credited
@@ -20,20 +30,11 @@ type GetInflationRewardApiResponse = Readonly<{
2030
postBalance: LamportsUnsafeBeyond2Pow53Minus1;
2131
}>;
2232

33+
type GetInflationRewardApiResponse = readonly (InflationReward | null)[];
34+
2335
export interface GetInflationRewardApi extends RpcApiMethods {
2436
/**
2537
* Returns the current block height of the node
2638
*/
27-
getInflationReward(
28-
addresses: Address[],
29-
config?: Readonly<{
30-
// Defaults to `finalized`
31-
commitment?: Commitment;
32-
// An epoch for which the reward occurs.
33-
// If omitted, the previous epoch will be used
34-
epoch?: U64UnsafeBeyond2Pow53Minus1;
35-
// The minimum slot that the request can be evaluated at
36-
minContextSlot?: Slot;
37-
}>,
38-
): Promise<readonly (GetInflationRewardApiResponse | null)[]>;
39+
getInflationReward(addresses: Address[], config?: GetInflationRewardApiConfig): GetInflationRewardApiResponse;
3940
}

0 commit comments

Comments
 (0)