mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
27 lines
803 B
TypeScript
27 lines
803 B
TypeScript
import type { ApiResource } from '../types';
|
|
import type { AddressMetadataInfo, PublicTagTypesResponse } from 'types/api/addressMetadata';
|
|
|
|
export const METADATA_API_RESOURCES = {
|
|
info: {
|
|
path: '/v1/metadata',
|
|
},
|
|
tags_search: {
|
|
path: '/v1/tags:search',
|
|
},
|
|
public_tag_types: {
|
|
path: '/v1/public-tag-types',
|
|
},
|
|
address_submit: {
|
|
path: '/v1/addresses\\:submit',
|
|
},
|
|
} satisfies Record<string, ApiResource>;
|
|
|
|
export type MetadataApiResourceName = `metadata:${ keyof typeof METADATA_API_RESOURCES }`;
|
|
|
|
/* eslint-disable @stylistic/indent */
|
|
export type MetadataApiResourcePayload<R extends MetadataApiResourceName> =
|
|
R extends 'metadata:info' ? AddressMetadataInfo :
|
|
R extends 'metadata:public_tag_types' ? PublicTagTypesResponse :
|
|
never;
|
|
/* eslint-enable @stylistic/indent */
|