-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,255 additions
and
1,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,39 @@ | ||
/* | ||
* File: .eslintrc | ||
* Project: @xyo-network/sdk-core-nodejs | ||
* File Created: Friday, 13th November 2020 10:18:05 am | ||
* Author: XYO Development Team ([email protected]) | ||
* ----- | ||
* Last Modified: Friday, 13th November 2020 11:22:27 am | ||
* Modified By: XYO Development Team ([email protected]>) | ||
* ----- | ||
* Copyright 2017 - 2020 XY - The Persistent Company | ||
*/ | ||
|
||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"ignorePatterns": [ | ||
"node_modules/", | ||
"build/", | ||
"/*.ts", | ||
"/*.js", | ||
"src/contracts" | ||
], | ||
"ignorePatterns": ["node_modules/", "build/"], | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier", | ||
"sort-keys-fix", | ||
"sort-export-all", | ||
"typescript-sort-keys", | ||
"json", | ||
"workspaces", | ||
"import", | ||
"simple-import-sort", | ||
"no-secrets" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings", | ||
"plugin:import/typescript", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:json/recommended", | ||
"plugin:prettier/recommended" | ||
"plugin:prettier/recommended", | ||
"plugin:workspaces/recommended" | ||
], | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"] | ||
} | ||
}, | ||
"rules": { | ||
"no-secrets/no-secrets": ["off"], | ||
"workspaces/require-dependency": ["off"], | ||
"prettier/prettier": "error", | ||
"semi": "off", | ||
"@typescript-eslint/semi": ["error", "never"], | ||
"prettier/prettier": "warn", | ||
"semi": ["warn", "never"], | ||
"@typescript-eslint/semi": ["warn", "never"], | ||
|
||
"no-tabs": ["error"], | ||
"@typescript-eslint/member-delimiter-style": [ | ||
|
@@ -63,19 +49,13 @@ | |
} | ||
} | ||
], | ||
"sort-export-all/sort-export-all": "warn", | ||
"require-await": "error", | ||
"sort-keys": [ | ||
"warn", | ||
"asc", | ||
{ "caseSensitive": true, "natural": false, "minKeys": 2 } | ||
], | ||
"sort-keys": ["warn", "asc", { "caseSensitive": true, "natural": false, "minKeys": 2 }], | ||
"typescript-sort-keys/interface": "warn", | ||
"typescript-sort-keys/string-enum": "warn", | ||
"sort-keys-fix/sort-keys-fix": "warn", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ "argsIgnorePattern": "^_" } | ||
], | ||
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"quotes": [2, "single", "avoid-escape"], | ||
|
@@ -85,11 +65,35 @@ | |
"max-lines": ["error", { "max": 512, "skipBlankLines": true }], | ||
"max-nested-callbacks": ["error", 6], | ||
"import/no-named-as-default": ["off"], | ||
"import/no-self-import": ["warn"], | ||
"import/no-absolute-path": ["warn"], | ||
"import/no-internal-modules": [ "off", { | ||
"allow": [ | ||
"react-icons/*", | ||
"*/img/**", | ||
"source-map-support/*", | ||
"lodash/*", | ||
"@material-ui/**", | ||
"aws-sdk/**", | ||
"firebase/**", | ||
"@ethersproject/**", | ||
"aos/**", | ||
"filepond*/**", | ||
"pure-react-carousel/**", | ||
"mapbox-gl/**", | ||
"react-share/**", | ||
"sdk-xyoworld-typechain/**", | ||
"react-git-info/**", | ||
"react-player/**" | ||
] | ||
} ], | ||
"import/no-restricted-paths": ["warn"], | ||
"import/namespace": ["warn"], | ||
"import/no-cycle": ["warn"], | ||
"import/no-useless-path-segments": ["warn"], | ||
"simple-import-sort/sort": ["error"] | ||
"simple-import-sort/imports": ["warn"], | ||
"simple-import-sort/exports": ["warn"], | ||
"workspaces/no-relative-imports": ["off"], | ||
"workspaces/no-absolute-imports": ["off"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
/* | ||
* File: defaultResolvers.ts | ||
* Project: @xyo-network/sdk-core-nodejs | ||
* File Created: Friday, 13th November 2020 2:22:50 pm | ||
* Author: XYO Development Team ([email protected]) | ||
* ----- | ||
* Last Modified: Friday, 13th November 2020 2:30:21 pm | ||
* Modified By: XYO Development Team ([email protected]>) | ||
* ----- | ||
* Copyright 2017 - 2020 XY - The Persistent Company | ||
*/ | ||
|
||
import { XyoObjectSchema } from '../../schema' | ||
import { | ||
boundWitnessResolver, | ||
bridgeHashSetResolver, | ||
fetterResolver, | ||
gpsResolver, | ||
indexResolver, | ||
keySetResolver, | ||
latResolver, | ||
lngResolver, | ||
paymentKeyResolver, | ||
previousHashResolver, | ||
rsaPublicKeyResolver, | ||
rsaSignatureResolver, | ||
rssiAt1MResolver, | ||
rssiResolver, | ||
secp256K1PublicKeyResolver, | ||
secp256K1SignatureResolver, | ||
sha3Resolver, | ||
sha256Resolver, | ||
signatureSetResolver, | ||
stubHashResolver, | ||
stubPublicKey, | ||
stubSignatureResolver, | ||
timeResolver, | ||
witnessResolver, | ||
} from './resolvers' | ||
|
||
const defaultResolvers = [ | ||
{ | ||
id: XyoObjectSchema.BLE_POWER_LEVEL.id, | ||
resolver: rssiAt1MResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.EC_PUBLIC_KEY.id, | ||
resolver: secp256K1PublicKeyResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.EC_SIGNATURE.id, | ||
resolver: secp256K1SignatureResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.INDEX.id, | ||
resolver: indexResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.LAT.id, | ||
resolver: latResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.LNG.id, | ||
resolver: lngResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.PAYMENT_KEY.id, | ||
resolver: paymentKeyResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.RSA_PUBLIC_KEY.id, | ||
resolver: rsaPublicKeyResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.RSA_SIGNATURE.id, | ||
resolver: rsaSignatureResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.RSSI.id, | ||
resolver: rssiResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.SHA_256.id, | ||
resolver: sha256Resolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.SHA_3.id, | ||
resolver: sha3Resolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.STUB_HASH.id, | ||
resolver: stubHashResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.STUB_PUBLIC_KEY.id, | ||
resolver: stubPublicKey, | ||
}, | ||
{ | ||
id: XyoObjectSchema.STUB_SIGNATURE.id, | ||
resolver: stubSignatureResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.UNIX_TIME.id, | ||
resolver: timeResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.GPS.id, | ||
resolver: gpsResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.BW.id, | ||
resolver: boundWitnessResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.KEY_SET.id, | ||
resolver: keySetResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.SIGNATURE_SET.id, | ||
resolver: signatureSetResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.FETTER.id, | ||
resolver: fetterResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.WITNESS.id, | ||
resolver: witnessResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.PREVIOUS_HASH.id, | ||
resolver: previousHashResolver, | ||
}, | ||
{ | ||
id: XyoObjectSchema.BRIDGE_HASH_SET.id, | ||
resolver: bridgeHashSetResolver, | ||
}, | ||
] | ||
|
||
export default defaultResolvers |
Oops, something went wrong.