Skip to content

Commit

Permalink
add address keys proxy (#1366)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfaur09 authored Oct 29, 2024
1 parent affe405 commit ec39adc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/gateway/entities/gateway.component.request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum GatewayComponentRequest {
addressNonce = 'addressNonce',
addressShard = 'addressShard',
addressStorage = 'addressStorage',
addressKeys = 'addressKeys',
guardianData = 'guardianData',
addressTransactions = 'addressTransactions',
simulateTransaction = 'simulateTransaction',
Expand Down
10 changes: 10 additions & 0 deletions src/endpoints/proxy/gateway.proxy.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ export class GatewayProxyController {
return await this.gatewayGet(`address/${address}/shard`, GatewayComponentRequest.addressShard);
}

@Get('/address/:address/keys')
async getAddressKeys(@Param('address', ParseAddressPipe) address: string) {
try {
return await this.gatewayGet(`address/${address}/keys`, GatewayComponentRequest.addressKeys);
} catch (error: any) {
this.logger.error(`Error fetching address keys for address ${address}: ${error.message}`);
throw new BadRequestException(error.response?.data || 'An error occurred while fetching address keys');
}
}

@Get('/address/:address/key/:key')
async getAddressStorageKey(@Param('address', ParseAddressPipe) address: string, @Param('key') key: string) {
// eslint-disable-next-line require-await
Expand Down

0 comments on commit ec39adc

Please sign in to comment.