Skip to content

Commit

Permalink
Add abi configuration for listing contracts (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahnami authored Dec 8, 2023
1 parent f25c1fa commit ec2f85a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/proposal/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ export class ProposalClient extends BaseApiClient {
});
}

public async listContracts(): Promise<Omit<Contract, 'abi'>[]> {
public async listContracts(params: { includeAbi?: boolean } = {}): Promise<Contract[]> {
return this.apiCall(async (api) => {
return (await api.get('/contracts')) as Omit<Contract, 'abi'>[];
return (await api.get('/contracts', { params })) as Contract[];
});
}

public async getContract(contractId: string): Promise<Contract[]> {
return this.apiCall(async (api) => {
return (await api.get(`/contracts/${contractId}`)) as Contract[];
});
}

Expand Down

0 comments on commit ec2f85a

Please sign in to comment.