@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,657 @@
|
|
|
1
|
+
import { Transactions, Utils, Validation, Web3 } from '@bitpay-labs/crypto-wallet-core';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import { IWallet } from 'src/lib/model';
|
|
4
|
+
import { IAddress } from 'src/lib/model/address';
|
|
5
|
+
import { WalletService } from 'src/lib/server';
|
|
6
|
+
import { IChain } from '../../../types/chain';
|
|
7
|
+
import { Common } from '../../common';
|
|
8
|
+
import { ClientError } from '../../errors/clienterror';
|
|
9
|
+
import { Errors } from '../../errors/errordefinitions';
|
|
10
|
+
import logger from '../../logger';
|
|
11
|
+
import { ERC20Abi } from './abi-erc20';
|
|
12
|
+
import { InvoiceAbi } from './abi-invoice';
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
Constants,
|
|
16
|
+
Defaults
|
|
17
|
+
} = Common;
|
|
18
|
+
|
|
19
|
+
function requireUncached(module) {
|
|
20
|
+
delete require.cache[require.resolve(module)];
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
22
|
+
return require(module);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Erc20Decoder = requireUncached('abi-decoder');
|
|
26
|
+
Erc20Decoder.addABI(ERC20Abi);
|
|
27
|
+
|
|
28
|
+
const InvoiceDecoder = requireUncached('abi-decoder');
|
|
29
|
+
InvoiceDecoder.addABI(InvoiceAbi);
|
|
30
|
+
function getInvoiceDecoder() {
|
|
31
|
+
return InvoiceDecoder;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class EthChain implements IChain {
|
|
35
|
+
|
|
36
|
+
chain: string;
|
|
37
|
+
|
|
38
|
+
constructor() {
|
|
39
|
+
this.chain = 'ETH';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts Bitcore Balance Response.
|
|
43
|
+
* @param {Object} bitcoreBalance - { unconfirmed, confirmed, balance }
|
|
44
|
+
* @param {Number} locked - Sum of txp.amount
|
|
45
|
+
* @returns {Object} balance - Total amount & locked amount.
|
|
46
|
+
*/
|
|
47
|
+
private convertBitcoreBalance(bitcoreBalance, locked) {
|
|
48
|
+
const { confirmed, balance } = bitcoreBalance;
|
|
49
|
+
// we ASUME all locked as confirmed, for ETH.
|
|
50
|
+
const convertedBalance = {
|
|
51
|
+
totalAmount: balance,
|
|
52
|
+
totalConfirmedAmount: confirmed,
|
|
53
|
+
lockedAmount: locked,
|
|
54
|
+
lockedConfirmedAmount: locked,
|
|
55
|
+
availableAmount: balance - locked,
|
|
56
|
+
availableConfirmedAmount: confirmed - locked,
|
|
57
|
+
byAddress: []
|
|
58
|
+
};
|
|
59
|
+
return convertedBalance;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
getSizeSafetyMargin() {
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
getInputSizeSafetyMargin() {
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
notifyConfirmations() {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
supportsMultisig() {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
supportsThresholdsig() {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
getWalletBalance(server, wallet, opts, cb) {
|
|
83
|
+
const bc = server._getBlockchainExplorer(wallet.chain || wallet.coin, wallet.network);
|
|
84
|
+
|
|
85
|
+
if (opts.tokenAddress) {
|
|
86
|
+
wallet.tokenAddress = opts.tokenAddress;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (opts.multisigContractAddress) {
|
|
90
|
+
wallet.multisigContractAddress = opts.multisigContractAddress;
|
|
91
|
+
opts.network = wallet.network;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
bc.getBalance(wallet, (err, balance) => {
|
|
95
|
+
if (err) {
|
|
96
|
+
return cb(err);
|
|
97
|
+
}
|
|
98
|
+
// getPendingTxs returns all txps when given a native currency
|
|
99
|
+
server.getPendingTxs(opts, (err, txps) => {
|
|
100
|
+
if (err) return cb(err);
|
|
101
|
+
let fees = 0;
|
|
102
|
+
let amounts = 0;
|
|
103
|
+
|
|
104
|
+
txps.filter(txp => {
|
|
105
|
+
// Add gas used for tokens when getting native balance
|
|
106
|
+
if (!opts.tokenAddress) {
|
|
107
|
+
fees += txp.fee || 0;
|
|
108
|
+
}
|
|
109
|
+
// Filter tokens when getting native balance
|
|
110
|
+
if (txp.tokenAddress && !opts.tokenAddress) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
amounts += txp.amount;
|
|
114
|
+
return true;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// TODO support big int
|
|
118
|
+
const lockedSum = (amounts + fees) || 0; // previously set to 0 if opts.multisigContractAddress
|
|
119
|
+
const convertedBalance = this.convertBitcoreBalance(balance, lockedSum);
|
|
120
|
+
server.storage.fetchAddresses(server.walletId, (err, addresses: IAddress[]) => {
|
|
121
|
+
if (err) return cb(err);
|
|
122
|
+
if (addresses.length > 0) {
|
|
123
|
+
const byAddress = [
|
|
124
|
+
{
|
|
125
|
+
address: addresses[0].address,
|
|
126
|
+
path: addresses[0].path,
|
|
127
|
+
amount: convertedBalance.totalAmount
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
convertedBalance.byAddress = byAddress;
|
|
131
|
+
}
|
|
132
|
+
return cb(null, convertedBalance);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
getWalletSendMaxInfo(server, wallet, opts, cb) {
|
|
139
|
+
server.getBalance({}, (err, balance) => {
|
|
140
|
+
if (err) return cb(err);
|
|
141
|
+
const { availableAmount } = balance;
|
|
142
|
+
const fee = opts.feePerKb * Defaults.MIN_GAS_LIMIT;
|
|
143
|
+
return cb(null, {
|
|
144
|
+
utxosBelowFee: 0,
|
|
145
|
+
amountBelowFee: 0,
|
|
146
|
+
amount: availableAmount - fee,
|
|
147
|
+
feePerKb: opts.feePerKb,
|
|
148
|
+
fee
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
getDustAmountValue() {
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
getTransactionCount(server, wallet, from) {
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
server._getTransactionCount(wallet, from, (err, nonce) => {
|
|
160
|
+
if (err) return reject(err);
|
|
161
|
+
return resolve(nonce);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
getChangeAddress() { }
|
|
167
|
+
|
|
168
|
+
checkDust(_output, _opts) { }
|
|
169
|
+
|
|
170
|
+
checkScriptOutput(_output) { }
|
|
171
|
+
|
|
172
|
+
getFee(server, wallet, opts) {
|
|
173
|
+
return new Promise(resolve => {
|
|
174
|
+
server._getFeePerKb(wallet, opts, async (err, inFeePerKb) => {
|
|
175
|
+
let feePerKb = inFeePerKb;
|
|
176
|
+
let gasPrice = inFeePerKb;
|
|
177
|
+
let maxGasFee;
|
|
178
|
+
let priorityGasFee;
|
|
179
|
+
const { from, txType, priorityFeePercentile, gasLimitBuffer } = opts;
|
|
180
|
+
const { coin, network, chain } = wallet;
|
|
181
|
+
let inGasLimit = 0; // Per recepient gas limit
|
|
182
|
+
let gasLimit = 0; // Gas limit for all recepients. used for contract interactions that rollup recepients
|
|
183
|
+
let fee = 0;
|
|
184
|
+
const defaultGasLimit = this.getDefaultGasLimit(opts);
|
|
185
|
+
const outputAddresses = []; // Parameter for MuliSend contract
|
|
186
|
+
const outputAmounts: bigint[] = []; // Parameter for MuliSend contract
|
|
187
|
+
let totalValue = 0n; // Parameter for MuliSend contract
|
|
188
|
+
logger.info(`getFee for address ${from} on network ${network} and chain ${chain}`);
|
|
189
|
+
logger.info('getFee.opts: %o', { from, txType, priorityFeePercentile, gasLimitBuffer });
|
|
190
|
+
logger.info(`[${from}] Add gas limit buffer?: ${!!gasLimitBuffer}`);
|
|
191
|
+
for (const output of opts.outputs) {
|
|
192
|
+
// Multisend txs build contract fn parameters (addresses, amounts) and bypass output level gas estimations
|
|
193
|
+
if (opts.multiSendContractAddress) {
|
|
194
|
+
outputAddresses.push(output.toAddress);
|
|
195
|
+
outputAmounts.push(BigInt(output.amount));
|
|
196
|
+
if (!opts.tokenAddress) {
|
|
197
|
+
totalValue += BigInt(output.amount);
|
|
198
|
+
}
|
|
199
|
+
// Used as a fallback value if estimateGas fails for multisend
|
|
200
|
+
inGasLimit += output.gasLimit ? output.gasLimit : defaultGasLimit;
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
// Estimate a standard transfer
|
|
204
|
+
if (!output.gasLimit) {
|
|
205
|
+
try {
|
|
206
|
+
const to = opts.payProUrl
|
|
207
|
+
? output.toAddress
|
|
208
|
+
: opts.tokenAddress
|
|
209
|
+
? opts.tokenAddress
|
|
210
|
+
: opts.multisigContractAddress
|
|
211
|
+
? opts.multisigContractAddress
|
|
212
|
+
: output.toAddress;
|
|
213
|
+
const value = opts.tokenAddress || opts.multisigContractAddress ? 0 : output.amount;
|
|
214
|
+
// output.gasLimit used as the gasLimit in getBitcoreTx for non multisend transactions
|
|
215
|
+
const gasLimitEstimate = await server.estimateGas({
|
|
216
|
+
coin,
|
|
217
|
+
chain: this.chain,
|
|
218
|
+
network,
|
|
219
|
+
from,
|
|
220
|
+
to,
|
|
221
|
+
value,
|
|
222
|
+
data: output.data,
|
|
223
|
+
gasPrice
|
|
224
|
+
});
|
|
225
|
+
output.gasLimit = gasLimitEstimate || defaultGasLimit;
|
|
226
|
+
} catch {
|
|
227
|
+
output.gasLimit = defaultGasLimit;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
inGasLimit += output.gasLimit;
|
|
231
|
+
logger.info(`[${from}][${output?.toAddress || opts?.tokenAddress}] Output level gas limit: ${output.gasLimit}`);
|
|
232
|
+
// Add gas Limit buffer to output level gasLimit
|
|
233
|
+
if (gasLimitBuffer) {
|
|
234
|
+
const gasBuffer = Math.ceil(output.gasLimit * (gasLimitBuffer / 100));
|
|
235
|
+
output.gasLimit += gasBuffer;
|
|
236
|
+
inGasLimit += gasBuffer;
|
|
237
|
+
logger.info(`[${from}][${output?.toAddress || opts?.tokenAddress}] Output gas limit with buffer: ${output.gasLimit}`);
|
|
238
|
+
}
|
|
239
|
+
if (_.isNumber(opts.fee)) {
|
|
240
|
+
// This is used for sendmax
|
|
241
|
+
gasPrice = feePerKb = Number((opts.fee / (inGasLimit || defaultGasLimit)).toFixed());
|
|
242
|
+
}
|
|
243
|
+
fee += feePerKb * output.gasLimit;
|
|
244
|
+
}
|
|
245
|
+
// gasLimit == sum of internal gasLimits (for non Multisend)
|
|
246
|
+
gasLimit = inGasLimit;
|
|
247
|
+
logger.info(`[${from}] Current top level gas limit: ${gasLimit}`);
|
|
248
|
+
if (opts.multiSendContractAddress) {
|
|
249
|
+
// Calculate gas limit for top level of txp based on multisend tx
|
|
250
|
+
let _gasLimit;
|
|
251
|
+
try {
|
|
252
|
+
const data = this.encodeContractParameters(
|
|
253
|
+
Constants.BITPAY_CONTRACTS.MULTISEND,
|
|
254
|
+
{ addresses: outputAddresses, amounts: outputAmounts },
|
|
255
|
+
opts
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
_gasLimit = await server.estimateGas({
|
|
259
|
+
coin,
|
|
260
|
+
chain: this.chain,
|
|
261
|
+
network,
|
|
262
|
+
from,
|
|
263
|
+
to: opts.multiSendContractAddress,
|
|
264
|
+
value: totalValue.toString(),
|
|
265
|
+
data,
|
|
266
|
+
gasPrice
|
|
267
|
+
});
|
|
268
|
+
logger.info(`[${from}] Estimated multisend gas limit: ${_gasLimit}`);
|
|
269
|
+
} catch (error) {
|
|
270
|
+
logger.error('Error estimating gas for MultiSend contract: %o', error);
|
|
271
|
+
}
|
|
272
|
+
// Add gas limit buffer to top level gas limit
|
|
273
|
+
const buffer = gasLimitBuffer ? gasLimitBuffer / 100 : Defaults.MS_GAS_LIMIT_BUFFER_PERCENT;
|
|
274
|
+
// If gas estimation fails, fallback to sum of internal gasLimits
|
|
275
|
+
gasLimit = _gasLimit || gasLimit;
|
|
276
|
+
gasLimit += Math.ceil(gasLimit * buffer); // add gas limit buffer
|
|
277
|
+
fee += feePerKb * gasLimit;
|
|
278
|
+
logger.info(`[${from}] Top level gas limit with buffer: ${gasLimit}`);
|
|
279
|
+
}
|
|
280
|
+
if (Number(txType) === 2) {
|
|
281
|
+
maxGasFee = await server.estimateFee({ network, chain: wallet.chain || coin, txType: 2 });
|
|
282
|
+
priorityGasFee = await server.estimatePriorityFee({ network, chain: wallet.chain || coin, percentile: priorityFeePercentile || 15 });
|
|
283
|
+
}
|
|
284
|
+
return resolve({ feePerKb, gasPrice, gasLimit, maxGasFee, priorityGasFee, fee });
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
getBitcoreTx(txp, opts = { signed: true }) {
|
|
290
|
+
const {
|
|
291
|
+
data,
|
|
292
|
+
outputs,
|
|
293
|
+
payProUrl,
|
|
294
|
+
tokenAddress,
|
|
295
|
+
multisigContractAddress,
|
|
296
|
+
multiSendContractAddress,
|
|
297
|
+
isTokenSwap,
|
|
298
|
+
multiTx
|
|
299
|
+
} = txp;
|
|
300
|
+
if (multiTx) {
|
|
301
|
+
throw Errors.MULTI_TX_UNSUPPORTED;
|
|
302
|
+
}
|
|
303
|
+
const isERC20 = tokenAddress && !payProUrl && !isTokenSwap;
|
|
304
|
+
const isETHMULTISIG = multisigContractAddress;
|
|
305
|
+
const chain = isETHMULTISIG ? `${this.chain}MULTISIG` : isERC20 ? `${this.chain}ERC20` : this.chain;
|
|
306
|
+
const recipients = outputs.map(output => {
|
|
307
|
+
return {
|
|
308
|
+
amount: output.amount,
|
|
309
|
+
address: output.toAddress,
|
|
310
|
+
data: output.data,
|
|
311
|
+
gasLimit: output.gasLimit
|
|
312
|
+
};
|
|
313
|
+
});
|
|
314
|
+
// Backwards compatibility BWC <= 8.9.0
|
|
315
|
+
if (data) {
|
|
316
|
+
recipients[0].data = data;
|
|
317
|
+
}
|
|
318
|
+
const unsignedTxs = [];
|
|
319
|
+
|
|
320
|
+
if (multiSendContractAddress) {
|
|
321
|
+
const multiSendParams = {
|
|
322
|
+
nonce: Number(txp.nonce),
|
|
323
|
+
recipients,
|
|
324
|
+
contractAddress: multiSendContractAddress
|
|
325
|
+
};
|
|
326
|
+
// Uses gas limit from the txp top level
|
|
327
|
+
unsignedTxs.push(Transactions.create({ ...txp, chain, ...multiSendParams }));
|
|
328
|
+
} else {
|
|
329
|
+
for (let index = 0; index < recipients.length; index++) {
|
|
330
|
+
// Uses gas limit from the txp output level
|
|
331
|
+
const params = {
|
|
332
|
+
...recipients[index],
|
|
333
|
+
nonce: Number(txp.nonce) + Number(index),
|
|
334
|
+
recipients: [recipients[index]]
|
|
335
|
+
};
|
|
336
|
+
unsignedTxs.push(Transactions.create({ ...txp, chain, ...params }));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const tx = {
|
|
341
|
+
uncheckedSerialize: () => unsignedTxs,
|
|
342
|
+
txid: () => txp.txid,
|
|
343
|
+
toObject: () => {
|
|
344
|
+
const ret = _.clone(txp);
|
|
345
|
+
ret.outputs[0].satoshis = ret.outputs[0].amount;
|
|
346
|
+
return ret;
|
|
347
|
+
},
|
|
348
|
+
getFee: () => {
|
|
349
|
+
return txp.fee;
|
|
350
|
+
},
|
|
351
|
+
getChangeOutput: () => null
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
if (opts.signed) {
|
|
355
|
+
const sigs = txp.getCurrentSignatures();
|
|
356
|
+
for (const x of sigs ) {
|
|
357
|
+
this.addSignaturesToBitcoreTx(tx, txp.inputs, txp.inputPaths, x.signatures, x.xpub);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return tx;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
getDefaultGasLimit(opts) {
|
|
365
|
+
let defaultGasLimit: number = opts.tokenAddress ? Defaults.DEFAULT_ERC20_GAS_LIMIT : Defaults.DEFAULT_GAS_LIMIT;
|
|
366
|
+
if (opts.multiSendContractAddress) {
|
|
367
|
+
defaultGasLimit = opts.tokenAddress
|
|
368
|
+
? Defaults.DEFAULT_MULTISEND_RECIPIENT_ERC20_GAS_LIMIT
|
|
369
|
+
: Defaults.DEFAULT_MULTISEND_RECIPIENT_GAS_LIMIT;
|
|
370
|
+
}
|
|
371
|
+
return defaultGasLimit;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
encodeContractParameters(contract, params, opts) {
|
|
375
|
+
if (contract === Constants.BITPAY_CONTRACTS.MULTISEND) {
|
|
376
|
+
const web3 = new Web3();
|
|
377
|
+
return {
|
|
378
|
+
addresses: web3.eth.abi.encodeParameter('address[]', params.addresses),
|
|
379
|
+
amounts: web3.eth.abi.encodeParameter('uint256[]', params.amounts),
|
|
380
|
+
method: opts.tokenAddress ? 'sendErc20' : 'sendEth',
|
|
381
|
+
tokenAddress: opts.tokenAddress,
|
|
382
|
+
type: Constants.BITPAY_CONTRACTS.MULTISEND
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
convertFeePerKb(p, feePerKb) {
|
|
388
|
+
return [p, feePerKb];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
checkTx(txp) {
|
|
392
|
+
try {
|
|
393
|
+
this.getBitcoreTx(txp);
|
|
394
|
+
} catch (ex) {
|
|
395
|
+
logger.debug('Error building Bitcore transaction: %o', ex);
|
|
396
|
+
return ex;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
checkTxUTXOs(server, txp, opts, cb) {
|
|
403
|
+
return cb();
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
selectTxInputs(server, txp, wallet, opts, cb) {
|
|
407
|
+
server.getBalance(
|
|
408
|
+
{ wallet, tokenAddress: opts.tokenAddress, multisigContractAddress: opts.multisigContractAddress },
|
|
409
|
+
(err, balance) => {
|
|
410
|
+
if (err) return cb(err);
|
|
411
|
+
|
|
412
|
+
const getInvoiceValue = txp => {
|
|
413
|
+
let totalAmount;
|
|
414
|
+
|
|
415
|
+
/* invoice outputs data example:
|
|
416
|
+
abiDecoder.decodeMethod(txp.outputs[0].data)
|
|
417
|
+
{ name: 'approve',
|
|
418
|
+
params:
|
|
419
|
+
[ { name: '_spender',
|
|
420
|
+
value: '0xc27ed3df0de776246cdad5a052a9982473fceab8',
|
|
421
|
+
type: 'address' },
|
|
422
|
+
{ name: '_value', value: '1380623310000000', type: 'uint256' } ] }
|
|
423
|
+
|
|
424
|
+
> abiDecoder.decodeMethod(txp.outputs[1].data)
|
|
425
|
+
{ name: 'pay',
|
|
426
|
+
params:
|
|
427
|
+
[ { name: 'value', value: '1000000', type: 'uint256' },
|
|
428
|
+
{ name: 'gasPrice', value: '40000000000', type: 'uint256' },
|
|
429
|
+
{ name: 'expiration', value: '1604123733282', type: 'uint256' },
|
|
430
|
+
... ] }
|
|
431
|
+
*/
|
|
432
|
+
|
|
433
|
+
for (const output of txp.outputs) {
|
|
434
|
+
// We use a custom contract call (pay) instead of the transfer ERC20 method
|
|
435
|
+
const decodedData = getInvoiceDecoder().decodeMethod(output.data);
|
|
436
|
+
if (decodedData && decodedData.name === 'pay') {
|
|
437
|
+
totalAmount = decodedData.params[0].value;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return totalAmount;
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
const { totalAmount, availableAmount } = balance;
|
|
444
|
+
|
|
445
|
+
/* If its paypro its an already created ERC20 transaction and we need to get the actual invoice value from the data
|
|
446
|
+
invoice outputs example:
|
|
447
|
+
"outputs":[{
|
|
448
|
+
"amount":0,
|
|
449
|
+
"toAddress":"0x44d69d16C711BF966E3d00A46f96e02D16BDdf1f",
|
|
450
|
+
"message":null,
|
|
451
|
+
"data":"...",
|
|
452
|
+
"gasLimit":29041
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"amount":0,
|
|
456
|
+
"toAddress":"0xc27eD3DF0DE776246cdAD5a052A9982473FceaB8",
|
|
457
|
+
"message":null,
|
|
458
|
+
"data":"...",
|
|
459
|
+
"gasLimit":200000
|
|
460
|
+
}]
|
|
461
|
+
*/
|
|
462
|
+
const txpTotalAmount =
|
|
463
|
+
(opts.multisigContractAddress || opts.tokenAddress) && txp.payProUrl
|
|
464
|
+
? getInvoiceValue(txp)
|
|
465
|
+
: txp.getTotalAmount();
|
|
466
|
+
|
|
467
|
+
if (totalAmount < txpTotalAmount) {
|
|
468
|
+
return cb(Errors.INSUFFICIENT_FUNDS);
|
|
469
|
+
} else if (availableAmount < txpTotalAmount) {
|
|
470
|
+
return cb(Errors.LOCKED_FUNDS);
|
|
471
|
+
} else {
|
|
472
|
+
if (opts.tokenAddress || opts.multisigContractAddress) {
|
|
473
|
+
// ETH linked wallet balance
|
|
474
|
+
server.getBalance({}, (err, ethBalance) => {
|
|
475
|
+
if (err) return cb(err);
|
|
476
|
+
const { totalAmount, availableAmount } = ethBalance;
|
|
477
|
+
if (totalAmount < txp.fee) {
|
|
478
|
+
return cb(this.getInsufficientFeeError(txp));
|
|
479
|
+
} else if (availableAmount < txp.fee) {
|
|
480
|
+
return cb(this.getLockedFeeError(txp));
|
|
481
|
+
} else {
|
|
482
|
+
return cb(this.checkTx(txp));
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
} else if (availableAmount - txp.fee < txpTotalAmount) {
|
|
486
|
+
return cb(
|
|
487
|
+
new ClientError(
|
|
488
|
+
Errors.codes.INSUFFICIENT_FUNDS_FOR_FEE,
|
|
489
|
+
`${Errors.INSUFFICIENT_FUNDS_FOR_FEE.message}. RequiredFee: ${txp.fee}`,
|
|
490
|
+
{
|
|
491
|
+
requiredFee: txp.fee
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
);
|
|
495
|
+
} else {
|
|
496
|
+
return cb(this.checkTx(txp));
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
getInsufficientFeeError(txp) {
|
|
504
|
+
return new ClientError(
|
|
505
|
+
Errors.codes[`INSUFFICIENT_${this.chain}_FEE`],
|
|
506
|
+
`${Errors[`INSUFFICIENT_${this.chain}_FEE`].message}. RequiredFee: ${txp.fee}`,
|
|
507
|
+
{
|
|
508
|
+
requiredFee: txp.fee
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
getLockedFeeError(txp) {
|
|
514
|
+
return new ClientError(
|
|
515
|
+
Errors.codes[`LOCKED_${this.chain}_FEE`],
|
|
516
|
+
`${Errors[`LOCKED_${this.chain}_FEE`].message}. RequiredFee: ${txp.fee}`,
|
|
517
|
+
{
|
|
518
|
+
requiredFee: txp.fee
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
checkUtxos(_opts) { }
|
|
524
|
+
|
|
525
|
+
checkValidTxAmount(output): boolean {
|
|
526
|
+
try {
|
|
527
|
+
if (
|
|
528
|
+
output.amount == null ||
|
|
529
|
+
output.amount < 0 ||
|
|
530
|
+
isNaN(output.amount) ||
|
|
531
|
+
Utils.toHex(output.amount) !== '0x' + BigInt(output.amount).toString(16)
|
|
532
|
+
) {
|
|
533
|
+
throw new Error('output.amount is not a valid value: ' + output.amount);
|
|
534
|
+
}
|
|
535
|
+
return true;
|
|
536
|
+
} catch (err) {
|
|
537
|
+
logger.warn(`Invalid output amount (${output.amount}) in checkValidTxAmount: %o`, err);
|
|
538
|
+
return false;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
isUTXOChain() {
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
isSingleAddress() {
|
|
546
|
+
return true;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
addressFromStorageTransform(network, address): void {
|
|
550
|
+
if (network != 'livenet') {
|
|
551
|
+
const x = address.address.indexOf(':');
|
|
552
|
+
if (x >= 0) {
|
|
553
|
+
address.address = address.address.substr(0, x);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
addressToStorageTransform(network, address): void {
|
|
559
|
+
if (network != 'livenet') address.address += ':' + network;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
addSignaturesToBitcoreTx(tx, _inputs, _inputPaths, signatures, _xpub) {
|
|
563
|
+
if (signatures.length === 0) {
|
|
564
|
+
throw new Error('Signatures Required');
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const unsignedTxs = tx.uncheckedSerialize();
|
|
568
|
+
const signedTxs = [];
|
|
569
|
+
for (let index = 0; index < signatures.length; index++) {
|
|
570
|
+
const signed = Transactions.applySignature({
|
|
571
|
+
chain: this.chain, // TODO use lowercase always to avoid confusion
|
|
572
|
+
tx: unsignedTxs[index],
|
|
573
|
+
signature: signatures[index]
|
|
574
|
+
});
|
|
575
|
+
signedTxs.push(signed);
|
|
576
|
+
|
|
577
|
+
// bitcore users id for txid...
|
|
578
|
+
tx.id = Transactions.getHash({ tx: signed, chain: this.chain });
|
|
579
|
+
}
|
|
580
|
+
tx.uncheckedSerialize = () => signedTxs;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
validateAddress(wallet, inaddr, opts) {
|
|
584
|
+
const chain = this.chain.toLowerCase();
|
|
585
|
+
const isValidTo = Validation.validateAddress(chain, wallet.network, inaddr);
|
|
586
|
+
if (!isValidTo) {
|
|
587
|
+
throw Errors.INVALID_ADDRESS;
|
|
588
|
+
}
|
|
589
|
+
const isValidFrom = Validation.validateAddress(chain, wallet.network, opts.from);
|
|
590
|
+
if (!isValidFrom) {
|
|
591
|
+
throw Errors.INVALID_ADDRESS;
|
|
592
|
+
}
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
onCoin(_coin) {
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
onTx(tx) {
|
|
601
|
+
// TODO: Multisig ERC20 - Internal txs ¿?
|
|
602
|
+
let tokenAddress;
|
|
603
|
+
let multisigContractAddress;
|
|
604
|
+
let address;
|
|
605
|
+
let amount;
|
|
606
|
+
// Only returns single notification so determine most precise
|
|
607
|
+
if (tx.effects && tx.effects.length) {
|
|
608
|
+
const multisigConfirm = tx.effects.findIndex(e => e.type === 'MULTISIG:confirmTransaction');
|
|
609
|
+
const multisigSubmit = tx.effects.findIndex(e => e.type === 'MULTISIG:submitTransaction');
|
|
610
|
+
const erc20Transfer = tx.effects.findIndex(e => e.type === 'ERC20:transer');
|
|
611
|
+
const internalTransfer = tx.effects.findIndex(e => !e.type && !e.contractAddress);
|
|
612
|
+
|
|
613
|
+
const exists = [multisigConfirm, multisigSubmit, erc20Transfer, internalTransfer].filter(i => i > -1);
|
|
614
|
+
|
|
615
|
+
if (exists.length) {
|
|
616
|
+
// Get the first effect based on priority as determined by order in above array
|
|
617
|
+
const best = tx.effects[exists[0]];
|
|
618
|
+
if (best.type == 'MULTISIG:confirmTransaction' || best.type == 'MULTISIG:submitTransaction') {
|
|
619
|
+
multisigContractAddress = best.contractAddress;
|
|
620
|
+
address = best.to;
|
|
621
|
+
amount = best.amount;
|
|
622
|
+
} else if (best.type == 'ERC20:transfer') {
|
|
623
|
+
tokenAddress = best.contractAddress;
|
|
624
|
+
address = best.to;
|
|
625
|
+
amount = best.amount;
|
|
626
|
+
} else {
|
|
627
|
+
address = best.to;
|
|
628
|
+
amount = best.amount;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// If we haven't defined address by this point then it must be native transfer
|
|
634
|
+
if (!address) {
|
|
635
|
+
address = tx.to;
|
|
636
|
+
amount = tx.value;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return {
|
|
640
|
+
txid: tx.txid,
|
|
641
|
+
out: {
|
|
642
|
+
address,
|
|
643
|
+
amount,
|
|
644
|
+
tokenAddress,
|
|
645
|
+
multisigContractAddress
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
getReserve(server: WalletService, wallet: IWallet, cb: (err?, reserve?: number) => void) {
|
|
651
|
+
return cb(null, 0);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
refreshTxData(_server: WalletService, txp, _opts, cb) {
|
|
655
|
+
return cb(null, txp);
|
|
656
|
+
}
|
|
657
|
+
}
|