Skip to content

Commit

Permalink
update openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Dec 28, 2023
1 parent 5075746 commit e06b9b4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 37 deletions.
47 changes: 31 additions & 16 deletions docs/bin/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@
],
"type": "object"
},
"AssetName": {
"type": "string",
"example": "42657272794e617679",
"pattern": "[0-9a-fA-F]{0,64}"
},
"AssetUtxosResponse": {
"items": {
"properties": {
Expand All @@ -159,6 +164,15 @@
"paymentCred": {
"type": "string"
},
"assetName": {
"$ref": "#/components/schemas/AssetName"
},
"policyId": {
"type": "string"
},
"cip14Fingerprint": {
"type": "string"
},
"utxo": {
"properties": {
"index": {
Expand All @@ -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"
Expand All @@ -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"
},
Expand All @@ -223,7 +249,6 @@
}
},
"required": [
"assets",
"range"
],
"type": "object"
Expand Down Expand Up @@ -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": {
Expand Down
43 changes: 22 additions & 21 deletions webserver/shared/models/AssetUtxos.ts
Original file line number Diff line number Diff line change
@@ -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;
}[];

0 comments on commit e06b9b4

Please sign in to comment.