@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,359 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import 'ts-node/register';
|
|
4
|
+
import { exec } from 'child_process';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import sgMail from '@sendgrid/mail';
|
|
9
|
+
import juice from 'juice';
|
|
10
|
+
import Mustache from 'mustache';
|
|
11
|
+
import config from '../src/config';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const iconMap = {
|
|
15
|
+
new_copayer: 'person-plus.png',
|
|
16
|
+
new_incoming_tx: 'down-arrow-green.png',
|
|
17
|
+
new_incoming_tx_testnet: 'down-arrow-green.png',
|
|
18
|
+
new_outgoing_tx: 'up-arrow-gray.png',
|
|
19
|
+
new_tx_proposal: 'writing-gray.png',
|
|
20
|
+
new_zero_outgoing_tx: 'up-arrow-gray.png',
|
|
21
|
+
tx_confirmation: 'green-check.png',
|
|
22
|
+
tx_confirmation_receiver: 'green-check.png',
|
|
23
|
+
tx_confirmation_sender: 'green-check.png',
|
|
24
|
+
txp_finally_rejected: 'failed-icon.png',
|
|
25
|
+
wallet_complete: 'green-check.png'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function getIconHtml (templateName) {
|
|
29
|
+
const iconFile = iconMap[templateName];
|
|
30
|
+
if (!iconFile) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const staticUrl = config.baseUrl || 'https://bws.bitpay.com';
|
|
35
|
+
const iconUrl = `${staticUrl}/bws/static/images/${iconFile}`;
|
|
36
|
+
|
|
37
|
+
return `<img src="${iconUrl}" alt="${templateName} icon" style="width: 50px; height: 50px;" />`;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Parse command line arguments
|
|
41
|
+
const args = process.argv.slice(2);
|
|
42
|
+
const templateName = args[0] || 'new_copayer';
|
|
43
|
+
const language = args[1] || 'en';
|
|
44
|
+
const sendEmail = args[2] === 'send';
|
|
45
|
+
const recipientEmail = args[3]; // Required if sendEmail is true
|
|
46
|
+
|
|
47
|
+
// Available email templates
|
|
48
|
+
const TEMPLATE_TYPES = [
|
|
49
|
+
'new_copayer',
|
|
50
|
+
'wallet_complete',
|
|
51
|
+
'new_tx_proposal',
|
|
52
|
+
'new_outgoing_tx',
|
|
53
|
+
'new_incoming_tx',
|
|
54
|
+
'new_incoming_tx_testnet',
|
|
55
|
+
'new_zero_outgoing_tx',
|
|
56
|
+
'txp_finally_rejected',
|
|
57
|
+
'tx_confirmation',
|
|
58
|
+
'tx_confirmation_receiver',
|
|
59
|
+
'tx_confirmation_sender'
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
// Template directory
|
|
63
|
+
const TEMPLATE_DIR = path.join(__dirname, '../../templates');
|
|
64
|
+
const MASTER_TEMPLATE_PATH = path.join(TEMPLATE_DIR, 'master-template.html');
|
|
65
|
+
const CONTENT_TEMPLATE_PATH = path.join(TEMPLATE_DIR, language, `${templateName}.html`);
|
|
66
|
+
|
|
67
|
+
console.log('Template directories:');
|
|
68
|
+
console.log('TEMPLATE_DIR:', TEMPLATE_DIR);
|
|
69
|
+
|
|
70
|
+
// Validate arguments
|
|
71
|
+
if (!templateName || !TEMPLATE_TYPES.includes(templateName)) {
|
|
72
|
+
console.log('Usage: node preview-email.js <templateName> [language] [send] [recipientEmail]');
|
|
73
|
+
console.log(' - templateName: Name of the template to preview');
|
|
74
|
+
console.log(' - language: Language code (default: en)');
|
|
75
|
+
console.log(' - send: Set to "send" to send an actual email');
|
|
76
|
+
console.log(' - recipientEmail: Email address to send to (required if send=true)');
|
|
77
|
+
console.log('\nAvailable templates:');
|
|
78
|
+
for (const type of TEMPLATE_TYPES) {
|
|
79
|
+
console.log(`- ${type}`);
|
|
80
|
+
}
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (sendEmail && !recipientEmail) {
|
|
85
|
+
console.error('Error: Recipient email is required when sending an actual email');
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Create sample data based on template type
|
|
90
|
+
const createSampleData = (templateName) => {
|
|
91
|
+
// Common data for all templates
|
|
92
|
+
const commonData = {
|
|
93
|
+
title: templateName.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' '),
|
|
94
|
+
subjectPrefix: '[Wallet Service] ',
|
|
95
|
+
walletId: 'testWalletId',
|
|
96
|
+
walletName: 'Test Wallet',
|
|
97
|
+
walletM: 2,
|
|
98
|
+
walletN: 3,
|
|
99
|
+
copayerId: 'testCopayerId',
|
|
100
|
+
copayerName: 'John Doe'
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const iconObj = getIconHtml(templateName, sendEmail);
|
|
104
|
+
if (iconObj) {
|
|
105
|
+
commonData.icon = iconObj;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
const plainTextPath = path.join(TEMPLATE_DIR, language, `${templateName}.plain`);
|
|
110
|
+
const plainContent = fs.readFileSync(plainTextPath, 'utf8');
|
|
111
|
+
const firstLine = plainContent.split('\n')[0];
|
|
112
|
+
if (firstLine && firstLine.startsWith('{{subjectPrefix}}')) {
|
|
113
|
+
commonData.title = firstLine.replace('{{subjectPrefix}}', '');
|
|
114
|
+
}
|
|
115
|
+
} catch { /* ignore error */ }
|
|
116
|
+
|
|
117
|
+
switch (templateName) {
|
|
118
|
+
case 'new_copayer':
|
|
119
|
+
return commonData;
|
|
120
|
+
case 'wallet_complete': {
|
|
121
|
+
const title = commonData.title;
|
|
122
|
+
return {
|
|
123
|
+
...commonData,
|
|
124
|
+
title: title || 'Wallet Complete'
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
case 'new_tx_proposal': {
|
|
128
|
+
const title = commonData.title;
|
|
129
|
+
return {
|
|
130
|
+
...commonData,
|
|
131
|
+
title: title || 'New Payment Proposal',
|
|
132
|
+
txProposalId: 'txp-123',
|
|
133
|
+
amount: '1.5 BTC',
|
|
134
|
+
toAddress: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
|
|
135
|
+
creatorName: 'John Doe'
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
case 'new_outgoing_tx':
|
|
139
|
+
case 'new_incoming_tx': {
|
|
140
|
+
const title = commonData.title;
|
|
141
|
+
return {
|
|
142
|
+
...commonData,
|
|
143
|
+
title: title || (templateName === 'new_outgoing_tx' ? 'Payment Sent' : 'New Payment Received'),
|
|
144
|
+
txid: '1234567890abcdef',
|
|
145
|
+
amount: '1.5 BTC',
|
|
146
|
+
address: {
|
|
147
|
+
coin: 'btc'
|
|
148
|
+
},
|
|
149
|
+
urlForTx: 'https://explorer.bitpay.com/tx/1234567890abcdef'
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
case 'new_incoming_tx_testnet': {
|
|
153
|
+
const title = commonData.title;
|
|
154
|
+
return {
|
|
155
|
+
...commonData,
|
|
156
|
+
title: title || 'New Payment Received',
|
|
157
|
+
txid: '1234567890abcdef',
|
|
158
|
+
amount: '1.5 BTC',
|
|
159
|
+
address: {
|
|
160
|
+
coin: 'btc'
|
|
161
|
+
},
|
|
162
|
+
networkStr: ' en TESTNET',
|
|
163
|
+
urlForTx: 'https://explorer.bitpay.com/tx/1234567890abcdef'
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
case 'new_zero_outgoing_tx': {
|
|
167
|
+
const title = commonData.title;
|
|
168
|
+
return {
|
|
169
|
+
...commonData,
|
|
170
|
+
title: title || 'Payment Sent',
|
|
171
|
+
txid: '1234567890abcdef',
|
|
172
|
+
urlForTx: 'https://explorer.bitpay.com/tx/1234567890abcdef'
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
case 'txp_finally_rejected': {
|
|
176
|
+
const title = commonData.title;
|
|
177
|
+
return {
|
|
178
|
+
...commonData,
|
|
179
|
+
title: title || 'Payment Proposal Rejected',
|
|
180
|
+
txProposalId: 'txp-123',
|
|
181
|
+
rejectorsNames: 'Jane Smith, Bob Johnson'
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
case 'tx_confirmation': {
|
|
185
|
+
const title = commonData.title;
|
|
186
|
+
return {
|
|
187
|
+
...commonData,
|
|
188
|
+
title: title || 'Transaction Confirmed',
|
|
189
|
+
txid: '1234567890abcdef',
|
|
190
|
+
amount: '1.5 BTC',
|
|
191
|
+
urlForTx: 'https://explorer.bitpay.com/tx/1234567890abcdef'
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
case 'tx_confirmation_receiver': {
|
|
195
|
+
const title = commonData.title;
|
|
196
|
+
return {
|
|
197
|
+
...commonData,
|
|
198
|
+
title: title || 'Transaction Confirmed',
|
|
199
|
+
txid: '1234567890abcdef',
|
|
200
|
+
amount: '1.5 BTC',
|
|
201
|
+
urlForTx: 'https://explorer.bitpay.com/tx/1234567890abcdef'
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
case 'tx_confirmation_sender': {
|
|
205
|
+
const title = commonData.title;
|
|
206
|
+
return {
|
|
207
|
+
...commonData,
|
|
208
|
+
title: title || 'Transaction Confirmed',
|
|
209
|
+
txid: '1234567890abcdef',
|
|
210
|
+
amount: '1.5 BTC',
|
|
211
|
+
urlForTx: 'https://explorer.bitpay.com/tx/1234567890abcdef'
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
default:
|
|
215
|
+
return commonData;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const masterTemplate = fs.readFileSync(MASTER_TEMPLATE_PATH, 'utf8');
|
|
220
|
+
|
|
221
|
+
function createBasicHtmlFromPlain(templateName) {
|
|
222
|
+
const plainTextPath = path.join(TEMPLATE_DIR, language, `${templateName}.plain`);
|
|
223
|
+
let plainContent = '';
|
|
224
|
+
|
|
225
|
+
try {
|
|
226
|
+
plainContent = fs.readFileSync(plainTextPath, 'utf8')
|
|
227
|
+
.split('\n')
|
|
228
|
+
.slice(2) // Skip the subject line and empty line
|
|
229
|
+
.join('\n')
|
|
230
|
+
.trim();
|
|
231
|
+
} catch {
|
|
232
|
+
plainContent = `This is a sample email template for ${templateName}`;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return `
|
|
236
|
+
<h1 class="mb-2">{{title}}</h1>
|
|
237
|
+
<div class="divider"></div>
|
|
238
|
+
<div class="text-16">
|
|
239
|
+
${plainContent}
|
|
240
|
+
</div>
|
|
241
|
+
`;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Save HTML to temp file and open in browser
|
|
245
|
+
const previewInBrowser = (html) => {
|
|
246
|
+
const tempDir = os.tmpdir();
|
|
247
|
+
const previewDir = path.join(tempDir, `bitcore-email-preview-${Date.now()}`);
|
|
248
|
+
const tempFilePath = path.join(previewDir, 'index.html');
|
|
249
|
+
|
|
250
|
+
fs.mkdirSync(previewDir);
|
|
251
|
+
fs.writeFileSync(tempFilePath, html, 'utf8');
|
|
252
|
+
console.log(`Opening preview in browser: ${tempFilePath}`);
|
|
253
|
+
|
|
254
|
+
const platform = process.platform;
|
|
255
|
+
try {
|
|
256
|
+
if (platform === 'darwin') { // macOS
|
|
257
|
+
exec(`open "${tempFilePath}"`);
|
|
258
|
+
} else if (platform === 'win32') { // Windows
|
|
259
|
+
exec(`start "" "${tempFilePath}"`);
|
|
260
|
+
} else { // Linux and others
|
|
261
|
+
exec(`xdg-open "${tempFilePath}"`);
|
|
262
|
+
}
|
|
263
|
+
console.log('Preview opened in your default browser');
|
|
264
|
+
} catch (err) {
|
|
265
|
+
console.error('Failed to open browser automatically:', err);
|
|
266
|
+
console.log('Please open the HTML file manually at:', tempFilePath);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return tempFilePath;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// Send actual email
|
|
273
|
+
const sendTestEmail = async (subject, plainBody, htmlBody, recipient) => {
|
|
274
|
+
const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY;
|
|
275
|
+
if (!SENDGRID_API_KEY) {
|
|
276
|
+
console.error('Error: SENDGRID_API_KEY environment variable is required to send emails');
|
|
277
|
+
process.exit(1);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
sgMail.setApiKey(SENDGRID_API_KEY);
|
|
281
|
+
|
|
282
|
+
const msg = {
|
|
283
|
+
to: recipient,
|
|
284
|
+
from: process.env.FROM_EMAIL || 'noreply@example.com',
|
|
285
|
+
subject: subject,
|
|
286
|
+
text: plainBody,
|
|
287
|
+
html: htmlBody
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
try {
|
|
291
|
+
await sgMail.send(msg);
|
|
292
|
+
console.log(`Email successfully sent to ${recipient}`);
|
|
293
|
+
} catch (error) {
|
|
294
|
+
console.error('Error sending email:', error);
|
|
295
|
+
if (error.response) {
|
|
296
|
+
console.error(error.response.body);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// Main function
|
|
302
|
+
const previewTemplate = async () => {
|
|
303
|
+
console.log(`Testing template: ${templateName} (${language})`);
|
|
304
|
+
|
|
305
|
+
// Create sample data
|
|
306
|
+
const data = createSampleData(templateName);
|
|
307
|
+
|
|
308
|
+
// Read template
|
|
309
|
+
const contentTemplate = fs.existsSync(CONTENT_TEMPLATE_PATH)
|
|
310
|
+
? fs.readFileSync(CONTENT_TEMPLATE_PATH, 'utf8')
|
|
311
|
+
: createBasicHtmlFromPlain(templateName);
|
|
312
|
+
|
|
313
|
+
// Replace content placeholder with actual content
|
|
314
|
+
const html = masterTemplate.replace('{{> htmlContent}}', contentTemplate);
|
|
315
|
+
|
|
316
|
+
// Render final HTML with data
|
|
317
|
+
const renderedHtml = Mustache.render(html, data);
|
|
318
|
+
|
|
319
|
+
// Inline CSS for both preview and email
|
|
320
|
+
const inlinedHtml = juice(renderedHtml, {
|
|
321
|
+
removeStyleTags: false,
|
|
322
|
+
preserveImportant: true,
|
|
323
|
+
preserveMediaQueries: true,
|
|
324
|
+
preserveFontFaces: true,
|
|
325
|
+
applyStyleTags: true
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// Display subject
|
|
329
|
+
console.log('\nSubject:', data.title);
|
|
330
|
+
|
|
331
|
+
// Preview HTML in browser
|
|
332
|
+
if (inlinedHtml) {
|
|
333
|
+
const tempFilePath = previewInBrowser(inlinedHtml);
|
|
334
|
+
console.log('HTML preview saved to:', tempFilePath);
|
|
335
|
+
} else {
|
|
336
|
+
console.error('Failed to generate HTML preview');
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Send actual email if requested
|
|
340
|
+
if (sendEmail) {
|
|
341
|
+
console.log(`\nSending test email to ${recipientEmail}...`);
|
|
342
|
+
|
|
343
|
+
// Generate plain text version
|
|
344
|
+
const plainText = `${data.title}\n\nA new copayer just joined your wallet.`;
|
|
345
|
+
|
|
346
|
+
await sendTestEmail(
|
|
347
|
+
data.title,
|
|
348
|
+
plainText,
|
|
349
|
+
inlinedHtml,
|
|
350
|
+
recipientEmail
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
// Run the preview
|
|
356
|
+
previewTemplate().catch(err => {
|
|
357
|
+
console.error('Error:', err);
|
|
358
|
+
process.exit(1);
|
|
359
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import readline from 'readline';
|
|
4
|
+
import { Storage } from '../../ts_build/src';
|
|
5
|
+
import config from '../../ts_build/src/config';
|
|
6
|
+
|
|
7
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
let stop = false;
|
|
11
|
+
process.on('SIGINT', () => {
|
|
12
|
+
stop = true;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function usage(errMsg) {
|
|
16
|
+
console.log('USAGE: ./purgeNotifications.js <options>');
|
|
17
|
+
console.log();
|
|
18
|
+
console.log('OPTIONS:');
|
|
19
|
+
console.log(' --walletId <value> WalletId to purge notifications for. Often this is in the format `<chain>:<network>`');
|
|
20
|
+
console.log(' --batchSize [value] How many docs to delete at once. Default: 1000');
|
|
21
|
+
console.log(' --doit Save the migration to the db');
|
|
22
|
+
if (errMsg) {
|
|
23
|
+
console.log();
|
|
24
|
+
console.log('\nERROR: ' + errMsg);
|
|
25
|
+
}
|
|
26
|
+
process.exit();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const args = process.argv.slice(2);
|
|
30
|
+
|
|
31
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
32
|
+
usage();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const walletIdIdx = args.indexOf('--walletId');
|
|
36
|
+
const batchSizeIdx = args.indexOf('--batchSize');
|
|
37
|
+
const walletId = args[walletIdIdx + 1];
|
|
38
|
+
const batchSize = batchSizeIdx > -1 ? parseInt(args[batchSizeIdx + 1]) : 1000;
|
|
39
|
+
const doit = args.includes('--doit');
|
|
40
|
+
|
|
41
|
+
if (walletIdIdx === -1 || !walletId) {
|
|
42
|
+
usage('Missing required --walletId');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (batchSizeIdx > -1 && isNaN(batchSize)) {
|
|
46
|
+
usage('Invalid batch size');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!doit) {
|
|
50
|
+
console.log('Dry run (pass --doit to actually do it)');
|
|
51
|
+
} else {
|
|
52
|
+
console.log('LET\'S DO IT FOR REAL');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const storage = new Storage();
|
|
56
|
+
storage.connect(config.storageOpts, async (err) => {
|
|
57
|
+
if (err) {
|
|
58
|
+
console.log(err);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function done(err) {
|
|
63
|
+
if (err) { console.log(err); }
|
|
64
|
+
rl.close();
|
|
65
|
+
storage.disconnect(() => { console.log('done'); });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
// Get all notifications
|
|
70
|
+
const notiCnt = await storage.db.collection(Storage.collections.NOTIFICATIONS).count({ walletId });
|
|
71
|
+
|
|
72
|
+
console.log(`Found ${Intl.NumberFormat().format(notiCnt)} total notifications for ${walletId} to delete`);
|
|
73
|
+
const ans = await new Promise(r => rl.question(`Would you like to continue ${doit ? 'FOR REAL' : 'a dry run'}? (y/N): `, r));
|
|
74
|
+
if (ans?.toLowerCase() !== 'y') {
|
|
75
|
+
return done('Good bye.');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let count = 0;
|
|
79
|
+
let notifications = [];
|
|
80
|
+
const getNextPage = async () => storage.db.collection(Storage.collections.NOTIFICATIONS).find({ walletId }).skip(doit ? 0 : count).limit(batchSize).toArray();
|
|
81
|
+
while ((notifications = await getNextPage()).length > 0 && !stop) {
|
|
82
|
+
if (count % (batchSize * 10) === 0) {
|
|
83
|
+
process.stdout.write(`Purged ${(count / notiCnt * 100).toFixed(4)}% notifications (${count})\r`); // shows how fast things are working
|
|
84
|
+
await new Promise(resolve => setTimeout(resolve, 250)); // cooldown
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const query = { _id: { $in: notifications.map(n => n._id) } };
|
|
88
|
+
|
|
89
|
+
if (doit) {
|
|
90
|
+
const res = await storage.db.collection(Storage.collections.NOTIFICATIONS).deleteMany(query);
|
|
91
|
+
count += res.deletedCount;
|
|
92
|
+
} else {
|
|
93
|
+
// Update Wallets collection
|
|
94
|
+
const notificationCount = await storage.db.collection(Storage.collections.NOTIFICATIONS).countDocuments(query);
|
|
95
|
+
count += notificationCount;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
process.stdout.write('\n');
|
|
99
|
+
|
|
100
|
+
console.log(`\u2713 Purged ${Intl.NumberFormat().format(count)} notifications`);
|
|
101
|
+
if (stop) console.log('Stopped prematurely by user');
|
|
102
|
+
|
|
103
|
+
return done();
|
|
104
|
+
} catch (err) {
|
|
105
|
+
return done(err);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// json support
|
|
2
|
+
db.addresses.update({"beRegistered":true}, {'$set':{ "beRegistered":null} }, {multi:true});
|
|
3
|
+
db.wallets.update({"beRegistered":true}, {'$set':{ "beRegistered":null} }, {multi:true});
|
|
4
|
+
db.wallets.update({}, {'$set':{ "beRegistered":null} }, {multi:true});
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
a='888a335d-e360-473d-8e3f-04e293607806';
|
|
8
|
+
db.addresses.update({"walletId":a, "beRegistered":true}, {'$set':{ "beRegistered":null} }, {multi:true});
|
|
9
|
+
db.wallets.update({'id':'888a335d-e360-473d-8e3f-04e293607806'}, {'$set':{ "beRegistered":null} });
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// migration
|
|
13
|
+
|
|
14
|
+
a='';
|
|
15
|
+
db.addresses.find({"walletId":a}).sort({"_id":-1});
|
|
16
|
+
db.addresses.update({"walletId":a, "beRegistered":true}, {'$set':{ "beRegistered":null} }, {multi:true});
|
|
17
|
+
|
|
18
|
+
db.wallets.update({'id':a},{ $set: {"nativeCashAddr":false,"beRegistered":false}});
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { BitcoreLib } from '@bitpay-labs/crypto-wallet-core';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
import requestStream from 'request';
|
|
6
|
+
import { Client } from '../src/lib//blockchainexplorers/v8/client';
|
|
7
|
+
|
|
8
|
+
const coin = process.argv[2];
|
|
9
|
+
|
|
10
|
+
if (!coin) {
|
|
11
|
+
console.log(' Usage: coin authKey (extra: tokenAddress= )');
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const network = 'mainnet';
|
|
16
|
+
const authKey = process.argv[3];
|
|
17
|
+
const extra = process.argv[4] || '';
|
|
18
|
+
// tokenAddress=$
|
|
19
|
+
|
|
20
|
+
console.log('COIN:', coin);
|
|
21
|
+
if (!authKey) throw new Error('provide authKey');
|
|
22
|
+
|
|
23
|
+
// ====================
|
|
24
|
+
//
|
|
25
|
+
const authKeyObj = BitcoreLib.PrivateKey(authKey);
|
|
26
|
+
|
|
27
|
+
const tmp = authKeyObj.toObject();
|
|
28
|
+
tmp.compressed = false;
|
|
29
|
+
const pubKey = BitcoreLib.PrivateKey(tmp).toPublicKey();
|
|
30
|
+
|
|
31
|
+
const BASE = {
|
|
32
|
+
BTC: `https://api.bitcore.io/api/${coin}/${network}`,
|
|
33
|
+
BCH: `https://api.bitcore.io/api/${coin}/${network}`,
|
|
34
|
+
ETH: `https://api-eth.bitcore.io/api/${coin}/${network}`,
|
|
35
|
+
MATIC: `https://api-matic.bitcore.io/api/${coin}/${network}`,
|
|
36
|
+
ARB: `https://api-eth.bitcore.io/api/ARB/${network}`,
|
|
37
|
+
BASE: `https://api-eth.bitcore.io/api/BASE/${network}`,
|
|
38
|
+
OP: `https://api-eth.bitcore.io/api/OP/${network}`,
|
|
39
|
+
XRP: `https://api-xrp.bitcore.io/api/${coin}/${network}`,
|
|
40
|
+
DOGE: `https://api.bitcore.io/api/${coin}/${network}`,
|
|
41
|
+
LTC: `https://api.bitcore.io/api/${coin}/${network}`
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const baseUrl = BASE[coin];
|
|
45
|
+
|
|
46
|
+
const client = new Client({
|
|
47
|
+
baseUrl,
|
|
48
|
+
authKey: authKeyObj
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// utxos
|
|
52
|
+
// addresses
|
|
53
|
+
|
|
54
|
+
// const url = `${baseUrl}/wallet/${pubKey}/${path}`;
|
|
55
|
+
let url = `${baseUrl}/wallet/${pubKey}/transactions?startBlock=0&includeMempool=true`;
|
|
56
|
+
if (extra) {
|
|
57
|
+
url = url + '&' + extra;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.log('[v8tool.37:url:]', url);
|
|
61
|
+
const signature = client.sign({ method: 'GET', url });
|
|
62
|
+
let acum = '';
|
|
63
|
+
|
|
64
|
+
const r = requestStream.get(url, {
|
|
65
|
+
headers: { 'x-signature': signature },
|
|
66
|
+
json: true
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
r.on('data', raw => {
|
|
70
|
+
acum = acum + raw.toString();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
r.on('end', () => {
|
|
74
|
+
const txs = [],
|
|
75
|
+
unconf = [];
|
|
76
|
+
_.each(acum.split(/\r?\n/), rawTx => {
|
|
77
|
+
if (!rawTx) return;
|
|
78
|
+
|
|
79
|
+
let tx;
|
|
80
|
+
try {
|
|
81
|
+
tx = JSON.parse(rawTx);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
console.log('v8 error at JSON.parse:' + e + ' Parsing:' + rawTx + ':');
|
|
84
|
+
}
|
|
85
|
+
// v8 field name differences
|
|
86
|
+
if (tx.value) tx.amount = tx.satoshis / 1e8;
|
|
87
|
+
if (tx.abiType) tx.abiType = JSON.stringify(tx.abiType);
|
|
88
|
+
|
|
89
|
+
if (tx.height >= 0) txs.push(tx);
|
|
90
|
+
else unconf.push(tx);
|
|
91
|
+
});
|
|
92
|
+
console.log('txs', _.flatten(_.orderBy(unconf, 'blockTime', 'desc').concat(txs.reverse())));
|
|
93
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { BitcoreLib } from '@bitpay-labs/crypto-wallet-core';
|
|
4
|
+
import request from 'request';
|
|
5
|
+
import { Client } from '../src/lib//blockchainexplorers/v8/client';
|
|
6
|
+
|
|
7
|
+
const coin = process.argv[2];
|
|
8
|
+
|
|
9
|
+
if (!coin) {
|
|
10
|
+
console.log(' Usage: coin authKey (extra: tokenAddress= )');
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const network = 'mainnet';
|
|
15
|
+
const authKey = process.argv[3];
|
|
16
|
+
const path = process.argv[4] || 'addresses';
|
|
17
|
+
const extra = process.argv[5] || '';
|
|
18
|
+
// tokenAddress=$
|
|
19
|
+
console.log('COIN:', coin);
|
|
20
|
+
|
|
21
|
+
if (!authKey) throw new Error('provide authKey');
|
|
22
|
+
|
|
23
|
+
// ====================
|
|
24
|
+
//
|
|
25
|
+
const authKeyObj = BitcoreLib.PrivateKey(authKey);
|
|
26
|
+
|
|
27
|
+
const tmp = authKeyObj.toObject();
|
|
28
|
+
tmp.compressed = false;
|
|
29
|
+
const pubKey = BitcoreLib.PrivateKey(tmp).toPublicKey();
|
|
30
|
+
|
|
31
|
+
const BASE = {
|
|
32
|
+
BTC: `https://api.bitcore.io/api/${coin}/${network}`,
|
|
33
|
+
BCH: `https://api.bitcore.io/api/${coin}/${network}`,
|
|
34
|
+
ETH: `https://api-eth.bitcore.io/api/${coin}/${network}`,
|
|
35
|
+
MATIC: `https://api-matic.bitcore.io/api/${coin}/${network}`,
|
|
36
|
+
ARB: `https://api-eth.bitcore.io/api/ARB/${network}`,
|
|
37
|
+
BASE: `https://api-eth.bitcore.io/api/BASE/${network}`,
|
|
38
|
+
OP: `https://api-eth.bitcore.io/api/OP/${network}`,
|
|
39
|
+
XRP: `https://api-xrp.bitcore.io/api/${coin}/${network}`,
|
|
40
|
+
DOGE: `https://api.bitcore.io/api/${coin}/${network}`,
|
|
41
|
+
LTC: `https://api.bitcore.io/api/${coin}/${network}`
|
|
42
|
+
};
|
|
43
|
+
const baseUrl = BASE[coin];
|
|
44
|
+
console.log('[v8tool.ts.37:baseUrl:]', baseUrl); // TODO
|
|
45
|
+
|
|
46
|
+
const client = new Client({
|
|
47
|
+
baseUrl,
|
|
48
|
+
authKey: authKeyObj
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// utxos
|
|
52
|
+
// addresses
|
|
53
|
+
|
|
54
|
+
let url = `${baseUrl}/wallet/${pubKey}/${path}`;
|
|
55
|
+
if (extra) {
|
|
56
|
+
url = url + '?' + extra;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
console.log('[v8tool.ts.38:url:]', url); // TODO
|
|
60
|
+
console.log('[v8tool.37:url:]', url);
|
|
61
|
+
const signature = client.sign({ method: 'GET', url });
|
|
62
|
+
const payload = {};
|
|
63
|
+
|
|
64
|
+
request.get(
|
|
65
|
+
url,
|
|
66
|
+
{
|
|
67
|
+
headers: { 'x-signature': signature },
|
|
68
|
+
body: payload,
|
|
69
|
+
json: true
|
|
70
|
+
},
|
|
71
|
+
(err, req, body) => {
|
|
72
|
+
if (err) {
|
|
73
|
+
console.log('[v8tool.43:err:]', err);
|
|
74
|
+
} else {
|
|
75
|
+
try {
|
|
76
|
+
console.log('[v8tool.50:body:]', body);
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.log('[v8tool.52]', e, body);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|