laconic-wallet/types.ts
Adwait Gharpure 7db0edce75
Allow incoming signature requests from intents (#32)
* Add url scheme and linking

* Pass account to sign request page

* Provide functionality for accepting or rejecting requests

* Load account state before handling url

* Refactor code

* Make intent work when app is cleared from recents

* Fix bug to populate data from intents

* Fix bug to update data on subsequent requests

* Pass correct network to sign messages from cosmos account

* Fix bug to populate data for incoming intent

* Allow spaces in url

* Bad signature page

* Review changes

* Change page heading

* Use correct regex

* Clean up code

* Use https in url

* Set state properly

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-02-28 19:37:26 +05:30

85 lines
1.7 KiB
TypeScript

export type StackParamsList = {
Laconic: undefined;
SignMessage: { selectedNetwork: string; accountInfo: Account } | undefined;
SignRequest:
| { network: string; address: string; message: string }
| undefined;
InvalidPath: undefined;
};
export type Account = {
counterId: number;
pubKey: string;
address: string;
hdPath: string;
};
export type WalletDetails = {
mnemonic: string;
ethAccounts: Account | undefined;
cosmosAccounts: Account | undefined;
};
export type AccountsProps = {
network: string;
accounts: {
ethAccounts: Account[];
cosmosAccounts: Account[];
};
currentIndex: number;
updateIndex: (index: number) => void;
updateAccounts: (account: Account) => void;
};
export type NetworkDropdownProps = {
selectedNetwork: string;
updateNetwork: (network: string) => void;
};
export type AccountsState = {
ethAccounts: Account[];
cosmosAccounts: Account[];
};
export type SignMessageParams = {
message: string;
network: string;
accountId: number;
};
export type CreateWalletProps = {
isWalletCreating: boolean;
createWalletHandler: () => Promise<void>;
};
export type ResetDialogProps = {
visible: boolean;
hideDialog: () => void;
onConfirm: () => void;
};
export type HDPathDialogProps = {
pathCode: string;
visible: boolean;
hideDialog: () => void;
updateIndex: (index: number) => 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;
};