Skip to content

Commit

Permalink
Feature/pro 903 add positions data to investments (#216)
Browse files Browse the repository at this point in the history
* Added position data to account investments

* Updated the package version

* Removed label from position info
  • Loading branch information
kaushalrajbacancy authored Jan 30, 2023
1 parent 544bab2 commit bdee139
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "etherspot",
"version": "1.42.6",
"version": "1.42.7",
"description": "Etherspot SDK",
"keywords": [
"ether",
Expand Down
8 changes: 8 additions & 0 deletions src/sdk/account/account.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ export class AccountService extends Service {
position
balance
logoURI
positionsInfo {
balance
tokens
price
metaType
name
logoURI
}
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/sdk/account/classes/account-investment-positions-info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { BigNumber } from 'ethers';
import { TransformBigNumber } from '../../common';

export class AccountInvestmentPositionsInfo {
@TransformBigNumber()
balance: BigNumber;

tokens: number;

price: number;

metaType: string;

name: string;

logoURI: string;
}
5 changes: 5 additions & 0 deletions src/sdk/account/classes/account-investment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Type } from 'class-transformer'
import { BigNumber } from 'ethers';
import { TransformBigNumber } from '../../common';
import { AccountInvestmentPositionsInfo } from './account-investment-positions-info';

export class AccountInvestment {
name: string;
Expand All @@ -12,4 +14,7 @@ export class AccountInvestment {
position: number;

logoURI: string;

@Type(() => AccountInvestmentPositionsInfo)
positionsInfo?: [AccountInvestmentPositionsInfo[]]
}
1 change: 1 addition & 0 deletions src/sdk/account/classes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export * from './account-total-balances';
export * from './accounts';
export * from './account-investment';
export * from './account-investments';
export * from './account-investment-positions-info';

0 comments on commit bdee139

Please sign in to comment.