diff --git a/docs/bin/openapi.json b/docs/bin/openapi.json index 921409ca..36e15c4a 100644 --- a/docs/bin/openapi.json +++ b/docs/bin/openapi.json @@ -146,6 +146,11 @@ ], "type": "object" }, + "AssetName": { + "type": "string", + "example": "42657272794e617679", + "pattern": "[0-9a-fA-F]{0,64}" + }, "AssetUtxosResponse": { "items": { "properties": { @@ -159,6 +164,15 @@ "paymentCred": { "type": "string" }, + "assetName": { + "$ref": "#/components/schemas/AssetName" + }, + "policyId": { + "type": "string" + }, + "cip14Fingerprint": { + "type": "string" + }, "utxo": { "properties": { "index": { @@ -176,16 +190,17 @@ "type": "object" }, "amount": { - "type": "number", - "format": "double", - "description": "If the utxo is created, this has the amount. It's undefined if the utxo\nis spent.", - "example": 1031423725351 + "type": "string", + "description": "If the utxo is created, this has the amount. It's undefined if the utxo\nis spent." } }, "required": [ "txId", "slot", "paymentCred", + "assetName", + "policyId", + "cip14Fingerprint", "utxo" ], "type": "object" @@ -196,9 +211,20 @@ "type": "string", "example": "asset1c43p68zwjezc7f6w4w9qkhkwv9ppwz0f7c3amw" }, + "PolicyId": { + "type": "string", + "example": "b863bc7369f46136ac1048adb2fa7dae3af944c3bbb2be2f216a8d4f", + "pattern": "[0-9a-fA-F]{56}" + }, "AssetUtxosRequest": { "properties": { - "assets": { + "policyIds": { + "items": { + "$ref": "#/components/schemas/PolicyId" + }, + "type": "array" + }, + "fingerprints": { "items": { "$ref": "#/components/schemas/Cip14Fingerprint" }, @@ -223,7 +249,6 @@ } }, "required": [ - "assets", "range" ], "type": "object" @@ -478,16 +503,6 @@ ], "type": "object" }, - "PolicyId": { - "type": "string", - "example": "b863bc7369f46136ac1048adb2fa7dae3af944c3bbb2be2f216a8d4f", - "pattern": "[0-9a-fA-F]{56}" - }, - "AssetName": { - "type": "string", - "example": "42657272794e617679", - "pattern": "[0-9a-fA-F]{0,64}" - }, "Asset": { "properties": { "assetName": { diff --git a/webserver/shared/models/AssetUtxos.ts b/webserver/shared/models/AssetUtxos.ts index ccd8bb7a..e9633fb7 100644 --- a/webserver/shared/models/AssetUtxos.ts +++ b/webserver/shared/models/AssetUtxos.ts @@ -1,31 +1,32 @@ +import { AssetName, PolicyId } from "./PolicyIdAssetMap"; + /** * @example "asset1c43p68zwjezc7f6w4w9qkhkwv9ppwz0f7c3amw" */ export type Cip14Fingerprint = string; export type AssetUtxosRequest = { - range: { minSlot: number; maxSlot: number }, - fingerprints?: Cip14Fingerprint[], - policyIds?: string[] + range: { minSlot: number; maxSlot: number }; + fingerprints?: Cip14Fingerprint[]; + policyIds?: PolicyId[]; }; export type AssetUtxosResponse = { - - /** - * If the utxo is created, this has the amount. It's undefined if the utxo - * is spent. - * - * @example '1031423725351' - */ - amount: string | undefined, - utxo: { - tx: string, - index: number, - }, - cip14Fingerprint: string, - policyId: string, - assetName: string, - paymentCred: string, - slot: number - txId: string, + /** + * If the utxo is created, this has the amount. It's undefined if the utxo + * is spent. + * + * @example '1031423725351' + */ + amount: string | undefined; + utxo: { + tx: string; + index: number; + }; + cip14Fingerprint: string; + policyId: string; + assetName: AssetName; + paymentCred: string; + slot: number; + txId: string; }[];