@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.
@@ -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)
@@ -1,4 +1,4 @@
1
- import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './node-browser-bd6a5de3.js';
1
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './node-browser-35d521b9.js';
2
2
  import './contract-32687834.js';
3
3
 
4
4
  function commonjsRequire(path) {
@@ -1,4 +1,4 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-bd6a5de3.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-35d521b9.js';
2
2
  import './contract-32687834.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './node-browser-bd6a5de3.js';
1
+ import { F as FormatInterface } from './node-browser-35d521b9.js';
2
2
  import './contract-32687834.js';
3
3
 
4
4
  var proto$b = {
@@ -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-712688fc-ad40bdec.js');
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-3f370680-fb7e5b5b.js');
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-de444350-a666f9b6.js');
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 (peer.id === peer.id) {
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-bd6a5de3.js';
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.4.41",
3
+ "version": "1.4.43",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": "./exports/node.js",