Skip to content

Commit

Permalink
Revert "chore(suite): remove unused types in token"
Browse files Browse the repository at this point in the history
This reverts commit efed0f9.
  • Loading branch information
peter-sanderson committed Jan 14, 2025
1 parent 97ea53c commit f588fa3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/blockchain-link-types/src/blockbook-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export interface Token {
secondaryValue?: number;
ids?: string[];
multiTokenValues?: MultiTokenValue[];
totalReceived?: string;
totalSent?: string;
}
export interface Address {
page?: number;
Expand Down
4 changes: 3 additions & 1 deletion packages/blockchain-link-types/src/blockbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Pick<BlockbookToken, 'path' | 'decimals' | 'balance'>> &
} & Required<
Pick<BlockbookToken, 'path' | 'decimals' | 'balance' | 'totalSent' | 'totalReceived'>
> &
Pick<BlockbookToken, 'name' | 'transfers'>;

type BaseERC = Required<Pick<BlockbookToken, 'contract'>> &
Expand Down
8 changes: 6 additions & 2 deletions packages/blockchain-link-types/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type {
AddressAlias,
TokenTransfer as BlockbookTokenTransfer,
ContractInfo,
MultiTokenValue,
StakingPool,
Token,
} from './blockbook-api';
import type { SolanaStakingAccount } from './solana';

Expand Down Expand Up @@ -200,7 +200,7 @@ export interface TokenAccount {
balance: string;
}

export interface TokenInfo extends Partial<Pick<Token, 'multiTokenValues' | 'ids'>> {
export interface TokenInfo {
type: string; // token type: ERC20...
contract: string; // token address, token unit for ADA
balance?: string; // token balance
Expand All @@ -210,6 +210,10 @@ export interface TokenInfo extends Partial<Pick<Token, 'multiTokenValues' | 'ids
accounts?: TokenAccount[]; // token accounts for solana
policyId?: string; // Cardano policy id
fingerprint?: string; // Cardano starting with "asset"
multiTokenValues?: MultiTokenValue[];
ids?: string[];
totalReceived?: string;
totalSent?: string;
// transfers: number, // total transactions?
}

Expand Down
2 changes: 2 additions & 0 deletions packages/blockchain-link-utils/src/blockbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ export const transformAddresses = (
path: t.path,
transfers: t.transfers,
balance: t.balance,
sent: t.totalSent,
received: t.totalReceived,
},
]);
}, [] as Address[]);
Expand Down

0 comments on commit f588fa3

Please sign in to comment.