Skip to content

Commit

Permalink
fix: šŸ› dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SmilingXinyi committed Jul 8, 2020
1 parent 76827ad commit a094994
Show file tree
Hide file tree
Showing 14 changed files with 1,782 additions and 79,064 deletions.
20 changes: 9 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
node: true
},
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended'
],
globals: {
Expand All @@ -15,19 +14,18 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
project: './tsconfig.json'
},
plugins: ['@typescript-eslint'],
ignorePatterns: ['node_modules/**', 'scripts/**', 'sdk-*/**'],
ignorePatterns: ['node_modules/**', 'scripts/**', 'sdk-1.*/**'],
rules: {
'indent': ['error', 4],
'comma-dangle': 'off'
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
}
'@typescript-eslint/indent': ['error', 4],
'comma-dangle': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'arrow-parens': 'off',
'object-curly-spacing': 'off',

}
};
25,586 changes: 0 additions & 25,586 deletions output/src/proto/xuper_pb.js

This file was deleted.

3,775 changes: 1,693 additions & 2,082 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,28 @@
"homepage": "https://github.com/xuperchain/xuper-sdk-js#readme",
"devDependencies": {
"@types/jest": "^26.0.4",
"@typescript-eslint/eslint-plugin": "^2.12.0",
"@typescript-eslint/parser": "^2.12.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"clean-webpack-plugin": "^3.0.0",
"coveralls": "^3.0.9",
"cz-conventional-changelog": "^3.0.2",
"coveralls": "^3.1.0",
"cz-conventional-changelog": "^3.2.0",
"dotenv": "^8.2.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.19.1",
"git-cz": "^4.7.0",
"husky": "^3.1.0",
"jest": "^26.1.0",
"jest-environment-jsdom-fourteen": "^1.0.1",
"standard-version": "^7.0.1",
"standard-version": "^8.0.0",
"ts-jest": "^26.1.1",
"ts-loader": "^6.2.1",
"ts-loader": "^6.2.2",
"tsdx": "^0.13.2",
"tslib": "^2.0.0",
"typedoc": "^0.15.5",
"typedoc": "^0.15.8",
"typescript": "^3.9.6",
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2",
"whatwg-fetch": "^3.0.0"
"whatwg-fetch": "^3.1.0"
},
"husky": {
"hooks": {
Expand All @@ -87,9 +85,6 @@
"awesome-typescript-loader": "^5.2.1",
"bn.js": "^5.0.0",
"elliptic": "^6.5.2",
"google-protobuf": "^3.12.2",
"grpc": "^1.24.3",
"grpc-tools": "^1.9.0",
"node-fetch": "^2.6.0",
"pbkdf2": "^3.0.17",
"ripemd160-min": "0.0.6",
Expand Down
55 changes: 26 additions & 29 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {Options} from './types';
import {
// xchainProto,
grpcClient,
pb,
postRequest,
isBrowser
} from './utils';
Expand All @@ -31,25 +30,24 @@ export default class XuperSDK implements XuperSDKInterface {

checkStatus(): Promise<any> {
const node = this.options.node;
const target = `${node}/v1/get_bcstatus`;
const body = {
bcname: this.options.chain,
bcname: this.options.chain
};
if (isBrowser) {
const target = `${node}/v1/get_bcstatus`;
return postRequest(target, body);
}
else {
// @ts-ignore
// request.setMessage(body);
// @ts-ignore

// console.log(pb.Header);

// const request = new xchainProto.Header();

const request = pb.BCStatus(body);
// console.log(body);
return grpcClient.GetBlockChainStatus(body);
} else {
return new Promise<any>((resolve, reject) =>
grpcClient.GetBlockChainStatus(body, (err: Error, response: any) => {
if (!err) {
resolve(response);
}
else {
console.warn(err);
reject(err);
}
})
)
}
}

Expand All @@ -59,25 +57,24 @@ export default class XuperSDK implements XuperSDKInterface {

if (!addr && this.account) {
addr = this.account.address;
} else {
// Todo: throw error of wrong parameter
}
else {

}
// Todo: check addr

const body = {
address: addr,
bcs: [{
bcname: this.options.chain
}]
};

if (isBrowser) {
console.log('browser');
const body = {
address: addr,
bcs: [{
bcname: this.options.chain
}]
};
const target = `${node}/v1/get_balance`;
return postRequest(target, body);
}
else {
console.log('nodejs');
return grpcClient.GetBlockChainStatus({bcname: 'xuper'});
} else {
return grpcClient.GetBalance(body);
}
}

Expand Down
70 changes: 0 additions & 70 deletions src/proto/chaindbft.proto

This file was deleted.

33 changes: 0 additions & 33 deletions src/proto/src/proto/xuper_grpc_pb.js

This file was deleted.

Loading

0 comments on commit a094994

Please sign in to comment.