mainnet-js 3.0.1 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/{mainnet-3.0.1.js → mainnet-3.1.1.js} +5 -5
  3. package/dist/module/history/getHistory.js +10 -10
  4. package/dist/module/history/getHistory.js.map +1 -1
  5. package/dist/module/network/ElectrumNetworkProvider.d.ts +7 -3
  6. package/dist/module/network/ElectrumNetworkProvider.d.ts.map +1 -1
  7. package/dist/module/network/ElectrumNetworkProvider.js +51 -25
  8. package/dist/module/network/ElectrumNetworkProvider.js.map +1 -1
  9. package/dist/module/network/NetworkProvider.d.ts +14 -6
  10. package/dist/module/network/NetworkProvider.d.ts.map +1 -1
  11. package/dist/module/network/index.d.ts +1 -1
  12. package/dist/module/network/index.d.ts.map +1 -1
  13. package/dist/module/network/interface.d.ts +4 -3
  14. package/dist/module/network/interface.d.ts.map +1 -1
  15. package/dist/module/wallet/Base.d.ts.map +1 -1
  16. package/dist/module/wallet/Base.js +1 -2
  17. package/dist/module/wallet/Base.js.map +1 -1
  18. package/dist/module/wallet/HDWallet.d.ts +8 -0
  19. package/dist/module/wallet/HDWallet.d.ts.map +1 -1
  20. package/dist/module/wallet/HDWallet.js +28 -0
  21. package/dist/module/wallet/HDWallet.js.map +1 -1
  22. package/dist/module/wallet/Util.d.ts +5 -3
  23. package/dist/module/wallet/Util.d.ts.map +1 -1
  24. package/dist/module/wallet/Util.js +28 -22
  25. package/dist/module/wallet/Util.js.map +1 -1
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +1 -1
  28. package/src/history/getHistory.ts +15 -15
  29. package/src/network/ElectrumNetworkProvider.ts +105 -39
  30. package/src/network/NetworkProvider.ts +44 -6
  31. package/src/network/index.ts +5 -1
  32. package/src/network/interface.ts +8 -3
  33. package/src/wallet/Base.ts +1 -4
  34. package/src/wallet/HDWallet.test.ts +239 -0
  35. package/src/wallet/HDWallet.ts +36 -0
  36. package/src/wallet/Util.test.ts +56 -6
  37. package/src/wallet/Util.ts +67 -46
  38. package/src/wallet/Wif.test.ts +3 -9
@@ -995,9 +995,7 @@ describe(`Wallet extrema behavior regression testing`, () => {
995
995
  OpReturnData.from("MEMO\x10LÖL😅"),
996
996
  { cashaddr: wallet.cashaddr!, value: 546n },
997
997
  ]);
998
- transaction = (await wallet.provider!.getRawTransactionObject(
999
- result.txId!
1000
- )) as ElectrumRawTransaction;
998
+ transaction = await wallet.provider!.getRawTransactionObject(result.txId!);
1001
999
  expect(transaction.vout[0].scriptPubKey.asm).toContain("OP_RETURN");
1002
1000
  expect(transaction.vout[0].scriptPubKey.hex.slice(4)).toBe(
1003
1001
  binToHex(utf8ToBin("MEMO\x10LÖL😅"))
@@ -1007,9 +1005,7 @@ describe(`Wallet extrema behavior regression testing`, () => {
1007
1005
  [wallet.cashaddr!, 546n],
1008
1006
  ["OP_RETURN", Uint8Array.from([0x00, 0x01, 0x02])],
1009
1007
  ]);
1010
- transaction = (await wallet.provider!.getRawTransactionObject(
1011
- result.txId!
1012
- )) as ElectrumRawTransaction;
1008
+ transaction = await wallet.provider!.getRawTransactionObject(result.txId!);
1013
1009
  expect(transaction.vout[1].scriptPubKey.asm).toContain("OP_RETURN");
1014
1010
  expect([
1015
1011
  ...hexToBin(transaction.vout[1].scriptPubKey.hex.slice(4)),
@@ -1019,9 +1015,7 @@ describe(`Wallet extrema behavior regression testing`, () => {
1019
1015
  OpReturnData.from(""),
1020
1016
  OpReturnData.from(Uint8Array.from([])),
1021
1017
  ]);
1022
- transaction = (await wallet.provider!.getRawTransactionObject(
1023
- result.txId!
1024
- )) as ElectrumRawTransaction;
1018
+ transaction = await wallet.provider!.getRawTransactionObject(result.txId!);
1025
1019
  expect(transaction.vout[0].scriptPubKey.asm).toContain("OP_RETURN");
1026
1020
  expect([...hexToBin(transaction.vout[0].scriptPubKey.hex)]).toStrictEqual([
1027
1021
  0x6a, 0x00,