From 428cc29f12825c31391a475096cd6b7cdcebba0c Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 17 May 2018 18:52:43 +0530 Subject: [PATCH 01/72] Added reason in logger --- services/deploy/deployer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/deploy/deployer.js b/services/deploy/deployer.js index 9a51fe7..6ebe322 100644 --- a/services/deploy/deployer.js +++ b/services/deploy/deployer.js @@ -256,7 +256,7 @@ DeployerKlass.prototype = { } }) .catch(function(reason) { - logger.error("%Error - Contract deployment failed"); + logger.error("%Error - Contract deployment failed. Reason", reason); if (basicHelper.isReturnTypeTxReceipt(returnType)) { let errorParams = { internal_error_identifier: 'l_d_7', @@ -270,7 +270,7 @@ DeployerKlass.prototype = { }) .catch(function(reason) { if (basicHelper.isReturnTypeTxReceipt(returnType)) { - logger.error("%Error - Contract deployment failed"); + logger.error("%Error - Contract deployment failed. Reason: ", reason); let errorParams = { internal_error_identifier: 'l_d_8', api_error_identifier: 'unhandled_api_error', @@ -288,7 +288,7 @@ DeployerKlass.prototype = { error_config: errorConfig, debug_options: {} }; - logger.error('%Error - Transaction failed') + logger.error('%Error - Transaction failed. Reason:', reason); return onResolve(responseHelper.error(errorParams)); }); From cb180597687135f5411c1bc9d6adaca296df7b74 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 17 May 2018 20:34:03 +0530 Subject: [PATCH 02/72] Gas limit increased for airdrop contract deployment --- .travis.yml | 1 + lib/global_constant/gas_limit.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b127360..212f8bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ branches: only: - master - develop + - contract_deployment_fx notifications: email: recipients: diff --git a/lib/global_constant/gas_limit.js b/lib/global_constant/gas_limit.js index ec4b048..04f82d6 100644 --- a/lib/global_constant/gas_limit.js +++ b/lib/global_constant/gas_limit.js @@ -3,7 +3,7 @@ const gasLimit = { buffer: function() { - return 10000; + return 20000; }, default: function() { @@ -18,8 +18,9 @@ const gasLimit = { return 569731+this.buffer(); }, + // deployment gas 1645052 deployAirdrop: function() { - return 1583725+this.buffer(); + return 1803725+this.buffer(); }, deployPriceOracle: function() { From 1cfaeb442b27f53588a8dcd73149ba5d6f80ec1d Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Thu, 17 May 2018 21:06:41 +0530 Subject: [PATCH 03/72] remove contract_deployment_fx from travis build --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 212f8bb..b127360 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ branches: only: - master - develop - - contract_deployment_fx notifications: email: recipients: From bccdd6f9c3d82e8cc5b38036eb194b0fafc9a407 Mon Sep 17 00:00:00 2001 From: Sarvesh Jain Date: Fri, 18 May 2018 15:57:14 +0530 Subject: [PATCH 04/72] Running all mocha tests in one run so that summary tells the status of all tests --- mocha_test/scripts/travis_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mocha_test/scripts/travis_test.sh b/mocha_test/scripts/travis_test.sh index 44c80ff..32a529f 100644 --- a/mocha_test/scripts/travis_test.sh +++ b/mocha_test/scripts/travis_test.sh @@ -3,7 +3,7 @@ sh start_test_chain.sh sh deploy_all.sh . ./env_vars.sh node ./../../migrations/create_tables.js -./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/pricer --exit -./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/airdrop --exit +./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/pricer/*.js ./../../mocha_test/services/airdrop/*.js ./../../mocha_test/services/workers/*.js --exit +#./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/airdrop --exit # run worker test at last, as in the test case it removes the worker contract that is needed for other tests. -./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/workers --exit \ No newline at end of file +#./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/workers --exit \ No newline at end of file From a5e033985ab8fea0195400a562b3d8b522a750dc Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Fri, 18 May 2018 16:42:54 +0530 Subject: [PATCH 05/72] version bump up --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb3ed43..1b3c226 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.5", + "version": "1.0.5-beta.1", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 4017e31f4d675ffe9ff319cbbb019a132eae8865 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Fri, 18 May 2018 16:50:01 +0530 Subject: [PATCH 06/72] version bump up and changelog update --- CHANGELOG.md | 2 +- VERSION | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 837cd91..039b96e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## OpenST-Payments v1.0.5 (17 May 2018) +## OpenST-Payments v1.0.6 (17 May 2018) Changelog: diff --git a/VERSION b/VERSION index 1464c52..f9cbc01 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.5 \ No newline at end of file +1.0.7 \ No newline at end of file diff --git a/package.json b/package.json index 1b3c226..2badee0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.5-beta.1", + "version": "1.0.7-beta.1", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 38d6f63242ed77f6cc9928b7fea028c501e0f316 Mon Sep 17 00:00:00 2001 From: abhay-pepo Date: Wed, 23 May 2018 13:19:39 +0530 Subject: [PATCH 07/72] CHANGELOG Update --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 039b96e..7561568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## OpenST-Payments v1.0.7 (23 May 2018) + +Changelog: + +- Airdrop contract gas limit is increased because of contract changes. +- Reason is added in logs when transaction fails. + ## OpenST-Payments v1.0.6 (17 May 2018) Changelog: From 098c15efa265c1c61d62e3412d311c63bca95d6c Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Wed, 23 May 2018 13:20:41 +0530 Subject: [PATCH 08/72] version bump. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2badee0..e1c9809 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.7-beta.1", + "version": "1.0.7", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From c5dc960157c3383eb594633d592c84da0992b926 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 12:56:04 +0530 Subject: [PATCH 09/72] Mocha Test: Fixed cache failing issues --- mocha_test/services/airdrop/pay.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 369f389..80a4fbd 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -14,6 +14,7 @@ const rootPrefix = "../../.." , logger = require(rootPrefix + '/helpers/custom_console_logger') , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') + , BalanceCacheKlass = require(rootPrefix + '/lib/cache_management/balance') ; const errorConfig = { @@ -493,6 +494,15 @@ function validateTransferSuccess( * */ async function populateCache() { + + // Clear the previous cache + const cacheObject = new BalanceCacheKlass(constants.chainId, constants.TC5Address); + await cacheObject.clearBalance(constants.account1); + await cacheObject.clearBalance(constants.account2); + await cacheObject.clearBalance(constants.account3); + await cacheObject.clearBalance(constants.account4); + await cacheObject.clearBalance(constants.account5); + // Populate Cache await brandedTokenObject.getBalanceOf(constants.account1); await brandedTokenObject.getBalanceOf(constants.account2); @@ -556,6 +566,9 @@ describe('Airdrop Pay', function() { logger.debug("============= Do Airdrop Setup if setup was not done ============="); await registerAirdrop(constants.airdropOstUsdAddress); + // Populate Cache + populateCache(); + }); it('AirdropManager: transfer branded token from reserve to airdropBudgetHolder and approve airdrop contract', async function() { From 64e60f93e03fab0a9db7ce4b99b285ba68facb92 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 13:27:50 +0530 Subject: [PATCH 10/72] travis: Updated travis.yml --- .travis.yml | 6 +++++- .../{install_geth_1_7_3.sh => install_geth_1.7.3.sh} | 0 .../{install_geth_1_8_3.sh => install_geth_1.8.3.sh} | 0 3 files changed, 5 insertions(+), 1 deletion(-) rename mocha_test/scripts/{install_geth_1_7_3.sh => install_geth_1.7.3.sh} (100%) rename mocha_test/scripts/{install_geth_1_8_3.sh => install_geth_1.8.3.sh} (100%) diff --git a/.travis.yml b/.travis.yml index b127360..1c336a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ branches: only: - master - develop + - deepesh/multiple_env_travis notifications: email: recipients: @@ -13,6 +14,9 @@ notifications: on_failure: always node_js: - "8" +env: + - GETH_VERSION=1.8.3 + - GETH_VERSION=1.7.3 services: - mysql before_install: @@ -23,7 +27,7 @@ before_install: - sudo apt-get install software-properties-common - sudo add-apt-repository -y ppa:ethereum/ethereum - sudo apt-get update - - sudo bash mocha_test/scripts/install_geth_1_8_3.sh + - sudo bash mocha_test/scripts/install_geth_$GETH_VERSION.sh - sudo apt-get install solc - geth version install: diff --git a/mocha_test/scripts/install_geth_1_7_3.sh b/mocha_test/scripts/install_geth_1.7.3.sh similarity index 100% rename from mocha_test/scripts/install_geth_1_7_3.sh rename to mocha_test/scripts/install_geth_1.7.3.sh diff --git a/mocha_test/scripts/install_geth_1_8_3.sh b/mocha_test/scripts/install_geth_1.8.3.sh similarity index 100% rename from mocha_test/scripts/install_geth_1_8_3.sh rename to mocha_test/scripts/install_geth_1.8.3.sh From db3b71e20cddc899c79f39da2b07b0974387d241 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 14:50:56 +0530 Subject: [PATCH 11/72] Added node 10.2.1 and geth 1.8.8 --- .travis.yml | 4 +++- mocha_test/scripts/install_geth_1.8.8.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 mocha_test/scripts/install_geth_1.8.8.sh diff --git a/.travis.yml b/.travis.yml index 1c336a7..f8e668e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,9 @@ notifications: on_failure: always node_js: - "8" + - "10.2.1" env: + - GETH_VERSION=1.8.8 - GETH_VERSION=1.8.3 - GETH_VERSION=1.7.3 services: @@ -28,8 +30,8 @@ before_install: - sudo add-apt-repository -y ppa:ethereum/ethereum - sudo apt-get update - sudo bash mocha_test/scripts/install_geth_$GETH_VERSION.sh - - sudo apt-get install solc - geth version + - sudo apt-get install solc install: - npm install before_script: diff --git a/mocha_test/scripts/install_geth_1.8.8.sh b/mocha_test/scripts/install_geth_1.8.8.sh new file mode 100644 index 0000000..46144cb --- /dev/null +++ b/mocha_test/scripts/install_geth_1.8.8.sh @@ -0,0 +1,9 @@ +#!/bin/bash +curl https://gethstore.blob.core.windows.net/builds/geth-linux-arm64-1.8.8-2688dab4.tar.gz | tar xvz +mv geth-linux-arm64-1.8.8-2688dab4 /usr/local/bin +ln -s /usr/local/bin/geth-linux-arm64-1.8.8-2688dab4/geth /usr/local/bin/geth +export PATH="$PATH:/usr/local/bin/geth-linux-arm64-1.8.8-2688dab4" + + + + From e6d5a94e8c6bb714ceb3137f8816d68d88711bbc Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 19:28:01 +0530 Subject: [PATCH 12/72] Updated travis test script --- mocha_test/scripts/travis_test.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mocha_test/scripts/travis_test.sh b/mocha_test/scripts/travis_test.sh index 32a529f..1f4effc 100644 --- a/mocha_test/scripts/travis_test.sh +++ b/mocha_test/scripts/travis_test.sh @@ -3,7 +3,10 @@ sh start_test_chain.sh sh deploy_all.sh . ./env_vars.sh node ./../../migrations/create_tables.js -./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/pricer/*.js ./../../mocha_test/services/airdrop/*.js ./../../mocha_test/services/workers/*.js --exit -#./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/airdrop --exit -# run worker test at last, as in the test case it removes the worker contract that is needed for other tests. -#./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/workers --exit \ No newline at end of file +./../../node_modules/mocha/bin/mocha ./../../mocha_test/services/pricer/*.js ./../../mocha_test/services/airdrop/*.js ./../../mocha_test/services/workers/_is_worker.js ./../../mocha_test/services/workers/_remove_worker.js ./../../mocha_test/services/workers/_set_worker.js ./../../mocha_test/services/workers/remove.js --exit + +# run worker test at last, and in the following sequence as in the test case it removes the worker contract that is needed for other tests. +# 1. _is_worker.js +# 2. _remove_worker.js +# 3. _set_worker.js +# 4. remove.js \ No newline at end of file From 85da3b0de5d8da69b990112867dc772cad4e4213 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 19:36:49 +0530 Subject: [PATCH 13/72] Updated travis.yml to include build matrix --- .travis.yml | 10 +++++++--- mocha_test/scripts/install_geth_1.8.8.sh | 8 ++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8e668e..279723c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,11 +14,15 @@ notifications: on_failure: always node_js: - "8" - - "10.2.1" + - "10" env: - - GETH_VERSION=1.8.8 - - GETH_VERSION=1.8.3 - GETH_VERSION=1.7.3 +matrix: + include: + - branches: deepesh/multiple_env_travis + env: + - GETH_VERSION=1.8.8 + - GETH_VERSION=1.8.3 services: - mysql before_install: diff --git a/mocha_test/scripts/install_geth_1.8.8.sh b/mocha_test/scripts/install_geth_1.8.8.sh index 46144cb..749b3bd 100644 --- a/mocha_test/scripts/install_geth_1.8.8.sh +++ b/mocha_test/scripts/install_geth_1.8.8.sh @@ -1,8 +1,8 @@ #!/bin/bash -curl https://gethstore.blob.core.windows.net/builds/geth-linux-arm64-1.8.8-2688dab4.tar.gz | tar xvz -mv geth-linux-arm64-1.8.8-2688dab4 /usr/local/bin -ln -s /usr/local/bin/geth-linux-arm64-1.8.8-2688dab4/geth /usr/local/bin/geth -export PATH="$PATH:/usr/local/bin/geth-linux-arm64-1.8.8-2688dab4" +curl https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.8.8-2688dab4.tar.gz | tar xvz +mv geth-linux-amd64-1.8.8-2688dab4 /usr/local/bin +ln -s /usr/local/bin/geth-linux-amd64-1.8.8-2688dab4/geth /usr/local/bin/geth +export PATH="$PATH:/usr/local/bin/geth-linux-amd64-1.8.8-2688dab4" From f173cf6c01183c4e6686ba46b452fbe6083a9969 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 19:39:52 +0530 Subject: [PATCH 14/72] Updated travis.yml env --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 279723c..33354e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ matrix: - branches: deepesh/multiple_env_travis env: - GETH_VERSION=1.8.8 + - branches: deepesh/multiple_env_travis + env: - GETH_VERSION=1.8.3 services: - mysql From 88b98d4d0d2b1aec414fa072e856e1354a50d63e Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 19:48:24 +0530 Subject: [PATCH 15/72] Updated travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33354e6..9a65025 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,10 +19,10 @@ env: - GETH_VERSION=1.7.3 matrix: include: - - branches: deepesh/multiple_env_travis + - if: branch =~ ^deepesh/multiple_env_travis env: - GETH_VERSION=1.8.8 - - branches: deepesh/multiple_env_travis + - if: branch =~ ^develop env: - GETH_VERSION=1.8.3 services: From 486466cf2ecfbfe7fb85824ab205baef87d1f450 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 19:57:03 +0530 Subject: [PATCH 16/72] travis: changed the defualt geth version to 1.7.2 --- .travis.yml | 5 ++--- mocha_test/scripts/install_geth_1.7.2.sh | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 mocha_test/scripts/install_geth_1.7.2.sh diff --git a/.travis.yml b/.travis.yml index 9a65025..b386b23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,11 @@ notifications: on_failure: always node_js: - "8" - - "10" env: - - GETH_VERSION=1.7.3 + - GETH_VERSION=1.7.2 matrix: include: - - if: branch =~ ^deepesh/multiple_env_travis + - if: branch =~ ^develop env: - GETH_VERSION=1.8.8 - if: branch =~ ^develop diff --git a/mocha_test/scripts/install_geth_1.7.2.sh b/mocha_test/scripts/install_geth_1.7.2.sh new file mode 100644 index 0000000..4038a94 --- /dev/null +++ b/mocha_test/scripts/install_geth_1.7.2.sh @@ -0,0 +1,5 @@ +#!/bin/bash +curl https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.7.2-1db4ecdc.tar.gz | tar xvz +mv geth-linux-amd64-1.7.2-1db4ecdc /usr/local/bin +ln -s /usr/local/bin/geth-linux-amd64-1.7.2-1db4ecdc/geth /usr/local/bin/geth +export PATH="$PATH:/usr/local/bin/geth-linux-amd64-1.7.2-1db4ecdc" From c7891fd4bbc30729aceeb63f1138b98d864904f2 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:03:44 +0530 Subject: [PATCH 17/72] Modified travis script more --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b386b23..00bd576 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,10 +20,12 @@ matrix: include: - if: branch =~ ^develop env: + - GETH_VERSION=1.7.2 + - GETH_VERSION=1.8.3 - GETH_VERSION=1.8.8 - - if: branch =~ ^develop + - if: branch =~ ^deepesh/multiple_env_travis env: - - GETH_VERSION=1.8.3 + - GETH_VERSION=1.7.2 services: - mysql before_install: From b5cbdec76cf6334efc90f6da1c564d675eb0a20f Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:15:50 +0530 Subject: [PATCH 18/72] Branch test --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00bd576..1700795 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,12 +18,12 @@ env: - GETH_VERSION=1.7.2 matrix: include: - - if: branch =~ ^develop + - if: branch =~ ^deepesh/multiple_env_travis env: - GETH_VERSION=1.7.2 - GETH_VERSION=1.8.3 - GETH_VERSION=1.8.8 - - if: branch =~ ^deepesh/multiple_env_travis + - if: branch =~ ^develop env: - GETH_VERSION=1.7.2 services: From 127949afd87ac3d3c5f5d5ce04764553c139e796 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:20:08 +0530 Subject: [PATCH 19/72] Changed script --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1700795..dee0a3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,13 +19,13 @@ env: matrix: include: - if: branch =~ ^deepesh/multiple_env_travis - env: - - GETH_VERSION=1.7.2 - - GETH_VERSION=1.8.3 - - GETH_VERSION=1.8.8 + env: GETH_VERSION=1.7.2 + - if: branch =~ ^deepesh/multiple_env_travis + env: GETH_VERSION=1.8.3 + - if: branch =~ ^deepesh/multiple_env_travis + env: GETH_VERSION=1.8.8 - if: branch =~ ^develop - env: - - GETH_VERSION=1.7.2 + env: GETH_VERSION=1.7.2 services: - mysql before_install: From 1147c96943033819bd3770d0511e9d577f4b0af4 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:21:54 +0530 Subject: [PATCH 20/72] modified script to test --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dee0a3e..8efc105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,6 @@ matrix: include: - if: branch =~ ^deepesh/multiple_env_travis env: GETH_VERSION=1.7.2 - - if: branch =~ ^deepesh/multiple_env_travis - env: GETH_VERSION=1.8.3 - if: branch =~ ^deepesh/multiple_env_travis env: GETH_VERSION=1.8.8 - if: branch =~ ^develop From 5b8804598713c10fc454f225221c1a3c37f389df Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:25:00 +0530 Subject: [PATCH 21/72] added check for master branch --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8efc105..6d6d956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,12 +18,20 @@ env: - GETH_VERSION=1.7.2 matrix: include: - - if: branch =~ ^deepesh/multiple_env_travis + - if: branch =~ ^master env: GETH_VERSION=1.7.2 - - if: branch =~ ^deepesh/multiple_env_travis + - if: branch =~ ^master + env: GETH_VERSION=1.8.3 + - if: branch =~ ^master env: GETH_VERSION=1.8.8 - if: branch =~ ^develop env: GETH_VERSION=1.7.2 + - if: branch =~ ^develop + env: GETH_VERSION=1.8.3 + - if: branch =~ ^develop + env: GETH_VERSION=1.8.8 + - if: branch =~ ^deepesh/multiple_env_travis + env: GETH_VERSION=1.7.2 services: - mysql before_install: From 33ee18ec7b6f7d688a1c48820c75f72f600cb201 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:35:35 +0530 Subject: [PATCH 22/72] Added node version 9 for test --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6d6d956..9dc0105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ notifications: on_failure: always node_js: - "8" + - "9" env: - GETH_VERSION=1.7.2 matrix: From b3a7abf18638ecfe8b01de92ad086628f4ad16e4 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Fri, 25 May 2018 20:39:53 +0530 Subject: [PATCH 23/72] Updated scripts --- .travis.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9dc0105..640c919 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,23 +14,46 @@ notifications: on_failure: always node_js: - "8" - - "9" env: - GETH_VERSION=1.7.2 matrix: include: - if: branch =~ ^master env: GETH_VERSION=1.7.2 + node_js: "8" - if: branch =~ ^master env: GETH_VERSION=1.8.3 + node_js: "8" - if: branch =~ ^master env: GETH_VERSION=1.8.8 + node_js: "8" - if: branch =~ ^develop env: GETH_VERSION=1.7.2 + node_js: "8" - if: branch =~ ^develop env: GETH_VERSION=1.8.3 + node_js: "8" - if: branch =~ ^develop env: GETH_VERSION=1.8.8 + node_js: "8" + - if: branch =~ ^master + env: GETH_VERSION=1.7.2 + node_js: "9" + - if: branch =~ ^master + env: GETH_VERSION=1.8.3 + node_js: "9" + - if: branch =~ ^master + env: GETH_VERSION=1.8.8 + node_js: "9" + - if: branch =~ ^develop + env: GETH_VERSION=1.7.2 + node_js: "9" + - if: branch =~ ^develop + env: GETH_VERSION=1.8.3 + node_js: "9" + - if: branch =~ ^develop + env: GETH_VERSION=1.8.8 + node_js: "9" - if: branch =~ ^deepesh/multiple_env_travis env: GETH_VERSION=1.7.2 services: From cd6f032e210a587bf86607959518fcb1148dee01 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Wed, 30 May 2018 13:14:46 +0530 Subject: [PATCH 24/72] whitelisted branch v0.9.3/develop --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 640c919..753728f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,8 +54,9 @@ matrix: - if: branch =~ ^develop env: GETH_VERSION=1.8.8 node_js: "9" - - if: branch =~ ^deepesh/multiple_env_travis + - if: branch =~ ^v0.9.3/develop env: GETH_VERSION=1.7.2 + node_js: "8" services: - mysql before_install: From 63e5aa095d11d0384e1e09ba2e16c4f737bde957 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Wed, 30 May 2018 13:17:01 +0530 Subject: [PATCH 25/72] updated travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 753728f..1799321 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,8 @@ matrix: - if: branch =~ ^develop env: GETH_VERSION=1.8.8 node_js: "9" + - if: branch =~ ^deepesh/multiple_env_travis + env: GETH_VERSION=1.7.2 - if: branch =~ ^v0.9.3/develop env: GETH_VERSION=1.7.2 node_js: "8" From 6d84766516204ed983ec473734e07e77c66a0412 Mon Sep 17 00:00:00 2001 From: deepesh KN Date: Thu, 31 May 2018 17:21:33 +0530 Subject: [PATCH 26/72] updated travis --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1799321..d076db9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ branches: only: - master - develop - - deepesh/multiple_env_travis notifications: email: recipients: @@ -54,11 +53,7 @@ matrix: - if: branch =~ ^develop env: GETH_VERSION=1.8.8 node_js: "9" - - if: branch =~ ^deepesh/multiple_env_travis - env: GETH_VERSION=1.7.2 - - if: branch =~ ^v0.9.3/develop - env: GETH_VERSION=1.7.2 - node_js: "8" + services: - mysql before_install: From 90c17a7d1eef1fe51cc473f5c92fb68a08a0d99c Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Fri, 1 Jun 2018 11:51:01 +0530 Subject: [PATCH 27/72] dynamo integration --- config/dynamoDB.js | 25 +++++++++++++++++++++++++ lib/auto_scaling_service.js | 21 +++++++++++++++++++++ lib/dynamoDB_service.js | 14 ++++++++++++++ package.json | 1 + 4 files changed, 61 insertions(+) create mode 100644 config/dynamoDB.js create mode 100644 lib/auto_scaling_service.js create mode 100644 lib/dynamoDB_service.js diff --git a/config/dynamoDB.js b/config/dynamoDB.js new file mode 100644 index 0000000..9a765da --- /dev/null +++ b/config/dynamoDB.js @@ -0,0 +1,25 @@ +"use strict"; + +const rootPrefix = '..' + , coreConstants = require(rootPrefix + '/config/core_constants'); + +// Dynamo DB connection config details +const ddbConnectionConfig = { + 'apiVersion': process.env.OS_DYNAMODB_API_VERSION, + 'accessKeyId': process.env.OS_DYNAMODB_ACCESS_KEY_ID, + 'secretAccessKey': process.env.OS_DYNAMODB_SECRET_ACCESS_KEY, + 'region': process.env.OS_DYNAMODB_REGION, + 'endpoint': process.env.OS_DYNAMODB_ENDPOINT +}; + +if (process.env.OS_DYNAMODB_SSL_ENABLED == 1) { + ddbConnectionConfig['sslEnabled'] = true; +} else { + ddbConnectionConfig['sslEnabled'] = false; +} + +if (process.env.OS_DYNAMODB_LOGGING_ENABLED == 1) { + ddbConnectionConfig['logger'] = console; +} + +module.exports = ddbConnectionConfig; diff --git a/lib/auto_scaling_service.js b/lib/auto_scaling_service.js new file mode 100644 index 0000000..bd90994 --- /dev/null +++ b/lib/auto_scaling_service.js @@ -0,0 +1,21 @@ +"use strict"; + +/* + * Autoscaling Service Object + */ + +const rootPrefix = '..' + , coreConstants = require(rootPrefix + '/config/core_constants') +; + +var autoscalingServiceObj = null; + +if (coreConstants.ENVIRONMENT != 'development') { + const OSTStorage = require('@openstfoundation/openst-storage') + , autoScalingConfig = require(rootPrefix + '/config/autoscaling') + ; + + autoscalingServiceObj = new OSTStorage.AutoScaling(autoScalingConfig); +} + +module.exports = autoscalingServiceObj; \ No newline at end of file diff --git a/lib/dynamoDB_service.js b/lib/dynamoDB_service.js new file mode 100644 index 0000000..ff01f13 --- /dev/null +++ b/lib/dynamoDB_service.js @@ -0,0 +1,14 @@ +"use strict"; + +/* + * Dynamodb Service Object + */ + +const OSTStorage = require('@openstfoundation/openst-storage'); + +const rootPrefix = '..' + , dynamodbConnectionParams = require(rootPrefix + '/config/dynamoDB') + , ddbServiceObj = new OSTStorage.Dynamodb(dynamodbConnectionParams) +; + +module.exports = ddbServiceObj; \ No newline at end of file diff --git a/package.json b/package.json index e1c9809..8c8cf9d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", + "@openstfoundation/openst-storage": "1.0.0-beta.6", "bignumber.js": "4.1.0", "mustache": "2.3.0", "mysql": "2.14.1", From 155d02c5268f0fdab3bcd90b3ec12d4cfa4d0793 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Fri, 1 Jun 2018 12:37:30 +0530 Subject: [PATCH 28/72] get balance from dynamoDB(openst-storage) --- lib/contract_interact/branded_token.js | 39 +++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 56eac1a..4ef8180 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -8,6 +8,7 @@ * */ const BigNumber = require('bignumber.js') + , openSTStorage = require('@openstfoundation/openst-storage') ; const rootPrefix = '../..' @@ -84,30 +85,30 @@ BrandedToken.prototype = { ; try { - var cacheResult = await oThis.balanceCache.getBalance(owner); - if (cacheResult.isSuccess() && cacheResult.data.response != null) { - return Promise.resolve(responseHelper.successWithData({ - balance: cacheResult.data.response, - source: "cache"})); - } else { - const getBalanceFromContractResponse = await oThis.getBalanceFromContract(owner); - - cacheResult = await oThis.balanceCache.getBalance(owner); - if (cacheResult.isSuccess() && cacheResult.data.response != null) { - return Promise.resolve(responseHelper.successWithData({ - balance: cacheResult.data.response, - source: "cache"})); - } + // Validate addresses + if (!basicHelper.isAddressValid(owner)) { + let errObj = responseHelper.error({ + internal_error_identifier: 'l_ci_bt_getBalanceOf_1', + api_error_identifier: 'invalid_address', + error_config: errorConfig + }); - if (getBalanceFromContractResponse.isFailure()) return Promise.resolve(getBalanceFromContractResponse); + return Promise.resolve(errObj); + } - await oThis.balanceCache.setBalance(owner, new BigNumber(getBalanceFromContractResponse.data.balance)); + const balanceResponse = await new openSTStorage.TokenBalanceCache({ + erc20_contract_address: oThis.brandedTokenAddress, ethereum_addresses: [owner] + }).fetch(); - return Promise.resolve(responseHelper.successWithData({ - balance: getBalanceFromContractResponse.data.balance, - source: "chain"})); + if (balanceResponse.isFailure()) { + return Promise.resolve(balanceResponse); } + + const ownerBalance = balanceResponse.data[owner].available_balance; + + return responseHelper.successWithData({balance: ownerBalance}); + } catch(err) { let errorParams = { internal_error_identifier: 'l_ci_bt_getBalanceOf_2', From 009df9045d80b45d3f6ab9b4e5f4df6c5de33184 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Fri, 1 Jun 2018 14:01:38 +0530 Subject: [PATCH 29/72] Changes for travis dynamo init --- .travis.yml | 13 ++++++++++++ config/dynamoDB.js | 3 --- lib/dynamo_db_service.js | 14 +++++++++++++ package.json | 1 + tools/deploy/EIP20TokenMock.js | 12 +++++++++++ tools/dynamo_db_init.js | 38 ++++++++++++++++++++++++++++++++++ 6 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 lib/dynamo_db_service.js create mode 100644 tools/dynamo_db_init.js diff --git a/.travis.yml b/.travis.yml index b127360..7c5ac9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,17 @@ before_script: - geth makedag 0 ~/.ethash - nohup sh tools/runTestRpc.sh /dev/null 2>&1 & - bash contracts/compile.sh + - mkdir -p dynamodb + - wget https://s3.ap-south-1.amazonaws.com/dynamodb-local-mumbai/dynamodb_local_latest.zip -O ./dynamodb/dynamodb_local_latest.zip + - unzip ./dynamodb/dynamodb_local_latest.zip + - nohup java -Djava.library.path=./dynamodb/DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb & + - sleep 30 + - export OS_DYNAMODB_API_VERSION='2012-08-10' + - export OS_DYNAMODB_ACCESS_KEY_ID='x' + - export OS_DYNAMODB_SECRET_ACCESS_KEY='x' + - export OS_DYNAMODB_REGION='localhost' + - export OS_DYNAMODB_ENDPOINT='http://localhost:8000' + - node tools/dynamo_db_init.js script: - truffle test - cd mocha_test/scripts/ @@ -40,3 +51,5 @@ script: after_script: - kill $(ps aux | grep 'testrpc' | awk '{print $2}') - kill $(ps aux | grep 'geth' | awk '{print $2}') + - kill $(ps aux | grep 'DynamoDBLocal.jar' | awk '{print $2}') + - rm -rf dynamodb diff --git a/config/dynamoDB.js b/config/dynamoDB.js index 9a765da..3a27c08 100644 --- a/config/dynamoDB.js +++ b/config/dynamoDB.js @@ -1,8 +1,5 @@ "use strict"; -const rootPrefix = '..' - , coreConstants = require(rootPrefix + '/config/core_constants'); - // Dynamo DB connection config details const ddbConnectionConfig = { 'apiVersion': process.env.OS_DYNAMODB_API_VERSION, diff --git a/lib/dynamo_db_service.js b/lib/dynamo_db_service.js new file mode 100644 index 0000000..ff01f13 --- /dev/null +++ b/lib/dynamo_db_service.js @@ -0,0 +1,14 @@ +"use strict"; + +/* + * Dynamodb Service Object + */ + +const OSTStorage = require('@openstfoundation/openst-storage'); + +const rootPrefix = '..' + , dynamodbConnectionParams = require(rootPrefix + '/config/dynamoDB') + , ddbServiceObj = new OSTStorage.Dynamodb(dynamodbConnectionParams) +; + +module.exports = ddbServiceObj; \ No newline at end of file diff --git a/package.json b/package.json index 8c8cf9d..906a8dc 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", "@openstfoundation/openst-storage": "1.0.0-beta.6", + "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", "mysql": "2.14.1", diff --git a/tools/deploy/EIP20TokenMock.js b/tools/deploy/EIP20TokenMock.js index 086e179..4313f4b 100644 --- a/tools/deploy/EIP20TokenMock.js +++ b/tools/deploy/EIP20TokenMock.js @@ -12,6 +12,8 @@ * @module tools/deploy/EIP20TokenMock */ +const openSTStorage = require('@openstfoundation/openst-storage'); + const readline = require('readline') , rootPrefix = '../..' , prompts = readline.createInterface(process.stdin, process.stdout) @@ -20,6 +22,8 @@ const readline = require('readline') , BigNumber = require('bignumber.js') , helper = require(rootPrefix + "/tools/deploy/helper") , gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') + , dynamodbConnectionParams = require(rootPrefix + '/config/dynamoDB') + , ddbServiceObj = new openSTStorage.Dynamodb(dynamodbConnectionParams) ; /** @@ -117,6 +121,14 @@ async function performer(argv) { if (deployResult.isSuccess()) { const contractAddress = deployResult.data.transaction_receipt.contractAddress; logger.win("contractAddress: " + contractAddress); + + logger.debug('*** Allocating shard for Token balance'); + + await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + erc20_contract_address: contractAddress + }).allocate(); + if (fileForContractAddress !== '') { await helper.writeContractAddressToFile(fileForContractAddress, contractAddress); } diff --git a/tools/dynamo_db_init.js b/tools/dynamo_db_init.js new file mode 100644 index 0000000..34c6057 --- /dev/null +++ b/tools/dynamo_db_init.js @@ -0,0 +1,38 @@ +"use strict"; +/** + * Dynamo DB init + * + * @module tools/dynamo_db_init + */ +const openSTStorage = require('@openstfoundation/openst-storage') +; + +const rootPrefix = '..' + , logger = require(rootPrefix + '/helpers/custom_console_logger') + , ddbServiceObj = require(rootPrefix + '/lib/dynamo_db_service') + // , autoscalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') +; + +/** + * Dynamo db init + * + * @constructor + */ +const DynamoDBInit = function () {}; + +DynamoDBInit.prototype = { + perform: async function () { + // run migrations + logger.info('* Running DynamoDB initial migrations for shard management.'); + let shardMgmtObj = ddbServiceObj.shardManagement(); + await shardMgmtObj.runShardMigration(ddbServiceObj, null); + + // createAndRegisterShard + logger.info('* Creating and registering shard for token balance model.'); + await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj + }).createAndRegisterShard('tokenBalancesShard1') + } +}; + +new DynamoDBInit().perform(); \ No newline at end of file From 4c79dc4eecb47c456f366b88b496f83d6a01db0d Mon Sep 17 00:00:00 2001 From: Alpesh Date: Fri, 1 Jun 2018 13:43:18 +0530 Subject: [PATCH 30/72] balance credit and debit using dynamoDB(openst-storage) --- lib/contract_interact/branded_token.js | 140 ++++++++++++------------- lib/transaction_helper.js | 17 --- 2 files changed, 70 insertions(+), 87 deletions(-) diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 4ef8180..673a4c7 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -7,8 +7,7 @@ * @module lib/contract_interact/branded_token * */ -const BigNumber = require('bignumber.js') - , openSTStorage = require('@openstfoundation/openst-storage') +const openSTStorage = require('@openstfoundation/openst-storage') ; const rootPrefix = '../..' @@ -24,6 +23,7 @@ const rootPrefix = '../..' , BalanceCacheKlass = require(rootPrefix + '/lib/cache_management/balance') , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') + , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') ; const errorConfig = { @@ -52,7 +52,6 @@ const BrandedToken = function (brandedTokenAddress, chainId) { oThis.brandedTokenAddress = brandedTokenAddress; oThis.chainId = chainId; oThis.balanceCache = new BalanceCacheKlass(chainId, brandedTokenAddress); - //currContract.setProvider(web3Provider.currentProvider); }; BrandedToken.prototype = { @@ -187,7 +186,9 @@ BrandedToken.prototype = { notificationData.message.payload.erc20_contract_address = oThis.brandedTokenAddress; const onSuccess = async function(receipt) { - await oThis._afterTransferSuccess(airdropBudgetHolderAddress, amount); + if(coreConstants.STANDALONE_MODE == '1') { + await oThis._afterTransferSuccess(senderAddress, airdropBudgetHolderAddress, amount); + } }; const onFail = async function(receipt) { await oThis._afterTransferFail(senderAddress, amount); @@ -230,34 +231,31 @@ BrandedToken.prototype = { * Credit balance in cache * * @param {string} owner - Account address - * @param {BigNumber} bigAmount - amount to be credited + * @param {BigNumber} amount - amount to be credited * * @return {promise} */ - creditBalance: async function (owner, bigAmount) { + creditBalance: async function (owner, amount) { const oThis = this + , bigAmount = basicHelper.convertToBigNumber(amount) ; try { - bigAmount = basicHelper.convertToBigNumber(bigAmount); - - if (bigAmount.gt(0)) { - const getBalanceOfResponse = await oThis.getBalanceOf(owner); - if (getBalanceOfResponse.isSuccess()) { - if (getBalanceOfResponse.data.source == 'cache'){ - const balance = new BigNumber(getBalanceOfResponse.data.balance); - const newBalance = balance.plus(bigAmount); - logger.debug('creditBalance called with params:', JSON.stringify({owner: owner, - bigAmount: bigAmount.toString(10)})); - await oThis.setBalanceInCache(owner, newBalance); - } - } else { - logger.error('lib/contract_interact/branded_token.js:creditBalance getBalanceOfResponse error', - JSON.stringify(getBalanceOfResponse)); - } + + const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + erc20_contract_address: oThis.brandedTokenAddress + }).update({ + ethereum_address: owner, + settle_amount: bigAmount.toString(10) + }).catch(function (error) { + return error; + }); + + if (balanceUpdateResponse.isFailure()) { + return balanceUpdateResponse; } - return Promise.resolve(responseHelper.successWithData({})); + } catch(err) { let errorParams = { internal_error_identifier: 'l_ci_bt_creditBalance_1', @@ -278,29 +276,29 @@ BrandedToken.prototype = { * * @return {promise} */ - debitBalance: async function (owner, bigAmount) { + debitBalance: async function (owner, amount) { const oThis = this - ; + , debitAmount = (basicHelper.convertToBigNumber(amount)).mul(basicHelper.convertToBigNumber(-1)); try { - bigAmount = basicHelper.convertToBigNumber(bigAmount); - if (bigAmount.gt(0)) { - const getBalanceOfResponse = await oThis.getBalanceOf(owner); - - if (getBalanceOfResponse.isSuccess()) { - const balance = new BigNumber(getBalanceOfResponse.data.balance); - const newBalance = balance.minus(bigAmount); - logger.debug('debitBalance called with params:', JSON.stringify({owner: owner, - bigAmount: bigAmount.toString(10)})); - await oThis.setBalanceInCache(owner, newBalance); - } else { - logger.error('lib/contract_interact/branded_token.js:debitBalance getBalanceOfResponse error', - JSON.stringify(getBalanceOfResponse)); - } + const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: oThis.brandedTokenAddress + }).update({ + ethereum_address: owner, + settle_amount: debitAmount.toString(10), + un_settled_debit_amount: debitAmount.toString(10) + }).catch(function (error) { + return error; + }); + + if (balanceUpdateResponse.isFailure()) { + return balanceUpdateResponse; } - return Promise.resolve(responseHelper.successWithData({})); + } catch(err) { let errorParams = { internal_error_identifier: 'l_ci_bt_debitBalance_1', @@ -313,42 +311,39 @@ BrandedToken.prototype = { } }, + /** - * Set balance in cache + * Debit balance in cache for pessimistic caching * * @param {string} owner - Account address - * @param {BigNumber} bigAmount - amount to be set + * @param {BigNumber} bigAmount - amount to be debited * * @return {promise} + * + * @ignore */ - setBalanceInCache: async function (owner, bigAmount) { + pessimisticDebit: async function (owner, amount) { + const oThis = this + , bigAmount = basicHelper.convertToBigNumber(amount) ; - try { - const setBalanceResponse = await oThis.balanceCache.setBalance(owner, bigAmount); - - if (setBalanceResponse.isSuccess() && setBalanceResponse.data.response != null) { - return Promise.resolve(responseHelper.successWithData({})); - } - - let errorParams = { - internal_error_identifier: 'l_ci_bt_setBalanceInCache_1', - api_error_identifier: 'could_not_process', - error_config: errorConfig, - debug_options: { setBalanceResponse: setBalanceResponse } - }; - return Promise.resolve(responseHelper.error(errorParams)); - } catch(err) { - let errorParams = { - internal_error_identifier: 'l_ci_bt_setBalanceInCache_2', - api_error_identifier: 'unhandled_api_error', - error_config: errorConfig, - debug_options: {} - }; - logger.error('lib/contract_interact/branded_token.js:setBalanceInCache inside catch:', err); - return Promise.resolve(responseHelper.error(errorParams)); + const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: oThis.brandedTokenAddress + }).update({ + ethereum_address: owner, + un_settled_debit_amount: bigAmount.toString(10) + }).catch(function (error) { + return error; + }); + + if (balanceUpdateResponse.isFailure()) { + return balanceUpdateResponse; } + return responseHelper.successWithData({}); + }, /** @@ -428,7 +423,7 @@ BrandedToken.prototype = { logger.debug('_beforeTransfer called with params:', JSON.stringify({address: address, amount: amount})); - return oThis.debitBalance(address, amount); + return oThis.pessimisticDebit(address, amount); }, /** @@ -442,13 +437,18 @@ BrandedToken.prototype = { * @private * */ - _afterTransferSuccess: function(address, amount) { + _afterTransferSuccess: async function(senderAddress, airdropBudgetHolderAddress, amount) { const oThis = this ; logger.debug('_afterTransferSuccess called with params:', JSON.stringify({address: address, amount: amount})); - return oThis.creditBalance(address, amount); + //Credit the amount to the recipient. + await oThis.creditBalance(airdropBudgetHolderAddress, amount); + //Debit the amount to the sender. + await oThis.debitBalance(senderAddress, amount); + + return Promise.resolve(responseHelper.successWithData({})); }, /** @@ -468,7 +468,7 @@ BrandedToken.prototype = { logger.debug('_afterTransferFail called with params:', JSON.stringify({address: address, amount: amount})); - return oThis.creditBalance(address, amount); + return oThis.pessimisticDebit(address, (basicHelper.convertToBigNumber(amount)).mul(basicHelper.convertToBigNumber(-1))); }, }; diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index bd818b6..b2e0f90 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -100,23 +100,6 @@ TransactionHelper.prototype = { } }, - /** - * Set balance in cache - * - * @param {string} brandedTokenAddress - branded token address - * @param {string} owner - Account address - * @param {BigNumber} bigAmount - amount to be set - * - * @return {promise} - */ - setBalanceInCache: function (brandedTokenAddress, owner, bigAmount) { - const oThis = this - , brandedToken = new Token(brandedTokenAddress, oThis.chainId) - ; - - return brandedToken.setBalanceInCache(owner, bigAmount); - }, - /** * Update airdrop balance * From 36772c5d03d70b2198158e40d11d77359b8497dd Mon Sep 17 00:00:00 2001 From: Alpesh Date: Fri, 1 Jun 2018 15:59:01 +0530 Subject: [PATCH 31/72] set balance to dynamo on moc contract update. --- lib/contract_interact/EIP20TokenMock.js | 46 ++++++++++++++++++------- lib/contract_interact/branded_token.js | 2 ++ mocha_test/services/pricer/pay.js | 9 ++--- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/lib/contract_interact/EIP20TokenMock.js b/lib/contract_interact/EIP20TokenMock.js index 488a6af..0668bab 100644 --- a/lib/contract_interact/EIP20TokenMock.js +++ b/lib/contract_interact/EIP20TokenMock.js @@ -7,15 +7,24 @@ * @module lib/contract_interact/pricer * */ -const rootPrefix = '../..'; -const helper = require(rootPrefix + '/lib/contract_interact/helper'); -const coreAddresses = require(rootPrefix + '/config/core_addresses'); -const web3Provider = require(rootPrefix + '/lib/web3/providers/ws'); -const coreConstants = require(rootPrefix + '/config/core_constants'); -const contractName = 'eip20tokenmock'; -const contractAbi = coreAddresses.getAbiForContract(contractName); -const gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') -const currContract = new web3Provider.eth.Contract(contractAbi); + +const openSTStorage = require('@openstfoundation/openst-storage') +; + +const rootPrefix = '../..' + , helper = require(rootPrefix + '/lib/contract_interact/helper') + , coreAddresses = require(rootPrefix + '/config/core_addresses') + , web3Provider = require(rootPrefix + '/lib/web3/providers/ws') + , gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') + , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') + , basicHelper = require(rootPrefix + '/helpers/basic_helper') + , logger = require(rootPrefix + '/helpers/custom_console_logger') +; + +const contractName = 'eip20tokenmock' + , contractAbi = coreAddresses.getAbiForContract(contractName) + , currContract = new web3Provider.eth.Contract(contractAbi) +; /** @@ -57,24 +66,37 @@ MockToken.prototype = { * */ setBalance: function (senderAddress, senderPassphrase, ownerAddress, value, gasPrice) { + const oThis = this; + if (!gasPrice) { return Promise.reject('GasPrice is mandatory'); } helper.assertAddress(ownerAddress); helper.assertAddress(senderAddress); - currContract.options.address = this.contractAddress; + currContract.options.address = oThis.contractAddress; //currContract.setProvider( web3Provider.currentProvider ); const transactionObject = currContract.methods.setBalance(ownerAddress, value); const encodedABI = transactionObject.encodeABI(); return helper.safeSendFromAddr( web3Provider, - this.contractAddress, + oThis.contractAddress, encodedABI, senderAddress, senderPassphrase, { gasPrice: gasPrice, gas: gasLimitGlobalConstant.default() } - ).then(function(transactionReceipt) { + ).then(async function(transactionReceipt) { + // set balance in dynamo and cache. + const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: oThis.brandedTokenAddress + }).set({ + ethereum_address: owner, + settle_amount: basicHelper.convertToBigNumber(value).toString(10) + }).catch(function (error) { + logger.error('lib/contract_interact/EIP20TokenMock.js:set Balance inside catch:', error); + }); return Promise.resolve(transactionReceipt); }); }, diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 673a4c7..8d2cc14 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -243,6 +243,8 @@ BrandedToken.prototype = { try { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, erc20_contract_address: oThis.brandedTokenAddress }).update({ ethereum_address: owner, diff --git a/mocha_test/services/pricer/pay.js b/mocha_test/services/pricer/pay.js index afa9795..fb41e18 100644 --- a/mocha_test/services/pricer/pay.js +++ b/mocha_test/services/pricer/pay.js @@ -12,13 +12,14 @@ const rootPrefix = "../../.." , pricerOstEur = new pricer(constants.pricerOstEurAddress, constants.chainId) , mockToken = require(rootPrefix + '/lib/contract_interact/EIP20TokenMock') , TC5 = new mockToken(constants.TC5Address) - , BalanceCacheKlass = require(rootPrefix + '/lib/cache_management/balance') - , balanceCache = new BalanceCacheKlass(constants.chainId, constants.TC5Address) - , BrandedTokenKlass = require(rootPrefix + '/lib/contract_interact/branded_token'); + , BrandedTokenKlass = require(rootPrefix + '/lib/contract_interact/branded_token') + , brandedTokenObj = new BrandedTokenKlass(constants.TC5Address, constants.chainId) ; async function getAmountFromCache(address) { - const resp = await balanceCache.getBalance(address); + + const resp = await brandedTokenObj.getBalanceOf(address); + return new BigNumber(resp.data.response); } From 23a58b21aa9f6c5c6c838e8073cb965b36c35520 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Fri, 1 Jun 2018 16:06:41 +0530 Subject: [PATCH 32/72] cache balance shifted to openst storage. --- lib/cache_management/balance.js | 95 -------------------------- lib/contract_interact/branded_token.js | 38 ----------- 2 files changed, 133 deletions(-) delete mode 100644 lib/cache_management/balance.js diff --git a/lib/cache_management/balance.js b/lib/cache_management/balance.js deleted file mode 100644 index e2711b6..0000000 --- a/lib/cache_management/balance.js +++ /dev/null @@ -1,95 +0,0 @@ -//"use strict"; - -/** - * - * This is cache layer for balance related caching

- * - * @module lib/cache_management/balance_cache - * - */ -const openStCache = require('@openstfoundation/openst-cache') -; - -const rootPrefix = '../..' - , responseHelper = require(rootPrefix + '/lib/formatter/response') - , logger = require(rootPrefix + '/helpers/custom_console_logger') - , coreConstants = require(rootPrefix + '/config/core_constants') -; - -const cacheImplementer = new openStCache.cache(coreConstants.CACHING_ENGINE, true) - , cacheKeys = openStCache.OpenSTCacheKeys -; - -/** - * constructor - * - * @param {string} chainId - Chain id - * @param {string} brandedTokenAddress - address of branded token contract - * - * @constructor - */ -const BalanceCache = module.exports= function(chainId, brandedTokenAddress) { - const oThis = this; - oThis.chainId = chainId; - oThis.brandedTokenAddress = brandedTokenAddress; -}; - -BalanceCache.prototype = { - - chainId: null, - brandedTokenAddress: null, - - - /** - * Get balance from cache - * - * @param {string} owner - address of user whose balance is to be found - * - * @return {promise} - * - */ - getBalance: function (owner) { - const oThis = this - , cacheKey = cacheKeys.btBalance(oThis.chainId, oThis.brandedTokenAddress, owner) - ; - - //logger.debug('getBalance called with params:', JSON.stringify({owner: owner, cacheKey: cacheKey})); - - return cacheImplementer.get(cacheKey); - }, - - /** - * Set balance to cache - * - * @param {string} owner - address of user whose balance is to be set - * @param {BigNumber} balance - balance of the user - * - * @return {promise} - * - */ - setBalance: function (owner, balance) { - const oThis = this - , cacheKey = cacheKeys.btBalance(oThis.chainId, oThis.brandedTokenAddress, owner) - ; - - // logger.debug('setBalance called with params:', JSON.stringify({owner: owner, balance: balance.toString(10), - // cacheKey: cacheKey})); - - return cacheImplementer.set(cacheKey, balance.toString(10)); - }, - - /** - * Clear balance from cache - * - * @param {string} owner - address of user whose balance is to be set - * - * @return {promise} - * - */ - clearBalance: function(owner) { - const oThis = this; - const cacheKey = cacheKeys.btBalance(oThis.chainId, oThis.brandedTokenAddress, owner); - return cacheImplementer.del(cacheKey); - } - -}; diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 8d2cc14..622ff71 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -20,7 +20,6 @@ const rootPrefix = '../..' , logger = require(rootPrefix + '/helpers/custom_console_logger') , notificationGlobalConstant = require(rootPrefix + '/lib/global_constant/notification') , gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') - , BalanceCacheKlass = require(rootPrefix + '/lib/cache_management/balance') , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') @@ -51,7 +50,6 @@ const BrandedToken = function (brandedTokenAddress, chainId) { oThis.brandedTokenAddress = brandedTokenAddress; oThis.chainId = chainId; - oThis.balanceCache = new BalanceCacheKlass(chainId, brandedTokenAddress); }; BrandedToken.prototype = { @@ -66,11 +64,6 @@ BrandedToken.prototype = { */ chainId: null, - /** - * balance cache - */ - balanceCache: null, - /** * Fetch Balance For a given address * @@ -120,37 +113,6 @@ BrandedToken.prototype = { } }, - /** - * Fetch Balance For a given address from contract - * - * @param {string} owner - address for which balance is to be fetched - * - * @return {promise} - * - */ - getBalanceFromContract: async function (owner) { - const oThis = this - ; - - try { - const transactionObject = currContract.methods.balanceOf(owner) - , encodedABI = transactionObject.encodeABI() - , transactionOutputs = helper.getTransactionOutputs(transactionObject) - , response = await helper.call(web3Provider, oThis.brandedTokenAddress, encodedABI, {}, transactionOutputs); - - return Promise.resolve(responseHelper.successWithData({balance: response[0]})); - } catch(err) { - let errorParams = { - internal_error_identifier: 'l_ci_bt_getBalanceFromContract_1', - api_error_identifier: 'unhandled_api_error', - error_config: errorConfig, - debug_options: {} - }; - logger.error('lib/contract_interact/branded_token.js:getBalanceFromContract inside catch:', err); - return Promise.resolve(responseHelper.error(errorParams)); - } - }, - /** * Transfer amount to budget holder * From 4f63eafa6246bd1e07677431ee59ea67ae473089 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Mon, 4 Jun 2018 18:50:21 +0530 Subject: [PATCH 33/72] new openst storage. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 906a8dc..24bfcda 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.6", + "@openstfoundation/openst-storage": "1.0.0-beta.9", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 8adc9887b3f670623d43ec5be1cf143ff2113a7a Mon Sep 17 00:00:00 2001 From: Alpesh Date: Tue, 5 Jun 2018 11:36:48 +0530 Subject: [PATCH 34/72] openst storage changes, --- .travis.yml | 2 +- lib/contract_interact/EIP20TokenMock.js | 7 ++++--- lib/contract_interact/branded_token.js | 4 +++- lib/transaction_helper.js | 7 ++++--- mocha_test/services/pricer/pay.js | 5 ++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c5ac9d..e880919 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ before_script: - export OS_DYNAMODB_REGION='localhost' - export OS_DYNAMODB_ENDPOINT='http://localhost:8000' - node tools/dynamo_db_init.js -script: +script: - truffle test - cd mocha_test/scripts/ - bash travis_test.sh diff --git a/lib/contract_interact/EIP20TokenMock.js b/lib/contract_interact/EIP20TokenMock.js index 0668bab..b4ed02f 100644 --- a/lib/contract_interact/EIP20TokenMock.js +++ b/lib/contract_interact/EIP20TokenMock.js @@ -90,10 +90,11 @@ MockToken.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, auto_scaling: null, - erc20_contract_address: oThis.brandedTokenAddress + erc20_contract_address: oThis.contractAddress }).set({ - ethereum_address: owner, - settle_amount: basicHelper.convertToBigNumber(value).toString(10) + ethereum_address: ownerAddress, + settle_amount: basicHelper.convertToBigNumber(value).toString(10), + un_settled_debit_amount: basicHelper.convertToBigNumber(0).toString(10), }).catch(function (error) { logger.error('lib/contract_interact/EIP20TokenMock.js:set Balance inside catch:', error); }); diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 622ff71..5477391 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -90,7 +90,9 @@ BrandedToken.prototype = { } const balanceResponse = await new openSTStorage.TokenBalanceCache({ - erc20_contract_address: oThis.brandedTokenAddress, ethereum_addresses: [owner] + ddb_service: ddbServiceObj, + erc20_contract_address: oThis.brandedTokenAddress, + ethereum_addresses: [owner] }).fetch(); if (balanceResponse.isFailure()) { diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index b2e0f90..9d9945c 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -222,7 +222,7 @@ TransactionHelper.prototype = { logger.debug('lib/transaction_helper.js:beforePay called with params:', JSON.stringify( {brandedTokenAddress: brandedTokenAddress, spender: spender, estimatedPayAmount: estimatedPayAmount})); - return oThis.debitBalance(brandedTokenAddress, spender, estimatedPayAmount); + return oThis.pessimisticDebit(brandedTokenAddress, spender, estimatedPayAmount); }, /** @@ -239,7 +239,7 @@ TransactionHelper.prototype = { * @return {promise} * */ - afterPaySuccess: async function(brandedTokenAddress, spender, estimatedPayAmount, beneficiaryAddress, + afterPaySuccess_back: async function(brandedTokenAddress, spender, estimatedPayAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount) { const oThis = this // adjustment cache for spender @@ -277,10 +277,11 @@ TransactionHelper.prototype = { const oThis = this ; + estimatedPayAmount = basicHelper.convertToBigNumber(estimatedPayAmount).mul(basicHelper.convertToBigNumber(-1)); logger.debug('lib/transaction_helper.js:afterPayFailure called with params:', JSON.stringify( {brandedTokenAddress: brandedTokenAddress, spender: spender, estimatedPayAmount: estimatedPayAmount})); - return oThis.creditBalance(brandedTokenAddress, spender, estimatedPayAmount); + return oThis.pessimisticDebit(brandedTokenAddress, spender, estimatedPayAmount); }, /** diff --git a/mocha_test/services/pricer/pay.js b/mocha_test/services/pricer/pay.js index fb41e18..84c54e2 100644 --- a/mocha_test/services/pricer/pay.js +++ b/mocha_test/services/pricer/pay.js @@ -20,7 +20,7 @@ async function getAmountFromCache(address) { const resp = await brandedTokenObj.getBalanceOf(address); - return new BigNumber(resp.data.response); + return new BigNumber(resp.data.balance); } describe('Pay', function() { @@ -75,8 +75,7 @@ describe('Pay', function() { const poResult = await pricerOstUsd.priceOracles(constants.currencyUSD); assert.equal(poResult.isSuccess(), true); assert.equal(constants.priceOracles.OST.USD, poResult.data.priceOracles); - - await TC5.setBalance( + const setBalResp = await TC5.setBalance( constants.ops, constants.opsPassphrase, constants.account1, From 8082021cf1affc788ecc8b476093023f69546c68 Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Tue, 5 Jun 2018 17:09:18 +0530 Subject: [PATCH 35/72] storage integration. --- lib/contract_interact/airdrop.js | 363 +++++++++++------------ lib/contract_interact/helper.js | 52 ++-- lib/contract_interact/pricer.js | 140 +++++---- lib/transaction_helper.js | 482 +++++++++++++++++++++++-------- 4 files changed, 651 insertions(+), 386 deletions(-) diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index 9b18640..5d510d1 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -17,7 +17,7 @@ const rootPrefix = '../..' , responseHelper = require(rootPrefix + '/lib/formatter/response') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') - , eventGlobalConstants = require(rootPrefix+'/lib/global_constant/events') + , eventGlobalConstants = require(rootPrefix + '/lib/global_constant/events') , notificationGlobalConstant = require(rootPrefix + '/lib/global_constant/notification') , gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') , Pricer = require(rootPrefix + '/lib/contract_interact/pricer') @@ -60,8 +60,33 @@ Airdrop.prototype = Object.create(Pricer.prototype); Airdrop.prototype.constructor = Airdrop; +Airdrop.prototype.pay = function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, + transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, + spender, gasPrice, options) { + const oThis = this + ; + + return oThis._asyncPay(senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, + transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, + spender, gasPrice, options) + .catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::pay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_ci_a_pay_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + }); +}; + /** - * Pay + * Actual pay method - can give rejections of Promise * * @param {string} senderWorkerAddress - address of worker * @param {string} senderWorkerPassphrase - passphrase of worker @@ -72,22 +97,25 @@ Airdrop.prototype.constructor = Airdrop; * @param {string} currency - quote currency * @param {BigNumber} intendedPricePoint - price point at which the pay is intended (in wei) * @param {string} spender - User address - * @param {Hex} gas_price - gas price + * @param {Hex} gasPrice - gas price * @param {object} options - for params like returnType, tag. * * @return {promise} * */ -Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, - transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, - spender, gasPrice, options) { +Airdrop.prototype._asyncPay = async function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, + transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, + spender, gasPrice, options) { logger.debug("\nAirdrop.pay.params"); - logger.debug("\nsenderWorkerAddress: ", senderWorkerAddress, "\nbeneficiaryAddress: ",beneficiaryAddress, "\ntransferAmount: ",transferAmount, "\ncommissionBeneficiaryAddress ",commissionBeneficiaryAddress, - "\ncommissionAmount: ",commissionAmount, "\ncurrency: ",currency, "\nintendedPricePoint",intendedPricePoint, - "\nspender",spender, "\ngasPrice", gasPrice, "\noptions", options); - const oThis = this; + logger.debug("\nsenderWorkerAddress: ", senderWorkerAddress, "\nbeneficiaryAddress: ", beneficiaryAddress, "\ntransferAmount: ", + transferAmount, "\ncommissionBeneficiaryAddress ", commissionBeneficiaryAddress, + "\ncommissionAmount: ", commissionAmount, "\ncurrency: ", currency, "\nintendedPricePoint", intendedPricePoint, + "\nspender", spender, "\ngasPrice", gasPrice, "\noptions", options); - const validationResponse = helper.validateAirdropPayParams(senderWorkerAddress, + const oThis = this + ; + + await helper.validateAirdropPayParams(senderWorkerAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, @@ -96,101 +124,85 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr intendedPricePoint, gasPrice, spender); - logger.debug("==========airdrop.pay.validateAirdropPayParams==========="); - logger.debug(validationResponse); - - if (validationResponse.isFailure()) { - return Promise.resolve(validationResponse); - } // validate if spender has the balance - var totalAmount = 0; - // If currency is not present + let totalTransferAmount = 0; + // If currency is not present, amounts are in BT if (!currency) { - totalAmount = new BigNumber(0) + totalTransferAmount = basicHelper.convertToBigNumber(0) .plus(transferAmount) .plus(commissionAmount); - } else { - // return Big Number - totalAmount = await oThis.getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint); - logger.debug("=========totalAmount========", totalAmount); + } else { // amounts are in USD + totalTransferAmount = await oThis.getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint); + logger.debug("=========totalAmount========", totalTransferAmount); } - const spenderAccountBalanceResponse = await oThis.getBalanceOf(spender); + const spenderOnChainAvailableBalanceResponse = await oThis.getBalanceOf(spender); logger.debug("==========airdrop.pay.senderAccountBalanceResponse==========="); - logger.debug(spenderAccountBalanceResponse); - if (spenderAccountBalanceResponse.isFailure()) { + logger.debug(spenderOnChainAvailableBalanceResponse); + if (spenderOnChainAvailableBalanceResponse.isFailure()) { let errorParams = { - internal_error_identifier: 'l_ci_a_pay_1', + internal_error_identifier: 'l_ci_a_async_pay_1', api_error_identifier: 'db_get_failed', error_config: errorConfig, debug_options: {} }; - return Promise.resolve(responseHelper.error(errorParams)); + return Promise.reject(responseHelper.error(errorParams)); } - var AirdropUserBalanceObject = new AirdropUserBalanceKlass({ + + let spenderOnChainAvailableBalance = basicHelper.convertToBigNumber(spenderOnChainAvailableBalanceResponse.data.balance); + logger.debug(`\nuserInitialBalance: ${spenderOnChainAvailableBalance.toString(10)}`); + + let spenderAirdropBalanceResponse = await new AirdropUserBalanceKlass({ chain_id: oThis.chainId, airdrop_contract_address: oThis.contractAddress, user_addresses: [spender] - }); - const airdropBalanceResult = await AirdropUserBalanceObject.perform(); + }).perform(); + logger.debug("==========airdrop.pay.airdropBalanceResult==========="); - logger.debug(airdropBalanceResult); - if (airdropBalanceResult.isFailure()){ - return Promise.resolve(airdropBalanceResult); + logger.debug(spenderAirdropBalanceResponse); + if (spenderAirdropBalanceResponse.isFailure()) { + return Promise.reject(spenderAirdropBalanceResponse); } - var userAirdropAmount = !(airdropBalanceResult.data[spender]) ? 0 : airdropBalanceResult.data[spender].balanceAirdropAmount - , userAirdropAmount = new BigNumber(userAirdropAmount) + let spenderAirdropBalance = spenderAirdropBalanceResponse.data[spender] ? + basicHelper.convertToBigNumber(spenderAirdropBalanceResponse.data[spender].balanceAirdropAmount) : + basicHelper.convertToBigNumber(0) ; - const userInitialBalance = new BigNumber(spenderAccountBalanceResponse.data.balance) - // Minimum of total and airdrop amount as per contract logic - , airdropAmountToUse = BigNumber.min(totalAmount, userAirdropAmount) + + // to give airdrop balance higher preference, we compute the min of total amount and airdrop balance + let airdropBalanceToUse = BigNumber.min(totalTransferAmount, spenderAirdropBalance) ; - logger.debug(`\nuserInitialBalance: ${userInitialBalance.toString(10)}`); - logger.debug(`\nairdropAmountToUse: ${airdropAmountToUse.toString(10)}`); - logger.debug(`\ntotalAmount: ${totalAmount.toString(10)}`); - logger.debug(`\nuserInitialBalance.plus(airdropAmountToUse): ${(userInitialBalance.plus(airdropAmountToUse)).toString(10)}`); + logger.debug(`\nairdropBalanceToUse: ${airdropBalanceToUse.toString(10)}`); + logger.debug(`\ntotalAmount: ${totalTransferAmount.toString(10)}`); + logger.debug(`\nuserInitialBalance.plus(airdropBalanceToUse): ${(spenderOnChainAvailableBalance.plus(airdropBalanceToUse)).toString(10)}`); - if ((userInitialBalance.plus(airdropAmountToUse)).lt(totalAmount)) { + // validate if the spender has enough balance (airdrop + on chain available) + if ((spenderOnChainAvailableBalance.plus(airdropBalanceToUse)).lt(totalTransferAmount)) { let errorParams = { - internal_error_identifier: 'l_ci_a_pay_2', + internal_error_identifier: 'l_ci_a_async_pay_2', api_error_identifier: 'insufficient_funds', error_config: errorConfig, debug_options: {} }; - return Promise.resolve(responseHelper.error(errorParams)); + return Promise.reject(responseHelper.error(errorParams)); } - var brandedTokenAddress = null; const brandedTokenResponse = await oThis.brandedToken(); - if (brandedTokenResponse.isSuccess()) { - brandedTokenAddress = brandedTokenResponse.data.brandedToken; - } else { - return Promise.resolve(brandedTokenResponse); - } + if (brandedTokenResponse.isFailure()) return Promise.reject(brandedTokenResponse); + + let brandedTokenAddress = brandedTokenResponse.data.brandedToken; - var airdropBudgetHolder = null; const airdropBudgetHolderResponse = await oThis.airdropBudgetHolder(); - if (airdropBudgetHolderResponse.isSuccess()) { - airdropBudgetHolder = airdropBudgetHolderResponse.data.airdropBudgetHolder; - } else { - return Promise.resolve(airdropBudgetHolderResponse); - } + if (airdropBudgetHolderResponse.isSuccess()) return Promise.reject(airdropBudgetHolderResponse); + + let airdropBudgetHolder = airdropBudgetHolderResponse.data.airdropBudgetHolder; const returnType = basicHelper.getReturnType(options.returnType); logger.debug("==========airdrop.pay.params==========="); - logger.debug(beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, spender, userAirdropAmount.toString(10)); - const transactionObject = currContract.methods.payAirdrop( - beneficiaryAddress, - transferAmount, - commissionBeneficiaryAddress, - commissionAmount, - web3Provider.utils.asciiToHex(currency), - intendedPricePoint, - spender, - userAirdropAmount.toString(10)); + logger.debug(beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, + intendedPricePoint, spender, spenderAirdropBalance.toString(10)); const notificationData = helper.getNotificationData( ['transfer.payments.airdrop.pay'], @@ -210,24 +222,25 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr spender: spender, brandedTokenAddress: brandedTokenAddress, contractAddress: oThis.contractAddress, - totalAmount: totalAmount.toString(10), - airdropAmountToUse: airdropAmountToUse.toString(10), + totalAmount: totalTransferAmount.toString(10), + airdropAmountToUse: airdropBalanceToUse.toString(10), airdropBudgetHolder: airdropBudgetHolder, chainId: oThis.chainId }; - const failCallback = async function(reason) { - return await oThis.onAirdropPayFailure(postPayParams);; + const failCallback = function (reason) { + return oThis.onAirdropPayFailure(postPayParams); }; - const successCallback = async function(receipt) { + const successCallback = async function (receipt) { const setAddressToNameMapResponse = await oThis.setAddressToNameMap(); - if (setAddressToNameMapResponse.isFailure()){ + if (setAddressToNameMapResponse.isFailure()) { return setAddressToNameMapResponse; } - const actualAmountsFromReceipt = oThis.transactionHelper.getActualAmountsFromReceipt(receipt, oThis.addressToNameMap, eventGlobalConstants.eventAirdropPayment()); + const actualAmountsFromReceipt = oThis.transactionHelper.getActualAmountsFromReceipt(receipt, oThis.addressToNameMap, + eventGlobalConstants.eventAirdropPayment()); logger.debug("========airdrop.pay.actualAmountsFromReceipt Response========"); logger.debug(actualAmountsFromReceipt); if (actualAmountsFromReceipt.isSuccess()) { @@ -237,7 +250,17 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr } }; - const params = { + const transactionObject = currContract.methods.payAirdrop( + beneficiaryAddress, + transferAmount, + commissionBeneficiaryAddress, + commissionAmount, + web3Provider.utils.asciiToHex(currency), + intendedPricePoint, + spender, + spenderAirdropBalance.toString(10)); + + const sendPerformParams = { transactionObject: transactionObject, notificationData: notificationData, senderAddress: senderWorkerAddress, @@ -252,33 +275,33 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr }; if (options && options.shouldHandlePostPay == 0) { - params.processReceipt = 0; - params.postReceiptProcessParams = postPayParams; + sendPerformParams.processReceipt = 0; + sendPerformParams.postReceiptProcessParams = postPayParams; } else { - params.processReceipt = 1; + sendPerformParams.processReceipt = 1; } const beforePayResponse = await oThis.transactionHelper.beforeAirdropPay( brandedTokenAddress, oThis.contractAddress, spender, - totalAmount, - airdropAmountToUse, + totalTransferAmount, + airdropBalanceToUse, airdropBudgetHolder); const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(beforePayResponse); if (isAllResponseSuccessful) { - return Promise.resolve(helper.performSend(params, returnType)); + return Promise.resolve(helper.performSend(sendPerformParams, returnType)); } else { let errorParams = { - internal_error_identifier: 'l_ci_a_pay_8', + internal_error_identifier: 'l_ci_a_async_pay_3', api_error_identifier: 'could_not_process', error_config: errorConfig, debug_options: {} }; logger.error('%Error - Something went wrong. It could be that either cache or airdrop used amount promise failed.'); // TODO: Discuss: we may need to do some revert ? - return Promise.resolve(responseHelper.error(errorParams)); + return Promise.reject(responseHelper.error(errorParams)); } }; @@ -302,7 +325,7 @@ Airdrop.prototype.pay = async function (senderWorkerAddress, senderWorkerPassphr * @return {promise} * */ -Airdrop.prototype.postAirdropPay = async function(airdropPostPayParams, decodedEvents, status) { +Airdrop.prototype.postAirdropPay = async function (airdropPostPayParams, decodedEvents, status) { const oThis = this ; @@ -341,55 +364,46 @@ Airdrop.prototype.postAirdropPay = async function(airdropPostPayParams, decodedE */ Airdrop.prototype.onAirdropPaySuccess = async function (airdropPostPayParams, actualAmountsFromReceipt) { - const oThis = this; - try { - const validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); - if (validationResponse.isFailure()) return Promise.resolve(validationResponse); - - const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress - , contractAddress = airdropPostPayParams.contractAddress - , spender = airdropPostPayParams.spender - , totalAmount = new BigNumber(airdropPostPayParams.totalAmount) - , airdropAmountToUse = new BigNumber(airdropPostPayParams.airdropAmountToUse) - , beneficiaryAddress = airdropPostPayParams.beneficiaryAddress - , commissionBeneficiaryAddress = airdropPostPayParams.commissionBeneficiaryAddress - , airdropBudgetHolder = airdropPostPayParams.airdropBudgetHolder - ; - - const afterSuccessResponse = await oThis.transactionHelper.afterAirdropPaySuccess( - brandedTokenAddress, - contractAddress, - spender, - totalAmount, - airdropAmountToUse, - beneficiaryAddress, - actualAmountsFromReceipt.actualBeneficiaryAmount, - commissionBeneficiaryAddress, - actualAmountsFromReceipt.actualCommissionAmount, - actualAmountsFromReceipt.actualAirdropAmount, - airdropBudgetHolder); - - const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterSuccessResponse); - if (isAllResponseSuccessful) { - return Promise.resolve(responseHelper.successWithData({})); - } - let errorParams = { - internal_error_identifier: 'l_ci_a_onAirdropPaySuccess_1', - api_error_identifier: 'could_not_process', - error_config: errorConfig, - debug_options: {} - }; - return Promise.resolve(responseHelper.error(errorParams)); - } catch (err) { - logger.error("lib/contract_interact/airdrop.js:onAirdropPaySuccess inside catch ", err); - let errorParams = { - internal_error_identifier: 'l_ci_a_onAirdropPaySuccess_2', - api_error_identifier: 'unhandled_api_error', - error_config: errorConfig, - debug_options: {} - }; - return Promise.resolve(responseHelper.error(errorParams)); + const oThis = this + , validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); + + if (validationResponse.isFailure()) return Promise.resolve(validationResponse); + + const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress + , contractAddress = airdropPostPayParams.contractAddress + , spender = airdropPostPayParams.spender + , totalTransferAmount = basicHelper.convertToBigNumber(airdropPostPayParams.totalAmount) + , airdropAmountToUse = basicHelper.convertToBigNumber(airdropPostPayParams.airdropAmountToUse) + , beneficiaryAddress = airdropPostPayParams.beneficiaryAddress + , commissionBeneficiaryAddress = airdropPostPayParams.commissionBeneficiaryAddress + , airdropBudgetHolder = airdropPostPayParams.airdropBudgetHolder + ; + + const afterSuccessResponse = await oThis.transactionHelper.afterAirdropPaySuccess( + brandedTokenAddress, + contractAddress, + spender, + totalTransferAmount, + airdropAmountToUse, + beneficiaryAddress, + actualAmountsFromReceipt.actualBeneficiaryAmount, + commissionBeneficiaryAddress, + actualAmountsFromReceipt.actualCommissionAmount, + actualAmountsFromReceipt.actualAirdropAmount, + airdropBudgetHolder); + + const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterSuccessResponse); + if (isAllResponseSuccessful) { + return Promise.resolve(responseHelper.successWithData({})); } + let errorParams = { + internal_error_identifier: 'l_ci_a_onAirdropPaySuccess_1', + api_error_identifier: 'could_not_process', + error_config: errorConfig, + debug_options: {} + }; + return Promise.resolve(responseHelper.error(errorParams)); + }; @@ -412,48 +426,39 @@ Airdrop.prototype.onAirdropPaySuccess = async function (airdropPostPayParams, ac */ Airdrop.prototype.onAirdropPayFailure = async function (airdropPostPayParams) { - const oThis = this; - try { - const validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); - if (validationResponse.isFailure()) return Promise.resolve(validationResponse); - - const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress - , contractAddress = airdropPostPayParams.contractAddress - , spender = airdropPostPayParams.spender - , totalAmount = new BigNumber(airdropPostPayParams.totalAmount) - , airdropAmountToUse = new BigNumber(airdropPostPayParams.airdropAmountToUse) - , airdropBudgetHolder = airdropPostPayParams.airdropBudgetHolder - ; - - const afterFailureResponse = await oThis.transactionHelper.afterAirdropPayFailure( - brandedTokenAddress, - contractAddress, - spender, - totalAmount, - airdropAmountToUse, - airdropBudgetHolder); - - const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterFailureResponse); - if (isAllResponseSuccessful) { - return Promise.resolve(responseHelper.successWithData({})); - } - let errorParams = { - internal_error_identifier: 'l_ci_a_onAirdropPayFailure_1', - api_error_identifier: 'could_not_process', - error_config: errorConfig, - debug_options: {} - }; - return Promise.resolve(responseHelper.error(errorParams)); - } catch(err) { - logger.error("lib/contract_interact/airdrop.js:onAirdropPayFailure inside catch ", err); - let errorParams = { - internal_error_identifier: 'l_ci_a_onAirdropPayFailure_2', - api_error_identifier: 'unhandled_api_error', - error_config: errorConfig, - debug_options: {} - }; - return Promise.resolve(responseHelper.error(errorParams)); + const oThis = this + ; + + const validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); + if (validationResponse.isFailure()) return Promise.reject(validationResponse); + + const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress + , contractAddress = airdropPostPayParams.contractAddress + , spender = airdropPostPayParams.spender + , totalTransferAmount = basicHelper.convertToBigNumber(airdropPostPayParams.totalAmount) + , airdropAmountToUse = basicHelper.convertToBigNumber(airdropPostPayParams.airdropAmountToUse) + , airdropBudgetHolderAddress = airdropPostPayParams.airdropBudgetHolder + ; + + const afterFailureResponse = await oThis.transactionHelper.afterAirdropPayFailure( + brandedTokenAddress, + contractAddress, + spender, + totalTransferAmount, + airdropAmountToUse, + airdropBudgetHolderAddress); + + const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterFailureResponse); + if (isAllResponseSuccessful) { + return Promise.resolve(responseHelper.successWithData({})); } + let errorParams = { + internal_error_identifier: 'l_ci_a_onAirdropPayFailure_1', + api_error_identifier: 'could_not_process', + error_config: errorConfig, + debug_options: {} + }; + return Promise.resolve(responseHelper.error(errorParams)); }; @@ -464,7 +469,7 @@ Airdrop.prototype.onAirdropPayFailure = async function (airdropPostPayParams) { * @return {promise} * */ -Airdrop.prototype.airdropBudgetHolder = async function() { +Airdrop.prototype.airdropBudgetHolder = async function () { const oThis = this ; @@ -480,7 +485,7 @@ Airdrop.prototype.airdropBudgetHolder = async function() { return Promise.resolve(getAirdropBudgetHolderFromContractResponse); } - } catch(err) { + } catch (err) { let errorParams = { internal_error_identifier: 'l_ci_a_airdropBudgetHolder_1', api_error_identifier: 'unhandled_api_error', @@ -499,7 +504,7 @@ Airdrop.prototype.airdropBudgetHolder = async function() { * @return {promise} * */ -Airdrop.prototype.getAirdropBudgetHolderFromContract = async function() { +Airdrop.prototype.getAirdropBudgetHolderFromContract = async function () { const oThis = this ; @@ -517,7 +522,7 @@ Airdrop.prototype.getAirdropBudgetHolderFromContract = async function() { * @return {promise} * */ -Airdrop.prototype.getWorkers = async function() { +Airdrop.prototype.getWorkers = async function () { const oThis = this ; diff --git a/lib/contract_interact/helper.js b/lib/contract_interact/helper.js index 4fd1bb0..9dbe91b 100644 --- a/lib/contract_interact/helper.js +++ b/lib/contract_interact/helper.js @@ -513,7 +513,7 @@ ContractInteractHelper.prototype = { errorCode = 'l_ci_h_pse_gas_low'; reason.message = "insufficient gas" } - const receiptFailResponse =onReceiptFail(errorCode, reason, {}); + const receiptFailResponse = onReceiptFail(errorCode, reason, {}); return receiptFailResponse; } }; @@ -521,7 +521,7 @@ ContractInteractHelper.prototype = { if (basicHelper.isReturnTypeTxReceipt(returnType) && processReceipt==0){ const errorCode = 'l_ci_h_pse_3' , reason = 'not supported for returnType=txReceipt and processReceipt=0' - , receiptFailResponse =onReceiptFail(errorCode, reason, {}); + , receiptFailResponse = onReceiptFail(errorCode, reason, {}) ; if (isValueReturned == false) { isValueReturned = true; @@ -716,10 +716,10 @@ ContractInteractHelper.prototype = { * @param {BigNumber} commissionAmount - commission amount (in wei) * @param {string} currency - quote currency * - * @return {result} + * @return {promise} * */ - validateCommonPayParams: function (senderAddress, + validateCommonPayParams: async function (senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, @@ -740,7 +740,7 @@ ContractInteractHelper.prototype = { debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (transferAmount.isNaN() || !transferAmount.isInteger()) { let errorParams = { @@ -751,7 +751,7 @@ ContractInteractHelper.prototype = { debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (transferAmount.equals(0)) { @@ -762,7 +762,7 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['zero_transfer_amount'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (commissionAmount.isNaN() || !commissionAmount.isInteger()) { let errorParams = { @@ -772,7 +772,7 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['invalid_commission_amount'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (!basicHelper.isAddressValid(beneficiaryAddress)) { @@ -783,7 +783,7 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['beneficiary_address_invalid'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (!basicHelper.isAddressValid(commissionBeneficiaryAddress)) { let errorParams = { @@ -793,7 +793,7 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['commission_beneficiary_address_invalid'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (!oThis.isValidCurrency(currency, true)) { let errorParams = { @@ -803,10 +803,10 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['invalid_currency'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } - return responseHelper.successWithData({}); + return Promise.resolve(responseHelper.successWithData({})); }, /** @@ -821,10 +821,10 @@ ContractInteractHelper.prototype = { * @param {BigNumber} intendedPricePoint - price point at which the pay is intended (in wei) * @param {BigNumber} gasPrice - gas price * - * @return {result} + * @return {promise} * */ - validatePayParams: function( + validatePayParams: async function( senderAddress, beneficiaryAddress, transferAmount, @@ -839,16 +839,14 @@ ContractInteractHelper.prototype = { intendedPricePoint = new BigNumber(intendedPricePoint); - const commonParamsValidationResponse = oThis.validateCommonPayParams(senderAddress, + await oThis.validateCommonPayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency); - if (commonParamsValidationResponse.isFailure()) { - return commonParamsValidationResponse; - } + if (intendedPricePoint.isNaN() || !intendedPricePoint.isInteger()) { let errorParams = { internal_error_identifier: 'l_ci_h_vpp_8', @@ -857,7 +855,7 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['price_point_invalid'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } if (!gasPrice ) { let errorParams = { @@ -867,9 +865,9 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['gas_price_invalid'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } - return responseHelper.successWithData({}); + return Promise.resolve(responseHelper.successWithData({})); }, /** @@ -888,7 +886,7 @@ ContractInteractHelper.prototype = { * @return {Promise} * */ - validateAirdropPayParams: function( + validateAirdropPayParams: async function( senderAddress, beneficiaryAddress, transferAmount, @@ -902,7 +900,7 @@ ContractInteractHelper.prototype = { const oThis = this ; - const validationResponse = oThis.validatePayParams(senderAddress, + await oThis.validatePayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, @@ -911,10 +909,6 @@ ContractInteractHelper.prototype = { intendedPricePoint, gasPrice); - if (validationResponse.isFailure()) { - return validationResponse; - } - if (!basicHelper.isAddressValid(user)) { let errorParams = { internal_error_identifier: 'l_ci_h_vapp_2', @@ -923,10 +917,10 @@ ContractInteractHelper.prototype = { params_error_identifiers: ['invalid_user_address'], debug_options: {} }; - return responseHelper.paramValidationError(errorParams); + return Promise.reject(responseHelper.paramValidationError(errorParams)); } - return responseHelper.successWithData({}); + return Promise.resolve(responseHelper.successWithData({})); }, /** diff --git a/lib/contract_interact/pricer.js b/lib/contract_interact/pricer.js index 67bc24a..6ddd2a0 100644 --- a/lib/contract_interact/pricer.js +++ b/lib/contract_interact/pricer.js @@ -918,9 +918,49 @@ Pricer.prototype = { }, /** - * Pay + * Pay + * + * @param {string} spenderAddress - address of sender + * @param {string} senderPassphrase - passphrase of sender + * @param {string} beneficiaryAddress - address of beneficiary account + * @param {BigNumber} transferAmount - transfer amount (in wei) + * @param {string} commissionBeneficiaryAddress - address of commision beneficiary account + * @param {BigNumber} commissionAmount - commission amount (in wei) + * @param {string} currency - quote currency + * @param {BigNumber} intendedPricePoint - price point at which the pay is intended (in wei) + * @param {BigNumber} gasPrice - gas price + * @param {object} options - for params like returnType, tag. + * + * @return {promise} + * + */ + pay: function (spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, + commissionAmount, currency, intendedPricePoint, gasPrice, options) { + const oThis = this + ; + + return oThis._asyncPay(spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, + commissionAmount, currency, intendedPricePoint, gasPrice, options) + .catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::pay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_ci_p_pay_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + }); +}, + + /** + * Actual Pay - can give rejections of promise * - * @param {string} senderAddress - address of sender + * @param {string} spenderAddress - address of sender * @param {string} senderPassphrase - passphrase of sender * @param {string} beneficiaryAddress - address of beneficiary account * @param {BigNumber} transferAmount - transfer amount (in wei) @@ -934,13 +974,13 @@ Pricer.prototype = { * @return {promise} * */ - pay: async function (senderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, + _asyncPay: async function (spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, options) { const oThis = this ; - const validationResponse = helper.validatePayParams(senderAddress, + await helper.validatePayParams(spenderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, @@ -949,72 +989,48 @@ Pricer.prototype = { intendedPricePoint, gasPrice); - if (validationResponse.isFailure()) { - return Promise.resolve(validationResponse); - } - // validate if user has the balance - var totalAmount = 0; + var totalTransferAmount = 0; if (!currency) { // If currency not present - totalAmount = new BigNumber(0) + totalTransferAmount = new BigNumber(0) .plus(transferAmount) .plus(commissionAmount); } else { // If currency is present - totalAmount = await oThis.getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint); + totalTransferAmount = await oThis.getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint); } - const senderAccountBalanceResponse = await oThis.getBalanceOf(senderAddress); + const senderAccountBalanceResponse = await oThis.getBalanceOf(spenderAddress); if (senderAccountBalanceResponse.isFailure()) { let errorParams = { - internal_error_identifier: 'l_ci_p_pay_1', + internal_error_identifier: 'l_ci_p_async_pay_1', api_error_identifier: 'get_balance_failed', error_config: errorConfig, debug_options: {} }; - return Promise.resolve(responseHelper.error(errorParams)); + return Promise.reject(responseHelper.error(errorParams)); } - const userInitialBalance = new BigNumber(senderAccountBalanceResponse.data.balance); - if (userInitialBalance.lt(totalAmount)) { + const spenderOnChainAvailableBalanceResponse = new BigNumber(senderAccountBalanceResponse.data.balance); + + // if available balance is insufficient, error out + if (spenderOnChainAvailableBalanceResponse.lt(totalTransferAmount)) { let errorParams = { - internal_error_identifier: 'l_ci_p_pay_2', + internal_error_identifier: 'l_ci_p_async_pay_2', api_error_identifier: 'insufficient_funds', error_config: errorConfig, debug_options: {} }; - return Promise.resolve(responseHelper.error(errorParams)); + return Promise.reject(responseHelper.error(errorParams)); } - var brandedTokenAddress = null; const brandedTokenResponse = await oThis.brandedToken(); - if (brandedTokenResponse.isSuccess()) { - brandedTokenAddress = brandedTokenResponse.data.brandedToken; - } else { - return Promise.resolve(brandedTokenResponse); - } + if(brandedTokenResponse.isFailure()) return Promise.reject(brandedTokenResponse); - const returnType = basicHelper.getReturnType(options.returnType); - - const transactionObject = currContract.methods.pay( - beneficiaryAddress, - transferAmount, - commissionBeneficiaryAddress, - commissionAmount, - web3Provider.utils.asciiToHex(currency), - intendedPricePoint); + let brandedTokenAddress = brandedTokenResponse.data.brandedToken; - const notificationData = helper.getNotificationData( - ['transfer.payments.pricer.pay'], - notificationGlobalConstant.publisher(), - 'pay', - oThis.contractName, - oThis.contractAddress, - web3Provider, - oThis.chainId, - options); - notificationData.message.payload.erc20_contract_address = brandedTokenAddress; + const returnType = basicHelper.getReturnType(options.returnType); const successCallback = async function(receipt) { const setAddressToNameMapResponse = await oThis.setAddressToNameMap(); @@ -1027,26 +1043,45 @@ Pricer.prototype = { if (actualAmountFromReceipt.isSuccess()) { return oThis.transactionHelper.afterPaySuccess( brandedTokenAddress, - senderAddress, - totalAmount, + spenderAddress, + totalTransferAmount, beneficiaryAddress, actualAmountFromReceipt.data.actualBeneficiaryAmount, commissionBeneficiaryAddress, actualAmountFromReceipt.data.actualCommissionAmount); } else { - return oThis.transactionHelper.afterPayFailure(brandedTokenAddress, senderAddress, totalAmount); + return oThis.transactionHelper.afterPayFailure(brandedTokenAddress, spenderAddress, totalTransferAmount); } }; const failCallback = function(reason) { - return oThis.transactionHelper.afterPayFailure(brandedTokenAddress, senderAddress, totalAmount); + return oThis.transactionHelper.afterPayFailure(brandedTokenAddress, spenderAddress, totalTransferAmount); }; - const params = { + const transactionObject = currContract.methods.pay( + beneficiaryAddress, + transferAmount, + commissionBeneficiaryAddress, + commissionAmount, + web3Provider.utils.asciiToHex(currency), + intendedPricePoint); + + const notificationData = helper.getNotificationData( + ['transfer.payments.pricer.pay'], + notificationGlobalConstant.publisher(), + 'pay', + oThis.contractName, + oThis.contractAddress, + web3Provider, + oThis.chainId, + options); + notificationData.message.payload.erc20_contract_address = brandedTokenAddress; + + const performSendParams = { transactionObject: transactionObject, notificationData: notificationData, - senderAddress: senderAddress, + senderAddress: spenderAddress, senderPassphrase: senderPassphrase, contractAddress: oThis.contractAddress, gasPrice: gasPrice, @@ -1057,11 +1092,10 @@ Pricer.prototype = { errorCode: "l_ci_p_p_8" }; - const beforePayResponse = await oThis.transactionHelper.beforePay(brandedTokenAddress, senderAddress, totalAmount); - - if(beforePayResponse.isFailure()) return Promise.resolve(beforePayResponse); + const beforePayResponse = await oThis.transactionHelper.beforePay(brandedTokenAddress, spenderAddress, totalTransferAmount); + if(beforePayResponse.isFailure()) return Promise.reject(beforePayResponse); - return Promise.resolve(helper.performSend(params, returnType)); + return Promise.resolve(helper.performSend(performSendParams, returnType)); }, /** diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index 9d9945c..0b97b20 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -8,6 +8,7 @@ * */ const BigNumber = require('bignumber.js') + , openSTStorage = require('@openstfoundation/openst-storage') ; const rootPrefix = '..' @@ -22,6 +23,7 @@ const rootPrefix = '..' , AirdropModelCacheKlass = require(rootPrefix + '/lib/cache_management/airdrop_model') , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') + , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') ; const errorConfig = { @@ -135,7 +137,9 @@ TransactionHelper.prototype = { * @return {promise} */ creditAirdropBalance: async function (airdropContractAddress, owner, bigAmount) { - const oThis = this; + const oThis = this + ; + bigAmount = basicHelper.convertToBigNumber(bigAmount); if (bigAmount.gt(0)) { const AdjustAirdropAmountObject = new AdjustAirdropAmountKlass({ @@ -209,27 +213,52 @@ TransactionHelper.prototype = { * Before pay function, this is called before the pay is called * * @param {string} brandedTokenAddress - branded token address - * @param {string} spender - spender address + * @param {string} spenderAddress - spender address * @param {BigNumber} estimatedPayAmount - estimated pay amount in weis * * @return {promise} * */ - beforePay: function(brandedTokenAddress, spender, estimatedPayAmount) { + beforePay: async function(brandedTokenAddress, spenderAddress, estimatedPayAmount) { const oThis = this ; logger.debug('lib/transaction_helper.js:beforePay called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, spender: spender, estimatedPayAmount: estimatedPayAmount})); + {brandedTokenAddress: brandedTokenAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount})); + + const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: oThis.brandedTokenAddress + }).update({ + ethereum_address: spenderAddress, + un_settled_debit_amount: estimatedPayAmount.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::beforeAirdropPay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_beforePay_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + }); - return oThis.pessimisticDebit(brandedTokenAddress, spender, estimatedPayAmount); + if (balanceUpdateResponse.isFailure()) { + return balanceUpdateResponse; + } + return responseHelper.successWithData({}); }, /** * After pay function, this is called after the pay is successfull * * @param {string} brandedTokenAddress - branded token address - * @param {string} spender - spender address + * @param {string} spenderAddress - spender address * @param {BigNumber} estimatedPayAmount - estimated pay amount in weis * @param {string} beneficiaryAddress - beneficiary address * @param {BigNumber} actualBeneficiaryAmount - actual beneficiary amount in weis @@ -239,91 +268,207 @@ TransactionHelper.prototype = { * @return {promise} * */ - afterPaySuccess_back: async function(brandedTokenAddress, spender, estimatedPayAmount, beneficiaryAddress, + afterPaySuccess: async function(brandedTokenAddress, spenderAddress, estimatedPayAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount) { const oThis = this - // adjustment cache for spender + , promiseArray = [] , actualTotalAmount = actualBeneficiaryAmount.plus(actualCommissionBeneficiaryAmount) - , initNumber = basicHelper.convertToBigNumber(0) - , addressToBalanceChangeMap = {} ; - addressToBalanceChangeMap[beneficiaryAddress] = initNumber; - addressToBalanceChangeMap[commissionBeneficiaryAddress] = initNumber; - addressToBalanceChangeMap[spender] = initNumber; - - addressToBalanceChangeMap[beneficiaryAddress] = addressToBalanceChangeMap[beneficiaryAddress].plus( - actualBeneficiaryAmount); - - addressToBalanceChangeMap[commissionBeneficiaryAddress] = addressToBalanceChangeMap[commissionBeneficiaryAddress].plus( - actualCommissionBeneficiaryAmount); - - addressToBalanceChangeMap[spender].plus(estimatedPayAmount.minus(actualTotalAmount)); + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: oThis.brandedTokenAddress + }).update({ + ethereum_address: beneficiaryAddress, + settle_amount: actualBeneficiaryAmount.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterPaySuccess_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); + + // credit commissionBeneficiaryAddress with actualCommissionBeneficiaryAmount - add it to the settled_amount + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: commissionBeneficiaryAddress, + settle_amount: actualCommissionBeneficiaryAmount.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterPaySuccess_2', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); + + // we had pessimistically debitted estimatedDebitAmount from spenderAddress. + // now adjusting the debit to actualDebitAmount. + // subtract estimatedDebitAmount from un_settled_debit_amount AND subtract actualDebitAmount from settle_amount. + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: spenderAddress, + settle_amount: (actualTotalAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10), + un_settled_debit_amount: (estimatedPayAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterPaySuccess_3', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); - return Promise.all(oThis._getPromiseArrayForBalanceChange(brandedTokenAddress, '', - addressToBalanceChangeMap, {})); + return Promise.all(promiseArray); }, /** * After pay function, this is called after the pay is failed * * @param {string} brandedTokenAddress - branded token address - * @param {string} spender - spender address + * @param {string} spenderAddress - spender address * @param {BigNumber} estimatedPayAmount - estimated pay amount in weis * * @return {promise} */ - afterPayFailure: function (brandedTokenAddress, spender, estimatedPayAmount) { + afterPayFailure: async function (brandedTokenAddress, spenderAddress, estimatedPayAmount) { const oThis = this ; - estimatedPayAmount = basicHelper.convertToBigNumber(estimatedPayAmount).mul(basicHelper.convertToBigNumber(-1)); logger.debug('lib/transaction_helper.js:afterPayFailure called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, spender: spender, estimatedPayAmount: estimatedPayAmount})); + {brandedTokenAddress: brandedTokenAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount})); + + const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: oThis.brandedTokenAddress + }).update({ + ethereum_address: spenderAddress, + un_settled_debit_amount: (estimatedPayAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterPayFailure::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterPayFailure_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + }); - return oThis.pessimisticDebit(brandedTokenAddress, spender, estimatedPayAmount); + if (balanceUpdateResponse.isFailure()) { + return balanceUpdateResponse; + } + return responseHelper.successWithData({}); }, /** * Before airdrop pay function, this is called before the pay is called * @param {string} brandedTokenAddress - branded token address * @param {string} airdropAddress - airdrop contract address - * @param {string} spender - spender address - * @param {BigNumber} estimatedPayAmount - estimated pay amount in weis - * @param {BigNumber} estimatedAirdropAmount - estimated airdrop amount + * @param {string} spenderAddress - spender address + * @param {BigNumber} totalTransferAmount - estimated pay amount in weis + * @param {BigNumber} airdropBalanceToUse - estimated airdrop amount * @param {string} airdropBugdetAddress - airdrop budget holder address * - * @return {promise} + * @return {promise>} * */ - beforeAirdropPay: function(brandedTokenAddress, airdropAddress, spender, estimatedPayAmount, estimatedAirdropAmount, + beforeAirdropPay: async function(brandedTokenAddress, airdropAddress, spenderAddress, totalTransferAmount, airdropBalanceToUse, airdropBugdetAddress) { logger.debug('lib/transaction_helper.js:beforeAirdropPay called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spender, - estimatedAirdropAmount: estimatedAirdropAmount, airdropBugdetAddress: airdropBugdetAddress})); + {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, + estimatedAirdropAmount: airdropBalanceToUse, airdropBugdetAddress: airdropBugdetAddress})); const oThis = this - , amountToDebit = estimatedPayAmount.minus(estimatedAirdropAmount) - , initNumber = basicHelper.convertToBigNumber(0) - , addressToBalanceChangeMap = {} - , addressToAirdropBalanceChangeMap = {} + , amountToDebitFromChain = totalTransferAmount.minus(airdropBalanceToUse) + , promiseArray = [] ; - addressToBalanceChangeMap[spender] = initNumber; - addressToAirdropBalanceChangeMap[spender] = initNumber; - addressToBalanceChangeMap[airdropBugdetAddress] = initNumber; - - if (amountToDebit.gt(0)) { - addressToBalanceChangeMap[spender] = addressToBalanceChangeMap[spender].minus(amountToDebit); + // Pessimistic debit of spender. + if (amountToDebitFromChain.gt(0)) { + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: spenderAddress, + un_settled_debit_amount: amountToDebitFromChain.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::beforeAirdropPay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_beforeAirdropPay_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); } - addressToAirdropBalanceChangeMap[spender] = addressToAirdropBalanceChangeMap[spender].minus(estimatedAirdropAmount); - addressToBalanceChangeMap[airdropBugdetAddress] = addressToBalanceChangeMap[airdropBugdetAddress].minus( - estimatedAirdropAmount); + //Debit airdrop balance of spender from DB. + promiseArray.push(oThis.updateAirdropBalance(airdropAddress, spenderAddress, airdropBalanceToUse.mul(basicHelper.convertToBigNumber(-1)))); + + // pessimistic debit of airdrop budget holder. + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: airdropBugdetAddress, + un_settled_debit_amount: airdropBalanceToUse.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::beforeAirdropPay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_beforeAirdropPay_2', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); - return Promise.all(oThis._getPromiseArrayForBalanceChange(brandedTokenAddress, airdropAddress, - addressToBalanceChangeMap, addressToAirdropBalanceChangeMap)); + return Promise.all(promiseArray); }, /** @@ -331,7 +476,7 @@ TransactionHelper.prototype = { * * @param {string} brandedTokenAddress - branded token address * @param {string} airdropAddress - airdrop contract address - * @param {string} spender - spender address + * @param {string} spenderAddress - spender address * @param {BigNumber} estimatedPayAmount - estimated pay amount in weis * @param {BigNumber} estimatedAirdropAmount - estimated airdrop amount * @param {string} beneficiaryAddress - beneficiary address @@ -343,13 +488,13 @@ TransactionHelper.prototype = { * * @return {promise} */ - afterAirdropPaySuccess: function(brandedTokenAddress, airdropAddress, spender, estimatedPayAmount, + afterAirdropPaySuccess: function(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount, actualAirdropAmount, airdropBugdetAddress) { logger.debug('lib/transaction_helper.js:afterAirdropPaySuccess called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spender, + {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount, beneficiaryAddress: beneficiaryAddress, actualBeneficiaryAmount: actualBeneficiaryAmount, commissionBeneficiaryAddress: commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount: actualCommissionBeneficiaryAmount, @@ -360,67 +505,111 @@ TransactionHelper.prototype = { , estimatedDebitAmount = estimatedPayAmount.minus(estimatedAirdropAmount) , actualTotalAmount = actualBeneficiaryAmount.plus(actualCommissionBeneficiaryAmount) , actualDebitAmount = actualTotalAmount.minus(actualAirdropAmount) - , initNumber = basicHelper.convertToBigNumber(0) - , addressToBalanceChangeMap = {} - , addressToAirdropBalanceChangeMap = {} - ; - - addressToBalanceChangeMap[beneficiaryAddress] = initNumber; - addressToBalanceChangeMap[commissionBeneficiaryAddress] = initNumber; - addressToBalanceChangeMap[spender] = initNumber; - addressToBalanceChangeMap[airdropBugdetAddress] = initNumber; - - addressToAirdropBalanceChangeMap[spender] = initNumber; - - // credit beneficiaryAddress with actualBeneficiaryAmount - addressToBalanceChangeMap[beneficiaryAddress] = - addressToBalanceChangeMap[beneficiaryAddress].plus(actualBeneficiaryAmount); - - // credit commissionBeneficiaryAddress with actualCommissionBeneficiaryAmount - addressToBalanceChangeMap[commissionBeneficiaryAddress] = - addressToBalanceChangeMap[commissionBeneficiaryAddress].plus(actualCommissionBeneficiaryAmount); - - // we had debited estimatedDebitAmount previously from spender balance, now adjusting the delta. - addressToBalanceChangeMap[spender] = addressToBalanceChangeMap[spender].plus( - estimatedDebitAmount.minus(actualDebitAmount)); - - // we had debited estimatedAirdropAmount previously from spender balance, now adjusting the delta. - addressToAirdropBalanceChangeMap[spender] = addressToAirdropBalanceChangeMap[spender].plus( - estimatedAirdropAmount.minus(actualAirdropAmount)); - - // we had debited estimatedAirdropAmount previously from airdropBugdetAddress balance, now adjusting the delta. - addressToBalanceChangeMap[airdropBugdetAddress] = addressToBalanceChangeMap[airdropBugdetAddress].plus( - estimatedAirdropAmount.minus(actualAirdropAmount)); - - return Promise.all(oThis._getPromiseArrayForBalanceChange(brandedTokenAddress, airdropAddress, - addressToBalanceChangeMap, addressToAirdropBalanceChangeMap)); - }, - - /** - * Get promise array for balance change - * - * @param {string} brandedTokenAddress - branded token address - * @param {string} airdropAddress - airdrop contract address - * @param {string} addressToBalanceChangeMap - address to balance change map - * @param {BigNumber} addressToAirdropBalanceChangeMap - address to airdrop balance change map - * - * @return {array} - */ - _getPromiseArrayForBalanceChange: function(brandedTokenAddress, airdropAddress, addressToBalanceChangeMap, - addressToAirdropBalanceChangeMap) { - const oThis = this , promiseArray = [] ; - for(var address in addressToBalanceChangeMap) { - promiseArray.push(oThis.updateBalance(brandedTokenAddress, address, addressToBalanceChangeMap[address])); - } + // credit beneficiaryAddress with actualBeneficiaryAmount - add it to the settled_amount + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: beneficiaryAddress, + settle_amount: actualBeneficiaryAmount.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterAirdropPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterAirdropPaySuccess_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); + + // credit commissionBeneficiaryAddress with actualCommissionBeneficiaryAmount - add it to the settled_amount + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: commissionBeneficiaryAddress, + settle_amount: actualCommissionBeneficiaryAmount.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterAirdropPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterAirdropPaySuccess_2', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); + + // we had pessimistically debitted estimatedDebitAmount from spenderAddress. + // now adjusting the debit to actualDebitAmount. + // subtract estimatedDebitAmount from un_settled_debit_amount AND subtract actualDebitAmount from settle_amount. + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: spenderAddress, + settle_amount: (actualDebitAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10), + un_settled_debit_amount: (estimatedDebitAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterAirdropPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterAirdropPaySuccess_3', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); - for(var address in addressToAirdropBalanceChangeMap) { - promiseArray.push(oThis.updateAirdropBalance(airdropAddress, address, addressToAirdropBalanceChangeMap[address])); - } + // we had debited estimatedAirdropAmount previously from spender balance, now adjusting the delta. + promiseArray.push(oThis.updateAirdropBalance(airdropAddress, spenderAddress, estimatedAirdropAmount.minus(actualAirdropAmount))); + + // changes for spender address. + // we had added estimatedAirdropAmount previously to airdropBugdetAddress un_settled_debit_amount, now subtracting the same. + // AND subtracting actualAirdropAmount from settle_amount + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: airdropBugdetAddress, + settle_amount: (actualAirdropAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10), + un_settled_debit_amount: (estimatedAirdropAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterAirdropPaySuccess::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterAirdropPaySuccess_4', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); - return promiseArray; + return Promise.all(promiseArray); }, /** @@ -428,7 +617,7 @@ TransactionHelper.prototype = { * * @param {string} brandedTokenAddress - branded token address * @param {string} airdropAddress - airdrop contract address - * @param {string} spender - spender address + * @param {string} spenderAddress - spender address * @param {BigNumber} estimatedPayAmount - estimated pay amount in weis * @param {BigNumber} estimatedAirdropAmount - estimated airdrop amount * @param {string} airdropBugdetAddress - airdrop budget holder address @@ -436,34 +625,77 @@ TransactionHelper.prototype = { * @return {promise} * */ - afterAirdropPayFailure: function (brandedTokenAddress, airdropAddress, spender, + afterAirdropPayFailure: function (brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress) { logger.debug('lib/transaction_helper.js:afterAirdropPayFailure called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spender, + {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, estimatedAirdropAmount: estimatedAirdropAmount, airdropBugdetAddress: airdropBugdetAddress})); const oThis = this - , amountToCredit = estimatedPayAmount.minus(estimatedAirdropAmount) - , initNumber = basicHelper.convertToBigNumber(0) + , amountToCreditToChain = estimatedPayAmount.minus(estimatedAirdropAmount) + , zero = basicHelper.convertToBigNumber(0) , addressToBalanceChangeMap = {} , addressToAirdropBalanceChangeMap = {} ; - addressToBalanceChangeMap[spender] = initNumber; - addressToBalanceChangeMap[airdropBugdetAddress] = initNumber; - addressToAirdropBalanceChangeMap[spender] = initNumber; - - if (amountToCredit.gt(0)) { - addressToBalanceChangeMap[spender] = addressToBalanceChangeMap[spender].plus(amountToCredit); + addressToBalanceChangeMap[spenderAddress] = zero; + addressToBalanceChangeMap[airdropBugdetAddress] = zero; + addressToAirdropBalanceChangeMap[spenderAddress] = zero; + + const promiseArray = []; + + if (amountToCreditToChain.gt(0)) { + // rollback the pessimistic debit made from the spender address + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: spenderAddress, + un_settled_debit_amount: (amountToCreditToChain.mul(basicHelper.convertToBigNumber(-1))).toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterAirdropPayFailure::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterAirdropPayFailure_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); } - addressToAirdropBalanceChangeMap[spender] = addressToAirdropBalanceChangeMap[spender].plus(estimatedAirdropAmount); - addressToBalanceChangeMap[airdropBugdetAddress] = addressToBalanceChangeMap[airdropBugdetAddress].plus( - estimatedAirdropAmount); + promiseArray.push(oThis.updateAirdropBalance(airdropAddress, spenderAddress, estimatedAirdropAmount)); + + // rollback the pessimistic debit made from airdrop budget holder address. + promiseArray.push(new openSTStorage.TokenBalanceModel({ + ddb_service: ddbServiceObj, + auto_scaling: null, + erc20_contract_address: brandedTokenAddress + }).update({ + ethereum_address: airdropBugdetAddress, + un_settled_debit_amount: estimatedAirdropAmount.toString(10) + }).catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::afterAirdropPayFailure::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_th_afterAirdropPayFailure_2', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + })); - return Promise.all(oThis._getPromiseArrayForBalanceChange(brandedTokenAddress, airdropAddress, - addressToBalanceChangeMap, addressToAirdropBalanceChangeMap)); + return Promise.all(promiseArray); }, /** From 2aafa75bc837f00aaac24ede96a1209c50cae41c Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Tue, 5 Jun 2018 17:24:45 +0530 Subject: [PATCH 36/72] airdrop contract interact changes. --- lib/contract_interact/airdrop.js | 882 ++++++++++++++++--------------- 1 file changed, 442 insertions(+), 440 deletions(-) diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index 5d510d1..88351c2 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -42,8 +42,10 @@ const contractAbi = coreAddresses.getAbiForContract('airdrop') * @param {string} airdropContractAddress - airdrop contract address * @param {string} chainId - chain ID * + * @augments Pricer + * */ -const Airdrop = module.exports = function (airdropContractAddress, chainId) { +const Airdrop = function (airdropContractAddress, chainId) { const oThis = this ; @@ -58,479 +60,479 @@ const Airdrop = module.exports = function (airdropContractAddress, chainId) { Airdrop.prototype = Object.create(Pricer.prototype); -Airdrop.prototype.constructor = Airdrop; +const AirdropSpecificPrototype = { + constructor: Airdrop, + + /** + * Actual pay method - can give rejections of Promise + * + * @param {string} senderWorkerAddress - address of worker + * @param {string} senderWorkerPassphrase - passphrase of worker + * @param {string} beneficiaryAddress - address of beneficiary account + * @param {BigNumber} transferAmount - transfer amount (in wei) + * @param {string} commissionBeneficiaryAddress - address of commision beneficiary account + * @param {BigNumber} commissionAmount - commission amount (in wei) + * @param {string} currency - quote currency + * @param {BigNumber} intendedPricePoint - price point at which the pay is intended (in wei) + * @param {string} spender - User address + * @param {Hex} gasPrice - gas price + * @param {object} options - for params like returnType, tag. + * + * @return {promise} + * + */ + pay: function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, + transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, + spender, gasPrice, options) { + const oThis = this + ; + + return oThis._asyncPay(senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, + transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, + spender, gasPrice, options) + .catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::pay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_ci_a_pay_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + }); + }, + + _asyncPay: async function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, + transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, + spender, gasPrice, options) { + logger.debug("\nAirdrop.pay.params"); + logger.debug("\nsenderWorkerAddress: ", senderWorkerAddress, "\nbeneficiaryAddress: ", beneficiaryAddress, "\ntransferAmount: ", + transferAmount, "\ncommissionBeneficiaryAddress ", commissionBeneficiaryAddress, + "\ncommissionAmount: ", commissionAmount, "\ncurrency: ", currency, "\nintendedPricePoint", intendedPricePoint, + "\nspender", spender, "\ngasPrice", gasPrice, "\noptions", options); + + const oThis = this + ; + + await helper.validateAirdropPayParams(senderWorkerAddress, + beneficiaryAddress, + transferAmount, + commissionBeneficiaryAddress, + commissionAmount, + currency, + intendedPricePoint, + gasPrice, + spender); + + // validate if spender has the balance + let totalTransferAmount = 0; + // If currency is not present, amounts are in BT + if (!currency) { + totalTransferAmount = basicHelper.convertToBigNumber(0) + .plus(transferAmount) + .plus(commissionAmount); + } else { // amounts are in USD + totalTransferAmount = await oThis.getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint); + logger.debug("=========totalAmount========", totalTransferAmount); + } -Airdrop.prototype.pay = function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, - transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, - spender, gasPrice, options) { - const oThis = this - ; + const spenderOnChainAvailableBalanceResponse = await oThis.getBalanceOf(spender); + logger.debug("==========airdrop.pay.senderAccountBalanceResponse==========="); + logger.debug(spenderOnChainAvailableBalanceResponse); + if (spenderOnChainAvailableBalanceResponse.isFailure()) { + let errorParams = { + internal_error_identifier: 'l_ci_a_async_pay_1', + api_error_identifier: 'db_get_failed', + error_config: errorConfig, + debug_options: {} + }; + return Promise.reject(responseHelper.error(errorParams)); + } - return oThis._asyncPay(senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, - transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, - spender, gasPrice, options) - .catch(function (error) { - if (responseHelper.isCustomResult(error)) { - return error; - } else { - logger.error(`${__filename}::pay::catch`); - logger.error(error); - return responseHelper.error({ - internal_error_identifier: 'l_ci_a_pay_1', - api_error_identifier: 'unhandled_api_error', - error_config: errorConfig, - debug_options: {} - }); - } - }); -}; + let spenderOnChainAvailableBalance = basicHelper.convertToBigNumber(spenderOnChainAvailableBalanceResponse.data.balance); + logger.debug(`\nuserInitialBalance: ${spenderOnChainAvailableBalance.toString(10)}`); -/** - * Actual pay method - can give rejections of Promise - * - * @param {string} senderWorkerAddress - address of worker - * @param {string} senderWorkerPassphrase - passphrase of worker - * @param {string} beneficiaryAddress - address of beneficiary account - * @param {BigNumber} transferAmount - transfer amount (in wei) - * @param {string} commissionBeneficiaryAddress - address of commision beneficiary account - * @param {BigNumber} commissionAmount - commission amount (in wei) - * @param {string} currency - quote currency - * @param {BigNumber} intendedPricePoint - price point at which the pay is intended (in wei) - * @param {string} spender - User address - * @param {Hex} gasPrice - gas price - * @param {object} options - for params like returnType, tag. - * - * @return {promise} - * - */ -Airdrop.prototype._asyncPay = async function (senderWorkerAddress, senderWorkerPassphrase, beneficiaryAddress, - transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, - spender, gasPrice, options) { - logger.debug("\nAirdrop.pay.params"); - logger.debug("\nsenderWorkerAddress: ", senderWorkerAddress, "\nbeneficiaryAddress: ", beneficiaryAddress, "\ntransferAmount: ", - transferAmount, "\ncommissionBeneficiaryAddress ", commissionBeneficiaryAddress, - "\ncommissionAmount: ", commissionAmount, "\ncurrency: ", currency, "\nintendedPricePoint", intendedPricePoint, - "\nspender", spender, "\ngasPrice", gasPrice, "\noptions", options); + let spenderAirdropBalanceResponse = await new AirdropUserBalanceKlass({ + chain_id: oThis.chainId, + airdrop_contract_address: oThis.contractAddress, + user_addresses: [spender] + }).perform(); - const oThis = this - ; + logger.debug("==========airdrop.pay.airdropBalanceResult==========="); + logger.debug(spenderAirdropBalanceResponse); + if (spenderAirdropBalanceResponse.isFailure()) { + return Promise.reject(spenderAirdropBalanceResponse); + } - await helper.validateAirdropPayParams(senderWorkerAddress, - beneficiaryAddress, - transferAmount, - commissionBeneficiaryAddress, - commissionAmount, - currency, - intendedPricePoint, - gasPrice, - spender); - - // validate if spender has the balance - let totalTransferAmount = 0; - // If currency is not present, amounts are in BT - if (!currency) { - totalTransferAmount = basicHelper.convertToBigNumber(0) - .plus(transferAmount) - .plus(commissionAmount); - } else { // amounts are in USD - totalTransferAmount = await oThis.getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint); - logger.debug("=========totalAmount========", totalTransferAmount); - } + let spenderAirdropBalance = spenderAirdropBalanceResponse.data[spender] ? + basicHelper.convertToBigNumber(spenderAirdropBalanceResponse.data[spender].balanceAirdropAmount) : + basicHelper.convertToBigNumber(0) + ; + + // to give airdrop balance higher preference, we compute the min of total amount and airdrop balance + let airdropBalanceToUse = BigNumber.min(totalTransferAmount, spenderAirdropBalance) + ; + + logger.debug(`\nairdropBalanceToUse: ${airdropBalanceToUse.toString(10)}`); + logger.debug(`\ntotalAmount: ${totalTransferAmount.toString(10)}`); + logger.debug(`\nuserInitialBalance.plus(airdropBalanceToUse): ${(spenderOnChainAvailableBalance.plus(airdropBalanceToUse)).toString(10)}`); + + // validate if the spender has enough balance (airdrop + on chain available) + if ((spenderOnChainAvailableBalance.plus(airdropBalanceToUse)).lt(totalTransferAmount)) { + let errorParams = { + internal_error_identifier: 'l_ci_a_async_pay_2', + api_error_identifier: 'insufficient_funds', + error_config: errorConfig, + debug_options: {} + }; + return Promise.reject(responseHelper.error(errorParams)); + } - const spenderOnChainAvailableBalanceResponse = await oThis.getBalanceOf(spender); - logger.debug("==========airdrop.pay.senderAccountBalanceResponse==========="); - logger.debug(spenderOnChainAvailableBalanceResponse); - if (spenderOnChainAvailableBalanceResponse.isFailure()) { - let errorParams = { - internal_error_identifier: 'l_ci_a_async_pay_1', - api_error_identifier: 'db_get_failed', - error_config: errorConfig, - debug_options: {} + const brandedTokenResponse = await oThis.brandedToken(); + if (brandedTokenResponse.isFailure()) return Promise.reject(brandedTokenResponse); + + let brandedTokenAddress = brandedTokenResponse.data.brandedToken; + + const airdropBudgetHolderResponse = await oThis.airdropBudgetHolder(); + if (airdropBudgetHolderResponse.isSuccess()) return Promise.reject(airdropBudgetHolderResponse); + + let airdropBudgetHolder = airdropBudgetHolderResponse.data.airdropBudgetHolder; + + const returnType = basicHelper.getReturnType(options.returnType); + logger.debug("==========airdrop.pay.params==========="); + logger.debug(beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, + intendedPricePoint, spender, spenderAirdropBalance.toString(10)); + + const notificationData = helper.getNotificationData( + ['transfer.payments.airdrop.pay'], + notificationGlobalConstant.publisher(), + 'pay', + oThis.contractName, + oThis.contractAddress, + web3Provider, + oThis.chainId, + options); + notificationData.message.payload.erc20_contract_address = brandedTokenAddress; + + + const postPayParams = { + beneficiaryAddress: beneficiaryAddress, + commissionBeneficiaryAddress: commissionBeneficiaryAddress, + spender: spender, + brandedTokenAddress: brandedTokenAddress, + contractAddress: oThis.contractAddress, + totalAmount: totalTransferAmount.toString(10), + airdropAmountToUse: airdropBalanceToUse.toString(10), + airdropBudgetHolder: airdropBudgetHolder, + chainId: oThis.chainId }; - return Promise.reject(responseHelper.error(errorParams)); - } - - let spenderOnChainAvailableBalance = basicHelper.convertToBigNumber(spenderOnChainAvailableBalanceResponse.data.balance); - logger.debug(`\nuserInitialBalance: ${spenderOnChainAvailableBalance.toString(10)}`); - - let spenderAirdropBalanceResponse = await new AirdropUserBalanceKlass({ - chain_id: oThis.chainId, - airdrop_contract_address: oThis.contractAddress, - user_addresses: [spender] - }).perform(); - logger.debug("==========airdrop.pay.airdropBalanceResult==========="); - logger.debug(spenderAirdropBalanceResponse); - if (spenderAirdropBalanceResponse.isFailure()) { - return Promise.reject(spenderAirdropBalanceResponse); - } + const failCallback = function (reason) { + return oThis.onAirdropPayFailure(postPayParams); + }; - let spenderAirdropBalance = spenderAirdropBalanceResponse.data[spender] ? - basicHelper.convertToBigNumber(spenderAirdropBalanceResponse.data[spender].balanceAirdropAmount) : - basicHelper.convertToBigNumber(0) - ; + const successCallback = async function (receipt) { - // to give airdrop balance higher preference, we compute the min of total amount and airdrop balance - let airdropBalanceToUse = BigNumber.min(totalTransferAmount, spenderAirdropBalance) - ; + const setAddressToNameMapResponse = await oThis.setAddressToNameMap(); + if (setAddressToNameMapResponse.isFailure()) { + return setAddressToNameMapResponse; + } - logger.debug(`\nairdropBalanceToUse: ${airdropBalanceToUse.toString(10)}`); - logger.debug(`\ntotalAmount: ${totalTransferAmount.toString(10)}`); - logger.debug(`\nuserInitialBalance.plus(airdropBalanceToUse): ${(spenderOnChainAvailableBalance.plus(airdropBalanceToUse)).toString(10)}`); + const actualAmountsFromReceipt = oThis.transactionHelper.getActualAmountsFromReceipt(receipt, oThis.addressToNameMap, + eventGlobalConstants.eventAirdropPayment()); + logger.debug("========airdrop.pay.actualAmountsFromReceipt Response========"); + logger.debug(actualAmountsFromReceipt); + if (actualAmountsFromReceipt.isSuccess()) { + return await oThis.onAirdropPaySuccess(postPayParams, actualAmountsFromReceipt.data); + } else { + return failCallback("Status 0x0"); + } + }; - // validate if the spender has enough balance (airdrop + on chain available) - if ((spenderOnChainAvailableBalance.plus(airdropBalanceToUse)).lt(totalTransferAmount)) { - let errorParams = { - internal_error_identifier: 'l_ci_a_async_pay_2', - api_error_identifier: 'insufficient_funds', - error_config: errorConfig, - debug_options: {} + const transactionObject = currContract.methods.payAirdrop( + beneficiaryAddress, + transferAmount, + commissionBeneficiaryAddress, + commissionAmount, + web3Provider.utils.asciiToHex(currency), + intendedPricePoint, + spender, + spenderAirdropBalance.toString(10)); + + const sendPerformParams = { + transactionObject: transactionObject, + notificationData: notificationData, + senderAddress: senderWorkerAddress, + senderPassphrase: senderWorkerPassphrase, + contractAddress: oThis.contractAddress, + gasPrice: gasPrice, + gasLimit: gasLimitGlobalConstant.airdropPay(), + web3Provider: web3Provider, + successCallback: successCallback, + failCallback: failCallback, + errorCode: "l_ci_ad_p_3" }; - return Promise.reject(responseHelper.error(errorParams)); - } - const brandedTokenResponse = await oThis.brandedToken(); - if (brandedTokenResponse.isFailure()) return Promise.reject(brandedTokenResponse); - - let brandedTokenAddress = brandedTokenResponse.data.brandedToken; - - const airdropBudgetHolderResponse = await oThis.airdropBudgetHolder(); - if (airdropBudgetHolderResponse.isSuccess()) return Promise.reject(airdropBudgetHolderResponse); - - let airdropBudgetHolder = airdropBudgetHolderResponse.data.airdropBudgetHolder; - - const returnType = basicHelper.getReturnType(options.returnType); - logger.debug("==========airdrop.pay.params==========="); - logger.debug(beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, - intendedPricePoint, spender, spenderAirdropBalance.toString(10)); - - const notificationData = helper.getNotificationData( - ['transfer.payments.airdrop.pay'], - notificationGlobalConstant.publisher(), - 'pay', - oThis.contractName, - oThis.contractAddress, - web3Provider, - oThis.chainId, - options); - notificationData.message.payload.erc20_contract_address = brandedTokenAddress; - - - const postPayParams = { - beneficiaryAddress: beneficiaryAddress, - commissionBeneficiaryAddress: commissionBeneficiaryAddress, - spender: spender, - brandedTokenAddress: brandedTokenAddress, - contractAddress: oThis.contractAddress, - totalAmount: totalTransferAmount.toString(10), - airdropAmountToUse: airdropBalanceToUse.toString(10), - airdropBudgetHolder: airdropBudgetHolder, - chainId: oThis.chainId - }; - - const failCallback = function (reason) { - return oThis.onAirdropPayFailure(postPayParams); - }; - - const successCallback = async function (receipt) { - - const setAddressToNameMapResponse = await oThis.setAddressToNameMap(); - if (setAddressToNameMapResponse.isFailure()) { - return setAddressToNameMapResponse; + if (options && options.shouldHandlePostPay == 0) { + sendPerformParams.processReceipt = 0; + sendPerformParams.postReceiptProcessParams = postPayParams; + } else { + sendPerformParams.processReceipt = 1; } - const actualAmountsFromReceipt = oThis.transactionHelper.getActualAmountsFromReceipt(receipt, oThis.addressToNameMap, - eventGlobalConstants.eventAirdropPayment()); - logger.debug("========airdrop.pay.actualAmountsFromReceipt Response========"); - logger.debug(actualAmountsFromReceipt); - if (actualAmountsFromReceipt.isSuccess()) { - return await oThis.onAirdropPaySuccess(postPayParams, actualAmountsFromReceipt.data); + const beforePayResponse = await oThis.transactionHelper.beforeAirdropPay( + brandedTokenAddress, + oThis.contractAddress, + spender, + totalTransferAmount, + airdropBalanceToUse, + airdropBudgetHolder); + + const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(beforePayResponse); + if (isAllResponseSuccessful) { + return Promise.resolve(helper.performSend(sendPerformParams, returnType)); } else { - return failCallback("Status 0x0"); + let errorParams = { + internal_error_identifier: 'l_ci_a_async_pay_3', + api_error_identifier: 'could_not_process', + error_config: errorConfig, + debug_options: {} + }; + logger.error('%Error - Something went wrong. It could be that either cache or airdrop used amount promise failed.'); + // TODO: Discuss: we may need to do some revert ? + return Promise.reject(responseHelper.error(errorParams)); + } + }, + + /** + * postAirdropPay + * + * @param {Object} airdropPostPayParams - airdrop post pay params + * @param {string} airdropPostPayParams.beneficiaryAddress - beneficiary address + * @param {string} airdropPostPayParams.commissionBeneficiaryAddress - commission beneficiary address + * @param {string} airdropPostPayParams.spender - spender address + * @param {string} airdropPostPayParams.brandedTokenAddress - branded token address + * @param {string} airdropPostPayParams.contractAddress - contractAddress address + * @param {string} airdropPostPayParams.airdropBudgetHolder - airdrop budget holder address + * @param {number} airdropPostPayParams.totalAmount - total amount that was debited from spender account + * @param {number} airdropPostPayParams.airdropAmountToUse - airdrop amount that was used in the transaction + * @param {number} airdropPostPayParams.chainId - chain id + * @param {Object} decodedEvents - decoded events from trasaction receipt + * @param {number} status - transactions status (0 => failure, 1 => success) + * + * @return {promise} + * + */ + postAirdropPay: async function (airdropPostPayParams, decodedEvents, status) { + const oThis = this + ; + + if (status == 1) { + + const actualAmountsFromReceipt = oThis.transactionHelper.getActualAmountsFromDecodedEvents(decodedEvents, + eventGlobalConstants.eventAirdropPayment()); + + if (actualAmountsFromReceipt.isSuccess()) { + return await oThis.onAirdropPaySuccess(airdropPostPayParams, actualAmountsFromReceipt.data); + } } - }; - - const transactionObject = currContract.methods.payAirdrop( - beneficiaryAddress, - transferAmount, - commissionBeneficiaryAddress, - commissionAmount, - web3Provider.utils.asciiToHex(currency), - intendedPricePoint, - spender, - spenderAirdropBalance.toString(10)); - - const sendPerformParams = { - transactionObject: transactionObject, - notificationData: notificationData, - senderAddress: senderWorkerAddress, - senderPassphrase: senderWorkerPassphrase, - contractAddress: oThis.contractAddress, - gasPrice: gasPrice, - gasLimit: gasLimitGlobalConstant.airdropPay(), - web3Provider: web3Provider, - successCallback: successCallback, - failCallback: failCallback, - errorCode: "l_ci_ad_p_3" - }; - - if (options && options.shouldHandlePostPay == 0) { - sendPerformParams.processReceipt = 0; - sendPerformParams.postReceiptProcessParams = postPayParams; - } else { - sendPerformParams.processReceipt = 1; - } - const beforePayResponse = await oThis.transactionHelper.beforeAirdropPay( - brandedTokenAddress, - oThis.contractAddress, - spender, - totalTransferAmount, - airdropBalanceToUse, - airdropBudgetHolder); - - const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(beforePayResponse); - if (isAllResponseSuccessful) { - return Promise.resolve(helper.performSend(sendPerformParams, returnType)); - } else { + return await oThis.onAirdropPayFailure(airdropPostPayParams); + + }, + + /** + * onAirdropPaySuccess + * + * @param {Object} airdropPostPayParams - airdrop post pay params + * @param {string} airdropPostPayParams.beneficiaryAddress - beneficiary address + * @param {string} airdropPostPayParams.commissionBeneficiaryAddress - commission beneficiary address + * @param {string} airdropPostPayParams.spender - spender address + * @param {string} airdropPostPayParams.brandedTokenAddress - branded token address + * @param {string} airdropPostPayParams.contractAddress - contractAddress address + * @param {string} airdropPostPayParams.airdropBudgetHolder - airdrop budget holder address + * @param {number} airdropPostPayParams.totalAmount - total amount that was debited from spender account + * @param {number} airdropPostPayParams.airdropAmountToUse - airdrop amount that was used in the transaction + * @param {number} airdropPostPayParams.chainId - chain id + * @param {Object} actualAmountsFromReceipt - Actual transfer amounts from receipt + * + * @return {promise} + * + */ + onAirdropPaySuccess: async function (airdropPostPayParams, actualAmountsFromReceipt) { + + const oThis = this + , validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); + + if (validationResponse.isFailure()) return Promise.resolve(validationResponse); + + const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress + , contractAddress = airdropPostPayParams.contractAddress + , spender = airdropPostPayParams.spender + , totalTransferAmount = basicHelper.convertToBigNumber(airdropPostPayParams.totalAmount) + , airdropAmountToUse = basicHelper.convertToBigNumber(airdropPostPayParams.airdropAmountToUse) + , beneficiaryAddress = airdropPostPayParams.beneficiaryAddress + , commissionBeneficiaryAddress = airdropPostPayParams.commissionBeneficiaryAddress + , airdropBudgetHolder = airdropPostPayParams.airdropBudgetHolder + ; + + const afterSuccessResponse = await oThis.transactionHelper.afterAirdropPaySuccess( + brandedTokenAddress, + contractAddress, + spender, + totalTransferAmount, + airdropAmountToUse, + beneficiaryAddress, + actualAmountsFromReceipt.actualBeneficiaryAmount, + commissionBeneficiaryAddress, + actualAmountsFromReceipt.actualCommissionAmount, + actualAmountsFromReceipt.actualAirdropAmount, + airdropBudgetHolder); + + const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterSuccessResponse); + if (isAllResponseSuccessful) { + return Promise.resolve(responseHelper.successWithData({})); + } let errorParams = { - internal_error_identifier: 'l_ci_a_async_pay_3', + internal_error_identifier: 'l_ci_a_onAirdropPaySuccess_1', api_error_identifier: 'could_not_process', error_config: errorConfig, debug_options: {} }; - logger.error('%Error - Something went wrong. It could be that either cache or airdrop used amount promise failed.'); - // TODO: Discuss: we may need to do some revert ? - return Promise.reject(responseHelper.error(errorParams)); - } -}; - - -/** - * postAirdropPay - * - * @param {Object} airdropPostPayParams - airdrop post pay params - * @param {string} airdropPostPayParams.beneficiaryAddress - beneficiary address - * @param {string} airdropPostPayParams.commissionBeneficiaryAddress - commission beneficiary address - * @param {string} airdropPostPayParams.spender - spender address - * @param {string} airdropPostPayParams.brandedTokenAddress - branded token address - * @param {string} airdropPostPayParams.contractAddress - contractAddress address - * @param {string} airdropPostPayParams.airdropBudgetHolder - airdrop budget holder address - * @param {number} airdropPostPayParams.totalAmount - total amount that was debited from spender account - * @param {number} airdropPostPayParams.airdropAmountToUse - airdrop amount that was used in the transaction - * @param {number} airdropPostPayParams.chainId - chain id - * @param {Object} decodedEvents - decoded events from trasaction receipt - * @param {number} status - transactions status (0 => failure, 1 => success) - * - * @return {promise} - * - */ -Airdrop.prototype.postAirdropPay = async function (airdropPostPayParams, decodedEvents, status) { - const oThis = this - ; - - if (status == 1) { - - const actualAmountsFromReceipt = oThis.transactionHelper.getActualAmountsFromDecodedEvents(decodedEvents, - eventGlobalConstants.eventAirdropPayment()); - - if (actualAmountsFromReceipt.isSuccess()) { - return await oThis.onAirdropPaySuccess(airdropPostPayParams, actualAmountsFromReceipt.data); - } - } - - return await oThis.onAirdropPayFailure(airdropPostPayParams); - -}; - - -/** - * onAirdropPaySuccess - * - * @param {Object} airdropPostPayParams - airdrop post pay params - * @param {string} airdropPostPayParams.beneficiaryAddress - beneficiary address - * @param {string} airdropPostPayParams.commissionBeneficiaryAddress - commission beneficiary address - * @param {string} airdropPostPayParams.spender - spender address - * @param {string} airdropPostPayParams.brandedTokenAddress - branded token address - * @param {string} airdropPostPayParams.contractAddress - contractAddress address - * @param {string} airdropPostPayParams.airdropBudgetHolder - airdrop budget holder address - * @param {number} airdropPostPayParams.totalAmount - total amount that was debited from spender account - * @param {number} airdropPostPayParams.airdropAmountToUse - airdrop amount that was used in the transaction - * @param {number} airdropPostPayParams.chainId - chain id - * @param {Object} actualAmountsFromReceipt - Actual transfer amounts from receipt - * - * @return {promise} - * - */ -Airdrop.prototype.onAirdropPaySuccess = async function (airdropPostPayParams, actualAmountsFromReceipt) { - - const oThis = this - , validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); - - if (validationResponse.isFailure()) return Promise.resolve(validationResponse); - - const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress - , contractAddress = airdropPostPayParams.contractAddress - , spender = airdropPostPayParams.spender - , totalTransferAmount = basicHelper.convertToBigNumber(airdropPostPayParams.totalAmount) - , airdropAmountToUse = basicHelper.convertToBigNumber(airdropPostPayParams.airdropAmountToUse) - , beneficiaryAddress = airdropPostPayParams.beneficiaryAddress - , commissionBeneficiaryAddress = airdropPostPayParams.commissionBeneficiaryAddress - , airdropBudgetHolder = airdropPostPayParams.airdropBudgetHolder - ; - - const afterSuccessResponse = await oThis.transactionHelper.afterAirdropPaySuccess( - brandedTokenAddress, - contractAddress, - spender, - totalTransferAmount, - airdropAmountToUse, - beneficiaryAddress, - actualAmountsFromReceipt.actualBeneficiaryAmount, - commissionBeneficiaryAddress, - actualAmountsFromReceipt.actualCommissionAmount, - actualAmountsFromReceipt.actualAirdropAmount, - airdropBudgetHolder); - - const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterSuccessResponse); - if (isAllResponseSuccessful) { - return Promise.resolve(responseHelper.successWithData({})); - } - let errorParams = { - internal_error_identifier: 'l_ci_a_onAirdropPaySuccess_1', - api_error_identifier: 'could_not_process', - error_config: errorConfig, - debug_options: {} - }; - return Promise.resolve(responseHelper.error(errorParams)); - - -}; - -/** - * onAirdropPayFailure - * - * @param {Object} airdropPostPayParams - airdrop post pay params - * @param {string} airdropPostPayParams.beneficiaryAddress - beneficiary address - * @param {string} airdropPostPayParams.commissionBeneficiaryAddress - commission beneficiary address - * @param {string} airdropPostPayParams.spender - spender address - * @param {string} airdropPostPayParams.brandedTokenAddress - branded token address - * @param {string} airdropPostPayParams.contractAddress - contractAddress address - * @param {string} airdropPostPayParams.airdropBudgetHolder - airdrop budget holder address - * @param {number} airdropPostPayParams.totalAmount - total amount that was debited from spender account - * @param {number} airdropPostPayParams.airdropAmountToUse - airdrop amount that was used in the transaction - * @param {number} airdropPostPayParams.chainId - chain id - * - * @return {promise} - * - */ -Airdrop.prototype.onAirdropPayFailure = async function (airdropPostPayParams) { - - const oThis = this - ; - - const validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); - if (validationResponse.isFailure()) return Promise.reject(validationResponse); - - const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress - , contractAddress = airdropPostPayParams.contractAddress - , spender = airdropPostPayParams.spender - , totalTransferAmount = basicHelper.convertToBigNumber(airdropPostPayParams.totalAmount) - , airdropAmountToUse = basicHelper.convertToBigNumber(airdropPostPayParams.airdropAmountToUse) - , airdropBudgetHolderAddress = airdropPostPayParams.airdropBudgetHolder - ; - - const afterFailureResponse = await oThis.transactionHelper.afterAirdropPayFailure( - brandedTokenAddress, - contractAddress, - spender, - totalTransferAmount, - airdropAmountToUse, - airdropBudgetHolderAddress); - - const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterFailureResponse); - if (isAllResponseSuccessful) { - return Promise.resolve(responseHelper.successWithData({})); - } - let errorParams = { - internal_error_identifier: 'l_ci_a_onAirdropPayFailure_1', - api_error_identifier: 'could_not_process', - error_config: errorConfig, - debug_options: {} - }; - return Promise.resolve(responseHelper.error(errorParams)); - -}; - - -/** - * Get airdrop budget holder address of airdrop - * - * @return {promise} - * - */ -Airdrop.prototype.airdropBudgetHolder = async function () { - const oThis = this - ; - - try { - const cacheResult = await oThis.airdropCache.getAirdropBudgetHolder(); - if (cacheResult.isSuccess() && cacheResult.data.response != null) { - return Promise.resolve(responseHelper.successWithData({airdropBudgetHolder: cacheResult.data.response})); - } else { - const getAirdropBudgetHolderFromContractResponse = await oThis.getAirdropBudgetHolderFromContract(); - if (getAirdropBudgetHolderFromContractResponse.isSuccess()) { - await oThis.airdropCache.setAirdropBudgetHolder(getAirdropBudgetHolderFromContractResponse.data.airdropBudgetHolder); - } - return Promise.resolve(getAirdropBudgetHolderFromContractResponse); + return Promise.resolve(responseHelper.error(errorParams)); + }, + + /** + * onAirdropPayFailure + * + * @param {Object} airdropPostPayParams - airdrop post pay params + * @param {string} airdropPostPayParams.beneficiaryAddress - beneficiary address + * @param {string} airdropPostPayParams.commissionBeneficiaryAddress - commission beneficiary address + * @param {string} airdropPostPayParams.spender - spender address + * @param {string} airdropPostPayParams.brandedTokenAddress - branded token address + * @param {string} airdropPostPayParams.contractAddress - contractAddress address + * @param {string} airdropPostPayParams.airdropBudgetHolder - airdrop budget holder address + * @param {number} airdropPostPayParams.totalAmount - total amount that was debited from spender account + * @param {number} airdropPostPayParams.airdropAmountToUse - airdrop amount that was used in the transaction + * @param {number} airdropPostPayParams.chainId - chain id + * + * @return {promise} + * + */ + onAirdropPayFailure: async function (airdropPostPayParams) { + + const oThis = this + ; + + const validationResponse = helper.validatePostAirdropPayParams(airdropPostPayParams); + if (validationResponse.isFailure()) return Promise.reject(validationResponse); + + const brandedTokenAddress = airdropPostPayParams.brandedTokenAddress + , contractAddress = airdropPostPayParams.contractAddress + , spender = airdropPostPayParams.spender + , totalTransferAmount = basicHelper.convertToBigNumber(airdropPostPayParams.totalAmount) + , airdropAmountToUse = basicHelper.convertToBigNumber(airdropPostPayParams.airdropAmountToUse) + , airdropBudgetHolderAddress = airdropPostPayParams.airdropBudgetHolder + ; + + const afterFailureResponse = await oThis.transactionHelper.afterAirdropPayFailure( + brandedTokenAddress, + contractAddress, + spender, + totalTransferAmount, + airdropAmountToUse, + airdropBudgetHolderAddress); + + const isAllResponseSuccessful = oThis.transactionHelper.isAllResponseSuccessful(afterFailureResponse); + if (isAllResponseSuccessful) { + return Promise.resolve(responseHelper.successWithData({})); } - - } catch (err) { let errorParams = { - internal_error_identifier: 'l_ci_a_airdropBudgetHolder_1', - api_error_identifier: 'unhandled_api_error', + internal_error_identifier: 'l_ci_a_onAirdropPayFailure_1', + api_error_identifier: 'could_not_process', error_config: errorConfig, debug_options: {} }; - logger.error("lib/contract_interact/airdrop.js:airdropBudgetHolder inside catch ", err); return Promise.resolve(responseHelper.error(errorParams)); - } -}; + }, -/** - * Get airdrop budget holder address of airdrop from contract - * - * @return {promise} - * - */ -Airdrop.prototype.getAirdropBudgetHolderFromContract = async function () { - const oThis = this - ; - - const transactionObject = currContract.methods.airdropBudgetHolder() - , encodedABI = transactionObject.encodeABI() - , transactionOutputs = helper.getTransactionOutputs(transactionObject) - , response = await helper.call(web3Provider, oThis.contractAddress, encodedABI, {}, transactionOutputs); - return Promise.resolve(responseHelper.successWithData({airdropBudgetHolder: response[0]})); -}; + /** + * Get airdrop budget holder address of airdrop + * + * @return {promise} + * + */ + airdropBudgetHolder: async function () { + const oThis = this + ; -/** - * Get worker contract address - * - * @return {promise} - * - */ -Airdrop.prototype.getWorkers = async function () { - const oThis = this - ; - - const transactionObject = currContract.methods.workers() - , encodedABI = transactionObject.encodeABI() - , transactionOutputs = helper.getTransactionOutputs(transactionObject) - , response = await helper.call(web3Provider, oThis.contractAddress, encodedABI, {}, transactionOutputs); + try { + const cacheResult = await oThis.airdropCache.getAirdropBudgetHolder(); + if (cacheResult.isSuccess() && cacheResult.data.response != null) { + return Promise.resolve(responseHelper.successWithData({airdropBudgetHolder: cacheResult.data.response})); + } else { + const getAirdropBudgetHolderFromContractResponse = await oThis.getAirdropBudgetHolderFromContract(); + if (getAirdropBudgetHolderFromContractResponse.isSuccess()) { + await oThis.airdropCache.setAirdropBudgetHolder(getAirdropBudgetHolderFromContractResponse.data.airdropBudgetHolder); + } + return Promise.resolve(getAirdropBudgetHolderFromContractResponse); + } - return Promise.resolve(responseHelper.successWithData({workerContractAddress: response[0]})); + } catch (err) { + let errorParams = { + internal_error_identifier: 'l_ci_a_airdropBudgetHolder_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }; + logger.error("lib/contract_interact/airdrop.js:airdropBudgetHolder inside catch ", err); + return Promise.resolve(responseHelper.error(errorParams)); + } + }, + + /** + * Get airdrop budget holder address of airdrop from contract + * + * @return {promise} + * + */ + getAirdropBudgetHolderFromContract: async function () { + const oThis = this + ; + + const transactionObject = currContract.methods.airdropBudgetHolder() + , encodedABI = transactionObject.encodeABI() + , transactionOutputs = helper.getTransactionOutputs(transactionObject) + , response = await helper.call(web3Provider, oThis.contractAddress, encodedABI, {}, transactionOutputs); + + return Promise.resolve(responseHelper.successWithData({airdropBudgetHolder: response[0]})); + }, + + /** + * Get worker contract address + * + * @return {promise} + * + */ + getWorkers: async function () { + const oThis = this + ; + + const transactionObject = currContract.methods.workers() + , encodedABI = transactionObject.encodeABI() + , transactionOutputs = helper.getTransactionOutputs(transactionObject) + , response = await helper.call(web3Provider, oThis.contractAddress, encodedABI, {}, transactionOutputs); + + return Promise.resolve(responseHelper.successWithData({workerContractAddress: response[0]})); + } }; +Object.assign(Airdrop, AirdropSpecificPrototype); + +module.exports = Airdrop; From baef8fdc3c68aea8cf7721ccce177355108f61e5 Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Wed, 6 Jun 2018 11:49:42 +0530 Subject: [PATCH 37/72] sourcing the env vars for dynamo init. --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0098164..0dc66fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,11 +79,7 @@ before_script: - unzip ./dynamodb/dynamodb_local_latest.zip - nohup java -Djava.library.path=./dynamodb/DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb & - sleep 30 - - export OS_DYNAMODB_API_VERSION='2012-08-10' - - export OS_DYNAMODB_ACCESS_KEY_ID='x' - - export OS_DYNAMODB_SECRET_ACCESS_KEY='x' - - export OS_DYNAMODB_REGION='localhost' - - export OS_DYNAMODB_ENDPOINT='http://localhost:8000' + - . ./mocha_test/scripts/set_env_vars.sh - node tools/dynamo_db_init.js script: - truffle test From 20b33f39d73f90ed3fc141ddd18b886adb6314d4 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Wed, 6 Jun 2018 11:51:21 +0530 Subject: [PATCH 38/72] bug fixes for dynamo support. --- config/core_constants.js | 1 + lib/contract_interact/airdrop.js | 4 +-- lib/contract_interact/branded_token.js | 9 +++--- lib/contract_interact/pricer.js | 38 +++++++++++++------------- lib/transaction_helper.js | 8 +++--- mocha_test/scripts/set_env_vars.sh | 11 +++++++- package.json | 2 +- 7 files changed, 42 insertions(+), 31 deletions(-) diff --git a/config/core_constants.js b/config/core_constants.js index a6274a6..e36f369 100644 --- a/config/core_constants.js +++ b/config/core_constants.js @@ -28,6 +28,7 @@ define("MYSQL_USER", process.env.OP_MYSQL_USER); define("MYSQL_PASSWORD", process.env.OP_MYSQL_PASSWORD); define("MYSQL_DATABASE", process.env.OP_MYSQL_DATABASE); define("MYSQL_CONNECTION_POOL_SIZE", process.env.OP_MYSQL_CONNECTION_POOL_SIZE); +define("STANDALONE_MODE", process.env.OST_STANDALONE_MODE); //Debug level diff --git a/lib/contract_interact/airdrop.js b/lib/contract_interact/airdrop.js index 88351c2..b28cd55 100644 --- a/lib/contract_interact/airdrop.js +++ b/lib/contract_interact/airdrop.js @@ -198,7 +198,7 @@ const AirdropSpecificPrototype = { let brandedTokenAddress = brandedTokenResponse.data.brandedToken; const airdropBudgetHolderResponse = await oThis.airdropBudgetHolder(); - if (airdropBudgetHolderResponse.isSuccess()) return Promise.reject(airdropBudgetHolderResponse); + if (airdropBudgetHolderResponse.isFailure()) return Promise.reject(airdropBudgetHolderResponse); let airdropBudgetHolder = airdropBudgetHolderResponse.data.airdropBudgetHolder; @@ -533,6 +533,6 @@ const AirdropSpecificPrototype = { } }; -Object.assign(Airdrop, AirdropSpecificPrototype); +Object.assign(Airdrop.prototype, AirdropSpecificPrototype); module.exports = Airdrop; diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 5477391..4fd324b 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -395,7 +395,8 @@ BrandedToken.prototype = { /** * Called after successful transfer to airdrop budget holder * - * @param {string} address - address + * @param {string} spenderAddress - spenderAddress + * @param {string} airdropBudgetHolderAddress - airdropBudgetHolderAddress * @param {BigNumber} amount - amount in wei * * @return {Promise} @@ -403,16 +404,16 @@ BrandedToken.prototype = { * @private * */ - _afterTransferSuccess: async function(senderAddress, airdropBudgetHolderAddress, amount) { + _afterTransferSuccess: async function(spenderAddress, airdropBudgetHolderAddress, amount) { const oThis = this ; - logger.debug('_afterTransferSuccess called with params:', JSON.stringify({address: address, amount: amount})); + logger.debug('_afterTransferSuccess called with params:', JSON.stringify({spenderAddress: spenderAddress, amount: amount})); //Credit the amount to the recipient. await oThis.creditBalance(airdropBudgetHolderAddress, amount); //Debit the amount to the sender. - await oThis.debitBalance(senderAddress, amount); + await oThis.debitBalance(spenderAddress, amount); return Promise.resolve(responseHelper.successWithData({})); }, diff --git a/lib/contract_interact/pricer.js b/lib/contract_interact/pricer.js index 6ddd2a0..3ab4b93 100644 --- a/lib/contract_interact/pricer.js +++ b/lib/contract_interact/pricer.js @@ -936,26 +936,26 @@ Pricer.prototype = { */ pay: function (spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, options) { - const oThis = this - ; + const oThis = this + ; - return oThis._asyncPay(spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, - commissionAmount, currency, intendedPricePoint, gasPrice, options) - .catch(function (error) { - if (responseHelper.isCustomResult(error)) { - return error; - } else { - logger.error(`${__filename}::pay::catch`); - logger.error(error); - return responseHelper.error({ - internal_error_identifier: 'l_ci_p_pay_1', - api_error_identifier: 'unhandled_api_error', - error_config: errorConfig, - debug_options: {} - }); - } - }); -}, + return oThis._asyncPay(spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, + commissionAmount, currency, intendedPricePoint, gasPrice, options) + .catch(function (error) { + if (responseHelper.isCustomResult(error)) { + return error; + } else { + logger.error(`${__filename}::pay::catch`); + logger.error(error); + return responseHelper.error({ + internal_error_identifier: 'l_ci_p_pay_1', + api_error_identifier: 'unhandled_api_error', + error_config: errorConfig, + debug_options: {} + }); + } + }); + }, /** * Actual Pay - can give rejections of promise diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index 0b97b20..15e6a88 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -229,7 +229,7 @@ TransactionHelper.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, auto_scaling: null, - erc20_contract_address: oThis.brandedTokenAddress + erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, un_settled_debit_amount: estimatedPayAmount.toString(10) @@ -278,7 +278,7 @@ TransactionHelper.prototype = { promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, auto_scaling: null, - erc20_contract_address: oThis.brandedTokenAddress + erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: beneficiaryAddress, settle_amount: actualBeneficiaryAmount.toString(10) @@ -368,7 +368,7 @@ TransactionHelper.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, auto_scaling: null, - erc20_contract_address: oThis.brandedTokenAddress + erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, un_settled_debit_amount: (estimatedPayAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10) @@ -679,7 +679,7 @@ TransactionHelper.prototype = { erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: airdropBugdetAddress, - un_settled_debit_amount: estimatedAirdropAmount.toString(10) + un_settled_debit_amount: (estimatedAirdropAmount.mul(basicHelper.convertToBigNumber(-1))).toString(10) }).catch(function (error) { if (responseHelper.isCustomResult(error)) { return error; diff --git a/mocha_test/scripts/set_env_vars.sh b/mocha_test/scripts/set_env_vars.sh index 186e522..9cdc123 100644 --- a/mocha_test/scripts/set_env_vars.sh +++ b/mocha_test/scripts/set_env_vars.sh @@ -20,4 +20,13 @@ export OP_MYSQL_DATABASE='payment_development' export OP_MYSQL_CONNECTION_POOL_SIZE='5' export OST_CACHING_ENGINE='none' -export OST_DEBUG_ENABLED=1 \ No newline at end of file +export OST_DEBUG_ENABLED=1 + + +export OS_DYNAMODB_API_VERSION='2012-08-10' +export OS_DYNAMODB_ACCESS_KEY_ID='x' +export OS_DYNAMODB_SECRET_ACCESS_KEY='x' +export OS_DYNAMODB_REGION='localhost' +export OS_DYNAMODB_ENDPOINT='http://localhost:8000' + +export OST_STANDALONE_MODE=1 \ No newline at end of file diff --git a/package.json b/package.json index 24bfcda..cce90c9 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.9", + "@openstfoundation/openst-storage": "1.0.0-beta.12", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 08b6b7845d495a95dff03e68ed68636108be6711 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Wed, 6 Jun 2018 11:55:16 +0530 Subject: [PATCH 39/72] clear cache not required in payments. --- mocha_test/services/airdrop/pay.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mocha_test/services/airdrop/pay.js b/mocha_test/services/airdrop/pay.js index 80a4fbd..2709114 100644 --- a/mocha_test/services/airdrop/pay.js +++ b/mocha_test/services/airdrop/pay.js @@ -14,7 +14,6 @@ const rootPrefix = "../../.." , logger = require(rootPrefix + '/helpers/custom_console_logger') , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') - , BalanceCacheKlass = require(rootPrefix + '/lib/cache_management/balance') ; const errorConfig = { @@ -494,15 +493,6 @@ function validateTransferSuccess( * */ async function populateCache() { - - // Clear the previous cache - const cacheObject = new BalanceCacheKlass(constants.chainId, constants.TC5Address); - await cacheObject.clearBalance(constants.account1); - await cacheObject.clearBalance(constants.account2); - await cacheObject.clearBalance(constants.account3); - await cacheObject.clearBalance(constants.account4); - await cacheObject.clearBalance(constants.account5); - // Populate Cache await brandedTokenObject.getBalanceOf(constants.account1); await brandedTokenObject.getBalanceOf(constants.account2); From f5948a7b6d4205edf9d9d5143a98eaf823f4ba22 Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Wed, 6 Jun 2018 12:03:07 +0530 Subject: [PATCH 40/72] version bump for openst-storage. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cce90c9..90b893f 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.12", + "@openstfoundation/openst-storage": "1.0.0-beta.14", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 13152eb4749a6d4f7719b6b80dea6192e75b3fd0 Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Wed, 6 Jun 2018 12:14:19 +0530 Subject: [PATCH 41/72] readme changes for dynamo DB. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c833639..0dced26 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,15 @@ While OpenST 0.9 is available as-is for anyone to use, we caution that this is e npm install @openstfoundation/openst-payments --save ``` +# Init DynamoDB +Following commands need to be run once, only for the first time. DynamoDB initial migrations for shard management are +run in it and one shard is created and registered for storing token balance. + +```bash +. ./mocha_test/scripts/set_env_vars.sh +node tools/dynamo_db_init.js +``` + # Run Test Chain ```bash From c5662ff088e79726918314f48dec92fef92303f1 Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Wed, 6 Jun 2018 12:20:25 +0530 Subject: [PATCH 42/72] readme and changelog changes. --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7561568..ebd61c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## OpenST-Payments v1.0.8-beta.1 () +DynamoDB integration for token balance - Now the balances (settled and unsettled debits) are being stored in DynamoDB. +Openst-Storage takes care of implementing the model class for DynamoDB tables and is integrated in OpenST-Payments in this release. +Cache for token balances is now responsibility of the OpenST-Storage module and is removed from OpenST-Payments module. + ## OpenST-Payments v1.0.7 (23 May 2018) Changelog: diff --git a/package.json b/package.json index 90b893f..77306c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.7", + "version": "1.0.8-beta.1", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From afe889d5b88198911786a952de5228f8b54d3d0f Mon Sep 17 00:00:00 2001 From: kedarchandrayan Date: Wed, 6 Jun 2018 12:33:00 +0530 Subject: [PATCH 43/72] readme and changelog changes. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd61c7..681b410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## OpenST-Payments v1.0.8-beta.1 () +#####OpenST-storage and dynamoDB integration for token balances ([openst-payments#124](https://github.com/OpenSTFoundation/openst-payments/issues/124)) DynamoDB integration for token balance - Now the balances (settled and unsettled debits) are being stored in DynamoDB. Openst-Storage takes care of implementing the model class for DynamoDB tables and is integrated in OpenST-Payments in this release. Cache for token balances is now responsibility of the OpenST-Storage module and is removed from OpenST-Payments module. From 8b28bd577dc47a48dfb3c2961dc64b2322456beb Mon Sep 17 00:00:00 2001 From: Alpesh Date: Thu, 7 Jun 2018 16:38:19 +0530 Subject: [PATCH 44/72] lowercase address for cache. --- lib/contract_interact/branded_token.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 4fd324b..fbc8b0b 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -99,7 +99,7 @@ BrandedToken.prototype = { return Promise.resolve(balanceResponse); } - const ownerBalance = balanceResponse.data[owner].available_balance; + const ownerBalance = balanceResponse.data[owner.toLowerCase()].available_balance; return responseHelper.successWithData({balance: ownerBalance}); From 1b91fdc6deacb16a303d17147bf480652d6dccd8 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Thu, 7 Jun 2018 16:38:44 +0530 Subject: [PATCH 45/72] version upgrade --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 77306c6..70ebe07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.1", + "version": "1.0.8-beta.2", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 49bc2f2f61833895c50a8d087e9ad19f3b6d747b Mon Sep 17 00:00:00 2001 From: Alpesh Date: Thu, 7 Jun 2018 16:49:22 +0530 Subject: [PATCH 46/72] storage version upgrade --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 70ebe07..e522aac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.2", + "version": "1.0.8-beta.3", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.14", + "@openstfoundation/openst-storage": "1.0.0-beta.18", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From c2a2aef7c33b1fd4766558ed499937f5906f2c2a Mon Sep 17 00:00:00 2001 From: Alpesh Date: Thu, 7 Jun 2018 17:35:24 +0530 Subject: [PATCH 47/72] storage version upgrade --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e522aac..39c8846 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.18", + "@openstfoundation/openst-storage": "1.0.0-beta.19", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From eb6760e3e401f78012d91e2412a0500cce3f51b3 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Thu, 7 Jun 2018 17:36:09 +0530 Subject: [PATCH 48/72] storage version upgrade --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39c8846..cfb1738 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.3", + "version": "1.0.8-beta.4", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From f27f1a4c9905dfc2f585c761d1ff34a2eb82674c Mon Sep 17 00:00:00 2001 From: Alpesh Date: Fri, 8 Jun 2018 20:10:47 +0530 Subject: [PATCH 49/72] upgrade storage version. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cfb1738..2aa674f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.4", + "version": "1.0.8-beta.5", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.19", + "@openstfoundation/openst-storage": "1.0.0-beta.20", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 4259561b68b336f4d29516d06791d8cc5c2a5e62 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 12 Jun 2018 11:48:05 +0530 Subject: [PATCH 50/72] enabled autoscaling for DDB tables --- lib/contract_interact/EIP20TokenMock.js | 3 ++- lib/contract_interact/branded_token.js | 8 +++++--- lib/transaction_helper.js | 27 +++++++++++++------------ tools/deploy/EIP20TokenMock.js | 2 ++ tools/dynamo_db_init.js | 5 +++-- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/lib/contract_interact/EIP20TokenMock.js b/lib/contract_interact/EIP20TokenMock.js index b4ed02f..565e1e0 100644 --- a/lib/contract_interact/EIP20TokenMock.js +++ b/lib/contract_interact/EIP20TokenMock.js @@ -17,6 +17,7 @@ const rootPrefix = '../..' , web3Provider = require(rootPrefix + '/lib/web3/providers/ws') , gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') + , autoScalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') , basicHelper = require(rootPrefix + '/helpers/basic_helper') , logger = require(rootPrefix + '/helpers/custom_console_logger') ; @@ -89,7 +90,7 @@ MockToken.prototype = { // set balance in dynamo and cache. const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.contractAddress }).set({ ethereum_address: ownerAddress, diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index fbc8b0b..0f3847f 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -23,6 +23,7 @@ const rootPrefix = '../..' , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') + , autoScalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') ; const errorConfig = { @@ -91,6 +92,7 @@ BrandedToken.prototype = { const balanceResponse = await new openSTStorage.TokenBalanceCache({ ddb_service: ddbServiceObj, + auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.brandedTokenAddress, ethereum_addresses: [owner] }).fetch(); @@ -208,7 +210,7 @@ BrandedToken.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.brandedTokenAddress }).update({ ethereum_address: owner, @@ -250,7 +252,7 @@ BrandedToken.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.brandedTokenAddress }).update({ ethereum_address: owner, @@ -296,7 +298,7 @@ BrandedToken.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: oThis.brandedTokenAddress }).update({ ethereum_address: owner, diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index 15e6a88..497685d 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -24,6 +24,7 @@ const rootPrefix = '..' , paramErrorConfig = require(rootPrefix + '/config/param_error_config') , apiErrorConfig = require(rootPrefix + '/config/api_error_config') , ddbServiceObj = require(rootPrefix + '/lib/dynamoDB_service') + , autoScalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') ; const errorConfig = { @@ -228,7 +229,7 @@ TransactionHelper.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, @@ -277,7 +278,7 @@ TransactionHelper.prototype = { promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: beneficiaryAddress, @@ -300,7 +301,7 @@ TransactionHelper.prototype = { // credit commissionBeneficiaryAddress with actualCommissionBeneficiaryAmount - add it to the settled_amount promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: commissionBeneficiaryAddress, @@ -325,7 +326,7 @@ TransactionHelper.prototype = { // subtract estimatedDebitAmount from un_settled_debit_amount AND subtract actualDebitAmount from settle_amount. promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, @@ -367,7 +368,7 @@ TransactionHelper.prototype = { const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, @@ -421,7 +422,7 @@ TransactionHelper.prototype = { if (amountToDebitFromChain.gt(0)) { promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, @@ -448,7 +449,7 @@ TransactionHelper.prototype = { // pessimistic debit of airdrop budget holder. promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: airdropBugdetAddress, @@ -511,7 +512,7 @@ TransactionHelper.prototype = { // credit beneficiaryAddress with actualBeneficiaryAmount - add it to the settled_amount promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: beneficiaryAddress, @@ -534,7 +535,7 @@ TransactionHelper.prototype = { // credit commissionBeneficiaryAddress with actualCommissionBeneficiaryAmount - add it to the settled_amount promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: commissionBeneficiaryAddress, @@ -559,7 +560,7 @@ TransactionHelper.prototype = { // subtract estimatedDebitAmount from un_settled_debit_amount AND subtract actualDebitAmount from settle_amount. promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, @@ -588,7 +589,7 @@ TransactionHelper.prototype = { // AND subtracting actualAirdropAmount from settle_amount promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: airdropBugdetAddress, @@ -649,7 +650,7 @@ TransactionHelper.prototype = { // rollback the pessimistic debit made from the spender address promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: spenderAddress, @@ -675,7 +676,7 @@ TransactionHelper.prototype = { // rollback the pessimistic debit made from airdrop budget holder address. promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, - auto_scaling: null, + auto_scaling: autoScalingServiceObj, erc20_contract_address: brandedTokenAddress }).update({ ethereum_address: airdropBugdetAddress, diff --git a/tools/deploy/EIP20TokenMock.js b/tools/deploy/EIP20TokenMock.js index 4313f4b..fb89fbc 100644 --- a/tools/deploy/EIP20TokenMock.js +++ b/tools/deploy/EIP20TokenMock.js @@ -24,6 +24,7 @@ const readline = require('readline') , gasLimitGlobalConstant = require(rootPrefix + '/lib/global_constant/gas_limit') , dynamodbConnectionParams = require(rootPrefix + '/config/dynamoDB') , ddbServiceObj = new openSTStorage.Dynamodb(dynamodbConnectionParams) + , autoScalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') ; /** @@ -126,6 +127,7 @@ async function performer(argv) { await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, + auto_scaling: autoScalingServiceObj, erc20_contract_address: contractAddress }).allocate(); diff --git a/tools/dynamo_db_init.js b/tools/dynamo_db_init.js index 34c6057..179e782 100644 --- a/tools/dynamo_db_init.js +++ b/tools/dynamo_db_init.js @@ -10,7 +10,7 @@ const openSTStorage = require('@openstfoundation/openst-storage') const rootPrefix = '..' , logger = require(rootPrefix + '/helpers/custom_console_logger') , ddbServiceObj = require(rootPrefix + '/lib/dynamo_db_service') - // , autoscalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') + , autoScalingServiceObj = require(rootPrefix + '/lib/auto_scaling_service') ; /** @@ -30,7 +30,8 @@ DynamoDBInit.prototype = { // createAndRegisterShard logger.info('* Creating and registering shard for token balance model.'); await new openSTStorage.TokenBalanceModel({ - ddb_service: ddbServiceObj + ddb_service: ddbServiceObj, + auto_scaling: autoScalingServiceObj, }).createAndRegisterShard('tokenBalancesShard1') } }; From c1abd43a5fd2c4339b27df85a89621af7abe6446 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 12 Jun 2018 12:38:58 +0530 Subject: [PATCH 51/72] Version bump for storage module --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2aa674f..afa4dd7 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.20", + "@openstfoundation/openst-storage": "1.0.0-beta.21", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 5a67ea086f7f46ed595bd1d9cff7f670ab84c4d0 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 12 Jun 2018 13:51:26 +0530 Subject: [PATCH 52/72] Added auto scaling env vars --- config/autoscaling.js | 25 +++++++++++++++++++++++++ mocha_test/scripts/set_env_vars.sh | 8 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 config/autoscaling.js diff --git a/config/autoscaling.js b/config/autoscaling.js new file mode 100644 index 0000000..141be12 --- /dev/null +++ b/config/autoscaling.js @@ -0,0 +1,25 @@ +"use strict"; + +const rootPrefix = '..' +; + +// Dynamo DB connection config details +var autoScalingConfig = { + 'apiVersion': process.env.OS_AUTOSCALING_API_VERSION, + 'accessKeyId': process.env.OS_AUTOSCALING_ACCESS_KEY_ID, + 'secretAccessKey': process.env.OS_AUTOSCALING_SECRET_ACCESS_KEY, + 'region': process.env.OS_AUTOSCALING_REGION, + 'endpoint': process.env.OS_AUTOSCALING_ENDPOINT +} + +if (process.env.OS_AUTOSCALING_SSL_ENABLED == 1) { + autoScalingConfig['sslEnabled'] = true; +} else { + autoScalingConfig['sslEnabled'] = false; +} + +if (process.env.OS_AUTOSCALING_LOGGING_ENABLED == 1) { + autoScalingConfig['logger'] = console; +} + +module.exports = autoScalingConfig; diff --git a/mocha_test/scripts/set_env_vars.sh b/mocha_test/scripts/set_env_vars.sh index 9cdc123..1f69865 100644 --- a/mocha_test/scripts/set_env_vars.sh +++ b/mocha_test/scripts/set_env_vars.sh @@ -29,4 +29,12 @@ export OS_DYNAMODB_SECRET_ACCESS_KEY='x' export OS_DYNAMODB_REGION='localhost' export OS_DYNAMODB_ENDPOINT='http://localhost:8000' +export OS_AUTOSCALING_API_VERSION='2016-02-06' +export OS_AUTOSCALING_ACCESS_KEY_ID='x' +export OS_AUTOSCALING_SECRET_ACCESS_KEY='x' +export OS_AUTOSCALING_REGION='localhost' +export OS_AUTOSCALING_ENDPOINT='http://localhost:8000' +export OS_AUTOSCALING_SSL_ENABLED='0' +export OS_AUTOSCALING_LOGGING_ENABLED='0' + export OST_STANDALONE_MODE=1 \ No newline at end of file From 3971bee80ca98625750a6d0c72b2dd4944787c02 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 12 Jun 2018 16:32:35 +0530 Subject: [PATCH 53/72] Fix for failing travis run --- config/core_constants.js | 3 +++ lib/auto_scaling_service.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/core_constants.js b/config/core_constants.js index e36f369..2408c24 100644 --- a/config/core_constants.js +++ b/config/core_constants.js @@ -33,3 +33,6 @@ define("STANDALONE_MODE", process.env.OST_STANDALONE_MODE); //Debug level define('DEBUG_ENABLED', process.env.OST_DEBUG_ENABLED || false); + +//Environment +define("RUNNING_TESTS_IN", process.env.RUNNING_TESTS_IN); diff --git a/lib/auto_scaling_service.js b/lib/auto_scaling_service.js index bd90994..5fe730a 100644 --- a/lib/auto_scaling_service.js +++ b/lib/auto_scaling_service.js @@ -10,7 +10,7 @@ const rootPrefix = '..' var autoscalingServiceObj = null; -if (coreConstants.ENVIRONMENT != 'development') { +if (coreConstants.RUNNING_TESTS_IN != 'travis' ) { const OSTStorage = require('@openstfoundation/openst-storage') , autoScalingConfig = require(rootPrefix + '/config/autoscaling') ; From 75dafd204933253f37570e7fc58313f57c61c88e Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 12 Jun 2018 16:44:39 +0530 Subject: [PATCH 54/72] Added the flag in set_env_vars --- mocha_test/scripts/set_env_vars.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mocha_test/scripts/set_env_vars.sh b/mocha_test/scripts/set_env_vars.sh index 1f69865..eab0594 100644 --- a/mocha_test/scripts/set_env_vars.sh +++ b/mocha_test/scripts/set_env_vars.sh @@ -37,4 +37,5 @@ export OS_AUTOSCALING_ENDPOINT='http://localhost:8000' export OS_AUTOSCALING_SSL_ENABLED='0' export OS_AUTOSCALING_LOGGING_ENABLED='0' -export OST_STANDALONE_MODE=1 \ No newline at end of file +export OST_STANDALONE_MODE=1 +export RUNNING_TESTS_IN='travis' From 72f7f0a7bcd13ae965582fdf2fd4c856eb096c09 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 12 Jun 2018 17:52:27 +0530 Subject: [PATCH 55/72] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afa4dd7..d8731d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.5", + "version": "1.0.8-beta.6", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 171c1a64654e1e8c2852e70747189af8e35304f4 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Wed, 13 Jun 2018 12:58:40 +0530 Subject: [PATCH 56/72] Storage version change --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8731d7..cec5b13 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.21", + "@openstfoundation/openst-storage": "1.0.0-beta.22", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From c1c29add661f2db4b8be86ff7610fe478cabfb31 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Wed, 13 Jun 2018 13:02:37 +0530 Subject: [PATCH 57/72] storage version upgrade. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cec5b13..f2e3d2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.6", + "version": "1.0.8-beta.7", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From 8872047223a17d855c661f6f9a66913864ec035e Mon Sep 17 00:00:00 2001 From: santhu210 Date: Thu, 14 Jun 2018 13:05:43 +0530 Subject: [PATCH 58/72] Fix for budget holder amount approval issue --- services/airdrop_management/approve.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/airdrop_management/approve.js b/services/airdrop_management/approve.js index dde31b3..d97b258 100644 --- a/services/airdrop_management/approve.js +++ b/services/airdrop_management/approve.js @@ -160,8 +160,8 @@ ApproveKlass.prototype = { } oThis.brandedTokenObject = new brandedTokenContractInteract(oThis.brandedTokenContractAddress, oThis.chainId); - result = await oThis.brandedTokenObject.getBalanceOf(oThis.airdropBudgetHolderAddress); - oThis.amount = result.data.balance; + //result = await oThis.brandedTokenObject.getBalanceOf(oThis.airdropBudgetHolderAddress); + oThis.amount = '250000000000000000000000'; //result.data.balance; const amountInBigNumber = new BigNumber(oThis.amount); if (amountInBigNumber.isNaN() || !amountInBigNumber.isInteger()){ let errorParams = { From 3295f24d7f0d2ceefc479e64665616a584db0a70 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Thu, 14 Jun 2018 13:09:35 +0530 Subject: [PATCH 59/72] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f2e3d2e..406465a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.7", + "version": "1.0.8-beta.8", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", From c4d3d2bed44e7e84f098b4ae241f83932b6a139e Mon Sep 17 00:00:00 2001 From: Alpesh Date: Mon, 25 Jun 2018 18:05:04 +0530 Subject: [PATCH 60/72] storage version upgrade. --- lib/transaction_helper.js | 59 ++++++++++++++++++++------------------- package.json | 4 +-- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index 497685d..f7af757 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -270,7 +270,7 @@ TransactionHelper.prototype = { * */ afterPaySuccess: async function(brandedTokenAddress, spenderAddress, estimatedPayAmount, beneficiaryAddress, - actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount) { + actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount) { const oThis = this , promiseArray = [] , actualTotalAmount = actualBeneficiaryAmount.plus(actualCommissionBeneficiaryAmount) @@ -407,7 +407,7 @@ TransactionHelper.prototype = { * */ beforeAirdropPay: async function(brandedTokenAddress, airdropAddress, spenderAddress, totalTransferAmount, airdropBalanceToUse, - airdropBugdetAddress) { + airdropBugdetAddress) { logger.debug('lib/transaction_helper.js:beforeAirdropPay called with params:', JSON.stringify( {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, @@ -489,11 +489,12 @@ TransactionHelper.prototype = { * * @return {promise} */ - afterAirdropPaySuccess: function(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, - estimatedAirdropAmount, beneficiaryAddress, actualBeneficiaryAmount, - commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount, - actualAirdropAmount, airdropBugdetAddress) { + afterAirdropPaySuccess: async function(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, + estimatedAirdropAmount, beneficiaryAddress, actualBeneficiaryAmount, + commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount, + actualAirdropAmount, airdropBugdetAddress) { + console.log("-PPP--------------------------------------------------------------6--", Date.now(), 'ms'); logger.debug('lib/transaction_helper.js:afterAirdropPaySuccess called with params:', JSON.stringify( {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount, beneficiaryAddress: beneficiaryAddress, @@ -531,7 +532,7 @@ TransactionHelper.prototype = { }); } })); - + console.log("-PPP--------------------------------------------------------------6.1--", Date.now(), 'ms'); // credit commissionBeneficiaryAddress with actualCommissionBeneficiaryAmount - add it to the settled_amount promiseArray.push(new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, @@ -554,7 +555,7 @@ TransactionHelper.prototype = { }); } })); - + console.log("-PPP--------------------------------------------------------------6.2--", Date.now(), 'ms'); // we had pessimistically debitted estimatedDebitAmount from spenderAddress. // now adjusting the debit to actualDebitAmount. // subtract estimatedDebitAmount from un_settled_debit_amount AND subtract actualDebitAmount from settle_amount. @@ -580,10 +581,10 @@ TransactionHelper.prototype = { }); } })); - + console.log("-PPP--------------------------------------------------------------6.3--", Date.now(), 'ms'); // we had debited estimatedAirdropAmount previously from spender balance, now adjusting the delta. promiseArray.push(oThis.updateAirdropBalance(airdropAddress, spenderAddress, estimatedAirdropAmount.minus(actualAirdropAmount))); - + console.log("-PPP--------------------------------------------------------------6.4--", Date.now(), 'ms'); // changes for spender address. // we had added estimatedAirdropAmount previously to airdropBugdetAddress un_settled_debit_amount, now subtracting the same. // AND subtracting actualAirdropAmount from settle_amount @@ -609,8 +610,10 @@ TransactionHelper.prototype = { }); } })); - - return Promise.all(promiseArray); + console.log("-PPP--------------------------------------------------------------6.5--", Date.now(), 'ms'); + let resp = await Promise.all(promiseArray) + console.log("-PPP--------------------------------------------------------------6.6--", Date.now(), 'ms'); + return resp; }, /** @@ -627,7 +630,7 @@ TransactionHelper.prototype = { * */ afterAirdropPayFailure: function (brandedTokenAddress, airdropAddress, spenderAddress, - estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress) { + estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress) { logger.debug('lib/transaction_helper.js:afterAirdropPayFailure called with params:', JSON.stringify( {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, @@ -700,14 +703,14 @@ TransactionHelper.prototype = { }, /** - * Get actual beneficiary amount, actual commission amount and actual airdrop amount from transaction receipt - * - * @param {Object} transactionReceipt - transaction receipt - * @param {Object} addressToNameMap - address to name map object - * @param {string} eventName - Event name - * - * @return {result} - */ + * Get actual beneficiary amount, actual commission amount and actual airdrop amount from transaction receipt + * + * @param {Object} transactionReceipt - transaction receipt + * @param {Object} addressToNameMap - address to name map object + * @param {string} eventName - Event name + * + * @return {result} + */ getActualAmountsFromReceipt: function(transactionReceipt, addressToNameMap, eventName) { const oThis = this; @@ -773,13 +776,13 @@ TransactionHelper.prototype = { }, /** - * Check if all response is success - * - * @param {array} results - response array - * - * @return {boolean} - * - */ + * Check if all response is success + * + * @param {array} results - response array + * + * @return {boolean} + * + */ isAllResponseSuccessful: function (results) { var isSuccess = true; for (var i = results.length - 1; i >= 0; i--) { diff --git a/package.json b/package.json index 406465a..4a678a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.8", + "version": "1.0.8-beta.9", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.22", + "@openstfoundation/openst-storage": "1.0.0-beta.26", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From a879b8d1d7a1b335770144761d7f4d10b3a25e8c Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 26 Jun 2018 15:46:17 +0530 Subject: [PATCH 61/72] Version bump --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4a678a6..e9eaeb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.9", + "version": "1.0.8-beta.10", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.26", + "@openstfoundation/openst-storage": "1.0.0-beta.27", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From ac9a8672438aaaf1e24c8cab6860526d8d262e29 Mon Sep 17 00:00:00 2001 From: santhu210 Date: Tue, 26 Jun 2018 15:48:48 +0530 Subject: [PATCH 62/72] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9eaeb4..3c73635 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.27", + "@openstfoundation/openst-storage": "1.0.0-beta.28", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 674be094125e3666f791f840d2be7958ef2c2401 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Tue, 26 Jun 2018 20:11:41 +0530 Subject: [PATCH 63/72] storage pgrade. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3c73635..d38c739 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.10", + "version": "1.0.8-beta.11", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.0", "@openstfoundation/openst-cache": "1.0.3", "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.28", + "@openstfoundation/openst-storage": "1.0.0-beta.29", "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", "bignumber.js": "4.1.0", "mustache": "2.3.0", From 23aa4113f64aab1523902fb25e518f320e644c47 Mon Sep 17 00:00:00 2001 From: Shlok Gilda Date: Wed, 27 Jun 2018 15:53:46 +0530 Subject: [PATCH 64/72] Remove json.stringify --- lib/cache_multi_management/base.js | 2 +- lib/contract_interact/branded_token.js | 6 +++--- lib/transaction_helper.js | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/cache_multi_management/base.js b/lib/cache_multi_management/base.js index ba63e25..079665c 100644 --- a/lib/cache_multi_management/base.js +++ b/lib/cache_multi_management/base.js @@ -149,7 +149,7 @@ baseCacheMultiManagementKlass.prototype = { } } } else { - logger.error("==>Error while getting from cache: ", JSON.stringify(cacheFetchResponse)); + logger.error("==>Error while getting from cache: ", cacheFetchResponse); for (var i = 0; i < cacheKeys.length; i++) { var cacheKey = cacheKeys[i]; cacheMiss.push(oThis.cacheKeys[cacheKey]); diff --git a/lib/contract_interact/branded_token.js b/lib/contract_interact/branded_token.js index 0f3847f..2d756c6 100644 --- a/lib/contract_interact/branded_token.js +++ b/lib/contract_interact/branded_token.js @@ -389,7 +389,7 @@ BrandedToken.prototype = { const oThis = this ; - logger.debug('_beforeTransfer called with params:', JSON.stringify({address: address, amount: amount})); + logger.debug('_beforeTransfer called with params:', {address: address, amount: amount}); return oThis.pessimisticDebit(address, amount); }, @@ -410,7 +410,7 @@ BrandedToken.prototype = { const oThis = this ; - logger.debug('_afterTransferSuccess called with params:', JSON.stringify({spenderAddress: spenderAddress, amount: amount})); + logger.debug('_afterTransferSuccess called with params:', {spenderAddress: spenderAddress, amount: amount}); //Credit the amount to the recipient. await oThis.creditBalance(airdropBudgetHolderAddress, amount); @@ -435,7 +435,7 @@ BrandedToken.prototype = { const oThis = this ; - logger.debug('_afterTransferFail called with params:', JSON.stringify({address: address, amount: amount})); + logger.debug('_afterTransferFail called with params:', {address: address, amount: amount}); return oThis.pessimisticDebit(address, (basicHelper.convertToBigNumber(amount)).mul(basicHelper.convertToBigNumber(-1))); }, diff --git a/lib/transaction_helper.js b/lib/transaction_helper.js index f7af757..255b51c 100644 --- a/lib/transaction_helper.js +++ b/lib/transaction_helper.js @@ -150,7 +150,7 @@ TransactionHelper.prototype = { }); const creditAirdropUsedAmountResponse = await AdjustAirdropAmountObject.creditAirdropUsedAmount(); - logger.debug('creditAirdropBalance.result', JSON.stringify(creditAirdropUsedAmountResponse)); + logger.debug('creditAirdropBalance.result', creditAirdropUsedAmountResponse); oThis.clearUserDetailCache(airdropContractAddress, owner); return Promise.resolve(creditAirdropUsedAmountResponse); } @@ -179,7 +179,7 @@ TransactionHelper.prototype = { }); const debitAirdropUsedAmountResponse = await AdjustAirdropAmountObject.debitAirdropUsedAmount(); - logger.debug('debitAirdropBalance.result', JSON.stringify(debitAirdropUsedAmountResponse)); + logger.debug('debitAirdropBalance.result', debitAirdropUsedAmountResponse); oThis.clearUserDetailCache(airdropContractAddress, owner); return Promise.resolve(debitAirdropUsedAmountResponse); } @@ -224,8 +224,8 @@ TransactionHelper.prototype = { const oThis = this ; - logger.debug('lib/transaction_helper.js:beforePay called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount})); + logger.debug('lib/transaction_helper.js:beforePay called with params:', + {brandedTokenAddress: brandedTokenAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount}); const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, @@ -363,8 +363,8 @@ TransactionHelper.prototype = { const oThis = this ; - logger.debug('lib/transaction_helper.js:afterPayFailure called with params:', JSON.stringify( - {brandedTokenAddress: brandedTokenAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount})); + logger.debug('lib/transaction_helper.js:afterPayFailure called with params:', + {brandedTokenAddress: brandedTokenAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount}); const balanceUpdateResponse = await new openSTStorage.TokenBalanceModel({ ddb_service: ddbServiceObj, @@ -409,9 +409,9 @@ TransactionHelper.prototype = { beforeAirdropPay: async function(brandedTokenAddress, airdropAddress, spenderAddress, totalTransferAmount, airdropBalanceToUse, airdropBugdetAddress) { - logger.debug('lib/transaction_helper.js:beforeAirdropPay called with params:', JSON.stringify( + logger.debug('lib/transaction_helper.js:beforeAirdropPay called with params:', {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, - estimatedAirdropAmount: airdropBalanceToUse, airdropBugdetAddress: airdropBugdetAddress})); + estimatedAirdropAmount: airdropBalanceToUse, airdropBugdetAddress: airdropBugdetAddress}); const oThis = this , amountToDebitFromChain = totalTransferAmount.minus(airdropBalanceToUse) @@ -495,13 +495,13 @@ TransactionHelper.prototype = { actualAirdropAmount, airdropBugdetAddress) { console.log("-PPP--------------------------------------------------------------6--", Date.now(), 'ms'); - logger.debug('lib/transaction_helper.js:afterAirdropPaySuccess called with params:', JSON.stringify( + logger.debug('lib/transaction_helper.js:afterAirdropPaySuccess called with params:', {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, estimatedPayAmount: estimatedPayAmount, beneficiaryAddress: beneficiaryAddress, actualBeneficiaryAmount: actualBeneficiaryAmount, commissionBeneficiaryAddress: commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount: actualCommissionBeneficiaryAmount, estimatedAirdropAmount: estimatedAirdropAmount, airdropBugdetAddress: airdropBugdetAddress, - actualAirdropAmount: actualAirdropAmount})); + actualAirdropAmount: actualAirdropAmount}); const oThis = this , estimatedDebitAmount = estimatedPayAmount.minus(estimatedAirdropAmount) @@ -632,9 +632,9 @@ TransactionHelper.prototype = { afterAirdropPayFailure: function (brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress) { - logger.debug('lib/transaction_helper.js:afterAirdropPayFailure called with params:', JSON.stringify( + logger.debug('lib/transaction_helper.js:afterAirdropPayFailure called with params:', {brandedTokenAddress: brandedTokenAddress, airdropAddress: airdropAddress, spender: spenderAddress, - estimatedAirdropAmount: estimatedAirdropAmount, airdropBugdetAddress: airdropBugdetAddress})); + estimatedAirdropAmount: estimatedAirdropAmount, airdropBugdetAddress: airdropBugdetAddress}); const oThis = this , amountToCreditToChain = estimatedPayAmount.minus(estimatedAirdropAmount) From 33755186c205a20c0883b623a69d562eb2416d3d Mon Sep 17 00:00:00 2001 From: Dhananjay8 Date: Wed, 27 Jun 2018 19:38:08 +0530 Subject: [PATCH 65/72] Version upgrades --- package.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d38c739..08293dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.11", + "version": "1.0.8-beta.12", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -22,11 +22,10 @@ "make-docs": "node_modules/.bin/jsdoc -c .jsdoc.json" }, "dependencies": { - "@openstfoundation/openst-base": "0.9.0", - "@openstfoundation/openst-cache": "1.0.3", - "@openstfoundation/openst-notification": "1.0.1", - "@openstfoundation/openst-storage": "1.0.0-beta.29", - "@ostdotcom/ost-price-oracle": "^1.0.1-beta.3", + "@openstfoundation/openst-base": "0.9.1-beta.3", + "@openstfoundation/openst-cache": "1.0.4-beta.1", + "@openstfoundation/openst-notification": "1.0.2-beta.2", + "@openstfoundation/openst-storage": "1.0.0-beta.32", "bignumber.js": "4.1.0", "mustache": "2.3.0", "mysql": "2.14.1", From 0ad653404283c62cf1cf4f9f735885610d0dd8f1 Mon Sep 17 00:00:00 2001 From: Alpesh Date: Thu, 28 Jun 2018 20:41:43 +0530 Subject: [PATCH 66/72] storage upgrade. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 08293dd..78d4522 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.12", + "version": "1.0.8-beta.13", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -25,7 +25,7 @@ "@openstfoundation/openst-base": "0.9.1-beta.3", "@openstfoundation/openst-cache": "1.0.4-beta.1", "@openstfoundation/openst-notification": "1.0.2-beta.2", - "@openstfoundation/openst-storage": "1.0.0-beta.32", + "@openstfoundation/openst-storage": "1.0.0-beta.33", "bignumber.js": "4.1.0", "mustache": "2.3.0", "mysql": "2.14.1", From f65745a8ace62c7b8aa84af3c486241fbc97a3de Mon Sep 17 00:00:00 2001 From: Kedar Chandrayan Date: Fri, 29 Jun 2018 16:30:14 +0530 Subject: [PATCH 67/72] changelog changes. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 681b410..6770bae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## OpenST-Payments v1.0.8-beta.1 () +## OpenST-Payments v1.0.8-beta.1 #####OpenST-storage and dynamoDB integration for token balances ([openst-payments#124](https://github.com/OpenSTFoundation/openst-payments/issues/124)) DynamoDB integration for token balance - Now the balances (settled and unsettled debits) are being stored in DynamoDB. Openst-Storage takes care of implementing the model class for DynamoDB tables and is integrated in OpenST-Payments in this release. From 4ec205ee828ae13df57bb29d583cd8c106dda961 Mon Sep 17 00:00:00 2001 From: Kedar Chandrayan Date: Fri, 29 Jun 2018 19:57:45 +0530 Subject: [PATCH 68/72] version bump for self and dependencies --- CHANGELOG.md | 2 +- VERSION | 2 +- package.json | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6770bae..6ff2fdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## OpenST-Payments v1.0.8-beta.1 +## OpenST-Payments v1.0.8 #####OpenST-storage and dynamoDB integration for token balances ([openst-payments#124](https://github.com/OpenSTFoundation/openst-payments/issues/124)) DynamoDB integration for token balance - Now the balances (settled and unsettled debits) are being stored in DynamoDB. Openst-Storage takes care of implementing the model class for DynamoDB tables and is integrated in OpenST-Payments in this release. diff --git a/VERSION b/VERSION index f9cbc01..337a6a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.7 \ No newline at end of file +1.0.8 \ No newline at end of file diff --git a/package.json b/package.json index 78d4522..4d8a433 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openstfoundation/openst-payments", - "version": "1.0.8-beta.13", + "version": "1.0.8", "description": "Payment infrastructure on top of the OpenST network.", "keywords": [ "openst", @@ -22,10 +22,10 @@ "make-docs": "node_modules/.bin/jsdoc -c .jsdoc.json" }, "dependencies": { - "@openstfoundation/openst-base": "0.9.1-beta.3", - "@openstfoundation/openst-cache": "1.0.4-beta.1", - "@openstfoundation/openst-notification": "1.0.2-beta.2", - "@openstfoundation/openst-storage": "1.0.0-beta.33", + "@openstfoundation/openst-base": "0.9.1", + "@openstfoundation/openst-cache": "1.0.4", + "@openstfoundation/openst-notification": "1.0.2", + "@openstfoundation/openst-storage": "1.0.0", "bignumber.js": "4.1.0", "mustache": "2.3.0", "mysql": "2.14.1", From eb865d820d40e6ba031c442dbe78a5f72820e724 Mon Sep 17 00:00:00 2001 From: Kedar Chandrayan Date: Fri, 29 Jun 2018 20:44:54 +0530 Subject: [PATCH 69/72] change log changes --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff2fdb..2bfbdf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## OpenST-Payments v1.0.8 +## OpenST-Payments v1.0.8 #####OpenST-storage and dynamoDB integration for token balances ([openst-payments#124](https://github.com/OpenSTFoundation/openst-payments/issues/124)) DynamoDB integration for token balance - Now the balances (settled and unsettled debits) are being stored in DynamoDB. Openst-Storage takes care of implementing the model class for DynamoDB tables and is integrated in OpenST-Payments in this release. From 90726f85a21746c16b6640da0b88ba88752b867a Mon Sep 17 00:00:00 2001 From: Kedar Chandrayan Date: Fri, 29 Jun 2018 21:21:47 +0530 Subject: [PATCH 70/72] adding new branches to travis yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0dc66fb..103eff6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ branches: only: - master - develop + - release-1.0 + - pre-release-v1.0.8 notifications: email: recipients: From ca337beaa05c9f6325fe597a20122cffd51b0b8a Mon Sep 17 00:00:00 2001 From: Kedar Chandrayan Date: Fri, 29 Jun 2018 21:52:19 +0530 Subject: [PATCH 71/72] doc folder regenerate --- docs/AirdropModelCacheKlass.html | 391 + docs/baseCacheManagementKlass.html | 1335 +++ docs/baseCacheMultiManagementKlass.html | 1137 +++ docs/classes.list.html | 381 + docs/fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20127 bytes docs/fonts/glyphicons-halflings-regular.svg | 288 + docs/fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 45404 bytes docs/fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23424 bytes docs/fonts/glyphicons-halflings-regular.woff2 | Bin 0 -> 18028 bytes docs/global.html | 375 + docs/img/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes docs/img/glyphicons-halflings.png | Bin 0 -> 12799 bytes docs/index.html | 425 + ...helpers_basic_helper-BasicHelperKlass.html | 2419 ++++++ docs/module-helpers_basic_helper.html | 311 + ...rdrop_amount-AdjustAirdropAmountKlass.html | 831 ++ ...drop_management_adjust_airdrop_amount.html | 311 + ...ent_airdrop_cache-AirdropBalanceCache.html | 428 + ...le-lib_cache_management_airdrop_cache.html | 311 + ...e_management_pricer_cache-PricerCache.html | 3891 +++++++++ ...ule-lib_cache_management_pricer_cache.html | 311 + ...lib_contract_interact_airdrop-Airdrop.html | 424 + .../module-lib_contract_interact_airdrop.html | 311 + ...t_interact_branded_token-BrandedToken.html | 1573 ++++ ...e-lib_contract_interact_branded_token.html | 311 + ...nteract_helper-ContractInteractHelper.html | 4593 ++++++++++ docs/module-lib_contract_interact_helper.html | 311 + ...s_managed_contract-OpsManagedContract.html | 774 ++ ...ontract_interact_ops_managed_contract.html | 311 + ...interact_owned_contract-OwnedContract.html | 763 ++ ...-lib_contract_interact_owned_contract.html | 311 + ...ib_contract_interact_pricer-MockToken.html | 1199 +++ ...e-lib_contract_interact_pricer-Pricer.html | 5571 ++++++++++++ docs/module-lib_contract_interact_pricer.html | 407 + ...lib_contract_interact_workers-Workers.html | 1818 ++++ .../module-lib_contract_interact_workers.html | 311 + ..._builder_mysql-MySQLQueryBuilderKlass.html | 2662 ++++++ docs/module-lib_query_builder_mysql.html | 339 + ...e-lib_set_worker_and_ops-SetWorkerOps.html | 603 ++ docs/module-lib_set_worker_and_ops.html | 311 + ..._transaction_helper-TransactionHelper.html | 3873 +++++++++ docs/module-lib_transaction_helper.html | 311 + ...b3_events_formatter-web3EventsDecoder.html | 491 ++ ..._events_formatter-web3EventsFormatter.html | 457 + docs/module-lib_web3_events_formatter.html | 407 + docs/module-tools_deploy_DeployHelper.html | 821 ++ docs/module-tools_deploy_EIP20TokenMock.html | 448 + docs/module-tools_deploy_helper.html | 306 + docs/module-tools_deploy_pricer.html | 1495 ++++ docs/module-tools_deploy_workers.html | 406 + ...ule-tools_dynamo_db_init-DynamoDBInit.html | 343 + docs/module-tools_dynamo_db_init.html | 311 + docs/modules.list.html | 381 + docs/namespaces.list.html | 381 + docs/quicksearch.html | 31 + docs/scripts/docstrap.lib.js | 11 + docs/scripts/fulltext-search-ui.js | 89 + docs/scripts/fulltext-search.js | 36 + docs/scripts/lunr.min.js | 6 + docs/scripts/prettify/Apache-License-2.0.txt | 202 + docs/scripts/prettify/jquery.min.js | 6 + docs/scripts/prettify/lang-css.js | 21 + docs/scripts/prettify/prettify.js | 496 ++ docs/scripts/sunlight.js | 1157 +++ docs/scripts/toc.js | 203 + docs/styles/darkstrap.css | 960 +++ docs/styles/prettify-tomorrow.css | 132 + docs/styles/site.cerulean.css | 7008 +++++++++++++++ docs/styles/site.cosmo.css | 7061 +++++++++++++++ docs/styles/site.cyborg.css | 7048 +++++++++++++++ docs/styles/site.darkly.css | 7171 ++++++++++++++++ docs/styles/site.darkstrap.css | 5638 ++++++++++++ docs/styles/site.dibs-bootstrap.css | 5899 +++++++++++++ docs/styles/site.flatly.css | 7147 ++++++++++++++++ docs/styles/site.journal.css | 6973 +++++++++++++++ docs/styles/site.lumen.css | 7298 ++++++++++++++++ docs/styles/site.paper.css | 7623 +++++++++++++++++ docs/styles/site.readable.css | 6997 +++++++++++++++ docs/styles/site.sandstone.css | 7035 +++++++++++++++ docs/styles/site.simplex.css | 7023 +++++++++++++++ docs/styles/site.slate.css | 7343 ++++++++++++++++ docs/styles/site.spacelab.css | 7055 +++++++++++++++ docs/styles/site.superhero.css | 7131 +++++++++++++++ docs/styles/site.united.css | 6895 +++++++++++++++ docs/styles/site.yeti.css | 7195 ++++++++++++++++ docs/styles/sunlight.dark.css | 345 + docs/styles/sunlight.default.css | 344 + docs/userAirdropDetailCache.html | 864 ++ 88 files changed, 176922 insertions(+) create mode 100644 docs/AirdropModelCacheKlass.html create mode 100644 docs/baseCacheManagementKlass.html create mode 100644 docs/baseCacheMultiManagementKlass.html create mode 100644 docs/classes.list.html create mode 100644 docs/fonts/glyphicons-halflings-regular.eot create mode 100644 docs/fonts/glyphicons-halflings-regular.svg create mode 100644 docs/fonts/glyphicons-halflings-regular.ttf create mode 100644 docs/fonts/glyphicons-halflings-regular.woff create mode 100644 docs/fonts/glyphicons-halflings-regular.woff2 create mode 100644 docs/global.html create mode 100644 docs/img/glyphicons-halflings-white.png create mode 100644 docs/img/glyphicons-halflings.png create mode 100644 docs/index.html create mode 100644 docs/module-helpers_basic_helper-BasicHelperKlass.html create mode 100644 docs/module-helpers_basic_helper.html create mode 100644 docs/module-lib_airdrop_management_adjust_airdrop_amount-AdjustAirdropAmountKlass.html create mode 100644 docs/module-lib_airdrop_management_adjust_airdrop_amount.html create mode 100644 docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html create mode 100644 docs/module-lib_cache_management_airdrop_cache.html create mode 100644 docs/module-lib_cache_management_pricer_cache-PricerCache.html create mode 100644 docs/module-lib_cache_management_pricer_cache.html create mode 100644 docs/module-lib_contract_interact_airdrop-Airdrop.html create mode 100644 docs/module-lib_contract_interact_airdrop.html create mode 100644 docs/module-lib_contract_interact_branded_token-BrandedToken.html create mode 100644 docs/module-lib_contract_interact_branded_token.html create mode 100644 docs/module-lib_contract_interact_helper-ContractInteractHelper.html create mode 100644 docs/module-lib_contract_interact_helper.html create mode 100644 docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html create mode 100644 docs/module-lib_contract_interact_ops_managed_contract.html create mode 100644 docs/module-lib_contract_interact_owned_contract-OwnedContract.html create mode 100644 docs/module-lib_contract_interact_owned_contract.html create mode 100644 docs/module-lib_contract_interact_pricer-MockToken.html create mode 100644 docs/module-lib_contract_interact_pricer-Pricer.html create mode 100644 docs/module-lib_contract_interact_pricer.html create mode 100644 docs/module-lib_contract_interact_workers-Workers.html create mode 100644 docs/module-lib_contract_interact_workers.html create mode 100644 docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html create mode 100644 docs/module-lib_query_builder_mysql.html create mode 100644 docs/module-lib_set_worker_and_ops-SetWorkerOps.html create mode 100644 docs/module-lib_set_worker_and_ops.html create mode 100644 docs/module-lib_transaction_helper-TransactionHelper.html create mode 100644 docs/module-lib_transaction_helper.html create mode 100644 docs/module-lib_web3_events_formatter-web3EventsDecoder.html create mode 100644 docs/module-lib_web3_events_formatter-web3EventsFormatter.html create mode 100644 docs/module-lib_web3_events_formatter.html create mode 100644 docs/module-tools_deploy_DeployHelper.html create mode 100644 docs/module-tools_deploy_EIP20TokenMock.html create mode 100644 docs/module-tools_deploy_helper.html create mode 100644 docs/module-tools_deploy_pricer.html create mode 100644 docs/module-tools_deploy_workers.html create mode 100644 docs/module-tools_dynamo_db_init-DynamoDBInit.html create mode 100644 docs/module-tools_dynamo_db_init.html create mode 100644 docs/modules.list.html create mode 100644 docs/namespaces.list.html create mode 100644 docs/quicksearch.html create mode 100644 docs/scripts/docstrap.lib.js create mode 100644 docs/scripts/fulltext-search-ui.js create mode 100644 docs/scripts/fulltext-search.js create mode 100644 docs/scripts/lunr.min.js create mode 100644 docs/scripts/prettify/Apache-License-2.0.txt create mode 100644 docs/scripts/prettify/jquery.min.js create mode 100644 docs/scripts/prettify/lang-css.js create mode 100644 docs/scripts/prettify/prettify.js create mode 100644 docs/scripts/sunlight.js create mode 100644 docs/scripts/toc.js create mode 100644 docs/styles/darkstrap.css create mode 100644 docs/styles/prettify-tomorrow.css create mode 100644 docs/styles/site.cerulean.css create mode 100644 docs/styles/site.cosmo.css create mode 100644 docs/styles/site.cyborg.css create mode 100644 docs/styles/site.darkly.css create mode 100644 docs/styles/site.darkstrap.css create mode 100644 docs/styles/site.dibs-bootstrap.css create mode 100644 docs/styles/site.flatly.css create mode 100644 docs/styles/site.journal.css create mode 100644 docs/styles/site.lumen.css create mode 100644 docs/styles/site.paper.css create mode 100644 docs/styles/site.readable.css create mode 100644 docs/styles/site.sandstone.css create mode 100644 docs/styles/site.simplex.css create mode 100644 docs/styles/site.slate.css create mode 100644 docs/styles/site.spacelab.css create mode 100644 docs/styles/site.superhero.css create mode 100644 docs/styles/site.united.css create mode 100644 docs/styles/site.yeti.css create mode 100644 docs/styles/sunlight.dark.css create mode 100644 docs/styles/sunlight.default.css create mode 100644 docs/userAirdropDetailCache.html diff --git a/docs/AirdropModelCacheKlass.html b/docs/AirdropModelCacheKlass.html new file mode 100644 index 0000000..67bd0f9 --- /dev/null +++ b/docs/AirdropModelCacheKlass.html @@ -0,0 +1,391 @@ + + + + + + + OpenST Payments Class: AirdropModelCacheKlass + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: AirdropModelCacheKlass

+
+ +
+ +

+ AirdropModelCacheKlass +

+ + +
+ + +
+
+ + +
+
+

new AirdropModelCacheKlass(cache)

+ + +
+
+ + +
+ constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cache + + +object + + + + + get/set related arguments
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/baseCacheManagementKlass.html b/docs/baseCacheManagementKlass.html new file mode 100644 index 0000000..16d9b62 --- /dev/null +++ b/docs/baseCacheManagementKlass.html @@ -0,0 +1,1335 @@ + + + + + + + OpenST Payments Class: baseCacheManagementKlass + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: baseCacheManagementKlass

+
+ +
+ +

+ baseCacheManagementKlass +

+ + +
+ + +
+
+ + +
+
+

new baseCacheManagementKlass(params)

+ + +
+
+ + +
+ constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +Object + + + + + cache key generation & expiry related params
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

_cacheKeyPrefix()

+ + +
+
+ + +
+ cache key prefix +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + + +
+
+ + + + + +
+ + + +
+
+

_fetchFromCache()

+ + +
+
+ + +
+ fetch from cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

_setCache(dataToSet)

+ + +
+
+ + +
+ set data in cache. +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
dataToSet + + +Object + + + + + data to se tin cache
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Result + + + +
+
+ + + + + +
+ + + +
+
+

_sharedCacheKeyPrefix()

+ + +
+
+ + +
+ Shared cache key prefix +This cache is shared between company api and saas +Cache keys with these prefixes can be flushed via company api or saas. +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + + +
+
+ + + + + +
+ + + +
+
+

clear()

+ + +
+
+ + +
+ clear cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Result> + + + +
+
+ + + + + +
+ + + +
+
+

fetch()

+ + +
+
+ + +
+ Fetch data from cache, in case of cache miss calls sub class method to fetch data from source +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ - On success, data.value has value. On failure, error details returned. +
+ + + +
+
+ Type +
+
+ +Promise.<Result> + + + +
+
+ + + + + +
+ + + +
+
+

fetchDataFromSource()

+ + +
+
+ + +
+ fetch data from source +return should be of klass Result +data attr of return is returned and set in cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Result + + + +
+
+ + + + + +
+ + + +
+
+

setCacheExpiry()

+ + +
+
+ + +
+ set cache expiry in oThis.cacheExpiry and return it +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Number + + + +
+
+ + + + + +
+ + + +
+
+

setCacheKey()

+ + +
+
+ + +
+ set cache key in oThis.cacheKey and return it +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/baseCacheMultiManagementKlass.html b/docs/baseCacheMultiManagementKlass.html new file mode 100644 index 0000000..fcd0631 --- /dev/null +++ b/docs/baseCacheMultiManagementKlass.html @@ -0,0 +1,1137 @@ + + + + + + + OpenST Payments Class: baseCacheMultiManagementKlass + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: baseCacheMultiManagementKlass

+
+ +
+ +

+ baseCacheMultiManagementKlass +

+ + +
+ + +
+
+ + +
+
+

new baseCacheMultiManagementKlass(params)

+ + +
+
+ + +
+ constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +Object + + + + + cache key generation & expiry related params
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

_fetchFromCache()

+ + +
+
+ + +
+ fetch from cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

_setCache(dataToSet)

+ + +
+
+ + +
+ set data in cache. +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
dataToSet + + +Object + + + + + data to set in cache
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Result + + + +
+
+ + + + + +
+ + + +
+
+

clear()

+ + +
+
+ + +
+ clear cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Result> + + + +
+
+ + + + + +
+ + + +
+
+

fetch()

+ + +
+
+ + +
+ Fetch data from cache, in case of cache miss calls sub class method to fetch data from source +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ - On success, data.value has value. On failure, error details returned. +
+ + + +
+
+ Type +
+
+ +Promise.<Result> + + + +
+
+ + + + + +
+ + + +
+
+

fetchDataFromSource()

+ + +
+
+ + +
+ fetch data from source +return should be of klass Result +data attr of return is returned and set in cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Result + + + +
+
+ + + + + +
+ + + +
+
+

setCacheExpiry()

+ + +
+
+ + +
+ set cache expiry in oThis.cacheExpiry and return it +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Number + + + +
+
+ + + + + +
+ + + +
+
+

setCacheKeys()

+ + +
+
+ + +
+ set cache keys in oThis.cacheKeys and return it +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/classes.list.html b/docs/classes.list.html new file mode 100644 index 0000000..1eaf0f3 --- /dev/null +++ b/docs/classes.list.html @@ -0,0 +1,381 @@ + + + + + + + OpenST Payments Classes + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Classes

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
AirdropModelCacheKlass
+
+ +
baseCacheManagementKlass
+
+ +
baseCacheMultiManagementKlass
+
+ +
BasicHelperKlass
+
+ +
AdjustAirdropAmountKlass
+
+ +
AirdropBalanceCache
+
+ +
PricerCache
+
+ +
Airdrop
+
+ +
BrandedToken
+
+ +
ContractInteractHelper
+
+ +
OpsManagedContract
+
+ +
OwnedContract
+
+ +
MockToken
+
+ +
Pricer
+
+ +
Workers
+
+ +
MySQLQueryBuilderKlass
+
+ +
SetWorkerOps
+
+ +
TransactionHelper
+
+ +
DynamoDBInit
+
+ +
userAirdropDetailCache
+
+
+ + + + + +

Namespaces

+ +
+
web3EventsDecoder
+
+ +
web3EventsFormatter
+
+
+ + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000000000000000000000000000000000000..b93a4953fff68df523aa7656497ee339d6026d64 GIT binary patch literal 20127 zcma%hV{j!vx9y2-`@~L8?1^pLwlPU2wr$&<*tR|KBoo`2;LUg6eW-eW-tKDb)vH%` z^`A!Vd<6hNSRMcX|Cb;E|1qflDggj6Kmr)xA10^t-vIc3*Z+F{r%|K(GyE^?|I{=9 zNq`(c8=wS`0!RZy0g3{M(8^tv41d}oRU?8#IBFtJy*9zAN5dcxqGlMZGL>GG%R#)4J zDJ2;)4*E1pyHia%>lMv3X7Q`UoFyoB@|xvh^)kOE3)IL&0(G&i;g08s>c%~pHkN&6 z($7!kyv|A2DsV2mq-5Ku)D#$Kn$CzqD-wm5Q*OtEOEZe^&T$xIb0NUL}$)W)Ck`6oter6KcQG9Zcy>lXip)%e&!lQgtQ*N`#abOlytt!&i3fo)cKV zP0BWmLxS1gQv(r_r|?9>rR0ZeEJPx;Vi|h1!Eo*dohr&^lJgqJZns>&vexP@fs zkPv93Nyw$-kM5Mw^{@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r`C#{S}J2;s#d{M)ncW(#Y$C*lByLQ z&?+{dR7*gpdT~(1;M(FfF==3z`^eW)=5a9RqvF-)2?S-(G zhS;p(u~_qBum*q}On@$#08}ynd0+spzyVco0%G6;<-i5&016cV5UKzhQ~)fX03|>L z8ej+HzzgVr6_5ZUpa4HW0Ca!=r1%*}Oo;2no&Zz8DfR)L!@r<5 z2viSZpmvo5XqXyAz{Ms7`7kX>fnr1gi4X~7KpznRT0{Xc5Cfz@43PjBMBoH@z_{~( z(Wd}IPJ9hH+%)Fc)0!hrV+(A;76rhtI|YHbEDeERV~Ya>SQg^IvlazFkSK(KG9&{q zkPIR~EeQaaBmwA<20}mBO?)N$(z1@p)5?%}rM| zGF()~Z&Kx@OIDRI$d0T8;JX@vj3^2%pd_+@l9~a4lntZ;AvUIjqIZbuNTR6@hNJoV zk4F;ut)LN4ARuyn2M6F~eg-e#UH%2P;8uPGFW^vq1vj8mdIayFOZo(tphk8C7hpT~ z1Fv8?b_LNR3QD9J+!v=p%}# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..1413fc609ab6f21774de0cb7e01360095584f65b GIT binary patch literal 45404 zcmd?Sd0-pWwLh*qi$?oCk~i6sWlOeWJC3|4juU5JNSu9hSVACzERcmjLV&P^utNzg zIE4Kr1=5g!SxTX#Ern9_%4&01rlrW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Nl zV>@xkWWWv*N+{e$(SrExvN6BXzU(Hxlx27{VYHf+LpIbTO+Yu(ltMk<;)3A(LU@ytVYFkYvTa79idMtUFhfxx?P!)2F`prNWW#Fub#l>N2s@nh&n_ zA4{#}|AIs9|A4P0ZF%fy=hDN!t#ifH<)4u2kirK~JUpjQ-J+~cXOZI&dIts;P}UeXslP6zKvpEKSN-$y>kJ^nw2tC9bv zo(|lT@?vZ!{_l|d^8Yh)eEBh*5ABh+Lzjw+?V)o z#P-W7361>E(Y4;@`sv;VKn G`u_lkUM?>H literal 0 HcmV?d00001 diff --git a/docs/fonts/glyphicons-halflings-regular.woff2 b/docs/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..64539b54c3751a6d9adb44c8e3a45ba5a73b77f0 GIT binary patch literal 18028 zcmV(~K+nH-Pew8T0RR9107h&84*&oF0I^&E07eM_0Rl|`00000000000000000000 z0000#Mn+Uk92y`7U;vDA2m}!b3WBL5f#qcZHUcCAhI9*rFaQJ~1&1OBl~F%;WnyLq z8)b|&?3j;$^FW}&KmNW53flIFARDZ7_Wz%hpoWaWlgHTHEHf()GI0&dMi#DFPaEt6 zCO)z0v0~C~q&0zBj^;=tv8q{$8JxX)>_`b}WQGgXi46R*CHJ}6r+;}OrvwA{_SY+o zK)H-vy{l!P`+NG*`*x6^PGgHH4!dsolgU4RKj@I8Xz~F6o?quCX&=VQ$Q{w01;M0? zKe|5r<_7CD z=eO3*x!r$aX2iFh3;}xNfx0v;SwBfGG+@Z;->HhvqfF4r__4$mU>Dl_1w;-9`~5rF~@!3;r~xP-hZvOfOx)A z#>8O3N{L{naf215f>m=bzbp7_(ssu&cx)Qo-{)!)Yz3A@Z0uZaM2yJ8#OGlzm?JO5gbrj~@)NB4@?>KE(K-$w}{};@dKY#K3+Vi64S<@!Z{(I{7l=!p9 z&kjG^P~0f46i13(w!hEDJga;*Eb z`!n|++@H8VaKG<9>VDh(y89J#=;Z$ei=GnD5TesW#|Wf)^D+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JlT2kCOV0000$L_|bHBqAarB4TD{W@grX1CUr72@caw0faEd7-K|4L_|cawbojjHdpd6 zI6~Iv5J?-Q4*&oF000000FV;^004t70Z6Qk1Xl{X9oJ{sRC2(cs?- literal 0 HcmV?d00001 diff --git a/docs/global.html b/docs/global.html new file mode 100644 index 0000000..49ca8a1 --- /dev/null +++ b/docs/global.html @@ -0,0 +1,375 @@ + + + + + + + OpenST Payments Global + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Global

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<constant> rootPrefix

+ + +
+
+ +
+ List of all addresses and there respective abi, bin, passphrase +required for platform. + +And helper methods to access this information using human readable +names. +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/img/glyphicons-halflings-white.png b/docs/img/glyphicons-halflings-white.png new file mode 100644 index 0000000000000000000000000000000000000000..3bf6484a29d8da269f9bc874b25493a45fae3bae GIT binary patch literal 8777 zcmZvC1yGz#v+m*$LXcp=A$ZWB0fL7wNbp_U*$~{_gL`my3oP#L!5tQYy99Ta`+g_q zKlj|KJ2f@c)ARJx{q*bbkhN_!|Wn*Vos8{TEhUT@5e;_WJsIMMcG5%>DiS&dv_N`4@J0cnAQ-#>RjZ z00W5t&tJ^l-QC*ST1-p~00u^9XJ=AUl7oW-;2a+x2k__T=grN{+1c4XK0ZL~^z^i$ zp&>vEhr@4fZWb380S18T&!0cQ3IKpHF)?v=b_NIm0Q>vwY7D0baZ)n z31Fa5sELUQARIVaU0nqf0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`gI?tVQZ4X={qU?(n zV>0ASES^Xuc;9JBji{)RnFL(Lez;8XbB1uWaMp@p?7xhXk6V#!6B@aP4Rz7-K%a>i z?fvf}va_DGUXlI#4--`A3qK7J?-HwnG7O~H2;zR~RLW)_^#La!=}+>KW#anZ{|^D3 B7G?kd literal 0 HcmV?d00001 diff --git a/docs/img/glyphicons-halflings.png b/docs/img/glyphicons-halflings.png new file mode 100644 index 0000000000000000000000000000000000000000..a9969993201f9cee63cf9f49217646347297b643 GIT binary patch literal 12799 zcma*OWmH^Ivn@*S;K3nSf_t!#;0f+&pm7Po8`nk}2q8f5;M%x$SdAkd9FAvlc$ zx660V9e3Ox@4WZ^?7jZ%QFGU-T~%||Ug4iK6bbQY@zBuF2$hxOw9wF=A)nUSxR_5@ zEX>HBryGrjyuOFFv$Y4<+|3H@gQfEqD<)+}a~mryD|1U9*I_FOG&F%+Ww{SJ-V2BR zjt<81Ek$}Yb*95D4RS0HCps|uLyovt;P05hchQb-u2bzLtmog&f2}1VlNhxXV);S9 zM2buBg~!q9PtF)&KGRgf3#z7B(hm5WlNClaCWFs!-P!4-u*u5+=+D|ZE9e`KvhTHT zJBnLwGM%!u&vlE%1ytJ=!xt~y_YkFLQb6bS!E+s8l7PiPGSt9xrmg?LV&&SL?J~cI zS(e9TF1?SGyh+M_p@o1dyWu7o7_6p;N6hO!;4~ z2B`I;y`;$ZdtBpvK5%oQ^p4eR2L)BH>B$FQeC*t)c`L71gXHPUa|vyu`Bnz)H$ZcXGve(}XvR!+*8a>BLV;+ryG1kt0=)ytl zNJxFUN{V7P?#|Cp85QTa@(*Q3%K-R(Pkv1N8YU*(d(Y}9?PQ(j;NzWoEVWRD-~H$=f>j9~PN^BM2okI(gY-&_&BCV6RP&I$FnSEM3d=0fCxbxA6~l>54-upTrw zYgX@%m>jsSGi`0cQt6b8cX~+02IghVlNblR7eI;0ps}mpWUcxty1yG56C5rh%ep(X z?)#2d?C<4t-KLc*EAn>>M8%HvC1TyBSoPNg(4id~H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9Id;?%4PfR4&Ph9B9cFK~@tG3wlFW-0fXZS_L4U*EiAA%+`h%q2^6BCC;t0iO4V=s4Qug{M|iDV@s zC7|ef-dxiR7T&Mpre!%hiUhHM%3Qxi$Lzw6&(Tvlx9QA_7LhYq<(o~=Y>3ka-zrQa zhGpfFK@)#)rtfz61w35^sN1=IFw&Oc!Nah+8@qhJ0UEGr;JplaxOGI82OVqZHsqfX ze1}r{jy;G?&}Da}a7>SCDsFDuzuseeCKof|Dz2BPsP8? zY;a)Tkr2P~0^2BeO?wnzF_Ul-ekY=-w26VnU%U3f19Z-pj&2 z4J_a|o4Dci+MO)mPQIM>kdPG1xydiR9@#8m zh27D7GF{p|a{8({Q-Pr-;#jV{2zHR>lGoFtIfIpoMo?exuQyX_A;;l0AP4!)JEM$EwMInZkj+8*IHP4vKRd zKx_l-i*>A*C@{u%ct`y~s6MWAfO{@FPIX&sg8H{GMDc{4M3%$@c8&RAlw0-R<4DO3 trJqdc$mBpWeznn?E0M$F`|3v=`3%T2A17h;rxP7$%JLd=6(2u;`(N3pt&so# literal 0 HcmV?d00001 diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..86b33e9 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,425 @@ + + + + + + + OpenST Payments Index + + + + + + + + + + + + + +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+

OpenST Payments - Advance Payment infrastructure on top of the OpenST network

Latest version +Travis +Downloads per month +Gitter: JOIN CHAT

+

While OpenST 0.9 is available as-is for anyone to use, we caution that this is early stage software and under heavy ongoing development and improvement. Please report bugs and suggested improvements.

+

Install OpenST Payments

npm install @openstfoundation/openst-payments --save

Init DynamoDB

Following commands need to be run once, only for the first time. DynamoDB initial migrations for shard management are +run in it and one shard is created and registered for storing token balance.

+
. ./mocha_test/scripts/set_env_vars.sh
+node tools/dynamo_db_init.js

Run Test Chain

cd mocha_test/scripts/
+sh start_test_chain.sh

Set EVN Variables

Setup Initial Setup Variables:

export OST_UTILITY_GETH_RPC_PROVIDER=''
+export OST_UTILITY_GETH_WS_PROVIDER=''
+export OST_UTILITY_DEPLOYER_ADDR=''
+export OST_UTILITY_DEPLOYER_PASSPHRASE=''
+export OST_UTILITY_OPS_ADDR=''
+export OST_UTILITY_OPS_PASSPHRASE=''

Deploy Branded Token Contract:

node tools/deploy/EIP20TokenMock.js conversionRate symbol name decimals gasPrice

Deploy Workers Contract:

node tools/deploy/workers.js gasPrice chainId

Deploy Airdrop Contract:

node tools/deploy/airdrop.js brandedTokenContractAddress baseCurrency workerContractAddress airdropBudgetHolder gasPrice chainId

Set Caching Engine:

export OST_CACHING_ENGINE='none'
+For using redis/memcache as cache engine refer - [OpenSTFoundation/ost-price-oracle](https://github.com/OpenSTFoundation/ost-price-oracle)

Set DB Details For Payments/Airdrop:

export OP_MYSQL_HOST=''
+export OP_MYSQL_USER=''
+export OP_MYSQL_PASSWORD=''
+export OP_MYSQL_DATABASE=''
+export OP_MYSQL_CONNECTION_POOL_SIZE='5'

Create Airdrop Tables:

node migrations/create_tables.js 

Deploy Service Examples:

const OpenSTPayment = require('@openstfoundation/openst-payments')
+  , Deploy = OpenSTPayment.services.deploy
+;  
+  // Deploy Workers
+  const deployWorkerObject = new Deploy.workers({
+    gas_price: gasPrice,
+    options: {returnType: 'txHash'}
+  });
+  deployWorkerObject.perform();
+
+  // Deploy Airdrop
+  const deployAirdropObject = new Deploy.airdrop({
+    branded_token_contract_address: brandedTokenAddress,
+    base_currency: baseCurrency,
+    worker_contract_address: workerContractAddress,
+    airdrop_budget_holder: airdropBudgetHolder,
+    gas_price: gasPrice,
+    options: {returnType: 'txHash'}
+  });
+  deployAirdropObject.perform();
+

OpsManaged Service Examples

const OpenSTPayment = require('@openstfoundation/openst-payments')
+  , OpsManaged = OpenSTPayment.services.opsManaged
+;  
+  // Set Ops Address
+  const setOpsObject = new OpsManaged.setOps({
+    contract_address: contractAddress,
+    gas_price: gasPrice,
+    chain_id: chainId,
+    deployer_address: deployerAddress,
+    deployer_passphrase: deployerPassphrase,
+    ops_address: opsAddress,
+    options: {returnType: 'txHash'}
+  });
+  setOpsObject.perform();
+
+  // Get Ops Address
+  const getOpsObject = new OpsManaged.getOps({
+    contract_address: contractAddress,
+    gas_price: gasPrice,
+    chain_id: chainId
+  });
+  getOpsObject.perform();

Workers Service Examples

const OpenSTPayment = require('@openstfoundation/openst-payments')
+  , Workers = OpenSTPayment.services.workers
+;  
+  // Set Worker
+  const setWorkerObject = new Workers.setWorker({
+      workers_contract_address: constants.workersContractAddress,
+      sender_address: constants.ops,
+      sender_passphrase: constants.opsPassphrase,
+      worker_address: workerAddress,
+      deactivation_height: deactivationHeight.toString(10),
+      gas_price: gasPrice,
+      chain_id: chainId,
+      options: {returnType: 'txHash'}
+  });
+  setWorkerObject.perform();
+
+  // Is Worker
+  const isWorkerObject = new Workers.isWorker({
+      workers_contract_address: workersContractAddress,
+      worker_address: workerAddress,
+      chain_id: chainId
+  });
+  isWorkerObject.perform();

Airdrop Management Service Examples:

const OpenSTPayment = require('@openstfoundation/openst-payments')
+  , AirdropManager = OpenSTPayment.services.airdropManager
+;  
+  // Register Airdrop
+  const registerObject = new AirdropManager.register({
+    airdrop_contract_address: airdropContractAddress,
+    chain_id: chainId
+  });
+  registerObject.perform();
+
+  // Set Price Oracle
+  const setPriceOracleObject = new AirdropManager.setPriceOracle({
+      airdrop_contract_address: airdropContractAddress,
+      chain_id: chainId,
+      sender_address: senderAddress,
+      sender_passphrase: senderPassphrase,
+      currency: currency,
+      price_oracle_contract_address: priceOracleContractAddress,
+      gas_price: gasPrice,
+      options: {tag: 'airdrop.setPriceOracle', returnType: 'txHash'}
+  });
+  setPriceOracleObject.perform();
+
+  // Set Accepted Margin
+  const setAcceptedMarginObject = new AirdropManager.setAcceptedMargin({
+    airdrop_contract_address: airdropContractAddress,
+    chain_id: chainId,
+    sender_address: senderAddress,
+    sender_passphrase: senderPassphrase,
+    currency: currency,
+    accepted_margin: acceptedMargin,
+    gas_price: gasPrice,
+    options: {tag: 'airdrop.setAcceptedMargin', returnType: 'txHash'}
+  });
+  setAcceptedMarginObject.perform();
+
+  // Transfer Amount to airdrop budget holder
+  const transferObject = new AirdropManager.transfer({
+    sender_address: senderAddress,
+    sender_passphrase: senderPassphrase,
+    airdrop_contract_address: airdropContractAddress,
+    amount: airdropBudgetAmountInWei,
+    gas_price: gasPrice,
+    chain_id: chainId,
+    options: {tag: 'airdrop.transfer', returnType: 'txHash'}
+  });
+  transferObject.perform();
+
+  // Approve airdrop budget holder
+  const approveObject = new AirdropManager.approve({
+    airdrop_contract_address: airdropContractAddress,
+    airdrop_budget_holder_passphrase: airdropBudgetHolderPassphrase,
+    gas_price: gasPrice,
+    chain_id: chainId,
+    options: {tag: 'airdrop.approve', returnType: 'txHash'}
+  });
+  approveObject.perform();
+
+  // Allocate airdrop amount to users in batch
+  const batchAllocatorObject = new AirdropManager.batchAllocator({
+    airdrop_contract_address: airdropContractAddress,
+    transaction_hash: transactionHash,
+    airdrop_users: {userAddress1: {airdropAmount: amountInWei, expiryTimestamp: 0}, userAddress2: {airdropAmount: amountInWei, expiryTimestamp: 0}},
+    chain_id: chainId
+  });
+  batchAllocatorObject.perform();
+
+  // Get Users Airdrop Balance
+  const userBalanceObject = new AirdropManager.userBalance({
+    airdrop_contract_address: airdropContractAddress,
+    chain_id: chainId,
+    user_addresses: [user1, user2]
+  });
+  userBalanceObject.perform();
+
+  // Call Pay method
+  const payObject = new AirdropManager.pay({
+    airdrop_contract_address: airdropContractAddress,
+    chain_id: chainId,
+    sender_worker_address: workerAddress,
+    sender_worker_passphrase: workerPassphrase,
+    beneficiary_address: beneficiary,
+    transfer_amount: transferAmount.toString(10),
+    commission_beneficiary_address: commissionBeneficiary,
+    commission_amount: commissionAmount.toString(10),
+    currency: currency,
+    intended_price_point: intendedPricePoint,
+    spender: spenderAddress,
+    gas_price: gasPrice,
+    options: {tag:'airdrop.pay', returnType: 'txHash'}
+  });
+  payObject.perform()
+

For further implementation details, please refer to the API documentation.

+
+ + + + + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-helpers_basic_helper-BasicHelperKlass.html b/docs/module-helpers_basic_helper-BasicHelperKlass.html new file mode 100644 index 0000000..92eaef3 --- /dev/null +++ b/docs/module-helpers_basic_helper-BasicHelperKlass.html @@ -0,0 +1,2419 @@ + + + + + + + OpenST Payments Class: BasicHelperKlass + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: BasicHelperKlass

+
+ +
+ +

+ helpers/basic_helper~ + + BasicHelperKlass +

+ + +
+ + +
+
+ + +
+
+

new BasicHelperKlass()

+ + +
+
+ + +
+ Basic helper methods constructor +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

convertToBigNumber(amountInWei)

+ + +
+
+ + +
+ Convert number to big number. Make sure it's a valid number +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
amountInWei + + +number + + + + + amount in wei to be formatted
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +BigNumber + + + +
+
+ + + + + +
+ + + +
+
+

formatWeiToString(amountInWei)

+ + +
+
+ + +
+ Convert wei to proper string. Make sure it's a valid number +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
amountInWei + + +number + + + + + amount in wei to be formatted
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

getReturnType(returnType)

+ + +
+
+ + +
+ get return type for transaction +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
returnType + + +string + + + + + return from geth transactions when following event is received
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

isAddressValid(address)

+ + +
+
+ + +
+ Check if address is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
address + + +string + + + + + Address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isBTConversionRateValid(conversionRate)

+ + +
+
+ + +
+ Check if branded token conversion rate is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conversionRate + + +number + + + + + Branded token conversion rate
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isBTNameValid(name)

+ + +
+
+ + +
+ Check if branded token name is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + + Branded token name
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isBTSymbolValid(symbol)

+ + +
+
+ + +
+ Check if branded token symbol is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
symbol + + +string + + + + + Branded token symbol
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isNonZeroWeiValid(amountInWei)

+ + +
+
+ + +
+ Check if amount is valid wei number and not zero +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
amountInWei + + +number + + + + + amount in wei
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isReturnTypeTxHash(returnType)

+ + +
+
+ + +
+ check if return type is txHash or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
returnType + + +string + + + + + return type
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isReturnTypeTxReceipt(returnType)

+ + +
+
+ + +
+ check if return type is txReceipt or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
returnType + + +string + + + + + return type
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isReturnTypeUUID(returnType)

+ + +
+
+ + +
+ check if return type is uuid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
returnType + + +string + + + + + return type
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isTxHashValid(transactionHash)

+ + +
+
+ + +
+ Check if transaction hash is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transactionHash + + +string + + + + + Transaction hash
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isUuidValid(uuid)

+ + +
+
+ + +
+ Check if uuid is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
uuid + + +string + + + + + Branded Token UUID
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isValidChainId(chainId)

+ + +
+
+ + +
+ Check if chainId is valid +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chainId + + +Number + + + + + chainId
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Bool + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-helpers_basic_helper.html b/docs/module-helpers_basic_helper.html new file mode 100644 index 0000000..d7aa955 --- /dev/null +++ b/docs/module-helpers_basic_helper.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: helpers/basic_helper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: helpers/basic_helper

+
+ +
+ +
+ + +
+
+ + +
Perform basic validations
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
BasicHelperKlass
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_adjust_airdrop_amount-AdjustAirdropAmountKlass.html b/docs/module-lib_airdrop_management_adjust_airdrop_amount-AdjustAirdropAmountKlass.html new file mode 100644 index 0000000..ab7a6b1 --- /dev/null +++ b/docs/module-lib_airdrop_management_adjust_airdrop_amount-AdjustAirdropAmountKlass.html @@ -0,0 +1,831 @@ + + + + + + + OpenST Payments Class: AdjustAirdropAmountKlass + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: AdjustAirdropAmountKlass

+
+ +
+ +

+ lib/airdrop_management/adjust_airdrop_amount~ + + AdjustAirdropAmountKlass +

+ + +
+ + +
+
+ + +
+
+

new AdjustAirdropAmountKlass(airdropContractAddress, userAddress, airdropAmountUsed)

+ + +
+
+ + +
+ Constructor to create object of userBalance +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropContractAddress + + +Hex + + + + + airdrop contract address
userAddress + + +Array + + + + + Array of user addressed
airdropAmountUsed + + +BigNumber + + + + + used airdrop amount
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

creditAirdropUsedAmount()

+ + +
+
+ + +
+ Credit airdrop used amount. decreases airdrop_used_amount of user_airdrop_details table +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

debitAirdropUsedAmount()

+ + +
+
+ + +
+ Debit airdrop used amount +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

rollbackCreditAirdropAdjustedAmount()

+ + +
+
+ + +
+ Rollback credit airdrop used amount +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

rollbackDebitAirdropAdjustedAmount()

+ + +
+
+ + +
+ Rollback debit airdrop used amount +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_airdrop_management_adjust_airdrop_amount.html b/docs/module-lib_airdrop_management_adjust_airdrop_amount.html new file mode 100644 index 0000000..04932ba --- /dev/null +++ b/docs/module-lib_airdrop_management_adjust_airdrop_amount.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/airdrop_management/adjust_airdrop_amount + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/airdrop_management/adjust_airdrop_amount

+
+ +
+ +
+ + +
+
+ + +
This class would be used for calculating user airdrop balance.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
AdjustAirdropAmountKlass
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html b/docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html new file mode 100644 index 0000000..a690a42 --- /dev/null +++ b/docs/module-lib_cache_management_airdrop_cache-AirdropBalanceCache.html @@ -0,0 +1,428 @@ + + + + + + + OpenST Payments Class: AirdropBalanceCache + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: AirdropBalanceCache

+
+ +
+ +

+ lib/cache_management/airdrop_cache~ + + AirdropBalanceCache +

+ + +
+ + +
+
+ + +
+
+

new AirdropBalanceCache(chainId, airdropAddress)

+ + +
+
+ + +
+ constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chainId + + +string + + + + + Chain id
airdropAddress + + +string + + + + + address of airdrop contract
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ + + + +
    +
  • PricerCacheKlass
  • +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_cache_management_airdrop_cache.html b/docs/module-lib_cache_management_airdrop_cache.html new file mode 100644 index 0000000..777a745 --- /dev/null +++ b/docs/module-lib_cache_management_airdrop_cache.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/cache_management/airdrop_cache + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/cache_management/airdrop_cache

+
+ +
+ +
+ + +
+
+ + +
This is cache layer for airdrop balance related caching

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
AirdropBalanceCache
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_cache_management_pricer_cache-PricerCache.html b/docs/module-lib_cache_management_pricer_cache-PricerCache.html new file mode 100644 index 0000000..335a189 --- /dev/null +++ b/docs/module-lib_cache_management_pricer_cache-PricerCache.html @@ -0,0 +1,3891 @@ + + + + + + + OpenST Payments Class: PricerCache + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: PricerCache

+
+ +
+ +

+ lib/cache_management/pricer_cache~ + + PricerCache +

+ + +
+ + +
+
+ + +
+
+

new PricerCache(chainId, contractAddress)

+ + +
+
+ + +
+ constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chainId + + +string + + + + + Chain id
contractAddress + + +string + + + + + address of pricer/airdrop contract
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

clearAcceptedMargins(currency)

+ + +
+
+ + +
+ reset accepted margin cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearBrandedTokenAddress(brandedTokenAddress)

+ + +
+
+ + +
+ clear branded token address cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearCache(key)

+ + +
+
+ + +
+ Clear cache for given key +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + cache key
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearConversionRate()

+ + +
+
+ + +
+ Clear conversion rate from cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearConversionRateDecimals()

+ + +
+
+ + +
+ Clear conversion rate decimals from cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearDecimals()

+ + +
+
+ + +
+ clear decimals from cache +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearPriceOracles(currency, address)

+ + +
+
+ + +
+ Clear price oracle address for given currency in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
address + + +string + + + + + price oracle address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearPricePoint(address)

+ + +
+
+ + +
+ Clear price point of price oracle from cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
address + + +string + + + + + price oracle address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getAcceptedMargins(currency)

+ + +
+
+ + +
+ Get accepted margin +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getBrandedTokenAddress()

+ + +
+
+ + +
+ Get branded token address for pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getCacheKey(owner)

+ + +
+
+ + +
+ Get conversion rate for pricer +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
owner + + +string + + + + + address of user whose balance is to be found
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getCacheValue(key)

+ + +
+
+ + +
+ Get cached value +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + key
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getConversionRate()

+ + +
+
+ + +
+ Get conversion rate for pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getConversionRateDecimals()

+ + +
+
+ + +
+ Get conversion rate decimals for pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getDecimals()

+ + +
+
+ + +
+ Get decimals for pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getPriceOracles(currency)

+ + +
+
+ + +
+ Get price oracle address for given currency from cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getPricePoint(address)

+ + +
+
+ + +
+ Get price point of price oracle from cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
address + + +string + + + + + price oracle address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setAcceptedMargins(currency, margin)

+ + +
+
+ + +
+ Set accepted margin +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
margin + + +BigNumber + + + + + accepted margin value
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setBrandedTokenAddress(brandedTokenAddress)

+ + +
+
+ + +
+ Set branded token address for pricer +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setCacheValue(key, value)

+ + +
+
+ + +
+ Set value in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + key
value + + +string + + + + + value
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setConversionRate(conversionRate)

+ + +
+
+ + +
+ Set conversion rate to cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conversionRate + + +BigNumber + + + + + conversion rate of pricer/airdrop
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setConversionRateDecimals(conversionRateDecimals)

+ + +
+
+ + +
+ Set conversion rate decimals to cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conversionRateDecimals + + +BigNumber + + + + + conversion rate of pricer/airdrop
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setDecimals(conversionRateDecimals)

+ + +
+
+ + +
+ Set decimals to cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conversionRateDecimals + + +BigNumber + + + + + conversion rate of pricer/airdrop
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setPriceOracles(currency, address)

+ + +
+
+ + +
+ Set price oracle address for given currency in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
address + + +string + + + + + price oracle address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setPricePoint(pricePoint, address)

+ + +
+
+ + +
+ Set price point of price oracle from cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pricePoint + + +string + + + + + price oracle price point
address + + +string + + + + + price oracle address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_cache_management_pricer_cache.html b/docs/module-lib_cache_management_pricer_cache.html new file mode 100644 index 0000000..44812eb --- /dev/null +++ b/docs/module-lib_cache_management_pricer_cache.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/cache_management/pricer_cache + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/cache_management/pricer_cache

+
+ +
+ +
+ + +
+
+ + +
This is cache layer for pricer balance related caching

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
PricerCache
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_airdrop-Airdrop.html b/docs/module-lib_contract_interact_airdrop-Airdrop.html new file mode 100644 index 0000000..1ccfe39 --- /dev/null +++ b/docs/module-lib_contract_interact_airdrop-Airdrop.html @@ -0,0 +1,424 @@ + + + + + + + OpenST Payments Class: Airdrop + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Airdrop

+
+ +
+ +

+ lib/contract_interact/airdrop~ + + Airdrop +

+ + +
+ + +
+
+ + +
+
+

new Airdrop(airdropContractAddress, chainId)

+ + +
+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropContractAddress + + +string + + + + + airdrop contract address
chainId + + +string + + + + + chain ID
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ + + + +
    +
  • Pricer
  • +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_airdrop.html b/docs/module-lib_contract_interact_airdrop.html new file mode 100644 index 0000000..333fda8 --- /dev/null +++ b/docs/module-lib_contract_interact_airdrop.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/airdrop + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/airdrop

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on Pricer.sol contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
Airdrop
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_branded_token-BrandedToken.html b/docs/module-lib_contract_interact_branded_token-BrandedToken.html new file mode 100644 index 0000000..6ef6fd9 --- /dev/null +++ b/docs/module-lib_contract_interact_branded_token-BrandedToken.html @@ -0,0 +1,1573 @@ + + + + + + + OpenST Payments Class: BrandedToken + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: BrandedToken

+
+ +
+ +

+ lib/contract_interact/branded_token~ + + BrandedToken +

+ + +
+ + +
+
+ + +
+
+

new BrandedToken(brandedTokenAddress, chainId)

+ + +
+
+ + +
+ Constructor to create object of BrandedToken +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + Branded token address
chainId + + +number + + + + + chainId
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

brandedTokenAddress

+ + +
+
+ +
+ branded token address +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+

chainId

+ + +
+
+ +
+ chain id +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

approveByBudgetHolder(airdropBudgetHolderAddress, airdropBudgetHolderPassphrase, airdropContractAddress, amount, gasPrice, options)

+ + +
+
+ + +
+ Approve amount to budget holder +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropBudgetHolderAddress + + +string + + + + + address of airdropBudgetHolder
airdropBudgetHolderPassphrase + + +string + + + + + Passphrase of airdropBudgetHolder
airdropContractAddress + + +string + + + + + airdrop contract address
amount + + +BigNumber + + + + + amount in wei
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

creditBalance(owner, amount)

+ + +
+
+ + +
+ Credit balance in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
owner + + +string + + + + + Account address
amount + + +BigNumber + + + + + amount to be credited
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

debitBalance(owner, bigAmount)

+ + +
+
+ + +
+ Debit balance in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
owner + + +string + + + + + Account address
bigAmount + + +BigNumber + + + + + amount to be debited
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getBalanceOf(owner)

+ + +
+
+ + +
+ Fetch Balance For a given address +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
owner + + +string + + + + + address for which balance is to be fetched
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

transferToAirdropBudgetHolder(senderAddress, senderPassphrase, airdropBudgetHolderAddress, amount, gasPrice, options)

+ + +
+
+ + +
+ Transfer amount to budget holder +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
airdropBudgetHolderAddress + + +string + + + + + recipient address
amount + + +BigNumber + + + + + amount in wei
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_branded_token.html b/docs/module-lib_contract_interact_branded_token.html new file mode 100644 index 0000000..316b0eb --- /dev/null +++ b/docs/module-lib_contract_interact_branded_token.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/branded_token + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/branded_token

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on EIP20Token contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
BrandedToken
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_helper-ContractInteractHelper.html b/docs/module-lib_contract_interact_helper-ContractInteractHelper.html new file mode 100644 index 0000000..eddd62e --- /dev/null +++ b/docs/module-lib_contract_interact_helper-ContractInteractHelper.html @@ -0,0 +1,4593 @@ + + + + + + + OpenST Payments Class: ContractInteractHelper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: ContractInteractHelper

+
+ +
+ +

+ lib/contract_interact/helper~ + + ContractInteractHelper +

+ + +
+ + +
+
+ + +
+
+

new ContractInteractHelper()

+ + +
+
+ + +
+ contract interact helper constructor +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

call(web3Provider, currContractAddr, encodeABI [, options] [, transactionOutputs])

+ + +
+
+ + +
+ Call methods (execute methods which DO NOT modify state of contracts) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
web3Provider + + +object + + + + + + + + + + + It could be value chain or utility chain provider
currContractAddr + + +String + + + + + + + + + + + current contract address
encodeABI + + +Object + + + + + + + + + + + encoded method ABI data
options + + +Object + + + + + + + <optional>
+ + + + + +
optional params
transactionOutputs + + +Object + + + + + + + <optional>
+ + + + + +
optional transactionOutputs
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise + + + +
+
+ + + + + +
+ + + +
+
+

generateManagedKeyPassphrase()

+ + +
+
+ + +
+ Stub method to generate managed key passphrase +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String + + + +
+
+ + + + + +
+ + + +
+
+

getNotificationData(topics, publisher, method, contractName, contractAddress, web3Provider, options)

+ + +
+
+ + +
+ get notification event formatted data +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
topics + + +array + + + + + topics where the event will be published
publisher + + +String + + + + + publisher name
method + + +String + + + + + method name
contractName + + +String + + + + + name of contract
contractAddress + + +String + + + + + address of contract
web3Provider + + +Object + + + + + address of contract
options + + +Object + + + + + options
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

getTransactionOutputs(transactionObject)

+ + +
+
+ + +
+ get outputs of a given transaction +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transactionObject + + +object + + + + + transactionObject is returned from call method.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +array + + + +
+
+ + + + + +
+ + + +
+
+

getTransactionReceiptFromTrasactionHash(web3Provider, transactionHash)

+ + +
+
+ + +
+ Get transaction receipt +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
web3Provider + + +Web3 + + + + + It could be value chain or utility chain provider
transactionHash + + +String + + + + + transaction hash
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

isDecimal(num)

+ + +
+
+ + +
+ check if return type is true/false +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
num + + +Number + + + + + Number
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ Note - Don't use for BigNumbers +
+ + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

isValidCurrency(currency, allow_blank)

+ + +
+
+ + +
+ valid currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + currency
allow_blank + + +bool + + + + + true / false, '' if allow_blank is true
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ - true / false +
+ + + +
+
+ Type +
+
+ +Bool + + + +
+
+ + + + + +
+ + + +
+
+

performSend(Object, string, senderAddr)

+ + +
+
+ + +
+ Perform send +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
Object + + +params + + + + + parmaters
string + + +returnType + + + + + return type
senderAddr + + +String + + + + + address of transaction's sender senderAddr
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

safeSend(web3Provider, currContractAddr, senderName, encodeABI [, txOptions] [, addressToNameMap])

+ + +
+
+ + +
+ Safe Send a transaction (this internally waits for transaction to be mined) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
web3Provider + + +Web3 + + + + + + + + + + + It could be value chain or utility chain provider
currContractAddr + + +String + + + + + + + + + + + current contract address
senderName + + +String + + + + + + + + + + + name of transaction's sender
encodeABI + + +Object + + + + + + + + + + + encoded method ABI data
txOptions + + +Object + + + + + + + <optional>
+ + + + + +
optional txOptions
addressToNameMap + + +Object + + + + + + + <optional>
+ + + + + +
optional addressToNameMap
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

safeSendFromAddr(web3Provider, currContractAddr, senderAddr, senderPassphrase, encodeABI [, txOptions] [, addressToNameMap])

+ + +
+
+ + +
+ Safe Send a transaction (this internally waits for transaction to be mined) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
web3Provider + + +Web3 + + + + + + + + + + + It could be value chain or utility chain provider
currContractAddr + + +String + + + + + + + + + + + current contract address
senderAddr + + +String + + + + + + + + + + + address of transaction's sender senderAddr
senderPassphrase + + +String + + + + + + + + + + + passphrase of
encodeABI + + +Object + + + + + + + + + + + encoded method ABI data
txOptions + + +Object + + + + + + + <optional>
+ + + + + +
optional txOptions
addressToNameMap + + +Object + + + + + + + <optional>
+ + + + + +
optional addressToNameMap
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

send(web3Provider, currContractAddr, encodeABI [, options] [, transactionOutputs])

+ + +
+
+ + +
+ Send methods (execute methods which modify state of a contracts) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
web3Provider + + +Web3 + + + + + + + + + + + It could be value chain or utility chain provider
currContractAddr + + +String + + + + + + + + + + + current contract address
encodeABI + + +Object + + + + + + + + + + + encoded method ABI data
options + + +Object + + + + + + + <optional>
+ + + + + +
optional params
transactionOutputs + + +Object + + + + + + + <optional>
+ + + + + +
optional transactionOutputs
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise + + + +
+
+ + + + + +
+ + + +
+
+

toAddress(web3Provider, result)

+ + +
+
+ + +
+ Decode result and typecast it to an Address +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
web3Provider + + +Web3 + + + + + It could be value chain or utility chain provider
result + + +String + + + + + current contract address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

toNumber(web3Provider, result)

+ + +
+
+ + +
+ Decode result and typecast it to a Number +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
web3Provider + + +Web3 + + + + + It could be value chain or utility chain provider
result + + +String + + + + + current contract address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

toString(web3Provider, result)

+ + +
+
+ + +
+ Decode result and typecast it to a String +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
web3Provider + + +Web3 + + + + + It could be value chain or utility chain provider
result + + +String + + + + + current contract address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

validateAirdropPayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, user)

+ + +
+
+ + +
+ Validate Airdrop pay params +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
beneficiaryAddress + + +string + + + + + address of beneficiary account
transferAmount + + +BigNumber + + + + + transfer amount (in wei)
commissionBeneficiaryAddress + + +string + + + + + address of commision beneficiary account
commissionAmount + + +BigNumber + + + + + commission amount (in wei)
currency + + +string + + + + + quote currency
intendedPricePoint + + +BigNumber + + + + + price point at which the pay is intended (in wei)
gasPrice + + +BigNumber + + + + + gas price
user + + +Hex + + + + + User address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

validateCommonPayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency)

+ + +
+
+ + +
+ Validate common pay params +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
beneficiaryAddress + + +string + + + + + address of beneficiary account
transferAmount + + +BigNumber + + + + + transfer amount (in wei)
commissionBeneficiaryAddress + + +string + + + + + address of commision beneficiary account
commissionAmount + + +BigNumber + + + + + commission amount (in wei)
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

validatePayParams(senderAddress, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice)

+ + +
+
+ + +
+ Validate Airdrop params +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
beneficiaryAddress + + +string + + + + + address of beneficiary account
transferAmount + + +BigNumber + + + + + transfer amount (in wei)
commissionBeneficiaryAddress + + +string + + + + + address of commision beneficiary account
commissionAmount + + +BigNumber + + + + + commission amount (in wei)
currency + + +string + + + + + quote currency
intendedPricePoint + + +BigNumber + + + + + price point at which the pay is intended (in wei)
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

validatePostAirdropPayParams()

+ + +
+
+ + +
+ Validate post airdrop pay params +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params.beneficiaryAddress + + +string + + + + + beneficiary address
params.commissionBeneficiaryAddress + + +string + + + + + commission beneficiary address
params.spender + + +string + + + + + spender address
params.brandedTokenAddress + + +string + + + + + branded token address
params.contractAddress + + +string + + + + + contractAddress address
params.airdropBudgetHolder + + +string + + + + + airdrop budget holder address
params.totalAmount + + +number + + + + + total amount that was debited from spender account
params.airdropAmountToUse + + +number + + + + + airdrop amount that was used in the transaction
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_helper.html b/docs/module-lib_contract_interact_helper.html new file mode 100644 index 0000000..c64f3a3 --- /dev/null +++ b/docs/module-lib_contract_interact_helper.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/helper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/helper

+
+ +
+ +
+ + +
+
+ + +
This is utility class for contract interacts

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
ContractInteractHelper
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html b/docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html new file mode 100644 index 0000000..9f19c7a --- /dev/null +++ b/docs/module-lib_contract_interact_ops_managed_contract-OpsManagedContract.html @@ -0,0 +1,774 @@ + + + + + + + OpenST Payments Class: OpsManagedContract + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: OpsManagedContract

+
+ +
+ +

+ lib/contract_interact/ops_managed_contract~ + + OpsManagedContract +

+ + +
+ + +
+
+ + +
+
+

new OpsManagedContract(contractAddress, defaultGasPrice, chainId)

+ + +
+
+ + +
+ Ops managed contract interact constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
contractAddress + + +string + + + + + address where Contract has been deployed
defaultGasPrice + + +string + + + + + default Gas Price
chainId + + +number + + + + + chain id
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ + + + +
    +
  • OwnedContract
  • +
+ + + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

getOpsAddress()

+ + +
+
+ + +
+ Get currContract's Ops Address +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setOpsAddress(senderAddress, senderPassphrase, opsAddress, options)

+ + +
+
+ + +
+ Set currContract's Ops Address +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + Sender Address
senderPassphrase + + +String + + + + + Sender Passphrase
opsAddress + + +String + + + + + address which is to be made Ops Address of currContract
options + + +Object + + + + + options for this transaction
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_ops_managed_contract.html b/docs/module-lib_contract_interact_ops_managed_contract.html new file mode 100644 index 0000000..b2c3d63 --- /dev/null +++ b/docs/module-lib_contract_interact_ops_managed_contract.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/ops_managed_contract + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/ops_managed_contract

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on OpsManaged Contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
OpsManagedContract
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_owned_contract-OwnedContract.html b/docs/module-lib_contract_interact_owned_contract-OwnedContract.html new file mode 100644 index 0000000..8dc678f --- /dev/null +++ b/docs/module-lib_contract_interact_owned_contract-OwnedContract.html @@ -0,0 +1,763 @@ + + + + + + + OpenST Payments Class: OwnedContract + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: OwnedContract

+
+ +
+ +

+ lib/contract_interact/owned_contract~ + + OwnedContract +

+ + +
+ + +
+
+ + +
+
+

new OwnedContract(contractAddress, web3Provider, currContract, defaultGasPrice)

+ + +
+
+ + +
+ Owned contract interact constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
contractAddress + + +String + + + + + address where Contract has been deployed
web3Provider + + +String + + + + + web3 provider of network where currContract has been deployed
currContract + + +String + + + + + Contract Instance
defaultGasPrice + + +String + + + + + default Gas Price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

getOwner()

+ + +
+
+ + +
+ Get address of Owner of currContract +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<string> + + + +
+
+ + + + + +
+ + + +
+
+

initiateOwnerShipTransfer(senderName, proposedOwner, customOptions)

+ + +
+
+ + +
+ Initiate Ownership of currContract +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderName + + +string + + + + + Sender of this Transaction
proposedOwner + + +string + + + + + address to which ownership needs to be transferred
customOptions + + +object + + + + + custom params of this transaction
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_owned_contract.html b/docs/module-lib_contract_interact_owned_contract.html new file mode 100644 index 0000000..6b1bcf2 --- /dev/null +++ b/docs/module-lib_contract_interact_owned_contract.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/owned_contract + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/owned_contract

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on Owned Contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
OwnedContract
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_pricer-MockToken.html b/docs/module-lib_contract_interact_pricer-MockToken.html new file mode 100644 index 0000000..816d5ec --- /dev/null +++ b/docs/module-lib_contract_interact_pricer-MockToken.html @@ -0,0 +1,1199 @@ + + + + + + + OpenST Payments Class: MockToken + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: MockToken

+
+ +
+ +

+ lib/contract_interact/pricer~ + + MockToken +

+ + +
+ + +
+
+ + +
+
+

new MockToken()

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

approve(senderAddr, senderPassphrase, spenderAddress, value, gasPrice)

+ + +
+
+ + +
+ Approve +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddr + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
spenderAddress + + +string + + + + + address which will be approved for spending
value + + +BigNumber + + + + + amount which is being approved (in wei)
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

balanceOf(ownerAddress)

+ + +
+
+ + +
+ Get balance of address +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ownerAddress + + +String + + + + + address for which balance is to be fetched
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

setBalance(senderAddr, senderPassphrase, ownerAddress, value, gasPrice)

+ + +
+
+ + +
+ Set balance +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddr + + +string + + + + + address of user who is sending amount
senderPassphrase + + +string + + + + + sender address passphrase
ownerAddress + + +string + + + + + address for which balance is to be set
value + + +BigNumber + + + + + amount which is being transferred (in wei)
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

setConversionRate(senderAddr, senderPassphrase, conversionRate, gasPrice)

+ + +
+
+ + +
+ Set conversion rate +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddr + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
conversionRate + + +number + + + + + conversion rate of branded token
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_pricer-Pricer.html b/docs/module-lib_contract_interact_pricer-Pricer.html new file mode 100644 index 0000000..713de95 --- /dev/null +++ b/docs/module-lib_contract_interact_pricer-Pricer.html @@ -0,0 +1,5571 @@ + + + + + + + OpenST Payments Class: Pricer + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Pricer

+
+ +
+ +

+ lib/contract_interact/pricer~ + + Pricer +

+ + +
+ + +
+
+ + +
+
+

new Pricer(pricerAddress, chainId)

+ + +
+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pricerAddress + + +string + + + + + Pricer contract address
chainId + + +string + + + + + chain ID
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

_asyncPay(spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, options)

+ + +
+
+ + +
+ Actual Pay - can give rejections of promise +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
spenderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
beneficiaryAddress + + +string + + + + + address of beneficiary account
transferAmount + + +BigNumber + + + + + transfer amount (in wei)
commissionBeneficiaryAddress + + +string + + + + + address of commision beneficiary account
commissionAmount + + +BigNumber + + + + + commission amount (in wei)
currency + + +string + + + + + quote currency
intendedPricePoint + + +BigNumber + + + + + price point at which the pay is intended (in wei)
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

acceptedMargins(currency)

+ + +
+
+ + +
+ Get acceptable margin for the given currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

baseCurrency()

+ + +
+
+ + +
+ Get base currency of pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

brandedToken()

+ + +
+
+ + +
+ Get branded token address of pricer from cache, if not found in cache get from contract +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

conversionRate()

+ + +
+
+ + +
+ Get conversion rate of pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

conversionRateDecimals()

+ + +
+
+ + +
+ Get conversion rate decimals of pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

decimals()

+ + +
+
+ + +
+ Get decimal of pricer +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getAcceptedMarginsFromContract(currency)

+ + +
+
+ + +
+ Get acceptable margin for the given currency from contract +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getBalanceOf(owner)

+ + +
+
+ + +
+ Get balance of the account +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
owner + + +string + + + + + account address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ 10^18 +
+ + + +
+
+ Type +
+
+ +BigNumer + + + +
+
+ + + + + +
+ + + +
+
+

getBrandedTokenAddressFromContract()

+ + +
+
+ + +
+ Get branded token address of pricer from contract +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getConversionRateDecimalsFromContract()

+ + +
+
+ + +
+ Get conversion rate decimals of pricer from contract +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getConversionRateFromContract()

+ + +
+
+ + +
+ Get conversion rate of pricer from contract +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getDecimalsFromContract()

+ + +
+
+ + +
+ Get decimal of pricer from contract +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getEstimatedTotalAmount(transferAmount, commissionAmount, intendedPricePoint)

+ + +
+
+ + +
+ Get estimated total amount +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transferAmount + + +BigNumber + + + + + Transfer amount
commissionAmount + + +BigNumber + + + + + Commission amount
intendedPricePoint + + +BigNumber + + + + + Intended price point
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +BigNumber + + + +
+
+ + + + + +
+ + + +
+
+

getPriceOraclesFromContract(currency)

+ + +
+
+ + +
+ Get address of price oracle for the given currency from contract +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getPricePoint(currency)

+ + +
+
+ + +
+ Get current price point from the price oracle for the give currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getPricePointAndCalculatedAmounts(transferAmount, commissionAmount, currency)

+ + +
+
+ + +
+ Get current price point and calculated token amounts +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transferAmount + + +BigNumber + + + + + transfer amount (in wei)
commissionAmount + + +BigNumber + + + + + commision amount (in wei)
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getPricePointFromContract(currency)

+ + +
+
+ + +
+ Get current price point from the price oracle for the give currency from contract +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getTxReceipt(transactionHash)

+ + +
+
+ + +
+ Get transaction receipt from transaction hash +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transactionHash + + +string + + + + + transaction hash
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ 10^18 +
+ + + +
+
+ Type +
+
+ +BigNumer + + + +
+
+ + + + + +
+ + + +
+
+

pay(spenderAddress, senderPassphrase, beneficiaryAddress, transferAmount, commissionBeneficiaryAddress, commissionAmount, currency, intendedPricePoint, gasPrice, options)

+ + +
+
+ + +
+ Pay +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
spenderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
beneficiaryAddress + + +string + + + + + address of beneficiary account
transferAmount + + +BigNumber + + + + + transfer amount (in wei)
commissionBeneficiaryAddress + + +string + + + + + address of commision beneficiary account
commissionAmount + + +BigNumber + + + + + commission amount (in wei)
currency + + +string + + + + + quote currency
intendedPricePoint + + +BigNumber + + + + + price point at which the pay is intended (in wei)
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

priceOracles(currency)

+ + +
+
+ + +
+ Get address of price oracle for the given currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
currency + + +string + + + + + quote currency
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setAcceptedMargin(senderAddress, senderPassphrase, currency, acceptedMargin, gasPrice, options)

+ + +
+
+ + +
+ Set or update the acceptable margin range for a given currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
currency + + +string + + + + + quote currency
acceptedMargin + + +BigNumber + + + + + accepted margin for the given currency (in wei)
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setAddressToNameMap()

+ + +
+
+ + +
+ set address to name map +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setPriceOracle(senderAddress, senderPassphrase, currency, address, gasPrice, options)

+ + +
+
+ + +
+ Set or updates the price oracle address for a given currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
currency + + +string + + + + + quote currency
address + + +string + + + + + address of price pracle
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setTokenObj()

+ + +
+
+ + +
+ set token object +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

toWei(value)

+ + +
+
+ + +
+ Convert value in wei +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +BigNumber + + + + + amount in decimal
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ 10^18 +
+ + + +
+
+ Type +
+
+ +BigNumer + + + +
+
+ + + + + +
+ + + +
+
+

unsetPriceOracle(senderAddress, senderPassphrase, currency, gasPrice, options)

+ + +
+
+ + +
+ Remove the price oracle address for a given currency +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
currency + + +string + + + + + quote currency
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

validateSetAcceptedMarginParams(senderAddress, currency, acceptedMargin, gasPrice)

+ + +
+
+ + +
+ Validate set accepted margin params parameters +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
currency + + +string + + + + + quote currency
acceptedMargin + + +BigNumber + + + + + accepted margin for the given currency (in wei)
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ + + +
+
+

validateSetPriceOracleParams(senderAddress, currency, address, gasPrice)

+ + +
+
+ + +
+ Validate set price oracle parameters +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
currency + + +string + + + + + quote currency
address + + +string + + + + + address of price pracle
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ + + +
+
+

validateUnsetPriceOracleParams(senderAddress, currency, gasPrice)

+ + +
+
+ + +
+ Validate unset price oracle parameters +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
currency + + +string + + + + + quote currency
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

verifyReceiptAndUpdateAcceptedMarginCache(acceptedMargin, currency, receipt)

+ + +
+
+ + +
+ Verify receipt and update accepted margin in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
acceptedMargin + + +BigNumber + + + + + accepted margin for the given currency (in wei)
currency + + +string + + + + + quote currency
receipt + + +Object + + + + + transaction receipt
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_pricer.html b/docs/module-lib_contract_interact_pricer.html new file mode 100644 index 0000000..9e37e50 --- /dev/null +++ b/docs/module-lib_contract_interact_pricer.html @@ -0,0 +1,407 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/pricer + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/pricer

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on Pricer contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
MockToken
+
+ +
Pricer
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +

Module: lib/contract_interact/pricer

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on Pricer contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
MockToken
+
+ +
Pricer
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_workers-Workers.html b/docs/module-lib_contract_interact_workers-Workers.html new file mode 100644 index 0000000..e2410d4 --- /dev/null +++ b/docs/module-lib_contract_interact_workers-Workers.html @@ -0,0 +1,1818 @@ + + + + + + + OpenST Payments Class: Workers + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Workers

+
+ +
+ +

+ lib/contract_interact/workers~ + + Workers +

+ + +
+ + +
+
+ + +
+
+

new Workers(workerAddress, chainId)

+ + +
+
+ + +
+ Workers contract interact class constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
workerAddress + + +string + + + + + address of worker (external address)
chainId + + +number + + + + + chain id
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

_validateRemoveParams(senderAddress, gasPrice)

+ + +
+
+ + +
+ Validate Remove (selfdestruct) params +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ + + +
+
+

_validateRemoveWorkerParams(senderAddress, workerAddress, gasPrice)

+ + +
+
+ + +
+ Validate remove worker params +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
workerAddress + + +string + + + + + worker address
gasPrice + + +BigNumber + + + + + gas price
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ + + +
+
+

getTxReceipt(transactionHash)

+ + +
+
+ + +
+ Get transaction receipt from transaction hash +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transactionHash + + +string + + + + + transaction hash +TODO - this can be moved to a util class
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

isWorker(workerAddress)

+ + +
+
+ + +
+ Check if the given worker address is valid or not +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
workerAddress + + +string + + + + + worker address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

remove(senderAddr, senderPassphrase, gasPrice, object)

+ + +
+
+ + +
+ Remove (selfdestruct) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddr + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
gasPrice + + +BigNumber + + + + + gas price
object + + +options + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

removeWorker(senderAddress, senderPassphrase, workerAddress, gasPrice, options)

+ + +
+
+ + +
+ Remove worker +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
workerAddress + + +string + + + + + worker address
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

setWorker(senderAddress, senderPassphrase, workerAddress, deactivationHeight, gasPrice, options)

+ + +
+
+ + +
+ Set or update the worker +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
senderAddress + + +string + + + + + address of sender
senderPassphrase + + +string + + + + + passphrase of sender
workerAddress + + +string + + + + + worker address
deactivationHeight + + +number + + + + + block number till which the worker is valid
gasPrice + + +BigNumber + + + + + gas price
options + + +object + + + + + for params like returnType, tag.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_contract_interact_workers.html b/docs/module-lib_contract_interact_workers.html new file mode 100644 index 0000000..e0f04a6 --- /dev/null +++ b/docs/module-lib_contract_interact_workers.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/contract_interact/workers + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/contract_interact/workers

+
+ +
+ +
+ + +
+
+ + +
This is a utility file which would be used for executing all methods on Workers contract.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
Workers
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html b/docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html new file mode 100644 index 0000000..6ae15c5 --- /dev/null +++ b/docs/module-lib_query_builder_mysql-MySQLQueryBuilderKlass.html @@ -0,0 +1,2662 @@ + + + + + + + OpenST Payments Class: MySQLQueryBuilderKlass + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: MySQLQueryBuilderKlass

+
+ +
+ +

+ lib/query_builder/mysql~ + + MySQLQueryBuilderKlass +

+ + +
+ + +
+
+ + +
+
+

new MySQLQueryBuilderKlass(params)

+ + +
+
+ + +
+ MySQL query builder constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +Object + + + + + - +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
table_name + + +String + + + + + + + <optional>
+ + + + + +
MySQL table name for which query need to be build
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<private> _generateDelete()

+ + +
+
+ + +
+ Generate the final DELETE statement +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

<private> _generateInsert()

+ + +
+
+ + +
+ Generate the final INSERT statement +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

<private> _generateSelect()

+ + +
+
+ + +
+ Generate the final SELECT statement +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

<private> _generateUpdate()

+ + +
+
+ + +
+ Generate the final UPDATE statement +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

delete()

+ + +
+
+ + +
+ Delete row from table + +Example 1: +delete() +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

generate()

+ + +
+
+ + +
+ Generate final query supported by mysql node module +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +object.<response> + + + +
+
+ + + + + +
+ + + +
+
+

group_by()

+ + +
+
+ + +
+ List of fields to be grouped by from table. If called multiple times, group by conditions will be joined by COMMA. + +Possible data types: +* Array - list of field names will be joined by comma +* String - list of field names will be used as it is + +Example 1: +group_by(['name', 'created_at']) + +Example 2: +group_by('name, created_at') +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

having()

+ + +
+
+ + +
+ List of fields for having clause. If called multiple times, having conditions will be joined by AND. + +Possible data types: +* Array - index 0 should have the having sub query and other indexes should have the valued to be replaced in sub query +* String - where sub query, used as it is. + +Example 1: Where in array format +having(['MIN(`salary`) < ?', 10]) + +Example 2: condition in string. Will be used as it is +having('MIN(`salary`) < 10') +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

insert((object), (object), (object))

+ + +
+
+ + +
+ Insert single record in table. Method can't be called twice on same object + +Example 1: Insert in object format. +insert({name: 'ACMA', id: 10}) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
(object) + + insertFields - key and value pairs of columns and values to be inserted
(object) + + insertOptions -
(object) + + [insertOptions.touch] - if true, auto insert created_at and updated_at values. Default is true.
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

insertMultiple(insertColumns, insertValues, insertOptions)

+ + +
+
+ + +
+ Insert multiple records in table. Method can't be called twice on same object + +Example 1: +insertMultiple(['name', 'symbol'], [['ABC', '123'], ['ABD', '456']]) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
insertColumns + + +array + + + + + list of columns. also columns are mandatory
insertValues + + +array + + + + + array of array with values
insertOptions + + +object + + + + + - +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
touch + + +object + + + + + + + <optional>
+ + + + + +
if true, auto insert created_at and updated_at values. Default is true.
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

limit((number))

+ + +
+
+ + +
+ Limit of records to be fetched. If called multiple times, it will overwrite the previous value + +Example 1: +limit(100) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
(number) + + recordsLimit - limit for select query
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

offset((number))

+ + +
+
+ + +
+ Offset for records to be fetched. If called multiple times, it will overwrite the previous value. limit is mandatory for offset + +Example 1: +offset(10) +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
(number) + + recordsOffset - offset for select query
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

onDuplicate()

+ + +
+
+ + +
+ On Duplicate conditions to be applied to the INSERT query. If called multiple times, conditions will be joined by COMMA. + +Possible data types: +* Array - index 0 should have the On Duplicate sub query and other indexes should have the valued to be replaced in sub query +* Object - key and value pairs of columns and values to be joined by COMMA to form On Duplicate sub query +* String - sub query, used as it is. + +Example 1: ON DUPLICATE in array format +onDuplicate(['name=? , id=?', 'ACMA', 10]) + +Example 2: ON DUPLICATE in object format. Conditions will be joined by , +onDuplicate({name: 'ACMA', id: 10}) + +Example 3: ON DUPLICATE in string. Will be used as it is +onDuplicate('id=10') +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

order_by()

+ + +
+
+ + +
+ List of fields to be ordered by from table. If called multiple times, order by conditions will be joined by COMMA. + +Possible data types: +* Object - where keys are column names and value is order +* String - order will be used as it is + +Example 1: +order_by({'name': 'ASC', 'created_at': 'DESC'}) + +Example 2: +order_by('name ASC, created_at DESC') + +Example 3: +order_by([1, 2, 3]) +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

select()

+ + +
+
+ + +
+ List of fields to be selected from table. If called multiple times, select columns will be joined by COMMA. + +Possible data types: +* blank/undefined - '*' will be used to fetch all columns +* Array - list of field names will be joined by comma +* String - list of field names will be used as it is + +Example 1: '*' will be used to fetch all columns +select() + +Example 2: list of field names in array. Will be joined by comma +select(['name', 'created_at']) + +Example 3: list of field names in string. Will be used as it is +select('name, created_at') +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

update(updateFields, insertOptions)

+ + +
+
+ + +
+ Update columns to be applied to the query. If called multiple times, update fields will be joined by COMMA. + +Possible data types: +* Array - index 0 should have the update sub query and other indexes should have the valued to be replaced in sub query +* Object - key and value pairs of columns and values to be joined by COMMA to form update sub query +* String - update sub query, used as it is. +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
updateFields + + +* + + + + + refer possible data types
insertOptions + + +object + + + + + - +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
touch + + +object + + + + + + + <optional>
+ + + + + +
if true, auto insert created_at and updated_at values. Default is true. + +Example 1: update in array format +update(['name=?, id=?', 'ACMA', 10]) + +Example 2: Update in object format. Fields will be joined by {,} +update({name: 'ACMA', id: 10}) + +Example 3: Update in string. Will be used as it is +update('id=10')
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ + + +
+
+

where()

+ + +
+
+ + +
+ Where conditions to be applied to the query. If called multiple times, where conditions will be joined by AND. + +Possible data types: +* Array - index 0 should have the where sub query and other indexes should have the valued to be replaced in sub query +* Object - key and value pairs of columns and values to be joined by AND to form where sub query +* String - where sub query, used as it is. + +Example 1: Where in array format +where(['name=? AND id=?', 'ACMA', 10]) + +Example 2: Where in object format. Conditions will be joined by AND +where({name: 'ACMA', id: 10}) +where({name: [1,2,3], id: 10}) + +Example 3: condition in string. Will be used as it is +where('id=10') +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ oThis +
+ + + +
+
+ Type +
+
+ +object.<self> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_query_builder_mysql.html b/docs/module-lib_query_builder_mysql.html new file mode 100644 index 0000000..45e7a40 --- /dev/null +++ b/docs/module-lib_query_builder_mysql.html @@ -0,0 +1,339 @@ + + + + + + + OpenST Payments Module: lib/query_builder/mysql + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/query_builder/mysql

+
+ +
+ +
+ + +
+
+ + +
Form mysql query

+ + +Max supported SELECT query: +SELECT [columns] + FROM [table] + WHERE [where conditions] + GROUP BY [columns] + ORDER BY [order by columns] + HAVING [having condition] + LIMIT [limit and offset]; + +Max supported INSERT query: +INSERT INTO [table] ([columns]) + VALUES ([values]), ([values]) + ON DUPLICATE KEY UPDATE [conditions]; + +Max supported UPDATE query: +UPDATE [table] + SET [column=value], [column=value] + WHERE [where conditions] + ORDER BY [order by columns] + LIMIT [limit]; + +Max supported DELETE query: +DELETE FROM [table] + WHERE [where conditions] + ORDER BY [order by columns] + LIMIT [limit];
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
MySQLQueryBuilderKlass
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_set_worker_and_ops-SetWorkerOps.html b/docs/module-lib_set_worker_and_ops-SetWorkerOps.html new file mode 100644 index 0000000..4acc688 --- /dev/null +++ b/docs/module-lib_set_worker_and_ops-SetWorkerOps.html @@ -0,0 +1,603 @@ + + + + + + + OpenST Payments Class: SetWorkerOps + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: SetWorkerOps

+
+ +
+ +

+ lib/set_worker_and_ops~ + + SetWorkerOps +

+ + +
+ + +
+
+ + +
+
+

new SetWorkerOps()

+ + +
+
+ + +
+ Set Worker Contract and OPS Address +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

perform( [options])

+ + +
+
+ + +
+ Set Worker and Ops for a contract. +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
options + + +object + + + + + + + <optional>
+ + + + + +
+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
gasPrice + + +number + + + + + + + <optional>
+ + + + + +
Gas Price to use
chainId + + +number + + + + + + + <optional>
+ + + + + +
Chain Id where contract need to be deployed
+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_set_worker_and_ops.html b/docs/module-lib_set_worker_and_ops.html new file mode 100644 index 0000000..4a082d8 --- /dev/null +++ b/docs/module-lib_set_worker_and_ops.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/set_worker_and_ops + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/set_worker_and_ops

+
+ +
+ +
+ + +
+
+ + +
Set Worker Contract and OPS Address
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
SetWorkerOps
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_transaction_helper-TransactionHelper.html b/docs/module-lib_transaction_helper-TransactionHelper.html new file mode 100644 index 0000000..e8513ca --- /dev/null +++ b/docs/module-lib_transaction_helper-TransactionHelper.html @@ -0,0 +1,3873 @@ + + + + + + + OpenST Payments Class: TransactionHelper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: TransactionHelper

+
+ +
+ +

+ lib/transaction_helper~ + + TransactionHelper +

+ + +
+ + +
+
+ + +
+
+

new TransactionHelper(chainId)

+ + +
+
+ + +
+ constructor +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chainId + + +string + + + + + chain id
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

afterAirdropPayFailure(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress)

+ + +
+
+ + +
+ After airdrop pay function, this is called after the pay is failed +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
airdropAddress + + +string + + + + + airdrop contract address
spenderAddress + + +string + + + + + spender address
estimatedPayAmount + + +BigNumber + + + + + estimated pay amount in weis
estimatedAirdropAmount + + +BigNumber + + + + + estimated airdrop amount
airdropBugdetAddress + + +string + + + + + airdrop budget holder address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

afterAirdropPaySuccess(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount, actualAirdropAmount, airdropBugdetAddress)

+ + +
+
+ + +
+ After airdrop pay function, this is called after the pay is successfull +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
airdropAddress + + +string + + + + + airdrop contract address
spenderAddress + + +string + + + + + spender address
estimatedPayAmount + + +BigNumber + + + + + estimated pay amount in weis
estimatedAirdropAmount + + +BigNumber + + + + + estimated airdrop amount
beneficiaryAddress + + +string + + + + + beneficiary address
actualBeneficiaryAmount + + +BigNumber + + + + + actual beneficiary amount in weis
commissionBeneficiaryAddress + + +string + + + + + commission beneficiary address
actualCommissionBeneficiaryAmount + + +BigNumber + + + + + actual commission beneficiary amount
actualAirdropAmount + + +BigNumber + + + + + actual airdrop amount
airdropBugdetAddress + + +string + + + + + airdrop budget holder address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

afterPayFailure(brandedTokenAddress, spenderAddress, estimatedPayAmount)

+ + +
+
+ + +
+ After pay function, this is called after the pay is failed +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
spenderAddress + + +string + + + + + spender address
estimatedPayAmount + + +BigNumber + + + + + estimated pay amount in weis
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

afterPaySuccess(brandedTokenAddress, spenderAddress, estimatedPayAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount)

+ + +
+
+ + +
+ After pay function, this is called after the pay is successfull +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
spenderAddress + + +string + + + + + spender address
estimatedPayAmount + + +BigNumber + + + + + estimated pay amount in weis
beneficiaryAddress + + +string + + + + + beneficiary address
actualBeneficiaryAmount + + +BigNumber + + + + + actual beneficiary amount in weis
commissionBeneficiaryAddress + + +string + + + + + commission beneficiary address
actualCommissionBeneficiaryAmount + + +BigNumber + + + + + actual commission beneficiary amount
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

beforeAirdropPay(brandedTokenAddress, airdropAddress, spenderAddress, totalTransferAmount, airdropBalanceToUse, airdropBugdetAddress)

+ + +
+
+ + +
+ Before airdrop pay function, this is called before the pay is called +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
airdropAddress + + +string + + + + + airdrop contract address
spenderAddress + + +string + + + + + spender address
totalTransferAmount + + +BigNumber + + + + + estimated pay amount in weis
airdropBalanceToUse + + +BigNumber + + + + + estimated airdrop amount
airdropBugdetAddress + + +string + + + + + airdrop budget holder address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<array.<result>> + + + +
+
+ + + + + +
+ + + +
+
+

beforePay(brandedTokenAddress, spenderAddress, estimatedPayAmount)

+ + +
+
+ + +
+ Before pay function, this is called before the pay is called +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
spenderAddress + + +string + + + + + spender address
estimatedPayAmount + + +BigNumber + + + + + estimated pay amount in weis
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

clearUserDetailCache(airdropContractAddress, owner)

+ + +
+
+ + +
+ Clear user detail cache for the user addressess +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropContractAddress + + +string + + + + + airdrop contract address
owner + + +string + + + + + Account address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

creditAirdropBalance(airdropContractAddress, owner, bigAmount)

+ + +
+
+ + +
+ Credit airdrop balance in db and clear cache +It decreases airdrop_used_amount for user in user_airdrop_details table +Clears the cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropContractAddress + + +string + + + + + airdrop contract address
owner + + +string + + + + + Account address
bigAmount + + +BigNumber + + + + + amount to be credited
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

creditBalance(brandedTokenAddress, owner, bigAmount)

+ + +
+
+ + +
+ Credit balance in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
owner + + +string + + + + + Account address
bigAmount + + +BigNumber + + + + + amount to be credited
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

debitAirdropBalance(airdropContractAddress, owner, bigAmount)

+ + +
+
+ + +
+ Debit airdrop balance in db and clear cache +It increases airdrop_used_amount for user in user_airdrop_details table +Clears the cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropContractAddress + + +string + + + + + airdrop contract address
owner + + +string + + + + + Account address
bigAmount + + +BigNumber + + + + + amount to be debited
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

debitBalance(brandedTokenAddress, owner, bigAmount)

+ + +
+
+ + +
+ Debit balance in cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
owner + + +string + + + + + Account address
bigAmount + + +BigNumber + + + + + amount to be debited
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

getActualAmountsFromDecodedEvents(decodedEvent, eventName)

+ + +
+
+ + +
+ Get actual beneficiary amount, actual commission amount and actual airdrop amount from decoded events +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
decodedEvent + + +Object + + + + + Decoded event from receipt
eventName + + +string + + + + + Event name
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ + + +
+
+

getActualAmountsFromReceipt(transactionReceipt, addressToNameMap, eventName)

+ + +
+
+ + +
+ Get actual beneficiary amount, actual commission amount and actual airdrop amount from transaction receipt +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transactionReceipt + + +Object + + + + + transaction receipt
addressToNameMap + + +Object + + + + + address to name map object
eventName + + +string + + + + + Event name
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ + + +
+
+

isAllResponseSuccessful(results)

+ + +
+
+ + +
+ Check if all response is success +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
results + + +array + + + + + response array
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

updateAirdropBalance(airdropContractAddress, owner, toCreditBigAmount)

+ + +
+
+ + +
+ Update airdrop balance +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
airdropContractAddress + + +string + + + + + airdrop contract address
owner + + +string + + + + + Account address
toCreditBigAmount + + +BigNumber + + + + + to credit amount - this can be negative also
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ + + +
+
+

updateBalance(brandedTokenAddress, owner, toCreditBigAmount)

+ + +
+
+ + +
+ Update balance to cache +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
brandedTokenAddress + + +string + + + + + branded token address
owner + + +string + + + + + Account address
toCreditBigAmount + + +BigNumber + + + + + to credit amount - this can be negative also
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +promise.<result> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_transaction_helper.html b/docs/module-lib_transaction_helper.html new file mode 100644 index 0000000..082686a --- /dev/null +++ b/docs/module-lib_transaction_helper.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: lib/transaction_helper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/transaction_helper

+
+ +
+ +
+ + +
+
+ + +
This is transaction helper that manages the cache updation

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
TransactionHelper
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_web3_events_formatter-web3EventsDecoder.html b/docs/module-lib_web3_events_formatter-web3EventsDecoder.html new file mode 100644 index 0000000..1872276 --- /dev/null +++ b/docs/module-lib_web3_events_formatter-web3EventsDecoder.html @@ -0,0 +1,491 @@ + + + + + + + OpenST Payments Namespace: web3EventsDecoder + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: web3EventsDecoder

+
+ +
+ +

+ lib/web3/events/formatter~ + + web3EventsDecoder +

+ + +
+ + +
+
+ + +
Ivent Decoder.
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

perform(txReceipt, addressToNameMap)

+ + +
+
+ + +
+ performer +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
txReceipt + + +Object + + + + +
addressToNameMap + + +Hash + + + + + Map of the address(key) to name(value)
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+ object of resulthelpwe\\er +
+ + + +
+
+ Type +
+
+ +result + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_web3_events_formatter-web3EventsFormatter.html b/docs/module-lib_web3_events_formatter-web3EventsFormatter.html new file mode 100644 index 0000000..f9d8038 --- /dev/null +++ b/docs/module-lib_web3_events_formatter-web3EventsFormatter.html @@ -0,0 +1,457 @@ + + + + + + + OpenST Payments Namespace: web3EventsFormatter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: web3EventsFormatter

+
+ +
+ +

+ lib/web3/events/formatter~ + + web3EventsFormatter +

+ + +
+ + +
+
+ + +
Event Formatter.
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

perform(formattedTransactionReceipt)

+ + +
+
+ + +
+ performer +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
formattedTransactionReceipt + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{}> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-lib_web3_events_formatter.html b/docs/module-lib_web3_events_formatter.html new file mode 100644 index 0000000..f222e9b --- /dev/null +++ b/docs/module-lib_web3_events_formatter.html @@ -0,0 +1,407 @@ + + + + + + + OpenST Payments Module: lib/web3/events/formatter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: lib/web3/events/formatter

+
+ +
+ +
+ + +
+
+ + +
Format decoded event into Hash with all the events received into it.
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +

Namespaces

+ +
+
web3EventsDecoder
+
+ +
web3EventsFormatter
+
+
+ + + + + + + + + +
+ +
+ + + + +

Module: lib/web3/events/formatter

+
+ +
+ +
+ + +
+
+ + +
Decode logs from a transaction receipt
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + +

Namespaces

+ +
+
web3EventsDecoder
+
+ +
web3EventsFormatter
+
+
+ + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_deploy_DeployHelper.html b/docs/module-tools_deploy_DeployHelper.html new file mode 100644 index 0000000..eaeec04 --- /dev/null +++ b/docs/module-tools_deploy_DeployHelper.html @@ -0,0 +1,821 @@ + + + + + + + OpenST Payments Module: tools/deploy/DeployHelper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: tools/deploy/DeployHelper

+
+ +
+ +
+ + +
+
+ + +
Deploy Helper class to perform deploy
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> writeContractAddressToFile(fileName, contractAddress)

+ + +
+
+ + +
+ Write contract address to file based on parameter +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fileName + + +String + + + + + file name
contractAddress + + +Hex + + + + + contract Address
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<async, inner> perform(contractName, web3Provider, contractAbi, contractBin, deployerName [, customOptions] [, constructorArgs])

+ + +
+
+ + +
+ Method deploys contract +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
contractName + + +String + + + + + + + + + + + Contract Name to be deployed
web3Provider + + +Web3 + + + + + + + + + + + Web3 Provider object
contractAbi + + +String + + + + + + + + + + + Contract Abi to be deployed
contractBin + + +String + + + + + + + + + + + Contract Bin file to be deployed
deployerName + + +String + + + + + + + + + + + Deployer name
customOptions + + +Object + + + + + + + <optional>
+ + + + + +
Custom options for value/utility chain
constructorArgs + + +Object + + + + + + + <optional>
+ + + + + +
Arguments to be passed while deploying contract
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Object> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_deploy_EIP20TokenMock.html b/docs/module-tools_deploy_EIP20TokenMock.html new file mode 100644 index 0000000..4869ffc --- /dev/null +++ b/docs/module-tools_deploy_EIP20TokenMock.html @@ -0,0 +1,448 @@ + + + + + + + OpenST Payments Module: tools/deploy/EIP20TokenMock + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: tools/deploy/EIP20TokenMock

+
+ +
+ +
+ + +
+
+ + +
This is script for deploying Pricer contract on any chain.

+ + Prerequisite: +
    +
  1. Deployer Address
  2. +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<async, inner> performer(arguments)

+ + +
+
+ + +
+ It is the main performer method of this deployment script +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_deploy_helper.html b/docs/module-tools_deploy_helper.html new file mode 100644 index 0000000..d0da17d --- /dev/null +++ b/docs/module-tools_deploy_helper.html @@ -0,0 +1,306 @@ + + + + + + + OpenST Payments Module: tools/deploy/helper + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: tools/deploy/helper

+
+ +
+ +
+ + +
+
+ + +
This is utility class for deploying contract

+ +Ref: module:tools/deploy/DeployHelper
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_deploy_pricer.html b/docs/module-tools_deploy_pricer.html new file mode 100644 index 0000000..75f6ac0 --- /dev/null +++ b/docs/module-tools_deploy_pricer.html @@ -0,0 +1,1495 @@ + + + + + + + OpenST Payments Module: tools/deploy/pricer + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: tools/deploy/pricer

+
+ +
+ +
+ + +
+
+ + +
This is script for deploying Pricer contract on any chain.

+ + Prerequisite: +
    +
  1. Deployer Address
  2. +
+ + These are the following steps:
+
    +
  1. Deploy Pricer contract
  2. +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<async, inner> performer(arguments)

+ + +
+
+ + +
+ It is the main performer method of this deployment script +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<async, inner> performer(arguments)

+ + +
+
+ + +
+ It is the main performer method of this deployment script +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<inner> validate(arguments)

+ + +
+
+ + +
+ Validation Method +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<inner> validate(arguments)

+ + +
+
+ + +
+ Validation Method +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +

Module: tools/deploy/pricer

+
+ +
+ +
+ + +
+
+ + +
This is script for deploying Pricer contract on any chain.

+ + Prerequisite: +
    +
  1. Deployer Address
  2. +
+ + These are the following steps:
+
    +
  1. Deploy Airdrop contract
  2. +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<async, inner> performer(arguments)

+ + +
+
+ + +
+ It is the main performer method of this deployment script +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<async, inner> performer(arguments)

+ + +
+
+ + +
+ It is the main performer method of this deployment script +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<inner> validate(arguments)

+ + +
+
+ + +
+ Validation Method +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ + + +
+
+

<inner> validate(arguments)

+ + +
+
+ + +
+ Validation Method +
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments + + +Array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_deploy_workers.html b/docs/module-tools_deploy_workers.html new file mode 100644 index 0000000..6877d87 --- /dev/null +++ b/docs/module-tools_deploy_workers.html @@ -0,0 +1,406 @@ + + + + + + + OpenST Payments Module: tools/deploy/workers + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: tools/deploy/workers

+
+ +
+ +
+ + +
+
+ + +
This is script for deploying Workers contract on any chain.

+ + Prerequisite: +
    +
  1. Deployer Address
  2. +
+ + These are the following steps:
+
    +
  1. Deploy Workers contract
  2. +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<async, inner> performer()

+ + +
+
+ + +
+ It is the main performer method of this deployment script + +Example: +node tools/deploy/worker.js gasPrice chainId +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_dynamo_db_init-DynamoDBInit.html b/docs/module-tools_dynamo_db_init-DynamoDBInit.html new file mode 100644 index 0000000..c9389f4 --- /dev/null +++ b/docs/module-tools_dynamo_db_init-DynamoDBInit.html @@ -0,0 +1,343 @@ + + + + + + + OpenST Payments Class: DynamoDBInit + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: DynamoDBInit

+
+ +
+ +

+ tools/dynamo_db_init~ + + DynamoDBInit +

+ + +
+ + +
+
+ + +
+
+

new DynamoDBInit()

+ + +
+
+ + +
+ Dynamo db init +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/module-tools_dynamo_db_init.html b/docs/module-tools_dynamo_db_init.html new file mode 100644 index 0000000..ae952d9 --- /dev/null +++ b/docs/module-tools_dynamo_db_init.html @@ -0,0 +1,311 @@ + + + + + + + OpenST Payments Module: tools/dynamo_db_init + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Module: tools/dynamo_db_init

+
+ +
+ +
+ + +
+
+ + +
Dynamo DB init
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
DynamoDBInit
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/modules.list.html b/docs/modules.list.html new file mode 100644 index 0000000..0a4433d --- /dev/null +++ b/docs/modules.list.html @@ -0,0 +1,381 @@ + + + + + + + OpenST Payments Modules + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Modules

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
AirdropModelCacheKlass
+
+ +
baseCacheManagementKlass
+
+ +
baseCacheMultiManagementKlass
+
+ +
BasicHelperKlass
+
+ +
AdjustAirdropAmountKlass
+
+ +
AirdropBalanceCache
+
+ +
PricerCache
+
+ +
Airdrop
+
+ +
BrandedToken
+
+ +
ContractInteractHelper
+
+ +
OpsManagedContract
+
+ +
OwnedContract
+
+ +
MockToken
+
+ +
Pricer
+
+ +
Workers
+
+ +
MySQLQueryBuilderKlass
+
+ +
SetWorkerOps
+
+ +
TransactionHelper
+
+ +
DynamoDBInit
+
+ +
userAirdropDetailCache
+
+
+ + + + + +

Namespaces

+ +
+
web3EventsDecoder
+
+ +
web3EventsFormatter
+
+
+ + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html new file mode 100644 index 0000000..445c624 --- /dev/null +++ b/docs/namespaces.list.html @@ -0,0 +1,381 @@ + + + + + + + OpenST Payments Namespaces + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespaces

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
AirdropModelCacheKlass
+
+ +
baseCacheManagementKlass
+
+ +
baseCacheMultiManagementKlass
+
+ +
BasicHelperKlass
+
+ +
AdjustAirdropAmountKlass
+
+ +
AirdropBalanceCache
+
+ +
PricerCache
+
+ +
Airdrop
+
+ +
BrandedToken
+
+ +
ContractInteractHelper
+
+ +
OpsManagedContract
+
+ +
OwnedContract
+
+ +
MockToken
+
+ +
Pricer
+
+ +
Workers
+
+ +
MySQLQueryBuilderKlass
+
+ +
SetWorkerOps
+
+ +
TransactionHelper
+
+ +
DynamoDBInit
+
+ +
userAirdropDetailCache
+
+
+ + + + + +

Namespaces

+ +
+
web3EventsDecoder
+
+ +
web3EventsFormatter
+
+
+ + + + + + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + + + OpenST Foundation Ltd. + + + + Documentation generated by JSDoc 3.5.5 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/quicksearch.html b/docs/quicksearch.html new file mode 100644 index 0000000..0a366cd --- /dev/null +++ b/docs/quicksearch.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/docs/scripts/docstrap.lib.js b/docs/scripts/docstrap.lib.js new file mode 100644 index 0000000..09d9272 --- /dev/null +++ b/docs/scripts/docstrap.lib.js @@ -0,0 +1,11 @@ +if(!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=_.type(a);return"function"!==c&&!_.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c)}catch(a){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("