Skip to content

Commit

Permalink
Merge branch 'issue-1/fix-misc' into 'master'
Browse files Browse the repository at this point in the history
Upgrade to latest dependencies, misc. quick fixes

See merge request thorchain/asgardex-common/asgardex-binance!1
  • Loading branch information
thorchain-admin authored and stuartwk committed Oct 4, 2020
1 parent a91a1b6 commit 528bbb1
Show file tree
Hide file tree
Showing 10 changed files with 757 additions and 681 deletions.
1 change: 1 addition & 0 deletions packages/asgardex-binance/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"plugins": ["prettier"],
"extends": ["plugin:@typescript-eslint/recommended", "prettier/@typescript-eslint", "plugin:prettier/recommended"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-empty-function": "off",
Expand Down
7 changes: 6 additions & 1 deletion packages/asgardex-binance/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
node_modules/
*.log
.DS_Store
node_modules
npm-debug.log
lib
.env
10 changes: 0 additions & 10 deletions packages/asgardex-binance/.gitignore copy

This file was deleted.

2 changes: 0 additions & 2 deletions packages/asgardex-binance/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ build:
test:
stage: test
script:
- yarn clean
- yarn build
- yarn test
2 changes: 1 addition & 1 deletion packages/asgardex-binance/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.14.1
13
34 changes: 17 additions & 17 deletions packages/asgardex-binance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@
"clean": "rimraf lib/**",
"build": "rollup -c",
"test": "jest",
"lint": "eslint \"{src,__tests__}/**/*.ts\" --fix",
"prepublishOnly": "yarn build"
},
"devDependencies": {
"@binance-chain/javascript-sdk": "^2.16.4",
"@types/jest": "^25.1.5",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"husky": "^4.2.3",
"jest": "^25.2.7",
"lerna": "^3.20.2",
"lint-staged": "^10.1.1",
"prettier": "^2.0.2",
"rollup": "^2.3.2",
"@types/jest": "^25.2.3",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"eslint": "^7.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^26.0.1",
"lerna": "^3.22.0",
"lint-staged": "^10.2.6",
"prettier": "^2.0.5",
"rollup": "^2.10.9",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-peer-deps-external": "^2.2.2",
"rollup-plugin-typescript2": "^0.27.0",
"ts-jest": "^25.3.1",
"tslib": "^1.11.1",
"typescript": "^3.8.3",
"rollup-plugin-typescript2": "^0.27.1",
"ts-jest": "^26.0.0",
"tslib": "^2.0.0",
"typescript": "^3.9.3",
"dotenv": "^8.2.0"
},
"publishConfig": {
Expand Down
15 changes: 14 additions & 1 deletion packages/asgardex-binance/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ export default {
exclude: '__tests__/**',
clean: true,
}),
commonjs(),
commonjs({
namedExports: {
// API of `u2f-api` is defined in `node_modules/u2f-api/lib/u2f-api.js`
// and re-imported in `node_modules/u2f-api/index.js`
'node_modules/u2f-api/index.js': [
'isSupported',
'ensureSupport',
'register',
'sign',
'ErrorCodes',
'ErrorNames',
],
},
}),
],
}
6 changes: 6 additions & 0 deletions packages/asgardex-binance/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface BinanceClient {
getAddress(): string
validateAddress(address: string): boolean
getBalance(address?: Address): Promise<Balance>
// TODO Add return type
// https://gitlab.com/thorchain/asgardex-common/asgardex-binance/-/issues/2
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
getTransactions(date: number, address?: string): Promise<any[]>
vaultTx(addressTo: Address, amount: number, asset: string, memo: string): Promise<TransferResult>
normalTx(addressTo: Address, amount: number, asset: string): Promise<TransferResult>
Expand Down Expand Up @@ -138,6 +141,9 @@ class Client implements BinanceClient {
return balance
}

// TODO Add proper return type
// https://gitlab.com/thorchain/asgardex-common/asgardex-binance/-/issues/2
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
getTransactions = async (date: number, address?: string): Promise<any[]> => {
const pathTx = '/api/v1/transactions?address='
const startTime = '&startTime=' // 3 months back. might need to think this.
Expand Down
3 changes: 3 additions & 0 deletions packages/asgardex-binance/src/types/binance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ export interface BncClient {
* Get Transactions
* https://github.com/binance-chain/javascript-sdk/wiki/API-Documentation#bncclientgettransactionsaddress-offset--promise
*/
// TODO Add proper return type
// https://gitlab.com/thorchain/asgardex-common/asgardex-binance/-/issues/2
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
getTransactions(address: Address, offset: number): Promise<any>

/**
Expand Down
Loading

0 comments on commit 528bbb1

Please sign in to comment.