diff --git a/cashtab/src/utils/__mocks__/createToken.js b/cashtab/src/utils/__mocks__/createToken.js --- a/cashtab/src/utils/__mocks__/createToken.js +++ b/cashtab/src/utils/__mocks__/createToken.js @@ -1,6 +1,8 @@ export default { invalidWallet: {}, wallet: { + mnemonic: 'Remembered to take this out this time', + name: 'VegasTrip', Path1899: { cashAddress: 'bitcoincash:qpuvjl7l3crt3apc62gmtf49pfsluu7s9gsex3qnhn', diff --git a/cashtab/src/utils/__mocks__/mockStoredWallets.js b/cashtab/src/utils/__mocks__/mockStoredWallets.js --- a/cashtab/src/utils/__mocks__/mockStoredWallets.js +++ b/cashtab/src/utils/__mocks__/mockStoredWallets.js @@ -1088,6 +1088,1087 @@ }, }; +export const invalidStoredWalletMissingPath1899AndMnemonic = { + name: 'TripDos', + Path245: { + cashAddress: 'bitcoincash:qq0mw6nah9huwaxt45qw3fegjpszkjlrqsvttwy36p', + slpAddress: 'simpleledger:qq0mw6nah9huwaxt45qw3fegjpszkjlrqsqsq433yl', + fundingWif: 'Nope', + fundingAddress: + 'simpleledger:qq0mw6nah9huwaxt45qw3fegjpszkjlrqsqsq433yl', + legacyAddress: '13thfuvhCA1dGE7nVgyU61BZfoD8ApXJsg', + }, + Path145: { + cashAddress: 'bitcoincash:qz5lf9pxde9neq3hzte8mmwts03sktl9nuz6m3dynu', + slpAddress: 'simpleledger:qz5lf9pxde9neq3hzte8mmwts03sktl9nuwps2cydz', + fundingWif: 'Nope', + fundingAddress: + 'simpleledger:qz5lf9pxde9neq3hzte8mmwts03sktl9nuwps2cydz', + legacyAddress: '1GVeC3gB6V3EStcQbJiry5BJn4fRdHjKyc', + }, + state: { + balances: { + totalBalanceInSatoshis: '1503017804', + totalBalance: '15030178.04', + }, + tokens: [ + { + info: { + height: 680782, + tx_hash: + '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + tx_pos: 1, + value: 546, + txid: '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bf24d955f59351e738ecd905966606a6837e478e1982943d724eab10caad82fd', + tokenTicker: 'ST', + tokenName: 'ST', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'bf24d955f59351e738ecd905966606a6837e478e1982943d724eab10caad82fd', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 680784, + tx_hash: + 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + tx_pos: 1, + value: 546, + txid: 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1e-9', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + balance: { + s: 1, + e: -9, + c: [100000], + }, + hasBaton: false, + }, + { + info: { + height: 681189, + tx_hash: + 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + tx_pos: 2, + value: 546, + txid: 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + tokenTicker: 'WDT', + tokenName: + 'Test Token With Exceptionally Long Name For CSS And Style Revisions', + tokenDocumentUrl: + 'https://www.ImpossiblyLongWebsiteDidYouThinkWebDevWouldBeFun.org', + tokenDocumentHash: + '����\\�IS\u001e9�����k+���\u0018���\u001b]�߷2��', + decimals: 7, + tokenType: 1, + tokenQty: '523512277.7961432', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + balance: { + s: 1, + e: 8, + c: [523512277, 79614320000000], + }, + hasBaton: false, + }, + { + info: { + height: 681190, + tx_hash: + 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + tx_pos: 2, + value: 546, + txid: 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '1f6a65e7a4bde92c0a012de2bcf4007034504a765377cdf08a3ee01d1eaa6901', + tokenTicker: '🍔', + tokenName: 'Burger', + tokenDocumentUrl: + 'https://c4.wallpaperflare.com/wallpaper/58/564/863/giant-hamburger-wallpaper-preview.jpg', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '1f6a65e7a4bde92c0a012de2bcf4007034504a765377cdf08a3ee01d1eaa6901', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + tx_pos: 2, + value: 546, + txid: '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '4bd147fc5d5ff26249a9299c46b80920c0b81f59a60e05428262160ebee0b0c3', + tokenTicker: 'NOCOVID', + tokenName: 'Covid19 Lifetime Immunity', + tokenDocumentUrl: + 'https://www.who.int/emergencies/diseases/novel-coronavirus-2019/covid-19-vaccines', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '996797', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '4bd147fc5d5ff26249a9299c46b80920c0b81f59a60e05428262160ebee0b0c3', + balance: { + s: 1, + e: 5, + c: [996797], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + tx_pos: 2, + value: 546, + txid: 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + tokenTicker: 'TAP', + tokenName: 'Thoughts and Prayers', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + tx_pos: 2, + value: 546, + txid: 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + tokenTicker: 'NAKAMOTO', + tokenName: 'NAKAMOTO', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 8, + tokenType: 1, + tokenQty: '0.99999999', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + balance: { + s: 1, + e: -1, + c: [99999999000000], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + tx_pos: 2, + value: 546, + txid: 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '7f8889682d57369ed0e32336f8b7e0ffec625a35cca183f4e81fde4e71a538a1', + tokenTicker: 'HONK', + tokenName: 'HONK HONK', + tokenDocumentUrl: 'THE REAL HONK SLP TOKEN', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '7f8889682d57369ed0e32336f8b7e0ffec625a35cca183f4e81fde4e71a538a1', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 681329, + tx_hash: + '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + tx_pos: 2, + value: 546, + txid: '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + tokenTicker: 'XBIT', + tokenName: 'eBits', + tokenDocumentUrl: 'https://boomertakes.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '999997.999999994', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + balance: { + s: 1, + e: 5, + c: [999997, 99999999400000], + }, + hasBaton: false, + }, + ], + slpBalancesAndUtxos: { + tokens: [ + { + info: { + height: 680782, + tx_hash: + '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + tx_pos: 1, + value: 546, + txid: '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bf24d955f59351e738ecd905966606a6837e478e1982943d724eab10caad82fd', + tokenTicker: 'ST', + tokenName: 'ST', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'bf24d955f59351e738ecd905966606a6837e478e1982943d724eab10caad82fd', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 680784, + tx_hash: + 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + tx_pos: 1, + value: 546, + txid: 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1e-9', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + balance: { + s: 1, + e: -9, + c: [100000], + }, + hasBaton: false, + }, + { + info: { + height: 681189, + tx_hash: + 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + tx_pos: 2, + value: 546, + txid: 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + tokenTicker: 'WDT', + tokenName: + 'Test Token With Exceptionally Long Name For CSS And Style Revisions', + tokenDocumentUrl: + 'https://www.ImpossiblyLongWebsiteDidYouThinkWebDevWouldBeFun.org', + tokenDocumentHash: + '����\\�IS\u001e9�����k+���\u0018���\u001b]�߷2��', + decimals: 7, + tokenType: 1, + tokenQty: '523512277.7961432', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + balance: { + s: 1, + e: 8, + c: [523512277, 79614320000000], + }, + hasBaton: false, + }, + { + info: { + height: 681190, + tx_hash: + 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + tx_pos: 2, + value: 546, + txid: 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '1f6a65e7a4bde92c0a012de2bcf4007034504a765377cdf08a3ee01d1eaa6901', + tokenTicker: '🍔', + tokenName: 'Burger', + tokenDocumentUrl: + 'https://c4.wallpaperflare.com/wallpaper/58/564/863/giant-hamburger-wallpaper-preview.jpg', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '1f6a65e7a4bde92c0a012de2bcf4007034504a765377cdf08a3ee01d1eaa6901', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + tx_pos: 2, + value: 546, + txid: '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '4bd147fc5d5ff26249a9299c46b80920c0b81f59a60e05428262160ebee0b0c3', + tokenTicker: 'NOCOVID', + tokenName: 'Covid19 Lifetime Immunity', + tokenDocumentUrl: + 'https://www.who.int/emergencies/diseases/novel-coronavirus-2019/covid-19-vaccines', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '996797', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '4bd147fc5d5ff26249a9299c46b80920c0b81f59a60e05428262160ebee0b0c3', + balance: { + s: 1, + e: 5, + c: [996797], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + tx_pos: 2, + value: 546, + txid: 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + tokenTicker: 'TAP', + tokenName: 'Thoughts and Prayers', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + tx_pos: 2, + value: 546, + txid: 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + tokenTicker: 'NAKAMOTO', + tokenName: 'NAKAMOTO', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 8, + tokenType: 1, + tokenQty: '0.99999999', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + balance: { + s: 1, + e: -1, + c: [99999999000000], + }, + hasBaton: false, + }, + { + info: { + height: 681191, + tx_hash: + 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + tx_pos: 2, + value: 546, + txid: 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '7f8889682d57369ed0e32336f8b7e0ffec625a35cca183f4e81fde4e71a538a1', + tokenTicker: 'HONK', + tokenName: 'HONK HONK', + tokenDocumentUrl: 'THE REAL HONK SLP TOKEN', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '7f8889682d57369ed0e32336f8b7e0ffec625a35cca183f4e81fde4e71a538a1', + balance: { + s: 1, + e: 0, + c: [1], + }, + hasBaton: false, + }, + { + info: { + height: 681329, + tx_hash: + '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + tx_pos: 2, + value: 546, + txid: '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + tokenTicker: 'XBIT', + tokenName: 'eBits', + tokenDocumentUrl: 'https://boomertakes.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '999997.999999994', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + balance: { + s: 1, + e: 5, + c: [999997, 99999999400000], + }, + hasBaton: false, + }, + ], + nonSlpUtxos: [ + { + height: 682107, + tx_hash: + '8d4c90ecf069e3a1494339724ddbb8bf28e3b38315a009ca5c49237b3ae7687a', + tx_pos: 1, + value: 1503017804, + txid: '8d4c90ecf069e3a1494339724ddbb8bf28e3b38315a009ca5c49237b3ae7687a', + isValid: false, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + outpoint: { + outIdx: 1, + txid: '8d4c90ecf069e3a1494339724ddbb8bf28e3b38315a009ca5c49237b3ae7687a', + }, + }, + ], + slpUtxos: [ + { + height: 680782, + tx_hash: + '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + tx_pos: 1, + value: 546, + txid: '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenTicker: 'ST', + tokenName: 'ST', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + slpMeta: { + tokenId: + 'bf24d955f59351e738ecd905966606a6837e478e1982943d724eab10caad82fd', + }, + }, + { + height: 680784, + tx_hash: + 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + tx_pos: 1, + value: 546, + txid: 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + vout: 1, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + }, + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1e-9', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681189, + tx_hash: + 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + tx_pos: 2, + value: 546, + txid: 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + }, + tokenTicker: 'WDT', + tokenName: + 'Test Token With Exceptionally Long Name For CSS And Style Revisions', + tokenDocumentUrl: + 'https://www.ImpossiblyLongWebsiteDidYouThinkWebDevWouldBeFun.org', + tokenDocumentHash: + '����\\�IS\u001e9�����k+���\u0018���\u001b]�߷2��', + decimals: 7, + tokenType: 1, + tokenQty: '523512277.7961432', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681190, + tx_hash: + 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + tx_pos: 2, + value: 546, + txid: 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + '1f6a65e7a4bde92c0a012de2bcf4007034504a765377cdf08a3ee01d1eaa6901', + }, + tokenTicker: '🍔', + tokenName: 'Burger', + tokenDocumentUrl: + 'https://c4.wallpaperflare.com/wallpaper/58/564/863/giant-hamburger-wallpaper-preview.jpg', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681191, + tx_hash: + '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + tx_pos: 2, + value: 546, + txid: '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + '4bd147fc5d5ff26249a9299c46b80920c0b81f59a60e05428262160ebee0b0c3', + }, + tokenTicker: 'NOCOVID', + tokenName: 'Covid19 Lifetime Immunity', + tokenDocumentUrl: + 'https://www.who.int/emergencies/diseases/novel-coronavirus-2019/covid-19-vaccines', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '996797', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681191, + tx_hash: + 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + tx_pos: 2, + value: 546, + txid: 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + }, + tokenTicker: 'TAP', + tokenName: 'Thoughts and Prayers', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681191, + tx_hash: + 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + tx_pos: 2, + value: 546, + txid: 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + }, + tokenTicker: 'NAKAMOTO', + tokenName: 'NAKAMOTO', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 8, + tokenType: 1, + tokenQty: '0.99999999', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681191, + tx_hash: + 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + tx_pos: 2, + value: 546, + txid: 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + '7f8889682d57369ed0e32336f8b7e0ffec625a35cca183f4e81fde4e71a538a1', + }, + tokenTicker: 'HONK', + tokenName: 'HONK HONK', + tokenDocumentUrl: 'THE REAL HONK SLP TOKEN', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + { + height: 681329, + tx_hash: + '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + tx_pos: 2, + value: 546, + txid: '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + vout: 2, + utxoType: 'token', + transactionType: 'send', + slpMeta: { + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + }, + tokenTicker: 'XBIT', + tokenName: 'eBits', + tokenDocumentUrl: 'https://boomertakes.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '999997.999999994', + isValid: true, + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + ], + }, + parsedTxHistory: [ + { + txid: '8d4c90ecf069e3a1494339724ddbb8bf28e3b38315a009ca5c49237b3ae7687a', + confirmations: 644, + height: 682107, + blocktime: 1618439595, + amountSent: 0.00002, + amountReceived: 0, + tokenTx: false, + outgoingTx: true, + destinationAddress: + 'bitcoincash:qqartrrq3npyzpcqswq2hcslstzu38mq8gvgtuqfpf', + }, + { + txid: '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + confirmations: 1422, + height: 681329, + blocktime: 1617988189, + amountSent: 0.00000546, + amountReceived: 0, + tokenTx: true, + outgoingTx: true, + destinationAddress: + 'bitcoincash:qqartrrq3npyzpcqswq2hcslstzu38mq8gvgtuqfpf', + tokenInfo: { + qtySent: '1e-9', + qtyReceived: '0', + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + tokenName: 'eBits', + tokenTicker: 'XBIT', + }, + }, + { + txid: 'f27ff24c15b01c30d44218c6dc8706fd33cc7bc9b4b38399075f0f41d8e412af', + confirmations: 1559, + height: 681192, + blocktime: 1617923457, + amountSent: 0.00000546, + amountReceived: 0, + tokenTx: true, + outgoingTx: true, + destinationAddress: + 'bitcoincash:qqartrrq3npyzpcqswq2hcslstzu38mq8gvgtuqfpf', + tokenInfo: { + qtySent: '5e-9', + qtyReceived: '0', + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + tokenName: 'eBits', + tokenTicker: 'XBIT', + }, + }, + { + txid: 'b7f8b23f5ce12842eb655239919b6142052a2fa2b2ce974a4baac36b0137f332', + confirmations: 1559, + height: 681192, + blocktime: 1617923457, + amountSent: 0.00000546, + amountReceived: 0, + tokenTx: true, + outgoingTx: true, + destinationAddress: + 'bitcoincash:qqartrrq3npyzpcqswq2hcslstzu38mq8gvgtuqfpf', + tokenInfo: { + qtySent: '4e-9', + qtyReceived: '0', + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + tokenName: 'eBits', + tokenTicker: 'XBIT', + }, + }, + { + txid: '880baf5691c2b4c5a22ae4032e2004c0c54bfabf003468044a2e341846137136', + confirmations: 1559, + height: 681192, + blocktime: 1617923457, + amountSent: 0.00000546, + amountReceived: 0, + tokenTx: true, + outgoingTx: true, + destinationAddress: + 'bitcoincash:qqartrrq3npyzpcqswq2hcslstzu38mq8gvgtuqfpf', + tokenInfo: { + qtySent: '3e-9', + qtyReceived: '0', + tokenId: + '1101bd5d7b6bbc3176fb2b93d08e76ab532b04ff731d71502249e3cb9b6fcb1a', + tokenName: 'eBits', + tokenTicker: 'XBIT', + }, + }, + ], + utxos: [ + { + utxos: [], + address: + 'bitcoincash:qq0mw6nah9huwaxt45qw3fegjpszkjlrqsvttwy36p', + }, + { + utxos: [], + address: + 'bitcoincash:qz5lf9pxde9neq3hzte8mmwts03sktl9nuz6m3dynu', + }, + { + utxos: [ + { + height: 680782, + tx_hash: + '525457276f1b6984170c9b35a8312d4988fce495723eabadd2afcdb3b872b2f1', + tx_pos: 1, + value: 546, + }, + { + height: 680784, + tx_hash: + '28f061fee068d3b9cb578141bac3d4d9ec4eccebec680464bf0aafaac414811f', + tx_pos: 1, + value: 546, + }, + { + height: 680784, + tx_hash: + '5fa3ffccea55c968beb7d214c563c92336ce2bbccbb714ba819848a7f7060bdb', + tx_pos: 1, + value: 546, + }, + { + height: 680784, + tx_hash: + 'daa98a872b7d88fefd2257b006db001ef82a601f3943b92e0c753076598a7b75', + tx_pos: 1, + value: 546, + }, + { + height: 681189, + tx_hash: + 'f38ccfa615e38f0c871f4eb35db420157808014f1f5743f1522529253c0c4c56', + tx_pos: 2, + value: 546, + }, + { + height: 681190, + tx_hash: + 'e9dca9aa954131a0004325fff11dfddcd6e5843c468116cf4d38cb264032cdc0', + tx_pos: 2, + value: 546, + }, + { + height: 681191, + tx_hash: + '091c9f32deb2f4f3733673803f51acf050b65d8042d1561824c6cd22d14bb43b', + tx_pos: 2, + value: 546, + }, + { + height: 681191, + tx_hash: + 'b35c502f388cdfbdd6841b7a73e973149b3c8deca76295a3e4665939e0562796', + tx_pos: 2, + value: 546, + }, + { + height: 681191, + tx_hash: + 'c70408fca1a5bf48f338f7ef031e586293be6948a5bff1fbbdd4eb923ef11e59', + tx_pos: 2, + value: 546, + }, + { + height: 681191, + tx_hash: + 'e1097932e5a607c100dc73fa18169be2e501e1782c7c94500742974d6353476c', + tx_pos: 2, + value: 546, + }, + { + height: 681329, + tx_hash: + '08e9a7b9537e60f630eba0f339be6b97e9d8061d5fc0c4d3247226fc86574ce9', + tx_pos: 2, + value: 546, + }, + { + height: 682107, + tx_hash: + '8d4c90ecf069e3a1494339724ddbb8bf28e3b38315a009ca5c49237b3ae7687a', + tx_pos: 1, + value: 1503017804, + }, + ], + address: + 'bitcoincash:qz2708636snqhsxu8wnlka78h6fdp77ar5ulhz04hr', + }, + ], + }, +}; + export const validStoredWalletAfter20221123Streamline = { mnemonic: 'Nope', name: 'TripDos', diff --git a/cashtab/src/utils/__tests__/cashMethods.test.js b/cashtab/src/utils/__tests__/cashMethods.test.js --- a/cashtab/src/utils/__tests__/cashMethods.test.js +++ b/cashtab/src/utils/__tests__/cashMethods.test.js @@ -57,6 +57,7 @@ invalidStoredWallet, invalidpreChronikStoredWallet, validStoredWalletAfter20221123Streamline, + invalidStoredWalletMissingPath1899AndMnemonic, } from '../__mocks__/mockStoredWallets'; import { @@ -1543,6 +1544,11 @@ it(`Recognizes a stored wallet as invalid if it includes hydratedUtxoDetails in the state field`, () => { expect(isValidStoredWallet(invalidpreChronikStoredWallet)).toBe(false); }); + it(`Recognizes a stored wallet as invalid if it's missing the Path1899 and mnemonic keys`, () => { + expect( + isValidStoredWallet(invalidStoredWalletMissingPath1899AndMnemonic), + ).toBe(false); + }); it(`Converts a legacy BCH amount to an XEC amount`, () => { expect(fromLegacyDecimals(0.00000546, 2)).toStrictEqual(5.46); }); diff --git a/cashtab/src/utils/cashMethods.js b/cashtab/src/utils/cashMethods.js --- a/cashtab/src/utils/cashMethods.js +++ b/cashtab/src/utils/cashMethods.js @@ -1076,6 +1076,11 @@ return ( typeof walletStateFromStorage === 'object' && 'state' in walletStateFromStorage && + 'mnemonic' in walletStateFromStorage && + 'name' in walletStateFromStorage && + 'Path245' in walletStateFromStorage && + 'Path145' in walletStateFromStorage && + 'Path1899' in walletStateFromStorage && typeof walletStateFromStorage.state === 'object' && 'balances' in walletStateFromStorage.state && !('hydratedUtxoDetails' in walletStateFromStorage.state) &&