@ecency/wallets 1.4.24 → 1.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser/index.js
CHANGED
|
@@ -1193,13 +1193,16 @@ function getHivePowerDelegatingsQueryOptions(username) {
|
|
|
1193
1193
|
async function transferHive(payload) {
|
|
1194
1194
|
const parsedAsset = parseAsset(payload.amount);
|
|
1195
1195
|
const token = parsedAsset.symbol;
|
|
1196
|
+
const precision = token === "VESTS" /* VESTS */ ? 6 : 3;
|
|
1197
|
+
const formattedAmount = parsedAsset.amount.toFixed(precision);
|
|
1198
|
+
const amountWithSymbol = `${formattedAmount} ${token}`;
|
|
1196
1199
|
if (payload.type === "key" && "key" in payload) {
|
|
1197
1200
|
const { key, type, ...params } = payload;
|
|
1198
1201
|
return CONFIG.hiveClient.broadcast.transfer(
|
|
1199
1202
|
{
|
|
1200
1203
|
from: params.from,
|
|
1201
1204
|
to: params.to,
|
|
1202
|
-
amount:
|
|
1205
|
+
amount: amountWithSymbol,
|
|
1203
1206
|
memo: params.memo
|
|
1204
1207
|
},
|
|
1205
1208
|
key
|
|
@@ -1209,7 +1212,7 @@ async function transferHive(payload) {
|
|
|
1209
1212
|
(resolve, reject) => window.hive_keychain?.requestTransfer(
|
|
1210
1213
|
payload.from,
|
|
1211
1214
|
payload.to,
|
|
1212
|
-
|
|
1215
|
+
formattedAmount,
|
|
1213
1216
|
payload.memo,
|
|
1214
1217
|
token,
|
|
1215
1218
|
(resp) => {
|
|
@@ -1229,7 +1232,7 @@ async function transferHive(payload) {
|
|
|
1229
1232
|
{
|
|
1230
1233
|
from: payload.from,
|
|
1231
1234
|
to: payload.to,
|
|
1232
|
-
amount:
|
|
1235
|
+
amount: amountWithSymbol,
|
|
1233
1236
|
memo: payload.memo
|
|
1234
1237
|
}
|
|
1235
1238
|
],
|