-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove unused comment unused remove unused Update consts.ts refactor
- Loading branch information
Showing
12 changed files
with
34 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
module.exports = { | ||
extends: ['../../.eslintrc.js'], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
}, | ||
|
||
ignorePatterns: ['!.eslintrc.js', 'dist/'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
'@typescript-eslint/no-shadow': [ | ||
'error', | ||
{ | ||
allow: ['Text'], | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,14 @@ | ||
import { DEFAULT_CHAIN_NAME } from '../defaults'; | ||
import { getKeyPair } from '../util/getKeyPair'; | ||
import { accountDemo } from '../ui/accountDemo'; | ||
import { getDefaultTokenBalances } from '../util/getDefaultTokenBalances'; | ||
|
||
export const getAddress = async (chainName?: string): Promise<string> => { | ||
const account = await getKeyPair(chainName || DEFAULT_CHAIN_NAME); | ||
const account = await getKeyPair(chainName ?? DEFAULT_CHAIN_NAME); | ||
|
||
if (!account) { | ||
throw new Error('account not found'); | ||
} | ||
|
||
const { address } = account; | ||
|
||
showAccount(address); // This can be removed in favour of onHomePage or onInstall | ||
|
||
return address; | ||
}; | ||
|
||
/** | ||
* To show address(es) in some main chains format to users for a short while. | ||
* | ||
* @param address - The any chain address. | ||
*/ | ||
async function showAccount(address: string) { | ||
const balances = await getDefaultTokenBalances(address); | ||
|
||
/** to show the address to user */ | ||
snap.request({ | ||
method: 'snap_dialog', | ||
params: { | ||
type: 'alert', | ||
content: accountDemo(address, balances), // TODO: fix parameters | ||
}, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.