Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
86ea36b
[DEV-411] implemented generic payout module, happy path
TonySemikin Aug 4, 2022
913dfd0
[DEV-411] added payout module to payment parent module
TonySemikin Aug 4, 2022
b1515c6
[DEV-411] refactored buy-crypto to use new payout service
TonySemikin Aug 4, 2022
a973f94
[DEV-411] finished refactoring and cleanup of buy-crypto
TonySemikin Aug 4, 2022
3fff900
[DEV-411] small improvements after first test run
TonySemikin Aug 4, 2022
dc2f7f3
[DEV-411] removed unnecessary imports
TonySemikin Aug 4, 2022
240ad67
[DEV-411] added node choice capability, depending on context
TonySemikin Aug 4, 2022
b42a5b6
[DEV-411] implemented corner cases protection and non-recoverable sce…
TonySemikin Aug 5, 2022
adc2012
[DEV-411] created db migration
TonySemikin Aug 5, 2022
0715511
[DEV-411] slightly improved log for new payout orders
TonySemikin Aug 5, 2022
748e33a
[DEV-411] slightly improved log for token payout
TonySemikin Aug 5, 2022
96c4f96
[DEV-411] returned INT wallet address config
TonySemikin Aug 5, 2022
1803f38
Merge remote-tracking branch 'origin/develop' into feature/DEV-411-st…
TonySemikin Aug 5, 2022
208643e
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Aug 22, 2022
bff8b4c
[DEV-667] added ethereum configuration
TonySemikin Aug 22, 2022
2b7f30d
[DEV-667] regrouped blockchain layer, added ethereum module
TonySemikin Aug 22, 2022
b40ed5a
[DEV-667] scaffolded ethereum service and client
TonySemikin Aug 22, 2022
731dafc
[DEV-667] interim progress on payout module adaption
TonySemikin Aug 24, 2022
d426cc2
[DEV-667] finished initial payout module adaption
TonySemikin Aug 24, 2022
d054d9c
[DEV-667] extracted logs service
TonySemikin Aug 24, 2022
513799e
[DEV-667] refactored dex module for ethereum
TonySemikin Aug 24, 2022
8ea3c8e
[DEV-667] first e2e ETH buy run
TonySemikin Aug 25, 2022
8bae6d4
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Aug 25, 2022
a08f62b
[DEV-667] implemented remaining part of asset fetch and liquidity cal…
TonySemikin Aug 26, 2022
433b049
[DEV-667] defined pricing interface
TonySemikin Aug 26, 2022
f2f4b22
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Aug 29, 2022
1eb2cbe
[DEV-667] pricing paths configuration - WIP
TonySemikin Aug 29, 2022
45cb65e
[DEV-667] renamed path aliases - WIP
TonySemikin Aug 29, 2022
2c07033
[DEV-667] added fixer service
TonySemikin Aug 29, 2022
52953ad
[DEV-667] fixed price requests from buy-crypto and staking
TonySemikin Aug 30, 2022
95bd820
[DEV-667] renamed ethereum blockchain directory
TonySemikin Aug 30, 2022
5641e21
[DEV-667] extracted ETH_API_KEY to separate variable and config
TonySemikin Aug 30, 2022
3a5aef1
[DEV-667] changed reference asset check logic
TonySemikin Aug 31, 2022
ecafb6b
[DEV-667] added bnb clone of ethereum
TonySemikin Aug 31, 2022
87b0881
[DEV-667] improved logs in pricings-step class
TonySemikin Aug 31, 2022
2abc313
[DEV-667] added health checks to payout and prepare defi strategies
TonySemikin Aug 31, 2022
dd6d303
[DEV-667] improved payout designation logic, to catch only timeouts
TonySemikin Aug 31, 2022
0f36fbf
[DEV-667] BNB transaction working e2e
TonySemikin Aug 31, 2022
c2fe0e4
[DEV-667] finished pricing module cleanup
TonySemikin Sep 2, 2022
0e9a239
[DEV-667] remaining modules cleanup interim progress
TonySemikin Sep 4, 2022
8dda1aa
[DEV-667] first version of EVM shared functionality
TonySemikin Sep 4, 2022
09b48d3
[DEV-667] removed redundant generic types
TonySemikin Sep 4, 2022
39b2cad
[DEV-667] finished strategies resturcturing
TonySemikin Sep 4, 2022
7b1b098
[DEV-667] removed denomination from evm-client
TonySemikin Sep 4, 2022
b4e6924
[DEV-667] implemented part of PR-354 comments
TonySemikin Sep 4, 2022
592e143
[DEV-667] fixed DI and initialization issues
TonySemikin Sep 5, 2022
cbd416c
[DEV-667] added await for sending mail
TonySemikin Sep 5, 2022
343be02
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Sep 5, 2022
18771c3
[DEV-667] cleanup after merge
TonySemikin Sep 5, 2022
b0297ec
[DEV-667] restructured mocks directories and fixed the tests
TonySemikin Sep 5, 2022
86bfd13
[DEV-667] restructured remaining mocks directories
TonySemikin Sep 5, 2022
cb07705
[DEV-667] implemented buy-crypto entites unit tests
TonySemikin Sep 5, 2022
d75dda1
[DEV-667] implemented liquidity-orider entity unit tests
TonySemikin Sep 5, 2022
db50030
[DEV-667] implemented payout-orider entity unit tests
TonySemikin Sep 5, 2022
fb0058d
[DEV-667] implemented factories unit tests
TonySemikin Sep 5, 2022
a629229
[DEV-667] implemented unit tests for strategies facades
TonySemikin Sep 5, 2022
7fbd16b
[DEV-667] implemented price paths and steps specifications unit tests
TonySemikin Sep 5, 2022
1a23a00
[DEV-667] added DEX module high level docs
TonySemikin Sep 5, 2022
913556f
[DEV-667] slightly updated DEX module high level docs
TonySemikin Sep 5, 2022
5217461
[DEV-667] declared basic integration tests scenarios
TonySemikin Sep 6, 2022
bbe88b7
[DEV-667] implemented payout defichain unit tests
TonySemikin Sep 6, 2022
f2b8258
[DEV-667] implemented payout defichain token unit tests
TonySemikin Sep 6, 2022
47cbc00
[DEV-667] added extensive logs to price requests
TonySemikin Sep 6, 2022
ed77733
[DEV-667] interim progress on pricing module testing
TonySemikin Sep 6, 2022
ac2be61
[DEV-667] finished pricing component integration tests
TonySemikin Sep 7, 2022
16adf07
[DEV-667] skipped non-implemented tests
TonySemikin Sep 7, 2022
088acd6
[DEV-667] extended buy-crypto inntegration test scenarios
TonySemikin Sep 7, 2022
078dd69
[DEV-667] generalized defichain payout sending logic
TonySemikin Sep 7, 2022
105a5b9
[DEV-667] removed unnecessary comment
TonySemikin Sep 7, 2022
e021cd7
[DEV-667] improved log message for pricing requests
TonySemikin Sep 7, 2022
01693dd
[DEV-667] integrated currency service
TonySemikin Sep 7, 2022
f0b97a4
[DEV-667] small syntax cleanup
TonySemikin Sep 7, 2022
8d510b8
[DEV-667] minor fixes after first test run
TonySemikin Sep 7, 2022
0873f1a
[DEV-667] reflected couple of testing findings
TonySemikin Sep 7, 2022
a2158e1
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Sep 7, 2022
b5c0e12
[DEV-667] fixed post merge errors
TonySemikin Sep 7, 2022
08f3940
[DEV-667] fixes after second test run findings
TonySemikin Sep 8, 2022
80581e6
[DEV-667] changed gsa limit to number
TonySemikin Sep 8, 2022
a65f5be
[DEV-667] addressed PR comments
TonySemikin Sep 8, 2022
a3518bf
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Sep 8, 2022
79ef34c
[DEV-667] fixed errors after develop merge
TonySemikin Sep 8, 2022
97636f0
[DEV-667] implemented setting output reference to BTC for non-USD Fia…
TonySemikin Sep 8, 2022
684498c
[DEV-667] removed Fixer env and configuration
TonySemikin Sep 8, 2022
f5d9eab
[DEV-667] adjusted setting output reference to BTC for non-USD Fiat i…
TonySemikin Sep 8, 2022
70f536d
[DEV-667] added pricing path USDC -> USDT
TonySemikin Sep 8, 2022
3662891
[DEV-667] removed redundant TODOs
TonySemikin Sep 8, 2022
31f142b
[DEV-667] fixed ETH liquidity purchase mail
TonySemikin Sep 8, 2022
124ad24
[DEV-667] added blockchain column to migration
TonySemikin Sep 9, 2022
2aebb8a
[DEV-667] removed IS NOT NULL constraint from asset
TonySemikin Sep 9, 2022
eb80c9b
Merge remote-tracking branch 'origin/develop' into feature/DEV-667-bu…
TonySemikin Sep 9, 2022
062dfa1
[DEV-667] removed evm explorers configs
TonySemikin Sep 9, 2022
fd42007
[DEV-667] Updated environment
davidleomay Sep 9, 2022
9d70c76
[DEV-667] Fixed BSC gateway URL
davidleomay Sep 9, 2022
200d093
[DEV-667] Fixed migration
davidleomay Sep 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ NODE_REF_URL_ACTIVE=
NODE_WALLET_PASSWORD=
DEX_WALLET_ADDRESS=
OUT_WALLET_ADDRESS=
INT_WALLET_ADDRESS=
STAKING_WALLET_ADDRESS=
UTXO_SPENDER_ADDRESS=
ETH_WALLET_ADDRESS=
ETH_WALLET_PRIVATE_KEY=
ETH_GATEWAY_URL=
ETH_API_KEY=
BSC_WALLET_ADDRESS=
BSC_WALLET_PRIVATE_KEY=
BSC_GATEWAY_URL=
LETTER_USER=
LETTER_AUTH=
LETTER_URL=
Expand Down
45 changes: 45 additions & 0 deletions infrastructure/bicep/dfx-api.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,23 @@ param nodePassword string
param nodeWalletPassword string
param dexWalletAddress string
param outWalletAddress string
param intWalletAddress string
param stakingWalletAddress string
param utxoSpenderAddress string
param btcCollectorAddress string

