diff --git a/src/lib/blockchains/EOS/beautify.js b/src/lib/blockchains/EOS/beautify.js index 461acdbe..88b7eed2 100644 --- a/src/lib/blockchains/EOS/beautify.js +++ b/src/lib/blockchains/EOS/beautify.js @@ -44,19 +44,20 @@ const allowedOperations = [ "rmvproducer", "updtrevision", "bidname", - "bidrefund" + "bidrefund", + "ramtransfer", ]; /** * Convert an array of operations into a readable format - * @param {Object} operation - * @returns + * @param {Object} operation + * @returns */ -export default async function beautify (operation) { +export default async function beautify(operation) { if (!operation || !operation.name) { return; } - + const opType = operation.name; if (!allowedOperations.includes(opType)) { @@ -74,9 +75,9 @@ export default async function beautify (operation) { if (opType === "transfer") { /** * Transferring tokens action. - * + * * @details Transfer tokens from account to account. - * + * * @param from - the account to transfer from, * @param to - the account to be transferred to, * @param quantity - the quantity of tokens to be transferred, @@ -92,7 +93,6 @@ export default async function beautify (operation) { { key: "quantity", params: { quantity: quantity } }, { key: "memo", params: { memo: memo ?? "" } }, ]; - } else if (opType === "setalimits") { /** * Set account limits action. @@ -169,7 +169,10 @@ export default async function beautify (operation) { */ const feature_digest = operation.data.feature_digest; currentOperation["rows"] = [ - { key: "feature_digest", params: { feature_digest: feature_digest } }, + { + key: "feature_digest", + params: { feature_digest: feature_digest }, + }, ]; } else if (opType === "delegatebw") { // functions defined in delegate_bandwidth.cpp @@ -197,11 +200,16 @@ export default async function beautify (operation) { currentOperation["rows"] = [ { key: "from", params: { from: from } }, { key: "receiver", params: { receiver: receiver } }, - { key: "stake_net_quantity", params: { stake_net_quantity: stake_net_quantity } }, - { key: "stake_cpu_quantity", params: { stake_cpu_quantity: stake_cpu_quantity } }, + { + key: "stake_net_quantity", + params: { stake_net_quantity: stake_net_quantity }, + }, + { + key: "stake_cpu_quantity", + params: { stake_cpu_quantity: stake_cpu_quantity }, + }, { key: "transfer", params: { transfer: transfer } }, ]; - } else if (opType === "setrex") { /** * Setrex action. @@ -333,9 +341,7 @@ export default async function beautify (operation) { * @pre Order cannot be cancelled once it's been filled. */ const owner = operation.data.owner; - currentOperation["rows"] = [ - { key: "owner", params: { owner: owner } }, - ]; + currentOperation["rows"] = [{ key: "owner", params: { owner: owner } }]; } else if (opType === "rentcpu") { /** * Rentcpu action. @@ -469,7 +475,7 @@ export default async function beautify (operation) { { key: "from", params: { from: from } }, { key: "loan_num", params: { loan_num: loan_num } }, { key: "amount", params: { amount: amount } }, - ]; + ]; } else if (opType === "updaterex") { /** * Updaterex action. @@ -478,11 +484,9 @@ export default async function beautify (operation) { * * @param owner - REX owner account. */ - + const owner = operation.data.owner; - currentOperation["rows"] = [ - { key: "owner", params: { owner: owner } }, - ]; + currentOperation["rows"] = [{ key: "owner", params: { owner: owner } }]; } else if (opType === "rexexec") { /** * Rexexec action. @@ -509,9 +513,7 @@ export default async function beautify (operation) { * @param owner - REX owner account name. */ const owner = operation.data.owner; - currentOperation["rows"] = [ - { key: "owner", params: { owner: owner } }, - ]; + currentOperation["rows"] = [{ key: "owner", params: { owner: owner } }]; } else if (opType === "mvtosavings") { /** * Mvtosavings action. @@ -561,9 +563,7 @@ export default async function beautify (operation) { * REX fund entry is deleted. */ const owner = operation.data.owner; - currentOperation["rows"] = [ - { key: "owner", params: { owner: owner } }, - ]; + currentOperation["rows"] = [{ key: "owner", params: { owner: owner } }]; } else if (opType === "undelegatebw") { /** * Undelegate bandwitdh action. @@ -601,8 +601,14 @@ export default async function beautify (operation) { currentOperation["rows"] = [ { key: "from", params: { from: from } }, { key: "receiver", params: { receiver: receiver } }, - { key: "unstake_net_quantity", params: { unstake_net_quantity: unstake_net_quantity } }, - { key: "unstake_cpu_quantity", params: { unstake_cpu_quantity: unstake_cpu_quantity } }, + { + key: "unstake_net_quantity", + params: { unstake_net_quantity: unstake_net_quantity }, + }, + { + key: "unstake_cpu_quantity", + params: { unstake_cpu_quantity: unstake_cpu_quantity }, + }, ]; } else if (opType === "buyram") { /** @@ -669,9 +675,7 @@ export default async function beautify (operation) { * @param owner - the owner of the tokens claimed. */ const owner = operation.data.owner; - currentOperation["rows"] = [ - { key: "owner", params: { owner: owner } }, - ]; + currentOperation["rows"] = [{ key: "owner", params: { owner: owner } }]; } else if (opType === "regproducer") { // functions defined in voting.cpp @@ -711,7 +715,7 @@ export default async function beautify (operation) { const producer = operation.data.producer; currentOperation["rows"] = [ { key: "producer", params: { producer: producer } }, - ]; + ]; } else if (opType === "setram") { /** * Set ram action. @@ -735,7 +739,10 @@ export default async function beautify (operation) { */ const bytes_per_block = operation.data.bytes_per_block; currentOperation["rows"] = [ - { key: "bytes_per_block", params: { bytes_per_block: bytes_per_block } }, + { + key: "bytes_per_block", + params: { bytes_per_block: bytes_per_block }, + }, ]; } else if (opType === "voteproducer") { /** @@ -770,7 +777,7 @@ export default async function beautify (operation) { { key: "voter", params: { voter: voter } }, { key: "proxy", params: { proxy: proxy } }, { key: "producers", params: { producers: producers } }, - ]; + ]; } else if (opType === "regproxy") { /** * Register proxy action. @@ -803,7 +810,10 @@ export default async function beautify (operation) { */ const params = JSON.stringify(operation.data.params, null, 2); currentOperation["rows"] = [ - { key: "params", params: { params: JSON.stringify(params, null, 2) } }, + { + key: "params", + params: { params: JSON.stringify(params, null, 2) }, + }, ]; } else if (opType === "claimrewards") { // functions defined in producer_pay.cpp @@ -814,9 +824,7 @@ export default async function beautify (operation) { * @param owner - producer account claiming per-block and per-vote rewards. */ const owner = operation.data.owner; - currentOperation["rows"] = [ - { key: "owner", params: { owner: owner } }, - ]; + currentOperation["rows"] = [{ key: "owner", params: { owner: owner } }]; } else if (opType === "setpriv") { /** * Set privilege status for an account. @@ -898,7 +906,25 @@ export default async function beautify (operation) { { key: "bidder", params: { bidder: bidder } }, { key: "newname", params: { newname: newname } }, ]; + } else if (opType === "ramtransfer") { + /** + * Ram transfer action. + * + * @details Allows an account `from` to transfer ram to another account `to`. + * + * @param from - the account sending ram, + * @param to - the account receiving ram, + * @param bytes - the amount of ram to be sent. + */ + const from = operation.data.from; + const to = operation.data.to; + const bytes = operation.data.bytes; + currentOperation["rows"] = [ + { key: "from", params: { from: from } }, + { key: "to", params: { to: to } }, + { key: "bytes", params: { bytes: bytes } }, + ]; } return currentOperation; -} \ No newline at end of file +} diff --git a/src/lib/blockchains/EOSmainnet.js b/src/lib/blockchains/EOSmainnet.js index 6e8b33eb..ec2f8215 100644 --- a/src/lib/blockchains/EOSmainnet.js +++ b/src/lib/blockchains/EOSmainnet.js @@ -58,7 +58,8 @@ const operations = [ "rmvproducer", "updtrevision", "bidname", - "bidrefund" + "bidrefund", + "ramtransfer" ]; export default class EOS extends BlockchainAPI { diff --git a/src/translations/operations/da.json b/src/translations/operations/da.json index e8605579..a001c5cb 100644 --- a/src/translations/operations/da.json +++ b/src/translations/operations/da.json @@ -2225,6 +2225,21 @@ "newname": "Nyt navn: {newname}" }, "tooltip": "Tilbagebetaling af budoperation" + }, + "ramtransfer": { + "method": "RAM-overførsel", + "title": "RAM-overførselsanmodning", + "result": "Resultat af RAM-overførsel", + "headers": { + "request": "Overføre RAM fra en konto til en anden?", + "result": "RAM blev overført fra en konto til en anden:" + }, + "rows": { + "from": "Fra: {from}", + "to": "Til: {to}", + "bytes": "Bytes: {bytes}" + }, + "tooltip": "Overførsel af RAM-drift" } } } diff --git a/src/translations/operations/de.json b/src/translations/operations/de.json index cae8b5af..cd5b3b2f 100644 --- a/src/translations/operations/de.json +++ b/src/translations/operations/de.json @@ -2225,7 +2225,22 @@ "newname": "Neuer Name: {newname}" }, "tooltip": "Rückerstattung des Gebotsvorgangs" - } + }, + "ramtransfer": { + "method": "RAM-Übertragung", + "title": "RAM-Übertragungsanforderung", + "result": "RAM-Übertragungsergebnis", + "headers": { + "request": "RAM von einem Konto auf ein anderes übertragen?", + "result": "RAM wurde von einem Konto auf ein anderes übertragen:" + }, + "rows": { + "from": "Von: {von}", + "to": "An: {an}", + "bytes": "Bytes: {Bytes}" + }, + "tooltip": "RAM-Betrieb übertragen" + } } } } \ No newline at end of file diff --git a/src/translations/operations/en.json b/src/translations/operations/en.json index 7fe83b7b..9b2e2ea3 100644 --- a/src/translations/operations/en.json +++ b/src/translations/operations/en.json @@ -787,7 +787,22 @@ "newname": "New Name: {newname}" }, "tooltip": "Refunding Bid operation" - } + }, + "ramtransfer": { + "method": "RAM Transfer", + "title": "RAM Transfer Request", + "result": "RAM Transfer Result", + "headers": { + "request": "Transfer RAM from one account to another?", + "result": "RAM was transferred from one account to another:" + }, + "rows": { + "from": "From: {from}", + "to": "To: {to}", + "bytes": "Bytes: {bytes}" + }, + "tooltip": "Transferring RAM operation" + } }, "BTS": { "getAccount": { diff --git a/src/translations/operations/es.json b/src/translations/operations/es.json index f1e4700f..02e07870 100644 --- a/src/translations/operations/es.json +++ b/src/translations/operations/es.json @@ -2225,6 +2225,21 @@ "newname": "Nuevo nombre: {newname}" }, "tooltip": "Operación de oferta de reembolso" + }, + "ramtransfer": { + "method": "Transferencia de RAM", + "title": "Solicitud de transferencia de RAM", + "result": "Resultado de la transferencia de RAM", + "headers": { + "request": "¿Transferir RAM de una cuenta a otra?", + "result": "La RAM se transfirió de una cuenta a otra:" + }, + "rows": { + "from": "De: {de}", + "to": "Para: {a}", + "bytes": "Bytes: {bytes}" + }, + "tooltip": "Operación de transferencia de RAM" } } } diff --git a/src/translations/operations/et.json b/src/translations/operations/et.json index 67863447..fbba4ea6 100644 --- a/src/translations/operations/et.json +++ b/src/translations/operations/et.json @@ -2225,6 +2225,21 @@ "newname": "Uus nimi: {newname}" }, "tooltip": "Pakkumise tagasimakse toiming" + }, + "ramtransfer": { + "method": "RAM-i ülekanne", + "title": "RAM-i ülekande taotlus", + "result": "RAM-i ülekande tulemus", + "headers": { + "request": "Kas teisaldada RAM-i ühelt kontolt teisele?", + "result": "RAM kanti ühelt kontolt teisele:" + }, + "rows": { + "from": "Saatja: {from}", + "to": "Saaja: {to}", + "bytes": "Baidid: {baiti}" + }, + "tooltip": "RAM-i toimingute edastamine" } } } diff --git a/src/translations/operations/fr.json b/src/translations/operations/fr.json index b6398e7d..79bc1477 100644 --- a/src/translations/operations/fr.json +++ b/src/translations/operations/fr.json @@ -2225,6 +2225,21 @@ "newname": "Nouveau nom : {newname}" }, "tooltip": "Opération d’offre de remboursement" + }, + "ramtransfer": { + "method": "Transfert de RAM", + "title": "Demande de transfert de RAM", + "result": "Résultat du transfert de RAM", + "headers": { + "request": "Transférer de la RAM d'un compte à un autre ?", + "result": "La RAM a été transférée d'un compte à un autre :" + }, + "rows": { + "from": "De : {de}", + "to": "À : {à}", + "bytes": "Octets : {octets}" + }, + "tooltip": "Opération de transfert de RAM" } } } diff --git a/src/translations/operations/it.json b/src/translations/operations/it.json index ddfcd6df..f35c4419 100644 --- a/src/translations/operations/it.json +++ b/src/translations/operations/it.json @@ -2225,6 +2225,21 @@ "newname": "Nuovo nome: {newname}" }, "tooltip": "Operazione di offerta di rimborso" + }, + "ramtransfer": { + "method": "Trasferimento RAM", + "title": "Richiesta di trasferimento RAM", + "result": "Risultato del trasferimento RAM", + "headers": { + "request": "Trasferire la RAM da un account all'altro?", + "result": "La RAM è stata trasferita da un account a un altro:" + }, + "rows": { + "from": "Da: {da}", + "to": "A: {a}", + "bytes": "Byte: {byte}" + }, + "tooltip": "Trasferimento dell'operazione RAM" } } } diff --git a/src/translations/operations/ja.json b/src/translations/operations/ja.json index def1c19a..7b8ad547 100644 --- a/src/translations/operations/ja.json +++ b/src/translations/operations/ja.json @@ -2225,6 +2225,21 @@ "newname": "新しい名前: {newname}" }, "tooltip": "入札返金業務" + }, + "ramtransfer": { + "method": "RAM転送", + "title": "RAM転送リクエスト", + "result": "RAM転送結果", + "headers": { + "request": "RAM をあるアカウントから別のアカウントに転送しますか?", + "result": "RAM があるアカウントから別のアカウントに転送されました。" + }, + "rows": { + "from": "差出人: {差出人}", + "to": "宛先: {宛}", + "bytes": "バイト: {バイト}" + }, + "tooltip": "RAM操作の転送" } } } diff --git a/src/translations/operations/ko.json b/src/translations/operations/ko.json index 542e0e99..e4b66777 100644 --- a/src/translations/operations/ko.json +++ b/src/translations/operations/ko.json @@ -2225,6 +2225,21 @@ "newname": "새 이름: {newname}" }, "tooltip": "입찰 환불 작업" + }, + "ramtransfer": { + "method": "RAM 전송", + "title": "RAM 전송 요청", + "result": "RAM 전송 결과", + "headers": { + "request": "한 계정에서 다른 계정으로 RAM을 이전하시겠습니까?", + "result": "RAM이 한 계정에서 다른 계정으로 이전되었습니다." + }, + "rows": { + "from": "보낸 사람: {from}", + "to": "받는 사람: {to}", + "bytes": "바이트: {바이트}" + }, + "tooltip": "RAM 작업 전송 중" } } } diff --git a/src/translations/operations/pt.json b/src/translations/operations/pt.json index 7a688242..06588267 100644 --- a/src/translations/operations/pt.json +++ b/src/translations/operations/pt.json @@ -2225,6 +2225,21 @@ "newname": "Novo nome: {newname}" }, "tooltip": "Operação de reembolso de lance" + }, + "ramtransfer": { + "method": "Transferência de RAM", + "title": "Solicitação de transferência de RAM", + "result": "Resultado da transferência de RAM", + "headers": { + "request": "Transferir RAM de uma conta para outra?", + "result": "RAM foi transferida de uma conta para outra:" + }, + "rows": { + "from": "De: {de}", + "to": "Para: {para}", + "bytes": "Bytes: {bytes}" + }, + "tooltip": "Operação de transferência de RAM" } } } diff --git a/src/translations/operations/th.json b/src/translations/operations/th.json index 6af291b6..6a946483 100644 --- a/src/translations/operations/th.json +++ b/src/translations/operations/th.json @@ -2225,6 +2225,21 @@ "newname": "ชื่อใหม่: {newname}" }, "tooltip": "การดำเนินการขอคืนเงิน" + }, + "ramtransfer": { + "method": "การถ่ายโอนแรม", + "title": "คำขอถ่ายโอน RAM", + "result": "ผลการถ่ายโอน RAM", + "headers": { + "request": "โอน RAM จากบัญชีหนึ่งไปยังอีกบัญชีหนึ่งหรือไม่", + "result": "RAM ถูกโอนจากบัญชีหนึ่งไปยังอีกบัญชีหนึ่ง:" + }, + "rows": { + "from": "จาก: {จาก}", + "to": "ถึง: {ถึง}", + "bytes": "ไบต์: {ไบต์}" + }, + "tooltip": "การถ่ายโอนการทำงานของ RAM" } } }