Skip to content

Commit

Permalink
Replace Exolix with ChangeNOW (#340)
Browse files Browse the repository at this point in the history
* Replace Exolix with ChangeNOW

Closes #339

* Fix issue with missing tests

---------

Co-authored-by: SondreB <sondre@outlook.com>
  • Loading branch information
missmeowness and sondreb authored Jun 25, 2023
1 parent f3c58a1 commit 412fc82
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 36 deletions.
11 changes: 10 additions & 1 deletion angular/src/app/exchange/exchange.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ <h1>{{ "Exchange.ExchangeCrypto" | translate }}</h1>

<p>{{ "Exchange.ExchangeCryptoDescription" | translate }}</p>

<p>
<!-- <p>
<button class="purchase-button" color="primary" mat-raised-button (click)="buy('', 'STRAX')"><mat-icon>currency_bitcoin</mat-icon>&nbsp;{{ "Exchange.ExchangeBTCForSTRAX" | translate }}</button>
</p>
<p>
<button class="purchase-button" color="primary" mat-raised-button (click)="sell('', 'STRAX')"><mat-icon>currency_bitcoin</mat-icon>&nbsp;{{ "Exchange.ExchangeSTRAXForBTC" | translate }}</button>
</p> -->

<p>
<button class="purchase-button" color="primary" mat-raised-button (click)="buyChangeNOW('', 'STRAX')"><mat-icon>currency_bitcoin</mat-icon>&nbsp;{{ "Exchange.ExchangeBTCForSTRAXChangeNOW" | translate }}</button>
</p>

<p>
<button class="purchase-button" color="primary" mat-raised-button (click)="sellChangeNOW('', 'STRAX')"><mat-icon>currency_bitcoin</mat-icon>&nbsp;{{ "Exchange.ExchangeSTRAXForBTCChangeNOW" | translate }}</button>
</p>


<br />
<h2>{{ "Exchange.Partners" | translate }}</h2>
<p><a href="https://exolix.com?ref=BcG9dcJcQqLeXPf5" target="_blank">Exolix</a></p>
Expand Down
10 changes: 10 additions & 0 deletions angular/src/app/exchange/exchange.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,14 @@ export class ExchangeComponent implements OnInit {
const network = this.networkLoader.getNetwork(networkType);
this.exchange.sellPopup(address, network, 200);
}

buyChangeNOW(address: string, networkType: string) {
const network = this.networkLoader.getNetwork(networkType);
this.exchange.popupChangeNOW(address, 'btc', network.symbol, 0.01);
}

sellChangeNOW(address: string, networkType: string) {
const network = this.networkLoader.getNetwork(networkType);
this.exchange.popupChangeNOW(address, network.symbol, 'btc', 200);
}
}
5 changes: 5 additions & 0 deletions angular/src/app/services/exchange.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ export class ExchangeService {
window.open(url, 'exolixPopup', 'height=820,width=600,left=200,top=200,resizable=yes,channelmode=yes,scrollbars=yes,toolbar=yes,menubar=no,location=yes,directories=no,status=yes');
}

popupChangeNOW(address: string, from: string, to: string, amount: number) {
const url = `https://changenow.app.link/referral?link_id=d10e70fc57c0e6&amount=${amount}&from=${from}&to=${to}`;
window.open(url, 'changeNOWPopup', 'height=820, width=600, left=200, top=200, resizable=yes, channelmode=yes, scrollbars=yes, toolbar=yes, menubar=no, location=yes, directories=no, status=yes')
}