param ethWalletAddress string
@secure()
param ethWalletPrivateKey string
param ethGatewayUrl string
@secure()
param ethApiKey string

param bscWalletAddress string
@secure()
param bscWalletPrivateKey string
param bscGatewayUrl string

param nodeServicePlanSkuName string
param nodeServicePlanSkuTier string
param hasBackupNodes bool
Expand Down Expand Up @@ -528,6 +541,10 @@ resource apiAppService 'Microsoft.Web/sites@2018-11-01' = {
name: 'OUT_WALLET_ADDRESS'
value: outWalletAddress
}
{
name: 'INT_WALLET_ADDRESS'
value: intWalletAddress
}
{
name: 'STAKING_WALLET_ADDRESS'
value: stakingWalletAddress
Expand All @@ -536,6 +553,34 @@ resource apiAppService 'Microsoft.Web/sites@2018-11-01' = {
name: 'UTXO_SPENDER_ADDRESS'
value: utxoSpenderAddress
}
{
name: 'ETH_WALLET_ADDRESS'
value: ethWalletAddress
}
{
name: 'ETH_WALLET_PRIVATE_KEY'
value: ethWalletPrivateKey
}
{
name: 'ETH_GATEWAY_URL'
value: ethGatewayUrl
}
{
name: 'ETH_API_KEY'
value: ethApiKey
}
{
name: 'BSC_WALLET_ADDRESS'
value: bscWalletAddress
}
{
name: 'BSC_WALLET_PRIVATE_KEY'
value: bscWalletPrivateKey
}
{
name: 'BSC_GATEWAY_URL'
value: bscGatewayUrl
}
{
name: 'BTC_COLLECTOR_ADDRESS'
value: btcCollectorAddress
Expand Down
24 changes: 24 additions & 0 deletions infrastructure/bicep/parameters/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,36 @@
"outWalletAddress": {
"value": "xxx"
},
"intWalletAddress": {
"value": "xxx"
},
"stakingWalletAddress": {
"value": "xxx"
},
"utxoSpenderAddress": {
"value": "xxx"
},
"ethWalletAddress": {
"value": "xxx"
},
"ethWalletPrivateKey": {
"value": "xxx"
},
"ethGatewayUrl": {
"value": "https://goerli.infura.io/v3"
},
"ethApiKey": {
"value": "xxx"
},
"bscWalletAddress": {
"value": "xxx"
},
"bscWalletPrivateKey": {
"value": "xxx"
},
"bscGatewayUrl": {
"value": "https://data-seed-prebsc-1-s1.binance.org:8545"
},
"btcCollectorAddress": {
"value": "xxx"
},
Expand Down
24 changes: 24 additions & 0 deletions infrastructure/bicep/parameters/loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,36 @@
"outWalletAddress": {
"value": "xxx"
},
"intWalletAddress": {
"value": "xxx"
},
"stakingWalletAddress": {
"value": "xxx"
},
"utxoSpenderAddress": {
"value": "xxx"
},
"ethWalletAddress": {
"value": "xxx"
},
"ethWalletPrivateKey": {
"value": "xxx"
},
"ethGatewayUrl": {
"value": "https://goerli.infura.io/v3"
},
"ethApiKey": {
"value": "xxx"
},
"bscWalletAddress": {
"value": "xxx"
},
"bscWalletPrivateKey": {
"value": "xxx"
},
"bscGatewayUrl": {
"value": "https://data-seed-prebsc-1-s1.binance.org:8545"
},
"btcCollectorAddress": {
"value": "xxx"
},
Expand Down
24 changes: 24 additions & 0 deletions infrastructure/bicep/parameters/prd.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,36 @@
"outWalletAddress": {
"value": "xxx"
},
"intWalletAddress": {
"value": "xxx"
},
"stakingWalletAddress": {
"value": "xxx"
},
"utxoSpenderAddress": {
"value": "xxx"
},
"ethWalletAddress": {
"value": "xxx"
},
"ethWalletPrivateKey": {
"value": "xxx"
},
"ethGatewayUrl": {
"value": "https://mainnet.infura.io/v3"
},
"ethApiKey": {
"value": "xxx"
},
"bscWalletAddress": {
"value": "xxx"
},
"bscWalletPrivateKey": {
"value": "xxx"
},
"bscGatewayUrl": {
"value": "https://bsc-dataseed.binance.org"
},
"btcCollectorAddress": {
"value": "xxx"
},
Expand Down
23 changes: 23 additions & 0 deletions migration/1662719663283-payoutOrders.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { MigrationInterface, QueryRunner } = require('typeorm');

module.exports = class payoutOrders1662719663283 {
name = 'payoutOrders1662719663283';

async up(queryRunner) {
await queryRunner.query(
`CREATE TABLE "payout_order" ("id" int NOT NULL IDENTITY(1,1), "updated" datetime2 NOT NULL CONSTRAINT "DF_c962900745f742c3bfb79eb3772" DEFAULT getdate(), "created" datetime2 NOT NULL CONSTRAINT "DF_77e65c6e94f256d8d4a21592269" DEFAULT getdate(), "context" nvarchar(256) NOT NULL, "correlationId" nvarchar(256) NOT NULL, "chain" nvarchar(256) NOT NULL, "amount" float NOT NULL, "destinationAddress" nvarchar(256) NOT NULL, "status" nvarchar(256) NOT NULL, "transferTxId" nvarchar(256), "payoutTxId" nvarchar(256), "assetId" int, CONSTRAINT "PK_b8871a008d488ac0065baff70f8" PRIMARY KEY ("id"))`,
);
await queryRunner.query(
`ALTER TABLE "payout_order" ADD CONSTRAINT "FK_104e583561878b016c275c3c6b3" FOREIGN KEY ("assetId") REFERENCES "asset"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
);
await queryRunner.query(`ALTER TABLE "buy_crypto_batch" ADD "blockchain" nvarchar(256)`);
await queryRunner.query(`ALTER TABLE "buy_crypto_batch" DROP COLUMN "outTxId"`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "buy_crypto_batch" ADD "outTxId" nvarchar(256)`);
await queryRunner.query(`ALTER TABLE "buy_crypto_batch" DROP COLUMN "blockchain"`);
await queryRunner.query(`ALTER TABLE "payout_order" DROP CONSTRAINT "FK_104e583561878b016c275c3c6b3"`);
await queryRunner.query(`DROP TABLE "payout_order"`);
}
};
Loading