Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch order creation and cancelation for CLOB and injective #4

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6c81037
Batch order creation and cancelation for CLOB and injective
Feb 21, 2023
1ce4e44
Move code over
Feb 14, 2023
6e56e33
Clean up
Feb 14, 2023
fcd509f
Clean up unwanted changes
Feb 14, 2023
5329137
Compiles now
Feb 14, 2023
8f71a55
Bring patches over
Feb 14, 2023
1ed97bc
Add xdc to root
Feb 14, 2023
3777af2
Fix https
Feb 14, 2023
04a57db
Start unit tests for xdc chain
Feb 14, 2023
e8eb24f
validator test
Feb 14, 2023
0f1fcde
Add route tests
Feb 14, 2023
d3df317
Support xdc addresses in evm routes only when the chain is xdc
Feb 15, 2023
97f6206
Unit test for allowances
Feb 15, 2023
b938d21
Remove commented code
Feb 15, 2023
ab4a877
Use xdc prefixed address as wallet address
Feb 16, 2023
6ec0c8f
Update
Feb 16, 2023
30b71e4
remove logs
Feb 16, 2023
c126d81
Update
Feb 16, 2023
626e7b6
Drop patch packages
Feb 17, 2023
3ff6179
Fork of ethers so it is compatible with XDC and doesn't interfere wit…
james-hummingbot Feb 20, 2023
7654b4d
Add Xdcish
Feb 20, 2023
77fc380
It compiles
Feb 20, 2023
fc4888e
Fix wallet controller
Feb 20, 2023
832df40
(fix) update patch files and package.json
CrimsonJacket Feb 15, 2023
1ba0ebd
(feat) add xsswap
CrimsonJacket Feb 15, 2023
3578005
(fix/test) address issues with gateway start up and add manual token …
CrimsonJacket Feb 15, 2023
61a97e6
wip
CrimsonJacket Feb 17, 2023
c7483c8
(fix/test) remove redundant private key transformation and finalize u…
CrimsonJacket Feb 17, 2023
2df0e70
(update) update yarn.lock
CrimsonJacket Feb 21, 2023
9ec26a3
(fix/feat) resolve WXDC token address conflicts and add xsswap connector
CrimsonJacket Feb 21, 2023
d3cb225
Clean up
Feb 21, 2023
e97d4b7
(fix) address incorrect token address used in XDCSwap and ethers package
CrimsonJacket Feb 23, 2023
f292c38
(refactor) include token list for xinfin network
CrimsonJacket Feb 24, 2023
0866f3a
(remove) xdcswap
CrimsonJacket Feb 24, 2023
57239b8
(cleanup) fix merge issues with erc20 tokenlist file
CrimsonJacket Feb 24, 2023
d06e7f1
(remove) remove patches
CrimsonJacket Feb 24, 2023
872845c
Merge branch 'development' into feat/xdc_chain_and_xsswap
james-hummingbot Feb 26, 2023
6f18f08
Merge branch 'development' into feat/xdc_chain_and_xsswap
vic-en Feb 28, 2023
ae055da
Revert "update jest to use 50%"
vic-en Mar 3, 2023
717eb81
Revert "workflow test"
vic-en Mar 3, 2023
8ed804c
remove endpoint not implemented in swagger
vic-en Mar 6, 2023
5256f08
correct typo
vic-en Mar 6, 2023
18b97b5
update yarn
vic-en Mar 6, 2023
1c7cdc5
Merge branch 'development' of github.com:CoinAlpha/gateway into feat/…
Mar 6, 2023
fbc59da
Merge branch 'feat/xdc_chain_and_xsswap' of github.com:CoinAlpha/gate…
Mar 6, 2023
6aae11f
move libs to devDependencies
fengtality Mar 7, 2023
13acef8
chore: remove unused route
sytranvn Mar 7, 2023
d384298
Apply yarn format to reduce diffs
Mar 7, 2023
7fe694c
Merge pull request #51 from hummingbot/feat/injective_with_diff_test_…
fengtality Mar 8, 2023
79a06a1
Merge branch 'development' into chore/remove-unused-route
fengtality Mar 8, 2023
5a34350
Merge branch 'development' into fix/format
fengtality Mar 8, 2023
d90f54d
Merge pull request #52 from sytranvn/chore/remove-unused-route
fengtality Mar 8, 2023
101cd14
Merge branch 'development' into fix/format
fengtality Mar 8, 2023
aa9ef71
Merge pull request #53 from CoinAlpha/fix/format
fengtality Mar 8, 2023
c18bddf
Merge development branch
Mar 8, 2023
0176b34
Merge branch 'development' of github.com:hummingbot/gateway into feat…
Mar 8, 2023
2483015
Merge development
Mar 8, 2023
24c4831
typo
Mar 8, 2023
1355975
Merge branch 'feat/injective_protocol' of https://github.com/CoinAlph…
vic-en Mar 8, 2023
acee342
remove endpoint not implemented in swagger
vic-en Mar 6, 2023
12ebf1b
fix unit test
vic-en Mar 8, 2023
3f40797
Remove unnecessary console.log
Mar 9, 2023
f955da0
Merge pull request #45 from CoinAlpha/feat/xdc_chain_and_xsswap
fengtality Mar 9, 2023
f8ebd74
Merge branch 'development' into feat/injective_w_batch_update
fengtality Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,7 @@ jobs:
run: |
git fetch --all -q
git checkout -b $GITHUB_SHA
yarn test:cov
DIFF_FILES=`git diff --name-only origin/$GITHUB_BASE_REF ./src/`
./node_modules/.bin/jest --listTests --findRelatedTests ${DIFF_FILES//$'\n'/ }
NODE_OPTIONS=--max-old-space-size=10240 node ./node_modules/.bin/jest --runInBand --coverage --findRelatedTests ${DIFF_FILES//$'\n'/ }
# git diff origin/$GITHUB_BASE_REF | yarn diff-test-coverage -c ./coverage/lcov.info -t lcov -b 50 -l 60
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ certs
*.md
*.yml
coverage
dist
dist
vendor
27 changes: 26 additions & 1 deletion docs/swagger/clob-routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,31 @@ paths:
description: 'Bad request response.'
'404':
description: 'Not found response.'
/clob/batchOrders:
post:
tags:
- 'clob'
summary: 'Batch create or delete orders'
description: 'Create or delete orders in batch.'
operationId: 'batchOrders'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
description: 'Request body.'
required: true
schema:
$ref: '#/definitions/ClobBatchOrdersRequest'
responses:
'200':
description: 'Successful response.'
schema:
$ref: '#/definitions/ClobBatchOrdersResponse'
'400':
description: 'Bad request response.'
/clob/estimateGas:
post:
tags:
Expand All @@ -168,4 +193,4 @@ paths:
responses:
'200':
schema:
$ref: '#/definitions/EstimateGasResponse'
$ref: '#/definitions/EstimateGasResponse'
66 changes: 66 additions & 0 deletions docs/swagger/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,72 @@ definitions:
type: 'string'
example: '0x...'

ClobBatchOrdersRequest:
type: 'object'
required:
- 'chain'
- 'network'
- 'connector'
- 'address'
- 'createOrderParams'
- 'cancelOrderIds'
properties:
chain:
type: 'string'
example: 'injective'
network:
type: 'string'
example: 'mainnet'
connector:
type: 'string'
example: 'injective'
address:
type: 'string'
example: '0x...'
createOrderParams:
type: 'array'
items: 'object'
example: [{
market: 'AAVE-USDT',
price: '2',
amount: '0.10',
side: 'SELL',
orderType: 'LIMIT',
},
{
price: '3',
amount: '0.10',
side: 'SELL',
}]
cancelOrderParams:
type: 'array'
items: 'object'
example: [
{market: 'AAVE-USDT', orderId: '0x...'},
{market: 'AAVE-USDT', orderId: '0x...'},
]

ClobBatchOrdersResponse:
type: 'object'
required:
- 'network'
- 'timestamp'
- 'latency'
- 'txHash'
properties:
network:
type: 'string'
example: 'mainnet'
timestamp:
type: 'integer'
example: 1636368085740
latency:
type: 'number'
example: 0.5
txHash:
type: 'string'
example: '0x...'

TransferToSubAccountRequest:
type: 'object'
required:
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ module.exports = {
eccrypto: '<rootDir>/test/mock/eccrypto-mock.js',
},
testPathIgnorePatterns: ['/node_modules/', 'test-helpers'],
workerIdleMemoryLimit: '0.5',
};
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"test:scripts": "jest -i --verbose ./test-scripts/*.test.ts"
},
"dependencies": {
"@babel/core": "^7.0.0-0",
"@babel/runtime": "^7.0",
"@cosmjs/proto-signing": "^0.28.10",
"@cosmjs/stargate": "^0.28.13",
"@crocswap/sdk": "^2.4.5",
Expand All @@ -36,15 +34,13 @@
"@ethersproject/solidity": "5.7.0",
"@harmony-js/core": "^0.1.57",
"@harmony-js/utils": "^0.1.56",
"@improbable-eng/grpc-web": "^0.13.0",
"@injectivelabs/networks": "^1.0.52",
"@injectivelabs/sdk-ts": "^1.0.319",
"@injectivelabs/ts-types": "^1.0.18",
"@injectivelabs/wallet-ts": "^1.0.300",
"@pancakeswap/sdk": "^2.4.5",
"@pangolindex/sdk": "^1.1.0",
"@perp/sdk-curie": "^1.16.0",
"@solana/web3.js": "^1.58.0",
"@sushiswap/sdk": "^5.0.0-canary.116",
"@switchboard-xyz/defikingdoms-sdk": "^1.0.7",
"@traderjoe-xyz/sdk": "^1.6.1",
Expand All @@ -67,17 +63,15 @@
"big.js": "6.1.1",
"bn.js": "^5.2.1",
"body-parser": "^1.19.0",
"bs58": "^4.0.1",
"chalk": "^4.1.0",
"coinalpha-ref-sdk": "1.1.0",
"dayjs": "^1.10.6",
"decimal.js-light": "^2.5.1",
"ethers": "^5.6.2",
"ethers-xdc": "file:./vendor/ethers-xdc",
"express": "^4.17.1",
"express-winston": "^4.1.0",
"fs-extra": "^10.0.0",
"google-protobuf": "^3.2.0",
"jsbi": "^3.2.0",
"js-yaml": "^4.1.0",
"level": "^8.0.0",
"lodash": "^4.17.21",
Expand All @@ -86,8 +80,6 @@
"minimist": "^1.2.6",
"morgan": "^1.10.0",
"near-api-js": "1.0.0",
"react": "^18",
"react-dom": "^18",
"quickswap-sdk": "^3.0.8",
"swagger-ui-express": "^4.1.6",
"tslib": "^2.3.1",
Expand All @@ -96,10 +88,15 @@
"web3": "^1.7.3",
"winston": "^3.3.3",
"winston-daily-rotate-file": "^4.5.5",
"xsswap-sdk": "^1.0.1",
"yarn": "^1.22.17"
},
"devDependencies": {
"@babel/core": "^7.0.0-0",
"@babel/runtime": "^7.0",
"@connectis/diff-test-coverage": "^1.5.1",
"@improbable-eng/grpc-web": "^0.13.0",
"@solana/web3.js": "^1.58.0",
"@types/app-root-path": "^1.2.4",
"@types/big.js": "^6.1.3",
"@types/bs58": "^4.0.1",
Expand All @@ -114,6 +111,7 @@
"@types/swagger-ui-express": "^4.1.3",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1",
"bs58": "^4.0.1",
"copyfiles": "^2.4.1",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -123,16 +121,20 @@
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^4.0.1",
"google-protobuf": "^3.2.0",
"jsbi": "^3.2.0",
"hardhat": "^2.0.0",
"jest": "^29.4",
"jest": "^27.3.1",
"jest-extended": "^0.11.5",
"mock-ethers-provider": "^1.0.2",
"node-cache": "5.1.2",
"nodemon": "^2.0.16",
"prettier": "^2.3.0",
"react": "^18",
"react-dom": "^18",
"rimraf": "^3.0.2",
"supertest": "^6.1.6",
"ts-jest": "^29.0.5",
"ts-jest": "^27.0.5",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
},
Expand Down
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { NetworkRoutes } from './network/network.routes';
import { ConnectorsRoutes } from './connectors/connectors.routes';
import { EVMRoutes } from './evm/evm.routes';
import { AmmRoutes, AmmLiquidityRoutes, PerpAmmRoutes } from './amm/amm.routes';
import morgan from 'morgan';
import { InjectiveRoutes } from './chains/injective/injective.routes';
import { NearRoutes } from './chains/near/near.routes';
import { CLOBRoutes } from './clob/clob.routes';

import morgan from 'morgan';
import swaggerUi from 'swagger-ui-express';
import { NearRoutes } from './chains/near/near.routes';

export const gatewayApp = express();

Expand Down
Loading