Skip to content

Commit

Permalink
Updated orders grid without rererendering rows.
Browse files Browse the repository at this point in the history
████ ███  To request new features or in case this commit breaks something for you,
████ ███  please, create a new github issue with all possible information for me,
▓███▀█▄   but never share your API Keys!
▒▓██ ███
░▒▓█ ███  Signed-off-by: Carles Tubio <ctubio@users.noreply.github.com>
 _________________________________________
/ Hello, WORLD!                           \
|                                         |
\ pssst.. 1.00000000 BTC = 61581.69 EUR.  /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
  • Loading branch information
ctubio committed Oct 15, 2024
1 parent b3dfb77 commit 59094c9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ K ?= K.sh
MAJOR = 0
MINOR = 7
PATCH = 0
BUILD = 34
BUILD = 35

OBLIGATORY = DISCLAIMER: This is strict non-violent software: \n$\
if you hurt other living creatures, please stop; \n$\
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ Pull Requests are welcome, but adhere to the Contributor License Agreement:
We have already enough policemen,<br />if you like adventures choose to be a <a href="https://youtu.be/pT_GM35fM7I">brave firefighter</a>.
<br /><br /><br /><br /><br />
<img src="https://user-images.githubusercontent.com/1634027/32695988-22681724-c76b-11e7-8557-7f2b15b2686b.jpg" />
<br /><br /><br /><br />Violence <a href="https://www.cnvc.org/learn-nvc/what-is-nvc">should not</a> be the answer to those who<br />are <a href="https://novact.org/about-us/activities/?lang=en">asking for</a> freedom.<br /><br /><br /><br /><br />
<br /><br /><br /><br />Violence <a href="https://www.cnvc.org/about/purpose-of-nvc">should not</a> be the answer to those who<br />are <a href="https://novact.org/en/">asking for</a> freedom.<br /><br /><br /><br /><br />
<img src="https://user-images.githubusercontent.com/1634027/29746351-7478d556-8ad7-11e7-8b27-445eefa8f960.jpg" />
<br /><br /><br /><br /><br />
<a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fctubio%2FKrypto-trading-bot%2FREADME.md&count_bg=%2379C83D&title_bg=%23555555&icon=known.svg&icon_color=%2306FF18&title=page+views&edge_flat=false"/></a></p>
20 changes: 15 additions & 5 deletions src/bin/+portfolios/+portfolios.client/Orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class OrdersComponent {
rowHeight:35,
headerHeight:35,
domLayout: 'autoHeight',
getRowId: (params: any) => params.data.exchangeId,
isExternalFilterPresent: () => !!this.filter,
doesExternalFilterPass: (node) => (
!this.filter || node.data.symbol == this.filter
Expand Down Expand Up @@ -193,11 +194,20 @@ export class OrdersComponent {
private addRowData = (o: Models.Order[]) => {
if (!this.api) return;

var add = [];
this.symbols.forEach(s => s.bids = s.asks = 0);

var add: any[] = [],
update: any[] = [],
remove: any[] = [];

this.api.forEachNode((rowNode, index) => {
remove.push({exchangeId: rowNode.data.exchangeId});
});

o.forEach(o => {
add.push({
(remove.filter(x => x.exchangeId == o.exchangeId).length
? update : add
).push({
symbol: o.symbol,
orderId: o.orderId,
exchangeId: o.exchangeId,
Expand All @@ -212,12 +222,12 @@ export class OrdersComponent {
time: o.time
});

remove = remove.filter(x => x.exchangeId != o.exchangeId);

this.addSymbol(o.symbol, o.side);
});

this.api.setGridOption('rowData', []);

if (add.length) this.api.applyTransaction({add: add});
this.api.applyTransaction({add, update, remove});

if (!this.filter && this.symbols.length) {
this.applyFilter(this.symbols[0].symbol)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Krypto.ninja-apis.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ class GwApiWsFix: public GwApiWs,
};
protected:
//BO non-free Gw class member functions from lib build-*/lib/K-*.a (it just redefines all virtual gateway functions below).
/**/ virtual string token(const string &crud = "", const string &url = "") const = 0; // return logon message.
/**/ virtual string token(const string &crud = "", const string &url = "") const = 0; // return jwt token.
//EO non-free Gw class member functions from lib build-*/lib/K-*.a (it just redefines all virtual gateway functions above).
string nonce() const override {
return Random::char16Id();
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Krypto.ninja-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ export define PACKAGE_JSON
"@angular/platform-browser": "^18.2.7",
"@angular/platform-browser-dynamic": "^18.2.7",
"@angular/router": "^18.2.7",
"@types/node": "^22.7.4",
"@types/node": "^22.7.5",
"ag-grid-angular": "^32.2.2",
"ag-grid-community": "^32.2.2",
"esbuild": "^0.24.0",
"highcharts": "^11.4.8",
"highcharts-angular": "^4.0.1",
"rxjs": "^7.8.1",
"sass": "^1.79.4",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"uglify-js": "^3.19.3",
"zone.js": "^0.14.10"
},
Expand Down

0 comments on commit 59094c9

Please sign in to comment.