@@ -122,10 +122,10 @@ export class Incentive implements BaseSDK {
122122 ] ) ;
123123
124124 return data . map ( ( item ) => {
125- const rawId = item [ 0 ] . args [ 0 ] ;
126- const id = getPoolId ( rawId ) ;
127- const type = rawId . isDex ? IncentiveType . DEX : IncentiveType . LOANS ;
128- const collateral = tokens [ forceToCurrencyName ( getPoolToken ( rawId ) ) ] ;
125+ const raw = item [ 0 ] . args [ 0 ] ;
126+ const id = getPoolId ( raw ) ;
127+ const type = raw . isDex ? IncentiveType . DEX : raw . isLoans ? IncentiveType . LOANS : IncentiveType . Earning ;
128+ const collateral = tokens [ forceToCurrencyName ( getPoolToken ( raw ) ) ] ;
129129 const totalShares = FixedPointNumber . fromInner ( item [ 1 ] . totalShares . toString ( ) , collateral . decimals ) ;
130130
131131 // format rewards infomations
@@ -142,7 +142,7 @@ export class Incentive implements BaseSDK {
142142 } ;
143143 } ) ;
144144
145- return { collateral, type, id, rawId , totalShares, rewards } ;
145+ return { collateral, type, id, raw , totalShares, rewards } ;
146146 } ) ;
147147 } )
148148 ) ;
@@ -180,8 +180,8 @@ export class Incentive implements BaseSDK {
180180
181181 return combineLatest ( {
182182 info : of ( info ) ,
183- sharesAndWithdrawn : this . storages . userSharesAndWithdrawnRewards ( info . rawId , address ) . observable ,
184- pendingRewards : this . storages . pendingRewards ( info . rawId , address ) . observable
183+ sharesAndWithdrawn : this . storages . userSharesAndWithdrawnRewards ( info . raw , address ) . observable ,
184+ pendingRewards : this . storages . pendingRewards ( info . raw , address ) . observable
185185 } ) ;
186186 } ) ,
187187 map ( ( { info, sharesAndWithdrawn, pendingRewards } ) => {
@@ -312,7 +312,7 @@ export class Incentive implements BaseSDK {
312312 return this . subscribeAllIncentivePools ( ) . pipe (
313313 map ( ( data ) => {
314314 return data . find ( ( item ) => {
315- return item . type === type && forceToCurrencyName ( getPoolToken ( item . rawId ) ) === forceToCurrencyName ( currency ) ;
315+ return item . type === type && forceToCurrencyName ( getPoolToken ( item . raw ) ) === forceToCurrencyName ( currency ) ;
316316 } ) ;
317317 } )
318318 ) ;
0 commit comments