From 4a7956c3086ae2f585ba3a09db3f8a612a3b9522 Mon Sep 17 00:00:00 2001 From: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com> Date: Mon, 4 Oct 2021 23:45:14 +0800 Subject: [PATCH] add vout.script.hex for transaction.vin.ts (#437) --- package-lock.json | 8 ++++++-- packages/whale-api-client/src/api/transactions.ts | 3 +++ src/module.indexer/model/transaction.vin.ts | 7 +++++-- src/module.model/transaction.vin.ts | 3 +++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1829543b2..3910e4d65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16194,7 +16194,9 @@ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.0.tgz", "integrity": "sha512-USH2jBb+C/hIpwD2iRjp0pe0k+MvzG0mlSn/FIdCgQhUb9ALPRjt2KIQdfZDS9r0ZIeUAg7gOu9KL0PFqGqr5Q==", "dev": true, - "requires": {} + "requires": { + "ajv": "^8.0.0" + } }, "json-schema-traverse": { "version": "1.0.0", @@ -18333,7 +18335,9 @@ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.0.2.tgz", "integrity": "sha512-Brah4Uo5/U8v76c6euTwtjVFFaVishwnJrQBYpev1JRh4vjA1F4HY3UzQez41YUCszUCXKagG8v6eVRBHV1gkw==", "dev": true, - "requires": {} + "requires": { + "ajv": "^8.0.0" + } }, "fs-extra": { "version": "10.0.0", diff --git a/packages/whale-api-client/src/api/transactions.ts b/packages/whale-api-client/src/api/transactions.ts index d497cd221..b447edec2 100644 --- a/packages/whale-api-client/src/api/transactions.ts +++ b/packages/whale-api-client/src/api/transactions.ts @@ -76,6 +76,9 @@ export interface TransactionVin { n: number value: string tokenId?: number + script: { + hex: string + } } script?: { hex: string diff --git a/src/module.indexer/model/transaction.vin.ts b/src/module.indexer/model/transaction.vin.ts index 423a3434e..1515ac785 100644 --- a/src/module.indexer/model/transaction.vin.ts +++ b/src/module.indexer/model/transaction.vin.ts @@ -1,5 +1,5 @@ import { Injectable } from '@nestjs/common' -import { Indexer, defid, RawBlock } from '@src/module.indexer/model/_abstract' +import { defid, Indexer, RawBlock } from '@src/module.indexer/model/_abstract' import { TransactionVin, TransactionVinMapper } from '@src/module.model/transaction.vin' import { TransactionVout } from '@src/module.model/transaction.vout' import { HexEncoder } from '@src/module.model/_hex.encoder' @@ -49,7 +49,10 @@ export class TransactionVinIndexer extends Indexer { txid: vout.txid, n: vout.n, value: vout.value, - tokenId: vout.tokenId + tokenId: vout.tokenId, + script: { + hex: vout.script.hex + } } : undefined, script: vin.scriptSig !== undefined ? { hex: vin.scriptSig.hex diff --git a/src/module.model/transaction.vin.ts b/src/module.model/transaction.vin.ts index 2ff17bbbd..05fa0763b 100644 --- a/src/module.model/transaction.vin.ts +++ b/src/module.model/transaction.vin.ts @@ -60,6 +60,9 @@ export interface TransactionVin extends Model { n: number value: string tokenId?: number + script: { + hex: string + } } script?: {