Skip to content
Merged
181 changes: 136 additions & 45 deletions opt/wildcat/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,43 @@
"get": {
"tags": ["admin"],
"operationId": "list_keyset_infos",
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": ["integer", "null"],
"format": "int32",
"minimum": 0
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": ["integer", "null"],
"format": "int32",
"minimum": 0
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/KeySetInfo"
}
"$ref": "#/components/schemas/PaginatedResponse_KeySetInfo"
}
}
}
}
}
}
},
"/v1/admin/credit/mint_op_status/{qid}": {
"/v1/admin/treasury/credit/mint_op_status/{qid}": {
"get": {
"tags": ["admin"],
"operationId": "get_mintop_status",
Expand Down Expand Up @@ -128,7 +147,7 @@
}
}
},
"/v1/admin/credit/mint_ops/{kid}": {
"/v1/admin/treasury/credit/mint_ops/{kid}": {
"get": {
"tags": ["admin"],
"operationId": "list_mintops",
Expand Down Expand Up @@ -388,6 +407,26 @@
}
]
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": ["integer", "null"],
"format": "int32",
"minimum": 0
}
},
{
"name": "offset",
"in": "query",
"required": false,
"schema": {
"type": ["integer", "null"],
"format": "int32",
"minimum": 0
}
}
],
"responses": {
Expand All @@ -396,7 +435,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListReplyLight"
"$ref": "#/components/schemas/PaginatedResponse_LightInfo"
}
}
}
Expand Down Expand Up @@ -785,16 +824,6 @@
"get": {
"tags": ["admin"],
"operationId": "get_ebill_mint_complete",
"parameters": [
{
"name": "bid",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
Expand Down Expand Up @@ -2029,21 +2058,6 @@
}
}
},
"LightBillIdentParticipant": {
"type": "object",
"required": ["type", "name", "node_id"],
"properties": {
"type": {
"$ref": "#/components/schemas/ContactType"
},
"name": {
"type": "string"
},
"node_id": {
"type": "string"
}
}
},
"LightBillIdentParticipantWithAddress": {
"allOf": [
{
Expand Down Expand Up @@ -2088,6 +2102,18 @@
}
]
},
"LightBillSignatory": {
"type": "object",
"required": ["node_id"],
"properties": {
"name": {
"type": ["string", "null"]
},
"node_id": {
"type": "string"
}
}
},
"LightInfo": {
"type": "object",
"required": ["id", "status", "sum"],
Expand Down Expand Up @@ -2119,24 +2145,12 @@
"type": "null"
},
{
"$ref": "#/components/schemas/LightBillIdentParticipant"
"$ref": "#/components/schemas/LightBillSignatory"
}
]
}
}
},
"ListReplyLight": {
"type": "object",
"required": ["quotes"],
"properties": {
"quotes": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LightInfo"
}
}
}
},
"ListSort": {
"type": "string",
"enum": ["bill_maturity_date_desc", "bill_maturity_date_asc"]
Expand Down Expand Up @@ -2222,6 +2236,83 @@
}
}
},
"PaginatedResponse_KeySetInfo": {
"type": "object",
"required": ["data", "total"],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"description": "KeySetInfo",
"required": ["id", "unit", "active"],
"properties": {
"id": {
"type": "string",
"description": "Keyset [`Id`]"
},
"unit": {
"$ref": "#/components/schemas/CurrencyUnit",
"description": "Keyset [`CurrencyUnit`]"
},
"active": {
"type": "boolean",
"description": "Keyset state\nMint will only sign from an active keyset"
},
"input_fee_ppk": {
"type": "integer",
"format": "int64",
"description": "Input Fee PPK",
"minimum": 0
},
"final_expiry": {
"type": ["integer", "null"],
"format": "int64",
"description": "Expiry of the keyset",
"minimum": 0
}
}
}
},
"total": {
"type": "integer",
"format": "int64",
"minimum": 0
}
}
},
"PaginatedResponse_LightInfo": {
"type": "object",
"required": ["data", "total"],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "status", "sum"],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"status": {
"$ref": "#/components/schemas/InfoReplyDiscriminants"
},
"sum": {
"type": "integer",
"format": "int64",
"minimum": 0
}
}
}
},
"total": {
"type": "integer",
"format": "int64",
"minimum": 0
}
}
},
"PerceivedState": {
"type": "object",
"description": "Reflects what the majority of Beta mints think about the current Alpha mint",
Expand Down
83 changes: 80 additions & 3 deletions src/generated/client/@tanstack/react-query.gen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is auto-generated by @hey-api/openapi-ts

import { type DefaultError, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query';

import { client } from '../client.gen';
import { getClowderAlphas, getClowderBetas, getClowderForeignCoverage, getClowderInfo, getClowderLocalCoverage, getClowderMystatus, getClowderStatus, getEbill, getEbillAttachment, getEbillEndorsements, getEbillMintComplete, getEbillPaymentstatus, getHealth, getIdentity, getKeysetInfo, getMintInfo, getMintopStatus, getQuote, getSatBalance, listEbills, listKeysetInfos, listMintops, listQuotes, type Options, postEbillReqtopay, postEnableRedemption, postTokenStatus, updateQuote } from '../sdk.gen';
Expand Down Expand Up @@ -99,6 +99,59 @@ export const listKeysetInfosOptions = (options?: Options<ListKeysetInfosData>) =
queryKey: listKeysetInfosQueryKey(options)
});

