mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
commit
34a74286b7
59
.eslintrc.js
Normal file
59
.eslintrc.js
Normal file
@ -0,0 +1,59 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
jasmine: true,
|
||||
node: true,
|
||||
worker: true,
|
||||
},
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
project: "./tsconfig.json",
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:import/typescript",
|
||||
],
|
||||
rules: {
|
||||
curly: ["warn", "multi-line", "consistent"],
|
||||
"no-console": ["warn", { allow: ["error", "info", "warn"] }],
|
||||
"no-param-reassign": "warn",
|
||||
"no-shadow": "warn",
|
||||
"prefer-const": "warn",
|
||||
"spaced-comment": ["warn", "always", { line: { markers: ["/ <reference"] } }],
|
||||
"import/no-cycle": "warn",
|
||||
"simple-import-sort/sort": "warn",
|
||||
"@typescript-eslint/explicit-function-return-type": ["warn", { allowExpressions: true }],
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
|
||||
"@typescript-eslint/no-use-before-define": "warn",
|
||||
"@typescript-eslint/prefer-readonly": "warn",
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: "**/*.js",
|
||||
rules: {
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: "**/*.spec.ts",
|
||||
rules: {
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: "jasmine-testrunner.js",
|
||||
rules: {
|
||||
"@typescript-eslint/camelcase": ["error", { properties: "never" }],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
@ -1,56 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"es6": true,
|
||||
"jasmine": true,
|
||||
"node": true,
|
||||
"worker": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "prettier", "simple-import-sort", "import"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:import/typescript"
|
||||
],
|
||||
"rules": {
|
||||
"curly": ["warn", "multi-line", "consistent"],
|
||||
"no-console": ["warn", { "allow": ["error", "info", "warn"] }],
|
||||
"no-param-reassign": "warn",
|
||||
"no-shadow": "warn",
|
||||
"prefer-const": "warn",
|
||||
"spaced-comment": ["warn", "always", { "line": { "markers": ["/ <reference"] } }],
|
||||
"import/no-cycle": "warn",
|
||||
"simple-import-sort/sort": "warn",
|
||||
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true }],
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
|
||||
"@typescript-eslint/no-use-before-define": "warn"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": "**/*.js",
|
||||
"rules": {
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "**/*.spec.ts",
|
||||
"rules": {
|
||||
"@typescript-eslint/no-non-null-assertion": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "jasmine-testrunner.js",
|
||||
"rules": {
|
||||
"@typescript-eslint/camelcase": ["error", { "properties": "never" }]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -69,7 +69,6 @@
|
||||
"source-map-support": "^0.5.6",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.13.0",
|
||||
"tslint-immutable": "^5.5.2",
|
||||
"typescript": "~3.7",
|
||||
"webpack": "^4.12.0",
|
||||
"webpack-cli": "^3.3.8"
|
||||
|
@ -205,7 +205,7 @@ export class CosmWasmConnection implements BlockchainConnection {
|
||||
): Promise<ConfirmedAndSignedTransaction<UnsignedTransaction> | FailedTransaction> {
|
||||
try {
|
||||
const response = await this.restClient.txsById(id);
|
||||
const chainId = await this.chainId();
|
||||
const chainId = this.chainId();
|
||||
return this.parseAndPopulateTxResponse(response, chainId);
|
||||
} catch (error) {
|
||||
if (error.response.status === 404) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
// tslint:disable: no-object-mutation
|
||||
import { UserProfile } from "@iov/keycontrol";
|
||||
import cors = require("@koa/cors");
|
||||
import Koa from "koa";
|
||||
@ -110,7 +109,7 @@ export async function start(args: ReadonlyArray<string>): Promise<void> {
|
||||
}
|
||||
|
||||
// context.request.body is set by the bodyParser() plugin
|
||||
const requestBody = (context.request as any).body;
|
||||
const requestBody = context.request.body;
|
||||
const { address, ticker } = RequestParser.parseCreditBody(requestBody);
|
||||
|
||||
if (!codecImplementation().isValidAddress(address)) {
|
||||
|
@ -1,4 +1,3 @@
|
||||
// tslint:disable: no-object-mutation
|
||||
import { TokenTicker } from "@iov/bcp";
|
||||
|
||||
import { creditAmount, refillAmount, refillThreshold, setFractionalDigits } from "./cashflow";
|
||||
|
@ -30,7 +30,6 @@ export async function loadAccounts(
|
||||
const codec = codecImplementation();
|
||||
const addresses = identitiesOfFirstWallet(profile).map(identity => codec.identityToAddress(identity));
|
||||
|
||||
// tslint:disable-next-line: readonly-array
|
||||
const out: Account[] = [];
|
||||
for (const address of addresses) {
|
||||
const response = await connection.getAccount({ address: address });
|
||||
@ -104,7 +103,6 @@ export async function refill(profile: UserProfile, connection: BlockchainConnect
|
||||
const availableTokens = availableTokensFromHolder(holderAccount);
|
||||
console.info("Available tokens:", availableTokens);
|
||||
|
||||
// tslint:disable-next-line: readonly-array
|
||||
const jobs: SendJob[] = [];
|
||||
|
||||
for (const token of availableTokens) {
|
||||
|
15
tslint.json
15
tslint.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"defaultSeverity": "error",
|
||||
"extends": ["tslint:latest", "tslint-immutable", "tslint-config-prettier"],
|
||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||
"jsRules": {},
|
||||
"rules": {
|
||||
"array-type": [true, "array"],
|
||||
@ -10,21 +10,12 @@
|
||||
"deprecation": true,
|
||||
"interface-name": [true, "never-prefix"],
|
||||
"max-classes-per-file": false,
|
||||
"no-class": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-console": [true, "log"],
|
||||
"no-delete": true,
|
||||
"no-empty": false,
|
||||
"no-empty-interface": false,
|
||||
"no-expression-statement": false,
|
||||
"no-floating-promises": true,
|
||||
"no-if-statement": false,
|
||||
"no-implicit-dependencies": false,
|
||||
"no-let": false,
|
||||
"no-loop-statement": false,
|
||||
"no-method-signature": true,
|
||||
"no-mixed-interface": false,
|
||||
"no-object-mutation": true,
|
||||
"no-parameter-reassignment": false,
|
||||
"no-unnecessary-class": [true, "allow-static-only"],
|
||||
"no-unnecessary-type-assertion": true,
|
||||
@ -32,10 +23,8 @@
|
||||
"object-literal-shorthand": [true, "never"],
|
||||
"object-literal-sort-keys": false,
|
||||
"ordered-imports": false,
|
||||
"prefer-const": true,
|
||||
"prefer-const": false,
|
||||
"promise-function-async": true,
|
||||
"readonly-array": true,
|
||||
"readonly-keyword": true,
|
||||
"typedef": [true, "call-signature"],
|
||||
"variable-name": [true, "check-format", "allow-leading-underscore"]
|
||||
},
|
||||
|
21
yarn.lock
21
yarn.lock
@ -7524,13 +7524,6 @@ tslint-config-prettier@^1.13.0:
|
||||
resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz#75f140bde947d35d8f0d238e0ebf809d64592c37"
|
||||
integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==
|
||||
|
||||
tslint-immutable@^5.5.2:
|
||||
version "5.5.2"
|
||||
resolved "https://registry.yarnpkg.com/tslint-immutable/-/tslint-immutable-5.5.2.tgz#57331f6100156fa7ac4503e121cd2616df5bab8a"
|
||||
integrity sha512-+dSMhEeUyRMrBe9XcjfRXT/FmqWKXsSdxttWoDzhUFSNCg8wfXx29M/ClQ78HhmdTaK+DDQsNS3wTGpSIhOv3g==
|
||||
dependencies:
|
||||
tsutils "^2.28.0 || ^3.0.0"
|
||||
|
||||
tslint@^5.19.0:
|
||||
version "5.20.1"
|
||||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d"
|
||||
@ -7555,13 +7548,6 @@ tsscmp@1.0.6:
|
||||
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
|
||||
integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==
|
||||
|
||||
"tsutils@^2.28.0 || ^3.0.0", tsutils@^3.17.1:
|
||||
version "3.17.1"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
|
||||
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tsutils@^2.29.0:
|
||||
version "2.29.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
|
||||
@ -7569,6 +7555,13 @@ tsutils@^2.29.0:
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tsutils@^3.17.1:
|
||||
version "3.17.1"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
|
||||
integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tty-browserify@0.0.0:
|
||||
version "0.0.0"
|
||||
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
|
||||
|
Loading…
x
Reference in New Issue
Block a user