Contractless-Web3-Wallets/extension/src/types.ts

49 lines
1.0 KiB
TypeScript
Raw Normal View History

export type ContractlessNetwork = "testnet" | "mainnet";
export type StoredSettings = {
selectedNetwork: ContractlessNetwork;
testnetApiUrl: string;
mainnetApiUrl: string;
apiUrl: string;
autoLockMinutes: number;
};
export type WalletStatus = {
exists: boolean;
unlocked: boolean;
activeWalletId?: string;
activeWalletLabel?: string;
address?: string;
publicKey?: string;
wallets: WalletSummary[];
selectedNetwork: ContractlessNetwork;
networkName: "Testnet" | "Mainnet";
networkSymbol: "CLTC" | "CLC";
testnetApiUrl: string;
mainnetApiUrl: string;
apiUrl: string;
autoLockMinutes: number;
};
export type WalletSummary = {
id: string;
label: string;
address: string;
publicKey: string;
network: ContractlessNetwork;
active: boolean;
};
export type ProviderRequest = {
id: string;
method: string;
params?: unknown;
origin: string;
};
export type ApprovalRecord = ProviderRequest & {
createdAt: number;
risk: "safe" | "low" | "high";
display?: Record<string, unknown>;
};