diff --git a/docs/ADD_BLOCKCHAIN.md b/docs/ADD_BLOCKCHAIN.md index d5939a83be..8016082a4b 100644 --- a/docs/ADD_BLOCKCHAIN.md +++ b/docs/ADD_BLOCKCHAIN.md @@ -2,14 +2,14 @@ The Atomic Swap is a complex operation which consists of multiple software/hardware elements controlled from different world regions. E.g, here is just a couple of the systems (elements): -- Multiple public nodes. -- libp2p messaging system. -- Two blockchains. -- Smart contracts written on different languages with different processing features. -- Public explorers. -- External monitoring services (e.g. mining fee calculator). -- User's browser as the swap logic executioner (not only frontend but the entire dApp). -- The user as his or her actions affect the swap. +- Multiple public nodes +- libp2p messaging system +- Two blockchains +- Smart contracts written on different languages with different processing features +- Public explorers +- External monitoring services (e.g. mining fee calculator) +- User's browser as the swap logic executioner (not only frontend but the entire dApp) +- The user as his or her actions affect the swap Mining fee. How much is the fee and which fee is optimal? How this fee will be calculated? How much cryptocurrency will be spend in both blockchains and who will pay this amount of crypto? Which sum will be final for the maker to send and for the taker to get? @@ -21,7 +21,7 @@ The Atomic Swap is a complex operation which consists of multiple software/hardw We elolve. We update our system timely and the blockchains' interoperability management takes time. -## How much? +## How much? For successful connection need 2 people: 1 senior React JS developer (you or your) and one tech Lead (from us).
@@ -30,7 +30,7 @@ A new senior JS developer, without blockchain skills, connect takes 2-3 month fo - Research of our app arhitecture - Do Plan A (see below) -COSTS: +COSTS: - 1 senior React JS developer ~ 2500 x 3 month ~ 7500 USD - swaponline team consultation, review - stake 5 000 SWAP @@ -63,94 +63,94 @@ COSTS: ### Add explorer api -- `config/mainnet/api.js` -- `config/testnet/api.js` +- `src/front/config/mainnet/api.js` +- `src/front/config/testnet/api.js` ### Add explorer link -- `config/mainnet/link.js` -- `config/testnet/api.js` +- `src/front/config/mainnet/link.js` +- `src/front/config/testnet/api.js` ### Set configs -- `/externalConfigs/swaponline.github.io` -- `/externalConfigs/mainnet-localhost.js` -- `/externalConfigs/testnet-default.js` -- `/shared/helpers/externalConfig.js` +- `src/front/externalConfigs/swaponline.github.io` +- `src/front/externalConfigs/mainnet-localhost.js` +- `src/front/externalConfigs/testnet-default.js` +- `src/front/shared/helpers/externalConfig.js` ### Add coin on -- `config/testnet/hiddenCoins.js` -- `shared/components/Coin/Coin.js` -- `shared/components/modals/HowToExportModal/HowToExportModal.js` -- `shared/components/modals/WithdrawModal/WithdrawModal.js` -- `shared/helpers/getCurrencyKey.js` -- `shared/helpers/user.js` -- `shared/pages/CreateWallet/CreateWallet.js` -- `shared/pages/CreateWallet/CreateWallet.scss` -- `shared/pages/CreateWallet/Steps/FirstStep.js` -- `shared/pages/CreateWallet/Steps/SecondStep.js` -- `shared/pages/Currency/Currency.js` -- `shared/pages/Wallet/Wallet.js` -- `shared/redux/reducers/createWallet.js` -- `shared/redux/reducers/currencies.js` +- `src/front/config/testnet/hiddenCoins.js` +- `src/front/shared/components/Coin/Coin.js` +- `src/front/shared/components/modals/HowToExportModal/HowToExportModal.js` +- `src/front/shared/components/modals/WithdrawModal/WithdrawModal.js` +- `src/front/shared/helpers/getCurrencyKey.js` +- `src/front/shared/helpers/user.js` +- `src/front/shared/pages/CreateWallet/CreateWallet.js` +- `src/front/shared/pages/CreateWallet/CreateWallet.scss` +- `src/front/shared/pages/CreateWallet/Steps/FirstStep.js` +- `src/front/shared/pages/CreateWallet/Steps/SecondStep.js` +- `src/front/shared/pages/Currency/Currency.js` +- `src/front/shared/pages/Wallet/Wallet.js` +- `src/front/shared/redux/reducers/createWallet.js` +- `src/front/shared/redux/reducers/currencies.js` ### Add logo -- `shared/components/ui/CurrencyIcon/images/coin.svg` -- export it here: `shared/components/ui/CurrencyIcon/images/index.js` +- `src/front/shared/components/ui/CurrencyIcon/images/coin.svg` +- export it here: `src/front/shared/components/ui/CurrencyIcon/images/index.js` ### Set fee default -- `shared/helpers/constants/DEFAULT_FEE_RATES.js` +- `src/front/shared/helpers/constants/DEFAULT_FEE_RATES.js` ### Set coin decimals -- `shared/helpers/constants/TOKEN_DECIMALS.js` +- `src/front/shared/helpers/constants/TOKEN_DECIMALS.js` ### Add coin as dynamic fee -- `shared/helpers/constants/coinsWithDynamicFee.js` +- `src/front/shared/helpers/constants/coinsWithDynamicFee.js` ### Add min amount -- `shared/helpers/constants/minAmount.js` +- `src/front/shared/helpers/constants/minAmount.js` ### Create `privateKey` / `mnemonicKey` names for your coin -- `shared/helpers/constants/privateKeyNames.js` +- `src/front/shared/helpers/constants/privateKeyNames.js` ### Add coin accordingly as is done for btc -- `shared/redux/actions/user.js` +- `src/front/shared/redux/actions/user.js` ### More changes! Create helper, use btc as reference: -- `shared/helpers/coin.js` -- import helper `shared/helpers/index.js` +- `src/front/shared/helpers/coin.js` +- import helper `src/front/shared/helpers/index.js` Add swap instances: -- `shared/instances/newSwap.js` +- `src/front/shared/instances/newSwap.js` ### Create coin actions -- `shared/redux/actions/index.js` -- `shared/redux/actions/coin.js` +- `src/front/shared/redux/actions/index.js` +- `src/front/shared/redux/actions/coin.js` * use `btc.js` as reference * getWalletByWords - set coin index * set urls @@ -168,83 +168,95 @@ Add swap instances: ### Add `coinData` -- `shared/components/CurrencyDirectionChooser/CurrencyDirectionChooser.js` -- `shared/components/Header/User/UserTooltip/UserTooltip.js` -- `shared/components/layout/DashboardLayout/DashboardLayout.js` -- `shared/components/modals/ConfirmBeginSwap/ConfirmBeginSwap.js` -- `shared/components/modals/DownloadModal/DownloadModal.js` -- `shared/components/modals/InvoiceModal/InvoiceModal.js` -- `shared/components/modals/OfferModal/AddOffer/AddOffer.js` -- `shared/components/modals/RestoryMnemonicWallet/RestoryMnemonicWallet.js` -- `shared/components/modals/ShowMoreCoins/ShowMoreCoins.js` -- `shared/components/modals/SignUpModal/SignUpModal.js` -- `shared/components/SaveKeys/SaveKeys.js` -- `shared/containers/App/App.js` -- `shared/helpers/firebase/index.js` -- `shared/pages/CurrencyWallet/CurrencyWallet.js` -- `shared/pages/Exchange/Exchange.js` -- `shared/pages/Exchange/SelectGroup/SelectGroup.js` -- `shared/pages/History/Row/Row.js` -- `shared/pages/History/SwapsHistory/RowHistory/RowHistory.js` -- `shared/pages/Invoices/CreateInvoice/index.js` -- `shared/pages/Invoices/Invoice/index.js` -- `shared/pages/Invoices/InvoicesList/index.js` -- `shared/pages/PointOfSell/PointOfSell.js` -- `shared/pages/Swap/Swap.js` -- `shared/redux/actions/core.js` -- `shared/redux/reducers/user.js` -- `shared/helpers/links` -- `shared/helpers/constants/TRADE_TICKERS.js` -- `shared/pages/Wallet/Row/Row.js` -- `shared/plugins/backupUserData.js` +- `src/front/shared/components/CurrencyDirectionChooser/CurrencyDirectionChooser.js` +- `src/front/shared/components/Header/User/UserTooltip/UserTooltip.js` +- `src/front/shared/components/layout/DashboardLayout/DashboardLayout.js` +- `src/front/shared/components/modals/ConfirmBeginSwap/ConfirmBeginSwap.js` +- `src/front/shared/components/modals/DownloadModal/DownloadModal.js` +- `src/front/shared/components/modals/InvoiceModal/InvoiceModal.js` +- `src/front/shared/components/modals/OfferModal/AddOffer/AddOffer.js` +- `src/front/shared/components/modals/RestoryMnemonicWallet/RestoryMnemonicWallet.js` +- `src/front/shared/components/modals/ShowMoreCoins/ShowMoreCoins.js` +- `src/front/shared/components/modals/SignUpModal/SignUpModal.js` +- `src/front/shared/components/SaveKeys/SaveKeys.js` +- `src/front/shared/containers/App/App.js` +- `src/front/shared/helpers/firebase/index.js` +- `src/front/shared/pages/CurrencyWallet/CurrencyWallet.js` +- `src/front/shared/pages/Exchange/Exchange.js` +- `src/front/shared/pages/Exchange/SelectGroup/SelectGroup.js` +- `src/front/shared/pages/History/Row/Row.js` +- `src/front/shared/pages/History/SwapsHistory/RowHistory/RowHistory.js` +- `src/front/shared/pages/Invoices/CreateInvoice/index.js` +- `src/front/shared/pages/Invoices/Invoice/index.js` +- `src/front/shared/pages/Invoices/InvoicesList/index.js` +- `src/front/shared/pages/PointOfSell/PointOfSell.js` +- `src/front/shared/pages/Swap/Swap.js` +- `src/front/shared/redux/actions/core.js` +- `src/front/shared/redux/reducers/user.js` +- `src/front/shared/helpers/links` +- `src/front/shared/helpers/constants/TRADE_TICKERS.js` +- `src/front/shared/pages/Wallet/Row/Row.js` +- `src/front/shared/plugins/backupUserData.js` ### Set routes -- `shared/routes/index.js` +- `src/front/shared/routes/index.js` ### Add swap directions -- `shared/pages/Swap/...` -- `shared/pages/Swap/CoinSwap/...` -- `shared/pages/Swap/SwapProgress/SwapProgress.js` -- `shared/pages/Swap/SwapProgress/SwapProgressText/...` -- `shared/pages/Swap/swaps/index.js` +- `src/front/shared/pages/Swap/...` +- `src/front/shared/pages/Swap/CoinSwap/...` +- `src/front/shared/pages/Swap/SwapProgress/SwapProgress.js` +- `src/front/shared/pages/Swap/SwapProgress/SwapProgressText/...` +- `src/front/shared/pages/Swap/swaps/index.js` ### Create swap localisation -- `shared/localisation/_default.json` -- `shared/localisation/en.json` -- `shared/localisation/nl.json` -- `shared/localisation/ru.json` +- `src/front/shared/localisation/_default.json` +- `src/front/shared/localisation/en.json` +- `src/front/shared/localisation/nl.json` +- `src/front/shared/localisation/ru.json` ### Other -- `shared/pages/Wallet/components/LinkAccount/index.js` +- `src/front/shared/pages/Wallet/components/LinkAccount/index.js` -### Update README +-------------------------------------------- -- `docs/ADD_BLOCKCHAIN.md` (improve this doc) +## Core changes --------------------------------------------- +- `src/core/swap.app/constants/COINS.js` +- `src/core/swap.app/constants/ENV.js` +- `src/core/swap.app/constants/TRADE_TICKERS.js` +- `src/core/swap.app/util/typeforce.js` +- `src/core/swap.auth/*.js` +- `src/core/swap.flows/index.js` +- `src/core/swap.flows/ETH2*.js` +- `src/core/swap.flows/ETHTOKEN2*.js` +- `src/core/swap.flows/*2ETH.js` +- `src/core/swap.flows/*2ETHTOKEN.js` +- `src/core/swap.swaps/index.js` +- `src/core/swap.swaps/*Swap.js` +- `package.json` (install lib via `npm i`) +`*` = `GHOST`, for example -## Core changes -### Change files +-------------------------------------------- -- See [swap.core/docs/ADD_BLOCKCHAIN.md](https://github.com/swaponline/swap.core/blob/master/docs/ADD_BLOCKCHAIN.md) +## Additional changes ### Update README -- `swap.core/docs/ADD_BLOCKCHAIN.md` (improve core doc) -- `swap.core/docs/README.md` (add coin to the table) +- `src/core/README.md` (add coin to the table) +- `docs/ADD_BLOCKCHAIN.md` (improve this doc) -------------------------------------------- @@ -254,7 +266,9 @@ Add swap instances: ### GHOST -- See [swap.core/docs/ADD_BLOCKCHAIN.md](https://github.com/swaponline/swap.core/blob/master/docs/ADD_BLOCKCHAIN.md) +- https://github.com/swaponline/MultiCurrencyWallet/pull/2891 +- https://github.com/swaponline/swap.core/pull/500 +- https://github.com/swaponline/swap.core/pull/501 ### NEXT.coin diff --git a/docs/ADD_BLOCKCHAIN_CORE.md b/docs/ADD_BLOCKCHAIN_CORE.md deleted file mode 100644 index 13109bc430..0000000000 --- a/docs/ADD_BLOCKCHAIN_CORE.md +++ /dev/null @@ -1,42 +0,0 @@ -# How to add BTC-like blockchain - - -## Edit `swap.core` repo - -### Edit files - -+ `src/swap.app/constants/COINS.js` -+ `src/swap.app/constants/ENV.js` -+ `src/swap.app/constants/TRADE_TICKERS.js` -+ `src/swap.app/util/typeforce.js` -- (?) `src/swap.auth/*.js` -+ `src/swap.flows/index.js` -+ (need test) `src/swap.flows/ETH2*.js` -+ `src/swap.flows/ETHTOKEN2*.js` -+ (need test) `src/swap.flows/*2ETH.js` -+ (need test) `src/swap.flows/*2ETHTOKEN.js` -+ `src/swap.swaps/index.js` -+- (?) `src/swap.swaps/*Swap.js` -- `package.json` (install lib via `npm i`) - -`*` = `ghost`, for example - -### Example PR (`ghost` was added) - -- https://github.com/swaponline/swap.core/pull/500 -- https://github.com/swaponline/swap.core/pull/501 - - -## Edit `MultiCurrencyWallet` repo - -### Edit files - -See [instruction](https://github.com/swaponline/MultiCurrencyWallet/blob/master/ADD_BLOCKCHAIN.md) - -### Example PR (`ghost` was added) - -- https://github.com/swaponline/MultiCurrencyWallet/pull/2891 - - - - diff --git a/src/bot/README.md b/docs/BOT.md similarity index 97% rename from src/bot/README.md rename to docs/BOT.md index 35de00d2ef..44c6e479c3 100644 --- a/src/bot/README.md +++ b/docs/BOT.md @@ -1,17 +1,10 @@ On our server launch `root@DCbankroll ~/swap_new.bot # npm run pm2` -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) - -# Swap.Bot +# Swap.Bot (`src/bot`) _Trading engine for swap.core protocol_ -``` -npm i -npm run start -``` - This is a NodeJS project that adheres to Swap.DEP and uses [swap.core](http://github.com/swaponline/swap.core) library. It comes in two styles: a REST interface and a self-operating `autopilot` module. @@ -19,7 +12,7 @@ It comes in two styles: a REST interface and a self-operating `autopilot` module ## Quickstart (testnet) - +0) `npm i` 1) `cp .env.example .env` Set variables - KRAKEN_API_KEY @@ -38,7 +31,7 @@ Set variables ## Mainnet ```bash -NETWORK=mainnet npm run start +NETWORK=mainnet npm run bot ``` Try to open [web-based client](https://swaponline.io/) and see if any orders show up. diff --git a/src/core/README.md b/docs/CORE.md similarity index 99% rename from src/core/README.md rename to docs/CORE.md index 3aa039a004..f17c1fd918 100644 --- a/src/core/README.md +++ b/docs/CORE.md @@ -1,6 +1,6 @@ -# Swap Core +# Swap Core (`src/core`) In-browser atomic swap protocol based on HTLC @@ -13,7 +13,7 @@ Swap Core is a decentralized exchange protocol (DEP) for crosschain atomic swaps *tags: HTLC, atomic swap, javascript, browser, crypto, bitcoin, ethereum, erc20* -## Used currencies +## Supported currencies | ticker | title | |-----------|---------| @@ -25,17 +25,17 @@ Swap Core is a decentralized exchange protocol (DEP) for crosschain atomic swaps | SUM | Sumcoin | | NEXT | NEXT.coin | -## Current swap directions support +## Supported swap directions | tx\rx | ETH | ERC20 | BTC | BCH | GHOST | SUM | NEXT | |-------|------|-------|-----|-----|-------|-----|------| -| ETH | | | + | | + | | soon | +| ETH | | | + | | + | | + | | ERC20 | | | + | | + | | | | BTC | + | + | | | | | | | BCH | | | | | | | | | GHOST | + | + | | | | | | | SUM | | | | | | | | -| NEXT | soon | | soon| | | | soon | +| NEXT | + | | soon| | | | soon | ## How it works step by step diff --git a/docs/ONBOARDING.md b/docs/ONBOARDING.md index fb1f6dfd70..4c2189b342 100644 --- a/docs/ONBOARDING.md +++ b/docs/ONBOARDING.md @@ -1,20 +1,20 @@ # Onboarding plan -## Fast test -- Install (`docs/INSTALLATION.md`) and run testent (`npm start`) -- Start a test wallet by writing down 12 words -- Get test BTC, ETH (`docs / FAUCETS.md`) +## Dive as a user +- Install and run the service locally on testnet using [`/docs/INSTALLATION.md`](/docs/INSTALLATION.md) +- Open in browser, create a test wallet by writing down 12 words +- Get testnet BTC, ETH (see [`/docs/FAUCETS.md`](/docs/FAUCETS.md)) - Send test coins to another wallet - Swap with yourself (you need another wallet using incognito mode) - Create an invoice and pay using another wallet (using incognito mode) ## Fast start -- Read the `docs` -- Explore Issue Tag List https://github.com/swaponline/MultiCurrencyWallet/labels -- Improve something: take a simple task / improve docs +- Improve something: take a simple task / improve docs / [List of tasks for newcomers](https://github.com/swaponline/MultiCurrencyWallet/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - Create the first PR ## More info +- Read the [`docs`](/docs) +- Explore Issue Tag List https://github.com/swaponline/MultiCurrencyWallet/labels - Check out insights and current developers https://github.com/swaponline/MultiCurrencyWallet/pulse - Check out the modules listed in `package / json` (https://www.npmjs.com/) - Get acquainted with the structure and content of project files @@ -29,8 +29,8 @@ - Look into the current graph (https://github.com/swaponline/MultiCurrencyWallet/network) ## Deep insight -- Raise a bot locally and exchange with him -- Understand the swap algorithm +- Raise a bot locally and exchange with it using [`/docs/BOT.md`](/docs/BOT.md) +- Understand the swap algorithm (see [`/docs/CORE.md`](/docs/CORE.md)) - Understand the core - Understand the bot - Explore the test server diff --git a/docs/README.md b/docs/README.md index b30b315bcb..eb4cabbd52 100644 --- a/docs/README.md +++ b/docs/README.md @@ -42,13 +42,13 @@ Add many assets to your wallet: USDT stablecoin wallet (payment system) -## Easy to install +## Easy to use in your project - Install [WordPress plugin](https://codecanyon.net/item/multicurrency-crypto-wallet-and-exchange-widgets-for-wordpress/23532064) - Or make your own build following the [installation guide](/docs/INSTALLATION.md) -## Customizable (images, colors, texts, etc..) for your project +## Customizable (images, colors, texts...) - Using [WordPress plugin](https://codecanyon.net/item/multicurrency-crypto-wallet-and-exchange-widgets-for-wordpress/23532064)? Сustomize right in the admin panel! - Using your own build? Follow the [customization guide](/docs/CUSTOMIZATION.md) @@ -78,6 +78,7 @@ Work in progress to add more languages. - _(the easiest)_ Star the project ⭐ Developer? Start with [ONBOARDING](https://github.com/swaponline/MultiCurrencyWallet/blob/master/docs/ONBOARDING.md) + --- Any questions [are welcome](https://t.me/mcvchat) diff --git a/package.json b/package.json index 9988a75c90..17c4fa4990 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ "build:chrome-extension-mainnet": "npm run clean:chrome-extension && cross-env NODE_ENV=production DEBUG=app:* CONFIG=chrome-extension-mainnet.prod node --max-old-space-size=2048 ./src/front/bin/compile && npm run copy:chrome-extension && npm run rename-assets-manifest-file && npm run rename-assets-manifest-link && npm run zip:chrome-extension-mainnet", "test:unit": "mocha --require babel-core/register --require ./test/helpers.js --require ./test/dom.js --require ignore-styles 'src/**/*.spec.js'", "test:snapshot": "jest --config ./test/jest.config.json", - "coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls", "messages:extract": "babel-node src/front/tools/run messages", "rename-assets-manifest-file": "rename-files ./build-chrome-extension/application/assets/ 'manifest.json' 'android-manifest.json'", "rename-assets-manifest-link": "replace 'assets/manifest.json' 'assets/android-manifest.json' ./build-chrome-extension/application/index.html",