Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

featue: add support for nexa (OK-20657) #3146

Merged
merged 132 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
4c84a9c
feat: init nexa
huhuanming Jun 19, 2023
2bf88f7
feat: add prepareAccounts
huhuanming Jun 21, 2023
47f8dfa
feat: fix nexatest
huhuanming Jun 21, 2023
cbde291
fix: fix provider
huhuanming Jun 21, 2023
279cb21
feat: support query balances
huhuanming Jun 22, 2023
090b26f
feat: add getClientEndpointStatus
huhuanming Jun 22, 2023
150ec7c
feat: add expiredTimeout for ws request
huhuanming Jun 23, 2023
23f31e3
feat: fix address validate
huhuanming Jun 25, 2023
e50e587
feat: support transaction
huhuanming Jun 26, 2023
586981a
fix: resolve conflicts
huhuanming Jun 27, 2023
c5fecc9
fix: remove batch call in WebSocketRequest
huhuanming Jun 27, 2023
4d4a50f
fix: fix websockect
huhuanming Jun 27, 2023
113b4e1
fix: fix txHash
huhuanming Jun 27, 2023
bc30c19
fix: fix history
huhuanming Jun 27, 2023
4d76ad6
fix: fix fee
huhuanming Jun 27, 2023
7caf823
fix: fix nexaAddress
huhuanming Jun 28, 2023
e62e09c
fix: fix script address
huhuanming Jun 28, 2023
6bbd056
fix: fix script address
huhuanming Jun 28, 2023
8052c41
fix: fix import account
huhuanming Jun 28, 2023
b02e980
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jun 28, 2023
fc61009
fix: fix import account
huhuanming Jun 28, 2023
c5758b2
fix: fix amount
huhuanming Jun 28, 2023
4a68c7b
feat: pub to address
huhuanming Jun 29, 2023
dcb6027
feat: remove address
huhuanming Jun 29, 2023
e4d55f4
fix: fix address
huhuanming Jun 29, 2023
126823f
fix: fix address
huhuanming Jun 30, 2023
ffe7557
fix: fix WebSocket error
huhuanming Jun 30, 2023
a7928fd
fix: fix testSignTransaction test
huhuanming Jun 30, 2023
9b4a0fa
refactor: add buffers
huhuanming Jun 30, 2023
016298b
refactor: add buffers
huhuanming Jul 1, 2023
68b7886
refactor: remove secp256k1 get public key
huhuanming Jul 1, 2023
476e844
refactor: remove secp256k1 get public key
huhuanming Jul 1, 2023
64ba00a
refactor: add outputSignatures
huhuanming Jul 1, 2023
b728206
refactor: build txid
huhuanming Jul 2, 2023
12d99cf
refactor: build txid
huhuanming Jul 2, 2023
cfa9d3d
refactor: replace method
huhuanming Jul 2, 2023
20cb26e
refactor: remove console
huhuanming Jul 2, 2023
4968746
refactor: add verify function
huhuanming Jul 2, 2023
49ba810
refactor: add utils sign test
huhuanming Jul 2, 2023
3ce9b30
refactor: remove unused file
huhuanming Jul 2, 2023
957fa5e
refactor: refactor import account
huhuanming Jul 2, 2023
8fc5103
refactor: test import sign
huhuanming Jul 2, 2023
e717142
refactor: fix bugs
huhuanming Jul 2, 2023
af17afe
refactor: fix keyringhd sign
huhuanming Jul 2, 2023
1e116a9
refactor: fix keyringimport sign
huhuanming Jul 2, 2023
e2819e7
refactor: fix verify method
huhuanming Jul 2, 2023
a1bb115
refactor: add KeyringWatching tests
huhuanming Jul 2, 2023
7e33a3b
refactor: update feeino
huhuanming Jul 2, 2023
fa66988
refactor: fix fee
huhuanming Jul 2, 2023
31ff329
refactor: remove unused code
huhuanming Jul 2, 2023
469ea95
refactor: remove nexcore-lib
huhuanming Jul 2, 2023
17b1331
refactor: fix wired bug
huhuanming Jul 2, 2023
496fcb9
refactor: change totalFee name to gas
huhuanming Jul 2, 2023
45b6fdd
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 3, 2023
30cbef9
refactor: fix time and fee
huhuanming Jul 3, 2023
e51a9de
refactor: fix transaction status
huhuanming Jul 3, 2023
f06d6cc
refactor: remove unused plus
huhuanming Jul 3, 2023
c0b4b42
refactor: replace number by bn.js
huhuanming Jul 3, 2023
20a94ef
refactor: fix warnings
huhuanming Jul 3, 2023
4fb6f09
refactor: add bug details
huhuanming Jul 3, 2023
84dcc37
refactor: fix proxy
huhuanming Jul 3, 2023
302e194
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 3, 2023
bec6532
refactor: fix files
huhuanming Jul 3, 2023
0e19afe
fix: resolve conflicts
huhuanming Jul 3, 2023
c27c420
fix: resolve conflicts
huhuanming Jul 3, 2023
d9a2ea0
fix: resolve conflicts
huhuanming Jul 3, 2023
cdacb13
fix: fix lint
huhuanming Jul 3, 2023
a7ae961
fix: webpack config
huhuanming Jul 3, 2023
4c7b260
fix: fix spells
huhuanming Jul 3, 2023
886c67e
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 3, 2023
baa3796
fix: fix url error
huhuanming Jul 4, 2023
080b0be
fix: fix hd path
huhuanming Jul 5, 2023
2d1eca7
fix: fix hd account test
huhuanming Jul 5, 2023
0fe478d
fix: fix uxto satoshis
huhuanming Jul 5, 2023
d594dd0
fix: replace nexa to NEX
huhuanming Jul 5, 2023
20392d4
fix: fix lints
huhuanming Jul 5, 2023
2943b92
feat: add sign tests
huhuanming Jul 5, 2023
1f35de1
fix: fix addres link
huhuanming Jul 5, 2023
e66a9f1
fix: resolve conflicts
huhuanming Jul 5, 2023
30e79d7
fix: resolve conflicts
huhuanming Jul 5, 2023
87a3a77
fix: fix tx url
huhuanming Jul 5, 2023
4c9bbc5
fix: fix refresh account
huhuanming Jul 5, 2023
3bb4e50
refactor: add addressFromBase
huhuanming Jul 5, 2023
9ed922b
fix: fix tests
huhuanming Jul 5, 2023
41384ae
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 6, 2023
093629e
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 6, 2023
b86fc10
Merge branch 'onekey' into feature/add-nexa-OK-20657
sidmorizon Jul 6, 2023
eb9eaa9
fix: remove test code
huhuanming Jul 7, 2023
1bfcd55
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 7, 2023
858c25e
fix: fix test
huhuanming Jul 7, 2023
47b842e
refactor: remove reverseBuffer
huhuanming Jul 7, 2023
23c959e
fix: remove unused code
huhuanming Jul 7, 2023
bfefb43
fix: fix merge
huhuanming Jul 10, 2023
40bab88
refactor: refact sigs
huhuanming Jul 10, 2023
1802cb9
fix: fix const
huhuanming Jul 10, 2023
d1e6a8d
feat: add nexa hardware sign
huhuanming Jul 10, 2023
cf2e3be
refactor: add nexa_ws proxy
huhuanming Jul 10, 2023
3799952
fix: fix action
huhuanming Jul 10, 2023
021f5a0
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 10, 2023
75baba0
feat: complete hardware address
huhuanming Jul 11, 2023
d3223fd
fix: fix prefix
huhuanming Jul 12, 2023
29ccc9f
feat: add KeyringHardware
huhuanming Jul 12, 2023
cb9fe23
feat: add hardware sign
huhuanming Jul 12, 2023
e54807c
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 13, 2023
4e92f0e
fix: remove unused type
huhuanming Jul 17, 2023
6f90caf
fix: resolve conflicts
huhuanming Jul 17, 2023
72debde
feat: export privateKey
huhuanming Jul 17, 2023
8f53fac
refactor: change to UTXO account
huhuanming Jul 17, 2023
4871867
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 17, 2023
894e8c2
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 17, 2023
0889b6f
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 17, 2023
33b89d3
fix: fix address type
huhuanming Jul 17, 2023
2e7a496
fix: fix estimateFee
huhuanming Jul 17, 2023
d92addb
fix: fix wallet account list
huhuanming Jul 17, 2023
cbd27a6
feat: support public key for watching account
huhuanming Jul 17, 2023
d5d0b8f
feat: support change address
huhuanming Jul 17, 2023
887c74d
fix: fix type names
huhuanming Jul 17, 2023
2925eb6
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 18, 2023
4416fbb
refactor: refactor transfer object
huhuanming Jul 18, 2023
3fdc728
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 20, 2023
a0adf5c
fix: remove IS_CHANGE_ADDRESS
huhuanming Jul 21, 2023
06874f5
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 21, 2023
dd73e4b
fix: fix nexa template
huhuanming Jul 21, 2023
3fb4ebd
feat: upgrade hd-ble-sdk version
huhuanming Jul 24, 2023
e150de6
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 24, 2023
3255f83
fix: fix account address
huhuanming Jul 24, 2023
23e71b7
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 24, 2023
710321f
fix: fix subdesc
huhuanming Jul 24, 2023
5954030
fix: fix types
huhuanming Jul 24, 2023
491741a
chore: update yarn.lock
huhuanming Jul 24, 2023
d950cbe
fix: fix template
huhuanming Jul 25, 2023
1981039
Merge branch 'onekey' into feature/add-nexa-OK-20657
huhuanming Jul 25, 2023
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
10 changes: 10 additions & 0 deletions development/webpackTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ function normalizeConfig({
if (PUBLIC_URL) config.output.publicPath = PUBLIC_URL;
const isDev = process.env.NODE_ENV !== 'production';

// add devServer proxy
if (config.devServer) {
config.devServer.proxy = config.devServer.proxy || {};
config.devServer.proxy['/nexa_ws'] = {
target: 'wss://testnet-explorer.nexa.org:30004',
changeOrigin: true,
ws: true,
};
}

config.plugins = [
...config.plugins,
platform !== 'ext' ? new DuplicatePackageCheckerPlugin() : null,
Expand Down
1 change: 1 addition & 0 deletions jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class LocalStorageMock {

global.localStorage = new LocalStorageMock();
global.fetch = require('node-fetch');
global.WebSocket = require('isomorphic-ws');

jest.mock('react-native-zip-archive', () => ({
zip: jest.fn(),
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
"@onekeyfe/cross-inpage-provider-injected": "1.1.30",
"@onekeyfe/cross-inpage-provider-types": "1.1.30",
"@onekeyfe/extension-bridge-hosted": "1.1.30",
"@onekeyfe/hd-ble-sdk": "0.3.15",
"@onekeyfe/hd-core": "0.3.15",
"@onekeyfe/hd-shared": "0.3.15",
"@onekeyfe/hd-transport": "0.3.15",
"@onekeyfe/hd-web-sdk": "0.3.15",
"@onekeyfe/hd-ble-sdk": "0.3.17",
"@onekeyfe/hd-core": "0.3.17",
"@onekeyfe/hd-shared": "0.3.17",
"@onekeyfe/hd-transport": "0.3.17",
"@onekeyfe/hd-web-sdk": "0.3.17",
"@onekeyfe/onekey-cross-webview": "1.1.30",
"@starcoin/starcoin": "2.1.5",
"@web3-react/core": "8.0.35-beta.0",
Expand Down Expand Up @@ -149,6 +149,7 @@
"globalthis": "^1.0.2",
"http-server": "^14.0.0",
"husky": "^7.0.4",
"isomorphic-ws": "^5.0.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"jest-expo": "^47.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/blockchain-libs/src/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const IMPLS: { [key: string]: any } = {
fil: mockProvider,
tron: mockProvider,
kaspa: mockProvider,
nexa: mockProvider,
lightning: mockProvider,
tlightning: mockProvider,
};
Expand Down
9 changes: 9 additions & 0 deletions packages/desktop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { registerRootComponent } from 'expo';

import App from './App';

const fixPatches = () => {
// fix BN.prototype.toBuffer is missing in Web Platform
const BN = require('bn.js');

BN.prototype.toBuffer = function toBuffer(endian, length) {
return this.toArrayLike(Buffer, endian, length);
};
};
fixPatches();
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
Expand Down
4 changes: 3 additions & 1 deletion packages/engine/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ class Engine {
const addresses = await Promise.all(
accounts.map(async (a) => {
if (a.type === AccountType.UTXO) {
return (a as DBUTXOAccount).address;
console.log(vault.getDisplayAddress(a.address));
return vault.getDisplayAddress(a.address);
}
if (a.type === AccountType.VARIANT) {
return vault.addressFromBase(a);
Expand Down Expand Up @@ -826,6 +827,7 @@ class Engine {
'354': OnekeyNetwork.dot,
'128': OnekeyNetwork.xmr,
'111111': OnekeyNetwork.kaspa,
'29223': OnekeyNetwork.nexa,
}[coinType];
if (typeof networkId === 'undefined') {
throw new NotImplemented('Unsupported network.');
Expand Down
2 changes: 2 additions & 0 deletions packages/engine/src/managers/derivation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
COINTYPE_LIGHTNING_TESTNET,
COINTYPE_LTC,
COINTYPE_NEAR,
COINTYPE_NEXA,
COINTYPE_SOL,
COINTYPE_STC,
COINTYPE_SUI,
Expand Down Expand Up @@ -101,6 +102,7 @@ const derivationPathTemplates: Record<string, string> = {
[COINTYPE_DOGE]: `m/44'/${COINTYPE_DOGE}'/${INCREMENT_LEVEL_TAG}'`,
[COINTYPE_LTC]: `m/${PURPOSE_TAG}'/${COINTYPE_LTC}'/${INCREMENT_LEVEL_TAG}'`,
[COINTYPE_BCH]: `m/44'/${COINTYPE_BCH}'/${INCREMENT_LEVEL_TAG}'`,
[COINTYPE_NEXA]: `m/44'/${COINTYPE_NEXA}'/${INCREMENT_LEVEL_TAG}`,
[COINTYPE_XRP]: `m/44'/${COINTYPE_XRP}'/${INCREMENT_LEVEL_TAG}'/0/0`,
[COINTYPE_COSMOS]: `m/44'/${COINTYPE_COSMOS}'/0'/0/${INCREMENT_LEVEL_TAG}`,
[COINTYPE_ADA]: `m/1852'/${COINTYPE_ADA}'/${INCREMENT_LEVEL_TAG}'`,
Expand Down
4 changes: 4 additions & 0 deletions packages/engine/src/managers/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
COINTYPE_LIGHTNING_TESTNET,
COINTYPE_LTC,
COINTYPE_NEAR,
COINTYPE_NEXA,
COINTYPE_SOL,
COINTYPE_STC,
COINTYPE_SUI,
Expand All @@ -41,6 +42,7 @@ import {
IMPL_LIGHTNING_TESTNET,
IMPL_LTC,
IMPL_NEAR,
IMPL_NEXA,
IMPL_SOL,
IMPL_STC,
IMPL_SUI,
Expand Down Expand Up @@ -85,6 +87,7 @@ const implToCoinTypes: Partial<Record<string, string | string[]>> = {
[IMPL_DOT]: COINTYPE_DOT,
[IMPL_XMR]: COINTYPE_XMR,
[IMPL_KASPA]: COINTYPE_KASPA,
[IMPL_NEXA]: COINTYPE_NEXA,
[IMPL_LIGHTNING]: COINTYPE_LIGHTNING,
[IMPL_LIGHTNING_TESTNET]: COINTYPE_LIGHTNING_TESTNET,
};
Expand Down Expand Up @@ -147,6 +150,7 @@ const defaultCurveMap: Record<string, Curve> = {
[IMPL_DOGE]: Curve.SECP256K1,
[IMPL_LTC]: Curve.SECP256K1,
[IMPL_BCH]: Curve.SECP256K1,
[IMPL_NEXA]: Curve.SECP256K1,
[IMPL_XRP]: Curve.SECP256K1,
[IMPL_COSMOS]: Curve.SECP256K1,
[IMPL_ADA]: Curve.ED25519,
Expand Down
10 changes: 8 additions & 2 deletions packages/engine/src/secret/hash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import crypto from 'crypto';

import { HmacSha512, Sha256 } from 'asmcrypto.js';
import { HmacSha256, HmacSha512, Sha256 } from 'asmcrypto.js';
ByteZhang1024 marked this conversation as resolved.
Show resolved Hide resolved

function hmacSHA256(key: Buffer, data: Buffer): Buffer {
return Buffer.from(
new HmacSha256(key).process(data).finish().result as Uint8Array,
);
}

function hmacSHA512(key: Buffer, data: Buffer): Buffer {
return Buffer.from(
Expand All @@ -16,4 +22,4 @@ function hash160(data: Buffer): Buffer {
return crypto.createHash('ripemd160').update(sha256(data)).digest();
}

export { hmacSHA512, sha256, hash160 };
export { hmacSHA256, hmacSHA512, sha256, hash160 };
4 changes: 4 additions & 0 deletions packages/engine/src/vaults/factory.createVaultSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
IMPL_LIGHTNING_TESTNET,
IMPL_LTC,
IMPL_NEAR,
IMPL_NEXA,
IMPL_SOL,
IMPL_STC,
IMPL_SUI,
Expand Down Expand Up @@ -106,6 +107,9 @@ export function createVaultSettings(options: {
if (impl === IMPL_KASPA) {
return require('./impl/kaspa/settings').default as IVaultSettings;
}
if (impl === IMPL_NEXA) {
return require('./impl/nexa/settings').default as IVaultSettings;
}
if (impl === IMPL_LIGHTNING) {
return require('./impl/lightning-network/settings')
.default as IVaultSettings;
Expand Down
9 changes: 9 additions & 0 deletions packages/engine/src/vaults/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
IMPL_LIGHTNING_TESTNET,
IMPL_LTC,
IMPL_NEAR,
IMPL_NEXA,
IMPL_SOL,
IMPL_STC,
IMPL_SUI,
Expand Down Expand Up @@ -51,6 +52,7 @@ import VaultHelperKaspa from './impl/kaspa/VaultHelper';
import VaultHelperLightning from './impl/lightning-network/VaultHelper';
import VaultHelperLtc from './impl/ltc/VaultHelper';
import VaultHelperNear from './impl/near/VaultHelper';
import VaultHelperNexa from './impl/nexa/VaultHelper';
import VauleHelperSol from './impl/sol/VaultHelper';
import VaultHelperStc from './impl/stc/VaultHelper';
import VaultHelperSui from './impl/sui/VaultHelper';
Expand Down Expand Up @@ -131,6 +133,9 @@ export async function createVaultHelperInstance(
if (impl === IMPL_KASPA) {
return new VaultHelperKaspa(options);
}
if (impl === IMPL_NEXA) {
return new VaultHelperNexa(options);
}
if (impl === IMPL_LIGHTNING || impl === IMPL_LIGHTNING_TESTNET) {
return new VaultHelperLightning(options);
}
Expand Down Expand Up @@ -262,6 +267,10 @@ export async function createVaultInstance(options: IVaultOptions) {
const VaultKaspa = (await import('./impl/kaspa/Vault')).default;
vault = new VaultKaspa(options);
}
if (network.impl === IMPL_NEXA) {
const VaultNexa = (await import('./impl/nexa/Vault')).default;
vault = new VaultNexa(options);
}
if (
network.impl === IMPL_LIGHTNING ||
network.impl === IMPL_LIGHTNING_TESTNET
Expand Down
135 changes: 135 additions & 0 deletions packages/engine/src/vaults/impl/nexa/@tests/nexaMockData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import mockCredentials from '../../../../../@tests/mockCredentials';
import { AccountType } from '../../../../types/account';

import type { IUnitTestMockAccount } from '../../../../../@tests/types';
import type { DBNetwork } from '../../../../types/network';

// indexedDB -> networks
const network: DBNetwork = {
balance2FeeDecimals: 0,
decimals: 2,
enabled: true,
feeDecimals: 2,
feeSymbol: 'TNEX',
id: 'nexa--testnet',
impl: 'nexa',
logoURI: 'https://onekey-asset.com/assets/nexa/nexa.png',
name: 'Nexa Testnet',
position: 33,
rpcURL: 'wss://testnet-explorer.nexa.org:30004/nexa_ws',
symbol: 'NEXA',
};

const hdAccount1: IUnitTestMockAccount = {
// indexedDB -> accounts
account: {
'name': 'NEXA #1',
'address':
'02e3027885ce1ed1d21300158ce8f60649e280e2a8f746e9cea6858a3331021d8a',
'addresses': {
'nexa--testnet':
'02e3027885ce1ed1d21300158ce8f60649e280e2a8f746e9cea6858a3331021d8a',
},
'xpub': '',
'coinType': '29223',
'id': "hd-19--m/44'/29223'/0'/0/0",
'path': "m/44'/29223'/0'/0/0",
'template': "m/44'/29223'/$$INDEX$$'/0/0",
'type': AccountType.UTXO,
},
mnemonic: mockCredentials.mnemonic1,
password: mockCredentials.password,
};

const importedAccount1: IUnitTestMockAccount = {
// indexedDB -> accounts
account: {
'address':
'03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
'addresses': {
'nexa--testnet':
'03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
},
'coinType': '29223',
'id': 'imported--29223--03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
name: 'Account #1',
path: '',
xpub: '',
type: AccountType.UTXO,
},
// indexedDB -> credentials
privateKey:
'6b4d9dee8a37f4329cbf7db9a137a2ecdc63be8e6caa881ef05b3a3349ef8db9',
password: mockCredentials.password,
};

const importedAccount2: IUnitTestMockAccount = {
account: {
'address':
'03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
'addresses': {
'nexa--testnet':
'03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
},
'coinType': '29223',
'id': 'imported--29223--03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
name: 'Account #1',
path: '',
xpub: '',
type: AccountType.UTXO,
},
// indexedDB -> credentials
privateKey:
'b848990d04878c4bbdcb671f45ed02807bcb4b200bfab2d636cb088e921b483fb01e7b872377c5b6dd582f0ca5d16ae5e4565163607df61ec5b5c96cbde8f4bb892865e079c0c4d64f29e5ba8b6a8d80317c1c7a97cf476a7459d24aa80d2a0f',
password: '12345678',
};

const watchingAccount1: IUnitTestMockAccount = {
account: {
address: 'nexatest:nqtsq5g5s9cd8fsl9d9a7jhsuzsw7u9exztnnz8n9un89t0k',
'coinType': '29223',
'id': 'external--29223--nexatest:nqtsq5g5s9cd8fsl9d9a7jhsuzsw7u9exztnnz8n9un89t0k',
name: 'Account #1',
path: '',
pub: '',
type: AccountType.SIMPLE,
},
password: '',
};

const watchingAccount2: IUnitTestMockAccount = {
account: {
address: 'nexatest:fmza0ttf3pnv5zpg8e2q8lr3t2cesrrv9xdk395r5g5qsqtn',
coinType: '29223',
id: 'external--397--ed25519:8wbWQQkeK9NV1qkiQZ95jbj7JNhpeapHafLPw3qsJdqi',
name: 'Account #1',
path: '',
pub: '',
type: AccountType.SIMPLE,
},
password: '',
};

const watchingAccount3: IUnitTestMockAccount = {
account: {
address:
'03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
coinType: '29223',
id: 'external--29223--03560d4451deeef0d1bcc46ff062372400ecf7b6e4e058ef01792f140ce2a97c31',
name: 'Account #1',
path: '',
pub: '',
type: AccountType.UTXO,
},
password: '',
};

export default {
network,
hdAccount1,
importedAccount1,
importedAccount2,
watchingAccount1,
watchingAccount2,
watchingAccount3,
};
Loading