Skip to content

Commit

Permalink
Merge branch 'develop' into 24178-bug-not-ellipsing-long-nft-id-withi…
Browse files Browse the repository at this point in the history
…n-simulations
  • Loading branch information
OGPoyraz authored Jun 12, 2024
2 parents 6a4d7c6 + 9a5aeae commit 9e9d403
Show file tree
Hide file tree
Showing 55 changed files with 1,338 additions and 313 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ jobs:
steps:
- run:
name: build:prod
command: yarn build --build-type flask prod
command: ENABLE_MV3=false yarn build --build-type flask prod
- run:
name: build:debug
command: find dist/ -type f -exec md5sum {} \; | sort -k 2
Expand Down
4 changes: 2 additions & 2 deletions .circleci/scripts/release-create-gh-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ then
release_body="$(awk -v version="${tag##v}" -f .circleci/scripts/show-changelog.awk CHANGELOG.md)"
hub release create \
--attach builds/metamask-chrome-*.zip \
--attach builds/metamask-firefox-*.zip \
--attach builds-mv2/metamask-firefox-*.zip \
--attach builds-flask/metamask-flask-chrome-*.zip \
--attach builds-flask/metamask-flask-firefox-*.zip \
--attach builds-flask-mv2/metamask-flask-firefox-*.zip \
--attach builds-mmi/metamask-mmi-chrome-*.zip \
--attach builds-mmi/metamask-mmi-firefox-*.zip \
--message "Version ${tag##v}" \
Expand Down
10 changes: 5 additions & 5 deletions .storybook/3.COLORS.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We follow a 3 tiered system for color design tokens and css variables.
<div
style={{
textAlign: 'center',
backgroundColor: 'var(--brand-colors-white-white000)',
backgroundColor: 'var(--brand-colors-white)',
padding: 32,
}}
>
Expand All @@ -36,9 +36,9 @@ These colors **SHOULD NOT** be used in your styles directly. They are used as a

```css
/** !!!DO NOT USE BRAND COLORS DIRECTLY IN YOUR CODE!!! */
var(--brand-colors-white-white000)
var(--brand-colors-white-white010)
var(--brand-colors-grey-grey030)
var(--brand-colors-white)
var(--brand-colors-black)
var(--brand-colors-grey-grey800)
```

### **Theme colors** (tier 2)
Expand Down Expand Up @@ -168,7 +168,7 @@ Don't use static hex values or brand color tokens in your code.
* Not theme compatible and will break UI when using dark theme
**/
.card {
background-color: var(--brand-colors-white-white000);
background-color: var(--brand-colors-white);
color: var(--brand-colors-grey-grey800);
}
```
Expand Down
16 changes: 8 additions & 8 deletions .storybook/4.SHADOW.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ As well as the neutral colors for shadow 2 other colors exist that are used for
style={{
height: 100,
backgroundColor: 'var(--color-primary-default)',
boxShadow: 'var(--shadow-size-lg) var(--color-primary-shadow)',
boxShadow: 'var(--shadow-size-lg) var(--color-shadow-primary)',
borderRadius: '4px',
display: 'grid',
alignContent: 'center',
Expand All @@ -129,7 +129,7 @@ As well as the neutral colors for shadow 2 other colors exist that are used for
style={{
height: 100,
backgroundColor: 'var(--color-error-default)',
boxShadow: 'var(--shadow-size-lg) var(--color-error-shadow)',
boxShadow: 'var(--shadow-size-lg) var(--color-shadow-error)',
borderRadius: '4px',
display: 'grid',
alignContent: 'center',
Expand All @@ -144,8 +144,8 @@ As well as the neutral colors for shadow 2 other colors exist that are used for
| Color | CSS |
| ----------- | ----------------------------- |
| **neutral** | `var(--color-shadow-default)` |
| **primary** | `var(--color-primary-shadow)` |
| **danger** | `var(--color-error-shadow)` |
| **primary** | `var(--color-shadow-primary)` |
| **danger** | `var(--color-shadow-error)` |

## Example usage

Expand Down Expand Up @@ -232,7 +232,7 @@ Using both size and color tokens, different shadows can be applied to components
justifyContent: 'center',
height: 100,
textAlign: 'center',
boxShadow: 'var(--shadow-size-sm) var(--color-primary-shadow)',
boxShadow: 'var(--shadow-size-sm) var(--color-shadow-primary)',
backgroundColor: 'var(--color-primary-default)',
color: 'var(--color-primary-inverse)',
}}
Expand All @@ -247,7 +247,7 @@ Using both size and color tokens, different shadows can be applied to components
justifyContent: 'center',
height: 100,
textAlign: 'center',
boxShadow: 'var(--shadow-size-sm) var(--color-error-shadow)',
boxShadow: 'var(--shadow-size-sm) var(--color-shadow-error)',
backgroundColor: 'var(--color-error-default)',
color: 'var(--color-error-inverse)',
}}
Expand All @@ -263,8 +263,8 @@ Using both size and color tokens, different shadows can be applied to components
| **Dropdown** | `box-shadow: var(--shadow-size-sm) var(--color-shadow-default);` |
| **Toast** | `box-shadow: var(--shadow-size-md) var(--color-shadow-default);` |
| **Modal** | `box-shadow: var(--shadow-size-lg) var(--color-shadow-default);` |
| **Button Primary Hover** | `box-shadow: var(--shadow-size-sm) var(--color-primary-shadow);` |
| **Button Danger Hover** | `box-shadow: var(--shadow-size-sm) var(--color-error-shadow);` |
| **Button Primary Hover** | `box-shadow: var(--shadow-size-sm) var(--color-shadow-primary);` |
| **Button Danger Hover** | `box-shadow: var(--shadow-size-sm) var(--color-shadow-error);` |

## Takeaways

Expand Down
5 changes: 4 additions & 1 deletion app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions app/images/bitcoin-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
},
"dependencies": {
"@babel/runtime": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch",
"@blockaid/ppom_release": "^1.4.6",
"@blockaid/ppom_release": "^1.4.7",
"@contentful/rich-text-html-renderer": "^16.3.5",
"@ensdomains/content-hash": "^2.5.7",
"@ethereumjs/tx": "^4.1.1",
Expand Down Expand Up @@ -290,7 +290,7 @@
"@metamask/browser-passworder": "^4.3.0",
"@metamask/contract-metadata": "^2.5.0",
"@metamask/controller-utils": "^10.0.0",
"@metamask/design-tokens": "^3.0.0",
"@metamask/design-tokens": "^4.0.0",
"@metamask/ens-controller": "^10.0.1",
"@metamask/eth-json-rpc-filters": "^7.0.0",
"@metamask/eth-json-rpc-middleware": "^12.1.1",
Expand Down
1 change: 1 addition & 0 deletions shared/constants/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ export enum MetaMetricsNetworkEventSource {
PopularNetworkList = 'popular_network_list',
Dapp = 'dapp',
DeprecatedNetworkModal = 'deprecated_network_modal',
NewAddNetworkFlow = 'new_add_network_flow',
}

export enum MetaMetricsSwapsEventSource {
Expand Down
38 changes: 38 additions & 0 deletions shared/constants/multichain/networks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ProviderConfig } from '@metamask/network-controller';
import { CaipChainId } from '@metamask/utils';

type ProviderConfigWithImageUrl = Omit<ProviderConfig, 'chainId'> & {
rpcPrefs?: { imageUrl?: string };
};

export type MultichainProviderConfig = ProviderConfigWithImageUrl & {
chainId: CaipChainId;
};

export enum MultichainNetworks {
BITCOIN = 'bip122:000000000019d6689c085ae165831e93',
BITCOIN_TESTNET = 'bip122:000000000933ea01ad0ee984209779ba',
}

export const BITCOIN_TOKEN_IMAGE_URL = './images/bitcoin-logo.svg';

export const MULTICHAIN_TOKEN_IMAGE_MAP = {
[MultichainNetworks.BITCOIN]: BITCOIN_TOKEN_IMAGE_URL,
} as const;

export const MULTICHAIN_PROVIDER_CONFIGS: Record<
CaipChainId,
MultichainProviderConfig
> = {
[MultichainNetworks.BITCOIN]: {
chainId: MultichainNetworks.BITCOIN,
rpcUrl: '', // not used
ticker: 'BTC',
nickname: 'Bitcoin',
id: 'btc-mainnet',
type: 'rpc',
rpcPrefs: {
imageUrl: MULTICHAIN_TOKEN_IMAGE_MAP[MultichainNetworks.BITCOIN],
},
},
};
59 changes: 59 additions & 0 deletions test/data/mock-accounts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { KeyringTypes } from '@metamask/keyring-controller';
import {
InternalAccount,
EthAccountType,
BtcMethod,
BtcAccountType,
} from '@metamask/keyring-api';
import {
ETH_EOA_METHODS,
ETH_4337_METHODS,
} from '../../shared/constants/eth-methods';

export const MOCK_ACCOUNT_EOA: InternalAccount = {
id: '4974fc00-c0fb-4a18-8535-8407ec6d1952',
address: '0x123',
options: {},
methods: ETH_EOA_METHODS,
type: EthAccountType.Eoa,
metadata: {
name: 'Account 1',
keyring: { type: KeyringTypes.hd },
importTime: 1691565967600,
lastSelected: 1691565967656,
},
};

export const MOCK_ACCOUNT_ERC4337: InternalAccount = {
id: '4d5921f2-2022-44ce-a84f-9f6a0f142a5c',
address: '0x123',
options: {},
methods: ETH_EOA_METHODS.concat(ETH_4337_METHODS),
type: EthAccountType.Erc4337,
metadata: {
name: 'Account 2',
keyring: { type: KeyringTypes.snap },
importTime: 1691565967600,
lastSelected: 1691565967656,
},
};

export const MOCK_ACCOUNT_BIP122_P2WPKH: InternalAccount = {
id: 'ae247df6-3911-47f7-9e36-28e6a7d96078',
address: 'bc1qaabb',
options: {},
methods: [BtcMethod.SendMany],
type: BtcAccountType.P2wpkh,
metadata: {
name: 'Bitcoin Account',
keyring: { type: KeyringTypes.snap },
importTime: 1691565967600,
lastSelected: 1955565967656,
},
};

export const MOCK_ACCOUNTS = {
[MOCK_ACCOUNT_EOA.id]: MOCK_ACCOUNT_EOA,
[MOCK_ACCOUNT_ERC4337.id]: MOCK_ACCOUNT_ERC4337,
[MOCK_ACCOUNT_BIP122_P2WPKH.id]: MOCK_ACCOUNT_BIP122_P2WPKH,
};
Loading

0 comments on commit 9e9d403

Please sign in to comment.