edge-core-js 2.26.1 → 2.26.2
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/CHANGELOG.md +4 -0
- package/android/src/main/assets/edge-core-js/edge-core.js +1 -1
- package/android/src/main/assets/edge-core-js/edge-core.js.map +1 -1
- package/android/src/main/assets/edge-core-js/index.html +25 -0
- package/lib/core/currency/wallet/currency-wallet-api.js +5 -5
- package/lib/core/currency/wallet/currency-wallet-files.js +4 -2
- package/lib/node/index.js +9 -6
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>edge core dev-server</title>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<script src="edge-core.js"></script>
|
|
10
|
+
<script>
|
|
11
|
+
function load() {
|
|
12
|
+
var script = document.createElement('script')
|
|
13
|
+
script.charset = 'utf-8'
|
|
14
|
+
script.async = true
|
|
15
|
+
script.addEventListener('error', window.lockEdgeCorePlugins)
|
|
16
|
+
script.addEventListener('load', window.lockEdgeCorePlugins)
|
|
17
|
+
script.src = 'plugin-bundle.js'
|
|
18
|
+
document.head.appendChild(script)
|
|
19
|
+
}
|
|
20
|
+
setTimeout(load, 200)
|
|
21
|
+
|
|
22
|
+
console.log('CORE SERVER!')
|
|
23
|
+
</script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -56,8 +56,8 @@ import {
|
|
|
56
56
|
renameCurrencyWallet,
|
|
57
57
|
saveTxMetadataFile,
|
|
58
58
|
setCurrencyWalletFiat,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
setupNewTxMetadata,
|
|
60
|
+
updateCurrencyWalletTxMetadata
|
|
61
61
|
} from './currency-wallet-files'
|
|
62
62
|
|
|
63
63
|
|
|
@@ -614,7 +614,7 @@ export function makeCurrencyWalletApi(
|
|
|
614
614
|
await saveTxMetadataFile(input, fileName, txFile)
|
|
615
615
|
fakeCallbacks.onTransactions([{ isNew: true, transaction }])
|
|
616
616
|
} else {
|
|
617
|
-
await
|
|
617
|
+
await updateCurrencyWalletTxMetadata(
|
|
618
618
|
input,
|
|
619
619
|
transaction.txid,
|
|
620
620
|
transaction.tokenId,
|
|
@@ -626,7 +626,7 @@ export function makeCurrencyWalletApi(
|
|
|
626
626
|
|
|
627
627
|
async saveTxAction(opts) {
|
|
628
628
|
const { txid, tokenId, assetAction, savedAction } = opts
|
|
629
|
-
await
|
|
629
|
+
await updateCurrencyWalletTxMetadata(
|
|
630
630
|
input,
|
|
631
631
|
txid,
|
|
632
632
|
tokenId,
|
|
@@ -640,7 +640,7 @@ export function makeCurrencyWalletApi(
|
|
|
640
640
|
async saveTxMetadata(opts) {
|
|
641
641
|
const { txid, tokenId, metadata } = opts
|
|
642
642
|
|
|
643
|
-
await
|
|
643
|
+
await updateCurrencyWalletTxMetadata(
|
|
644
644
|
input,
|
|
645
645
|
txid,
|
|
646
646
|
tokenId,
|
|
@@ -430,7 +430,7 @@ export async function loadAddressFiles(
|
|
|
430
430
|
/**
|
|
431
431
|
* Changes a wallet's metadata.
|
|
432
432
|
*/
|
|
433
|
-
export async function
|
|
433
|
+
export async function updateCurrencyWalletTxMetadata(
|
|
434
434
|
input,
|
|
435
435
|
txid,
|
|
436
436
|
tokenId,
|
|
@@ -498,7 +498,9 @@ export async function setCurrencyWalletTxMetadata(
|
|
|
498
498
|
await transactionFile.save(disklet, 'transaction/' + fileName, newFile)
|
|
499
499
|
const callbackTx = combineTxWithFile(input, tx, newFile, tokenId)
|
|
500
500
|
fakeCallbacks.onTransactions([
|
|
501
|
-
|
|
501
|
+
// This method is used to update metadata for existing/seen transactions,
|
|
502
|
+
// so we should always mark the transaction as not new.
|
|
503
|
+
{ isNew: false, transaction: callbackTx }
|
|
502
504
|
])
|
|
503
505
|
}
|
|
504
506
|
|
package/lib/node/index.js
CHANGED
|
@@ -6264,7 +6264,7 @@ async function loadAddressFiles(input) {
|
|
|
6264
6264
|
/**
|
|
6265
6265
|
* Changes a wallet's metadata.
|
|
6266
6266
|
*/
|
|
6267
|
-
async function
|
|
6267
|
+
async function updateCurrencyWalletTxMetadata(input, txid, tokenId, fakeCallbacks, metadataChange, assetAction, savedAction) {
|
|
6268
6268
|
const {
|
|
6269
6269
|
dispatch,
|
|
6270
6270
|
state,
|
|
@@ -6339,8 +6339,11 @@ async function setCurrencyWalletTxMetadata(input, txid, tokenId, fakeCallbacks,
|
|
|
6339
6339
|
});
|
|
6340
6340
|
await transactionFile.save(disklet, 'transaction/' + fileName, newFile);
|
|
6341
6341
|
const callbackTx = combineTxWithFile(input, tx, newFile, tokenId);
|
|
6342
|
-
fakeCallbacks.onTransactions([
|
|
6343
|
-
|
|
6342
|
+
fakeCallbacks.onTransactions([
|
|
6343
|
+
// This method is used to update metadata for existing/seen transactions,
|
|
6344
|
+
// so we should always mark the transaction as not new.
|
|
6345
|
+
{
|
|
6346
|
+
isNew: false,
|
|
6344
6347
|
transaction: callbackTx
|
|
6345
6348
|
}]);
|
|
6346
6349
|
}
|
|
@@ -7954,7 +7957,7 @@ function makeCurrencyWalletApi(input, engine, tools, publicWalletInfo) {
|
|
|
7954
7957
|
transaction
|
|
7955
7958
|
}]);
|
|
7956
7959
|
} else {
|
|
7957
|
-
await
|
|
7960
|
+
await updateCurrencyWalletTxMetadata(input, transaction.txid, transaction.tokenId, fakeCallbacks);
|
|
7958
7961
|
}
|
|
7959
7962
|
await engine.saveTx(transaction);
|
|
7960
7963
|
},
|
|
@@ -7965,7 +7968,7 @@ function makeCurrencyWalletApi(input, engine, tools, publicWalletInfo) {
|
|
|
7965
7968
|
assetAction,
|
|
7966
7969
|
savedAction
|
|
7967
7970
|
} = opts;
|
|
7968
|
-
await
|
|
7971
|
+
await updateCurrencyWalletTxMetadata(input, txid, tokenId, fakeCallbacks, undefined, assetAction, savedAction);
|
|
7969
7972
|
},
|
|
7970
7973
|
async saveTxMetadata(opts) {
|
|
7971
7974
|
const {
|
|
@@ -7973,7 +7976,7 @@ function makeCurrencyWalletApi(input, engine, tools, publicWalletInfo) {
|
|
|
7973
7976
|
tokenId,
|
|
7974
7977
|
metadata
|
|
7975
7978
|
} = opts;
|
|
7976
|
-
await
|
|
7979
|
+
await updateCurrencyWalletTxMetadata(input, txid, tokenId, fakeCallbacks, metadata);
|
|
7977
7980
|
},
|
|
7978
7981
|
async signBytes(bytes, opts = {}) {
|
|
7979
7982
|
const privateKeys = walletInfo.keys;
|