const createInfiniteParams = <K extends Pick<QueryKey<Options>[0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey<Options>, page: K) => {
const params = { ...queryKey[0] };
if (page.body) {
params.body = {
...queryKey[0].body as any,
...page.body as any
};
}
if (page.headers) {
params.headers = {
...queryKey[0].headers,
...page.headers
};
}
if (page.path) {
params.path = {
...queryKey[0].path as any,
...page.path as any
};
}
if (page.query) {
params.query = {
...queryKey[0].query as any,
...page.query as any
};
}
return params as unknown as typeof page;
};

export const listKeysetInfosInfiniteQueryKey = (options?: Options<ListKeysetInfosData>): QueryKey<Options<ListKeysetInfosData>> => createQueryKey('listKeysetInfos', options, true);

export const listKeysetInfosInfiniteOptions = (options?: Options<ListKeysetInfosData>) => infiniteQueryOptions<ListKeysetInfosResponse, DefaultError, InfiniteData<ListKeysetInfosResponse>, QueryKey<Options<ListKeysetInfosData>>, number | null | Pick<QueryKey<Options<ListKeysetInfosData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
// @ts-ignore
{
queryFn: async ({ pageParam, queryKey, signal }) => {
// @ts-ignore
const page: Pick<QueryKey<Options<ListKeysetInfosData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
query: {
offset: pageParam
}
};
const params = createInfiniteParams(queryKey, page);
const { data } = await listKeysetInfos({
...options,
...params,
signal,
throwOnError: true
});
return data;
},
queryKey: listKeysetInfosInfiniteQueryKey(options)
});

export const getMintopStatusQueryKey = (options: Options<GetMintopStatusData>) => createQueryKey('getMintopStatus', options);

export const getMintopStatusOptions = (options: Options<GetMintopStatusData>) => queryOptions<GetMintopStatusResponse, DefaultError, GetMintopStatusResponse, ReturnType<typeof getMintopStatusQueryKey>>({
Expand Down Expand Up @@ -201,6 +254,30 @@ export const listQuotesOptions = (options?: Options<ListQuotesData>) => queryOpt
queryKey: listQuotesQueryKey(options)
});

export const listQuotesInfiniteQueryKey = (options?: Options<ListQuotesData>): QueryKey<Options<ListQuotesData>> => createQueryKey('listQuotes', options, true);

export const listQuotesInfiniteOptions = (options?: Options<ListQuotesData>) => infiniteQueryOptions<ListQuotesResponse, DefaultError, InfiniteData<ListQuotesResponse>, QueryKey<Options<ListQuotesData>>, number | null | Pick<QueryKey<Options<ListQuotesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
// @ts-ignore
{
queryFn: async ({ pageParam, queryKey, signal }) => {
// @ts-ignore
const page: Pick<QueryKey<Options<ListQuotesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
query: {
offset: pageParam
}
};
const params = createInfiniteParams(queryKey, page);
const { data } = await listQuotes({
...options,
...params,
signal,
throwOnError: true
});
return data;
},
queryKey: listQuotesInfiniteQueryKey(options)
});

export const getIdentityQueryKey = (options?: Options<GetIdentityData>) => createQueryKey('getIdentity', options);

export const getIdentityOptions = (options?: Options<GetIdentityData>) => queryOptions<GetIdentityResponse, DefaultError, GetIdentityResponse, ReturnType<typeof getIdentityQueryKey>>({
Expand Down Expand Up @@ -431,9 +508,9 @@ export const getSatBalanceOptions = (options?: Options<GetSatBalanceData>) => qu
queryKey: getSatBalanceQueryKey(options)
});

export const getEbillMintCompleteQueryKey = (options: Options<GetEbillMintCompleteData>) => createQueryKey('getEbillMintComplete', options);
export const getEbillMintCompleteQueryKey = (options?: Options<GetEbillMintCompleteData>) => createQueryKey('getEbillMintComplete', options);

export const getEbillMintCompleteOptions = (options: Options<GetEbillMintCompleteData>) => queryOptions<GetEbillMintCompleteResponse, DefaultError, GetEbillMintCompleteResponse, ReturnType<typeof getEbillMintCompleteQueryKey>>({
export const getEbillMintCompleteOptions = (options?: Options<GetEbillMintCompleteData>) => queryOptions<GetEbillMintCompleteResponse, DefaultError, GetEbillMintCompleteResponse, ReturnType<typeof getEbillMintCompleteQueryKey>>({
queryFn: async ({ queryKey, signal }) => {
const { data } = await getEbillMintComplete({
...options,
Expand Down
Loading
Loading