-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: Add keplr wallet support and shared utils package #1147
Changes from 58 commits
c5087d0
5829861
4fd666f
60304a3
0ec44d3
97091d6
101c9ad
a5a6762
e8d0bd8
e1179ad
b39afcd
acdf38c
68a6094
769344d
8d38cb2
500669d
c5cec19
fd48092
3cf42d9
5baf24d
d02d242
76334cc
fb076ac
5ed5ca2
af0855e
d2c807c
8f6e1e4
834d458
b18ed70
b897897
5671ba2
093385b
452498a
2d38d89
54b0b7c
c962372
386ae15
f40fdf2
138c7a1
850b037
7991b42
988f112
4a7f4e5
e191940
d9b0332
c10a1ff
4e5d50a
c48386b
cf89cc9
3d65aea
630298b
1622f45
25559c8
a0da307
7376f3e
97a91fc
6f6c783
e428447
78d6de9
49257de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { getUniqueWalletSetupFunctions } from './utils/getUniqueWalletSetupFunctions' | ||
import { triggerCacheCreation } from './utils/triggerCacheCreation' | ||
|
||
//@TODO: Make it so createCache can handle only one wallet setup function | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you elaborate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason when we only have 1 setup file, the hash generated in prepareExtension creates what would have been the the hash from the second item in the wallet setup functions array. If there's 2 or more setup functions this behaviour does not happen (this is true for MM as well even before adding Keplr) This will be tackled in a separate issue |
||
export async function createCache(walletSetupDirPath: string, downloadExtension: () => Promise<string>, force = false) { | ||
const setupFunctions = await getUniqueWalletSetupFunctions(walletSetupDirPath) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import path from 'node:path' | ||
import fs from 'fs-extra' | ||
import { CACHE_DIR_NAME } from './constants' | ||
import { CACHE_DIR_NAME } from '../../cache/src/constants' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we do "./ensureCacheDirExists"? |
||
|
||
export function ensureCacheDirExists() { | ||
const cacheDirPath = path.join(process.cwd(), CACHE_DIR_NAME) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
export * from './constants' | ||
export * from './createCache' | ||
export * from './cli/cliEntrypoint' | ||
export * from '../../cache/src/constants' | ||
export * from './downloadFile' | ||
export * from './unzipArchive' | ||
export * from '../../cache/src/unzipArchive' | ||
export * from './ensureCacheDirExists' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why isn't it in the same "cache" directory? |
||
export * from './createCache' | ||
export * from './defineWalletSetup' | ||
export * from '../../cache/src/prepareExtension' | ||
export * from './prepareExtension' | ||
export * from './utils/bytesToMegabytes' | ||
export * from './utils/createCacheForWalletSetupFunction' | ||
export * from './utils/createTempContextDir' | ||
export * from './utils/getUniqueWalletSetupFunctions' | ||
export * from './utils/getWalletSetupFiles' | ||
export * from './utils/getWalletSetupFuncHash' | ||
export * from './utils/importWalletSetupFile' | ||
export * from './utils/isDirEmpty' | ||
export * from './utils/onDownloadProgress' | ||
export * from './utils/triggerCacheCreation' | ||
export * from './utils/removeTempContextDir' | ||
export * from './prepareExtension' | ||
export * from './cli/cliEntrypoint' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we use MetaMask as default?