Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@energyweb/exchange-client

Package Overview
Dependencies
Maintainers
7
Versions
472
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@energyweb/exchange-client - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5-alpha.1631706872.0

CHANGELOG.md

383

dist/js/api.d.ts

@@ -23,6 +23,6 @@ /**

*
* @type {object}
* @type {Asset}
* @memberof AccountAssetDTO
*/
asset: object;
asset: Asset;
/**

@@ -70,2 +70,45 @@ *

* @export
* @interface Asset
*/
export interface Asset {
/**
*
* @type {string}
* @memberof Asset
*/
id: string;
/**
*
* @type {string}
* @memberof Asset
*/
address: string;
/**
*
* @type {string}
* @memberof Asset
*/
tokenId: string;
/**
*
* @type {string}
* @memberof Asset
*/
deviceId: string;
/**
*
* @type {string}
* @memberof Asset
*/
generationFrom: string;
/**
*
* @type {string}
* @memberof Asset
*/
generationTo: string;
}
/**
*
* @export
* @interface AssetDTO

@@ -114,2 +157,88 @@ */

* @export
* @interface Bundle
*/
export interface Bundle {
/**
*
* @type {string}
* @memberof Bundle
*/
id: string;
/**
*
* @type {string}
* @memberof Bundle
*/
userId: string;
/**
*
* @type {number}
* @memberof Bundle
*/
price: number;
/**
*
* @type {boolean}
* @memberof Bundle
*/
isCancelled: boolean;
/**
*
* @type {Array<BundleItem>}
* @memberof Bundle
*/
items: Array<BundleItem>;
/**
*
* @type {string}
* @memberof Bundle
*/
available: string;
/**
*
* @type {string}
* @memberof Bundle
*/
volume: string;
}
/**
*
* @export
* @interface BundleItem
*/
export interface BundleItem {
/**
*
* @type {string}
* @memberof BundleItem
*/
id: string;
/**
*
* @type {Asset}
* @memberof BundleItem
*/
asset: Asset;
/**
*
* @type {string}
* @memberof BundleItem
*/
startVolume: string;
/**
*
* @type {string}
* @memberof BundleItem
*/
currentVolume: string;
/**
*
* @type {Bundle}
* @memberof BundleItem
*/
bundle: Bundle;
}
/**
*
* @export
* @interface BundleItemDTO

@@ -134,2 +263,70 @@ */

* @export
* @interface BundlePublicDTO
*/
export interface BundlePublicDTO {
/**
*
* @type {string}
* @memberof BundlePublicDTO
*/
id: string;
/**
*
* @type {Array<BundlePublicItemDTO>}
* @memberof BundlePublicDTO
*/
items: Array<BundlePublicItemDTO>;
/**
*
* @type {string}
* @memberof BundlePublicDTO
*/
available: string;
/**
*
* @type {string}
* @memberof BundlePublicDTO
*/
volume: string;
/**
*
* @type {string}
* @memberof BundlePublicDTO
*/
price: string;
}
/**
*
* @export
* @interface BundlePublicItemDTO
*/
export interface BundlePublicItemDTO {
/**
*
* @type {string}
* @memberof BundlePublicItemDTO
*/
id: string;
/**
*
* @type {Asset}
* @memberof BundlePublicItemDTO
*/
asset: Asset;
/**
*
* @type {string}
* @memberof BundlePublicItemDTO
*/
startVolume: string;
/**
*
* @type {string}
* @memberof BundlePublicItemDTO
*/
currentVolume: string;
}
/**
*
* @export
* @interface BundleSplitDTO

@@ -192,2 +389,58 @@ */

