@leofcoin/chain 1.4.41 → 1.4.43
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/exports/browser/chain.js +2 -0
- package/exports/browser/{client-de444350-a666f9b6.js → client-91364a04-ef77946f.js} +1 -1
- package/exports/browser/{index-712688fc-ad40bdec.js → index-2c7d7136-110b02cd.js} +1 -1
- package/exports/browser/{messages-3f370680-fb7e5b5b.js → messages-bcb7873b-d8249d98.js} +1 -1
- package/exports/browser/{node-browser-bd6a5de3.js → node-browser-35d521b9.js} +4 -4
- package/exports/browser/node-browser.js +1 -1
- package/exports/chain.js +2 -0
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -7778,6 +7778,7 @@ class Transaction extends Protocol {
|
|
|
7778
7778
|
throw new Error(`transaction not signed`);
|
|
7779
7779
|
if (message.decoded.nonce === undefined)
|
|
7780
7780
|
throw new Error(`nonce required`);
|
|
7781
|
+
message = new TransactionMessage(message.encoded);
|
|
7781
7782
|
try {
|
|
7782
7783
|
await this.validateNonce(message.decoded.from, message.decoded.nonce);
|
|
7783
7784
|
// todo check if signature is valid
|
|
@@ -8489,6 +8490,7 @@ class Chain extends Contract {
|
|
|
8489
8490
|
async #addTransaction(transaction) {
|
|
8490
8491
|
try {
|
|
8491
8492
|
transaction = await new TransactionMessage(transaction);
|
|
8493
|
+
transaction = await new TransactionMessage(transaction.encoded);
|
|
8492
8494
|
const hash = await transaction.hash();
|
|
8493
8495
|
const has = await globalThis.transactionPoolStore.has(hash);
|
|
8494
8496
|
if (!has)
|
|
@@ -20263,7 +20263,7 @@ class Identity {
|
|
|
20263
20263
|
globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
|
|
20264
20264
|
}
|
|
20265
20265
|
else {
|
|
20266
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-
|
|
20266
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-2c7d7136-110b02cd.js');
|
|
20267
20267
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
20268
20268
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
20269
20269
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -20434,7 +20434,7 @@ class Peernet {
|
|
|
20434
20434
|
this.root = options.root;
|
|
20435
20435
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
20436
20436
|
// FolderMessageResponse
|
|
20437
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
20437
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-bcb7873b-d8249d98.js');
|
|
20438
20438
|
/**
|
|
20439
20439
|
* proto Object containing protos
|
|
20440
20440
|
* @type {Object}
|
|
@@ -20506,7 +20506,7 @@ class Peernet {
|
|
|
20506
20506
|
if (this.#starting || this.#started)
|
|
20507
20507
|
return;
|
|
20508
20508
|
this.#starting = true;
|
|
20509
|
-
const importee = await import('./client-
|
|
20509
|
+
const importee = await import('./client-91364a04-ef77946f.js');
|
|
20510
20510
|
/**
|
|
20511
20511
|
* @access public
|
|
20512
20512
|
* @type {PeernetClient}
|
|
@@ -20517,7 +20517,7 @@ class Peernet {
|
|
|
20517
20517
|
}
|
|
20518
20518
|
#peerLeft(peer) {
|
|
20519
20519
|
for (const [id, _peer] of Object.entries(this.#connections)) {
|
|
20520
|
-
if (
|
|
20520
|
+
if (_peer.id === peer.id) {
|
|
20521
20521
|
delete this.#connections[id];
|
|
20522
20522
|
this.removePeer(_peer);
|
|
20523
20523
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { N as default } from './node-browser-
|
|
1
|
+
export { N as default } from './node-browser-35d521b9.js';
|
|
2
2
|
import './contract-32687834.js';
|
package/exports/chain.js
CHANGED
|
@@ -373,6 +373,7 @@ class Transaction extends Protocol {
|
|
|
373
373
|
throw new Error(`transaction not signed`);
|
|
374
374
|
if (message.decoded.nonce === undefined)
|
|
375
375
|
throw new Error(`nonce required`);
|
|
376
|
+
message = new TransactionMessage(message.encoded);
|
|
376
377
|
try {
|
|
377
378
|
await this.validateNonce(message.decoded.from, message.decoded.nonce);
|
|
378
379
|
// todo check if signature is valid
|
|
@@ -1084,6 +1085,7 @@ class Chain extends Contract {
|
|
|
1084
1085
|
async #addTransaction(transaction) {
|
|
1085
1086
|
try {
|
|
1086
1087
|
transaction = await new TransactionMessage(transaction);
|
|
1088
|
+
transaction = await new TransactionMessage(transaction.encoded);
|
|
1087
1089
|
const hash = await transaction.hash();
|
|
1088
1090
|
const has = await globalThis.transactionPoolStore.has(hash);
|
|
1089
1091
|
if (!has)
|