mainnet-js 0.5.9 → 1.0.0-rc.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.
- package/dist/index.html +9 -1
- package/dist/mainnet-1.0.0-rc.1.js +2928 -0
- package/dist/module/chain.d.ts +1 -0
- package/dist/module/chain.d.ts.map +1 -0
- package/dist/module/cli.d.ts +1 -0
- package/dist/module/cli.d.ts.map +1 -0
- package/dist/module/cli.js +2 -2
- package/dist/module/cli.js.map +1 -1
- package/dist/module/constant.d.ts +1 -0
- package/dist/module/constant.d.ts.map +1 -0
- package/dist/module/db/ExchangeRateProvider.d.ts +2 -1
- package/dist/module/db/ExchangeRateProvider.d.ts.map +1 -0
- package/dist/module/db/IndexedDBProvider.d.ts +3 -2
- package/dist/module/db/IndexedDBProvider.d.ts.map +1 -0
- package/dist/module/db/SqlProvider.d.ts +7 -8
- package/dist/module/db/SqlProvider.d.ts.map +1 -0
- package/dist/module/db/SqlProvider.js +10 -8
- package/dist/module/db/SqlProvider.js.map +1 -1
- package/dist/module/db/StorageProvider.d.ts +2 -1
- package/dist/module/db/StorageProvider.d.ts.map +1 -0
- package/dist/module/db/getStorageProvider.d.ts +3 -0
- package/dist/module/db/getStorageProvider.d.ts.map +1 -0
- package/dist/module/db/getStorageProvider.js +19 -0
- package/dist/module/db/getStorageProvider.js.map +1 -0
- package/dist/module/db/index.d.ts +4 -3
- package/dist/module/db/index.d.ts.map +1 -0
- package/dist/module/db/index.js +2 -2
- package/dist/module/db/index.js.map +1 -1
- package/dist/module/db/interface.d.ts +1 -0
- package/dist/module/db/interface.d.ts.map +1 -0
- package/dist/module/db/util.d.ts +2 -3
- package/dist/module/db/util.d.ts.map +1 -0
- package/dist/module/db/util.js +0 -17
- package/dist/module/db/util.js.map +1 -1
- package/dist/module/enum.d.ts +1 -0
- package/dist/module/enum.d.ts.map +1 -0
- package/dist/module/history/electrumTransformer.d.ts +3 -2
- package/dist/module/history/electrumTransformer.d.ts.map +1 -0
- package/dist/module/history/electrumTransformer.js +11 -11
- package/dist/module/history/electrumTransformer.js.map +1 -1
- package/dist/module/history/interface.d.ts +2 -1
- package/dist/module/history/interface.d.ts.map +1 -0
- package/dist/module/index.d.ts +26 -21
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +25 -17
- package/dist/module/index.js.map +1 -1
- package/dist/module/interface.d.ts +14 -0
- package/dist/module/interface.d.ts.map +1 -0
- package/dist/module/interface.js +5 -0
- package/dist/module/interface.js.map +1 -1
- package/dist/module/message/index.d.ts +3 -2
- package/dist/module/message/index.d.ts.map +1 -0
- package/dist/module/message/index.js +2 -2
- package/dist/module/message/index.js.map +1 -1
- package/dist/module/message/interface.d.ts +1 -0
- package/dist/module/message/interface.d.ts.map +1 -0
- package/dist/module/message/signed.d.ts +2 -1
- package/dist/module/message/signed.d.ts.map +1 -0
- package/dist/module/message/signed.js +10 -4
- package/dist/module/message/signed.js.map +1 -1
- package/dist/module/mine/index.d.ts +2 -1
- package/dist/module/mine/index.d.ts.map +1 -0
- package/dist/module/mine/index.js +1 -1
- package/dist/module/mine/index.js.map +1 -1
- package/dist/module/mine/mine.d.ts +1 -0
- package/dist/module/mine/mine.d.ts.map +1 -0
- package/dist/module/mine/mine.js +3 -3
- package/dist/module/mine/mine.js.map +1 -1
- package/dist/module/network/Connection.d.ts +3 -2
- package/dist/module/network/Connection.d.ts.map +1 -0
- package/dist/module/network/Connection.js +3 -3
- package/dist/module/network/Connection.js.map +1 -1
- package/dist/module/network/ElectrumNetworkProvider.d.ts +8 -5
- package/dist/module/network/ElectrumNetworkProvider.d.ts.map +1 -0
- package/dist/module/network/ElectrumNetworkProvider.js +59 -13
- package/dist/module/network/ElectrumNetworkProvider.js.map +1 -1
- package/dist/module/network/NetworkProvider.d.ts +2 -1
- package/dist/module/network/NetworkProvider.d.ts.map +1 -0
- package/dist/module/network/configuration.d.ts +8 -10
- package/dist/module/network/configuration.d.ts.map +1 -0
- package/dist/module/network/configuration.js +29 -17
- package/dist/module/network/configuration.js.map +1 -1
- package/dist/module/network/constant.d.ts +1 -0
- package/dist/module/network/constant.d.ts.map +1 -0
- package/dist/module/network/constant.js +8 -4
- package/dist/module/network/constant.js.map +1 -1
- package/dist/module/network/default.d.ts +4 -3
- package/dist/module/network/default.d.ts.map +1 -0
- package/dist/module/network/default.js +7 -7
- package/dist/module/network/default.js.map +1 -1
- package/dist/module/network/getRelayFeeCache.d.ts +2 -1
- package/dist/module/network/getRelayFeeCache.d.ts.map +1 -0
- package/dist/module/network/getRelayFeeCache.js +2 -2
- package/dist/module/network/getRelayFeeCache.js.map +1 -1
- package/dist/module/network/index.d.ts +3 -2
- package/dist/module/network/index.d.ts.map +1 -0
- package/dist/module/network/index.js +2 -2
- package/dist/module/network/index.js.map +1 -1
- package/dist/module/network/interface.d.ts +1 -0
- package/dist/module/network/interface.d.ts.map +1 -0
- package/dist/module/network/util.d.ts +2 -1
- package/dist/module/network/util.d.ts.map +1 -0
- package/dist/module/qr/Qr.d.ts +2 -1
- package/dist/module/qr/Qr.d.ts.map +1 -0
- package/dist/module/qr/Qr.js +2 -2
- package/dist/module/qr/Qr.js.map +1 -1
- package/dist/module/qr/interface.d.ts +1 -0
- package/dist/module/qr/interface.d.ts.map +1 -0
- package/dist/module/rate/ExchangeRate.d.ts +1 -0
- package/dist/module/rate/ExchangeRate.d.ts.map +1 -0
- package/dist/module/rate/ExchangeRate.js +5 -5
- package/dist/module/rate/ExchangeRate.js.map +1 -1
- package/dist/module/slp/GsppProvider.d.ts +4 -3
- package/dist/module/slp/GsppProvider.d.ts.map +1 -0
- package/dist/module/slp/GsppProvider.js +7 -7
- package/dist/module/slp/GsppProvider.js.map +1 -1
- package/dist/module/slp/SlpDbProvider.d.ts +4 -3
- package/dist/module/slp/SlpDbProvider.d.ts.map +1 -0
- package/dist/module/slp/SlpDbProvider.js +8 -8
- package/dist/module/slp/SlpDbProvider.js.map +1 -1
- package/dist/module/slp/SlpDbTemplates.d.ts +1 -0
- package/dist/module/slp/SlpDbTemplates.d.ts.map +1 -0
- package/dist/module/slp/SlpLibAuth.d.ts +7 -14
- package/dist/module/slp/SlpLibAuth.d.ts.map +1 -0
- package/dist/module/slp/SlpLibAuth.js +48 -39
- package/dist/module/slp/SlpLibAuth.js.map +1 -1
- package/dist/module/slp/SlpProvider.d.ts +2 -1
- package/dist/module/slp/SlpProvider.d.ts.map +1 -0
- package/dist/module/slp/SlpProvider.js.map +1 -1
- package/dist/module/slp/index.d.ts +5 -4
- package/dist/module/slp/index.d.ts.map +1 -0
- package/dist/module/slp/index.js +3 -3
- package/dist/module/slp/index.js.map +1 -1
- package/dist/module/slp/interface.d.ts +2 -1
- package/dist/module/slp/interface.d.ts.map +1 -0
- package/dist/module/test/axios.d.ts +3 -0
- package/dist/module/test/axios.d.ts.map +1 -0
- package/dist/module/test/axios.js +35 -0
- package/dist/module/test/axios.js.map +1 -0
- package/dist/module/test/expect.d.ts +6 -1
- package/dist/module/test/expect.d.ts.map +1 -0
- package/dist/module/test/expect.js +22 -1
- package/dist/module/test/expect.js.map +1 -1
- package/dist/module/transaction/Wif.d.ts +19 -16
- package/dist/module/transaction/Wif.d.ts.map +1 -0
- package/dist/module/transaction/Wif.js +152 -55
- package/dist/module/transaction/Wif.js.map +1 -1
- package/dist/module/transaction/allocateFee.d.ts +5 -4
- package/dist/module/transaction/allocateFee.d.ts.map +1 -0
- package/dist/module/transaction/allocateFee.js +11 -8
- package/dist/module/transaction/allocateFee.js.map +1 -1
- package/dist/module/util/amountInSatoshi.d.ts +1 -0
- package/dist/module/util/amountInSatoshi.d.ts.map +1 -0
- package/dist/module/util/amountInSatoshi.js +4 -4
- package/dist/module/util/amountInSatoshi.js.map +1 -1
- package/dist/module/util/asSendRequestObject.d.ts +3 -2
- package/dist/module/util/asSendRequestObject.d.ts.map +1 -0
- package/dist/module/util/asSendRequestObject.js +6 -3
- package/dist/module/util/asSendRequestObject.js.map +1 -1
- package/dist/module/util/balanceObjectFromSatoshi.d.ts +1 -0
- package/dist/module/util/balanceObjectFromSatoshi.d.ts.map +1 -0
- package/dist/module/util/balanceObjectFromSatoshi.js +5 -5
- package/dist/module/util/balanceObjectFromSatoshi.js.map +1 -1
- package/dist/module/util/base64.d.ts +2 -1
- package/dist/module/util/base64.d.ts.map +1 -0
- package/dist/module/util/base64.js +5 -25
- package/dist/module/util/base64.js.map +1 -1
- package/dist/module/util/bchaddr.d.ts +1 -0
- package/dist/module/util/bchaddr.d.ts.map +1 -0
- package/dist/module/util/browserNotSupported.d.ts +1 -0
- package/dist/module/util/browserNotSupported.d.ts.map +1 -0
- package/dist/module/util/browserNotSupported.js +1 -1
- package/dist/module/util/browserNotSupported.js.map +1 -1
- package/dist/module/util/checkForEmptySeed.d.ts +1 -0
- package/dist/module/util/checkForEmptySeed.d.ts.map +1 -0
- package/dist/module/util/checkWifNetwork.d.ts +2 -1
- package/dist/module/util/checkWifNetwork.d.ts.map +1 -0
- package/dist/module/util/checkWifNetwork.js +1 -1
- package/dist/module/util/checkWifNetwork.js.map +1 -1
- package/dist/module/util/convert.d.ts +1 -0
- package/dist/module/util/convert.d.ts.map +1 -0
- package/dist/module/util/convert.js +2 -2
- package/dist/module/util/convert.js.map +1 -1
- package/dist/module/util/delay.d.ts +1 -0
- package/dist/module/util/delay.d.ts.map +1 -0
- package/dist/module/util/deriveCashaddr.d.ts +6 -1
- package/dist/module/util/deriveCashaddr.d.ts.map +1 -0
- package/dist/module/util/deriveCashaddr.js +85 -6
- package/dist/module/util/deriveCashaddr.js.map +1 -1
- package/dist/module/util/deriveLockscript.d.ts +1 -0
- package/dist/module/util/deriveLockscript.d.ts.map +1 -0
- package/dist/module/util/deriveNetwork.d.ts +1 -0
- package/dist/module/util/deriveNetwork.d.ts.map +1 -0
- package/dist/module/util/deriveNetwork.js +2 -2
- package/dist/module/util/deriveNetwork.js.map +1 -1
- package/dist/module/util/derivePublicKeyHash.d.ts +3 -1
- package/dist/module/util/derivePublicKeyHash.d.ts.map +1 -0
- package/dist/module/util/derivePublicKeyHash.js +1 -1
- package/dist/module/util/derivePublicKeyHash.js.map +1 -1
- package/dist/module/util/eventsource.d.ts +1 -0
- package/dist/module/util/eventsource.d.ts.map +1 -0
- package/dist/module/util/eventsource.js +3 -2
- package/dist/module/util/eventsource.js.map +1 -1
- package/dist/module/util/floor.d.ts +1 -0
- package/dist/module/util/floor.d.ts.map +1 -0
- package/dist/module/util/getAddrsByXpubKey.d.ts +8 -8
- package/dist/module/util/getAddrsByXpubKey.d.ts.map +1 -0
- package/dist/module/util/getAddrsByXpubKey.js +17 -21
- package/dist/module/util/getAddrsByXpubKey.js.map +1 -1
- package/dist/module/util/getRuntimePlatform.d.ts +1 -0
- package/dist/module/util/getRuntimePlatform.d.ts.map +1 -0
- package/dist/module/util/getUsdRate.d.ts +1 -0
- package/dist/module/util/getUsdRate.d.ts.map +1 -0
- package/dist/module/util/getUsdRate.js +1 -1
- package/dist/module/util/getUsdRate.js.map +1 -1
- package/dist/module/util/getXPubKey.d.ts +2 -1
- package/dist/module/util/getXPubKey.d.ts.map +1 -0
- package/dist/module/util/getXPubKey.js +6 -7
- package/dist/module/util/getXPubKey.js.map +1 -1
- package/dist/module/util/hash160.d.ts +2 -1
- package/dist/module/util/hash160.d.ts.map +1 -0
- package/dist/module/util/hash160.js +2 -4
- package/dist/module/util/hash160.js.map +1 -1
- package/dist/module/util/index.d.ts +21 -20
- package/dist/module/util/index.d.ts.map +1 -0
- package/dist/module/util/index.js +20 -20
- package/dist/module/util/index.js.map +1 -1
- package/dist/module/util/randomBytes.d.ts +3 -1
- package/dist/module/util/randomBytes.d.ts.map +1 -0
- package/dist/module/util/randomBytes.js +2 -3
- package/dist/module/util/randomBytes.js.map +1 -1
- package/dist/module/util/randomInt.d.ts +1 -0
- package/dist/module/util/randomInt.d.ts.map +1 -0
- package/dist/module/util/randomValues.d.ts +1 -0
- package/dist/module/util/randomValues.d.ts.map +1 -0
- package/dist/module/util/randomValues.js +7 -7
- package/dist/module/util/randomValues.js.map +1 -1
- package/dist/module/util/sanitizeAddress.d.ts +1 -0
- package/dist/module/util/sanitizeAddress.d.ts.map +1 -0
- package/dist/module/util/sanitizeAddress.js +1 -1
- package/dist/module/util/sanitizeAddress.js.map +1 -1
- package/dist/module/util/sanitizeUnit.d.ts +2 -1
- package/dist/module/util/sanitizeUnit.d.ts.map +1 -0
- package/dist/module/util/satoshiToAmount.d.ts +1 -0
- package/dist/module/util/satoshiToAmount.d.ts.map +1 -0
- package/dist/module/util/satoshiToAmount.js +4 -4
- package/dist/module/util/satoshiToAmount.js.map +1 -1
- package/dist/module/util/sumSendRequestAmounts.d.ts +3 -2
- package/dist/module/util/sumSendRequestAmounts.d.ts.map +1 -0
- package/dist/module/util/sumSendRequestAmounts.js +5 -2
- package/dist/module/util/sumSendRequestAmounts.js.map +1 -1
- package/dist/module/util/sumUtxoValue.d.ts +4 -2
- package/dist/module/util/sumUtxoValue.d.ts.map +1 -0
- package/dist/module/util/sumUtxoValue.js +17 -3
- package/dist/module/util/sumUtxoValue.js.map +1 -1
- package/dist/module/util/transaction.d.ts +2 -0
- package/dist/module/util/transaction.d.ts.map +1 -0
- package/dist/module/util/transaction.js +7 -0
- package/dist/module/util/transaction.js.map +1 -0
- package/dist/module/wallet/Base.d.ts +8 -7
- package/dist/module/wallet/Base.d.ts.map +1 -0
- package/dist/module/wallet/Base.js +7 -7
- package/dist/module/wallet/Base.js.map +1 -1
- package/dist/module/wallet/Bcmr.d.ts +88 -0
- package/dist/module/wallet/Bcmr.d.ts.map +1 -0
- package/dist/module/wallet/Bcmr.js +281 -0
- package/dist/module/wallet/Bcmr.js.map +1 -0
- package/dist/module/wallet/Slp.d.ts +6 -5
- package/dist/module/wallet/Slp.d.ts.map +1 -0
- package/dist/module/wallet/Slp.js +15 -15
- package/dist/module/wallet/Slp.js.map +1 -1
- package/dist/module/wallet/Util.d.ts +3 -2
- package/dist/module/wallet/Util.d.ts.map +1 -0
- package/dist/module/wallet/Util.js +9 -14
- package/dist/module/wallet/Util.js.map +1 -1
- package/dist/module/wallet/Wif.d.ts +124 -20
- package/dist/module/wallet/Wif.d.ts.map +1 -0
- package/dist/module/wallet/Wif.js +406 -74
- package/dist/module/wallet/Wif.js.map +1 -1
- package/dist/module/wallet/bcmr-v1.schema.d.ts +623 -0
- package/dist/module/wallet/bcmr-v1.schema.d.ts.map +1 -0
- package/dist/module/wallet/bcmr-v1.schema.js +2 -0
- package/dist/module/wallet/bcmr-v1.schema.js.map +1 -0
- package/dist/module/wallet/createWallet.d.ts +3 -2
- package/dist/module/wallet/createWallet.d.ts.map +1 -0
- package/dist/module/wallet/createWallet.js +3 -3
- package/dist/module/wallet/createWallet.js.map +1 -1
- package/dist/module/wallet/enum.d.ts +1 -0
- package/dist/module/wallet/enum.d.ts.map +1 -0
- package/dist/module/wallet/interface.d.ts +10 -6
- package/dist/module/wallet/interface.d.ts.map +1 -0
- package/dist/module/wallet/model.d.ts +81 -5
- package/dist/module/wallet/model.d.ts.map +1 -0
- package/dist/module/wallet/model.js +102 -17
- package/dist/module/wallet/model.js.map +1 -1
- package/dist/module/webhook/Webhook.d.ts +3 -2
- package/dist/module/webhook/Webhook.d.ts.map +1 -0
- package/dist/module/webhook/Webhook.js +4 -1
- package/dist/module/webhook/Webhook.js.map +1 -1
- package/dist/module/webhook/WebhookBch.d.ts +4 -3
- package/dist/module/webhook/WebhookBch.d.ts.map +1 -0
- package/dist/module/webhook/WebhookBch.js +4 -4
- package/dist/module/webhook/WebhookBch.js.map +1 -1
- package/dist/module/webhook/WebhookSlp.d.ts +5 -4
- package/dist/module/webhook/WebhookSlp.d.ts.map +1 -0
- package/dist/module/webhook/WebhookSlp.js +4 -4
- package/dist/module/webhook/WebhookSlp.js.map +1 -1
- package/dist/module/webhook/WebhookWorker.d.ts +3 -2
- package/dist/module/webhook/WebhookWorker.d.ts.map +1 -0
- package/dist/module/webhook/WebhookWorker.js +1 -1
- package/dist/module/webhook/WebhookWorker.js.map +1 -1
- package/dist/module/webhook/index.d.ts +6 -5
- package/dist/module/webhook/index.d.ts.map +1 -0
- package/dist/module/webhook/index.js +5 -5
- package/dist/module/webhook/index.js.map +1 -1
- package/dist/module/webhook/interface.d.ts +1 -0
- package/dist/module/webhook/interface.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/polyfill/{bip39.browser.js → bip39.browser.cjs} +1 -0
- package/polyfill/{util.js → util.cjs} +0 -0
- package/src/Wallet.test.headless.js +6 -6
- package/src/cli.ts +3 -3
- package/src/db/ExchangeRateProvider.ts +1 -1
- package/src/db/IndexedDBProvider.test.ts +0 -1
- package/src/db/IndexedDBProvider.ts +2 -2
- package/src/db/SqlProvider.ts +14 -12
- package/src/db/StorageProvider.ts +1 -1
- package/src/db/getStorageProvider.ts +20 -0
- package/src/db/index.ts +3 -3
- package/src/db/util.ts +1 -20
- package/src/history/electrumTransformer.ts +13 -14
- package/src/history/interface.ts +1 -1
- package/src/index.ts +29 -21
- package/src/interface.ts +15 -0
- package/src/message/index.ts +2 -2
- package/src/message/signed.test.ts +4 -4
- package/src/message/signed.ts +23 -6
- package/src/mine/index.ts +1 -1
- package/src/mine/mine.ts +3 -3
- package/src/network/Connection.ts +5 -5
- package/src/network/ElectrumNetworkProvider.ts +85 -20
- package/src/network/NetworkProvider.ts +1 -1
- package/src/network/configuration.test.ts +33 -8
- package/src/network/configuration.ts +33 -18
- package/src/network/constant.ts +9 -4
- package/src/network/default.ts +13 -10
- package/src/network/getRelayFeeCache.ts +3 -3
- package/src/network/index.ts +6 -2
- package/src/network/util.ts +1 -1
- package/src/qr/Qr.ts +3 -3
- package/src/rate/ExchangeRate.ts +14 -15
- package/src/slp/GsppProvider.test.ts +2 -2
- package/src/slp/GsppProvider.ts +11 -8
- package/src/slp/SlpDbProvider.test.ts +1 -1
- package/src/slp/SlpDbProvider.ts +12 -9
- package/src/slp/SlpLibAuth.test.ts +1 -1
- package/src/slp/SlpLibAuth.ts +52 -42
- package/src/slp/SlpProvider.ts +6 -1
- package/src/slp/index.ts +4 -4
- package/src/slp/interface.ts +1 -1
- package/src/test/axios.ts +47 -0
- package/src/test/expect.ts +27 -2
- package/src/transaction/Wif.ts +203 -77
- package/src/transaction/allocateFee.ts +32 -14
- package/src/util/amountInSatoshi.ts +4 -4
- package/src/util/asSendRequestObject.ts +42 -30
- package/src/util/balanceObjectFromSatoshi.ts +5 -5
- package/src/util/base64.ts +5 -24
- package/src/util/browserNotSupported.ts +1 -1
- package/src/util/checkWifNetwork.ts +1 -1
- package/src/util/convert.ts +2 -2
- package/src/util/deriveCashaddr.test.ts +43 -0
- package/src/util/deriveCashaddr.ts +123 -7
- package/src/util/deriveNetwork.ts +2 -2
- package/src/util/derivePublicKeyHash.test.ts +3 -0
- package/src/util/derivePublicKeyHash.ts +18 -5
- package/src/util/eventsource.ts +4 -2
- package/src/util/getAddrsByXpubKey.test.ts +5 -5
- package/src/util/getAddrsByXpubKey.ts +23 -28
- package/src/util/getUsdRate.ts +1 -1
- package/src/util/getXPubKey.ts +5 -7
- package/src/util/hash160.test.ts +2 -2
- package/src/util/hash160.ts +2 -4
- package/src/util/index.ts +26 -20
- package/src/util/randomBytes.ts +2 -3
- package/src/util/randomValues.ts +8 -8
- package/src/util/sanitizeAddress.ts +1 -1
- package/src/util/sanitizeUnit.ts +1 -1
- package/src/util/satoshiToAmount.ts +4 -4
- package/src/util/sumSendRequestAmounts.ts +10 -4
- package/src/util/sumUtxoValue.ts +19 -7
- package/src/util/transaction.ts +10 -0
- package/src/wallet/Base.ts +11 -11
- package/src/wallet/Bcmr.test.headless.js +353 -0
- package/src/wallet/Bcmr.test.ts +610 -0
- package/src/wallet/Bcmr.ts +390 -0
- package/src/wallet/Cashtokens.test.headless.js +467 -0
- package/src/wallet/Cashtokens.test.ts +475 -0
- package/src/wallet/Slp.test.headless.js +6 -8
- package/src/wallet/Slp.test.ts +2 -2
- package/src/wallet/Slp.ts +26 -22
- package/src/wallet/Util.ts +9 -20
- package/src/wallet/Wif.test.ts +20 -21
- package/src/wallet/Wif.ts +534 -99
- package/src/wallet/bcmr-v1.schema.ts +639 -0
- package/src/wallet/createWallet.test.ts +1 -0
- package/src/wallet/createWallet.ts +4 -4
- package/src/wallet/interface.ts +9 -6
- package/src/wallet/model.ts +190 -19
- package/src/webhook/Webhook.ts +7 -3
- package/src/webhook/WebhookBch.ts +7 -7
- package/src/webhook/WebhookSlp.test.ts +2 -2
- package/src/webhook/WebhookSlp.ts +6 -6
- package/src/webhook/WebhookWorker.ts +2 -2
- package/src/webhook/index.ts +5 -5
- package/tsconfig.browser.json +0 -3
- package/tsconfig.json +17 -5
- package/{webpack.config.js → webpack.config.cjs} +46 -14
- package/dist/main/chain.d.ts +0 -3
- package/dist/main/chain.js +0 -7
- package/dist/main/chain.js.map +0 -1
- package/dist/main/cli.d.ts +0 -1
- package/dist/main/cli.js +0 -35
- package/dist/main/cli.js.map +0 -1
- package/dist/main/constant.d.ts +0 -5
- package/dist/main/constant.js +0 -27
- package/dist/main/constant.js.map +0 -1
- package/dist/main/db/ExchangeRateProvider.d.ts +0 -11
- package/dist/main/db/ExchangeRateProvider.js +0 -47
- package/dist/main/db/ExchangeRateProvider.js.map +0 -1
- package/dist/main/db/IndexedDBProvider.d.ts +0 -15
- package/dist/main/db/IndexedDBProvider.js +0 -86
- package/dist/main/db/IndexedDBProvider.js.map +0 -1
- package/dist/main/db/SqlProvider.d.ts +0 -41
- package/dist/main/db/SqlProvider.js +0 -217
- package/dist/main/db/SqlProvider.js.map +0 -1
- package/dist/main/db/StorageProvider.d.ts +0 -52
- package/dist/main/db/StorageProvider.js +0 -3
- package/dist/main/db/StorageProvider.js.map +0 -1
- package/dist/main/db/index.d.ts +0 -3
- package/dist/main/db/index.js +0 -11
- package/dist/main/db/index.js.map +0 -1
- package/dist/main/db/interface.d.ts +0 -22
- package/dist/main/db/interface.js +0 -3
- package/dist/main/db/interface.js.map +0 -1
- package/dist/main/db/util.d.ts +0 -5
- package/dist/main/db/util.js +0 -53
- package/dist/main/db/util.js.map +0 -1
- package/dist/main/enum.d.ts +0 -33
- package/dist/main/enum.js +0 -39
- package/dist/main/enum.js.map +0 -1
- package/dist/main/history/electrumTransformer.d.ts +0 -4
- package/dist/main/history/electrumTransformer.js +0 -216
- package/dist/main/history/electrumTransformer.js.map +0 -1
- package/dist/main/history/interface.d.ts +0 -16
- package/dist/main/history/interface.js +0 -3
- package/dist/main/history/interface.js.map +0 -1
- package/dist/main/index.d.ts +0 -24
- package/dist/main/index.js +0 -62
- package/dist/main/index.js.map +0 -1
- package/dist/main/interface.d.ts +0 -31
- package/dist/main/interface.js +0 -12
- package/dist/main/interface.js.map +0 -1
- package/dist/main/message/index.d.ts +0 -2
- package/dist/main/message/index.js +0 -15
- package/dist/main/message/index.js.map +0 -1
- package/dist/main/message/interface.d.ts +0 -29
- package/dist/main/message/interface.js +0 -6
- package/dist/main/message/interface.js.map +0 -1
- package/dist/main/message/signed.d.ts +0 -33
- package/dist/main/message/signed.js +0 -141
- package/dist/main/message/signed.js.map +0 -1
- package/dist/main/mine/index.d.ts +0 -1
- package/dist/main/mine/index.js +0 -14
- package/dist/main/mine/index.js.map +0 -1
- package/dist/main/mine/mine.d.ts +0 -13
- package/dist/main/mine/mine.js +0 -37
- package/dist/main/mine/mine.js.map +0 -1
- package/dist/main/network/Connection.d.ts +0 -14
- package/dist/main/network/Connection.js +0 -71
- package/dist/main/network/Connection.js.map +0 -1
- package/dist/main/network/ElectrumNetworkProvider.d.ts +0 -49
- package/dist/main/network/ElectrumNetworkProvider.js +0 -338
- package/dist/main/network/ElectrumNetworkProvider.js.map +0 -1
- package/dist/main/network/NetworkProvider.d.ts +0 -107
- package/dist/main/network/NetworkProvider.js +0 -3
- package/dist/main/network/NetworkProvider.js.map +0 -1
- package/dist/main/network/configuration.d.ts +0 -12
- package/dist/main/network/configuration.js +0 -79
- package/dist/main/network/configuration.js.map +0 -1
- package/dist/main/network/constant.d.ts +0 -35
- package/dist/main/network/constant.js +0 -55
- package/dist/main/network/constant.js.map +0 -1
- package/dist/main/network/default.d.ts +0 -7
- package/dist/main/network/default.js +0 -107
- package/dist/main/network/default.js.map +0 -1
- package/dist/main/network/getRelayFeeCache.d.ts +0 -2
- package/dist/main/network/getRelayFeeCache.js +0 -27
- package/dist/main/network/getRelayFeeCache.js.map +0 -1
- package/dist/main/network/index.d.ts +0 -2
- package/dist/main/network/index.js +0 -10
- package/dist/main/network/index.js.map +0 -1
- package/dist/main/network/interface.d.ts +0 -60
- package/dist/main/network/interface.js +0 -3
- package/dist/main/network/interface.js.map +0 -1
- package/dist/main/network/util.d.ts +0 -2
- package/dist/main/network/util.js +0 -32
- package/dist/main/network/util.js.map +0 -1
- package/dist/main/qr/Qr.d.ts +0 -8
- package/dist/main/qr/Qr.js +0 -26
- package/dist/main/qr/Qr.js.map +0 -1
- package/dist/main/qr/interface.d.ts +0 -5
- package/dist/main/qr/interface.js +0 -3
- package/dist/main/qr/interface.js.map +0 -1
- package/dist/main/rate/ExchangeRate.d.ts +0 -19
- package/dist/main/rate/ExchangeRate.js +0 -147
- package/dist/main/rate/ExchangeRate.js.map +0 -1
- package/dist/main/slp/GsppProvider.d.ts +0 -54
- package/dist/main/slp/GsppProvider.js +0 -214
- package/dist/main/slp/GsppProvider.js.map +0 -1
- package/dist/main/slp/SlpDbProvider.d.ts +0 -51
- package/dist/main/slp/SlpDbProvider.js +0 -182
- package/dist/main/slp/SlpDbProvider.js.map +0 -1
- package/dist/main/slp/SlpDbTemplates.d.ts +0 -312
- package/dist/main/slp/SlpDbTemplates.js +0 -387
- package/dist/main/slp/SlpDbTemplates.js.map +0 -1
- package/dist/main/slp/SlpLibAuth.d.ts +0 -217
- package/dist/main/slp/SlpLibAuth.js +0 -452
- package/dist/main/slp/SlpLibAuth.js.map +0 -1
- package/dist/main/slp/SlpProvider.d.ts +0 -23
- package/dist/main/slp/SlpProvider.js +0 -39
- package/dist/main/slp/SlpProvider.js.map +0 -1
- package/dist/main/slp/index.d.ts +0 -5
- package/dist/main/slp/index.js +0 -24
- package/dist/main/slp/index.js.map +0 -1
- package/dist/main/slp/interface.d.ts +0 -113
- package/dist/main/slp/interface.js +0 -10
- package/dist/main/slp/interface.js.map +0 -1
- package/dist/main/test/expect.d.ts +0 -7
- package/dist/main/test/expect.js +0 -31
- package/dist/main/test/expect.js.map +0 -1
- package/dist/main/transaction/Wif.d.ts +0 -42
- package/dist/main/transaction/Wif.js +0 -214
- package/dist/main/transaction/Wif.js.map +0 -1
- package/dist/main/transaction/allocateFee.d.ts +0 -7
- package/dist/main/transaction/allocateFee.js +0 -118
- package/dist/main/transaction/allocateFee.js.map +0 -1
- package/dist/main/util/amountInSatoshi.d.ts +0 -9
- package/dist/main/util/amountInSatoshi.js +0 -38
- package/dist/main/util/amountInSatoshi.js.map +0 -1
- package/dist/main/util/asSendRequestObject.d.ts +0 -2
- package/dist/main/util/asSendRequestObject.js +0 -57
- package/dist/main/util/asSendRequestObject.js.map +0 -1
- package/dist/main/util/balanceObjectFromSatoshi.d.ts +0 -8
- package/dist/main/util/balanceObjectFromSatoshi.js +0 -62
- package/dist/main/util/balanceObjectFromSatoshi.js.map +0 -1
- package/dist/main/util/base64.d.ts +0 -2
- package/dist/main/util/base64.js +0 -36
- package/dist/main/util/base64.js.map +0 -1
- package/dist/main/util/bchaddr.d.ts +0 -1
- package/dist/main/util/bchaddr.js +0 -24
- package/dist/main/util/bchaddr.js.map +0 -1
- package/dist/main/util/browserNotSupported.d.ts +0 -1
- package/dist/main/util/browserNotSupported.js +0 -11
- package/dist/main/util/browserNotSupported.js.map +0 -1
- package/dist/main/util/checkForEmptySeed.d.ts +0 -2
- package/dist/main/util/checkForEmptySeed.js +0 -12
- package/dist/main/util/checkForEmptySeed.js.map +0 -1
- package/dist/main/util/checkWifNetwork.d.ts +0 -2
- package/dist/main/util/checkWifNetwork.js +0 -16
- package/dist/main/util/checkWifNetwork.js.map +0 -1
- package/dist/main/util/convert.d.ts +0 -15
- package/dist/main/util/convert.js +0 -24
- package/dist/main/util/convert.js.map +0 -1
- package/dist/main/util/delay.d.ts +0 -1
- package/dist/main/util/delay.js +0 -8
- package/dist/main/util/delay.js.map +0 -1
- package/dist/main/util/deriveCashaddr.d.ts +0 -2
- package/dist/main/util/deriveCashaddr.js +0 -13
- package/dist/main/util/deriveCashaddr.js.map +0 -1
- package/dist/main/util/deriveLockscript.d.ts +0 -8
- package/dist/main/util/deriveLockscript.js +0 -19
- package/dist/main/util/deriveLockscript.js.map +0 -1
- package/dist/main/util/deriveNetwork.d.ts +0 -1
- package/dist/main/util/deriveNetwork.js +0 -23
- package/dist/main/util/deriveNetwork.js.map +0 -1
- package/dist/main/util/derivePublicKeyHash.d.ts +0 -16
- package/dist/main/util/derivePublicKeyHash.js +0 -49
- package/dist/main/util/derivePublicKeyHash.js.map +0 -1
- package/dist/main/util/eventsource.d.ts +0 -2
- package/dist/main/util/eventsource.js +0 -12
- package/dist/main/util/eventsource.js.map +0 -1
- package/dist/main/util/floor.d.ts +0 -1
- package/dist/main/util/floor.js +0 -9
- package/dist/main/util/floor.js.map +0 -1
- package/dist/main/util/getAddrsByXpubKey.d.ts +0 -22
- package/dist/main/util/getAddrsByXpubKey.js +0 -79
- package/dist/main/util/getAddrsByXpubKey.js.map +0 -1
- package/dist/main/util/getRuntimePlatform.d.ts +0 -6
- package/dist/main/util/getRuntimePlatform.js +0 -34
- package/dist/main/util/getRuntimePlatform.js.map +0 -1
- package/dist/main/util/getUsdRate.d.ts +0 -1
- package/dist/main/util/getUsdRate.js +0 -9
- package/dist/main/util/getUsdRate.js.map +0 -1
- package/dist/main/util/getXPubKey.d.ts +0 -1
- package/dist/main/util/getXPubKey.js +0 -26
- package/dist/main/util/getXPubKey.js.map +0 -1
- package/dist/main/util/hash160.d.ts +0 -8
- package/dist/main/util/hash160.js +0 -18
- package/dist/main/util/hash160.js.map +0 -1
- package/dist/main/util/index.d.ts +0 -21
- package/dist/main/util/index.js +0 -72
- package/dist/main/util/index.js.map +0 -1
- package/dist/main/util/randomBytes.d.ts +0 -1
- package/dist/main/util/randomBytes.js +0 -18
- package/dist/main/util/randomBytes.js.map +0 -1
- package/dist/main/util/randomInt.d.ts +0 -1
- package/dist/main/util/randomInt.js +0 -9
- package/dist/main/util/randomInt.js.map +0 -1
- package/dist/main/util/randomValues.d.ts +0 -1
- package/dist/main/util/randomValues.js +0 -15
- package/dist/main/util/randomValues.js.map +0 -1
- package/dist/main/util/sanitizeAddress.d.ts +0 -1
- package/dist/main/util/sanitizeAddress.js +0 -15
- package/dist/main/util/sanitizeAddress.js.map +0 -1
- package/dist/main/util/sanitizeUnit.d.ts +0 -2
- package/dist/main/util/sanitizeUnit.js +0 -13
- package/dist/main/util/sanitizeUnit.js.map +0 -1
- package/dist/main/util/satoshiToAmount.d.ts +0 -9
- package/dist/main/util/satoshiToAmount.js +0 -41
- package/dist/main/util/satoshiToAmount.js.map +0 -1
- package/dist/main/util/sumSendRequestAmounts.d.ts +0 -2
- package/dist/main/util/sumSendRequestAmounts.js +0 -31
- package/dist/main/util/sumSendRequestAmounts.js.map +0 -1
- package/dist/main/util/sumUtxoValue.d.ts +0 -2
- package/dist/main/util/sumUtxoValue.js +0 -17
- package/dist/main/util/sumUtxoValue.js.map +0 -1
- package/dist/main/wallet/Base.d.ts +0 -202
- package/dist/main/wallet/Base.js +0 -438
- package/dist/main/wallet/Base.js.map +0 -1
- package/dist/main/wallet/Slp.d.ts +0 -430
- package/dist/main/wallet/Slp.js +0 -775
- package/dist/main/wallet/Slp.js.map +0 -1
- package/dist/main/wallet/Util.d.ts +0 -69
- package/dist/main/wallet/Util.js +0 -182
- package/dist/main/wallet/Util.js.map +0 -1
- package/dist/main/wallet/Wif.d.ts +0 -255
- package/dist/main/wallet/Wif.js +0 -1067
- package/dist/main/wallet/Wif.js.map +0 -1
- package/dist/main/wallet/createWallet.d.ts +0 -69
- package/dist/main/wallet/createWallet.js +0 -244
- package/dist/main/wallet/createWallet.js.map +0 -1
- package/dist/main/wallet/enum.d.ts +0 -16
- package/dist/main/wallet/enum.js +0 -22
- package/dist/main/wallet/enum.js.map +0 -1
- package/dist/main/wallet/interface.d.ts +0 -76
- package/dist/main/wallet/interface.js +0 -3
- package/dist/main/wallet/interface.js.map +0 -1
- package/dist/main/wallet/model.d.ts +0 -88
- package/dist/main/wallet/model.js +0 -129
- package/dist/main/wallet/model.js.map +0 -1
- package/dist/main/webhook/Webhook.d.ts +0 -40
- package/dist/main/webhook/Webhook.js +0 -82
- package/dist/main/webhook/Webhook.js.map +0 -1
- package/dist/main/webhook/WebhookBch.d.ts +0 -13
- package/dist/main/webhook/WebhookBch.js +0 -148
- package/dist/main/webhook/WebhookBch.js.map +0 -1
- package/dist/main/webhook/WebhookSlp.d.ts +0 -14
- package/dist/main/webhook/WebhookSlp.js +0 -107
- package/dist/main/webhook/WebhookSlp.js.map +0 -1
- package/dist/main/webhook/WebhookWorker.d.ts +0 -22
- package/dist/main/webhook/WebhookWorker.js +0 -100
- package/dist/main/webhook/WebhookWorker.js.map +0 -1
- package/dist/main/webhook/index.d.ts +0 -5
- package/dist/main/webhook/index.js +0 -23
- package/dist/main/webhook/index.js.map +0 -1
- package/dist/main/webhook/interface.d.ts +0 -8
- package/dist/main/webhook/interface.js +0 -3
- package/dist/main/webhook/interface.js.map +0 -1
- package/dist/mainnet-0.5.9.js +0 -2
- package/dist/mainnet-0.5.9.js.LICENSE.txt +0 -48
- package/dist/tsconfig.browser.tsbuildinfo +0 -1
- package/jest.config.js +0 -23
|
@@ -3,18 +3,17 @@ import {
|
|
|
3
3
|
cashAddressToLockingBytecode,
|
|
4
4
|
decodeTransaction,
|
|
5
5
|
hexToBin,
|
|
6
|
-
binToBigIntUint64LE,
|
|
7
6
|
Transaction,
|
|
8
7
|
lockingBytecodeToCashAddress,
|
|
9
8
|
Output,
|
|
10
9
|
} from "@bitauth/libauth";
|
|
11
|
-
import { UnitEnum } from "../enum";
|
|
12
|
-
import NetworkProvider from "../network/NetworkProvider";
|
|
13
|
-
import { derivePrefix } from "../util/derivePublicKeyHash";
|
|
14
|
-
import { convert } from "../util/convert";
|
|
15
|
-
import { bchParam } from "../chain";
|
|
16
|
-
import { floor } from "../util/floor";
|
|
17
|
-
import { TransactionHistoryI, TransactionHistoryItemI } from "./interface";
|
|
10
|
+
import { UnitEnum } from "../enum.js";
|
|
11
|
+
import NetworkProvider from "../network/NetworkProvider.js";
|
|
12
|
+
import { derivePrefix } from "../util/derivePublicKeyHash.js";
|
|
13
|
+
import { convert } from "../util/convert.js";
|
|
14
|
+
import { bchParam } from "../chain.js";
|
|
15
|
+
import { floor } from "../util/floor.js";
|
|
16
|
+
import { TransactionHistoryI, TransactionHistoryItemI } from "./interface.js";
|
|
18
17
|
|
|
19
18
|
export async function getAddressHistory(
|
|
20
19
|
cashaddr: string,
|
|
@@ -146,7 +145,7 @@ async function getMatchingInputs(
|
|
|
146
145
|
blockheight: height,
|
|
147
146
|
txn: `${hash}`,
|
|
148
147
|
txId: `${hash}:i:${idx}`,
|
|
149
|
-
value: -Number(
|
|
148
|
+
value: -Number(output.valueSatoshis),
|
|
150
149
|
fee: 0,
|
|
151
150
|
});
|
|
152
151
|
}
|
|
@@ -165,7 +164,7 @@ async function getMatchingInputs(
|
|
|
165
164
|
blockheight: height,
|
|
166
165
|
txn: `${hash}`,
|
|
167
166
|
txId: `${hash}:i:${idx}`,
|
|
168
|
-
value: -Number(
|
|
167
|
+
value: -Number(output.valueSatoshis),
|
|
169
168
|
fee: fee,
|
|
170
169
|
});
|
|
171
170
|
txIds.push(`${hash}:i:${idx}`);
|
|
@@ -203,7 +202,7 @@ async function getMatchingInputs(
|
|
|
203
202
|
blockheight: height,
|
|
204
203
|
txn: `${hash}`,
|
|
205
204
|
txId: `${hash}:o:${transaction.outputs.indexOf(output)}`,
|
|
206
|
-
value: Number(
|
|
205
|
+
value: Number(output.valueSatoshis),
|
|
207
206
|
});
|
|
208
207
|
}
|
|
209
208
|
} else {
|
|
@@ -220,7 +219,7 @@ async function getMatchingInputs(
|
|
|
220
219
|
blockheight: height,
|
|
221
220
|
txn: `${hash}`,
|
|
222
221
|
txId: `${hash}:o:${transaction.outputs.indexOf(output)}`,
|
|
223
|
-
value: Number(
|
|
222
|
+
value: Number(output.valueSatoshis),
|
|
224
223
|
// incoming transactions pay no fee.
|
|
225
224
|
fee: 0,
|
|
226
225
|
});
|
|
@@ -256,12 +255,12 @@ function getFee(
|
|
|
256
255
|
let inValues = 0;
|
|
257
256
|
for (let outpoint of inputUtxos) {
|
|
258
257
|
if (binToHex(outpoint.lockingBytecode)) {
|
|
259
|
-
inValues += Number(
|
|
258
|
+
inValues += Number(outpoint.valueSatoshis);
|
|
260
259
|
}
|
|
261
260
|
}
|
|
262
261
|
|
|
263
262
|
const outValues = utxos
|
|
264
|
-
.map((utxo) => Number(
|
|
263
|
+
.map((utxo) => Number(utxo.valueSatoshis))
|
|
265
264
|
.reduce((a: number, b: number) => a + b, 0);
|
|
266
265
|
|
|
267
266
|
let fee = 0;
|
package/src/history/interface.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,43 +1,51 @@
|
|
|
1
|
-
export * from "./db/index";
|
|
2
|
-
export * from "./mine/index";
|
|
3
|
-
export * from "./slp/index";
|
|
4
|
-
export * from "./test/expect";
|
|
5
|
-
export * from "./
|
|
1
|
+
export * from "./db/index.js";
|
|
2
|
+
export * from "./mine/index.js";
|
|
3
|
+
export * from "./slp/index.js";
|
|
4
|
+
export * from "./test/expect.js";
|
|
5
|
+
export * from "./test/axios.js";
|
|
6
|
+
export * from "./webhook/index.js";
|
|
7
|
+
export * from "./wallet/Bcmr.js";
|
|
6
8
|
|
|
7
|
-
export * from "./network/index";
|
|
8
|
-
export { SignedMessage } from "./message/signed";
|
|
9
|
+
export * from "./network/index.js";
|
|
10
|
+
export { SignedMessage } from "./message/signed.js";
|
|
9
11
|
|
|
10
|
-
export { BaseWallet } from "./wallet/Base";
|
|
11
|
-
export * from "./wallet/Wif";
|
|
12
|
-
export * from "./wallet/createWallet";
|
|
12
|
+
export { BaseWallet } from "./wallet/Base.js";
|
|
13
|
+
export * from "./wallet/Wif.js";
|
|
14
|
+
export * from "./wallet/createWallet.js";
|
|
15
|
+
|
|
16
|
+
// provider
|
|
17
|
+
export { DefaultProvider } from "./network/configuration.js";
|
|
13
18
|
|
|
14
19
|
// Enum
|
|
15
|
-
export { NetworkType, UnitEnum } from "./enum";
|
|
16
|
-
export { WalletTypeEnum } from "./wallet/enum";
|
|
20
|
+
export { NetworkType, UnitEnum } from "./enum.js";
|
|
21
|
+
export { WalletTypeEnum } from "./wallet/enum.js";
|
|
17
22
|
|
|
18
23
|
// models
|
|
19
|
-
export
|
|
24
|
+
export * from "./wallet/model.js";
|
|
20
25
|
|
|
21
26
|
// utils
|
|
22
|
-
import * as Mainnet from "./util/index";
|
|
27
|
+
import * as Mainnet from "./util/index.js";
|
|
23
28
|
export { Mainnet };
|
|
29
|
+
export * from "./util/index.js";
|
|
30
|
+
|
|
31
|
+
// qr
|
|
32
|
+
export * from "./qr/Qr.js";
|
|
24
33
|
|
|
25
34
|
// constants
|
|
26
|
-
import * as CONST from "./constant";
|
|
35
|
+
import * as CONST from "./constant.js";
|
|
27
36
|
export { CONST };
|
|
28
37
|
|
|
29
38
|
// interfaces
|
|
30
|
-
export
|
|
31
|
-
export {
|
|
32
|
-
export { ImageI } from "./qr/interface";
|
|
39
|
+
export * from "./interface.js";
|
|
40
|
+
export { ImageI } from "./qr/interface.js";
|
|
33
41
|
export {
|
|
34
42
|
SignedMessageResponseI,
|
|
35
43
|
VerifyMessageResponseI,
|
|
36
|
-
} from "./message/interface";
|
|
37
|
-
export { WalletRequestI, WalletResponseI } from "./wallet/interface";
|
|
44
|
+
} from "./message/interface.js";
|
|
45
|
+
export { WalletRequestI, WalletResponseI } from "./wallet/interface.js";
|
|
38
46
|
|
|
39
47
|
// TODO move this up to util (Mainnet) ?
|
|
40
|
-
export * from "./util/bchaddr";
|
|
48
|
+
export * from "./util/bchaddr.js";
|
|
41
49
|
|
|
42
50
|
export function cube(x: number) {
|
|
43
51
|
return x * x * x;
|
package/src/interface.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface UtxoI {
|
|
|
21
21
|
satoshis: number;
|
|
22
22
|
height?: number;
|
|
23
23
|
coinbase?: boolean;
|
|
24
|
+
token?: TokenI;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface ElectrumBalanceI {
|
|
@@ -38,3 +39,17 @@ export interface HeaderI {
|
|
|
38
39
|
height: number;
|
|
39
40
|
hex: string;
|
|
40
41
|
}
|
|
42
|
+
|
|
43
|
+
export interface TokenI {
|
|
44
|
+
amount: number;
|
|
45
|
+
tokenId: string;
|
|
46
|
+
capability?: NFTCapability;
|
|
47
|
+
commitment?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const NFTCapability = {
|
|
51
|
+
none: literal("none"),
|
|
52
|
+
mutable: literal("mutable"),
|
|
53
|
+
minting: literal("minting"),
|
|
54
|
+
};
|
|
55
|
+
export type NFTCapability = typeof NFTCapability[keyof typeof NFTCapability];
|
package/src/message/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./interface";
|
|
2
|
-
export * from "./signed";
|
|
1
|
+
export * from "./interface.js";
|
|
2
|
+
export * from "./signed.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SignedMessage, hash_message } from "./signed";
|
|
2
|
-
import { Wallet, RegTestWallet, TestNetWallet } from "../wallet/Wif";
|
|
1
|
+
import { SignedMessage, hash_message } from "./signed.js";
|
|
2
|
+
import { Wallet, RegTestWallet, TestNetWallet } from "../wallet/Wif.js";
|
|
3
3
|
import { binToBase64, binToHex } from "@bitauth/libauth";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import fs from "fs";
|
|
6
6
|
|
|
7
7
|
async function loadLargeMessage() {
|
|
8
|
-
const data = await fs.readFile("./jest/data/bitcoin.tex", "utf-8");
|
|
8
|
+
const data = await fs.promises.readFile("./jest/data/bitcoin.tex", "utf-8");
|
|
9
9
|
return data;
|
|
10
10
|
}
|
|
11
11
|
|
package/src/message/signed.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
base64ToBin,
|
|
3
3
|
binToBase64,
|
|
4
|
+
CashAddressType,
|
|
4
5
|
encodeCashAddress,
|
|
5
6
|
hexToBin,
|
|
6
7
|
instantiateSecp256k1,
|
|
@@ -9,13 +10,13 @@ import {
|
|
|
9
10
|
utf8ToBin,
|
|
10
11
|
} from "@bitauth/libauth";
|
|
11
12
|
|
|
12
|
-
import { derivePrefix } from "../util/derivePublicKeyHash";
|
|
13
|
-
import { hash160 } from "../util/hash160";
|
|
13
|
+
import { derivePrefix } from "../util/derivePublicKeyHash.js";
|
|
14
|
+
import { hash160 } from "../util/hash160.js";
|
|
14
15
|
import {
|
|
15
16
|
SignedMessageI,
|
|
16
17
|
SignedMessageResponseI,
|
|
17
18
|
VerifyMessageResponseI,
|
|
18
|
-
} from "./interface";
|
|
19
|
+
} from "./interface.js";
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* message_magic - Add "Magic", per standard bitcoin message signing.
|
|
@@ -70,8 +71,17 @@ export class SignedMessage implements SignedMessageI {
|
|
|
70
71
|
privateKey,
|
|
71
72
|
messageHash
|
|
72
73
|
);
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
if (typeof rs === "string") {
|
|
75
|
+
throw new Error(rs);
|
|
76
|
+
}
|
|
77
|
+
let sigDer = secp256k1.signMessageHashDER(
|
|
78
|
+
privateKey,
|
|
79
|
+
messageHash
|
|
80
|
+
) as Uint8Array;
|
|
81
|
+
let sigSchnorr = secp256k1.signMessageHashSchnorr(
|
|
82
|
+
privateKey,
|
|
83
|
+
messageHash
|
|
84
|
+
) as Uint8Array;
|
|
75
85
|
let electronEncoding = new Uint8Array([
|
|
76
86
|
...[31 + rs.recoveryId],
|
|
77
87
|
...rs.signature,
|
|
@@ -127,6 +137,9 @@ export class SignedMessage implements SignedMessageI {
|
|
|
127
137
|
recoveryId as RecoveryId,
|
|
128
138
|
messageHash
|
|
129
139
|
);
|
|
140
|
+
if (typeof recoveredPk === "string") {
|
|
141
|
+
throw new Error(recoveredPk);
|
|
142
|
+
}
|
|
130
143
|
|
|
131
144
|
pkh = await hash160(recoveredPk);
|
|
132
145
|
signatureType = "recoverable";
|
|
@@ -138,7 +151,11 @@ export class SignedMessage implements SignedMessageI {
|
|
|
138
151
|
if (cashaddr) {
|
|
139
152
|
// Validate that the signature actually matches the provided cashaddr
|
|
140
153
|
let prefix = derivePrefix(cashaddr);
|
|
141
|
-
let resultingCashaddr = encodeCashAddress(
|
|
154
|
+
let resultingCashaddr = encodeCashAddress(
|
|
155
|
+
prefix,
|
|
156
|
+
CashAddressType.p2pkh,
|
|
157
|
+
pkh
|
|
158
|
+
);
|
|
142
159
|
if (resultingCashaddr === cashaddr) {
|
|
143
160
|
pkhMatch = true;
|
|
144
161
|
}
|
package/src/mine/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./mine";
|
|
1
|
+
export * from "./mine.js";
|
package/src/mine/mine.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { browserNotSupported } from "../util/browserNotSupported";
|
|
1
|
+
import { browserNotSupported } from "../util/browserNotSupported.js";
|
|
2
|
+
import { spawnSync } from "child_process";
|
|
2
3
|
/**
|
|
3
4
|
* Mine blocks to a regtest address
|
|
4
5
|
*
|
|
@@ -31,8 +32,7 @@ export async function mine({
|
|
|
31
32
|
blocks,
|
|
32
33
|
cashaddr,
|
|
33
34
|
];
|
|
34
|
-
const
|
|
35
|
-
const cli = await spawnSync(`docker`, generateArgs);
|
|
35
|
+
const cli = spawnSync(`docker`, generateArgs as any);
|
|
36
36
|
if (cli.stderr.length > 0) {
|
|
37
37
|
return console.log("Mine Error: " + cli.stderr.toString());
|
|
38
38
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { default as NetworkProvider } from "./NetworkProvider";
|
|
1
|
+
import { default as NetworkProvider } from "./NetworkProvider.js";
|
|
2
2
|
import {
|
|
3
3
|
getNetworkProvider,
|
|
4
4
|
setGlobalProvider,
|
|
5
5
|
getGlobalProvider,
|
|
6
6
|
removeGlobalProvider,
|
|
7
|
-
} from "./default";
|
|
8
|
-
import { Network } from "../interface";
|
|
9
|
-
import { networkTickerMap } from "./constant";
|
|
10
|
-
import { prefixFromNetworkMap } from "../enum";
|
|
7
|
+
} from "./default.js";
|
|
8
|
+
import { Network } from "../interface.js";
|
|
9
|
+
import { networkTickerMap } from "./constant.js";
|
|
10
|
+
import { prefixFromNetworkMap } from "../enum.js";
|
|
11
11
|
import { CashAddressNetworkPrefix } from "@bitauth/libauth";
|
|
12
12
|
|
|
13
13
|
async function initProvider(network: Network) {
|
|
@@ -4,17 +4,22 @@ import {
|
|
|
4
4
|
RequestResponse,
|
|
5
5
|
ConnectionStatus,
|
|
6
6
|
} from "electrum-cash";
|
|
7
|
-
import { default as NetworkProvider } from "./NetworkProvider";
|
|
8
|
-
import { HeaderI, TxI, UtxoI, ElectrumBalanceI } from "../interface";
|
|
9
|
-
import { Network } from "../interface";
|
|
10
|
-
import { delay } from "../util/delay";
|
|
11
|
-
import {
|
|
7
|
+
import { default as NetworkProvider } from "./NetworkProvider.js";
|
|
8
|
+
import { HeaderI, TxI, UtxoI, ElectrumBalanceI, TokenI } from "../interface.js";
|
|
9
|
+
import { Network } from "../interface.js";
|
|
10
|
+
import { delay } from "../util/delay.js";
|
|
11
|
+
import { ElectrumRawTransaction, ElectrumUtxo } from "./interface.js";
|
|
12
12
|
|
|
13
13
|
import { Mutex } from "async-mutex";
|
|
14
|
-
import { Util } from "../wallet/Util";
|
|
15
|
-
import { CancelWatchFn } from "../wallet/interface";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { Util } from "../wallet/Util.js";
|
|
15
|
+
import { CancelWatchFn } from "../wallet/interface.js";
|
|
16
|
+
import { getTransactionHash } from "../util/transaction.js";
|
|
17
|
+
import {
|
|
18
|
+
binToHex,
|
|
19
|
+
decodeTransactionBCH,
|
|
20
|
+
hexToBin,
|
|
21
|
+
TransactionBCH,
|
|
22
|
+
} from "@bitauth/libauth";
|
|
18
23
|
|
|
19
24
|
export default class ElectrumNetworkProvider implements NetworkProvider {
|
|
20
25
|
public electrum: ElectrumCluster | ElectrumClient;
|
|
@@ -49,7 +54,9 @@ export default class ElectrumNetworkProvider implements NetworkProvider {
|
|
|
49
54
|
await this.connectCluster();
|
|
50
55
|
} catch (e) {
|
|
51
56
|
console.warn(
|
|
52
|
-
`Unable to connect to one or more electrum-cash hosts: ${
|
|
57
|
+
`Unable to connect to one or more electrum-cash hosts: ${JSON.stringify(
|
|
58
|
+
e
|
|
59
|
+
)}`
|
|
53
60
|
);
|
|
54
61
|
}
|
|
55
62
|
resolve(await this.readyCluster());
|
|
@@ -69,18 +76,64 @@ export default class ElectrumNetworkProvider implements NetworkProvider {
|
|
|
69
76
|
clearTimeout(timeoutHandle);
|
|
70
77
|
}
|
|
71
78
|
|
|
79
|
+
static utxoTxCache = {};
|
|
72
80
|
async getUtxos(cashaddr: string): Promise<UtxoI[]> {
|
|
73
81
|
const result = (await this.performRequest(
|
|
74
82
|
"blockchain.address.listunspent",
|
|
75
83
|
cashaddr
|
|
76
84
|
)) as ElectrumUtxo[];
|
|
85
|
+
if (this.network === Network.MAINNET) {
|
|
86
|
+
return result.map((utxo) => ({
|
|
87
|
+
txid: utxo.tx_hash,
|
|
88
|
+
vout: utxo.tx_pos,
|
|
89
|
+
satoshis: utxo.value,
|
|
90
|
+
height: utxo.height,
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// a workaround until Fulcrum returns token info
|
|
95
|
+
const uniqueTransactionHashes = result.filter(
|
|
96
|
+
(value, index, array) => array.indexOf(value) === index
|
|
97
|
+
);
|
|
98
|
+
const transactionMap: { [hash: string]: TransactionBCH } = {};
|
|
99
|
+
for (let { tx_hash } of uniqueTransactionHashes) {
|
|
100
|
+
const key = `${this.network}-${tx_hash};`;
|
|
101
|
+
|
|
102
|
+
// check cache
|
|
103
|
+
if (ElectrumNetworkProvider.utxoTxCache[key]) {
|
|
104
|
+
transactionMap[tx_hash] = ElectrumNetworkProvider.utxoTxCache[key];
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
// download and decode tx from Fulcrum
|
|
108
|
+
const decoded = decodeTransactionBCH(
|
|
109
|
+
hexToBin(await this.getRawTransaction(tx_hash, false))
|
|
110
|
+
);
|
|
111
|
+
if (typeof decoded === "string") {
|
|
112
|
+
throw new Error(decoded);
|
|
113
|
+
}
|
|
114
|
+
transactionMap[tx_hash] = decoded;
|
|
115
|
+
ElectrumNetworkProvider.utxoTxCache[key] = decoded;
|
|
116
|
+
}
|
|
77
117
|
|
|
78
|
-
const utxos = result.map((utxo) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
118
|
+
const utxos = result.map((utxo) => {
|
|
119
|
+
const output = transactionMap[utxo.tx_hash].outputs[utxo.tx_pos];
|
|
120
|
+
return {
|
|
121
|
+
txid: utxo.tx_hash,
|
|
122
|
+
vout: utxo.tx_pos,
|
|
123
|
+
satoshis: utxo.value,
|
|
124
|
+
height: utxo.height,
|
|
125
|
+
token:
|
|
126
|
+
output.token &&
|
|
127
|
+
({
|
|
128
|
+
amount: Number(output.token.amount),
|
|
129
|
+
tokenId: binToHex(output.token.category),
|
|
130
|
+
capability: output.token.nft?.capability,
|
|
131
|
+
commitment:
|
|
132
|
+
output.token.nft?.commitment &&
|
|
133
|
+
binToHex(output.token.nft?.commitment),
|
|
134
|
+
} as TokenI),
|
|
135
|
+
} as UtxoI;
|
|
136
|
+
});
|
|
84
137
|
|
|
85
138
|
return utxos;
|
|
86
139
|
}
|
|
@@ -107,16 +160,26 @@ export default class ElectrumNetworkProvider implements NetworkProvider {
|
|
|
107
160
|
return this.blockHeight;
|
|
108
161
|
}
|
|
109
162
|
|
|
163
|
+
static rawTransactionCache = {};
|
|
110
164
|
async getRawTransaction(
|
|
111
165
|
txHash: string,
|
|
112
166
|
verbose: boolean = false
|
|
113
167
|
): Promise<string> {
|
|
168
|
+
const key = `${this.network}-${txHash}-${verbose}`;
|
|
169
|
+
if (ElectrumNetworkProvider.rawTransactionCache[key]) {
|
|
170
|
+
return ElectrumNetworkProvider.rawTransactionCache[key];
|
|
171
|
+
}
|
|
172
|
+
|
|
114
173
|
try {
|
|
115
|
-
|
|
174
|
+
const result = await this.performRequest(
|
|
116
175
|
"blockchain.transaction.get",
|
|
117
176
|
txHash,
|
|
118
177
|
verbose
|
|
119
|
-
)
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
ElectrumNetworkProvider.rawTransactionCache[key] = result;
|
|
181
|
+
|
|
182
|
+
return result as any;
|
|
120
183
|
} catch (error: any) {
|
|
121
184
|
if (
|
|
122
185
|
(error.message as string).indexOf(
|
|
@@ -145,7 +208,7 @@ export default class ElectrumNetworkProvider implements NetworkProvider {
|
|
|
145
208
|
awaitPropagation: boolean = true
|
|
146
209
|
): Promise<string> {
|
|
147
210
|
return new Promise(async (resolve, reject) => {
|
|
148
|
-
let txHash = await
|
|
211
|
+
let txHash = await getTransactionHash(txHex);
|
|
149
212
|
if (!awaitPropagation) {
|
|
150
213
|
this.performRequest("blockchain.transaction.broadcast", txHex);
|
|
151
214
|
resolve(txHash);
|
|
@@ -491,7 +554,9 @@ export default class ElectrumNetworkProvider implements NetworkProvider {
|
|
|
491
554
|
return await (this.electrum as ElectrumClient).connect();
|
|
492
555
|
} catch (e) {
|
|
493
556
|
console.warn(
|
|
494
|
-
`Warning: Failed to connect to client on ${this.network}
|
|
557
|
+
`Warning: Failed to connect to client on ${this.network} at ${
|
|
558
|
+
(this.electrum as ElectrumClient).connection.host
|
|
559
|
+
}.`
|
|
495
560
|
);
|
|
496
561
|
return;
|
|
497
562
|
}
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
+
import { Network } from "../interface";
|
|
1
2
|
import * as config from "./configuration";
|
|
2
3
|
import * as primary from "./constant";
|
|
3
4
|
|
|
4
5
|
test("Should get electrum settings from defaults", async () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
expect(
|
|
6
|
+
expect(config.getDefaultServers(Network.MAINNET)).toBe(
|
|
7
|
+
primary.mainnetServers
|
|
8
|
+
);
|
|
9
|
+
expect(config.getDefaultServers(Network.TESTNET)).toBe(
|
|
10
|
+
primary.testnetServers
|
|
11
|
+
);
|
|
12
|
+
expect(config.getDefaultServers(Network.REGTEST)).toBe(
|
|
13
|
+
primary.regtestServers
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("Should get electrum settings from DefaultProvider", async () => {
|
|
18
|
+
config.DefaultProvider.servers.mainnet = ["wss://example.com:777"];
|
|
19
|
+
|
|
20
|
+
expect(config.getDefaultServers(Network.MAINNET)).toStrictEqual([
|
|
21
|
+
"wss://example.com:777",
|
|
22
|
+
]);
|
|
23
|
+
expect(config.getDefaultServers(Network.TESTNET)).toBe(
|
|
24
|
+
primary.testnetServers
|
|
25
|
+
);
|
|
26
|
+
expect(config.getDefaultServers(Network.REGTEST)).toBe(
|
|
27
|
+
primary.regtestServers
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
config.DefaultProvider.servers.mainnet = [];
|
|
9
31
|
});
|
|
10
32
|
|
|
11
33
|
test("Should get electrum settings from env", async () => {
|
|
@@ -13,13 +35,16 @@ test("Should get electrum settings from env", async () => {
|
|
|
13
35
|
process.env.ELECTRUM_TESTNET =
|
|
14
36
|
"https://test.example.com:1234,https://test.example.dk:1234";
|
|
15
37
|
process.env.ELECTRUM_REGTEST = "ws://reg.example.com:1234";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
38
|
+
expect(config.getDefaultServers(Network.MAINNET)).toStrictEqual([
|
|
39
|
+
"https://example.com:1234",
|
|
40
|
+
]);
|
|
41
|
+
expect(config.getDefaultServers(Network.TESTNET)).toStrictEqual([
|
|
19
42
|
"https://test.example.com:1234",
|
|
20
43
|
"https://test.example.dk:1234",
|
|
21
44
|
]);
|
|
22
|
-
expect(
|
|
45
|
+
expect(config.getDefaultServers(Network.REGTEST)).toStrictEqual([
|
|
46
|
+
"ws://reg.example.com:1234",
|
|
47
|
+
]);
|
|
23
48
|
});
|
|
24
49
|
|
|
25
50
|
test("Should get electrum cluster confidence from defaults", async () => {
|
|
@@ -1,31 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Network } from "../interface.js";
|
|
2
|
+
import { getRuntimePlatform } from "../util/index.js";
|
|
3
|
+
import * as primary from "./constant.js";
|
|
3
4
|
|
|
4
5
|
let mainnetServers: string[],
|
|
5
6
|
testnetServers: string[],
|
|
6
7
|
regtestServers: string[];
|
|
7
8
|
|
|
8
|
-
export
|
|
9
|
+
export class DefaultProvider {
|
|
10
|
+
static servers: { [name: string]: string[] } = {
|
|
11
|
+
mainnet: [] as string[],
|
|
12
|
+
testnet: [] as string[],
|
|
13
|
+
regtest: [] as string[],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getDefaultServers(network: Network) {
|
|
18
|
+
let env: any;
|
|
9
19
|
if (getRuntimePlatform() == "node") {
|
|
10
|
-
|
|
11
|
-
? process.env.ELECTRUM.split(",")
|
|
12
|
-
: primary.mainnetServers;
|
|
13
|
-
testnetServers = process.env.ELECTRUM_TESTNET
|
|
14
|
-
? process.env.ELECTRUM_TESTNET.split(",")
|
|
15
|
-
: primary.testnetServers;
|
|
16
|
-
regtestServers = process.env.ELECTRUM_REGTEST
|
|
17
|
-
? process.env.ELECTRUM_REGTEST.split(",")
|
|
18
|
-
: primary.regtestServers;
|
|
20
|
+
env = process.env;
|
|
19
21
|
} else {
|
|
20
|
-
|
|
21
|
-
testnetServers = primary.testnetServers;
|
|
22
|
-
regtestServers = primary.regtestServers;
|
|
22
|
+
env = {};
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
mainnetServers = DefaultProvider.servers.mainnet.length
|
|
26
|
+
? DefaultProvider.servers.mainnet
|
|
27
|
+
: env.ELECTRUM
|
|
28
|
+
? env.ELECTRUM.split(",")
|
|
29
|
+
: primary.mainnetServers;
|
|
30
|
+
testnetServers = DefaultProvider.servers.testnet.length
|
|
31
|
+
? DefaultProvider.servers.testnet
|
|
32
|
+
: env.ELECTRUM_TESTNET
|
|
33
|
+
? env.ELECTRUM_TESTNET.split(",")
|
|
34
|
+
: primary.testnetServers;
|
|
35
|
+
regtestServers = DefaultProvider.servers.regtest.length
|
|
36
|
+
? DefaultProvider.servers.regtest
|
|
37
|
+
: env.ELECTRUM_REGTEST
|
|
38
|
+
? env.ELECTRUM_REGTEST.split(",")
|
|
39
|
+
: primary.regtestServers;
|
|
40
|
+
|
|
24
41
|
return {
|
|
25
42
|
mainnet: mainnetServers,
|
|
26
43
|
testnet: testnetServers,
|
|
27
44
|
regtest: regtestServers,
|
|
28
|
-
};
|
|
45
|
+
}[network];
|
|
29
46
|
}
|
|
30
47
|
|
|
31
48
|
export function getUserAgent() {
|
|
@@ -53,5 +70,3 @@ export function getConfidence() {
|
|
|
53
70
|
}
|
|
54
71
|
return confidence;
|
|
55
72
|
}
|
|
56
|
-
|
|
57
|
-
export const defaultServers = getDefaultServers();
|
package/src/network/constant.ts
CHANGED
|
@@ -12,13 +12,13 @@ export const mainnetServers = [
|
|
|
12
12
|
"wss://bch.imaginary.cash:50004",
|
|
13
13
|
//"wss://blackie.c3-soft.com:50004",
|
|
14
14
|
"wss://electrum.imaginary.cash:50004",
|
|
15
|
-
"wss://fulcrum.fountainhead.cash",
|
|
15
|
+
// "wss://fulcrum.fountainhead.cash",
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
export const testnetServers = [
|
|
19
|
-
"wss://tbch.loping.net:60004",
|
|
20
|
-
|
|
21
|
-
//"wss://testnet.bitcoincash.network:60004",
|
|
19
|
+
// "wss://tbch.loping.net:60004",
|
|
20
|
+
"wss://blackie.c3-soft.com:60004",
|
|
21
|
+
// "wss://testnet.bitcoincash.network:60004",
|
|
22
22
|
//,"wss://unavailable.invalid:50004"
|
|
23
23
|
];
|
|
24
24
|
|
|
@@ -29,6 +29,11 @@ export const testnetServers = [
|
|
|
29
29
|
// //,"wss://unavailable.invalid:50004"
|
|
30
30
|
// ];
|
|
31
31
|
|
|
32
|
+
// // chipnet
|
|
33
|
+
// export const testnetServers = [
|
|
34
|
+
// "wss://chipnet.imaginary.cash:50004",
|
|
35
|
+
// ];
|
|
36
|
+
|
|
32
37
|
export const regtestServers = ["ws://127.0.0.1:60003"];
|
|
33
38
|
|
|
34
39
|
export const defaultServers = {
|