* @export
* @interface BundleTrade
*/
export interface BundleTrade {
/**
*
* @type {string}
* @memberof BundleTrade
*/
id: string;
/**
*
* @type {string}
* @memberof BundleTrade
*/
buyerId: string;
/**
*
* @type {string}
* @memberof BundleTrade
*/
volume: string;
/**
*
* @type {Bundle}
* @memberof BundleTrade
*/
bundle: Bundle;
/**
*
* @type {Array<BundleTradeItemDTO>}
* @memberof BundleTrade
*/
items: Array<BundleTradeItemDTO>;
}
/**
*
* @export
* @interface BundleTradeItemDTO
*/
export interface BundleTradeItemDTO {
/**
*
* @type {number}
* @memberof BundleTradeItemDTO
*/
assetId: number;
/**
*
* @type {string}
* @memberof BundleTradeItemDTO
*/
volume: string;
}
/**
*
* @export
* @interface BuyBundleDTO

@@ -375,2 +628,86 @@ */

* @export
* @interface Transfer
*/
export interface Transfer {
/**
*
* @type {string}
* @memberof Transfer
*/
id: string;
/**
*
* @type {string}
* @memberof Transfer
*/
userId: string;
/**
*
* @type {Asset}
* @memberof Transfer
*/
asset: Asset;
/**
*
* @type {string}
* @memberof Transfer
*/
amount: string;
/**
*
* @type {string}
* @memberof Transfer
*/
transactionHash: string;
/**
*
* @type {string}
* @memberof Transfer
*/
address: string;
/**
*
* @type {TransferStatus}
* @memberof Transfer
*/
status: TransferStatus;
/**
*
* @type {number}
* @memberof Transfer
*/
confirmationBlock: number;
/**
*
* @type {TransferDirection}
* @memberof Transfer
*/
direction: TransferDirection;
}
/**
*
* @export
* @enum {string}
*/
export declare enum TransferDirection {
Deposit = "Deposit",
Withdrawal = "Withdrawal",
Claim = "Claim",
Send = "Send"
}
/**
*
* @export
* @enum {string}
*/
export declare enum TransferStatus {
Unknown = "Unknown",
Accepted = "Accepted",
Unconfirmed = "Unconfirmed",
Confirmed = "Confirmed",
Error = "Error"
}
/**
*
* @export
* @interface UpdateSupplyDto

@@ -644,3 +981,3 @@ */

