-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 24178-bug-not-ellipsing-long-nft-id-withi…
…n-simulations
- Loading branch information
Showing
55 changed files
with
1,338 additions
and
313 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,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], | ||
}, | ||
}, | ||
}; |
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,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, | ||
}; |
Oops, something went wrong.