@coinmeca/wallet-sdk
Version:
164 lines • 4.44 kB
TypeScript
import { AccessListEIP2930Transaction, AccessListEIP2930TxData, BlobEIP4844Transaction, BlobEIP4844TxData, EOACodeEIP7702Transaction, EOACodeEIP7702TxData, FeeMarketEIP1559Transaction, FeeMarketEIP1559TxData, LegacyTransaction, LegacyTxData } from "@ethereumjs/tx";
export { Address } from "@ethereumjs/util";
export type ChainBase = "evm" | "svm";
export type ChainType = "mainnet" | "mainnet-beta" | "testnet" | "devnet";
export interface Chain {
base?: ChainBase;
type?: ChainType;
logo?: string;
chainId: number | string;
chainName?: string;
nativeCurrency: NativeCurrency;
rpcUrls: string[];
blockExplorerUrls?: string[];
iconUrls?: string[];
}
export interface Chains {
[key: string]: {
mainnet?: Chain;
testnet?: {
[key: string]: Chain | undefined;
};
devnet?: {
[key: string]: Chain | undefined;
};
};
}
export interface RequestParams {
method: string;
params?: any[];
}
export type Transaction = LegacyTransaction | AccessListEIP2930Transaction | FeeMarketEIP1559Transaction | BlobEIP4844Transaction | EOACodeEIP7702Transaction;
export type TxData = LegacyTxData | AccessListEIP2930TxData | FeeMarketEIP1559TxData | BlobEIP4844TxData | EOACodeEIP7702TxData;
export interface TransactionParams {
from: string;
to: string;
value: string;
gas?: string;
gasPrice?: string;
data?: string;
nonce?: string;
chainId?: number;
maxFeePerGas?: string;
maxPriorityFeePerGas?: string;
type?: string;
accessList?: Array<{
address: string;
storageKeys: string[];
}>;
tokenAddress?: string;
tokenAmount?: string;
tokenData?: string;
validUntil?: string;
replayProtection?: boolean;
chainReference?: string;
signature?: string;
}
export interface EIP712Domain {
name?: string;
version?: string;
chainId?: number;
verifyingContract?: string;
salt?: string;
}
export interface EIP712Property {
name: string;
type: string;
}
export interface EIP712Types {
EIP712Domain: EIP712Property[];
[key: string]: EIP712Property[];
}
export type MessageTypes = {
EIP712Domain: EIP712Property[];
[additionalProperties: string]: EIP712Property[];
};
export interface EIP712Message<T = any> {
types: EIP712Types;
domain: EIP712Domain;
primaryType: string;
message: T;
}
export interface NativeCurrency {
name: string;
symbol: string;
decimals: number;
}
export type ERC20Options = {
address: string;
symbol?: string;
decimals?: number;
image?: string;
};
export type ERC721Options = {
address: string;
symbol?: string;
image?: string;
tokenId?: string;
};
export type ERC1155Options = {
address: string;
symbol?: string;
decimals?: number;
image?: string;
tokenId?: string;
};
export interface NativeCurrency {
name: string;
symbol: string;
decimals: number;
}
export interface App {
name?: string;
url?: string;
logo?: string;
accounts?: string[];
}
export type AssetOptions<Name> = Name extends "ERC20" ? ERC20Options : Name extends "ERC721" ? ERC721Options : Name extends "ERC1155" ? ERC1155Options : never;
export interface Asset<Name extends "ERC20" | "ERC721" | "ERC1155"> {
type: Name;
options: AssetOptions<Name>;
}
export interface Tokens {
fungibles?: {
[chainId: number | string]: string[] | undefined;
};
nonFungibles?: {
[chainId: number | string]: {
[address: string]: string[];
}[] | undefined;
};
multiTokens?: {
[chainId: number | string]: string[] | undefined;
};
}
export interface TransactionReceipt {
hash: string;
status: "pending" | "success" | "failure";
time?: number | string;
to?: string;
from?: string;
category?: string;
isContract?: boolean;
blockNumber?: string | number;
gasUsed?: string | number;
cumulativeGasUsed?: string | number;
contractAddress?: string;
no?: number;
}
export interface Transactions {
[chainId: number | string]: TransactionReceipt[] | undefined;
}
export interface Account {
name: string;
address: string;
index: number;
balance?: number;
tokens?: Tokens;
disable: boolean;
tx?: Transactions;
}
export interface Contact {
[x: string]: Account[];
}
//# sourceMappingURL=types.d.ts.map