mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 14:42:38 +03:00
3263
package-lock.json
generated
3263
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
25
package.json
25
package.json
@@ -1,16 +1,19 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.2.5",
|
||||
"version": "0.2.6",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"main": "./lib/umd/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
"types": "./lib/esm/index.d.ts",
|
||||
"scripts": {
|
||||
"start": "npm run build-ts && node lib/index.js",
|
||||
"start": "npm run build && node lib/esm/index.js",
|
||||
"develop": "concurrently -i -k -p \"[{name}]\" -n \"Node,TypeScript\" -c \"yellow.bold,cyan.bold\" \"yarn watch-js\" \"yarn watch-ts\"",
|
||||
"clean": "rimraf lib/*",
|
||||
"build-ts": "npm run typechain:generate-types && tsc --skipLibCheck",
|
||||
"watch-ts": "npm run typechain:generate-types && tsc -w --skipLibCheck",
|
||||
"watch-js": "nodemon lib/index.js",
|
||||
"watch-js": "nodemon lib/esm/index.js",
|
||||
"prepare": "npm run build",
|
||||
"prebuild": "npm run typechain:generate-types && tsc",
|
||||
"build": "webpack",
|
||||
"test": "exit 0",
|
||||
"coverage": "jest --coverage",
|
||||
"lint:eslint": "eslint ./src --ext .ts,.js,.tsx,.jsx",
|
||||
@@ -44,25 +47,33 @@
|
||||
"@types/ws": "^8.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
||||
"@typescript-eslint/parser": "^5.16.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-loader": "^8.2.5",
|
||||
"concurrently": "^7.0.0",
|
||||
"eslint": "^8.12.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"husky": "^7.0.4",
|
||||
"jest": "^27.5.1",
|
||||
"ts-loader": "^9.2.8",
|
||||
"typechain": "^8.0.0",
|
||||
"typescript": "^4.5.3"
|
||||
"typescript": "^4.6.3",
|
||||
"webpack": "^5.72.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ethersproject/abstract-signer": "^5.6.0",
|
||||
"@ethersproject/providers": "^5.6.2",
|
||||
"bignumber.js": "^9.0.2",
|
||||
"buffer": "^6.0.3",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
"csprng": "^0.1.2",
|
||||
"ethers": "^5.6.2",
|
||||
"isomorphic-ws": "^4.0.1",
|
||||
"just-clone": "^5.0.1",
|
||||
"node-fetch": "^2.6.7",
|
||||
"socket.io-client": "2.4.0",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"tiny-invariant": "^1.2.0",
|
||||
"uuid": "^8.3.2",
|
||||
"websocket-heartbeat-js": "^1.1.0",
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class OrionUnit {
|
||||
this.env = env;
|
||||
this.apiUrl = apiUrl;
|
||||
|
||||
this.orionBlockchain = new OrionBlockchain(apiUrl, chainId);
|
||||
this.orionBlockchain = new OrionBlockchain(apiUrl);
|
||||
this.orionAggregator = new OrionAggregator(apiUrl, chainId);
|
||||
this.priceFeed = new PriceFeed(apiUrl);
|
||||
this.exchange = new Exchange(this);
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
import { OrionBlockchainSocketIO } from './ws';
|
||||
import redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema';
|
||||
import { SupportedChainId } from '../../types';
|
||||
import { utils } from '../..';
|
||||
|
||||
interface IAdminAuthHeaders {
|
||||
@@ -54,10 +53,7 @@ class OrionBlockchain {
|
||||
|
||||
readonly ws: OrionBlockchainSocketIO;
|
||||
|
||||
constructor(
|
||||
apiUrl: string,
|
||||
chainId: SupportedChainId,
|
||||
) {
|
||||
constructor(apiUrl: string) {
|
||||
this.apiUrl = apiUrl;
|
||||
this.ws = new OrionBlockchainSocketIO(`https://${apiUrl}/`);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"files": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"include": [
|
||||
"src"
|
||||
"./src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
@@ -17,8 +20,10 @@
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
/* Language and Environment */
|
||||
"target": "es2018", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
// "lib": [
|
||||
// "",
|
||||
// ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
@@ -48,9 +53,9 @@
|
||||
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
||||
"outDir": "./lib", /* Specify an output folder for all emitted files. */
|
||||
"outDir": "./lib/esm", /* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
@@ -66,7 +71,7 @@
|
||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||
// "declarationDir": "./lib/typings/", /* Specify the output directory for generated declaration files. */
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
@@ -75,7 +80,7 @@
|
||||
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||
/* Type Checking */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
||||
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
||||
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
||||
@@ -83,8 +88,8 @@
|
||||
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
||||
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
||||
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
||||
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
||||
"noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
||||
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
||||
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||
|
||||
26
webpack.config.js
Normal file
26
webpack.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
index: path.resolve(__dirname, "./lib/esm/index.js")
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, "./lib/umd"), // builds to ./lib/umd/
|
||||
filename: "[name].js", // index.js
|
||||
library: "orionprotocol", // aka window.myLibrary
|
||||
libraryTarget: "umd", // supports commonjs, amd and web browsers
|
||||
globalObject: "this"
|
||||
},
|
||||
module: {
|
||||
rules: [{ test: /\.t|js$/, use: "babel-loader" }]
|
||||
},
|
||||
resolve: {
|
||||
fallback: {
|
||||
"crypto": require.resolve("crypto-browserify"),
|
||||
"buffer": require.resolve("buffer/"),
|
||||
"stream": require.resolve("stream-browserify"),
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user