Skip to content

Commit

Permalink
fix: search subname
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony23991 committed May 9, 2024
1 parent efb906f commit 02afca0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
20 changes: 10 additions & 10 deletions packages/@justaname.id/sdk/src/lib/features/subnames/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ import {
IsSubnameAvailableRequest,
IsSubnameAvailableResponse,
SIWEHeaders,
SubnameAcceptRequest, SubnameAcceptResponse,
SubnameAcceptRequest,
SubnameAcceptResponse,
SubnameAddRequest,
SubnameAddResponse,

SubnameGetAllByAddressRequest,
SubnameGetAllByAddressResponse,
SubnameGetAllByDomainChainIdRequest,
SubnameGetAllByDomainChainIdResponse, SubnameGetByDomainNameChainIdRequest,
SubnameGetAllByDomainChainIdRequest,
SubnameGetAllByDomainChainIdResponse,
SubnameGetByDomainNameChainIdRequest,
SubnameGetByDomainNameChainIdResponse,
SubnameGetBySubnameRequest,
SubnameGetBySubnameResponse,
SubnameReserveRequest,
SubnameReserveResponse,
SubnameRevokeRequest,
SubnameRevokeResponse,
SubnameSearchRequest,
SubnameSearchResponse, SubnameUpdateRequest,
SubnameUpdateResponse
,
SubnameSearchRequest,
SubnameSearchResponse,
SubnameUpdateRequest,
SubnameUpdateResponse,
} from '../../types';

/**
Expand Down Expand Up @@ -58,7 +59,6 @@ export class Subnames {
this.apiKey = apiKey;
}


/**
* Accept a subname invite under a specific domain, associating it with an Ethereum address.
* This operation requires an API key.
Expand Down Expand Up @@ -211,7 +211,7 @@ export class Subnames {

async searchSubnames(
params: SubnameSearchRequest
): Promise<SubnameSearchResponse[]> {
): Promise<SubnameSearchResponse> {
return restCall('SEARCH_SUBNAMES_ROUTE', 'GET', params);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export interface SubnameSearchRequest extends IRequest {
}

export interface SubnameSearchResponse extends IResponse {
domains: SubnameSearchDomainResponse[] | string[];
registered?: boolean;
}

export interface SubnameSearchDomainResponse {
id: string;

username: string;
Expand All @@ -66,6 +71,6 @@ export interface SubnameSearchResponse extends IResponse {

export interface SubnameSearchRoute extends IRoute {
request: SubnameSearchRequest;
response: SubnameSearchResponse[];
response: SubnameSearchResponse;
headers: NonNullable<unknown>;
}

0 comments on commit 02afca0

Please sign in to comment.