From 14b1501f5c8bdf505c0fdf6cb28eb2439c2acc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Prohaszka?= Date: Mon, 13 May 2024 15:14:59 +0200 Subject: [PATCH] chore: feedbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Prohaszka --- .../src/bridge/estimateMaxSpendable.ts | 4 +++- .../coin-tezos/src/types/signer.ts | 18 +++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/libs/coin-modules/coin-tezos/src/bridge/estimateMaxSpendable.ts b/libs/coin-modules/coin-tezos/src/bridge/estimateMaxSpendable.ts index 379a655f4e1f..c8f91f8d2bcb 100644 --- a/libs/coin-modules/coin-tezos/src/bridge/estimateMaxSpendable.ts +++ b/libs/coin-modules/coin-tezos/src/bridge/estimateMaxSpendable.ts @@ -6,6 +6,8 @@ import prepareTransaction from "./prepareTransaction"; import createTransaction from "./createTransaction"; import { getTransactionStatus } from "./transactionStatus"; +const TEZOS_BURN_ADDRESS = "tz1burnburnburnburnburnburnburjAYjjX"; + const estimateMaxSpendable = async ({ account, parentAccount, @@ -20,7 +22,7 @@ const estimateMaxSpendable = async ({ ...createTransaction(), ...transaction, // estimate using a burn address that exists so we don't enter into NotEnoughBalanceBecauseDestinationNotCreated - recipient: transaction?.recipient || "tz1burnburnburnburnburnburnburjAYjjX", + recipient: transaction?.recipient || TEZOS_BURN_ADDRESS, useAllAmount: true, }); const s = await getTransactionStatus(mainAccount, t); diff --git a/libs/coin-modules/coin-tezos/src/types/signer.ts b/libs/coin-modules/coin-tezos/src/types/signer.ts index 720a30ab349f..cced3a09033a 100644 --- a/libs/coin-modules/coin-tezos/src/types/signer.ts +++ b/libs/coin-modules/coin-tezos/src/types/signer.ts @@ -6,12 +6,12 @@ export type TezosSignature = { signature: string; }; // Type coming from hw-app-tezos -export const TezosCurves = { - ED25519: 0x00, - SECP256K1: 0x01, - SECP256R1: 0x02, +type TezosCurves = { + ED25519: 0x00; + SECP256K1: 0x01; + SECP256R1: 0x02; }; -export type Curve = (typeof TezosCurves)[keyof typeof TezosCurves]; +export type Curve = TezosCurves[keyof TezosCurves]; export type LedgerSigner = { publicKey(): Promise; @@ -46,11 +46,3 @@ export interface TezosSigner { // Tezos [LedgerSigner](https://www.npmjs.com/package/@taquito/ledger-signer) createLedgerSigner(path: string, prompt: boolean, derivationType: number): LedgerSigner; } - -// export type SignerContext = ( -// deviceId: string, -// path: string, -// prompt: boolean, -// derivationType: number, -// fn: (signer: TezosSigner) => Promise, -// ) => Promise;