purchasePopup(address: string, crypto: string, fiat: string, amount: string) {
const url = `https://www.coinvault.io/simplex/?crypto=${crypto}&fiat=${fiat}&amount=${amount}&wallet_address=${address}`;
window.open(url, 'simplexPopup', 'height=800,width=600,left=200,top=200,resizable=yes,channelmode=yes,scrollbars=yes,toolbar=yes,menubar=no,location=yes,directories=no,status=yes');
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@
"ExchangeCryptoDescription": "تبادل العملات المشفرة الحالية لعملة مشفرة أخرى.",
"ExchangeBTCForSTRAX": "تبادل BTC مقابل STRAX بواسطة Exolix",
"ExchangeSTRAXForBTC": "تبادل STRAX مقابل BTC بواسطة Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "الشركاء",
"PartnersDescription": "استخدام روابطنا وشركائنا المرتبطين، يساعد في دعم التطوير المستمر لهذه المحفظة."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@
"ExchangeCryptoDescription": "Exchange your existing cryptocurrency for other cryptocurrency.",
"ExchangeBTCForSTRAX": "Exchange BTC for STRAX with Exolix",
"ExchangeSTRAXForBTC": "Exchange STRAX for BTC with Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "Partners",
"PartnersDescription": "Using our links and affiliated partners, helps support the continued development of this wallet."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@
"ExchangeCryptoDescription": "Exchange your existing cryptocurrency for other cryptocurrency.",
"ExchangeBTCForSTRAX": "Exchange BTC for STRAX with Exolix",
"ExchangeSTRAXForBTC": "Exchange STRAX for BTC with Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "Partners",
"PartnersDescription": "Using our links and affiliated partners, helps support the continued development of this wallet."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@
"ExchangeCryptoDescription": "ارز دیجیتال موجود خود را با ارزهای دیجیتال دیگر مبادله کنید.",
"ExchangeBTCForSTRAX": "BTC را با STRAX با Exolix مبادله کنید",
"ExchangeSTRAXForBTC": "STRAX را با BTC با Exolix مبادله کنید",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "شرکا",
"PartnersDescription": "استفاده از پیوندها و شرکای وابسته ما، به حمایت از توسعه مداوم این کیف پول کمک می‌کند."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@
"ExchangeCryptoDescription": "Échangez votre cryptomonnaie existante contre d'autres cryptomonnaies.",
"ExchangeBTCForSTRAX": "Échanger du BTC contre du STRAX avec Exolix",
"ExchangeSTRAXForBTC": "Échanger du STRAX contre du BTC avec Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "Partenaires",
"PartnersDescription": "En utilisant nos liens et nos partenaires affiliés, vous contribuez au développement continu de ce portefeuille."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@
"ExchangeCryptoDescription": "Exchange your existing cryptocurrency for other cryptocurrency.",
"ExchangeBTCForSTRAX": "Exchange BTC for STRAX with Exolix",
"ExchangeSTRAXForBTC": "Exchange STRAX for BTC with Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "Partners",
"PartnersDescription": "Using our links and affiliated partners, helps support the continued development of this wallet."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@
"ExchangeCryptoDescription": "Exchange your existing cryptocurrency for other cryptocurrency.",
"ExchangeBTCForSTRAX": "Exchange BTC for STRAX with Exolix",
"ExchangeSTRAXForBTC": "Exchange STRAX for BTC with Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "Partners",
"PartnersDescription": "Using our links and affiliated partners, helps support the continued development of this wallet."
},
Expand Down
2 changes: 2 additions & 0 deletions angular/src/assets/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@
"ExchangeCryptoDescription": "Обменяйте свою существующую криптовалюту на другую криптовалюту.",
"ExchangeBTCForSTRAX": "Обменять BTC на STRAX с помощью Exolix",
"ExchangeSTRAXForBTC": "Обменять STRAX на BTC с помощью Exolix",
"ExchangeBTCForSTRAXChangeNOW": "Exchange BTC for STRAX with ChangeNOW",
"ExchangeSTRAXForBTCChangeNOW": "Exchange STRAX for BTC with ChangeNOW",
"Partners": "Партнёры",
"PartnersDescription": "Использование наших ссылок и связанных партнеров помогает поддерживать дальнейшее развитие этого кошелька."
},
Expand Down
70 changes: 35 additions & 35 deletions angular/src/shared/network-loader.spec.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import { NetworkLoader } from "./network-loader";
const axios = require('axios');
// import { NetworkLoader } from "./network-loader";
// const axios = require('axios');

describe('NetworkLoader', () => {
beforeEach(() => { });
// describe('NetworkLoader', () => {
// beforeEach(() => { });

// it('Should return random server', () => {
// // it('Should return random server', () => {

// const loader = new NetworkLoader();
// // const loader = new NetworkLoader();

// const servers = [
// loader.getServer('STRAX', 'group1'),
// loader.getServer('STRAX', 'group1'),
// loader.getServer('STRAX', 'group1'),
// loader.getServer('STRAX', 'group1'),
// loader.getServer('STRAX', 'group1')
// ];
// // const servers = [
// // loader.getServer('STRAX', 'group1'),
// // loader.getServer('STRAX', 'group1'),
// // loader.getServer('STRAX', 'group1'),
// // loader.getServer('STRAX', 'group1'),
// // loader.getServer('STRAX', 'group1')
// // ];

// // Get unique list of servers.
// var unique = [...new Set(servers)];
// // // Get unique list of servers.
// // var unique = [...new Set(servers)];

// // Expect more than a si1ngle one (then random has not worked well).
// expect(unique.length > 1).toBeTrue();
// });
// // // Expect more than a si1ngle one (then random has not worked well).
// // expect(unique.length > 1).toBeTrue();
// // });

// it('All indexers in group1 should respond', async () => {
// const servers = Servers.group1;
// const entries = Object.values(servers);
// // it('All indexers in group1 should respond', async () => {
// // const servers = Servers.group1;
// // const entries = Object.values(servers);

// for (var i = 0; i < entries.length; i++) {
// const entry = entries[i] as any;
// // for (var i = 0; i < entries.length; i++) {
// // const entry = entries[i] as any;

// for (var j = 0; j < entry.length; j++) {
// const server = entry[j];
// // for (var j = 0; j < entry.length; j++) {
// // const server = entry[j];

// try {
// var result = await axios.get(server + '/api/stats');
// expect(result.status).toBe(200);
// } catch (error) {
// throw new Error('Failed to verify indexer: ' + server);
// }
// }
// }
// });
// // try {
// // var result = await axios.get(server + '/api/stats');
// // expect(result.status).toBe(200);
// // } catch (error) {
// // throw new Error('Failed to verify indexer: ' + server);
// // }
// // }
// // }
// // });

});
// });

0 comments on commit 412fc82

Please sign in to comment.