From f588fa36a7487233f9dad368009794a7f583fbe9 Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Tue, 14 Jan 2025 11:50:06 +0100 Subject: [PATCH] Revert "chore(suite): remove unused types in token" This reverts commit efed0f9922eb0dd5951a631aba0853fa88c153d3. --- packages/blockchain-link-types/src/blockbook-api.ts | 2 ++ packages/blockchain-link-types/src/blockbook.ts | 4 +++- packages/blockchain-link-types/src/common.ts | 8 ++++++-- packages/blockchain-link-utils/src/blockbook.ts | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/blockchain-link-types/src/blockbook-api.ts b/packages/blockchain-link-types/src/blockbook-api.ts index 28b4b4f591f..51c6db037a5 100644 --- a/packages/blockchain-link-types/src/blockbook-api.ts +++ b/packages/blockchain-link-types/src/blockbook-api.ts @@ -146,6 +146,8 @@ export interface Token { secondaryValue?: number; ids?: string[]; multiTokenValues?: MultiTokenValue[]; + totalReceived?: string; + totalSent?: string; } export interface Address { page?: number; diff --git a/packages/blockchain-link-types/src/blockbook.ts b/packages/blockchain-link-types/src/blockbook.ts index 2919d5062bd..7c38fd46cde 100644 --- a/packages/blockchain-link-types/src/blockbook.ts +++ b/packages/blockchain-link-types/src/blockbook.ts @@ -69,7 +69,9 @@ type BlockFiltersBatch = `${string}:${string}:${string}`[]; // XPUBAddress, ERC20, ERC721, ERC1155 - blockbook generated type (Token) is not strict enough export type XPUBAddress = { type: 'XPUBAddress'; -} & Required> & +} & Required< + Pick +> & Pick; type BaseERC = Required> & diff --git a/packages/blockchain-link-types/src/common.ts b/packages/blockchain-link-types/src/common.ts index 0ce0c0dac17..843b6a1d61f 100644 --- a/packages/blockchain-link-types/src/common.ts +++ b/packages/blockchain-link-types/src/common.ts @@ -5,8 +5,8 @@ import type { AddressAlias, TokenTransfer as BlockbookTokenTransfer, ContractInfo, + MultiTokenValue, StakingPool, - Token, } from './blockbook-api'; import type { SolanaStakingAccount } from './solana'; @@ -200,7 +200,7 @@ export interface TokenAccount { balance: string; } -export interface TokenInfo extends Partial> { +export interface TokenInfo { type: string; // token type: ERC20... contract: string; // token address, token unit for ADA balance?: string; // token balance @@ -210,6 +210,10 @@ export interface TokenInfo extends Partial