diff --git a/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.6-900b59ba71-096f73aea1.zip b/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.24-88bebce6dc-bb39376e42.zip similarity index 58% rename from .yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.6-900b59ba71-096f73aea1.zip rename to .yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.24-88bebce6dc-bb39376e42.zip index 9d3a9dd0..a7edcd13 100644 Binary files a/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.6-900b59ba71-096f73aea1.zip and b/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.24-88bebce6dc-bb39376e42.zip differ diff --git a/package.json b/package.json index c33ab8f7..f7c2b97a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "dependencies": { "@blockfrost/blockfrost-js": "5.4.0", "@blockfrost/blockfrost-utils": "2.8.0", - "@blockfrost/openapi": "0.1.61-beta.6", + "@blockfrost/openapi": "0.1.61-beta.24", "@emurgo/cardano-serialization-lib-nodejs": "11.5.0", "@emurgo/cip14-js": "^3.0.1", "@fastify/cors": "^8.3.0", diff --git a/src/routes/txs/hash/required-signers.ts b/src/routes/txs/hash/required-signers.ts index fb88d666..1b9da4ee 100644 --- a/src/routes/txs/hash/required-signers.ts +++ b/src/routes/txs/hash/required-signers.ts @@ -4,6 +4,7 @@ import { toJSONStream } from '../../../utils/string-utils.js'; import { FastifyInstance, FastifyRequest } from 'fastify'; import { SQLQuery } from '../../../sql/index.js'; import * as QueryTypes from '../../../types/queries/tx.js'; +import * as ResponseTypes from '../../../types/responses/tx.js'; import { getDbSync } from '../../../utils/database.js'; async function route(fastify: FastifyInstance) { @@ -15,10 +16,10 @@ async function route(fastify: FastifyInstance) { const clientDbSync = await getDbSync(fastify); try { - const { rows } = await clientDbSync.query( - SQLQuery.get('txs_hash_wits'), - [request.params.hash], - ); + const { rows }: { rows: ResponseTypes.TxWitnesses } = + await clientDbSync.query(SQLQuery.get('txs_hash_wits'), [ + request.params.hash, + ]); clientDbSync.release(); @@ -26,18 +27,16 @@ async function route(fastify: FastifyInstance) { return reply.send([]); } - const list = rows.map(row => row.hash); - const unpaged = isUnpaged(request); if (unpaged) { // Use of Reply.raw functions is at your own risk as you are skipping all the Fastify logic of handling the HTTP response // https://www.fastify.io/docs/latest/Reference/Reply/#raw reply.raw.writeHead(200, { 'Content-Type': 'application/json' }); - await toJSONStream(list, reply.raw); + await toJSONStream(rows, reply.raw); return reply; } else { - return reply.send(list); + return reply.send(rows); } } catch (error) { if (clientDbSync) { diff --git a/src/sql/txs/txs_hash_wits.sql b/src/sql/txs/txs_hash_wits.sql index ff43821a..ce306d1a 100644 --- a/src/sql/txs/txs_hash_wits.sql +++ b/src/sql/txs/txs_hash_wits.sql @@ -1,4 +1,4 @@ -SELECT encode(wit.hash, 'hex') AS "hash" +SELECT encode(wit.hash, 'hex') AS "witness_hash" FROM tx JOIN extra_key_witness wit ON (wit.tx_id = tx.id) WHERE encode(tx.hash, 'hex') = $1 diff --git a/src/types/queries/tx.ts b/src/types/queries/tx.ts index 5194c7f6..dd6668ac 100644 --- a/src/types/queries/tx.ts +++ b/src/types/queries/tx.ts @@ -155,6 +155,6 @@ export interface TxRedeemers { redeemer_data_hash: string; } -export interface TxWits { - hash: string; +export interface TxWitnesses { + witness_hash: string; } diff --git a/src/types/responses/tx.ts b/src/types/responses/tx.ts index 2fdc2251..90a1a8d4 100644 --- a/src/types/responses/tx.ts +++ b/src/types/responses/tx.ts @@ -13,3 +13,4 @@ export type Relay = OpenApiResponseTypes['pool_relays']; export type TxRedeemers = OpenApiResponseTypes['tx_content_redeemers']; export type TxMetadataCbor = OpenApiResponseTypes['tx_content_metadata_cbor']; export type TxMetadata = OpenApiResponseTypes['tx_content_metadata']; +export type TxWitnesses = OpenApiResponseTypes['tx_content_required_signers']; diff --git a/yarn-project.nix b/yarn-project.nix index d1b879a6..2c69f4d3 100644 --- a/yarn-project.nix +++ b/yarn-project.nix @@ -1085,7 +1085,7 @@ cacheEntries = { "word-wrap@npm:1.2.3" = { filename = "word-wrap-npm-1.2.3-7fb15ab002-30b48f91fc.zip"; sha512 = "30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f"; }; "type-check@npm:0.3.2" = { filename = "type-check-npm-0.3.2-a4a38bb0b6-dd3b149564.zip"; sha512 = "dd3b1495642731bc0e1fc40abe5e977e0263005551ac83342ecb6f4f89551d106b368ec32ad3fb2da19b3bd7b2d1f64330da2ea9176d8ddbfe389fb286eb5124"; }; "levn@npm:0.3.0" = { filename = "levn-npm-0.3.0-48d774b1c2-0d084a5242.zip"; sha512 = "0d084a524231a8246bb10fec48cdbb35282099f6954838604f3c7fc66f2e16fa66fd9cc2f3f20a541a113c4dafdf181e822c887c8a319c9195444e6c64ac395e"; }; -"@blockfrost/openapi@npm:0.1.61-beta.6" = { filename = "@blockfrost-openapi-npm-0.1.61-beta.6-900b59ba71-096f73aea1.zip"; sha512 = "096f73aea158e6b466c61195372188ba19e3d68f6b711c216dcf1ef5bfed08297c99ca9a3bd6021cfce2de892b57c44bc42a6da7c226ea4205e1629e60820196"; }; +"@blockfrost/openapi@npm:0.1.61-beta.24" = { filename = "@blockfrost-openapi-npm-0.1.61-beta.24-88bebce6dc-bb39376e42.zip"; sha512 = "bb39376e420298d8d50d58b142336799e9e49d151cc5f9a43bada255d496c0bcc11bae3b6143b6be66466a7aaee55b63eb02dfa8e1e38a3a2aeeecb92fe2308d"; }; "yaml@npm:2.3.4" = { filename = "yaml-npm-2.3.4-8bb6dc2c0d-e6d1dae1c6.zip"; sha512 = "e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8"; }; "cbor@npm:9.0.1" = { filename = "cbor-npm-9.0.1-3a5a6b7751-42333ac3d4.zip"; sha512 = "42333ac3d42cc3f6fcc7a529e68417a2dd8099eda43ca4be1304cdc5bc7494efe058e2db8a3d3b46ae60d69c7331ea813c22dbd019c4ac592d23e599d72bbcc9"; }; }; diff --git a/yarn.lock b/yarn.lock index bdba6efd..ec0faf39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -136,14 +136,14 @@ __metadata: languageName: node linkType: hard -"@blockfrost/openapi@npm:0.1.61-beta.6": - version: 0.1.61-beta.6 - resolution: "@blockfrost/openapi@npm:0.1.61-beta.6" +"@blockfrost/openapi@npm:0.1.61-beta.24": + version: 0.1.61-beta.24 + resolution: "@blockfrost/openapi@npm:0.1.61-beta.24" dependencies: ajv: ^8.12.0 cbor: ^9.0.1 yaml: ^2.3.4 - checksum: 096f73aea158e6b466c61195372188ba19e3d68f6b711c216dcf1ef5bfed08297c99ca9a3bd6021cfce2de892b57c44bc42a6da7c226ea4205e1629e60820196 + checksum: bb39376e420298d8d50d58b142336799e9e49d151cc5f9a43bada255d496c0bcc11bae3b6143b6be66466a7aaee55b63eb02dfa8e1e38a3a2aeeecb92fe2308d languageName: node linkType: hard @@ -1956,7 +1956,7 @@ __metadata: "@blockfrost/blockfrost-js": 5.4.0 "@blockfrost/blockfrost-tests": 1.10.0 "@blockfrost/blockfrost-utils": 2.8.0 - "@blockfrost/openapi": 0.1.61-beta.6 + "@blockfrost/openapi": 0.1.61-beta.24 "@emurgo/cardano-serialization-lib-nodejs": 11.5.0 "@emurgo/cip14-js": ^3.0.1 "@esbuild/darwin-x64": "npm:0.16.17"