Skip to content

Commit 7a960b0

Browse files
committed
refactor(experimental): type reconciliation: GetSupplyApi
1 parent 0a85d7e commit 7a960b0

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

packages/rpc-api/src/getSupply.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type GetSupplyConfig = Readonly<{
66
commitment?: Commitment;
77
}>;
88

9-
type GetSupplyApiResponseBase = SolanaRpcResponse<{
9+
type GetSupplyApiResponseBase = Readonly<{
1010
/** Circulating supply in lamports */
1111
circulating: LamportsUnsafeBeyond2Pow53Minus1;
1212
/** Non-circulating supply in lamports */
@@ -17,21 +17,17 @@ type GetSupplyApiResponseBase = SolanaRpcResponse<{
1717

1818
type GetSupplyApiResponseWithNonCirculatingAccounts = GetSupplyApiResponseBase &
1919
Readonly<{
20-
value: Readonly<{
21-
/** an array of account addresses of non-circulating accounts */
22-
nonCirculatingAccounts: Address[];
23-
}>;
20+
/** an array of account addresses of non-circulating accounts */
21+
nonCirculatingAccounts: Address[];
2422
}>;
2523

2624
type GetSupplyApiResponseWithoutNonCirculatingAccounts = GetSupplyApiResponseBase &
2725
Readonly<{
28-
value: Readonly<{
29-
/** As per the docs:
30-
* "If `excludeNonCirculatingAccountsList` is enabled, the returned array will be empty."
31-
* See: https://solana.com/docs/rpc/http/getsupply
32-
*/
33-
nonCirculatingAccounts: never[];
34-
}>;
26+
/** As per the docs:
27+
* "If `excludeNonCirculatingAccountsList` is enabled, the returned array will be empty."
28+
* See: https://solana.com/docs/rpc/http/getsupply
29+
*/
30+
nonCirculatingAccounts: never[];
3531
}>;
3632

3733
export interface GetSupplyApi extends RpcApiMethods {
@@ -43,11 +39,11 @@ export interface GetSupplyApi extends RpcApiMethods {
4339
Readonly<{
4440
excludeNonCirculatingAccountsList: true;
4541
}>,
46-
): GetSupplyApiResponseWithoutNonCirculatingAccounts;
42+
): SolanaRpcResponse<GetSupplyApiResponseWithoutNonCirculatingAccounts>;
4743
getSupply(
4844
config?: GetSupplyConfig &
4945
Readonly<{
5046
excludeNonCirculatingAccountsList?: false;
5147
}>,
52-
): GetSupplyApiResponseWithNonCirculatingAccounts;
48+
): SolanaRpcResponse<GetSupplyApiResponseWithNonCirculatingAccounts>;
5349
}

0 commit comments

Comments
 (0)