Skip to content

Commit

Permalink
Remove unimplemented indexer endpoint of get subaccount funding
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Li committed Sep 20, 2023
1 parent 6eceb6c commit 5a1c158
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 90 deletions.
14 changes: 0 additions & 14 deletions v4-client-js/__tests__/modules/client/AccountEndpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,6 @@ describe('IndexerClient', () => {
}
});

/*
** Funding endpoint is not implemented in the indexer yet
it('Funding', async () => {
const response = await client.account.getSubaccountFunding(DYDX_TEST_ADDRESS, 0);
expect(response).not.toBeNull();
const funding = response.funding;
expect(funding).not.toBeNull();
if (funding.length > 0) {
const funding0 = funding[0];
expect(funding0).not.toBeNull();
}
});
*/

it('Historical PNL', async () => {
const response = await client.account.getSubaccountHistoricalPNLs(DYDX_TEST_ADDRESS, 0);
expect(response).not.toBeNull();
Expand Down
14 changes: 0 additions & 14 deletions v4-client-js/examples/account_endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,6 @@ async function test(): Promise<void> {
console.log(error.message);
}

// Get funding payments
try {
const response = await client.account.getSubaccountFunding(address, 0);
console.log(response);
const fundingPayments = response.fundingPayments;
console.log(fundingPayments);
if (fundingPayments.length > 0) {
const fundingPayments0 = fundingPayments[0];
console.log(fundingPayments0);
}
} catch (error) {
console.log(error.message);
}

// Get historical pnl
try {
const response = await client.account.getSubaccountHistoricalPNLs(address, 0);
Expand Down
4 changes: 2 additions & 2 deletions v4-client-js/package-lock.json

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

17 changes: 0 additions & 17 deletions v4-client-js/src/clients/modules/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,6 @@ export default class AccountClient extends RestClient {
});
}

async getSubaccountFunding(
address: string,
subaccountNumber: number,
limit?: number | null,
createdBeforeOrAtHeight?: number | null,
createdBeforeOrAt?: string | null,
): Promise<Data> {
const uri = '/v4/funding';
return this.get(uri, {
address,
subaccountNumber,
limit,
createdBeforeOrAtHeight,
createdBeforeOrAt,
});
}

async getSubaccountHistoricalPNLs(
address: string,
subaccountNumber: number,
Expand Down
44 changes: 1 addition & 43 deletions v4-client-py/v4_client_py/clients/modules/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,48 +384,6 @@ def get_subaccount_fills(
},
)

def get_subaccount_funding(
self,
address: str,
subaccount_number: int,
limit: int = None,
created_before_or_at_height: int = None,
created_before_or_at_time: str = None,
) -> Response:
'''
Get asset transfers record
:param address: required
:type address: str
:param subaccount_number: required
:type subaccount_number: int
:param limit: optional
:type limit: number
:param created_before_or_at_height: optional
:type created_before_or_at_height: number
:param created_before_or_at_time: optional
:type created_before_or_at_time: ISO str
:returns: Array of funding payments
:raises: DydxAPIError
'''
return self._get(
'/v4/funding',
{
'address': address,
'subaccountNumber': subaccount_number,
'limit': limit,
'createdBeforeOrAtHeight': created_before_or_at_height,
'createdBeforeOrAt': created_before_or_at_time,
},
)


def get_subaccount_historical_pnls(
self,
address: str,
Expand Down Expand Up @@ -460,4 +418,4 @@ def get_subaccount_historical_pnls(
'effectiveBeforeOrAt': effective_before_or_at,
'effectiveAtOrAfter': effective_at_or_after,
},
)
)

0 comments on commit 5a1c158

Please sign in to comment.