diff --git a/web/cashtab/src/hooks/__mocks__/mockReturnGetHydratedUtxoDetailsWithZeroBalance.js b/web/cashtab/src/hooks/__mocks__/mockReturnGetHydratedUtxoDetailsWithZeroBalance.js new file mode 100644 --- /dev/null +++ b/web/cashtab/src/hooks/__mocks__/mockReturnGetHydratedUtxoDetailsWithZeroBalance.js @@ -0,0 +1,761 @@ +export default { + slpUtxos: [ + { + utxos: [ + { + height: 660869, + tx_hash: + '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f2ff4d28e3f660', + tx_pos: 1, + value: 546, + txid: + '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f2ff4d28e3f660', + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660869, + tx_hash: + 'c7da9ae6a0ce9d4f2f3345f9f0e5da5371228c8aee72b6eeac1b42871b216e6b', + tx_pos: 1, + value: 546, + txid: + 'c7da9ae6a0ce9d4f2f3345f9f0e5da5371228c8aee72b6eeac1b42871b216e6b', + vout: 1, + 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: '2', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660869, + tx_hash: + 'dac23f10dd65caa51359c1643ffc93b94d14c05b739590ade85557d338a21040', + tx_pos: 1, + value: 546, + txid: + 'dac23f10dd65caa51359c1643ffc93b94d14c05b739590ade85557d338a21040', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660869, + tx_hash: + 'efa6f67078810875513a116b389886610d81ecf6daf97d55dd96d3fdd201dfac', + tx_pos: 1, + value: 546, + txid: + 'efa6f67078810875513a116b389886610d81ecf6daf97d55dd96d3fdd201dfac', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + tokenTicker: 'TAP', + tokenName: 'Thoughts and Prayers', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '2', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660978, + tx_hash: + 'b622b770f74f056e07e5d2ea4d7f8da1c4d865e21e11c31a263602a38d4a2474', + tx_pos: 2, + value: 546, + txid: + 'b622b770f74f056e07e5d2ea4d7f8da1c4d865e21e11c31a263602a38d4a2474', + vout: 2, + utxoType: 'minting-baton', + transactionType: 'mint', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenType: 1, + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + mintBatonVout: 2, + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660982, + tx_hash: + '67605f3d18135b52d95a4877a427d100c14f2610c63ee84eaf4856f883a0b70e', + tx_pos: 2, + value: 546, + txid: + '67605f3d18135b52d95a4877a427d100c14f2610c63ee84eaf4856f883a0b70e', + vout: 2, + utxoType: 'minting-baton', + transactionType: 'mint', + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + tokenType: 1, + 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, + mintBatonVout: 2, + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 662159, + tx_hash: + '05e90e9f35bc041a2939e0e28cf9c436c9adb0f247a7fb0d1f4abb26d418f096', + tx_pos: 1, + value: 546, + txid: + '05e90e9f35bc041a2939e0e28cf9c436c9adb0f247a7fb0d1f4abb26d418f096', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '150', + isValid: false, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 662799, + tx_hash: + 'b399a5ae69e4ac4c96b27c680a541e6b8142006bdc2484a959821858fc0b4ca3', + tx_pos: 2, + value: 546, + txid: + 'b399a5ae69e4ac4c96b27c680a541e6b8142006bdc2484a959821858fc0b4ca3', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '310', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 662935, + tx_hash: + 'ec423d0089f5cd85973ff6d875e9507f6b396b3b82bf6e9f5cfb24b7c70273bd', + tx_pos: 1, + value: 546, + txid: + 'ec423d0089f5cd85973ff6d875e9507f6b396b3b82bf6e9f5cfb24b7c70273bd', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'acba1d7f354c6d4d001eb99d31de174e5cea8a31d692afd6e7eb8474ad541f55', + tokenTicker: 'CTB', + tokenName: 'CashTabBits', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: false, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 662987, + tx_hash: + '9b4361b24c756ff7a74ea5261be565acade0b246fb85422086ac273c1e4ee7d5', + tx_pos: 1, + value: 546, + txid: + '9b4361b24c756ff7a74ea5261be565acade0b246fb85422086ac273c1e4ee7d5', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + '6a4c8bfa2e3ca345795dc3bde84d647390e9e1f2ff96e535cd2754d8ea5a3539', + tokenTicker: 'CTB2', + tokenName: 'CashTabBitsReborn', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '10000000000', + isValid: false, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667561, + tx_hash: + '4ca7f70996c699b0f988597a2dd2700f1f24f305318ddc8fe137d96d5fa96bf5', + tx_pos: 1, + value: 546, + txid: + '4ca7f70996c699b0f988597a2dd2700f1f24f305318ddc8fe137d96d5fa96bf5', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667750, + tx_hash: + 'de912bc7a6a1b14abe04960cd9a0ef88a4f59eb04db765f7bc2c0d2c2f997054', + tx_pos: 1, + value: 546, + txid: + 'de912bc7a6a1b14abe04960cd9a0ef88a4f59eb04db765f7bc2c0d2c2f997054', + vout: 1, + 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: '100.0000001', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667750, + tx_hash: + 'e25cebd4cccbbdd91b36f672d51f5ce978e0817839be9854c3550704aec4359d', + tx_pos: 1, + value: 546, + txid: + 'e25cebd4cccbbdd91b36f672d51f5ce978e0817839be9854c3550704aec4359d', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667750, + tx_hash: + 'e9a94cc174839e3659d2fe4d33490528d18ad91404b65eb8cc35d8fa2d3f5096', + tx_pos: 2, + value: 546, + txid: + 'e9a94cc174839e3659d2fe4d33490528d18ad91404b65eb8cc35d8fa2d3f5096', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '5.854300861', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667751, + tx_hash: + '05e87142de1bb8c2a43d22a2e4b97855eb84c3c76f4ea956a654efda8d0557ca', + tx_pos: 1, + value: 546, + txid: + '05e87142de1bb8c2a43d22a2e4b97855eb84c3c76f4ea956a654efda8d0557ca', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1.14669914', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + ], + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + utxos: [ + { + height: 660971, + tx_hash: + 'aefc3f3c65760d0f0fa716a84d12c4dc76ca7552953d6c7a4358abb6e24c5d7c', + tx_pos: 1, + value: 546, + txid: + 'aefc3f3c65760d0f0fa716a84d12c4dc76ca7552953d6c7a4358abb6e24c5d7c', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: false, + address: + 'bitcoincash:qrcl220pxeec78vnchwyh6fsdyf60uv9tcynw3u2ev', + }, + ], + address: 'bitcoincash:qrcl220pxeec78vnchwyh6fsdyf60uv9tcynw3u2ev', + }, + { + utxos: [ + { + height: 666954, + tx_hash: + '1b19314963be975c57eb37df12b6a8e0598bcb743226cdc684895520f51c4dfe', + tx_pos: 2, + value: 546, + txid: + '1b19314963be975c57eb37df12b6a8e0598bcb743226cdc684895520f51c4dfe', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '4.97', + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 666969, + tx_hash: + '99583b593a3bec993328b076f4988fd77b8423d788183bf2968ed43cec11c454', + tx_pos: 2, + value: 546, + txid: + '99583b593a3bec993328b076f4988fd77b8423d788183bf2968ed43cec11c454', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '9897999873.21001107', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667560, + tx_hash: + '34002080b2e1b42ff9f33d36dbbd0d8f1aaddc5a00b916054a40c45feebaf548', + tx_pos: 2, + value: 546, + txid: + '34002080b2e1b42ff9f33d36dbbd0d8f1aaddc5a00b916054a40c45feebaf548', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '3.999999998', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667560, + tx_hash: + '8edccfafe4b002da8f1aa71daae31846c51848968e7d92dcba5f0ff97beb734d', + tx_pos: 2, + value: 546, + txid: + '8edccfafe4b002da8f1aa71daae31846c51848968e7d92dcba5f0ff97beb734d', + 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: '523512244.796145', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667793, + tx_hash: + '9c295332b7bc16758b2e328f21189fa0ea79f71908b47529749b3ba54e523817', + tx_pos: 1, + value: 546, + txid: + '9c295332b7bc16758b2e328f21189fa0ea79f71908b47529749b3ba54e523817', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bfddfcfc9fb9a8d61ed74fa94b5e32ccc03305797eea461658303df5805578ef', + tokenTicker: 'Sending Token', + tokenName: 'Sending Token', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667909, + tx_hash: + '5bb8f9831d616b3a859ffec4507f66bd5f2f3c057d7f5d5fa5c026216d6c2646', + tx_pos: 1, + value: 546, + txid: + '5bb8f9831d616b3a859ffec4507f66bd5f2f3c057d7f5d5fa5c026216d6c2646', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667909, + tx_hash: + 'd3183b663a8d67b2b558654896b95102bbe68d164de219da96273ae52de93813', + tx_pos: 1, + value: 546, + txid: + 'd3183b663a8d67b2b558654896b95102bbe68d164de219da96273ae52de93813', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 668550, + tx_hash: + '38a692e3fa974ee186eedc3a03bf3410dd03a5f35bc44f1a07f287b669dce44b', + tx_pos: 2, + value: 546, + txid: + '38a692e3fa974ee186eedc3a03bf3410dd03a5f35bc44f1a07f287b669dce44b', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bfddfcfc9fb9a8d61ed74fa94b5e32ccc03305797eea461658303df5805578ef', + tokenTicker: 'Sending Token', + tokenName: 'Sending Token', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 668779, + tx_hash: + '24604835e5c68aedad2dbf4200ecc1af8c3fa92738445323af86def84d48d572', + tx_pos: 1, + value: 546, + txid: + '24604835e5c68aedad2dbf4200ecc1af8c3fa92738445323af86def84d48d572', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bfddfcfc9fb9a8d61ed74fa94b5e32ccc03305797eea461658303df5805578ef', + tokenTicker: 'Sending Token', + tokenName: 'Sending Token', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 669057, + tx_hash: + 'dd560d87bd632e40c6548021006653a150197ede13fadb5eadfa29abe4400d0e', + tx_pos: 1, + value: 546, + txid: + 'dd560d87bd632e40c6548021006653a150197ede13fadb5eadfa29abe4400d0e', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + tokenTicker: 'NAKAMOTO', + tokenName: 'NAKAMOTO', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 8, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 669510, + tx_hash: + 'acbb66f826211f40b89e84d9bd2143dfb541d67e1e3c664b17ccd3ba66327a9e', + tx_pos: 1, + value: 546, + txid: + 'acbb66f826211f40b89e84d9bd2143dfb541d67e1e3c664b17ccd3ba66327a9e', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bfddfcfc9fb9a8d61ed74fa94b5e32ccc03305797eea461658303df5805578ef', + tokenTicker: 'Sending Token', + tokenName: 'Sending Token', + tokenDocumentUrl: 'developer.bitcoin.com', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '0', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 669639, + tx_hash: + '0da6d49cf95d4603958e53360ad1e90bfccef41bfb327d6b2e8a77e242fa2d58', + tx_pos: 0, + value: 1000, + txid: + '0da6d49cf95d4603958e53360ad1e90bfccef41bfb327d6b2e8a77e242fa2d58', + vout: 0, + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + '39521b38cd1b6126a57a68b8adfd836020cd53b195f3b4675c58095c5c300ef8', + tx_pos: 0, + value: 700000, + txid: + '39521b38cd1b6126a57a68b8adfd836020cd53b195f3b4675c58095c5c300ef8', + vout: 0, + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + '93949923f02cb5271bd6d0b5a5b937ce5ae22df5bf6117161078f175f0c29d56', + tx_pos: 0, + value: 700000, + txid: + '93949923f02cb5271bd6d0b5a5b937ce5ae22df5bf6117161078f175f0c29d56', + vout: 0, + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + 'ddace66ea968e16e55ebf218814401acc38e0a39150529fa3d1108af04e81373', + tx_pos: 0, + value: 300000, + txid: + 'ddace66ea968e16e55ebf218814401acc38e0a39150529fa3d1108af04e81373', + vout: 0, + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + 'f1147285ac384159b5dfae513bda47a0459f876d046b48f13c8a7ec4f0d20d96', + tx_pos: 0, + value: 700000, + txid: + 'f1147285ac384159b5dfae513bda47a0459f876d046b48f13c8a7ec4f0d20d96', + vout: 0, + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + 'f4ca891d090f2682c7086b27a4d3bc2ed1543fb96123b6649e8f26b644a45b51', + tx_pos: 0, + value: 30000, + txid: + 'f4ca891d090f2682c7086b27a4d3bc2ed1543fb96123b6649e8f26b644a45b51', + vout: 0, + isValid: false, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + ], + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + ], +}; diff --git a/web/cashtab/src/hooks/__mocks__/mockReturnGetSlpBalancesAndUtxosNoZeroBalance.js b/web/cashtab/src/hooks/__mocks__/mockReturnGetSlpBalancesAndUtxosNoZeroBalance.js new file mode 100644 --- /dev/null +++ b/web/cashtab/src/hooks/__mocks__/mockReturnGetSlpBalancesAndUtxosNoZeroBalance.js @@ -0,0 +1,733 @@ +import BigNumber from 'bignumber.js'; + +export default { + tokens: [ + { + info: { + height: 660869, + tx_hash: + '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f2ff4d28e3f660', + tx_pos: 1, + value: 546, + txid: + '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f2ff4d28e3f660', + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + tokenId: + 'bf24d955f59351e738ecd905966606a6837e478e1982943d724eab10caad82fd', + balance: new BigNumber('1'), + hasBaton: false, + }, + { + info: { + height: 660869, + tx_hash: + 'c7da9ae6a0ce9d4f2f3345f9f0e5da5371228c8aee72b6eeac1b42871b216e6b', + tx_pos: 1, + value: 546, + txid: + 'c7da9ae6a0ce9d4f2f3345f9f0e5da5371228c8aee72b6eeac1b42871b216e6b', + vout: 1, + 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: '2', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + tokenId: + '1f6a65e7a4bde92c0a012de2bcf4007034504a765377cdf08a3ee01d1eaa6901', + balance: new BigNumber('2'), + hasBaton: false, + }, + { + info: { + height: 660869, + tx_hash: + 'dac23f10dd65caa51359c1643ffc93b94d14c05b739590ade85557d338a21040', + tx_pos: 1, + value: 546, + txid: + 'dac23f10dd65caa51359c1643ffc93b94d14c05b739590ade85557d338a21040', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + tokenId: + '7f8889682d57369ed0e32336f8b7e0ffec625a35cca183f4e81fde4e71a538a1', + balance: new BigNumber('3'), + hasBaton: false, + }, + { + info: { + height: 660869, + tx_hash: + 'efa6f67078810875513a116b389886610d81ecf6daf97d55dd96d3fdd201dfac', + tx_pos: 1, + value: 546, + txid: + 'efa6f67078810875513a116b389886610d81ecf6daf97d55dd96d3fdd201dfac', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + tokenTicker: 'TAP', + tokenName: 'Thoughts and Prayers', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '2', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + balance: new BigNumber('2'), + hasBaton: false, + }, + { + balance: new BigNumber('310'), + hasBaton: true, + info: { + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + decimals: 9, + height: 660978, + isValid: true, + mintBatonVout: 2, + tokenDocumentHash: '', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenName: 'Cash Tab Points', + tokenTicker: 'CTP', + tokenType: 1, + transactionType: 'mint', + tx_hash: + 'b622b770f74f056e07e5d2ea4d7f8da1c4d865e21e11c31a263602a38d4a2474', + tx_pos: 2, + txid: + 'b622b770f74f056e07e5d2ea4d7f8da1c4d865e21e11c31a263602a38d4a2474', + utxoType: 'minting-baton', + value: 546, + vout: 2, + }, + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + }, + { + balance: new BigNumber('523512344.7961451'), + hasBaton: true, + info: { + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + decimals: 7, + height: 660982, + isValid: true, + mintBatonVout: 2, + tokenDocumentHash: + '����\\�IS\u001e9�����k+���\u0018���\u001b]�߷2��', + tokenDocumentUrl: + 'https://www.ImpossiblyLongWebsiteDidYouThinkWebDevWouldBeFun.org', + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + tokenName: + 'Test Token With Exceptionally Long Name For CSS And Style Revisions', + tokenTicker: 'WDT', + tokenType: 1, + transactionType: 'mint', + tx_hash: + '67605f3d18135b52d95a4877a427d100c14f2610c63ee84eaf4856f883a0b70e', + tx_pos: 2, + txid: + '67605f3d18135b52d95a4877a427d100c14f2610c63ee84eaf4856f883a0b70e', + utxoType: 'minting-baton', + value: 546, + vout: 2, + }, + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + }, + { + info: { + height: 667750, + tx_hash: + 'e9a94cc174839e3659d2fe4d33490528d18ad91404b65eb8cc35d8fa2d3f5096', + tx_pos: 2, + value: 546, + txid: + 'e9a94cc174839e3659d2fe4d33490528d18ad91404b65eb8cc35d8fa2d3f5096', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '5.854300861', + isValid: true, + address: + 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + balance: new BigNumber('9897999885.211011069'), + hasBaton: false, + }, + { + info: { + height: 669057, + tx_hash: + 'dd560d87bd632e40c6548021006653a150197ede13fadb5eadfa29abe4400d0e', + tx_pos: 1, + value: 546, + txid: + 'dd560d87bd632e40c6548021006653a150197ede13fadb5eadfa29abe4400d0e', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + tokenTicker: 'NAKAMOTO', + tokenName: 'NAKAMOTO', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 8, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: + 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + balance: new BigNumber('1'), + hasBaton: false, + }, + ], + nonSlpUtxos: [ + { + height: 669639, + tx_hash: + '0da6d49cf95d4603958e53360ad1e90bfccef41bfb327d6b2e8a77e242fa2d58', + tx_pos: 0, + value: 1000, + txid: + '0da6d49cf95d4603958e53360ad1e90bfccef41bfb327d6b2e8a77e242fa2d58', + vout: 0, + isValid: false, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + '39521b38cd1b6126a57a68b8adfd836020cd53b195f3b4675c58095c5c300ef8', + tx_pos: 0, + value: 700000, + txid: + '39521b38cd1b6126a57a68b8adfd836020cd53b195f3b4675c58095c5c300ef8', + vout: 0, + isValid: false, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + '93949923f02cb5271bd6d0b5a5b937ce5ae22df5bf6117161078f175f0c29d56', + tx_pos: 0, + value: 700000, + txid: + '93949923f02cb5271bd6d0b5a5b937ce5ae22df5bf6117161078f175f0c29d56', + vout: 0, + isValid: false, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + 'ddace66ea968e16e55ebf218814401acc38e0a39150529fa3d1108af04e81373', + tx_pos: 0, + value: 300000, + txid: + 'ddace66ea968e16e55ebf218814401acc38e0a39150529fa3d1108af04e81373', + vout: 0, + isValid: false, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + 'f1147285ac384159b5dfae513bda47a0459f876d046b48f13c8a7ec4f0d20d96', + tx_pos: 0, + value: 700000, + txid: + 'f1147285ac384159b5dfae513bda47a0459f876d046b48f13c8a7ec4f0d20d96', + vout: 0, + isValid: false, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + { + height: 669639, + tx_hash: + 'f4ca891d090f2682c7086b27a4d3bc2ed1543fb96123b6649e8f26b644a45b51', + tx_pos: 0, + value: 30000, + txid: + 'f4ca891d090f2682c7086b27a4d3bc2ed1543fb96123b6649e8f26b644a45b51', + vout: 0, + isValid: false, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + wif: 'L58jqHoi5ynSdsskPVBJuGuVqTP8ZML1MwHQsBJY32Pv7cqDSCeH', + }, + ], + slpUtxos: [ + { + height: 660869, + tx_hash: + '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f2ff4d28e3f660', + tx_pos: 1, + value: 546, + txid: + '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f2ff4d28e3f660', + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660869, + tx_hash: + 'c7da9ae6a0ce9d4f2f3345f9f0e5da5371228c8aee72b6eeac1b42871b216e6b', + tx_pos: 1, + value: 546, + txid: + 'c7da9ae6a0ce9d4f2f3345f9f0e5da5371228c8aee72b6eeac1b42871b216e6b', + vout: 1, + 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: '2', + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660869, + tx_hash: + 'dac23f10dd65caa51359c1643ffc93b94d14c05b739590ade85557d338a21040', + tx_pos: 1, + value: 546, + txid: + 'dac23f10dd65caa51359c1643ffc93b94d14c05b739590ade85557d338a21040', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660869, + tx_hash: + 'efa6f67078810875513a116b389886610d81ecf6daf97d55dd96d3fdd201dfac', + tx_pos: 1, + value: 546, + txid: + 'efa6f67078810875513a116b389886610d81ecf6daf97d55dd96d3fdd201dfac', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'dd84ca78db4d617221b58eabc6667af8fe2f7eadbfcc213d35be9f1b419beb8d', + tokenTicker: 'TAP', + tokenName: 'Thoughts and Prayers', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 0, + tokenType: 1, + tokenQty: '2', + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660978, + tx_hash: + 'b622b770f74f056e07e5d2ea4d7f8da1c4d865e21e11c31a263602a38d4a2474', + tx_pos: 2, + value: 546, + txid: + 'b622b770f74f056e07e5d2ea4d7f8da1c4d865e21e11c31a263602a38d4a2474', + vout: 2, + utxoType: 'minting-baton', + transactionType: 'mint', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenType: 1, + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + mintBatonVout: 2, + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 660982, + tx_hash: + '67605f3d18135b52d95a4877a427d100c14f2610c63ee84eaf4856f883a0b70e', + tx_pos: 2, + value: 546, + txid: + '67605f3d18135b52d95a4877a427d100c14f2610c63ee84eaf4856f883a0b70e', + vout: 2, + utxoType: 'minting-baton', + transactionType: 'mint', + tokenId: + '7443f7c831cdf2b2b04d5f0465ed0bcf348582675b0e4f17906438c232c22f3d', + tokenType: 1, + 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, + mintBatonVout: 2, + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 662799, + tx_hash: + 'b399a5ae69e4ac4c96b27c680a541e6b8142006bdc2484a959821858fc0b4ca3', + tx_pos: 2, + value: 546, + txid: + 'b399a5ae69e4ac4c96b27c680a541e6b8142006bdc2484a959821858fc0b4ca3', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bef614aac85c0c866f4d39e4d12a96851267d38d1bca5bdd6488bbd42e28b6b1', + tokenTicker: 'CTP', + tokenName: 'Cash Tab Points', + tokenDocumentUrl: 'https://cashtabapp.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '310', + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667561, + tx_hash: + '4ca7f70996c699b0f988597a2dd2700f1f24f305318ddc8fe137d96d5fa96bf5', + tx_pos: 1, + value: 546, + txid: + '4ca7f70996c699b0f988597a2dd2700f1f24f305318ddc8fe137d96d5fa96bf5', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667750, + tx_hash: + 'de912bc7a6a1b14abe04960cd9a0ef88a4f59eb04db765f7bc2c0d2c2f997054', + tx_pos: 1, + value: 546, + txid: + 'de912bc7a6a1b14abe04960cd9a0ef88a4f59eb04db765f7bc2c0d2c2f997054', + vout: 1, + 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: '100.0000001', + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667750, + tx_hash: + 'e25cebd4cccbbdd91b36f672d51f5ce978e0817839be9854c3550704aec4359d', + tx_pos: 1, + value: 546, + txid: + 'e25cebd4cccbbdd91b36f672d51f5ce978e0817839be9854c3550704aec4359d', + vout: 1, + 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:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667750, + tx_hash: + 'e9a94cc174839e3659d2fe4d33490528d18ad91404b65eb8cc35d8fa2d3f5096', + tx_pos: 2, + value: 546, + txid: + 'e9a94cc174839e3659d2fe4d33490528d18ad91404b65eb8cc35d8fa2d3f5096', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '5.854300861', + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 667751, + tx_hash: + '05e87142de1bb8c2a43d22a2e4b97855eb84c3c76f4ea956a654efda8d0557ca', + tx_pos: 1, + value: 546, + txid: + '05e87142de1bb8c2a43d22a2e4b97855eb84c3c76f4ea956a654efda8d0557ca', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1.14669914', + isValid: true, + address: 'bitcoincash:qqvcsnz9x9nu7vq35vmrkjc7hkfxhhs9nuv44zm0ed', + }, + { + height: 666969, + tx_hash: + '99583b593a3bec993328b076f4988fd77b8423d788183bf2968ed43cec11c454', + tx_pos: 2, + value: 546, + txid: + '99583b593a3bec993328b076f4988fd77b8423d788183bf2968ed43cec11c454', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '9897999873.21001107', + isValid: true, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667560, + tx_hash: + '34002080b2e1b42ff9f33d36dbbd0d8f1aaddc5a00b916054a40c45feebaf548', + tx_pos: 2, + value: 546, + txid: + '34002080b2e1b42ff9f33d36dbbd0d8f1aaddc5a00b916054a40c45feebaf548', + vout: 2, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '3.999999998', + isValid: true, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667560, + tx_hash: + '8edccfafe4b002da8f1aa71daae31846c51848968e7d92dcba5f0ff97beb734d', + tx_pos: 2, + value: 546, + txid: + '8edccfafe4b002da8f1aa71daae31846c51848968e7d92dcba5f0ff97beb734d', + 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: '523512244.796145', + isValid: true, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 667909, + tx_hash: + 'd3183b663a8d67b2b558654896b95102bbe68d164de219da96273ae52de93813', + tx_pos: 1, + value: 546, + txid: + 'd3183b663a8d67b2b558654896b95102bbe68d164de219da96273ae52de93813', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'bd1acc4c986de57af8d6d2a64aecad8c30ee80f37ae9d066d758923732ddc9ba', + tokenTicker: 'TBS', + tokenName: 'TestBits', + tokenDocumentUrl: 'https://thecryptoguy.com/', + tokenDocumentHash: '', + decimals: 9, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + { + height: 669057, + tx_hash: + 'dd560d87bd632e40c6548021006653a150197ede13fadb5eadfa29abe4400d0e', + tx_pos: 1, + value: 546, + txid: + 'dd560d87bd632e40c6548021006653a150197ede13fadb5eadfa29abe4400d0e', + vout: 1, + utxoType: 'token', + transactionType: 'send', + tokenId: + 'df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb', + tokenTicker: 'NAKAMOTO', + tokenName: 'NAKAMOTO', + tokenDocumentUrl: '', + tokenDocumentHash: '', + decimals: 8, + tokenType: 1, + tokenQty: '1', + isValid: true, + address: 'bitcoincash:qphpmfj0qn7znklqhrfn5dq7qh36l3vxavu346vqcl', + }, + ], +}; diff --git a/web/cashtab/src/hooks/__tests__/useBCH.test.js b/web/cashtab/src/hooks/__tests__/useBCH.test.js --- a/web/cashtab/src/hooks/__tests__/useBCH.test.js +++ b/web/cashtab/src/hooks/__tests__/useBCH.test.js @@ -2,6 +2,8 @@ import useBCH from '../useBCH'; import mockReturnGetHydratedUtxoDetails from '../__mocks__/mockReturnGetHydratedUtxoDetails'; import mockReturnGetSlpBalancesAndUtxos from '../__mocks__/mockReturnGetSlpBalancesAndUtxos'; +import mockReturnGetHydratedUtxoDetailsWithZeroBalance from '../__mocks__/mockReturnGetHydratedUtxoDetailsWithZeroBalance'; +import mockReturnGetSlpBalancesAndUtxosNoZeroBalance from '../__mocks__/mockReturnGetSlpBalancesAndUtxosNoZeroBalance'; import sendBCHMock from '../__mocks__/sendBCH'; import mockTxHistory from '../__mocks__/mockTxHistory'; import mockFlatTxHistory from '../__mocks__/mockFlatTxHistory'; @@ -67,6 +69,18 @@ expect(result).toStrictEqual(mockReturnGetSlpBalancesAndUtxos); }); + it(`Ignores SLP utxos with utxo.tokenQty === '0'`, async () => { + const { getSlpBalancesAndUtxos } = useBCH(); + + const result = await getSlpBalancesAndUtxos( + mockReturnGetHydratedUtxoDetailsWithZeroBalance, + ); + + expect(result).toStrictEqual( + mockReturnGetSlpBalancesAndUtxosNoZeroBalance, + ); + }); + it('sends BCH correctly', async () => { const { sendBch } = useBCH(); const BCH = new BCHJS(); diff --git a/web/cashtab/src/hooks/useBCH.js b/web/cashtab/src/hooks/useBCH.js --- a/web/cashtab/src/hooks/useBCH.js +++ b/web/cashtab/src/hooks/useBCH.js @@ -351,7 +351,12 @@ utxo => utxo.isValid === false && utxo.value !== 546 && !utxo.tokenName, ); - const slpUtxos = hydratedUtxos.filter(utxo => utxo.isValid); + // To be included in slpUtxos, the utxo must + // have utxo.isValid = true + // If utxo has a utxo.tokenQty field, i.e. not a minting baton, then utxo.tokenQty !== '0' + const slpUtxos = hydratedUtxos.filter( + utxo => utxo.isValid && !(utxo.tokenQty === '0'), + ); let tokensById = {};