Skip to content

Commit

Permalink
fix: alliance delegation model does not need to be coins
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Mar 16, 2024
1 parent 5866dc3 commit 0b4f8e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/client/lcd/api/AllianceAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
AllianceUnbonding,
AllianceValidator,
} from '../../../core/alliance';
import { AccAddress, Coins, ValAddress } from '../../../core';
import { AccAddress, Coins, Coin, ValAddress } from '../../../core';
import { APIParams, Pagination, PaginationOptions } from '../APIRequester';
import { LCDClient } from '../LCDClient';

Expand Down Expand Up @@ -108,7 +108,7 @@ export class AllianceAPI extends BaseAPI {
params: Partial<PaginationOptions & APIParams> = {}
): Promise<{
delegations: AllianceDelegation[];
balance: Coins;
balance: Coin;
pagination: Pagination;
}> {
let url = `/terra/alliances/delegations`;
Expand Down Expand Up @@ -138,7 +138,7 @@ export class AllianceAPI extends BaseAPI {
if (delAddr && valAddr && denom) {
const res = await this.getReqFromChainID(chainID).get<{
delegation: AllianceDelegation.Data;
balance: Coins.Data;
balance: Coin.Data;
}>(url, params);

return {
Expand All @@ -147,19 +147,19 @@ export class AllianceAPI extends BaseAPI {
total: 1,
},
delegations: [AllianceDelegation.fromData(res.delegation)],
balance: Coins.fromData(res.balance),
balance: Coin.fromData(res.balance),
};
} else {
const res = await this.getReqFromChainID(chainID).get<{
delegations: AllianceDelegation.Data[];
balance: Coins.Data;
balance: Coin.Data;
pagination: Pagination;
}>(url, params);

return {
pagination: res.pagination,
delegations: res.delegations.map(d => AllianceDelegation.fromData(d)),
balance: Coins.fromData(res.balance),
balance: Coin.fromData(res.balance),
};
}
}
Expand Down

0 comments on commit 0b4f8e7

Please sign in to comment.