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
package/src/wallet/interface.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { WalletTypeEnum, FeePaidByEnum } from "./enum";
|
|
2
|
-
import { NetworkEnum } from "../enum";
|
|
3
|
-
import { ImageI } from "../qr/interface";
|
|
4
|
-
import { ElectrumRawTransaction } from "../network/interface";
|
|
5
|
-
import { BalanceResponse } from "../util/balanceObjectFromSatoshi";
|
|
1
|
+
import { WalletTypeEnum, FeePaidByEnum } from "./enum.js";
|
|
2
|
+
import { NetworkEnum } from "../enum.js";
|
|
3
|
+
import { ImageI } from "../qr/interface.js";
|
|
4
|
+
import { ElectrumRawTransaction } from "../network/interface.js";
|
|
5
|
+
import { BalanceResponse } from "../util/balanceObjectFromSatoshi.js";
|
|
6
|
+
import { UtxoI } from "../interface.js";
|
|
6
7
|
|
|
7
8
|
export interface WalletRequestI {
|
|
8
9
|
name?: string;
|
|
@@ -28,6 +29,7 @@ export interface WalletResponseI {
|
|
|
28
29
|
|
|
29
30
|
export interface WalletInfoI {
|
|
30
31
|
cashaddr?: string;
|
|
32
|
+
tokenaddr?: string;
|
|
31
33
|
isTestnet?: boolean;
|
|
32
34
|
name?: string;
|
|
33
35
|
network: NetworkEnum;
|
|
@@ -44,13 +46,14 @@ export interface WalletInfoI {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export interface SendRequestOptionsI {
|
|
47
|
-
utxoIds?: string[];
|
|
49
|
+
utxoIds?: string[] | UtxoI[];
|
|
48
50
|
changeAddress?: string;
|
|
49
51
|
slpAware?: boolean; // a flag which activates utxo checking against an external slp indexer
|
|
50
52
|
slpSemiAware?: boolean; // a flag which requires an utxo to have more than 546 sats to be spendable and counted in the balance
|
|
51
53
|
queryBalance?: boolean;
|
|
52
54
|
awaitTransactionPropagation?: boolean;
|
|
53
55
|
feePaidBy?: FeePaidByEnum;
|
|
56
|
+
checkTokenQuantities?: boolean; // true
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
export interface MnemonicI {
|
package/src/wallet/model.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BalanceResponse } from "../util/balanceObjectFromSatoshi";
|
|
2
|
-
import { sanitizeUnit } from "../util/sanitizeUnit";
|
|
3
|
-
import { UnitEnum } from "../enum";
|
|
4
|
-
import { UtxoI } from "../interface";
|
|
5
|
-
import { DELIMITER } from "../constant";
|
|
1
|
+
import { BalanceResponse } from "../util/balanceObjectFromSatoshi.js";
|
|
2
|
+
import { sanitizeUnit } from "../util/sanitizeUnit.js";
|
|
3
|
+
import { UnitEnum } from "../enum.js";
|
|
4
|
+
import { NFTCapability, UtxoI } from "../interface.js";
|
|
5
|
+
import { DELIMITER } from "../constant.js";
|
|
6
6
|
import { utf8ToBin } from "@bitauth/libauth";
|
|
7
7
|
|
|
8
8
|
// These are the minimal models used to provide types for the express server
|
|
@@ -10,6 +10,13 @@ import { utf8ToBin } from "@bitauth/libauth";
|
|
|
10
10
|
// This file will be deprecated auto-generated file in the future
|
|
11
11
|
// Any business logic contained here should be moved elsewhere in src/
|
|
12
12
|
|
|
13
|
+
export type SendRequestType =
|
|
14
|
+
| SendRequest
|
|
15
|
+
| TokenSendRequest
|
|
16
|
+
| OpReturnData
|
|
17
|
+
| Array<SendRequest | TokenSendRequest | OpReturnData>
|
|
18
|
+
| SendRequestArray[];
|
|
19
|
+
|
|
13
20
|
export class SendRequest {
|
|
14
21
|
cashaddr: string;
|
|
15
22
|
value: number;
|
|
@@ -30,10 +37,123 @@ export class SendRequest {
|
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
|
|
40
|
+
export class TokenGenesisRequest {
|
|
41
|
+
amount?: number; // fungible token amount
|
|
42
|
+
capability?: NFTCapability;
|
|
43
|
+
commitment?: string;
|
|
44
|
+
cashaddr?: string;
|
|
45
|
+
value?: number; // satoshi value
|
|
46
|
+
|
|
47
|
+
constructor({
|
|
48
|
+
amount,
|
|
49
|
+
capability,
|
|
50
|
+
commitment,
|
|
51
|
+
cashaddr,
|
|
52
|
+
value,
|
|
53
|
+
}: {
|
|
54
|
+
amount?: number;
|
|
55
|
+
capability?: NFTCapability;
|
|
56
|
+
commitment?: string;
|
|
57
|
+
cashaddr?: string;
|
|
58
|
+
value?: number;
|
|
59
|
+
}) {
|
|
60
|
+
this.amount = amount;
|
|
61
|
+
this.capability = capability;
|
|
62
|
+
this.commitment = commitment;
|
|
63
|
+
this.cashaddr = cashaddr;
|
|
64
|
+
this.value = value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class TokenBurnRequest {
|
|
69
|
+
tokenId: string;
|
|
70
|
+
capability?: NFTCapability;
|
|
71
|
+
commitment?: string;
|
|
72
|
+
amount?: number; // fungible token amount
|
|
73
|
+
cashaddr?: string;
|
|
74
|
+
|
|
75
|
+
constructor({
|
|
76
|
+
tokenId,
|
|
77
|
+
capability,
|
|
78
|
+
commitment,
|
|
79
|
+
amount,
|
|
80
|
+
cashaddr,
|
|
81
|
+
}: {
|
|
82
|
+
tokenId: string;
|
|
83
|
+
capability?: NFTCapability;
|
|
84
|
+
commitment?: string;
|
|
85
|
+
amount?: number;
|
|
86
|
+
cashaddr?: string;
|
|
87
|
+
}) {
|
|
88
|
+
this.tokenId = tokenId;
|
|
89
|
+
this.capability = capability;
|
|
90
|
+
this.commitment = commitment;
|
|
91
|
+
this.amount = amount;
|
|
92
|
+
this.cashaddr = cashaddr;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export class TokenSendRequest {
|
|
97
|
+
cashaddr: string;
|
|
98
|
+
value?: number; // satoshi value
|
|
99
|
+
amount: number; // fungible token amount
|
|
100
|
+
tokenId: string;
|
|
101
|
+
capability?: NFTCapability;
|
|
102
|
+
commitment?: string;
|
|
103
|
+
|
|
104
|
+
constructor({
|
|
105
|
+
cashaddr,
|
|
106
|
+
value,
|
|
107
|
+
amount,
|
|
108
|
+
tokenId,
|
|
109
|
+
capability,
|
|
110
|
+
commitment,
|
|
111
|
+
}: {
|
|
112
|
+
cashaddr: string;
|
|
113
|
+
value?: number;
|
|
114
|
+
amount?: number;
|
|
115
|
+
tokenId: string;
|
|
116
|
+
capability?: NFTCapability;
|
|
117
|
+
commitment?: string;
|
|
118
|
+
}) {
|
|
119
|
+
this.cashaddr = cashaddr;
|
|
120
|
+
this.value = value;
|
|
121
|
+
this.amount = amount || 0;
|
|
122
|
+
this.tokenId = tokenId;
|
|
123
|
+
this.capability = capability;
|
|
124
|
+
this.commitment = commitment;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export class TokenMintRequest {
|
|
129
|
+
capability?: NFTCapability;
|
|
130
|
+
commitment?: string;
|
|
131
|
+
cashaddr?: string;
|
|
132
|
+
value?: number;
|
|
133
|
+
|
|
134
|
+
constructor({
|
|
135
|
+
capability,
|
|
136
|
+
commitment,
|
|
137
|
+
cashaddr,
|
|
138
|
+
value,
|
|
139
|
+
}: {
|
|
140
|
+
capability?: NFTCapability;
|
|
141
|
+
commitment?: string;
|
|
142
|
+
cashaddr?: string;
|
|
143
|
+
value?: number;
|
|
144
|
+
}) {
|
|
145
|
+
// be explicit about minting capability for new NFTs
|
|
146
|
+
this.capability = capability || NFTCapability.none;
|
|
147
|
+
this.commitment = commitment;
|
|
148
|
+
this.cashaddr = cashaddr;
|
|
149
|
+
this.value = value;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
33
153
|
export class OpReturnData {
|
|
34
154
|
buffer: Buffer;
|
|
35
155
|
|
|
36
|
-
|
|
156
|
+
public constructor(buffer: Buffer) {
|
|
37
157
|
this.buffer = Buffer.from(buffer);
|
|
38
158
|
}
|
|
39
159
|
|
|
@@ -44,14 +164,8 @@ export class OpReturnData {
|
|
|
44
164
|
*
|
|
45
165
|
* @returns class instance
|
|
46
166
|
*/
|
|
47
|
-
public static from(data: string | Buffer) {
|
|
48
|
-
|
|
49
|
-
return this.fromBuffer(data as Buffer);
|
|
50
|
-
} else if (typeof data === "string") {
|
|
51
|
-
return this.fromString(data as string);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
throw new Error(`Unsupported data type ${typeof data}`);
|
|
167
|
+
public static from(data: string | Buffer | Uint8Array) {
|
|
168
|
+
return this.fromArray([data]);
|
|
55
169
|
}
|
|
56
170
|
|
|
57
171
|
/**
|
|
@@ -62,10 +176,7 @@ export class OpReturnData {
|
|
|
62
176
|
* @returns class instance
|
|
63
177
|
*/
|
|
64
178
|
public static fromString(string: string) {
|
|
65
|
-
|
|
66
|
-
return new this(
|
|
67
|
-
Buffer.from([...[0x6a, 0x4c, length], ...utf8ToBin(string)])
|
|
68
|
-
);
|
|
179
|
+
return this.fromArray([string]);
|
|
69
180
|
}
|
|
70
181
|
|
|
71
182
|
/**
|
|
@@ -78,10 +189,69 @@ export class OpReturnData {
|
|
|
78
189
|
*/
|
|
79
190
|
public static fromBuffer(buffer: Buffer) {
|
|
80
191
|
if (buffer[0] !== 0x6a) {
|
|
81
|
-
return
|
|
192
|
+
return this.fromArray([buffer]);
|
|
82
193
|
}
|
|
83
194
|
return new this(buffer);
|
|
84
195
|
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* buffer - Accept OP_RETURN data as a binary buffer.
|
|
199
|
+
* If buffer lacks the OP_RETURN and OP_PUSHDATA opcodes, they will be prepended.
|
|
200
|
+
*
|
|
201
|
+
* @param buffer Data buffer to be assigned to the OP_RETURN outpit
|
|
202
|
+
*
|
|
203
|
+
* @returns class instance
|
|
204
|
+
*/
|
|
205
|
+
public static fromUint8Array(uint8Array: Uint8Array) {
|
|
206
|
+
if (uint8Array[0] !== 0x6a) {
|
|
207
|
+
return this.fromArray([uint8Array]);
|
|
208
|
+
}
|
|
209
|
+
return new this(Buffer.from(uint8Array));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* fromArray - Accept array of data
|
|
214
|
+
*
|
|
215
|
+
* @param array Array of Buffer or UTF-8 encoded string messages to be converted to OP_RETURN data
|
|
216
|
+
*
|
|
217
|
+
* @returns class instance
|
|
218
|
+
*/
|
|
219
|
+
public static fromArray(array: Array<string | Buffer | Uint8Array>) {
|
|
220
|
+
let data: Buffer = Buffer.from([0x6a]); // OP_RETURN
|
|
221
|
+
for (const element of array) {
|
|
222
|
+
let length: number;
|
|
223
|
+
let elementData: Uint8Array | Buffer;
|
|
224
|
+
let lengthData: any;
|
|
225
|
+
if (typeof element === "string") {
|
|
226
|
+
elementData = utf8ToBin(element);
|
|
227
|
+
length = elementData.length;
|
|
228
|
+
} else if (element instanceof Buffer) {
|
|
229
|
+
elementData = element;
|
|
230
|
+
length = elementData.length;
|
|
231
|
+
} else if (element instanceof Uint8Array) {
|
|
232
|
+
elementData = Buffer.from(element);
|
|
233
|
+
length = elementData.length;
|
|
234
|
+
} else {
|
|
235
|
+
throw new Error("Wrong data array element");
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (length < 75) {
|
|
239
|
+
lengthData = [length];
|
|
240
|
+
} else if (length < 220) {
|
|
241
|
+
lengthData = [0x4c, length];
|
|
242
|
+
} else {
|
|
243
|
+
throw new Error("OP_RETURN data can not exceed 220 bytes in size");
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
data = Buffer.from([...data, ...[lengthData], ...elementData]);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (data.length > 220) {
|
|
250
|
+
throw new Error("OP_RETURN data can not exceed 220 bytes in size");
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return new this(data);
|
|
254
|
+
}
|
|
85
255
|
}
|
|
86
256
|
|
|
87
257
|
export type SendRequestArray = Array<string | number | UnitEnum | Buffer>;
|
|
@@ -144,6 +314,7 @@ export class SendResponse {
|
|
|
144
314
|
txId?: string;
|
|
145
315
|
balance?: BalanceResponse;
|
|
146
316
|
explorerUrl?: string;
|
|
317
|
+
tokenIds?: string[];
|
|
147
318
|
|
|
148
319
|
constructor({
|
|
149
320
|
txId,
|
package/src/webhook/Webhook.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import SqlProvider from "../db/SqlProvider";
|
|
2
|
-
import { TxI } from "../interface";
|
|
1
|
+
import SqlProvider from "../db/SqlProvider.js";
|
|
2
|
+
import { TxI } from "../interface.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import axios from "axios";
|
|
5
5
|
|
|
6
6
|
export enum WebhookType {
|
|
7
7
|
transactionIn = "transaction:in",
|
|
@@ -70,6 +70,10 @@ export class Webhook {
|
|
|
70
70
|
static setupAxiosMocks() {
|
|
71
71
|
axios.interceptors.request.use((config) => {
|
|
72
72
|
const url = config.url!;
|
|
73
|
+
if (!url.startsWith("http://example.com")) {
|
|
74
|
+
return config;
|
|
75
|
+
}
|
|
76
|
+
|
|
73
77
|
let response;
|
|
74
78
|
if (url === "http://example.com/fail") {
|
|
75
79
|
response = { status: 503 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import SqlProvider from "../db/SqlProvider";
|
|
2
|
-
import { TxI } from "../interface";
|
|
3
|
-
import { ElectrumRawTransaction } from "../network/interface";
|
|
4
|
-
import { balanceResponseFromSatoshi } from "../util/balanceObjectFromSatoshi";
|
|
5
|
-
import { Wallet } from "../wallet/Wif";
|
|
6
|
-
import { Webhook, WebhookRecurrence, WebhookType } from "./Webhook";
|
|
7
|
-
import WebhookWorker from "./WebhookWorker";
|
|
1
|
+
import SqlProvider from "../db/SqlProvider.js";
|
|
2
|
+
import { TxI } from "../interface.js";
|
|
3
|
+
import { ElectrumRawTransaction } from "../network/interface.js";
|
|
4
|
+
import { balanceResponseFromSatoshi } from "../util/balanceObjectFromSatoshi.js";
|
|
5
|
+
import { Wallet } from "../wallet/Wif.js";
|
|
6
|
+
import { Webhook, WebhookRecurrence, WebhookType } from "./Webhook.js";
|
|
7
|
+
import WebhookWorker from "./WebhookWorker.js";
|
|
8
8
|
|
|
9
9
|
export class WebhookBch extends Webhook {
|
|
10
10
|
callback!: (data: any | string | Array<string>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import WebhookWorker from "
|
|
1
|
+
import WebhookWorker from "./WebhookWorker";
|
|
2
2
|
import { RegTestWallet } from "../wallet/Wif";
|
|
3
3
|
import { mine } from "../mine/mine";
|
|
4
4
|
import { Webhook, WebhookRecurrence, WebhookType } from "./Webhook";
|
|
@@ -15,7 +15,7 @@ const serversGspp = { ...{}, ...GsppProvider.defaultServers };
|
|
|
15
15
|
/**
|
|
16
16
|
* @jest-environment jsdom
|
|
17
17
|
*/
|
|
18
|
-
describe("Webhook worker tests", () => {
|
|
18
|
+
describe.skip("Webhook worker tests", () => {
|
|
19
19
|
beforeAll(async () => {
|
|
20
20
|
try {
|
|
21
21
|
if (process.env.PRIVATE_WIF) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { GsppTx, SlpDbTx, SlpTxI } from "../slp";
|
|
1
|
+
import { GsppTx, SlpDbTx, SlpTxI } from "../slp/index.js";
|
|
2
2
|
import {
|
|
3
3
|
SlpCancelWatchFn,
|
|
4
4
|
SlpWatchTransactionCallback,
|
|
5
|
-
} from "../slp/SlpProvider";
|
|
6
|
-
import { toSlpAddress } from "../util/bchaddr";
|
|
7
|
-
import { Wallet } from "../wallet/Wif";
|
|
8
|
-
import { Webhook, WebhookRecurrence, WebhookType } from "./Webhook";
|
|
9
|
-
import WebhookWorker from "./WebhookWorker";
|
|
5
|
+
} from "../slp/SlpProvider.js";
|
|
6
|
+
import { toSlpAddress } from "../util/bchaddr.js";
|
|
7
|
+
import { Wallet } from "../wallet/Wif.js";
|
|
8
|
+
import { Webhook, WebhookRecurrence, WebhookType } from "./Webhook.js";
|
|
9
|
+
import WebhookWorker from "./WebhookWorker.js";
|
|
10
10
|
|
|
11
11
|
export class WebhookSlp extends Webhook {
|
|
12
12
|
callback!: SlpWatchTransactionCallback;
|
package/src/webhook/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as WebhookWorker } from "./WebhookWorker";
|
|
2
|
-
export * from "./Webhook";
|
|
3
|
-
export * from "./WebhookBch";
|
|
4
|
-
export * from "./WebhookSlp";
|
|
5
|
-
export * from "./interface";
|
|
1
|
+
export { default as WebhookWorker } from "./WebhookWorker.js";
|
|
2
|
+
export * from "./Webhook.js";
|
|
3
|
+
export * from "./WebhookBch.js";
|
|
4
|
+
export * from "./WebhookSlp.js";
|
|
5
|
+
export * from "./interface.js";
|
package/tsconfig.browser.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -2,19 +2,31 @@
|
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"rootDir": "src",
|
|
5
|
-
"skipLibCheck": true,
|
|
6
5
|
"esModuleInterop": true,
|
|
7
6
|
"allowSyntheticDefaultImports": true,
|
|
8
7
|
"strict": true,
|
|
9
8
|
"forceConsistentCasingInFileNames": true,
|
|
10
9
|
"downlevelIteration": true,
|
|
11
10
|
"composite": true,
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"target": "esnext",
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"outDir": "./dist/module",
|
|
14
14
|
"moduleResolution": "node",
|
|
15
15
|
"resolveJsonModule": true,
|
|
16
|
-
"lib": ["
|
|
17
|
-
"typeRoots": [
|
|
16
|
+
"lib": ["es2020", "es2020.bigint", "dom"],
|
|
17
|
+
"typeRoots": [
|
|
18
|
+
"node_modules/@types",
|
|
19
|
+
"../../node_modules/@types",
|
|
20
|
+
"./src/types"
|
|
21
|
+
],
|
|
22
|
+
"types": ["node", "jest"],
|
|
23
|
+
"allowJs": false,
|
|
24
|
+
"declaration": true,
|
|
25
|
+
"declarationMap": true,
|
|
26
|
+
"sourceMap": true,
|
|
27
|
+
"noEmit": false,
|
|
28
|
+
"strictPropertyInitialization": false,
|
|
29
|
+
"useDefineForClassFields": false
|
|
18
30
|
},
|
|
19
31
|
"include": ["src/**/*.ts"],
|
|
20
32
|
"exclude": ["node_modules/**", "src/**/*test.ts"],
|
|
@@ -2,29 +2,28 @@ const { merge } = require("webpack-merge");
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const packageJson = require("./package.json");
|
|
4
4
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
5
|
+
const InjectBodyPlugin = require("inject-body-webpack-plugin").default;
|
|
5
6
|
const BundleAnalyzerPlugin =
|
|
6
7
|
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
|
|
8
|
+
const CircularDependencyPlugin = require("circular-dependency-plugin");
|
|
7
9
|
const __basedir = require("path").resolve(__dirname, "../../");
|
|
8
10
|
|
|
11
|
+
const webpack = require("webpack");
|
|
12
|
+
|
|
9
13
|
const baseConfig = {
|
|
10
14
|
mode: "development",
|
|
11
|
-
module: {
|
|
12
|
-
rules: [
|
|
13
|
-
{
|
|
14
|
-
test: /\.tsx?$/,
|
|
15
|
-
use: "ts-loader",
|
|
16
|
-
exclude: /node_modules/,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
15
|
resolve: {
|
|
21
16
|
extensions: [".tsx", ".ts", ".js", ".wasm"],
|
|
17
|
+
extensionAlias: {
|
|
18
|
+
".js": [".ts", ".js"],
|
|
19
|
+
},
|
|
22
20
|
},
|
|
23
21
|
optimization: {
|
|
24
22
|
minimize: false,
|
|
25
23
|
mangleWasmImports: true,
|
|
26
24
|
usedExports: true,
|
|
27
25
|
},
|
|
26
|
+
experiments: { topLevelAwait: true, outputModule: true },
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
const prodConfig = {
|
|
@@ -40,10 +39,27 @@ const browserConfig = {
|
|
|
40
39
|
mainnet: {
|
|
41
40
|
import: "./src/index.ts",
|
|
42
41
|
library: {
|
|
42
|
+
name: "__mainnetPromise",
|
|
43
43
|
type: "global",
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
|
+
module: {
|
|
48
|
+
rules: [
|
|
49
|
+
{
|
|
50
|
+
test: /\.tsx?$/,
|
|
51
|
+
use: [
|
|
52
|
+
{
|
|
53
|
+
loader: "ts-loader",
|
|
54
|
+
options: {
|
|
55
|
+
configFile: "tsconfig.browser.json",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
exclude: [/node_modules/],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
47
63
|
output: {
|
|
48
64
|
filename: `[name]-${packageJson.version}.js`,
|
|
49
65
|
path: __dirname + "/dist",
|
|
@@ -54,6 +70,25 @@ const browserConfig = {
|
|
|
54
70
|
new HtmlWebpackPlugin({
|
|
55
71
|
title: "The Empty Mainnet App",
|
|
56
72
|
}),
|
|
73
|
+
new InjectBodyPlugin({
|
|
74
|
+
content:
|
|
75
|
+
'<script>document.addEventListener("DOMContentLoaded", async (event) => Object.assign(globalThis, await __mainnetPromise))</script>',
|
|
76
|
+
}),
|
|
77
|
+
new webpack.ProvidePlugin({
|
|
78
|
+
Buffer: ["buffer", "Buffer"],
|
|
79
|
+
}),
|
|
80
|
+
new CircularDependencyPlugin({
|
|
81
|
+
include: /src/,
|
|
82
|
+
// exclude detection of files based on a RegExp
|
|
83
|
+
exclude: /node_modules/,
|
|
84
|
+
// add errors to webpack instead of warnings
|
|
85
|
+
failOnError: false,
|
|
86
|
+
// allow import cycles that include an asyncronous import,
|
|
87
|
+
// e.g. via import(/* webpackMode: "weak" */ './file.js')
|
|
88
|
+
allowAsyncCycles: false,
|
|
89
|
+
// set the current working directory for displaying module paths
|
|
90
|
+
cwd: process.cwd(),
|
|
91
|
+
}),
|
|
57
92
|
],
|
|
58
93
|
resolve: {
|
|
59
94
|
alias: {
|
|
@@ -62,12 +97,12 @@ const browserConfig = {
|
|
|
62
97
|
"@ethersproject/contracts$": require.resolve(
|
|
63
98
|
"@ethersproject/contracts/lib/index.js"
|
|
64
99
|
),
|
|
65
|
-
bip39: require.resolve("./polyfill/bip39.browser.js"),
|
|
66
100
|
bufferutil: false,
|
|
67
101
|
child_process: false,
|
|
68
102
|
crypto: false,
|
|
69
103
|
dns: false,
|
|
70
104
|
events: require.resolve("events/"),
|
|
105
|
+
eventsource: false,
|
|
71
106
|
fs: false,
|
|
72
107
|
http: false,
|
|
73
108
|
https: false,
|
|
@@ -82,7 +117,6 @@ const browserConfig = {
|
|
|
82
117
|
"pg-native": false,
|
|
83
118
|
solc: false,
|
|
84
119
|
tls: false,
|
|
85
|
-
util: require.resolve("./polyfill/util.js"),
|
|
86
120
|
url: false,
|
|
87
121
|
zlib: false,
|
|
88
122
|
},
|
|
@@ -101,13 +135,12 @@ const webWorkerConfig = {
|
|
|
101
135
|
},
|
|
102
136
|
resolve: {
|
|
103
137
|
alias: {
|
|
104
|
-
bip39: require.resolve("./polyfill/bip39.browser.js"),
|
|
105
138
|
bufferutil: false,
|
|
106
139
|
child_process: false,
|
|
107
140
|
crypto: false,
|
|
108
141
|
dns: false,
|
|
109
|
-
eventsource: require.resolve("./polyfill/eventsource.js"),
|
|
110
142
|
events: require.resolve("events/"),
|
|
143
|
+
eventsource: false,
|
|
111
144
|
fs: false,
|
|
112
145
|
http: false,
|
|
113
146
|
https: false,
|
|
@@ -122,7 +155,6 @@ const webWorkerConfig = {
|
|
|
122
155
|
"pg-native": false,
|
|
123
156
|
solc: false,
|
|
124
157
|
tls: false,
|
|
125
|
-
util: require.resolve("./polyfill/util.js"),
|
|
126
158
|
url: false,
|
|
127
159
|
zlib: false,
|
|
128
160
|
},
|
package/dist/main/chain.d.ts
DELETED
package/dist/main/chain.js
DELETED
package/dist/main/chain.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,QAAQ,EAAE,SAAS;CACpB,CAAC"}
|
package/dist/main/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/main/cli.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const createWallet_1 = require("../src/wallet/createWallet");
|
|
4
|
-
const createWallet_2 = require("../src/wallet/createWallet");
|
|
5
|
-
let args = process.argv.slice(); // remove ts-node
|
|
6
|
-
args.shift(); // remove ts-node
|
|
7
|
-
args.shift(); // remove cli.ts
|
|
8
|
-
// This is an UNSUPPORTED feature for developers
|
|
9
|
-
// Please upstream any additions you find useful.
|
|
10
|
-
// There is ZERO support for this feature
|
|
11
|
-
(async () => {
|
|
12
|
-
let command = args.shift();
|
|
13
|
-
let w;
|
|
14
|
-
switch (command) {
|
|
15
|
-
case "wallet/create":
|
|
16
|
-
let response = await (0, createWallet_1.createWallet)({
|
|
17
|
-
name: args[0],
|
|
18
|
-
type: args[1],
|
|
19
|
-
network: args[2],
|
|
20
|
-
});
|
|
21
|
-
console.log(response);
|
|
22
|
-
break;
|
|
23
|
-
case "wallet/deposit_qr":
|
|
24
|
-
w = await (0, createWallet_2.walletFromId)(args[0]);
|
|
25
|
-
console.log(w.depositQr());
|
|
26
|
-
break;
|
|
27
|
-
case "wallet/deposit_address":
|
|
28
|
-
w = await (0, createWallet_2.walletFromId)(args[0]);
|
|
29
|
-
console.log(w.depositAddress());
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
console.log(`${command} not implemented`);
|
|
33
|
-
}
|
|
34
|
-
})();
|
|
35
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/main/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";;AAAA,6DAA0D;AAE1D,6DAA0D;AAE1D,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,iBAAiB;AAClD,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,iBAAiB;AAC/B,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,gBAAgB;AAE9B,gDAAgD;AAChD,iDAAiD;AACjD,yCAAyC;AAEzC,CAAC,KAAK,IAAI,EAAE;IACV,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,IAAI,CAAC,CAAC;IACN,QAAQ,OAAO,EAAE;QACf,KAAK,eAAe;YAClB,IAAI,QAAQ,GAAG,MAAM,IAAA,2BAAY,EAAC;gBAChC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;gBACb,IAAI,EAAE,IAAI,CAAC,CAAC,CAAmB;gBAC/B,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;aACjB,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACtB,MAAM;QACR,KAAK,mBAAmB;YACtB,CAAC,GAAG,MAAM,IAAA,2BAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;YAC3B,MAAM;QACR,KAAK,wBAAwB;YAC3B,CAAC,GAAG,MAAM,IAAA,2BAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;YAChC,MAAM;QACR;YACE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,kBAAkB,CAAC,CAAC;KAC7C;AACH,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/main/constant.d.ts
DELETED
package/dist/main/constant.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DERIVATION_PATHS = exports.EXCHANGE_RATE_TTL = exports.MEMPOOL_CHAIN_LIMIT = exports.DUST_UTXO_THRESHOLD = exports.DELIMITER = void 0;
|
|
4
|
-
exports.DELIMITER = ":";
|
|
5
|
-
// Min amount utxo can be to be accepted by the network
|
|
6
|
-
exports.DUST_UTXO_THRESHOLD = 546;
|
|
7
|
-
// Current chained tx limit
|
|
8
|
-
exports.MEMPOOL_CHAIN_LIMIT = 50;
|
|
9
|
-
// time in milliseconds to cache the usd exchange rate
|
|
10
|
-
exports.EXCHANGE_RATE_TTL = 250000;
|
|
11
|
-
// list of common derivation paths
|
|
12
|
-
// a la: https://github.com/Electron-Cash/Electron-Cash/blob/1de24c509992cfebc22217a2a77c862c2b02bc54/electroncash_gui/qt/installwizard.py#L624
|
|
13
|
-
exports.DERIVATION_PATHS = [
|
|
14
|
-
"m/0",
|
|
15
|
-
"m/0'",
|
|
16
|
-
"m/0'/0",
|
|
17
|
-
"m/0'/0'",
|
|
18
|
-
"m/0'/0'/0'",
|
|
19
|
-
"m/44'/0'/0'",
|
|
20
|
-
"m/44'/0'/0'/0",
|
|
21
|
-
"m/44'/145'/0'",
|
|
22
|
-
"m/44'/145'/0'/0",
|
|
23
|
-
"m/44'/245'/0",
|
|
24
|
-
"m/44'/245'/0'",
|
|
25
|
-
"m/44'/245'/0'/0",
|
|
26
|
-
];
|
|
27
|
-
//# sourceMappingURL=constant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,GAAG,CAAC;AAE7B,uDAAuD;AAC1C,QAAA,mBAAmB,GAAG,GAAG,CAAC;AAEvC,2BAA2B;AACd,QAAA,mBAAmB,GAAG,EAAE,CAAC;AAEtC,sDAAsD;AACzC,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAExC,kCAAkC;AAClC,+IAA+I;AAClI,QAAA,gBAAgB,GAAG;IAC9B,KAAK;IACL,MAAM;IACN,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,aAAa;IACb,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,eAAe;IACf,iBAAiB;CAClB,CAAC"}
|