@@ -22,6 +22,7 @@ import {
2222 SolanaTx ,
2323 SolanaTxStatus ,
2424 SolNetworkStats ,
25+ SolRewards ,
2526 SolStakes ,
2627 TaggedStake ,
2728} from '../types/sol' ;
@@ -507,10 +508,10 @@ export class SolService extends Service {
507508
508509 /**
509510 * Retrieve stakes of given kiln accounts
510- * @param accountIds: account ids of which you wish to retrieve rewards
511+ * @param accountIds: kiln account ids of which you wish to retrieve stakes
511512 * @returns {SolStakes } Solana Stakes
512513 */
513- async getAccountsRewards (
514+ async getStakesByAccounts (
514515 accountIds : string [ ] ,
515516 ) : Promise < SolStakes > {
516517 const { data } = await api . get < SolStakes > (
@@ -519,13 +520,63 @@ export class SolService extends Service {
519520 }
520521
521522 /**
522- * Retrieve stake on given stake accounts
523- * @param stakeAccountAddresses validator addresses of which you wish to retrieve rewards
523+ * Retrieve stakes of given stake accounts
524+ * @param stakeAccounts: stake account addresses of which you wish to retrieve rewards
524525 * @returns {SolStakes } Solana Stakes
525526 */
526- async getStakesRewards ( stakeAccountAddresses : string [ ] ) : Promise < SolStakes > {
527+ async getStakesByStakeAccounts (
528+ stakeAccounts : string [ ] ,
529+ ) : Promise < SolStakes > {
527530 const { data } = await api . get < SolStakes > (
528- `/v1/sol/stakes?stakeaccounts=${ stakeAccountAddresses . join ( ',' ) } ` ,
531+ `/v1/sol/stakes?stake_accounts=${ stakeAccounts . join ( ',' ) } ` ) ;
532+ return data ;
533+ }
534+
535+ /**
536+ * Retrieve stakes of given wallets
537+ * @param wallets: wallet addresses of which you wish to retrieve rewards
538+ * @returns {SolStakes } Solana Stakes
539+ */
540+ async getStakesByWallets (
541+ wallets : string [ ] ,
542+ ) : Promise < SolStakes > {
543+ const { data } = await api . get < SolStakes > (
544+ `/v1/sol/stakes?wallets=${ wallets . join ( ',' ) } ` ) ;
545+ return data ;
546+ }
547+
548+ /**
549+ * Retrieve rewards for given accounts
550+ * @param accountIds kiln account ids of which you wish to retrieve rewards
551+ * @returns {SolRewards } Solana rewards
552+ */
553+ async getRewardsByAccounts ( accountIds : string [ ] ) : Promise < SolRewards > {
554+ const { data } = await api . get < SolRewards > (
555+ `/v1/sol/rewards?accounts=${ accountIds . join ( ',' ) } ` ,
556+ ) ;
557+ return data ;
558+ }
559+
560+ /**
561+ * Retrieve rewards for given stake accounts
562+ * @param stakeAccounts stake account addresses of which you wish to retrieve rewards
563+ * @returns {SolRewards } Solana rewards
564+ */
565+ async getRewardsByStakeAccounts ( stakeAccounts : string [ ] ) : Promise < SolRewards > {
566+ const { data } = await api . get < SolRewards > (
567+ `/v1/sol/rewards?stake_accounts=${ stakeAccounts . join ( ',' ) } ` ,
568+ ) ;
569+ return data ;
570+ }
571+
572+ /**
573+ * Retrieve rewards for given stake accounts
574+ * @param wallets wallet addresses of which you wish to retrieve rewards
575+ * @returns {SolRewards } Solana rewards
576+ */
577+ async getRewardsByWallets ( wallets : string [ ] ) : Promise < SolRewards > {
578+ const { data } = await api . get < SolRewards > (
579+ `/v1/sol/rewards?wallets=${ wallets . join ( ',' ) } ` ,
529580 ) ;
530581 return data ;
531582 }
0 commit comments