Skip to content

Commit

Permalink
Merge branch 'develop' into features/merge-unisat-1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
BlobMaster41 committed Aug 20, 2024
2 parents efe2399 + fdfe590 commit 40475d7
Show file tree
Hide file tree
Showing 72 changed files with 4,073 additions and 19,638 deletions.
4 changes: 4 additions & 0 deletions build/_raw/images/artifacts/bitcoin-testnet-all.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed build/_raw/images/artifacts/bitcoin-testnet.png
Binary file not shown.
15 changes: 15 additions & 0 deletions build/_raw/images/artifacts/fractal-mainnet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions build/_raw/images/artifacts/fractal-testnet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/_raw/images/icons/overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/_raw/images/icons/right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion build/_raw/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

<title>OP_WALLET</title>
</head>
<body style="background-color: #1c1919">

<body style="background-color: #070606">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
3 changes: 2 additions & 1 deletion build/_raw/notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

<title>OP_WALLET</title>
</head>
<body style="background-color: #1c1919">

<body style="background-color: #070606">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
24 changes: 12 additions & 12 deletions build/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ const config = (env) => {
config: false,
plugins: !useTailwind
? [
'postcss-flexbugs-fixes',
['postcss-preset-env', { autoprefixer: { flexbox: 'no-2009' }, stage: 3 }],
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
'postcss-normalize'
]
'postcss-flexbugs-fixes',
['postcss-preset-env', { autoprefixer: { flexbox: 'no-2009' }, stage: 3 }],
// Adds PostCSS Normalize as the reset css with default options,
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
'postcss-normalize'
]
: [
'tailwindcss',
'postcss-flexbugs-fixes',
['postcss-preset-env', { autoprefixer: { flexbox: 'no-2009' }, stage: 3 }]
]
'tailwindcss',
'postcss-flexbugs-fixes',
['postcss-preset-env', { autoprefixer: { flexbox: 'no-2009' }, stage: 3 }]
]
},
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment
}
Expand All @@ -102,7 +102,7 @@ const config = (env) => {
'primary-color': 'rgb(234,202,68)',
'primary-color-active': '#383535',
'input-icon-hover-color': '#FFFFFF',
'component-background': '#1C1919',
'component-background': '#070606',
'select-dropdown-bg': '#2A2626',
'select-item-selected-bg': '#332F2F',
'select-item-active-bg': '#332F2F',
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"koa-compose": "^4.1.0",
"lodash-es": "^4.17.21",
"loglevel": "^1.8.0",
"react-idle-timer": "^5.7.2",
"mini-css-extract-plugin": "^2.4.5",
"opnet": "1.0.48",
"postcss": "^8.4.39",
Expand Down Expand Up @@ -146,7 +147,8 @@
"webpack-dev-server": "^4.6.0",
"webpack-extension-reloader": "^1.1.4",
"webpack-manifest-plugin": "^4.0.2",
"workbox-webpack-plugin": "^6.4.1"
"workbox-webpack-plugin": "^6.4.1",
"zxcvbn": "^4.4.2"
},
"browserslist": {
"production": [
Expand Down
22 changes: 22 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# UniSat Wallet Release Notes

## v1.4.2

- Support Testnet4
- Support Signet
- Fixed the issue of the app crashing when transferring Runes with multiple UTXOs
- Fixed the issue with the display of the available balance of partially-colored funds during an ARC20 transfer
- Fixed the issue with the incorrect display of HdPath in Keystone
- Audit fix: Removed private methods from the browser plugin object to enhance security
- Audit fix: Methods such as getPublicKey, getNetwork, switchNetwork are now only accessible after authorization for improved security.

## v1.4.1

- Support for setting transfer fees with one decimal place
- Added display of USD prices for BTC、BRC20 and Runes
- Real-time fee displays for various buy BTC options
- Fix unisat.sendRunes
- Fix unisat.multiSginPsbt

## v1.4.0

- Support fractalbitcoin

## v1.3.4

- Compatible with partial token coloring for ARC20
Expand Down
26 changes: 15 additions & 11 deletions src/background/controller/provider/controller.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import { permissionService, sessionService } from '@/background/service';
import { CHAINS, CHAINS_MAP, NETWORK_TYPES, VERSION } from '@/shared/constant';

Expand Down Expand Up @@ -42,7 +43,7 @@ class ProviderController extends BaseController {
sessionService.broadcastEvent('accountsChanged', account);
const connectSite = permissionService.getConnectedSite(origin);
if (connectSite) {
const network = wallet.getNetworkName();
const network = wallet.getLegacyNetworkName();
sessionService.broadcastEvent(
'networkChanged',
{
Expand All @@ -55,22 +56,25 @@ class ProviderController extends BaseController {
return account;
};

@Reflect.metadata('SAFE', true)
getAccounts = async ({ session: { origin } }) => {
if (!permissionService.hasPermission(origin)) {
return [];
}
disconnect = async ({ session: { origin } }) => {
wallet.removeConnectedSite(origin)
};

@Reflect.metadata('SAFE', true)
getAccounts = async ({ session: { origin } }) => {
if (!permissionService.hasPermission(origin)) {
return [];
}

const _account = await wallet.getCurrentAccount();
const account = _account ? [_account.address] : [];
return account;
};

@Reflect.metadata('SAFE', true)
getNetwork = async () => {
const networkType = wallet.getNetworkType();
return NETWORK_TYPES[networkType].name;
};
@Reflect.metadata('SAFE', true)
getNetwork = async () => {
return wallet.getLegacyNetworkName()
};

@Reflect.metadata('APPROVAL', ['SwitchNetwork', (req) => {
const network = req.data.params.network;
Expand Down
32 changes: 18 additions & 14 deletions src/background/controller/provider/internalMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@ const tabCheckin = ({
session.setProp({ origin, name, icon });
};

const getProviderState = async () => {
const isUnlocked = keyringService.memStore.getState().isUnlocked;
const accounts: string[] = [];
if (isUnlocked) {
const currentAccount = await wallet.getCurrentAccount();
if (currentAccount) {
accounts.push(currentAccount.address);
}
const getProviderState = async (req) => {
const {
session: { origin }
} = req;

const isUnlocked = keyringService.memStore.getState().isUnlocked;
const accounts: string[] = [];
if (isUnlocked) {
const currentAccount = await wallet.getCurrentAccount();
if (currentAccount) {
accounts.push(currentAccount.address);
}
return {
network: wallet.getNetworkName(),
chain: wallet.getChainType(),
isUnlocked,
accounts
};
}
return {
network: wallet.getLegacyNetworkName(),
chain: wallet.getChainType(),
isUnlocked,
accounts
};
};

const keepAlive = () => {
Expand Down
Loading

0 comments on commit 40475d7

Please sign in to comment.