Skip to content

Commit

Permalink
feat(app-tokens): Use POST route for getting app token batch (Zapper-…
Browse files Browse the repository at this point in the history
  • Loading branch information
JForsaken committed Aug 8, 2022
1 parent cf04d44 commit 98f802c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/position/app-token-selector.service.ts
Expand Up @@ -21,7 +21,7 @@ export class AppTokenSelectorService implements AppTokenSelectorFactory {
create(_opts: CreateAppTokenSelectorOptions): AppTokenSelector {
const tokenDataLoader = new DataLoader<AppTokenSelectorKey, AppTokenPosition | null>(
keys => this.positionAPIClient.getAppTokenBatch(keys as Mutable<AppTokenSelectorKey[]>),
{ maxBatchSize: 100 },
{ maxBatchSize: 1000 },
);

return {
Expand Down
7 changes: 5 additions & 2 deletions src/position/position-source/position-source.api.ts
Expand Up @@ -74,8 +74,11 @@ export class ApiPositionSource implements PositionSource {
networks.push(q.network);
}

const query = qs.stringify({ addresses, networks });
const { data } = await this.axios.get<(AppTokenPosition | null)[]>(`/v2/app-tokens/batch?${query}`);
const { data } = await this.axios.post<(AppTokenPosition | null)[]>(`/v2/app-tokens/batch`, {
addresses,
networks,
});

return data;
}
}

0 comments on commit 98f802c

Please sign in to comment.