Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Geneste committed Apr 29, 2021
2 parents d14f38d + 69c5c11 commit 9e681f8
Show file tree
Hide file tree
Showing 20 changed files with 186 additions and 86 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecto",
"version": "1.1.3",
"version": "1.1.4",
"private": true,
"scripts": {
"build": "vue-cli-service build",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "异链传送",
"sameChain": "同链传送",
"sendOn": "发送到",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "已选择",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "CROSS CHAIN ÜBERWEISUNGEN",
"sameChain": "ÜBERWEISUNGEN AUF GLEICHER CHAIN",
"sendOn": "Versand auf",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "ausgewählt",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "CROSS CHAIN TRANSFERS",
"sameChain": "SAME CHAIN TRANSFERS",
"sendOn": "Send on",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "selected",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "TRANSFERENCIA ENTRE CHAINS",
"sameChain": "TRANSFERENCIA NORMAL",
"sendOn": "Enviar en",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "seleccionado",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "TRANSFERTS INTER CHAINES",
"sameChain": "TRANSFERTS INTRA CHAINES",
"sendOn": "Envoi vers",
"cosmicSwap": "Vous n'avez pas assez de KCAL pour effectuer cette transaction. Désirez-vous utiliser des SOUL pour effectuer un cosmic swap?"
"cosmicSwap": "Vous n'avez pas assez de KCAL pour effectuer cette transaction. Désirez-vous utiliser des SOUL pour effectuer un cosmic swap?",
"viewOnExplorer": "voir adresse sur explorateur"
},
"nfts": {
"selected": "sélectionné",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "TRASFERIMENTI CROSS-CHAIN",
"sameChain": "TRASFERIMENTI SU CHAIN SINGOLA",
"sendOn": "Manda su",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "selezionato",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "OVERFØRING MELLOM ULIKE BLOKKKJEDER",
"sameChain": "SEND PÅ SAMME BLOKKJEDE",
"sendOn": "Send på",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "valgte",
Expand Down
25 changes: 13 additions & 12 deletions src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"minted": "Minted",
"sent": "Verstuurd",
"sentTo": "Verstuurd naar",
"burned": "Burned",
"burned": "Verbrand",
"claimed": "Claimed",
"paid": "Betaald",
"received": "Ontvangen",
Expand Down Expand Up @@ -87,7 +87,7 @@
"claim": "Claim",
"view": "Bekijk",
"send": "Verstuur",
"burn": "Burn",
"burn": "Verbrand",
"load": "Laad meer",
"agree": "Eens",
"disagree": "Oneens",
Expand All @@ -97,11 +97,11 @@
"removeStakes": "Verwijder Stakes",
"sendAmount": "Verstuur Aantal",
"sendAmount2": "Welk aantal wil je versturen?",
"burnAmount": "Burn Amount",
"burnAmount2": "How many do you want to burn?",
"burnConfirmation": "Burn Confirmation",
"burnConfirmation1": "Please confirm that you are going to burn",
"burnConfirmation2": "<br><br><b>IMPORTANT NOTE:</b> this is definitive and irreversible.",
"burnAmount": "Aantal verbrand",
"burnAmount2": "Welk aantal wil je verbranden?",
"burnConfirmation": "Verbrand Bevestiging",
"burnConfirmation1": "Bevestig de verbranding",
"burnConfirmation2": "<br><br><b>IMPORTANT NOTE:</b> dit is definitief en onomkeerbaar.",
"remaining": "Restant",
"next": "Verder",
"insertWIF": "Type jouw WIF in om een transactie goed te keuren.",
Expand Down Expand Up @@ -136,7 +136,7 @@
"swap": "verwissel",
"swapUppercase": "Verwissel",
"swapHowMany": "Welk aantal wil je verwisselen?",
"swapFrom": "Swap van",
"swapFrom": "Verwissel van",
"noSwapsNEO": "Er zijn geen bezittingen aan de NEO kant van jouw wallet die verwisseld kunnen worden.",
"noSwapsETH": "Er zijn geen bezittingen aan de Ethereum kant van jouw wallet die verwisseld kunnen worden.",
"sendAssetsSwap": "Stuur de bezittingen die je wilt verwisselen naar",
Expand Down Expand Up @@ -184,14 +184,15 @@
"crossChain": "OVERDRACHTEN TUSSEN CHAINS",
"sameChain": "OVERDRACHTEN OP DEZELFDE CHAIN",
"sendOn": "Verstuur op",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "Onvoldoende KCAL om deze transactie uit te voeren. Gebruik SOUL voor deze transactie?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "gekozen",
"send": "stuur NFT's",
"burn": "burn nfts",
"burnTitle": "Burn NFTs",
"confirmBurn": "Bevestig burn",
"burn": "verbrand nfts",
"burnTitle": "Verbrand NFTs",
"confirmBurn": "Bevestig verbranding",
"confirmBurnSecond": "Dit is onherroepelijk, vernietigt deze NFTs en claimt de ingevoegde bezittingen, indien aanwezig.",
"infused": "Ingevoegde bezittingen",
"destination": "Bestemming",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "TRANSFERÊNCIAS ENTRE CHAINS",
"sameChain": "TRANSFERÊNCIAS NA MESMA CHAIN",
"sendOn": "Envia em",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "selecionado",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "КРОСС-ЧЕЙН ПЕРЕСЫЛКИ",
"sameChain": "ПЕРЕСЫЛКИ В РАМКАХ ОДНОГО БЛОКЧЕЙНА",
"sendOn": "Отправить в",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "выбрано",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "ZİNCİR DEĞİŞİM İŞLEMLERİ",
"sameChain": "DİĞER ZİNCİRLERDE TRANSFERLER",
"sendOn": "Burada Gönder-Al,",
"cosmicSwap": "Hesabınızda yeterli KCAL bulunmamaktadır. Biraz SOUL kullanarak kozmik değişim yapılsın mı?"
"cosmicSwap": "Hesabınızda yeterli KCAL bulunmamaktadır. Biraz SOUL kullanarak kozmik değişim yapılsın mı?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "Seçildi",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
"crossChain": "CHUYỂN ĐỔI CHUỖI CHÉO",
"sameChain": "CÙNG CHUYỂN ĐỔI CHUỖI",
"sendOn": "Gửi tiếp",
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?"
"cosmicSwap": "You do not have enough KCAL to perform this transaction. Use some SOUL to perform a cosmic swap?",
"viewOnExplorer": "view address on explorer"
},
"nfts": {
"selected": "đã chọn",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.development.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
"version": "1.1.3",
"version": "1.1.4",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.production.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
"version": "1.1.3",
"version": "1.1.4",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
Expand Down
33 changes: 23 additions & 10 deletions src/neo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ const tokens = {
GAS: "0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7",
};

let isPrimaryRpcDead = false;

function getNeoRpc(isMainnet: boolean) {
if (!isMainnet) return "http://mankinighost.phantasma.io:30333";
return !isPrimaryRpcDead
? "http://seed.neoeconomy.io:10332"
: "http://jpc.phantasma.io:10332";
}

function ab2hexstring(arr: ArrayBuffer | ArrayLike<number>): string {
if (typeof arr !== "object") {
throw new Error(`ab2hexstring expects an array.Input was ${arr}`);
Expand Down Expand Up @@ -50,10 +59,18 @@ export async function getNeoBalances(
neoAddress: string,
isMainnet: boolean
): Promise<any[]> {
const neoRpc = isMainnet
? "http://seed.neoeconomy.io:10332"
: "http://mankinighost.phantasma.io:30333";
const account = await rpc.Query.getAccountState(neoAddress).execute(neoRpc);
let neoRpc = getNeoRpc(isMainnet);

let account = null;
try {
account = await rpc.Query.getAccountState(neoAddress).execute(neoRpc);
} catch {
isPrimaryRpcDead = true;
console.log("primary neo rpc", neoRpc, "is not working");
neoRpc = getNeoRpc(isMainnet);
console.log("trying secondary neo rpc", neoRpc);
account = await rpc.Query.getAccountState(neoAddress).execute(neoRpc);
}

console.log("neo account", account);

Expand Down Expand Up @@ -168,9 +185,7 @@ async function sendNep5(
);

// Send raw transaction
const neoRpc = isMainnet
? "http://seed.neoeconomy.io:10332"
: "http://mankinighost.phantasma.io:30333";
const neoRpc = getNeoRpc(isMainnet);
const client = new rpc.RPCClient(neoRpc);
const res = await client.sendRawTransaction(rawTransaction);
console.log("sendNep5 Raw Tx", res, rawTransaction);
Expand Down Expand Up @@ -207,9 +222,7 @@ async function sendNative(
}

// Send raw transaction
const neoRpc = isMainnet
? "http://seed.neoeconomy.io:10332"
: "http://mankinighost.phantasma.io:30333";
const neoRpc = getNeoRpc(isMainnet);
const client = new rpc.RPCClient(neoRpc);

const transaction = await createTxWithNeoScan();
Expand Down
8 changes: 8 additions & 0 deletions src/phan-js/rpc/phantasma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,20 @@ export class PhantasmaAPI {
var http = new XMLHttpRequest();

http.open("GET", host + "/rpc", true);
http.timeout = 4500;
http.onreadystatechange = function() {
if (http.readyState == 4 && http.status == 200) {
var ended = new Date().getTime();
var milliseconds = ended - started;
resolve(milliseconds);
}

http.ontimeout = function() {
resolve(100000);
};
http.onerror = function() {
resolve(100000);
};
};
try {
http.send(null);
Expand Down
2 changes: 1 addition & 1 deletion src/popup/PopupState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class PopupState {

allSwaps: Swap[] = [];

payload = "4543542D312E312E33";
payload = "4543542D312E312E34";

$i18n: any = {
t: (s: string) => s,
Expand Down
Loading

0 comments on commit 9e681f8

Please sign in to comment.