You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

@yuants/app-account-composer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yuants/app-account-composer - npm Package Compare versions

Comparing version

to
0.1.3

import { formatTime } from '@yuants/data-model';
import { Terminal, provideAccountInfo, readDataRecords } from '@yuants/protocol';
import { Terminal, provideAccountInfo, readDataRecords, useAccountInfo } from '@yuants/protocol';
import Ajv from 'ajv';
import addFormats from 'ajv-formats';
import { combineLatest, defer, filter, groupBy, map, mergeMap, retry, shareReplay, tap, throttleTime, timeout, toArray, } from 'rxjs';
import { combineLatest, defer, filter, from, groupBy, map, mergeMap, retry, shareReplay, tap, throttleTime, timeout, toArray, } from 'rxjs';
import { acrSchema } from './model';

@@ -17,3 +17,3 @@ const TERMINAL_ID = process.env.TERMINAL_ID || `AccountComposer`;

.pipe(mergeMap((x) => x), groupBy((x) => x.target_account_id), mergeMap((group) => group.pipe(toArray(), tap((x) => {
const accountInfo$ = defer(() => combineLatest(x.map((y) => terminal.useAccountInfo(y.source_account_id).pipe(map((x) => {
const accountInfo$ = defer(() => combineLatest(x.map((y) => from(useAccountInfo(terminal, y.source_account_id)).pipe(map((x) => {
var _a, _b;

@@ -20,0 +20,0 @@ return (Object.assign(Object.assign({}, x), { money: Object.assign(Object.assign({}, x.money), { equity: x.money.equity * y.multiple, balance: x.money.balance * y.multiple, profit: x.money.profit * y.multiple, used: x.money.used * y.multiple, free: x.money.free * y.multiple }), currencies: (_b = (_a = x.currencies) === null || _a === void 0 ? void 0 : _a.map((c) => (Object.assign(Object.assign({}, c), { equity: c.equity * y.multiple, balance: c.balance * y.multiple, profit: c.profit * y.multiple, used: c.used * y.multiple, free: c.free * y.multiple })))) !== null && _b !== void 0 ? _b : [], positions: x.positions.map((p) => (Object.assign(Object.assign({}, p), { volume: p.volume * y.multiple, free_volume: p.free_volume * y.multiple, floating_profit: p.floating_profit * y.multiple }))) }));

@@ -22,3 +22,3 @@ "use strict";

.pipe((0, rxjs_1.mergeMap)((x) => x), (0, rxjs_1.groupBy)((x) => x.target_account_id), (0, rxjs_1.mergeMap)((group) => group.pipe((0, rxjs_1.toArray)(), (0, rxjs_1.tap)((x) => {
const accountInfo$ = (0, rxjs_1.defer)(() => (0, rxjs_1.combineLatest)(x.map((y) => terminal.useAccountInfo(y.source_account_id).pipe((0, rxjs_1.map)((x) => {
const accountInfo$ = (0, rxjs_1.defer)(() => (0, rxjs_1.combineLatest)(x.map((y) => (0, rxjs_1.from)((0, protocol_1.useAccountInfo)(terminal, y.source_account_id)).pipe((0, rxjs_1.map)((x) => {
var _a, _b;

@@ -25,0 +25,0 @@ return (Object.assign(Object.assign({}, x), { money: Object.assign(Object.assign({}, x.money), { equity: x.money.equity * y.multiple, balance: x.money.balance * y.multiple, profit: x.money.profit * y.multiple, used: x.money.used * y.multiple, free: x.money.free * y.multiple }), currencies: (_b = (_a = x.currencies) === null || _a === void 0 ? void 0 : _a.map((c) => (Object.assign(Object.assign({}, c), { equity: c.equity * y.multiple, balance: c.balance * y.multiple, profit: c.profit * y.multiple, used: c.used * y.multiple, free: c.free * y.multiple })))) !== null && _b !== void 0 ? _b : [], positions: x.positions.map((p) => (Object.assign(Object.assign({}, p), { volume: p.volume * y.multiple, free_volume: p.free_volume * y.multiple, floating_profit: p.floating_profit * y.multiple }))) }));

{
"name": "@yuants/app-account-composer",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/No-Trade-No-Life/Yuan/tree/main/apps/account-composer",

@@ -14,4 +14,4 @@ "main": "lib/index.js",

"@yuants/data-model": "0.11.0",
"@yuants/protocol": "0.19.1",
"@yuants/utils": "0.0.7",
"@yuants/protocol": "0.20.0",
"@yuants/utils": "0.1.0",
"ajv": "~8.12.0",

@@ -29,3 +29,3 @@ "ajv-formats": "~2.1.1",

"@types/node": "18",
"@yuants/extension": "0.2.5",
"@yuants/extension": "0.2.6",
"@yuants/tool-kit": "0.1.4",

@@ -32,0 +32,0 @@ "json-schema": "~0.4.0",

{
"apps/account-composer/CHANGELOG.json": "f62d31968947d0c314638f855136908dda04854c",
"apps/account-composer/CHANGELOG.md": "946588886d34be116cb06feee299b5dd96d70c74",
"apps/account-composer/CHANGELOG.json": "fbe46c263ba28427899c968286356c6aeb8f3ab0",
"apps/account-composer/CHANGELOG.md": "191c0fafc77593d1173a8417df3f76ac68e3226a",
"apps/account-composer/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",

@@ -10,5 +10,5 @@ "apps/account-composer/build/Dockerfile": "0eed60fa05de14a12334a511ed238c0145e1bc58",

"apps/account-composer/etc/app-account-composer.api.md": "9fa5948ef5fa994a0fedfd35679e2b9af1b45d16",
"apps/account-composer/package.json": "1cada0dd14228c5e10f8e9d65a96ba0e1c0b5e52",
"apps/account-composer/package.json": "51b30723f433f2c958b4f8877733fd1337ace9c6",
"apps/account-composer/src/extension.ts": "864da3fb84c03298264a817107979c28148668a4",
"apps/account-composer/src/index.ts": "45831f51f5b97e111c978bf23f4d3dd73156f912",
"apps/account-composer/src/index.ts": "9a8b96ba4e6569d719d047d2ba168b7a47871e1f",
"apps/account-composer/src/model.ts": "a32cd1eb90639d8dbf3836aa666938c68590e1bb",

@@ -18,6 +18,6 @@ "apps/account-composer/tsconfig.json": "22f94ca28b507f8ddcc21b9053158eefd3f726a9",

"libraries/data-model/temp/package-deps.json": "a3692590a12ff97935dc2433e14ee0b9e558bb32",
"libraries/protocol/temp/package-deps.json": "b8c94406ef23599d8b1896115952fd3c18e303b2",
"libraries/utils/temp/package-deps.json": "aeee880333dc0b06a12fa464f6f5a73cfca07066",
"libraries/extension/temp/package-deps.json": "2ca5df8341720905bf8b2e6a46a05121ac53ef0d",
"libraries/protocol/temp/package-deps.json": "c5ba112d182f1337e4c8f5797e16c963c57166ae",
"libraries/utils/temp/package-deps.json": "ab86c7fd02dab8f99b0fadeff541e74e331ba294",
"libraries/extension/temp/package-deps.json": "7e271ad902144bc72bbdd5b3317e047333960dc7",
"tools/toolkit/temp/package-deps.json": "2875da6fe1d56cb58277b3dc53a29322a6f73957"
}

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