Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions packages/extension/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
/// <reference types="vite/client" />

namespace NodeJS {
interface ProcessEnv {
BROWSER: 'chrome' | 'firefox' | 'edge' | 'opera' | 'safari'
MINIFY: 'true' | 'false'
export namespace NodeJS {
export interface ProcessEnv {
BROWSER: 'chrome' | 'firefox' | 'edge' | 'opera' | 'safari';
MINIFY: 'true' | 'false';
}
}

declare let __PREFILL_PASSWORD__: string
declare let __PACKAGE_VERSION__: string
declare let __IS_DEV__: boolean
declare let __IS_FIREFOX__: boolean
declare let __IS_OPERA__: boolean
declare let __IS_CHROME__: boolean
declare let __IS_SAFARI__: boolean
declare let __BUILD_TIME__: string
declare module '*.svg' {
const content: string;
export default content;
}

declare let __PREFILL_PASSWORD__: string;
declare let __PACKAGE_VERSION__: string;
declare let __IS_DEV__: boolean;
declare let __IS_FIREFOX__: boolean;
declare let __IS_OPERA__: boolean;
declare let __IS_CHROME__: boolean;
declare let __IS_SAFARI__: boolean;
declare let __BUILD_TIME__: string;
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "2.4.0",
"version": "2.4.1",
"private": true,
"type": "module",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ export default async (
rawInfo: activity,
chainId: activity.chain.toString(),
crossChainId: activity.crossChainId,
status:
activity.idx === 1 ? ActivityStatus.success : ActivityStatus.failed,
status: ActivityStatus.success,
timestamp: new Date(activity.blockTime).getTime(),
value: rawAmount,
transactionHash: activity.requestKey,
Expand Down
7 changes: 5 additions & 2 deletions packages/extension/src/providers/kadena/libs/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ class API implements ProviderAPIInterface {
const error = balance.result.error as { message: string | undefined };
const message = error.message ?? 'Unknown error retrieving balances';
// expected error when account does not exist on a chain (balance == 0)
if (message.includes('row not found')) {
if (
message.includes('row not found') ||
message.includes('No value found in table')
) {
return toBase('0', this.decimals);
}
throw new Error(message);
Expand All @@ -91,7 +94,7 @@ class API implements ProviderAPIInterface {

async getBalanceAPI(account: string, chainId: string) {
const transaction = Pact.builder
.execution(Pact.modules.coin['get-balance'](account))
.execution((Pact.modules as any).coin['get-balance'](account))
.setMeta({ chainId: chainId as ChainId })
.setNetworkId(this.networkId)
.createTransaction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ const validateFields = async () => {
if (transactionResult.result.status !== 'success') {
fieldsValidation.value.amount = false;
errorMsg.value =
(transactionResult.result as any).error.message ||
((transactionResult.result as any).error.message as string)
.replace(/"/g, '')
.replace((transactionResult as any).reqKey, '') ||
'An error occurred';
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<p>
Save your current list of accounts across all networks, so you don't
need to re-generate them when you import or restore your wallet with
Enkrypt. You will still need your recovery phrase.
Enkrypt. You will still need your recovery phrase. We only back up
non-vital information such as account names and derivation paths. Your
sensitive information, like your mnemonic and private keys, is never
backed up.
</p>
</div>
<settings-switch
Expand Down Expand Up @@ -85,19 +88,19 @@
</div>
<div class="settings-container__backup-item">
<div class="settings-container__backup-item__content">
<backup-identicon :hash="selectedBackup.userId" />
<backup-identicon :hash="selectedBackup!.userId" />
<div class="settings-container__backup-item__name">
<h4>
{{ generateRandomNameWithSeed(' ', selectedBackup.userId) }}
{{ generateRandomNameWithSeed(' ', selectedBackup!.userId) }}
</h4>
<p>Last backup on: {{ formatDate(selectedBackup.updatedAt) }}</p>
<p>Last backup on: {{ formatDate(selectedBackup!.updatedAt) }}</p>
</div>
</div>
</div>
<div class="settings-container__backup-delete-buttons">
<base-button
title="Delete"
@click="deleteBackup(selectedBackup.userId)"
@click="deleteBackup(selectedBackup!.userId)"
red
/>
<base-button title="Cancel" @click="isDelete = false" no-background />
Expand Down
1 change: 1 addition & 0 deletions packages/extension/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": [
"env.d.ts",
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
Expand Down
Loading