*/
buyBundle(buyBundleDTO: BuyBundleDTO, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
buyBundle(buyBundleDTO: BuyBundleDTO, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BundleTrade>>;
/**

@@ -652,3 +989,3 @@ *

*/
cancelBundle(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
cancelBundle(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Bundle>>;
/**

@@ -660,3 +997,3 @@ *

*/
createBundle(createBundleDTO: CreateBundleDTO, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
createBundle(createBundleDTO: CreateBundleDTO, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Bundle>>;
/**

@@ -667,3 +1004,3 @@ *

*/
getAvailableBundles(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<object>>>;
getAvailableBundles(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<BundlePublicDTO>>>;
/**

@@ -674,3 +1011,3 @@ *

*/
getMyBundles(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<object>>>;
getMyBundles(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Bundle>>>;
/**

@@ -681,3 +1018,3 @@ *

*/
getMyTrades(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<object>>>;
getMyTrades(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<BundleTrade>>>;
};

@@ -702,3 +1039,3 @@ /**

*/
buyBundle(buyBundleDTO: BuyBundleDTO, options?: any): AxiosPromise<object>;
buyBundle(buyBundleDTO: BuyBundleDTO, options?: any): AxiosPromise<BundleTrade>;
/**

@@ -710,3 +1047,3 @@ *

*/
cancelBundle(id: string, options?: any): AxiosPromise<object>;
cancelBundle(id: string, options?: any): AxiosPromise<Bundle>;
/**

@@ -718,3 +1055,3 @@ *

*/
createBundle(createBundleDTO: CreateBundleDTO, options?: any): AxiosPromise<object>;
createBundle(createBundleDTO: CreateBundleDTO, options?: any): AxiosPromise<Bundle>;
/**

@@ -725,3 +1062,3 @@ *

*/
getAvailableBundles(options?: any): AxiosPromise<Array<object>>;
getAvailableBundles(options?: any): AxiosPromise<Array<BundlePublicDTO>>;
/**

@@ -732,3 +1069,3 @@ *

*/
getMyBundles(options?: any): AxiosPromise<Array<object>>;
getMyBundles(options?: any): AxiosPromise<Array<Bundle>>;
/**

@@ -739,3 +1076,3 @@ *

*/
getMyTrades(options?: any): AxiosPromise<Array<object>>;
getMyTrades(options?: any): AxiosPromise<Array<BundleTrade>>;
};

@@ -764,3 +1101,3 @@ /**

*/
buyBundle(buyBundleDTO: BuyBundleDTO, options?: any): Promise<import("axios").AxiosResponse<object>>;
buyBundle(buyBundleDTO: BuyBundleDTO, options?: any): Promise<import("axios").AxiosResponse<BundleTrade>>;
/**

@@ -773,3 +1110,3 @@ *

*/
cancelBundle(id: string, options?: any): Promise<import("axios").AxiosResponse<object>>;
cancelBundle(id: string, options?: any): Promise<import("axios").AxiosResponse<Bundle>>;
/**

@@ -782,3 +1119,3 @@ *

*/
createBundle(createBundleDTO: CreateBundleDTO, options?: any): Promise<import("axios").AxiosResponse<object>>;
createBundle(createBundleDTO: CreateBundleDTO, options?: any): Promise<import("axios").AxiosResponse<Bundle>>;
/**

@@ -790,3 +1127,3 @@ *

*/
getAvailableBundles(options?: any): Promise<import("axios").AxiosResponse<object[]>>;
getAvailableBundles(options?: any): Promise<import("axios").AxiosResponse<BundlePublicDTO[]>>;
/**

@@ -798,3 +1135,3 @@ *

*/
getMyBundles(options?: any): Promise<import("axios").AxiosResponse<object[]>>;
getMyBundles(options?: any): Promise<import("axios").AxiosResponse<Bundle[]>>;
/**

@@ -806,3 +1143,3 @@ *

*/
getMyTrades(options?: any): Promise<import("axios").AxiosResponse<object[]>>;
getMyTrades(options?: any): Promise<import("axios").AxiosResponse<BundleTrade[]>>;
}

@@ -1030,3 +1367,3 @@ /**

*/
getMyTransfers(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<object>>>;
getMyTransfers(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Transfer>>>;
/**

@@ -1071,3 +1408,3 @@ *

*/
getMyTransfers(options?: any): AxiosPromise<Array<object>>;
getMyTransfers(options?: any): AxiosPromise<Array<Transfer>>;
/**

@@ -1115,3 +1452,3 @@ *

*/
getMyTransfers(options?: any): Promise<import("axios").AxiosResponse<object[]>>;
getMyTransfers(options?: any): Promise<import("axios").AxiosResponse<Transfer[]>>;
/**

@@ -1118,0 +1455,0 @@ *

59

dist/js/common.js

@@ -15,2 +15,11 @@ "use strict";

*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -39,9 +48,11 @@ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;

*/
const setApiKeyToObject = async function (object, keyParamName, configuration) {
if (configuration && configuration.apiKey) {
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
? await configuration.apiKey(keyParamName)
: await configuration.apiKey;
object[keyParamName] = localVarApiKeyValue;
}
const setApiKeyToObject = function (object, keyParamName, configuration) {
return __awaiter(this, void 0, void 0, function* () {
if (configuration && configuration.apiKey) {
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
? yield configuration.apiKey(keyParamName)
: yield configuration.apiKey;
object[keyParamName] = localVarApiKeyValue;
}
});
};

@@ -63,9 +74,11 @@ exports.setApiKeyToObject = setApiKeyToObject;

*/
const setBearerAuthToObject = async function (object, configuration) {
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
object["Authorization"] = "Bearer " + accessToken;
}
const setBearerAuthToObject = function (object, configuration) {
return __awaiter(this, void 0, void 0, function* () {
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? yield configuration.accessToken()
: yield configuration.accessToken;
object["Authorization"] = "Bearer " + accessToken;
}
});
};

@@ -77,9 +90,11 @@ exports.setBearerAuthToObject = setBearerAuthToObject;

*/
const setOAuthToObject = async function (object, name, scopes, configuration) {
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? await configuration.accessToken(name, scopes)
: await configuration.accessToken;
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
const setOAuthToObject = function (object, name, scopes, configuration) {
return __awaiter(this, void 0, void 0, function* () {
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? yield configuration.accessToken(name, scopes)
: yield configuration.accessToken;
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
});
};

@@ -129,3 +144,3 @@ exports.setOAuthToObject = setOAuthToObject;

return (axios = globalAxios, basePath = BASE_PATH) => {
const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
return axios.request(axiosRequestArgs);

@@ -132,0 +147,0 @@ };

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -14,12 +23,13 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const Yaml = require('json-to-pretty-yaml');
const generateSchema = async () => {
const moduleFixture = await testing_1.Test.createTestingModule({
const generateSchema = () => __awaiter(void 0, void 0, void 0, function* () {
var _a, _b, _c, _d, _e;
const moduleFixture = yield testing_1.Test.createTestingModule({
imports: [
typeorm_1.TypeOrmModule.forRoot({
type: 'postgres',
host: process.env.DB_HOST ?? 'localhost',
port: Number(process.env.DB_PORT) ?? 5432,
username: process.env.DB_USERNAME ?? 'postgres',
password: process.env.DB_PASSWORD ?? 'postgres',
database: process.env.DB_DATABASE ?? 'origin',
host: (_a = process.env.DB_HOST) !== null && _a !== void 0 ? _a : 'localhost',
port: (_b = Number(process.env.DB_PORT)) !== null && _b !== void 0 ? _b : 5432,
username: (_c = process.env.DB_USERNAME) !== null && _c !== void 0 ? _c : 'postgres',
password: (_d = process.env.DB_PASSWORD) !== null && _d !== void 0 ? _d : 'postgres',
database: (_e = process.env.DB_DATABASE) !== null && _e !== void 0 ? _e : 'origin',
entities: exchange_1.entities,

@@ -44,7 +54,7 @@ logging: ['info']

fs_1.default.writeFileSync('./src/schema.yaml', Yaml.stringify(document));
};
});
exports.generateSchema = generateSchema;
(async () => {
await (0, exports.generateSchema)();
})();
(() => __awaiter(void 0, void 0, void 0, function* () {
yield (0, exports.generateSchema)();
}))();
//# sourceMappingURL=generateSchema.js.map
{
"name": "@energyweb/exchange-client",
"version": "0.1.4",
"version": "0.1.5-alpha.1631706872.0",
"description": "Client library interacting with the Exchange",

@@ -26,17 +26,17 @@ "homepage": "https://github.com/energywebfoundation/origin/tree/master/packages/exchange-client#readme",

"dependencies": {
"axios": "0.21.1"
"axios": "0.21.4"
},
"devDependencies": {
"@energyweb/exchange": "1.10.0",
"@energyweb/exchange": "1.10.1-alpha.1631706872.0",
"@nestjs/swagger": "4.8.2",
"@nestjs/testing": "7.6.18",
"@nestjs/typeorm": "7.1.5",
"@openapitools/openapi-generator-cli": "2.3.10",
"@openapitools/openapi-generator-cli": "2.4.2",
"@types/mocha": "9.0.0",
"@types/node": "14.17.12",
"@types/node": "14.17.15",
"json-to-pretty-yaml": "1.2.2",
"mocha": "9.1.1",
"prettier": "2.3.2",
"prettier": "2.4.0",
"ts-node": "9.1.1",
"typescript": "4.4.2"
"typescript": "4.4.3"
},

@@ -50,3 +50,3 @@ "publishConfig": {

],
"gitHead": "85535e1d733ff086bba0778374bf61954443aecb"
"gitHead": "7cff966958a6bed7926776c5d87ddc2dff7aeaf3"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc