@accret/api-client
Version:
A comprehensive SDK for blockchain data access via Moralis, Alchemy, and Shyft APIs
144 lines • 4.08 kB
TypeScript
import type { GetWalletHistoryOperationResponse, GetWalletHistoryOperationResponseJSON } from "moralis/common-evm-utils";
import type { PaginatedResponseV3Adapter } from "@moralisweb3/api-utils";
import type { AccretSupportedChain } from "../types";
export interface EVMTransactionHistoryType {
address: string;
network: AccretSupportedChain;
history: PaginatedResponseV3Adapter<GetWalletHistoryOperationResponse, GetWalletHistoryOperationResponseJSON>;
}
export type EVMTransactionHistoryResponse = {
eth: EVMTransactionHistoryType[];
bnb: EVMTransactionHistoryType[];
polygon: EVMTransactionHistoryType[];
base: EVMTransactionHistoryType[];
arbitrum: EVMTransactionHistoryType[];
avalanche: EVMTransactionHistoryType[];
};
export type TransactionHistoryResponseAdapter = {
eth: EVMTransactionHistoryResponse["eth"];
bnb: EVMTransactionHistoryResponse["bnb"];
polygon: EVMTransactionHistoryResponse["polygon"];
base: EVMTransactionHistoryResponse["base"];
arbitrum: EVMTransactionHistoryResponse["arbitrum"];
avalanche: EVMTransactionHistoryResponse["avalanche"];
solana: (SolanaTransactionHistory[] | null)[];
};
export interface SolanaTransactionHistory {
description: string;
type: string;
source: string;
fee: number;
feePayer: string;
signature: string;
slot: number;
timestamp: number;
tokenTransfers: TokenTransferElement[];
nativeTransfers: NativeTransfer[];
accountData: AccountDatum[];
transactionError: null;
instructions: Instruction[];
events: Events;
}
export interface TokenTransferElement {
fromTokenAccount: string;
toTokenAccount: string;
fromUserAccount: string;
toUserAccount: string;
tokenAmount: number;
mint: string;
tokenStandard: string;
}
export interface NativeTransfer {
fromUserAccount: string;
toUserAccount: string;
amount: number;
}
export interface AccountDatum {
account: string;
nativeBalanceChange: number;
tokenBalanceChanges: TokenBalanceChangeElement[];
}
export interface TokenBalanceChangeElement {
userAccount: string;
tokenAccount: string;
rawTokenAmount: RawTokenAmount;
mint: string;
}
export interface RawTokenAmount {
tokenAmount: string;
decimals: number;
}
export interface Instruction {
accounts: string[];
data: string;
programId: string;
innerInstructions?: Instruction[];
}
export interface Events {
swap?: Swap;
compressed?: Compressed[];
}
export interface Compressed {
type: string;
treeId: string;
leafIndex: number;
seq: number;
assetId: string;
instructionIndex: number;
innerInstructionIndex: null;
newLeafOwner: string;
oldLeafOwner: null;
newLeafDelegate: string;
oldLeafDelegate: null;
treeDelegate: string;
metadata: Metadata;
updateArgs: null;
}
export interface Metadata {
name: string;
symbol: string;
uri: string;
sellerFeeBasisPoints: number;
primarySaleHappened: boolean;
isMutable: boolean;
tokenStandard: string;
collection: Collection;
tokenProgramVersion: string;
creators: Creator[];
}
export interface Collection {
key: string;
verified: boolean;
}
export interface Creator {
address: string;
verified: boolean;
share: number;
}
export interface Swap {
nativeInput: Native | null;
nativeOutput: Native | null;
tokenInputs: TokenBalanceChangeElement[];
tokenOutputs: TokenBalanceChangeElement[];
nativeFees: Native[];
tokenFees: TokenBalanceChangeElement[];
innerSwaps: InnerSwap[];
}
export interface InnerSwap {
tokenInputs: TokenTransferElement[];
tokenOutputs: TokenTransferElement[];
tokenFees: TokenTransferElement[];
nativeFees: Native[];
programInfo: ProgramInfo;
}
export interface ProgramInfo {
source: string;
account: string;
programName: string;
instructionName: string;
}
export interface Native {
account: string;
amount: string;
}
//# sourceMappingURL=transaction-history.d.ts.map