From 2b416a65ba09da21678ea27f15c6cfade63f4e11 Mon Sep 17 00:00:00 2001 From: emmanuelm41 Date: Thu, 16 Jan 2025 16:38:21 -0300 Subject: [PATCH] tmp --- src/consts.ts | 1 + src/index.ts | 3 +++ src/types.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/src/consts.ts b/src/consts.ts index 0cbce3e..6998d39 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -51,6 +51,7 @@ export const P2_VALUES = { } export const DEPTH_LEN = 1 +export const VERSION_LEN = 4 export const INDEX_LEN = 4 export const TRANSPARENT_PK_LEN = 33 export const CHAIN_CODE_LEN = 32 diff --git a/src/index.ts b/src/index.ts index 3f632b7..ae2129d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,6 +34,7 @@ import { SAPLING_NK_LEN, SAPLING_OVK_LEN, TRANSPARENT_PK_LEN, + VERSION_LEN, } from './consts' import { AddressResponse, @@ -104,6 +105,7 @@ export default class ZCashApp extends GenericApp { const responseBuffer = await this.transport.send(CLA, INS.GET_ADDR_SECP256K1_EXT, p1, 0, sentToDevice) const response = processResponse(responseBuffer) + const version = response.readBytes(VERSION_LEN).readUint32LE() const depth = response.readBytes(DEPTH_LEN).readUInt8() const index = response.readBytes(INDEX_LEN).readUint32LE() const publicKey = response.readBytes(TRANSPARENT_PK_LEN) @@ -114,6 +116,7 @@ export default class ZCashApp extends GenericApp { chainCode, depth, index, + version, } } catch (error) { throw processErrorResponse(error) diff --git a/src/types.ts b/src/types.ts index 27a4245..56b7e67 100644 --- a/src/types.ts +++ b/src/types.ts @@ -22,6 +22,7 @@ export type AddressResponse = { export type AddressExtendedResponse = { chainCode: Buffer publicKey: Buffer + version: number index: number depth: number }