-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: updated hotfix branch to V0.0.32 (#791)
* Fixed claim tooltip text (#747) * Create s3-staging.yml * Create s3-production.yml * Create s3-hotfix.yml * Update s3-hotfix.yml * Update s3-hotfix.yml * Update s3-hotfix.yml * Release hotfix merge to master (#746) * add workflow for release-hotfix * add on push specific branch * remove automatic push process * set inputs on workflow * add specific branch on dispatch * Discord link update (#745) * Create s3-hotfix.yml * Update s3-hotfix.yml * Update s3-hotfix.yml --------- Co-authored-by: Will <korea651@hanmail.net> Co-authored-by: Ehsan <ehsan.hajian@gmail.com> * add nft menu on sidebar (#749) * add nft menu on sidebar * add customized balloon * clean up * Fix total dApps count (#751) * feat: updated theme color (#741) * feat: updated theme color on Assets page * feat: updated theme color on Dashboard page * feat: updated theme color on dApp staking page * feat: updated sidebar * fix: tests * update css * update css * update detail css * feat: updated header background * fix: updated hero position on dApp staking page * update css on feedback * update detail css * updates on addItemcard * update color on tags * update colors * feat: updated dark theme * update uilib & colors * styles: changed astar-blue-dark to astar-blue * styles: updated Ecosystem icon * fix: conflicts * fix: updated styles * fix: updated header * fix: updated modals * fix: updated play icon * fix: updated styles on transfer assets page * fix: updated ui liv --------- Co-authored-by: Will <korea651@hanmail.net> * Fix: Use XcmV2WeightLimit in InterlayXcmRepository.ts (#756) * feat: updated connect wallet drawer (#750) * feat: updated theme color on Assets page * feat: updated theme color on Dashboard page * feat: updated theme color on dApp staking page * feat: updated sidebar * fix: tests * update css * update css * update detail css * feat: updated astar-ui * feat: updated astar-ui (2) * feat: updated network modal * feat: updated 'ip-input' class * update css on feedback * update detail css * updates on addItemcard * update color on tags * feat: updated AccountModal logic * feat: updated account drawer * feat: updated disconnect button * feat: updated tests * fix: test * fix: conflicts (2) * fix: store selected address data * feat: updated drawer * feat: updated wallet logic * refactor: clean up * fix: changed 'disconnect' button position * feat: store selected theme to local storage * feat: updated modal drawer * feat: updated modal drawer --------- Co-authored-by: Will <korea651@hanmail.net> * Added github action for broken links (#761) * Added github action for broken links * build and check * e2e tests with Zombienet (#752) * Transfer tokens test * CI integration * Use env variable po pass BASE_URL to test script * yaml fix * Actions script fix * Another action script fix * yet another try * hardcoded versions * collator version fix * Links fix * Github action fix * It may run now on CI * Fixed test runner script * Add asset to a node * Moved Zombienet tests and configuration to separate folder. * Stake test * Increase Playwright test timeout * Tests and node setup fixes * Minor fixes * All tests run stable * Updated staking test with input validation test * release hotfix to main (#760) * add workflow for release-hotfix * add on push specific branch * remove automatic push process * set inputs on workflow * add specific branch on dispatch * Discord link update (#745) * Create s3-hotfix.yml * Update s3-hotfix.yml * Update s3-hotfix.yml * hotfix: added Injective assets (ATOM and INJ) on EVM assets page (#759) * feat: added ATOM and INJ on EVM assets page * fix: fetch token data from cbridge API --------- Co-authored-by: Will <korea651@hanmail.net> Co-authored-by: Bobo <bobo.kovacevic@gmail.com> Co-authored-by: Ehsan <ehsan.hajian@gmail.com> * fix: send non-native tokens with max amount (#768) * feat: updated XCM logic to V3 for Shiden, Statemine and Kusama (#758) * wip: KSM xcm V3 * feat: update sdk-core * feat: updated XCM logic for Kusama to V3 * feat: updated XCM V3 logic for Shiden * fix: removed console.log * fix: updated logic for statemine * fix: updated subscan link for ctust * feat: updated Bitfrost version to V3 * feat: updated XCM logic for Phala * refactor: clean up * fix: enabled XCM deposit/withdrawal on Shiden (#774) * fix: enabled XCM deposit/withdrawal on Shiden * test * test: lint * fix: clean up * Update broken-links.yml (#777) * removed quasar from broken link report (#767) * dAapp staking e2e tests (#769) * Unbond test * Re-stake on/off test * Claim rewards test, playwright config updates * On chain check if claim executed * Added Metamask extension * Metamask wallet creation * Trying to fix heap out of memory * One more try * One more try to fix CI out of memory * On more try to fix out of memory error * Heap size fix * command fix * What to say? * Metamask removed * Update pull-request-preview.yml * Pushing commit to rerun ci * setting up yarn * Added Metamask back * Test run on ubuntu-latest * tsconfig exclude pattern fix * Linter fixes --------- Co-authored-by: Ehsan <ehsan.hajian@gmail.com> Co-authored-by: Nikhil Ranjan <niklabh811@gmail.com> * feat: added 'help' button on header (#772) * fix: display EVM withdraw when users have balance in withdrawal * fix: added help button on header * fix: removed release note on the template.md * fix: test * fix: test (2) * fix: display ModalConectionTrouble when app is loading * fix: reset the staking tab after changing accounts (#779) * Change warning on EVM local transfer (#783) * update warning message * update css & only visible on EVM input * show prev warning * only visible isH160 * update warning message * fix: modified header styling for mobile devices (#782) * fix: updated connect button * fix: added separator at the top of assets page for mobile devices * fix: updated header background for mobile devices * fix: updated margin size inheader * Automatically create PR on regular and hotfix release (#781) * Fix for tests who are failing from time to time (#785) * Return Dwellir endpoint to the portal (#788) * feat: updated claim logic for ledger accounts (#765) * feat: updated claim logic for ledger account * refactor: clean up * debug: log transport * debug: log 2 * feat: test log * feat: test log 2 * feat: test log 3 * feat: test log 4 * feat: test log 5 * feat: test log 6 * refactor: removed console logs * refactor: clean up * fix: remove HID popup * fix: remove HID popup (2) * refactor: clean up * test: see console * refacotr: clean up * Deployment scripts fix (#790) --------- Co-authored-by: Bobo <bobo.kovacevic@gmail.com> Co-authored-by: Ehsan <ehsan.hajian@gmail.com> Co-authored-by: Will <korea651@hanmail.net> Co-authored-by: Brendon Votteler <bvotteler@users.noreply.github.com> Co-authored-by: Nikhil Ranjan <niklabh811@gmail.com>
- Loading branch information
1 parent
6d28632
commit 0e088b5
Showing
16 changed files
with
549 additions
and
93 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 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.
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 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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { Ledger } from '@polkadot/hw-ledger'; | ||
import { useAccount } from 'src/hooks/useAccount'; | ||
import { useStore } from 'src/store'; | ||
import { computed, ref, watch } from 'vue'; | ||
|
||
enum LedgerId { | ||
nanoS = 'nanoS', | ||
nanoSPlus = 'nanoSP', | ||
nanoX = 'nanoX', | ||
} | ||
|
||
export const useLedger = () => { | ||
const isLedgerAccount = ref<boolean>(false); | ||
const isLedgerNanoS = ref<boolean>(false); | ||
const ledger = ref<Ledger>(); | ||
const ledgerAccount = ref<string>(''); | ||
const { currentAccount } = useAccount(); | ||
|
||
const store = useStore(); | ||
const isH160 = computed<boolean>(() => store.getters['general/isH160Formatted']); | ||
|
||
const handleReset = (): void => { | ||
isLedgerAccount.value = false; | ||
isLedgerNanoS.value = false; | ||
ledger.value = undefined; | ||
ledgerAccount.value = ''; | ||
}; | ||
|
||
const handleLedgerData = async (): Promise<void> => { | ||
// Memo: make sure `transport` has been closed before creating ledger transport | ||
if (ledger.value && ledgerAccount.value) { | ||
const transport = (ledger.value as any).__internal__app.transport; | ||
transport.close(); | ||
} | ||
|
||
if (!currentAccount.value || isH160.value) { | ||
handleReset(); | ||
return; | ||
} | ||
try { | ||
if (!('hid' in window.navigator)) { | ||
console.error('WebHID API is not supported in this browser.'); | ||
handleReset(); | ||
return; | ||
} | ||
|
||
const hidDevices = (await (window.navigator as any).hid.getDevices()) as any; | ||
if (process.env.DEV) { | ||
console.info('hidDevices', hidDevices); | ||
} | ||
|
||
if (hidDevices.length === 0) { | ||
handleReset(); | ||
return; | ||
} | ||
|
||
hidDevices.some(async (device: any) => { | ||
try { | ||
if (device?.productName?.toLowerCase().includes('nano')) { | ||
const ledgerData = new Ledger('hid', 'astar'); | ||
const { address } = await ledgerData.getAddress(); | ||
if (process.env.DEV) { | ||
console.info('ledgerData', ledgerData); | ||
} | ||
|
||
if (address) { | ||
ledger.value = ledgerData; | ||
const deviceModel = (ledgerData as any).__internal__app.transport.deviceModel; | ||
ledgerAccount.value = address; | ||
isLedgerAccount.value = address === currentAccount.value; | ||
isLedgerNanoS.value = deviceModel.id === LedgerId.nanoS; | ||
} else { | ||
handleReset(); | ||
} | ||
} | ||
} catch (error: any) { | ||
const idLedgerLocked = '0x5515'; | ||
if (error.message.includes(idLedgerLocked)) { | ||
store.dispatch('general/showAlertMsg', { | ||
msg: error.message, | ||
alertType: 'error', | ||
}); | ||
handleReset(); | ||
} | ||
} finally { | ||
return; | ||
} | ||
}); | ||
} catch (error) { | ||
handleReset(); | ||
} | ||
}; | ||
|
||
watch([currentAccount], handleLedgerData, { immediate: true }); | ||
|
||
return { isLedgerAccount, isLedgerNanoS }; | ||
}; |
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
Oops, something went wrong.