@bitpay-labs/bitcore-wallet-service 11.5.2
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/.coveralls.yml +1 -0
- package/.travis.yml +27 -0
- package/DKG-flow.png +0 -0
- package/DSG-flow.png +0 -0
- package/Dockerfile +18 -0
- package/Installation.md +138 -0
- package/LICENCE +22 -0
- package/Makefile +5 -0
- package/README.md +429 -0
- package/TSS.md +136 -0
- package/bws.example.config.js +451 -0
- package/package.json +119 -0
- package/scripts/checkCopayerIds.js +118 -0
- package/scripts/clean_db.mongodb +5 -0
- package/scripts/deleteDupAddresses.mongo +6 -0
- package/scripts/deleteWallet.mongo +18 -0
- package/scripts/delme.ts +468 -0
- package/scripts/findEmail.js +32 -0
- package/scripts/fixAddressType.js +98 -0
- package/scripts/getSolStats2.js +81 -0
- package/scripts/migrateToNamedTestnets.js +191 -0
- package/scripts/migrateWalletsNetwork.js +204 -0
- package/scripts/preview-email.js +359 -0
- package/scripts/purgeNotifications.js +107 -0
- package/scripts/resetV8registration.mongo +21 -0
- package/scripts/v8tool-list.ts +93 -0
- package/scripts/v8tool.ts +82 -0
- package/scripts/walletStats.js +290 -0
- package/src/app.ts +28 -0
- package/src/bcmonitor/bcmonitor.ts +11 -0
- package/src/bws.ts +85 -0
- package/src/cleanfiatrates/cleanfiatrates.ts +9 -0
- package/src/config.ts +540 -0
- package/src/db/.empty +0 -0
- package/src/deprecated-serverMessages.ts +15 -0
- package/src/emailservice/emailservice.ts +11 -0
- package/src/externalservices/banxa.ts +261 -0
- package/src/externalservices/changelly.ts +371 -0
- package/src/externalservices/coingecko.ts +453 -0
- package/src/externalservices/moonpay.ts +435 -0
- package/src/externalservices/oneInch.ts +169 -0
- package/src/externalservices/ramp.ts +259 -0
- package/src/externalservices/sardine.ts +237 -0
- package/src/externalservices/simplex.ts +281 -0
- package/src/externalservices/thorswap.ts +197 -0
- package/src/externalservices/transak.ts +320 -0
- package/src/externalservices/wyre.ts +131 -0
- package/src/fiatrateservice/fiatrateservice.ts +15 -0
- package/src/index.ts +9 -0
- package/src/lib/bchaddresstranslator.ts +59 -0
- package/src/lib/blockchainexplorer.ts +84 -0
- package/src/lib/blockchainexplorers/v8/client.ts +177 -0
- package/src/lib/blockchainexplorers/v8.ts +730 -0
- package/src/lib/blockchainmonitor.ts +423 -0
- package/src/lib/chain/arb/index.ts +8 -0
- package/src/lib/chain/base/index.ts +8 -0
- package/src/lib/chain/bch/index.ts +40 -0
- package/src/lib/chain/btc/index.ts +991 -0
- package/src/lib/chain/doge/index.ts +387 -0
- package/src/lib/chain/eth/abi-erc20.ts +222 -0
- package/src/lib/chain/eth/abi-invoice.ts +277 -0
- package/src/lib/chain/eth/index.ts +657 -0
- package/src/lib/chain/index.ts +178 -0
- package/src/lib/chain/ltc/index.ts +9 -0
- package/src/lib/chain/matic/index.ts +8 -0
- package/src/lib/chain/op/index.ts +8 -0
- package/src/lib/chain/sol/index.ts +349 -0
- package/src/lib/chain/xrp/index.ts +338 -0
- package/src/lib/cleanfiatrates.ts +160 -0
- package/src/lib/common/constants.ts +231 -0
- package/src/lib/common/defaults.ts +436 -0
- package/src/lib/common/index.ts +11 -0
- package/src/lib/common/services.ts +43 -0
- package/src/lib/common/utils.ts +506 -0
- package/src/lib/emailservice.ts +741 -0
- package/src/lib/errors/clienterror.ts +44 -0
- package/src/lib/errors/errordefinitions.ts +158 -0
- package/src/lib/expressapp.ts +2415 -0
- package/src/lib/fiatrateproviders/bitpay.ts +20 -0
- package/src/lib/fiatrateproviders/bitstamp.ts +16 -0
- package/src/lib/fiatrateproviders/index.ts +8 -0
- package/src/lib/fiatrateproviders/provider.d.ts +10 -0
- package/src/lib/fiatrateservice.ts +338 -0
- package/src/lib/iconsconfig.ts +31 -0
- package/src/lib/index.ts +0 -0
- package/src/lib/lock.ts +112 -0
- package/src/lib/logger.ts +77 -0
- package/src/lib/messagebroker.ts +42 -0
- package/src/lib/model/address.ts +226 -0
- package/src/lib/model/addressmanager.ts +138 -0
- package/src/lib/model/advertisement.ts +84 -0
- package/src/lib/model/copayer.ts +162 -0
- package/src/lib/model/email.ts +103 -0
- package/src/lib/model/index.ts +12 -0
- package/src/lib/model/notification.ts +77 -0
- package/src/lib/model/preferences.ts +79 -0
- package/src/lib/model/pushnotificationsub.ts +50 -0
- package/src/lib/model/session.ts +65 -0
- package/src/lib/model/tsskeygen.ts +154 -0
- package/src/lib/model/tsssign.ts +136 -0
- package/src/lib/model/txconfirmationsub.ts +50 -0
- package/src/lib/model/txnote.ts +60 -0
- package/src/lib/model/txproposal.ts +561 -0
- package/src/lib/model/txproposal_legacy.ts +236 -0
- package/src/lib/model/txproposalaction.ts +48 -0
- package/src/lib/model/wallet.ts +359 -0
- package/src/lib/notificationbroadcaster.ts +17 -0
- package/src/lib/pushnotificationsservice.ts +802 -0
- package/src/lib/routes/helpers/error.ts +51 -0
- package/src/lib/routes/helpers/index.ts +1 -0
- package/src/lib/routes/middleware/authRequest.ts +117 -0
- package/src/lib/routes/middleware/authTssRequest.ts +66 -0
- package/src/lib/routes/middleware/createWalletLimiter.ts +21 -0
- package/src/lib/routes/middleware/log.ts +63 -0
- package/src/lib/routes/middleware/verifyTssMessage.ts +37 -0
- package/src/lib/routes/tss.ts +123 -0
- package/src/lib/server.ts +5342 -0
- package/src/lib/stats.ts +174 -0
- package/src/lib/storage.ts +1919 -0
- package/src/lib/tss.ts +446 -0
- package/src/lib/updatestats.ts +291 -0
- package/src/messagebroker/messagebroker.ts +18 -0
- package/src/pushnotificationsservice/pushnotificationsservice.ts +11 -0
- package/src/serverMessages.ts +30 -0
- package/src/types/chain.d.ts +62 -0
- package/src/types/emailservice.d.ts +11 -0
- package/src/types/expressapp.d.ts +15 -0
- package/src/types/externalservices.d.ts +41 -0
- package/src/types/notifications.d.ts +8 -0
- package/src/types/pushnotificationservice.d.ts +51 -0
- package/src/types/server.d.ts +24 -0
- package/src/updatestats/updatestats.ts +10 -0
- package/start-docker.sh +18 -0
- package/start.sh +38 -0
- package/static/images/down-arrow-green.png +0 -0
- package/static/images/failed-icon.png +0 -0
- package/static/images/green-check.png +0 -0
- package/static/images/person-plus.png +0 -0
- package/static/images/up-arrow-gray.png +0 -0
- package/static/images/writing-gray.png +0 -0
- package/stop.sh +19 -0
- package/templates/en/new_copayer.html +13 -0
- package/templates/en/new_copayer.plain +2 -0
- package/templates/en/new_incoming_tx.html +11 -0
- package/templates/en/new_incoming_tx.plain +2 -0
- package/templates/en/new_incoming_tx_testnet.html +13 -0
- package/templates/en/new_incoming_tx_testnet.plain +2 -0
- package/templates/en/new_outgoing_tx.html +11 -0
- package/templates/en/new_outgoing_tx.plain +2 -0
- package/templates/en/new_tx_proposal.html +13 -0
- package/templates/en/new_tx_proposal.plain +2 -0
- package/templates/en/new_zero_outgoing_tx.html +13 -0
- package/templates/en/new_zero_outgoing_tx.plain +2 -0
- package/templates/en/tx_confirmation.html +13 -0
- package/templates/en/tx_confirmation.plain +2 -0
- package/templates/en/tx_confirmation_receiver.html +13 -0
- package/templates/en/tx_confirmation_receiver.plain +2 -0
- package/templates/en/tx_confirmation_sender.html +13 -0
- package/templates/en/tx_confirmation_sender.plain +2 -0
- package/templates/en/txp_finally_rejected.html +13 -0
- package/templates/en/txp_finally_rejected.plain +2 -0
- package/templates/en/wallet_complete.html +13 -0
- package/templates/en/wallet_complete.plain +2 -0
- package/templates/es/new_copayer.html +13 -0
- package/templates/es/new_copayer.plain +2 -0
- package/templates/es/new_incoming_tx.html +11 -0
- package/templates/es/new_incoming_tx.plain +2 -0
- package/templates/es/new_incoming_tx_testnet.html +13 -0
- package/templates/es/new_incoming_tx_testnet.plain +2 -0
- package/templates/es/new_outgoing_tx.html +11 -0
- package/templates/es/new_outgoing_tx.plain +2 -0
- package/templates/es/new_tx_proposal.html +13 -0
- package/templates/es/new_tx_proposal.plain +2 -0
- package/templates/es/new_zero_outgoing_tx.html +13 -0
- package/templates/es/new_zero_outgoing_tx.plain +2 -0
- package/templates/es/tx_confirmation.html +13 -0
- package/templates/es/tx_confirmation.plain +2 -0
- package/templates/es/tx_confirmation_receiver.html +13 -0
- package/templates/es/tx_confirmation_receiver.plain +2 -0
- package/templates/es/tx_confirmation_sender.html +13 -0
- package/templates/es/tx_confirmation_sender.plain +2 -0
- package/templates/es/txp_finally_rejected.html +13 -0
- package/templates/es/txp_finally_rejected.plain +2 -0
- package/templates/es/wallet_complete.html +13 -0
- package/templates/es/wallet_complete.plain +2 -0
- package/templates/fr/new_copayer.html +13 -0
- package/templates/fr/new_copayer.plain +2 -0
- package/templates/fr/new_incoming_tx.html +11 -0
- package/templates/fr/new_incoming_tx.plain +2 -0
- package/templates/fr/new_incoming_tx_testnet.html +13 -0
- package/templates/fr/new_incoming_tx_testnet.plain +2 -0
- package/templates/fr/new_outgoing_tx.html +11 -0
- package/templates/fr/new_outgoing_tx.plain +2 -0
- package/templates/fr/new_tx_proposal.html +13 -0
- package/templates/fr/new_tx_proposal.plain +2 -0
- package/templates/fr/new_zero_outgoing_tx.html +13 -0
- package/templates/fr/new_zero_outgoing_tx.plain +2 -0
- package/templates/fr/tx_confirmation.html +13 -0
- package/templates/fr/tx_confirmation.plain +2 -0
- package/templates/fr/tx_confirmation_receiver.html +13 -0
- package/templates/fr/tx_confirmation_receiver.plain +2 -0
- package/templates/fr/tx_confirmation_sender.html +13 -0
- package/templates/fr/tx_confirmation_sender.plain +2 -0
- package/templates/fr/txp_finally_rejected.html +13 -0
- package/templates/fr/txp_finally_rejected.plain +2 -0
- package/templates/fr/wallet_complete.html +13 -0
- package/templates/fr/wallet_complete.plain +2 -0
- package/templates/ja/new_copayer.html +13 -0
- package/templates/ja/new_copayer.plain +2 -0
- package/templates/ja/new_incoming_tx.html +11 -0
- package/templates/ja/new_incoming_tx.plain +2 -0
- package/templates/ja/new_incoming_tx_testnet.html +13 -0
- package/templates/ja/new_incoming_tx_testnet.plain +2 -0
- package/templates/ja/new_outgoing_tx.html +11 -0
- package/templates/ja/new_outgoing_tx.plain +2 -0
- package/templates/ja/new_tx_proposal.html +13 -0
- package/templates/ja/new_tx_proposal.plain +2 -0
- package/templates/ja/new_zero_outgoing_tx.html +13 -0
- package/templates/ja/new_zero_outgoing_tx.plain +2 -0
- package/templates/ja/tx_confirmation.html +13 -0
- package/templates/ja/tx_confirmation.plain +2 -0
- package/templates/ja/tx_confirmation_receiver.html +13 -0
- package/templates/ja/tx_confirmation_receiver.plain +2 -0
- package/templates/ja/tx_confirmation_sender.html +13 -0
- package/templates/ja/tx_confirmation_sender.plain +2 -0
- package/templates/ja/txp_finally_rejected.html +13 -0
- package/templates/ja/txp_finally_rejected.plain +2 -0
- package/templates/ja/wallet_complete.html +13 -0
- package/templates/ja/wallet_complete.plain +2 -0
- package/templates/master-template.html +494 -0
- package/test/bchaddresstranslator.test.ts +50 -0
- package/test/blockchainexplorer.test.ts +66 -0
- package/test/chain/bch.test.ts +115 -0
- package/test/chain/btc.test.ts +331 -0
- package/test/chain/doge.test.ts +347 -0
- package/test/chain/eth.test.ts +21 -0
- package/test/chain/ltc.test.ts +328 -0
- package/test/chain/matic.test.ts +21 -0
- package/test/chain/xrp.test.ts +206 -0
- package/test/expressapp.test.ts +513 -0
- package/test/integration/bcmonitor.test.ts +381 -0
- package/test/integration/cashAddrMigration.test.ts +127 -0
- package/test/integration/data/tss/2of3/index.ts +3 -0
- package/test/integration/data/tss/2of3/party0.key.ts +5 -0
- package/test/integration/data/tss/2of3/party1.key.ts +5 -0
- package/test/integration/data/tss/2of3/party2.key.ts +5 -0
- package/test/integration/emailnotifications.test.ts +864 -0
- package/test/integration/externalservices/banxa.test.ts +373 -0
- package/test/integration/externalservices/changelly.test.ts +515 -0
- package/test/integration/externalservices/coinGecko.test.ts +284 -0
- package/test/integration/externalservices/moonpay.test.ts +569 -0
- package/test/integration/externalservices/oneInch.test.ts +162 -0
- package/test/integration/externalservices/ramp.test.ts +475 -0
- package/test/integration/externalservices/sardine.test.ts +352 -0
- package/test/integration/externalservices/simplex.test.ts +384 -0
- package/test/integration/externalservices/thorswap.test.ts +309 -0
- package/test/integration/externalservices/transak.test.ts +410 -0
- package/test/integration/externalservices/wyre.test.ts +270 -0
- package/test/integration/fiatrateservice.test.ts +979 -0
- package/test/integration/helpers.ts +694 -0
- package/test/integration/history.test.ts +1142 -0
- package/test/integration/hugetx.ts +6986 -0
- package/test/integration/pushNotifications.test.ts +1523 -0
- package/test/integration/server.test.ts +10740 -0
- package/test/integration/tss.test.ts +340 -0
- package/test/lock.test.ts +224 -0
- package/test/model/address.test.ts +187 -0
- package/test/model/addressmanager.test.ts +146 -0
- package/test/model/advertisement.test.ts +31 -0
- package/test/model/copayer.test.ts +131 -0
- package/test/model/txproposal.test.ts +185 -0
- package/test/model/wallet.test.ts +191 -0
- package/test/storage.test.ts +430 -0
- package/test/test-config.ts +12 -0
- package/test/testdata.ts +388 -0
- package/test/utils.test.ts +457 -0
- package/test/v8.test.ts +332 -0
- package/ts_build/package.json +119 -0
- package/ts_build/scripts/delme.d.ts +2 -0
- package/ts_build/scripts/delme.d.ts.map +1 -0
- package/ts_build/scripts/delme.js +453 -0
- package/ts_build/scripts/delme.js.map +1 -0
- package/ts_build/scripts/v8tool-list.d.ts +3 -0
- package/ts_build/scripts/v8tool-list.d.ts.map +1 -0
- package/ts_build/scripts/v8tool-list.js +80 -0
- package/ts_build/scripts/v8tool-list.js.map +1 -0
- package/ts_build/scripts/v8tool.d.ts +3 -0
- package/ts_build/scripts/v8tool.d.ts.map +1 -0
- package/ts_build/scripts/v8tool.js +69 -0
- package/ts_build/scripts/v8tool.js.map +1 -0
- package/ts_build/src/app.d.ts +3 -0
- package/ts_build/src/app.d.ts.map +1 -0
- package/ts_build/src/app.js +29 -0
- package/ts_build/src/app.js.map +1 -0
- package/ts_build/src/bcmonitor/bcmonitor.d.ts +3 -0
- package/ts_build/src/bcmonitor/bcmonitor.d.ts.map +1 -0
- package/ts_build/src/bcmonitor/bcmonitor.js +16 -0
- package/ts_build/src/bcmonitor/bcmonitor.js.map +1 -0
- package/ts_build/src/bws.d.ts +3 -0
- package/ts_build/src/bws.d.ts.map +1 -0
- package/ts_build/src/bws.js +98 -0
- package/ts_build/src/bws.js.map +1 -0
- package/ts_build/src/cleanfiatrates/cleanfiatrates.d.ts +3 -0
- package/ts_build/src/cleanfiatrates/cleanfiatrates.d.ts.map +1 -0
- package/ts_build/src/cleanfiatrates/cleanfiatrates.js +11 -0
- package/ts_build/src/cleanfiatrates/cleanfiatrates.js.map +1 -0
- package/ts_build/src/config.d.ts +3 -0
- package/ts_build/src/config.d.ts.map +1 -0
- package/ts_build/src/config.js +256 -0
- package/ts_build/src/config.js.map +1 -0
- package/ts_build/src/deprecated-serverMessages.d.ts +10 -0
- package/ts_build/src/deprecated-serverMessages.d.ts.map +1 -0
- package/ts_build/src/deprecated-serverMessages.js +20 -0
- package/ts_build/src/deprecated-serverMessages.js.map +1 -0
- package/ts_build/src/emailservice/emailservice.d.ts +3 -0
- package/ts_build/src/emailservice/emailservice.d.ts.map +1 -0
- package/ts_build/src/emailservice/emailservice.js +16 -0
- package/ts_build/src/emailservice/emailservice.js.map +1 -0
- package/ts_build/src/externalservices/banxa.d.ts +11 -0
- package/ts_build/src/externalservices/banxa.d.ts.map +1 -0
- package/ts_build/src/externalservices/banxa.js +254 -0
- package/ts_build/src/externalservices/banxa.js.map +1 -0
- package/ts_build/src/externalservices/changelly.d.ts +18 -0
- package/ts_build/src/externalservices/changelly.d.ts.map +1 -0
- package/ts_build/src/externalservices/changelly.js +356 -0
- package/ts_build/src/externalservices/changelly.js.map +1 -0
- package/ts_build/src/externalservices/coingecko.d.ts +43 -0
- package/ts_build/src/externalservices/coingecko.d.ts.map +1 -0
- package/ts_build/src/externalservices/coingecko.js +416 -0
- package/ts_build/src/externalservices/coingecko.js.map +1 -0
- package/ts_build/src/externalservices/moonpay.d.ts +19 -0
- package/ts_build/src/externalservices/moonpay.d.ts.map +1 -0
- package/ts_build/src/externalservices/moonpay.js +397 -0
- package/ts_build/src/externalservices/moonpay.js.map +1 -0
- package/ts_build/src/externalservices/oneInch.d.ts +11 -0
- package/ts_build/src/externalservices/oneInch.d.ts.map +1 -0
- package/ts_build/src/externalservices/oneInch.js +179 -0
- package/ts_build/src/externalservices/oneInch.js.map +1 -0
- package/ts_build/src/externalservices/ramp.d.ts +12 -0
- package/ts_build/src/externalservices/ramp.d.ts.map +1 -0
- package/ts_build/src/externalservices/ramp.js +256 -0
- package/ts_build/src/externalservices/ramp.js.map +1 -0
- package/ts_build/src/externalservices/sardine.d.ts +10 -0
- package/ts_build/src/externalservices/sardine.d.ts.map +1 -0
- package/ts_build/src/externalservices/sardine.js +232 -0
- package/ts_build/src/externalservices/sardine.js.map +1 -0
- package/ts_build/src/externalservices/simplex.d.ts +11 -0
- package/ts_build/src/externalservices/simplex.d.ts.map +1 -0
- package/ts_build/src/externalservices/simplex.js +261 -0
- package/ts_build/src/externalservices/simplex.js.map +1 -0
- package/ts_build/src/externalservices/thorswap.d.ts +9 -0
- package/ts_build/src/externalservices/thorswap.d.ts.map +1 -0
- package/ts_build/src/externalservices/thorswap.js +206 -0
- package/ts_build/src/externalservices/thorswap.js.map +1 -0
- package/ts_build/src/externalservices/transak.d.ts +13 -0
- package/ts_build/src/externalservices/transak.d.ts.map +1 -0
- package/ts_build/src/externalservices/transak.js +311 -0
- package/ts_build/src/externalservices/transak.js.map +1 -0
- package/ts_build/src/externalservices/wyre.d.ts +7 -0
- package/ts_build/src/externalservices/wyre.d.ts.map +1 -0
- package/ts_build/src/externalservices/wyre.js +144 -0
- package/ts_build/src/externalservices/wyre.js.map +1 -0
- package/ts_build/src/fiatrateservice/fiatrateservice.d.ts +3 -0
- package/ts_build/src/fiatrateservice/fiatrateservice.d.ts.map +1 -0
- package/ts_build/src/fiatrateservice/fiatrateservice.js +20 -0
- package/ts_build/src/fiatrateservice/fiatrateservice.js.map +1 -0
- package/ts_build/src/index.d.ts +8 -0
- package/ts_build/src/index.d.ts.map +1 -0
- package/ts_build/src/index.js +11 -0
- package/ts_build/src/index.js.map +1 -0
- package/ts_build/src/lib/bchaddresstranslator.d.ts +5 -0
- package/ts_build/src/lib/bchaddresstranslator.d.ts.map +1 -0
- package/ts_build/src/lib/bchaddresstranslator.js +66 -0
- package/ts_build/src/lib/bchaddresstranslator.js.map +1 -0
- package/ts_build/src/lib/blockchainexplorer.d.ts +3 -0
- package/ts_build/src/lib/blockchainexplorer.d.ts.map +1 -0
- package/ts_build/src/lib/blockchainexplorer.js +87 -0
- package/ts_build/src/lib/blockchainexplorer.js.map +1 -0
- package/ts_build/src/lib/blockchainexplorers/v8/client.d.ts +31 -0
- package/ts_build/src/lib/blockchainexplorers/v8/client.d.ts.map +1 -0
- package/ts_build/src/lib/blockchainexplorers/v8/client.js +191 -0
- package/ts_build/src/lib/blockchainexplorers/v8/client.js.map +1 -0
- package/ts_build/src/lib/blockchainexplorers/v8.d.ts +91 -0
- package/ts_build/src/lib/blockchainexplorers/v8.d.ts.map +1 -0
- package/ts_build/src/lib/blockchainexplorers/v8.js +662 -0
- package/ts_build/src/lib/blockchainexplorers/v8.js.map +1 -0
- package/ts_build/src/lib/blockchainmonitor.d.ts +32 -0
- package/ts_build/src/lib/blockchainmonitor.d.ts.map +1 -0
- package/ts_build/src/lib/blockchainmonitor.js +413 -0
- package/ts_build/src/lib/blockchainmonitor.js.map +1 -0
- package/ts_build/src/lib/chain/arb/index.d.ts +5 -0
- package/ts_build/src/lib/chain/arb/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/arb/index.js +12 -0
- package/ts_build/src/lib/chain/arb/index.js.map +1 -0
- package/ts_build/src/lib/chain/base/index.d.ts +5 -0
- package/ts_build/src/lib/chain/base/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/base/index.js +12 -0
- package/ts_build/src/lib/chain/base/index.js.map +1 -0
- package/ts_build/src/lib/chain/bch/index.d.ts +9 -0
- package/ts_build/src/lib/chain/bch/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/bch/index.js +43 -0
- package/ts_build/src/lib/chain/bch/index.js.map +1 -0
- package/ts_build/src/lib/chain/btc/index.d.ts +65 -0
- package/ts_build/src/lib/chain/btc/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/btc/index.js +829 -0
- package/ts_build/src/lib/chain/btc/index.js.map +1 -0
- package/ts_build/src/lib/chain/doge/index.d.ts +9 -0
- package/ts_build/src/lib/chain/doge/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/doge/index.js +338 -0
- package/ts_build/src/lib/chain/doge/index.js.map +1 -0
- package/ts_build/src/lib/chain/eth/abi-erc20.d.ts +39 -0
- package/ts_build/src/lib/chain/eth/abi-erc20.d.ts.map +1 -0
- package/ts_build/src/lib/chain/eth/abi-erc20.js +226 -0
- package/ts_build/src/lib/chain/eth/abi-erc20.js.map +1 -0
- package/ts_build/src/lib/chain/eth/abi-invoice.d.ts +42 -0
- package/ts_build/src/lib/chain/eth/abi-invoice.d.ts.map +1 -0
- package/ts_build/src/lib/chain/eth/abi-invoice.js +281 -0
- package/ts_build/src/lib/chain/eth/abi-invoice.js.map +1 -0
- package/ts_build/src/lib/chain/eth/index.d.ts +66 -0
- package/ts_build/src/lib/chain/eth/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/eth/index.js +516 -0
- package/ts_build/src/lib/chain/eth/index.js.map +1 -0
- package/ts_build/src/lib/chain/index.d.ts +40 -0
- package/ts_build/src/lib/chain/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/index.js +143 -0
- package/ts_build/src/lib/chain/index.js.map +1 -0
- package/ts_build/src/lib/chain/ltc/index.d.ts +6 -0
- package/ts_build/src/lib/chain/ltc/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/ltc/index.js +12 -0
- package/ts_build/src/lib/chain/ltc/index.js.map +1 -0
- package/ts_build/src/lib/chain/matic/index.d.ts +5 -0
- package/ts_build/src/lib/chain/matic/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/matic/index.js +12 -0
- package/ts_build/src/lib/chain/matic/index.js.map +1 -0
- package/ts_build/src/lib/chain/op/index.d.ts +5 -0
- package/ts_build/src/lib/chain/op/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/op/index.js +12 -0
- package/ts_build/src/lib/chain/op/index.js.map +1 -0
- package/ts_build/src/lib/chain/sol/index.d.ts +52 -0
- package/ts_build/src/lib/chain/sol/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/sol/index.js +305 -0
- package/ts_build/src/lib/chain/sol/index.js.map +1 -0
- package/ts_build/src/lib/chain/xrp/index.d.ts +46 -0
- package/ts_build/src/lib/chain/xrp/index.d.ts.map +1 -0
- package/ts_build/src/lib/chain/xrp/index.js +300 -0
- package/ts_build/src/lib/chain/xrp/index.js.map +1 -0
- package/ts_build/src/lib/cleanfiatrates.d.ts +13 -0
- package/ts_build/src/lib/cleanfiatrates.d.ts.map +1 -0
- package/ts_build/src/lib/cleanfiatrates.js +176 -0
- package/ts_build/src/lib/cleanfiatrates.js.map +1 -0
- package/ts_build/src/lib/common/constants.d.ts +387 -0
- package/ts_build/src/lib/common/constants.d.ts.map +1 -0
- package/ts_build/src/lib/common/constants.js +234 -0
- package/ts_build/src/lib/common/constants.js.map +1 -0
- package/ts_build/src/lib/common/defaults.d.ts +326 -0
- package/ts_build/src/lib/common/defaults.d.ts.map +1 -0
- package/ts_build/src/lib/common/defaults.js +356 -0
- package/ts_build/src/lib/common/defaults.js.map +1 -0
- package/ts_build/src/lib/common/index.d.ts +793 -0
- package/ts_build/src/lib/common/index.d.ts.map +1 -0
- package/ts_build/src/lib/common/index.js +14 -0
- package/ts_build/src/lib/common/index.js.map +1 -0
- package/ts_build/src/lib/common/services.d.ts +34 -0
- package/ts_build/src/lib/common/services.d.ts.map +1 -0
- package/ts_build/src/lib/common/services.js +44 -0
- package/ts_build/src/lib/common/services.js.map +1 -0
- package/ts_build/src/lib/common/utils.d.ts +47 -0
- package/ts_build/src/lib/common/utils.d.ts.map +1 -0
- package/ts_build/src/lib/common/utils.js +385 -0
- package/ts_build/src/lib/common/utils.js.map +1 -0
- package/ts_build/src/lib/emailservice.d.ts +62 -0
- package/ts_build/src/lib/emailservice.d.ts.map +1 -0
- package/ts_build/src/lib/emailservice.js +727 -0
- package/ts_build/src/lib/emailservice.js.map +1 -0
- package/ts_build/src/lib/errors/clienterror.d.ts +11 -0
- package/ts_build/src/lib/errors/clienterror.d.ts.map +1 -0
- package/ts_build/src/lib/errors/clienterror.js +46 -0
- package/ts_build/src/lib/errors/clienterror.js.map +1 -0
- package/ts_build/src/lib/errors/errordefinitions.d.ts +76 -0
- package/ts_build/src/lib/errors/errordefinitions.d.ts.map +1 -0
- package/ts_build/src/lib/errors/errordefinitions.js +82 -0
- package/ts_build/src/lib/errors/errordefinitions.js.map +1 -0
- package/ts_build/src/lib/expressapp.d.ts +8 -0
- package/ts_build/src/lib/expressapp.d.ts.map +1 -0
- package/ts_build/src/lib/expressapp.js +2221 -0
- package/ts_build/src/lib/expressapp.js.map +1 -0
- package/ts_build/src/lib/fiatrateproviders/bitpay.d.ts +3 -0
- package/ts_build/src/lib/fiatrateproviders/bitpay.d.ts.map +1 -0
- package/ts_build/src/lib/fiatrateproviders/bitpay.js +22 -0
- package/ts_build/src/lib/fiatrateproviders/bitpay.js.map +1 -0
- package/ts_build/src/lib/fiatrateproviders/bitstamp.d.ts +3 -0
- package/ts_build/src/lib/fiatrateproviders/bitstamp.d.ts.map +1 -0
- package/ts_build/src/lib/fiatrateproviders/bitstamp.js +18 -0
- package/ts_build/src/lib/fiatrateproviders/bitstamp.js.map +1 -0
- package/ts_build/src/lib/fiatrateproviders/index.d.ts +3 -0
- package/ts_build/src/lib/fiatrateproviders/index.d.ts.map +1 -0
- package/ts_build/src/lib/fiatrateproviders/index.js +8 -0
- package/ts_build/src/lib/fiatrateproviders/index.js.map +1 -0
- package/ts_build/src/lib/fiatrateservice.d.ts +18 -0
- package/ts_build/src/lib/fiatrateservice.d.ts.map +1 -0
- package/ts_build/src/lib/fiatrateservice.js +313 -0
- package/ts_build/src/lib/fiatrateservice.js.map +1 -0
- package/ts_build/src/lib/iconsconfig.d.ts +2 -0
- package/ts_build/src/lib/iconsconfig.d.ts.map +1 -0
- package/ts_build/src/lib/iconsconfig.js +31 -0
- package/ts_build/src/lib/iconsconfig.js.map +1 -0
- package/ts_build/src/lib/index.d.ts +1 -0
- package/ts_build/src/lib/index.d.ts.map +1 -0
- package/ts_build/src/lib/index.js +1 -0
- package/ts_build/src/lib/index.js.map +1 -0
- package/ts_build/src/lib/lock.d.ts +14 -0
- package/ts_build/src/lib/lock.d.ts.map +1 -0
- package/ts_build/src/lib/lock.js +55 -0
- package/ts_build/src/lib/lock.js.map +1 -0
- package/ts_build/src/lib/logger.d.ts +7 -0
- package/ts_build/src/lib/logger.d.ts.map +1 -0
- package/ts_build/src/lib/logger.js +95 -0
- package/ts_build/src/lib/logger.js.map +1 -0
- package/ts_build/src/lib/messagebroker.d.ts +11 -0
- package/ts_build/src/lib/messagebroker.d.ts.map +1 -0
- package/ts_build/src/lib/messagebroker.js +77 -0
- package/ts_build/src/lib/messagebroker.js.map +1 -0
- package/ts_build/src/lib/model/address.d.ts +47 -0
- package/ts_build/src/lib/model/address.d.ts.map +1 -0
- package/ts_build/src/lib/model/address.js +158 -0
- package/ts_build/src/lib/model/address.js.map +1 -0
- package/ts_build/src/lib/model/addressmanager.d.ts +41 -0
- package/ts_build/src/lib/model/addressmanager.d.ts.map +1 -0
- package/ts_build/src/lib/model/addressmanager.js +103 -0
- package/ts_build/src/lib/model/addressmanager.js.map +1 -0
- package/ts_build/src/lib/model/advertisement.d.ts +38 -0
- package/ts_build/src/lib/model/advertisement.d.ts.map +1 -0
- package/ts_build/src/lib/model/advertisement.js +68 -0
- package/ts_build/src/lib/model/advertisement.js.map +1 -0
- package/ts_build/src/lib/model/copayer.d.ts +48 -0
- package/ts_build/src/lib/model/copayer.d.ts.map +1 -0
- package/ts_build/src/lib/model/copayer.js +116 -0
- package/ts_build/src/lib/model/copayer.js.map +1 -0
- package/ts_build/src/lib/model/email.d.ts +23 -0
- package/ts_build/src/lib/model/email.d.ts.map +1 -0
- package/ts_build/src/lib/model/email.js +84 -0
- package/ts_build/src/lib/model/email.js.map +1 -0
- package/ts_build/src/lib/model/index.d.ts +13 -0
- package/ts_build/src/lib/model/index.d.ts.map +1 -0
- package/ts_build/src/lib/model/index.js +28 -0
- package/ts_build/src/lib/model/index.js.map +1 -0
- package/ts_build/src/lib/model/notification.d.ts +23 -0
- package/ts_build/src/lib/model/notification.d.ts.map +1 -0
- package/ts_build/src/lib/model/notification.js +40 -0
- package/ts_build/src/lib/model/notification.js.map +1 -0
- package/ts_build/src/lib/model/preferences.d.ts +37 -0
- package/ts_build/src/lib/model/preferences.d.ts.map +1 -0
- package/ts_build/src/lib/model/preferences.js +61 -0
- package/ts_build/src/lib/model/preferences.js.map +1 -0
- package/ts_build/src/lib/model/pushnotificationsub.d.ts +23 -0
- package/ts_build/src/lib/model/pushnotificationsub.d.ts.map +1 -0
- package/ts_build/src/lib/model/pushnotificationsub.js +40 -0
- package/ts_build/src/lib/model/pushnotificationsub.js.map +1 -0
- package/ts_build/src/lib/model/session.d.ts +22 -0
- package/ts_build/src/lib/model/session.d.ts.map +1 -0
- package/ts_build/src/lib/model/session.js +52 -0
- package/ts_build/src/lib/model/session.js.map +1 -0
- package/ts_build/src/lib/model/tsskeygen.d.ts +67 -0
- package/ts_build/src/lib/model/tsskeygen.d.ts.map +1 -0
- package/ts_build/src/lib/model/tsskeygen.js +69 -0
- package/ts_build/src/lib/model/tsskeygen.js.map +1 -0
- package/ts_build/src/lib/model/tsssign.d.ts +70 -0
- package/ts_build/src/lib/model/tsssign.d.ts.map +1 -0
- package/ts_build/src/lib/model/tsssign.js +54 -0
- package/ts_build/src/lib/model/tsssign.js.map +1 -0
- package/ts_build/src/lib/model/txconfirmationsub.d.ts +23 -0
- package/ts_build/src/lib/model/txconfirmationsub.d.ts.map +1 -0
- package/ts_build/src/lib/model/txconfirmationsub.js +40 -0
- package/ts_build/src/lib/model/txconfirmationsub.js.map +1 -0
- package/ts_build/src/lib/model/txnote.d.ts +23 -0
- package/ts_build/src/lib/model/txnote.d.ts.map +1 -0
- package/ts_build/src/lib/model/txnote.js +46 -0
- package/ts_build/src/lib/model/txnote.js.map +1 -0
- package/ts_build/src/lib/model/txproposal.d.ts +196 -0
- package/ts_build/src/lib/model/txproposal.d.ts.map +1 -0
- package/ts_build/src/lib/model/txproposal.js +382 -0
- package/ts_build/src/lib/model/txproposal.js.map +1 -0
- package/ts_build/src/lib/model/txproposal_legacy.d.ts +93 -0
- package/ts_build/src/lib/model/txproposal_legacy.d.ts.map +1 -0
- package/ts_build/src/lib/model/txproposal_legacy.js +185 -0
- package/ts_build/src/lib/model/txproposal_legacy.js.map +1 -0
- package/ts_build/src/lib/model/txproposalaction.d.ts +21 -0
- package/ts_build/src/lib/model/txproposalaction.d.ts.map +1 -0
- package/ts_build/src/lib/model/txproposalaction.js +37 -0
- package/ts_build/src/lib/model/txproposalaction.js.map +1 -0
- package/ts_build/src/lib/model/wallet.d.ts +110 -0
- package/ts_build/src/lib/model/wallet.d.ts.map +1 -0
- package/ts_build/src/lib/model/wallet.js +224 -0
- package/ts_build/src/lib/model/wallet.js.map +1 -0
- package/ts_build/src/lib/notificationbroadcaster.d.ts +6 -0
- package/ts_build/src/lib/notificationbroadcaster.d.ts.map +1 -0
- package/ts_build/src/lib/notificationbroadcaster.js +19 -0
- package/ts_build/src/lib/notificationbroadcaster.js.map +1 -0
- package/ts_build/src/lib/pushnotificationsservice.d.ts +56 -0
- package/ts_build/src/lib/pushnotificationsservice.d.ts.map +1 -0
- package/ts_build/src/lib/pushnotificationsservice.js +721 -0
- package/ts_build/src/lib/pushnotificationsservice.js.map +1 -0
- package/ts_build/src/lib/routes/helpers/error.d.ts +10 -0
- package/ts_build/src/lib/routes/helpers/error.d.ts.map +1 -0
- package/ts_build/src/lib/routes/helpers/error.js +54 -0
- package/ts_build/src/lib/routes/helpers/error.js.map +1 -0
- package/ts_build/src/lib/routes/helpers/index.d.ts +2 -0
- package/ts_build/src/lib/routes/helpers/index.d.ts.map +1 -0
- package/ts_build/src/lib/routes/helpers/index.js +18 -0
- package/ts_build/src/lib/routes/helpers/index.js.map +1 -0
- package/ts_build/src/lib/routes/middleware/authRequest.d.ts +6 -0
- package/ts_build/src/lib/routes/middleware/authRequest.d.ts.map +1 -0
- package/ts_build/src/lib/routes/middleware/authRequest.js +106 -0
- package/ts_build/src/lib/routes/middleware/authRequest.js.map +1 -0
- package/ts_build/src/lib/routes/middleware/authTssRequest.d.ts +3 -0
- package/ts_build/src/lib/routes/middleware/authTssRequest.d.ts.map +1 -0
- package/ts_build/src/lib/routes/middleware/authTssRequest.js +56 -0
- package/ts_build/src/lib/routes/middleware/authTssRequest.js.map +1 -0
- package/ts_build/src/lib/routes/middleware/createWalletLimiter.d.ts +4 -0
- package/ts_build/src/lib/routes/middleware/createWalletLimiter.d.ts.map +1 -0
- package/ts_build/src/lib/routes/middleware/createWalletLimiter.js +28 -0
- package/ts_build/src/lib/routes/middleware/createWalletLimiter.js.map +1 -0
- package/ts_build/src/lib/routes/middleware/log.d.ts +9 -0
- package/ts_build/src/lib/routes/middleware/log.d.ts.map +1 -0
- package/ts_build/src/lib/routes/middleware/log.js +52 -0
- package/ts_build/src/lib/routes/middleware/log.js.map +1 -0
- package/ts_build/src/lib/routes/middleware/verifyTssMessage.d.ts +2 -0
- package/ts_build/src/lib/routes/middleware/verifyTssMessage.d.ts.map +1 -0
- package/ts_build/src/lib/routes/middleware/verifyTssMessage.js +34 -0
- package/ts_build/src/lib/routes/middleware/verifyTssMessage.js.map +1 -0
- package/ts_build/src/lib/routes/tss.d.ts +14 -0
- package/ts_build/src/lib/routes/tss.d.ts.map +1 -0
- package/ts_build/src/lib/routes/tss.js +120 -0
- package/ts_build/src/lib/routes/tss.js.map +1 -0
- package/ts_build/src/lib/server.d.ts +250 -0
- package/ts_build/src/lib/server.d.ts.map +1 -0
- package/ts_build/src/lib/server.js +4115 -0
- package/ts_build/src/lib/server.js.map +1 -0
- package/ts_build/src/lib/stats.d.ts +17 -0
- package/ts_build/src/lib/stats.d.ts.map +1 -0
- package/ts_build/src/lib/stats.js +203 -0
- package/ts_build/src/lib/stats.js.map +1 -0
- package/ts_build/src/lib/storage.d.ts +163 -0
- package/ts_build/src/lib/storage.d.ts.map +1 -0
- package/ts_build/src/lib/storage.js +1513 -0
- package/ts_build/src/lib/storage.js.map +1 -0
- package/ts_build/src/lib/tss.d.ts +70 -0
- package/ts_build/src/lib/tss.d.ts.map +1 -0
- package/ts_build/src/lib/tss.js +379 -0
- package/ts_build/src/lib/tss.js.map +1 -0
- package/ts_build/src/lib/updatestats.d.ts +16 -0
- package/ts_build/src/lib/updatestats.d.ts.map +1 -0
- package/ts_build/src/lib/updatestats.js +308 -0
- package/ts_build/src/lib/updatestats.js.map +1 -0
- package/ts_build/src/messagebroker/messagebroker.d.ts +3 -0
- package/ts_build/src/messagebroker/messagebroker.d.ts.map +1 -0
- package/ts_build/src/messagebroker/messagebroker.js +20 -0
- package/ts_build/src/messagebroker/messagebroker.js.map +1 -0
- package/ts_build/src/pushnotificationsservice/pushnotificationsservice.d.ts +3 -0
- package/ts_build/src/pushnotificationsservice/pushnotificationsservice.d.ts.map +1 -0
- package/ts_build/src/pushnotificationsservice/pushnotificationsservice.js +16 -0
- package/ts_build/src/pushnotificationsservice/pushnotificationsservice.js.map +1 -0
- package/ts_build/src/serverMessages.d.ts +2 -0
- package/ts_build/src/serverMessages.d.ts.map +1 -0
- package/ts_build/src/serverMessages.js +35 -0
- package/ts_build/src/serverMessages.js.map +1 -0
- package/ts_build/src/updatestats/updatestats.d.ts +3 -0
- package/ts_build/src/updatestats/updatestats.d.ts.map +1 -0
- package/ts_build/src/updatestats/updatestats.js +15 -0
- package/ts_build/src/updatestats/updatestats.js.map +1 -0
- package/ts_build/templates/en/new_copayer.html +13 -0
- package/ts_build/templates/en/new_copayer.plain +2 -0
- package/ts_build/templates/en/new_incoming_tx.html +11 -0
- package/ts_build/templates/en/new_incoming_tx.plain +2 -0
- package/ts_build/templates/en/new_incoming_tx_testnet.html +13 -0
- package/ts_build/templates/en/new_incoming_tx_testnet.plain +2 -0
- package/ts_build/templates/en/new_outgoing_tx.html +11 -0
- package/ts_build/templates/en/new_outgoing_tx.plain +2 -0
- package/ts_build/templates/en/new_tx_proposal.html +13 -0
- package/ts_build/templates/en/new_tx_proposal.plain +2 -0
- package/ts_build/templates/en/new_zero_outgoing_tx.html +13 -0
- package/ts_build/templates/en/new_zero_outgoing_tx.plain +2 -0
- package/ts_build/templates/en/tx_confirmation.html +13 -0
- package/ts_build/templates/en/tx_confirmation.plain +2 -0
- package/ts_build/templates/en/tx_confirmation_receiver.html +13 -0
- package/ts_build/templates/en/tx_confirmation_receiver.plain +2 -0
- package/ts_build/templates/en/tx_confirmation_sender.html +13 -0
- package/ts_build/templates/en/tx_confirmation_sender.plain +2 -0
- package/ts_build/templates/en/txp_finally_rejected.html +13 -0
- package/ts_build/templates/en/txp_finally_rejected.plain +2 -0
- package/ts_build/templates/en/wallet_complete.html +13 -0
- package/ts_build/templates/en/wallet_complete.plain +2 -0
- package/ts_build/templates/es/new_copayer.html +13 -0
- package/ts_build/templates/es/new_copayer.plain +2 -0
- package/ts_build/templates/es/new_incoming_tx.html +11 -0
- package/ts_build/templates/es/new_incoming_tx.plain +2 -0
- package/ts_build/templates/es/new_incoming_tx_testnet.html +13 -0
- package/ts_build/templates/es/new_incoming_tx_testnet.plain +2 -0
- package/ts_build/templates/es/new_outgoing_tx.html +11 -0
- package/ts_build/templates/es/new_outgoing_tx.plain +2 -0
- package/ts_build/templates/es/new_tx_proposal.html +13 -0
- package/ts_build/templates/es/new_tx_proposal.plain +2 -0
- package/ts_build/templates/es/new_zero_outgoing_tx.html +13 -0
- package/ts_build/templates/es/new_zero_outgoing_tx.plain +2 -0
- package/ts_build/templates/es/tx_confirmation.html +13 -0
- package/ts_build/templates/es/tx_confirmation.plain +2 -0
- package/ts_build/templates/es/tx_confirmation_receiver.html +13 -0
- package/ts_build/templates/es/tx_confirmation_receiver.plain +2 -0
- package/ts_build/templates/es/tx_confirmation_sender.html +13 -0
- package/ts_build/templates/es/tx_confirmation_sender.plain +2 -0
- package/ts_build/templates/es/txp_finally_rejected.html +13 -0
- package/ts_build/templates/es/txp_finally_rejected.plain +2 -0
- package/ts_build/templates/es/wallet_complete.html +13 -0
- package/ts_build/templates/es/wallet_complete.plain +2 -0
- package/ts_build/templates/fr/new_copayer.html +13 -0
- package/ts_build/templates/fr/new_copayer.plain +2 -0
- package/ts_build/templates/fr/new_incoming_tx.html +11 -0
- package/ts_build/templates/fr/new_incoming_tx.plain +2 -0
- package/ts_build/templates/fr/new_incoming_tx_testnet.html +13 -0
- package/ts_build/templates/fr/new_incoming_tx_testnet.plain +2 -0
- package/ts_build/templates/fr/new_outgoing_tx.html +11 -0
- package/ts_build/templates/fr/new_outgoing_tx.plain +2 -0
- package/ts_build/templates/fr/new_tx_proposal.html +13 -0
- package/ts_build/templates/fr/new_tx_proposal.plain +2 -0
- package/ts_build/templates/fr/new_zero_outgoing_tx.html +13 -0
- package/ts_build/templates/fr/new_zero_outgoing_tx.plain +2 -0
- package/ts_build/templates/fr/tx_confirmation.html +13 -0
- package/ts_build/templates/fr/tx_confirmation.plain +2 -0
- package/ts_build/templates/fr/tx_confirmation_receiver.html +13 -0
- package/ts_build/templates/fr/tx_confirmation_receiver.plain +2 -0
- package/ts_build/templates/fr/tx_confirmation_sender.html +13 -0
- package/ts_build/templates/fr/tx_confirmation_sender.plain +2 -0
- package/ts_build/templates/fr/txp_finally_rejected.html +13 -0
- package/ts_build/templates/fr/txp_finally_rejected.plain +2 -0
- package/ts_build/templates/fr/wallet_complete.html +13 -0
- package/ts_build/templates/fr/wallet_complete.plain +2 -0
- package/ts_build/templates/ja/new_copayer.html +13 -0
- package/ts_build/templates/ja/new_copayer.plain +2 -0
- package/ts_build/templates/ja/new_incoming_tx.html +11 -0
- package/ts_build/templates/ja/new_incoming_tx.plain +2 -0
- package/ts_build/templates/ja/new_incoming_tx_testnet.html +13 -0
- package/ts_build/templates/ja/new_incoming_tx_testnet.plain +2 -0
- package/ts_build/templates/ja/new_outgoing_tx.html +11 -0
- package/ts_build/templates/ja/new_outgoing_tx.plain +2 -0
- package/ts_build/templates/ja/new_tx_proposal.html +13 -0
- package/ts_build/templates/ja/new_tx_proposal.plain +2 -0
- package/ts_build/templates/ja/new_zero_outgoing_tx.html +13 -0
- package/ts_build/templates/ja/new_zero_outgoing_tx.plain +2 -0
- package/ts_build/templates/ja/tx_confirmation.html +13 -0
- package/ts_build/templates/ja/tx_confirmation.plain +2 -0
- package/ts_build/templates/ja/tx_confirmation_receiver.html +13 -0
- package/ts_build/templates/ja/tx_confirmation_receiver.plain +2 -0
- package/ts_build/templates/ja/tx_confirmation_sender.html +13 -0
- package/ts_build/templates/ja/tx_confirmation_sender.plain +2 -0
- package/ts_build/templates/ja/txp_finally_rejected.html +13 -0
- package/ts_build/templates/ja/txp_finally_rejected.plain +2 -0
- package/ts_build/templates/ja/wallet_complete.html +13 -0
- package/ts_build/templates/ja/wallet_complete.plain +2 -0
- package/ts_build/templates/master-template.html +494 -0
- package/ts_build/test/bchaddresstranslator.test.d.ts +2 -0
- package/ts_build/test/bchaddresstranslator.test.d.ts.map +1 -0
- package/ts_build/test/bchaddresstranslator.test.js +76 -0
- package/ts_build/test/bchaddresstranslator.test.js.map +1 -0
- package/ts_build/test/blockchainexplorer.test.d.ts +2 -0
- package/ts_build/test/blockchainexplorer.test.d.ts.map +1 -0
- package/ts_build/test/blockchainexplorer.test.js +98 -0
- package/ts_build/test/blockchainexplorer.test.js.map +1 -0
- package/ts_build/test/chain/bch.test.d.ts +2 -0
- package/ts_build/test/chain/bch.test.d.ts.map +1 -0
- package/ts_build/test/chain/bch.test.js +135 -0
- package/ts_build/test/chain/bch.test.js.map +1 -0
- package/ts_build/test/chain/btc.test.d.ts +2 -0
- package/ts_build/test/chain/btc.test.d.ts.map +1 -0
- package/ts_build/test/chain/btc.test.js +310 -0
- package/ts_build/test/chain/btc.test.js.map +1 -0
- package/ts_build/test/chain/doge.test.d.ts +2 -0
- package/ts_build/test/chain/doge.test.d.ts.map +1 -0
- package/ts_build/test/chain/doge.test.js +343 -0
- package/ts_build/test/chain/doge.test.js.map +1 -0
- package/ts_build/test/chain/eth.test.d.ts +2 -0
- package/ts_build/test/chain/eth.test.d.ts.map +1 -0
- package/ts_build/test/chain/eth.test.js +51 -0
- package/ts_build/test/chain/eth.test.js.map +1 -0
- package/ts_build/test/chain/ltc.test.d.ts +2 -0
- package/ts_build/test/chain/ltc.test.d.ts.map +1 -0
- package/ts_build/test/chain/ltc.test.js +323 -0
- package/ts_build/test/chain/ltc.test.js.map +1 -0
- package/ts_build/test/chain/matic.test.d.ts +2 -0
- package/ts_build/test/chain/matic.test.d.ts.map +1 -0
- package/ts_build/test/chain/matic.test.js +51 -0
- package/ts_build/test/chain/matic.test.js.map +1 -0
- package/ts_build/test/chain/xrp.test.d.ts +2 -0
- package/ts_build/test/chain/xrp.test.d.ts.map +1 -0
- package/ts_build/test/chain/xrp.test.js +228 -0
- package/ts_build/test/chain/xrp.test.js.map +1 -0
- package/ts_build/test/expressapp.test.d.ts +2 -0
- package/ts_build/test/expressapp.test.d.ts.map +1 -0
- package/ts_build/test/expressapp.test.js +523 -0
- package/ts_build/test/expressapp.test.js.map +1 -0
- package/ts_build/test/integration/bcmonitor.test.d.ts +2 -0
- package/ts_build/test/integration/bcmonitor.test.d.ts.map +1 -0
- package/ts_build/test/integration/bcmonitor.test.js +375 -0
- package/ts_build/test/integration/bcmonitor.test.js.map +1 -0
- package/ts_build/test/integration/cashAddrMigration.test.d.ts +2 -0
- package/ts_build/test/integration/cashAddrMigration.test.d.ts.map +1 -0
- package/ts_build/test/integration/cashAddrMigration.test.js +147 -0
- package/ts_build/test/integration/cashAddrMigration.test.js.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/index.d.ts +4 -0
- package/ts_build/test/integration/data/tss/2of3/index.d.ts.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/index.js +20 -0
- package/ts_build/test/integration/data/tss/2of3/index.js.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/party0.key.d.ts +6 -0
- package/ts_build/test/integration/data/tss/2of3/party0.key.d.ts.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/party0.key.js +9 -0
- package/ts_build/test/integration/data/tss/2of3/party0.key.js.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/party1.key.d.ts +6 -0
- package/ts_build/test/integration/data/tss/2of3/party1.key.d.ts.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/party1.key.js +9 -0
- package/ts_build/test/integration/data/tss/2of3/party1.key.js.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/party2.key.d.ts +6 -0
- package/ts_build/test/integration/data/tss/2of3/party2.key.d.ts.map +1 -0
- package/ts_build/test/integration/data/tss/2of3/party2.key.js +9 -0
- package/ts_build/test/integration/data/tss/2of3/party2.key.js.map +1 -0
- package/ts_build/test/integration/emailnotifications.test.d.ts +2 -0
- package/ts_build/test/integration/emailnotifications.test.d.ts.map +1 -0
- package/ts_build/test/integration/emailnotifications.test.js +805 -0
- package/ts_build/test/integration/emailnotifications.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/banxa.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/banxa.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/banxa.test.js +382 -0
- package/ts_build/test/integration/externalservices/banxa.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/changelly.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/changelly.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/changelly.test.js +509 -0
- package/ts_build/test/integration/externalservices/changelly.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/coinGecko.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/coinGecko.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/coinGecko.test.js +295 -0
- package/ts_build/test/integration/externalservices/coinGecko.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/moonpay.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/moonpay.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/moonpay.test.js +567 -0
- package/ts_build/test/integration/externalservices/moonpay.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/oneInch.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/oneInch.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/oneInch.test.js +182 -0
- package/ts_build/test/integration/externalservices/oneInch.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/ramp.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/ramp.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/ramp.test.js +459 -0
- package/ts_build/test/integration/externalservices/ramp.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/sardine.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/sardine.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/sardine.test.js +364 -0
- package/ts_build/test/integration/externalservices/sardine.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/simplex.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/simplex.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/simplex.test.js +383 -0
- package/ts_build/test/integration/externalservices/simplex.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/thorswap.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/thorswap.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/thorswap.test.js +316 -0
- package/ts_build/test/integration/externalservices/thorswap.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/transak.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/transak.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/transak.test.js +409 -0
- package/ts_build/test/integration/externalservices/transak.test.js.map +1 -0
- package/ts_build/test/integration/externalservices/wyre.test.d.ts +2 -0
- package/ts_build/test/integration/externalservices/wyre.test.d.ts.map +1 -0
- package/ts_build/test/integration/externalservices/wyre.test.js +281 -0
- package/ts_build/test/integration/externalservices/wyre.test.js.map +1 -0
- package/ts_build/test/integration/fiatrateservice.test.d.ts +2 -0
- package/ts_build/test/integration/fiatrateservice.test.d.ts.map +1 -0
- package/ts_build/test/integration/fiatrateservice.test.js +838 -0
- package/ts_build/test/integration/fiatrateservice.test.js.map +1 -0
- package/ts_build/test/integration/helpers.d.ts +57 -0
- package/ts_build/test/integration/helpers.d.ts.map +1 -0
- package/ts_build/test/integration/helpers.js +633 -0
- package/ts_build/test/integration/helpers.js.map +1 -0
- package/ts_build/test/integration/history.test.d.ts +2 -0
- package/ts_build/test/integration/history.test.d.ts.map +1 -0
- package/ts_build/test/integration/history.test.js +1064 -0
- package/ts_build/test/integration/history.test.js.map +1 -0
- package/ts_build/test/integration/hugetx.d.ts +46 -0
- package/ts_build/test/integration/hugetx.d.ts.map +1 -0
- package/ts_build/test/integration/hugetx.js +6459 -0
- package/ts_build/test/integration/hugetx.js.map +1 -0
- package/ts_build/test/integration/pushNotifications.test.d.ts +2 -0
- package/ts_build/test/integration/pushNotifications.test.d.ts.map +1 -0
- package/ts_build/test/integration/pushNotifications.test.js +1379 -0
- package/ts_build/test/integration/pushNotifications.test.js.map +1 -0
- package/ts_build/test/integration/server.test.d.ts +2 -0
- package/ts_build/test/integration/server.test.d.ts.map +1 -0
- package/ts_build/test/integration/server.test.js +9980 -0
- package/ts_build/test/integration/server.test.js.map +1 -0
- package/ts_build/test/integration/tss.test.d.ts +2 -0
- package/ts_build/test/integration/tss.test.d.ts.map +1 -0
- package/ts_build/test/integration/tss.test.js +360 -0
- package/ts_build/test/integration/tss.test.js.map +1 -0
- package/ts_build/test/lock.test.d.ts +2 -0
- package/ts_build/test/lock.test.d.ts.map +1 -0
- package/ts_build/test/lock.test.js +226 -0
- package/ts_build/test/lock.test.js.map +1 -0
- package/ts_build/test/model/address.test.d.ts +2 -0
- package/ts_build/test/model/address.test.d.ts.map +1 -0
- package/ts_build/test/model/address.test.js +209 -0
- package/ts_build/test/model/address.test.js.map +1 -0
- package/ts_build/test/model/addressmanager.test.d.ts +2 -0
- package/ts_build/test/model/addressmanager.test.d.ts.map +1 -0
- package/ts_build/test/model/addressmanager.test.js +178 -0
- package/ts_build/test/model/addressmanager.test.js.map +1 -0
- package/ts_build/test/model/advertisement.test.d.ts +2 -0
- package/ts_build/test/model/advertisement.test.d.ts.map +1 -0
- package/ts_build/test/model/advertisement.test.js +61 -0
- package/ts_build/test/model/advertisement.test.js.map +1 -0
- package/ts_build/test/model/copayer.test.d.ts +2 -0
- package/ts_build/test/model/copayer.test.d.ts.map +1 -0
- package/ts_build/test/model/copayer.test.js +161 -0
- package/ts_build/test/model/copayer.test.js.map +1 -0
- package/ts_build/test/model/txproposal.test.d.ts +2 -0
- package/ts_build/test/model/txproposal.test.d.ts.map +1 -0
- package/ts_build/test/model/txproposal.test.js +198 -0
- package/ts_build/test/model/txproposal.test.js.map +1 -0
- package/ts_build/test/model/wallet.test.d.ts +2 -0
- package/ts_build/test/model/wallet.test.d.ts.map +1 -0
- package/ts_build/test/model/wallet.test.js +215 -0
- package/ts_build/test/model/wallet.test.js.map +1 -0
- package/ts_build/test/storage.test.d.ts +2 -0
- package/ts_build/test/storage.test.d.ts.map +1 -0
- package/ts_build/test/storage.test.js +433 -0
- package/ts_build/test/storage.test.js.map +1 -0
- package/ts_build/test/test-config.d.ts +8 -0
- package/ts_build/test/test-config.d.ts.map +1 -0
- package/ts_build/test/test-config.js +14 -0
- package/ts_build/test/test-config.js.map +1 -0
- package/ts_build/test/testdata.d.ts +91 -0
- package/ts_build/test/testdata.d.ts.map +1 -0
- package/ts_build/test/testdata.js +304 -0
- package/ts_build/test/testdata.js.map +1 -0
- package/ts_build/test/utils.test.d.ts +2 -0
- package/ts_build/test/utils.test.d.ts.map +1 -0
- package/ts_build/test/utils.test.js +450 -0
- package/ts_build/test/utils.test.js.map +1 -0
- package/ts_build/test/v8.test.d.ts +2 -0
- package/ts_build/test/v8.test.d.ts.map +1 -0
- package/ts_build/test/v8.test.js +341 -0
- package/ts_build/test/v8.test.js.map +1 -0
- package/tsconfig.json +43 -0
- package/tsconfig.prod.json +6 -0
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.V8 = void 0;
|
|
40
|
+
const crypto = __importStar(require("crypto"));
|
|
41
|
+
const crypto_wallet_core_1 = require("@bitpay-labs/crypto-wallet-core");
|
|
42
|
+
const async = __importStar(require("async"));
|
|
43
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
44
|
+
const preconditions_1 = require("preconditions");
|
|
45
|
+
const request = __importStar(require("request-promise-native"));
|
|
46
|
+
const io = __importStar(require("socket.io-client"));
|
|
47
|
+
const config_1 = __importDefault(require("../../config"));
|
|
48
|
+
const index_1 = require("../chain/index");
|
|
49
|
+
const common_1 = require("../common");
|
|
50
|
+
const logger_1 = __importDefault(require("../logger"));
|
|
51
|
+
const client_1 = require("./v8/client");
|
|
52
|
+
const $ = (0, preconditions_1.singleton)();
|
|
53
|
+
const Bitcore_ = {
|
|
54
|
+
btc: crypto_wallet_core_1.BitcoreLib,
|
|
55
|
+
bch: crypto_wallet_core_1.BitcoreLibCash,
|
|
56
|
+
eth: crypto_wallet_core_1.BitcoreLib,
|
|
57
|
+
matic: crypto_wallet_core_1.BitcoreLib,
|
|
58
|
+
xrp: crypto_wallet_core_1.BitcoreLib,
|
|
59
|
+
doge: crypto_wallet_core_1.BitcoreLibDoge,
|
|
60
|
+
ltc: crypto_wallet_core_1.BitcoreLibLtc,
|
|
61
|
+
arb: crypto_wallet_core_1.BitcoreLib,
|
|
62
|
+
op: crypto_wallet_core_1.BitcoreLib,
|
|
63
|
+
base: crypto_wallet_core_1.BitcoreLib,
|
|
64
|
+
sol: crypto_wallet_core_1.BitcoreLib
|
|
65
|
+
};
|
|
66
|
+
const { Constants, Defaults, Utils } = common_1.Common;
|
|
67
|
+
const { sortDesc } = Utils;
|
|
68
|
+
function v8network(bwsNetwork, chain = 'btc') {
|
|
69
|
+
if (Utils.getGenericName(bwsNetwork) == 'livenet')
|
|
70
|
+
return 'mainnet';
|
|
71
|
+
if (Utils.getGenericName(bwsNetwork) == 'testnet' && config_1.default.blockchainExplorerOpts?.[chain.toLowerCase()]?.[Utils.getNetworkName(chain.toLowerCase(), 'testnet')]?.regtestEnabled) {
|
|
72
|
+
return 'regtest';
|
|
73
|
+
}
|
|
74
|
+
return bwsNetwork;
|
|
75
|
+
}
|
|
76
|
+
class V8 {
|
|
77
|
+
chain;
|
|
78
|
+
network;
|
|
79
|
+
v8network;
|
|
80
|
+
addressFormat;
|
|
81
|
+
apiPrefix;
|
|
82
|
+
chainNetwork;
|
|
83
|
+
host;
|
|
84
|
+
userAgent;
|
|
85
|
+
baseUrl;
|
|
86
|
+
request;
|
|
87
|
+
Client;
|
|
88
|
+
_cachedReserve;
|
|
89
|
+
_cachedReserveTs;
|
|
90
|
+
constructor(opts) {
|
|
91
|
+
$.checkArgument(opts);
|
|
92
|
+
$.checkArgument(Utils.checkValueInCollection(opts.chain, Constants.CHAINS));
|
|
93
|
+
$.checkArgument(Utils.checkValueInCollection(opts.network, Constants.NETWORKS[opts.chain]));
|
|
94
|
+
$.checkArgument(opts.url);
|
|
95
|
+
this.apiPrefix = opts.apiPrefix == null ? '/api' : opts.apiPrefix;
|
|
96
|
+
this.chain = opts.chain;
|
|
97
|
+
this.network = opts.network || 'livenet';
|
|
98
|
+
this.v8network = v8network(this.network, this.chain);
|
|
99
|
+
this.addressFormat = this.chain == 'bch' ? 'cashaddr' : null;
|
|
100
|
+
this.chainNetwork = `/${this.chain.toUpperCase()}/${this.v8network}`;
|
|
101
|
+
this.apiPrefix += this.chainNetwork;
|
|
102
|
+
this.host = opts.url;
|
|
103
|
+
this.userAgent = opts.userAgent || 'bws';
|
|
104
|
+
this.baseUrl = this.host + this.apiPrefix;
|
|
105
|
+
this.request = opts.request || request;
|
|
106
|
+
this.Client = opts.client || client_1.Client || require('./v8/client');
|
|
107
|
+
}
|
|
108
|
+
_getClient() {
|
|
109
|
+
return new this.Client({
|
|
110
|
+
baseUrl: this.baseUrl
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
_getAuthClient(wallet) {
|
|
114
|
+
$.checkState(wallet.beAuthPrivateKey2, 'Failed state: wallet.beAuthPrivateKey2 at <_getAuthClient()>');
|
|
115
|
+
return new this.Client({
|
|
116
|
+
baseUrl: this.baseUrl,
|
|
117
|
+
authKey: Bitcore_[this.chain].PrivateKey(wallet.beAuthPrivateKey2)
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
addAddresses(wallet, addresses, cb, opts) {
|
|
121
|
+
const client = this._getAuthClient(wallet);
|
|
122
|
+
const payload = addresses.map(a => ({ address: a }));
|
|
123
|
+
if (opts?.reprocess) {
|
|
124
|
+
const c = this._getAuthClient({ beAuthPrivateKey2: config_1.default.blockchainExplorerOpts.socketApiKey });
|
|
125
|
+
opts.reprocess = c.sign({ method: 'reprocess', url: 'http://thisdontmatter.com/addAddresses' + wallet.beAuthPublicKey2, payload });
|
|
126
|
+
}
|
|
127
|
+
const k = 'addAddresses' + !!opts.reprocess + addresses.length;
|
|
128
|
+
const perfKey = getPerformanceKey(k);
|
|
129
|
+
console.time(perfKey);
|
|
130
|
+
client
|
|
131
|
+
.importAddresses({
|
|
132
|
+
payload,
|
|
133
|
+
pubKey: wallet.beAuthPublicKey2,
|
|
134
|
+
reprocess: opts?.reprocess
|
|
135
|
+
})
|
|
136
|
+
.then(ret => {
|
|
137
|
+
console.timeEnd(perfKey);
|
|
138
|
+
return cb(null, ret);
|
|
139
|
+
})
|
|
140
|
+
.catch(err => {
|
|
141
|
+
return cb(err);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
register(wallet, cb) {
|
|
145
|
+
if (wallet.chain != this.chain || wallet.network != this.network) {
|
|
146
|
+
return cb(new Error('Network chain or network mismatch'));
|
|
147
|
+
}
|
|
148
|
+
const client = this._getAuthClient(wallet);
|
|
149
|
+
const payload = {
|
|
150
|
+
name: wallet.id,
|
|
151
|
+
pubKey: wallet.beAuthPublicKey2
|
|
152
|
+
};
|
|
153
|
+
client
|
|
154
|
+
.register({
|
|
155
|
+
authKey: wallet.beAuthPrivateKey2,
|
|
156
|
+
payload
|
|
157
|
+
})
|
|
158
|
+
.then(ret => {
|
|
159
|
+
return cb(null, ret);
|
|
160
|
+
})
|
|
161
|
+
.catch(cb);
|
|
162
|
+
}
|
|
163
|
+
async getBalance(wallet, cb) {
|
|
164
|
+
const client = this._getAuthClient(wallet);
|
|
165
|
+
const { tokenAddress, multisigContractAddress } = wallet;
|
|
166
|
+
client
|
|
167
|
+
.getBalance({ pubKey: wallet.beAuthPublicKey2, payload: {}, tokenAddress, multisigContractAddress })
|
|
168
|
+
.then(ret => {
|
|
169
|
+
return cb(null, ret);
|
|
170
|
+
})
|
|
171
|
+
.catch(cb);
|
|
172
|
+
}
|
|
173
|
+
getConnectionInfo() {
|
|
174
|
+
return 'V8 (' + this.chain + '/' + this.v8network + ') @ ' + this.host;
|
|
175
|
+
}
|
|
176
|
+
_transformUtxos(utxos, bcheight) {
|
|
177
|
+
$.checkState(bcheight > 0, 'Failed state: No BC height passed to _transformUtxos()');
|
|
178
|
+
const ret = lodash_1.default.map(lodash_1.default.reject(utxos, x => {
|
|
179
|
+
return x.spentHeight && x.spentHeight <= -3;
|
|
180
|
+
}), x => {
|
|
181
|
+
const u = {
|
|
182
|
+
address: x.address,
|
|
183
|
+
satoshis: x.value,
|
|
184
|
+
amount: x.value / 1e8,
|
|
185
|
+
scriptPubKey: x.script,
|
|
186
|
+
txid: x.mintTxid,
|
|
187
|
+
vout: x.mintIndex,
|
|
188
|
+
locked: false,
|
|
189
|
+
confirmations: x.mintHeight > 0 && bcheight >= x.mintHeight ? bcheight - x.mintHeight + 1 : 0,
|
|
190
|
+
spent: x.spentHeight != -2
|
|
191
|
+
};
|
|
192
|
+
return u;
|
|
193
|
+
});
|
|
194
|
+
return ret;
|
|
195
|
+
}
|
|
196
|
+
getUtxos(wallet, height, cb, params = {}) {
|
|
197
|
+
$.checkArgument(cb);
|
|
198
|
+
const client = this._getAuthClient(wallet);
|
|
199
|
+
const perfKey = getPerformanceKey('V8getUtxos');
|
|
200
|
+
console.time(perfKey);
|
|
201
|
+
client
|
|
202
|
+
.getCoins({
|
|
203
|
+
pubKey: wallet.beAuthPublicKey2,
|
|
204
|
+
payload: {},
|
|
205
|
+
...params
|
|
206
|
+
})
|
|
207
|
+
.then(utxos => {
|
|
208
|
+
console.timeEnd(perfKey);
|
|
209
|
+
return cb(null, this._transformUtxos(utxos, height));
|
|
210
|
+
})
|
|
211
|
+
.catch(cb);
|
|
212
|
+
}
|
|
213
|
+
getCoinsForTx(txId, cb) {
|
|
214
|
+
$.checkArgument(cb);
|
|
215
|
+
const client = this._getClient();
|
|
216
|
+
const perfKey = getPerformanceKey('V8getCoinsForTx');
|
|
217
|
+
console.time(perfKey);
|
|
218
|
+
client
|
|
219
|
+
.getCoinsForTx({ txId, payload: {} })
|
|
220
|
+
.then(coins => {
|
|
221
|
+
console.timeEnd(perfKey);
|
|
222
|
+
return cb(null, coins);
|
|
223
|
+
})
|
|
224
|
+
.catch(cb);
|
|
225
|
+
}
|
|
226
|
+
getCheckData(wallet, cb) {
|
|
227
|
+
const client = this._getAuthClient(wallet);
|
|
228
|
+
const perfKey = getPerformanceKey('WalletCheck');
|
|
229
|
+
console.time(perfKey);
|
|
230
|
+
client
|
|
231
|
+
.getCheckData({ pubKey: wallet.beAuthPublicKey2, payload: {} })
|
|
232
|
+
.then(checkInfo => {
|
|
233
|
+
console.timeEnd(perfKey);
|
|
234
|
+
return cb(null, checkInfo);
|
|
235
|
+
})
|
|
236
|
+
.catch(cb);
|
|
237
|
+
}
|
|
238
|
+
broadcast(rawTx, cb, count = 0) {
|
|
239
|
+
const payload = {
|
|
240
|
+
rawTx,
|
|
241
|
+
network: this.v8network,
|
|
242
|
+
chain: this.chain.toUpperCase()
|
|
243
|
+
};
|
|
244
|
+
const client = this._getClient();
|
|
245
|
+
client
|
|
246
|
+
.broadcast({ payload })
|
|
247
|
+
.then(ret => {
|
|
248
|
+
if (!ret.txid) {
|
|
249
|
+
return cb(new Error('Error broadcasting'));
|
|
250
|
+
}
|
|
251
|
+
return cb(null, ret.txid);
|
|
252
|
+
})
|
|
253
|
+
.catch(err => {
|
|
254
|
+
if (count > 3) {
|
|
255
|
+
logger_1.default.error('[v8.js] FINAL Broadcast error: %o', err);
|
|
256
|
+
return cb(err);
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
count++;
|
|
260
|
+
setTimeout(() => {
|
|
261
|
+
logger_1.default.info('[v8.js] Retrying broadcast after %o', count * Defaults.BROADCAST_RETRY_TIME);
|
|
262
|
+
return this.broadcast(rawTx, cb, count);
|
|
263
|
+
}, count * Defaults.BROADCAST_RETRY_TIME);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
getTransaction(txid, cb) {
|
|
268
|
+
logger_1.default.debug('[v8.js] GET TX %o', txid);
|
|
269
|
+
const client = this._getClient();
|
|
270
|
+
client
|
|
271
|
+
.getTx({ txid })
|
|
272
|
+
.then(tx => {
|
|
273
|
+
if (!tx || JSON.stringify(tx) === '{}') {
|
|
274
|
+
return cb();
|
|
275
|
+
}
|
|
276
|
+
return cb(null, tx);
|
|
277
|
+
})
|
|
278
|
+
.catch(err => {
|
|
279
|
+
if (err.statusCode == '404') {
|
|
280
|
+
return cb();
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return cb(err);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
getAddressUtxos(address, height, cb) {
|
|
288
|
+
logger_1.default.debug('[v8.js] GET ADDR UTXO, %o, %o', address, height);
|
|
289
|
+
const client = this._getClient();
|
|
290
|
+
client
|
|
291
|
+
.getAddressTxos({ address, unspent: true })
|
|
292
|
+
.then(utxos => {
|
|
293
|
+
return cb(null, this._transformUtxos(utxos, height));
|
|
294
|
+
})
|
|
295
|
+
.catch(cb);
|
|
296
|
+
}
|
|
297
|
+
getTransactions(wallet, startBlock, cb) {
|
|
298
|
+
const perfKey = getPerformanceKey('V8getTxs');
|
|
299
|
+
console.time(perfKey);
|
|
300
|
+
if (startBlock) {
|
|
301
|
+
logger_1.default.debug(`getTxs: startBlock ${startBlock}`);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
logger_1.default.debug('getTxs: from 0');
|
|
305
|
+
}
|
|
306
|
+
const client = this._getAuthClient(wallet);
|
|
307
|
+
let acum = '', broken;
|
|
308
|
+
const opts = {
|
|
309
|
+
includeMempool: true,
|
|
310
|
+
pubKey: wallet.beAuthPublicKey2,
|
|
311
|
+
payload: {},
|
|
312
|
+
startBlock: undefined,
|
|
313
|
+
tokenAddress: wallet.tokenAddress,
|
|
314
|
+
multisigContractAddress: wallet.multisigContractAddress
|
|
315
|
+
};
|
|
316
|
+
if (startBlock != null && !isNaN(startBlock))
|
|
317
|
+
opts.startBlock = startBlock;
|
|
318
|
+
const txStream = client.listTransactions(opts);
|
|
319
|
+
txStream.on('data', raw => {
|
|
320
|
+
acum = acum + raw.toString();
|
|
321
|
+
});
|
|
322
|
+
txStream.on('end', () => {
|
|
323
|
+
if (broken) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const txs = [], unconf = [];
|
|
327
|
+
for (const rawTx of acum.split(/\r?\n/)) {
|
|
328
|
+
if (!rawTx)
|
|
329
|
+
continue;
|
|
330
|
+
let tx;
|
|
331
|
+
try {
|
|
332
|
+
tx = JSON.parse(rawTx);
|
|
333
|
+
}
|
|
334
|
+
catch (e) {
|
|
335
|
+
logger_1.default.error('[v8.js] Error at JSON.parse:' + e + ' Parsing:' + rawTx + ':');
|
|
336
|
+
return cb(e);
|
|
337
|
+
}
|
|
338
|
+
if (tx.value)
|
|
339
|
+
tx.amount = tx.satoshis / 1e8;
|
|
340
|
+
if (tx.height >= 0)
|
|
341
|
+
txs.push(tx);
|
|
342
|
+
else if (tx.height >= -2)
|
|
343
|
+
unconf.push(tx);
|
|
344
|
+
}
|
|
345
|
+
console.timeEnd(perfKey);
|
|
346
|
+
return cb(null, lodash_1.default.flatten(sortDesc(unconf, 'blockTime').concat(sortDesc(txs, 'height'))));
|
|
347
|
+
});
|
|
348
|
+
txStream.on('error', e => {
|
|
349
|
+
logger_1.default.error('[v8.js] Error: %o', e);
|
|
350
|
+
broken = true;
|
|
351
|
+
return cb(e);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
getAddressActivity(address, cb) {
|
|
355
|
+
const url = this.baseUrl + '/address/' + address + '/txs?limit=1';
|
|
356
|
+
logger_1.default.debug('[v8.js] CHECKING ADDRESS ACTIVITY %o', url);
|
|
357
|
+
this.request
|
|
358
|
+
.get(url, {})
|
|
359
|
+
.then(ret => {
|
|
360
|
+
return cb(null, ret !== '[]');
|
|
361
|
+
})
|
|
362
|
+
.catch(err => {
|
|
363
|
+
return cb(err);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
getTransactionCount(address, cb) {
|
|
367
|
+
const url = this.baseUrl + '/address/' + address + '/txs/count';
|
|
368
|
+
logger_1.default.debug('[v8.js] CHECKING ADDRESS NONCE %o', url);
|
|
369
|
+
this.request
|
|
370
|
+
.get(url, {})
|
|
371
|
+
.then(ret => {
|
|
372
|
+
ret = JSON.parse(ret);
|
|
373
|
+
return cb(null, ret.nonce);
|
|
374
|
+
})
|
|
375
|
+
.catch(err => {
|
|
376
|
+
return cb(err);
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
estimateGas(opts, cb) {
|
|
380
|
+
const url = this.baseUrl + '/gas';
|
|
381
|
+
logger_1.default.debug('[v8.js] CHECKING GAS LIMIT %o', url);
|
|
382
|
+
this.request
|
|
383
|
+
.post(url, { body: opts, json: true })
|
|
384
|
+
.then(gasLimit => {
|
|
385
|
+
gasLimit = JSON.parse(gasLimit);
|
|
386
|
+
return cb(null, gasLimit);
|
|
387
|
+
})
|
|
388
|
+
.catch(err => {
|
|
389
|
+
return cb(err);
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
getMultisigContractInstantiationInfo(opts, cb) {
|
|
393
|
+
const url = `${this.baseUrl}/ethmultisig/${opts.sender}/instantiation/${opts.txId}`;
|
|
394
|
+
logger_1.default.debug('[v8.js] CHECKING CONTRACT INSTANTIATION INFO %o', url);
|
|
395
|
+
this.request
|
|
396
|
+
.get(url, {})
|
|
397
|
+
.then(contractInstantiationInfo => {
|
|
398
|
+
contractInstantiationInfo = JSON.parse(contractInstantiationInfo);
|
|
399
|
+
return cb(null, contractInstantiationInfo);
|
|
400
|
+
})
|
|
401
|
+
.catch(err => {
|
|
402
|
+
return cb(err);
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
getMultisigContractInfo(opts, cb) {
|
|
406
|
+
const url = this.baseUrl + '/ethmultisig/info/' + opts.multisigContractAddress;
|
|
407
|
+
logger_1.default.debug('[v8.js] CHECKING CONTRACT INFO %o', url);
|
|
408
|
+
this.request
|
|
409
|
+
.get(url, {})
|
|
410
|
+
.then(contractInfo => {
|
|
411
|
+
contractInfo = JSON.parse(contractInfo);
|
|
412
|
+
return cb(null, contractInfo);
|
|
413
|
+
})
|
|
414
|
+
.catch(err => {
|
|
415
|
+
return cb(err);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
getTokenContractInfo(opts, cb) {
|
|
419
|
+
const url = this.baseUrl + '/token/' + opts.tokenAddress;
|
|
420
|
+
logger_1.default.debug('[v8.js] CHECKING CONTRACT INFO %o', url);
|
|
421
|
+
this.request
|
|
422
|
+
.get(url, {})
|
|
423
|
+
.then(contractInfo => {
|
|
424
|
+
contractInfo = JSON.parse(contractInfo);
|
|
425
|
+
return cb(null, contractInfo);
|
|
426
|
+
})
|
|
427
|
+
.catch(err => {
|
|
428
|
+
return cb(err);
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
getTokenAllowance(opts, cb) {
|
|
432
|
+
const url = this.baseUrl + '/token/' + opts.tokenAddress + '/allowance/' + opts.ownerAddress + '/for/' + opts.spenderAddress;
|
|
433
|
+
logger_1.default.debug('[v8.js] CHECKING TOKEN ALLOWANCE %o', url);
|
|
434
|
+
this.request
|
|
435
|
+
.get(url, {})
|
|
436
|
+
.then(allowance => {
|
|
437
|
+
allowance = JSON.parse(allowance);
|
|
438
|
+
return cb(null, allowance);
|
|
439
|
+
})
|
|
440
|
+
.catch(err => {
|
|
441
|
+
return cb(err);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
getMultisigTxpsInfo(opts, cb) {
|
|
445
|
+
const url = this.baseUrl + '/ethmultisig/txps/' + opts.multisigContractAddress;
|
|
446
|
+
logger_1.default.debug('[v8.js] CHECKING CONTRACT TXPS INFO %o', url);
|
|
447
|
+
this.request
|
|
448
|
+
.get(url, {})
|
|
449
|
+
.then(multisigTxpsInfo => {
|
|
450
|
+
multisigTxpsInfo = JSON.parse(multisigTxpsInfo);
|
|
451
|
+
return cb(null, multisigTxpsInfo);
|
|
452
|
+
})
|
|
453
|
+
.catch(err => {
|
|
454
|
+
return cb(err);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
estimateFee(nbBlocks, cb) {
|
|
458
|
+
nbBlocks = nbBlocks || [1, 2, 6, 24];
|
|
459
|
+
const result = {};
|
|
460
|
+
async.each(nbBlocks, (x, icb) => {
|
|
461
|
+
const url = this.baseUrl + '/fee/' + x;
|
|
462
|
+
this.request
|
|
463
|
+
.get(url, {})
|
|
464
|
+
.then(ret => {
|
|
465
|
+
try {
|
|
466
|
+
ret = JSON.parse(ret);
|
|
467
|
+
if (!lodash_1.default.isUndefined(ret.blocks) && ret.blocks != x) {
|
|
468
|
+
logger_1.default.info(`[v8.js] Ignoring response for ${x}: %o`, ret?.body || ret);
|
|
469
|
+
return icb();
|
|
470
|
+
}
|
|
471
|
+
result[x] = ret.feerate;
|
|
472
|
+
}
|
|
473
|
+
catch (e) {
|
|
474
|
+
logger_1.default.warn('[v8.js] Fee error: %o', e);
|
|
475
|
+
}
|
|
476
|
+
return icb();
|
|
477
|
+
})
|
|
478
|
+
.catch(err => {
|
|
479
|
+
return icb(err);
|
|
480
|
+
});
|
|
481
|
+
}, err => {
|
|
482
|
+
if (err) {
|
|
483
|
+
return cb(err);
|
|
484
|
+
}
|
|
485
|
+
return cb(null, result);
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
estimateFeeV2(opts, cb) {
|
|
489
|
+
const txType = opts.txType;
|
|
490
|
+
if (Number(txType) !== 2) {
|
|
491
|
+
return this.estimateFee(opts, cb);
|
|
492
|
+
}
|
|
493
|
+
const nbBlocks = Number(opts.nbBlocks) || 2;
|
|
494
|
+
const url = this.baseUrl + `/fee/${nbBlocks}?txType=${txType}`;
|
|
495
|
+
let result;
|
|
496
|
+
this.request
|
|
497
|
+
.get(url, {})
|
|
498
|
+
.then(ret => {
|
|
499
|
+
try {
|
|
500
|
+
ret = JSON.parse(ret);
|
|
501
|
+
result = ret.feerate;
|
|
502
|
+
}
|
|
503
|
+
catch (e) {
|
|
504
|
+
logger_1.default.warn('[v8.js] Fee error: %o', e);
|
|
505
|
+
}
|
|
506
|
+
return cb(null, result);
|
|
507
|
+
})
|
|
508
|
+
.catch(err => {
|
|
509
|
+
return cb(err);
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
estimatePriorityFee(opts, cb) {
|
|
513
|
+
const percentile = opts.percentile;
|
|
514
|
+
let result;
|
|
515
|
+
const url = this.baseUrl + `/priorityFee/${percentile}`;
|
|
516
|
+
this.request
|
|
517
|
+
.get(url, {})
|
|
518
|
+
.then(ret => {
|
|
519
|
+
try {
|
|
520
|
+
ret = JSON.parse(ret);
|
|
521
|
+
result = ret.feerate;
|
|
522
|
+
}
|
|
523
|
+
catch (e) {
|
|
524
|
+
logger_1.default.warn('[v8.js] Priority fee error: %o', e);
|
|
525
|
+
}
|
|
526
|
+
return cb(null, result);
|
|
527
|
+
})
|
|
528
|
+
.catch(err => {
|
|
529
|
+
return cb(err);
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
getBlockchainHeight(cb) {
|
|
533
|
+
const url = this.baseUrl + '/block/tip';
|
|
534
|
+
this.request
|
|
535
|
+
.get(url, {})
|
|
536
|
+
.then(ret => {
|
|
537
|
+
try {
|
|
538
|
+
ret = JSON.parse(ret);
|
|
539
|
+
return cb(null, ret.height, ret.hash);
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
return cb(new Error('Could not get height from block explorer'));
|
|
543
|
+
}
|
|
544
|
+
})
|
|
545
|
+
.catch(cb);
|
|
546
|
+
}
|
|
547
|
+
getTxidsInBlock(blockHash, cb) {
|
|
548
|
+
const url = this.baseUrl + '/tx/?blockHash=' + blockHash;
|
|
549
|
+
this.request
|
|
550
|
+
.get(url, {})
|
|
551
|
+
.then(ret => {
|
|
552
|
+
try {
|
|
553
|
+
ret = JSON.parse(ret);
|
|
554
|
+
const res = lodash_1.default.map(ret, 'txid');
|
|
555
|
+
return cb(null, res);
|
|
556
|
+
}
|
|
557
|
+
catch {
|
|
558
|
+
return cb(new Error('Could not get height from block explorer'));
|
|
559
|
+
}
|
|
560
|
+
})
|
|
561
|
+
.catch(cb);
|
|
562
|
+
}
|
|
563
|
+
getReserve(cb) {
|
|
564
|
+
if (this._cachedReserveTs && Date.now() - this._cachedReserveTs < 20 * 60 * 1000) {
|
|
565
|
+
return cb(null, this._cachedReserve);
|
|
566
|
+
}
|
|
567
|
+
const url = this.baseUrl + '/reserve';
|
|
568
|
+
this.request
|
|
569
|
+
.get(url, {})
|
|
570
|
+
.then(ret => {
|
|
571
|
+
try {
|
|
572
|
+
ret = JSON.parse(ret);
|
|
573
|
+
if (ret.reserve != null) {
|
|
574
|
+
this._cachedReserve = ret.reserve;
|
|
575
|
+
this._cachedReserveTs = Date.now();
|
|
576
|
+
}
|
|
577
|
+
return cb(null, ret.reserve ?? Defaults.MIN_XRP_BALANCE);
|
|
578
|
+
}
|
|
579
|
+
catch (err) {
|
|
580
|
+
logger_1.default.error('[v8.js] Error getting reserve: %o', err);
|
|
581
|
+
return cb(null, Defaults.MIN_XRP_BALANCE);
|
|
582
|
+
}
|
|
583
|
+
})
|
|
584
|
+
.catch(cb);
|
|
585
|
+
}
|
|
586
|
+
getRentMinimum(space, cb) {
|
|
587
|
+
if (!space) {
|
|
588
|
+
return cb(null, Defaults.MIN_SOL_BALANCE);
|
|
589
|
+
}
|
|
590
|
+
const url = this.baseUrl + `/rent/${space}`;
|
|
591
|
+
this.request
|
|
592
|
+
.get(url, {})
|
|
593
|
+
.then(ret => {
|
|
594
|
+
try {
|
|
595
|
+
ret = Number(ret);
|
|
596
|
+
return cb(null, ret || Defaults.MIN_SOL_BALANCE);
|
|
597
|
+
}
|
|
598
|
+
catch (err) {
|
|
599
|
+
logger_1.default.error('[v8.js] Error getting rentMinimum: %o', err);
|
|
600
|
+
return cb(null, Defaults.MIN_XRP_BALANCE);
|
|
601
|
+
}
|
|
602
|
+
})
|
|
603
|
+
.catch(cb);
|
|
604
|
+
}
|
|
605
|
+
initSocket(callbacks) {
|
|
606
|
+
logger_1.default.info('V8 connecting socket at:' + this.host);
|
|
607
|
+
const walletsSocket = io.connect(this.host, { transports: ['websocket'] });
|
|
608
|
+
const blockSocket = io.connect(this.host, { transports: ['websocket'] });
|
|
609
|
+
const getAuthPayload = host => {
|
|
610
|
+
const authKey = config_1.default.blockchainExplorerOpts.socketApiKey;
|
|
611
|
+
if (!authKey)
|
|
612
|
+
throw new Error('provide authKey');
|
|
613
|
+
const authKeyObj = new crypto_wallet_core_1.BitcoreLib.PrivateKey(authKey);
|
|
614
|
+
const pubKey = authKeyObj.toPublicKey().toString();
|
|
615
|
+
const authClient = new client_1.Client({ baseUrl: host, authKey: authKeyObj });
|
|
616
|
+
const payload = { method: 'socket', url: host };
|
|
617
|
+
const authPayload = { pubKey, message: authClient.getMessage(payload), signature: authClient.sign(payload) };
|
|
618
|
+
return authPayload;
|
|
619
|
+
};
|
|
620
|
+
blockSocket.on('connect', () => {
|
|
621
|
+
logger_1.default.info(`Connected to block ${this.getConnectionInfo()}`);
|
|
622
|
+
blockSocket.emit('room', `${this.chainNetwork}/inv`);
|
|
623
|
+
});
|
|
624
|
+
blockSocket.on('connect_error', () => {
|
|
625
|
+
logger_1.default.error(`Error connecting to ${this.getConnectionInfo()}`);
|
|
626
|
+
});
|
|
627
|
+
blockSocket.on('block', data => {
|
|
628
|
+
return callbacks.onBlock(data.hash);
|
|
629
|
+
});
|
|
630
|
+
walletsSocket.on('connect', () => {
|
|
631
|
+
logger_1.default.info(`Connected to wallets ${this.getConnectionInfo()}`);
|
|
632
|
+
walletsSocket.emit('room', `${this.chainNetwork}/wallets`, getAuthPayload(this.host));
|
|
633
|
+
});
|
|
634
|
+
walletsSocket.on('connect_error', () => {
|
|
635
|
+
logger_1.default.error(`Error connecting to ${this.getConnectionInfo()} ${this.chainNetwork}`);
|
|
636
|
+
});
|
|
637
|
+
walletsSocket.on('failure', err => {
|
|
638
|
+
logger_1.default.error(`Error joining room ${err.message} ${this.chainNetwork}`);
|
|
639
|
+
});
|
|
640
|
+
walletsSocket.on('coin', data => {
|
|
641
|
+
if (!data || !data.coin)
|
|
642
|
+
return;
|
|
643
|
+
const notification = index_1.ChainService.onCoin(this.chain, data.coin);
|
|
644
|
+
if (!notification)
|
|
645
|
+
return;
|
|
646
|
+
return callbacks.onIncomingPayments(notification);
|
|
647
|
+
});
|
|
648
|
+
walletsSocket.on('tx', data => {
|
|
649
|
+
if (!data || !data.tx)
|
|
650
|
+
return;
|
|
651
|
+
const notification = index_1.ChainService.onTx(this.chain, data.tx);
|
|
652
|
+
if (!notification)
|
|
653
|
+
return;
|
|
654
|
+
return callbacks.onIncomingPayments(notification);
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
exports.V8 = V8;
|
|
659
|
+
const getPerformanceKey = (name) => {
|
|
660
|
+
return name + '-' + crypto.randomBytes(5).toString('hex');
|
|
661
|
+
};
|
|
662
|
+
//# sourceMappingURL=v8.js.map
|