2024-07-25 07:30:03 +00:00
|
|
|
import { PopulatedTransaction } from 'ethers';
|
|
|
|
|
2024-07-26 04:58:57 +00:00
|
|
|
import { SignClientTypes, SessionTypes } from '@walletconnect/types';
|
2024-07-29 12:09:22 +00:00
|
|
|
import { IWeb3Wallet, Web3WalletTypes } from '@walletconnect/web3wallet';
|
2024-07-25 07:30:03 +00:00
|
|
|
import { EncodeObject } from '@cosmjs/proto-signing';
|
|
|
|
|
|
|
|
export type StackParamsList = {
|
2024-07-29 11:26:10 +00:00
|
|
|
Home: undefined;
|
2024-07-25 07:30:03 +00:00
|
|
|
SignMessage: {
|
|
|
|
selectedNamespace: string;
|
|
|
|
selectedChainId: string;
|
|
|
|
accountInfo: Account;
|
|
|
|
};
|
|
|
|
SignRequest: {
|
|
|
|
namespace: string;
|
|
|
|
address: string;
|
|
|
|
message: string;
|
2024-07-26 04:58:57 +00:00
|
|
|
requestEvent?: Web3WalletTypes.SessionRequest;
|
|
|
|
requestSessionData?: SessionTypes.Struct;
|
2024-07-25 07:30:03 +00:00
|
|
|
};
|
|
|
|
ApproveTransfer: {
|
|
|
|
transaction: PopulatedTransaction;
|
2024-07-26 04:58:57 +00:00
|
|
|
requestEvent: Web3WalletTypes.SessionRequest;
|
|
|
|
requestSessionData: SessionTypes.Struct;
|
2024-07-25 07:30:03 +00:00
|
|
|
};
|
|
|
|
InvalidPath: undefined;
|
|
|
|
WalletConnect: undefined;
|
|
|
|
AddSession: undefined;
|
|
|
|
AddNetwork: undefined;
|
|
|
|
EditNetwork: {
|
|
|
|
selectedNetwork: NetworksDataState;
|
|
|
|
};
|
|
|
|
ApproveTransaction: {
|
|
|
|
transactionMessage: EncodeObject;
|
|
|
|
signer: string;
|
2024-07-26 04:58:57 +00:00
|
|
|
requestEvent: Web3WalletTypes.SessionRequest;
|
|
|
|
requestSessionData: SessionTypes.Struct;
|
2024-07-25 07:30:03 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Account = {
|
|
|
|
index: number;
|
|
|
|
pubKey: string;
|
|
|
|
address: string;
|
|
|
|
hdPath: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type NetworkDropdownProps = {
|
|
|
|
updateNetwork: (networksData: NetworksDataState) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type NetworksFormData = {
|
|
|
|
networkName: string;
|
|
|
|
rpcUrl: string;
|
|
|
|
chainId: string;
|
|
|
|
currencySymbol?: string;
|
|
|
|
blockExplorerUrl?: string;
|
|
|
|
namespace: string;
|
|
|
|
nativeDenom?: string;
|
|
|
|
addressPrefix?: string;
|
|
|
|
coinType?: string;
|
|
|
|
gasPrice?: string;
|
|
|
|
isDefault: boolean;
|
|
|
|
};
|
|
|
|
|
|
|
|
export interface NetworksDataState extends NetworksFormData {
|
|
|
|
networkId: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type SignMessageParams = {
|
|
|
|
message: string;
|
|
|
|
namespace: string;
|
|
|
|
chainId: string;
|
|
|
|
accountId: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type CreateWalletProps = {
|
|
|
|
isWalletCreating: boolean;
|
|
|
|
createWalletHandler: () => Promise<void>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type ResetDialogProps = {
|
|
|
|
title: string;
|
|
|
|
visible: boolean;
|
|
|
|
hideDialog: () => void;
|
|
|
|
onConfirm: () => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type HDPathDialogProps = {
|
|
|
|
pathCode: string;
|
|
|
|
visible: boolean;
|
|
|
|
hideDialog: () => void;
|
|
|
|
updateAccounts: (account: Account) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type CustomDialogProps = {
|
|
|
|
visible: boolean;
|
|
|
|
hideDialog: () => void;
|
|
|
|
contentText: string;
|
|
|
|
titleText?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type GridViewProps = {
|
|
|
|
words: string[];
|
|
|
|
};
|
|
|
|
|
|
|
|
export type PathState = {
|
|
|
|
firstNumber: string;
|
|
|
|
secondNumber: string;
|
|
|
|
thirdNumber: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export interface PairingModalProps {
|
|
|
|
visible: boolean;
|
|
|
|
setModalVisible: (arg1: boolean) => void;
|
|
|
|
currentProposal:
|
2024-07-26 04:58:57 +00:00
|
|
|
| SignClientTypes.EventArguments['session_proposal']
|
2024-07-25 07:30:03 +00:00
|
|
|
| undefined;
|
|
|
|
setCurrentProposal: (
|
2024-07-26 04:58:57 +00:00
|
|
|
arg1:
|
|
|
|
| SignClientTypes.EventArguments['session_proposal']
|
2024-07-25 07:30:03 +00:00
|
|
|
| undefined,
|
|
|
|
) => void;
|
|
|
|
setToastVisible: (arg1: boolean) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface WalletConnectContextProps {
|
2024-07-26 04:58:57 +00:00
|
|
|
activeSessions: Record<string, SessionTypes.Struct>;
|
2024-07-25 07:30:03 +00:00
|
|
|
setActiveSessions: (
|
2024-07-26 04:58:57 +00:00
|
|
|
activeSessions: Record<string, SessionTypes.Struct>,
|
2024-07-25 07:30:03 +00:00
|
|
|
) => void;
|
2024-07-29 12:09:22 +00:00
|
|
|
web3wallet: IWeb3Wallet | undefined;
|
|
|
|
setWeb3wallet: React.Dispatch<React.SetStateAction<IWeb3Wallet | undefined>>;
|
2024-07-25 07:30:03 +00:00
|
|
|
}
|