@leofcoin/chain 1.4.84 → 1.4.86

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.
@@ -1,4 +1,4 @@
1
- import { B as BigNumber, L as Logger, v as version$1, h as hexZeroPad, i as isBigNumberish, a as arrayify, b as isBytes, C as ContractMessage, T as TransactionMessage, R as RawTransactionMessage, g as getDefaultExportFromCjs, c as BlockMessage, d as BWMessage, e as BWRequestMessage } from './index-f4429da1.js';
1
+ import { B as BigNumber, L as Logger, v as version$1, h as hexZeroPad, i as isBigNumberish, a as arrayify, b as isBytes, C as ContractMessage, T as TransactionMessage, t as toBase58, R as RawTransactionMessage, g as getDefaultExportFromCjs, c as BlockMessage, d as BWMessage, e as BWRequestMessage } from './index-fd1bc5f0.js';
2
2
 
3
3
  const logger$1 = new Logger(version$1);
4
4
  const _constructorGuard = {};
@@ -466,7 +466,7 @@ const createTransactionHash = async (transaction) => {
466
466
  return (await transaction.peernetHash).digest;
467
467
  };
468
468
  const signTransaction = async (transaction, wallet) => {
469
- const signature = await wallet.sign(await createTransactionHash(transaction));
469
+ const signature = toBase58(await wallet.sign(await createTransactionHash(transaction)));
470
470
  const signedTransaction = { ...transaction, signature };
471
471
  return signedTransaction;
472
472
  };
@@ -1358,7 +1358,7 @@ class Transaction extends Protocol {
1358
1358
  * @returns {TransactionMessage}
1359
1359
  */
1360
1360
  async promiseTransactions(transactions) {
1361
- transactions = await Promise.all(transactions.map(tx => new TransactionMessage(tx)));
1361
+ transactions = await Promise.all(transactions.map(tx => new TransactionMessage(tx.encoded || tx)));
1362
1362
  return transactions;
1363
1363
  }
1364
1364
  /**
@@ -2667,6 +2667,7 @@ class Chain extends State {
2667
2667
  // block.reward = block.reward.toString()
2668
2668
  // block.fees = block.fees.toString()
2669
2669
  try {
2670
+ console.log(block.transactions);
2670
2671
  block.transactions = await Promise.all(block.transactions
2671
2672
  .map(async (transaction) => {
2672
2673
  await globalThis.transactionPoolStore.delete(await transaction.hash());
@@ -1,5 +1,5 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-504c804a.js';
2
- import './index-f4429da1.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-e89e6592.js';
2
+ import './index-fd1bc5f0.js';
3
3
 
4
4
  /**
5
5
  * @params {String} network
@@ -5943,7 +5943,7 @@ var proto$6 = {
5943
5943
  nonce: Number(),
5944
5944
  method: String(),
5945
5945
  params: Array(),
5946
- signature: new Uint8Array()
5946
+ signature: String()
5947
5947
  };
5948
5948
 
5949
5949
  class TransactionMessage extends FormatInterface {
@@ -6081,4 +6081,4 @@ class RawTransactionMessage extends FormatInterface {
6081
6081
  }
6082
6082
  }
6083
6083
 
6084
- export { BigNumber as B, ContractMessage as C, Logger as L, RawTransactionMessage as R, TransactionMessage as T, ValidatorMessage as V, arrayify as a, isBytes as b, BlockMessage as c, BWMessage as d, BWRequestMessage as e, getDefaultExportFromCjs as g, hexZeroPad as h, isBigNumberish as i, version as v };
6084
+ export { BigNumber as B, ContractMessage as C, Logger as L, RawTransactionMessage as R, TransactionMessage as T, ValidatorMessage as V, arrayify as a, isBytes as b, BlockMessage as c, BWMessage as d, BWRequestMessage as e, getDefaultExportFromCjs as g, hexZeroPad as h, isBigNumberish as i, toBase58 as t, version as v };
@@ -1,5 +1,5 @@
1
- import { F as FormatInterface } from './node-browser-504c804a.js';
2
- import './index-f4429da1.js';
1
+ import { F as FormatInterface } from './node-browser-e89e6592.js';
2
+ import './index-fd1bc5f0.js';
3
3
 
4
4
  var proto$b = {
5
5
  data: new Uint8Array(),
@@ -1,4 +1,4 @@
1
- import { C as ContractMessage, T as TransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage, V as ValidatorMessage } from './index-f4429da1.js';
1
+ import { C as ContractMessage, T as TransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage, V as ValidatorMessage } from './index-fd1bc5f0.js';
2
2
 
3
3
  var nodeConfig = async (config = {
4
4
  network: 'leofcoin:peach',
@@ -20166,7 +20166,7 @@ class Identity {
20166
20166
  globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
20167
20167
  }
20168
20168
  else {
20169
- const importee = await import(/* webpackChunkName: "generate-account" */ './index-ed6cbdf7-eb75dc7a.js');
20169
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-ed6cbdf7-cced6308.js');
20170
20170
  const { identity, accounts } = await importee.default(password, this.network);
20171
20171
  await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
20172
20172
  await globalThis.walletStore.put('version', String(1));
@@ -20345,7 +20345,7 @@ class Peernet {
20345
20345
  this.root = options.root;
20346
20346
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
20347
20347
  // FolderMessageResponse
20348
- } = await import(/* webpackChunkName: "messages" */ './messages-35d069e1-9413ac70.js');
20348
+ } = await import(/* webpackChunkName: "messages" */ './messages-35d069e1-0b6352ff.js');
20349
20349
  /**
20350
20350
  * proto Object containing protos
20351
20351
  * @type {Object}
@@ -1,2 +1,2 @@
1
- export { N as default } from './node-browser-504c804a.js';
2
- import './index-f4429da1.js';
1
+ export { N as default } from './node-browser-e89e6592.js';
2
+ import './index-fd1bc5f0.js';
@@ -5876,7 +5876,7 @@ var proto$2 = {
5876
5876
  nonce: Number(),
5877
5877
  method: String(),
5878
5878
  params: Array(),
5879
- signature: new Uint8Array()
5879
+ signature: String()
5880
5880
  };
5881
5881
 
5882
5882
  class TransactionMessage extends FormatInterface {
@@ -5876,7 +5876,7 @@ var proto$3 = {
5876
5876
  nonce: Number(),
5877
5877
  method: String(),
5878
5878
  params: Array(),
5879
- signature: new Uint8Array()
5879
+ signature: String()
5880
5880
  };
5881
5881
 
5882
5882
  class TransactionMessage extends FormatInterface {
package/exports/chain.js CHANGED
@@ -58,7 +58,7 @@ class Transaction extends Protocol {
58
58
  * @returns {TransactionMessage}
59
59
  */
60
60
  async promiseTransactions(transactions) {
61
- transactions = await Promise.all(transactions.map(tx => new TransactionMessage(tx)));
61
+ transactions = await Promise.all(transactions.map(tx => new TransactionMessage(tx.encoded || tx)));
62
62
  return transactions;
63
63
  }
64
64
  /**
@@ -1287,6 +1287,7 @@ class Chain extends State {
1287
1287
  // block.reward = block.reward.toString()
1288
1288
  // block.fees = block.fees.toString()
1289
1289
  try {
1290
+ console.log(block.transactions);
1290
1291
  block.transactions = await Promise.all(block.transactions
1291
1292
  .map(async (transaction) => {
1292
1293
  await globalThis.transactionPoolStore.delete(await transaction.hash());
@@ -5839,7 +5839,7 @@ var proto$2 = {
5839
5839
  nonce: Number(),
5840
5840
  method: String(),
5841
5841
  params: Array(),
5842
- signature: new Uint8Array()
5842
+ signature: String()
5843
5843
  };
5844
5844
 
5845
5845
  class TransactionMessage extends FormatInterface {
@@ -5876,7 +5876,7 @@ var proto$3 = {
5876
5876
  nonce: Number(),
5877
5877
  method: String(),
5878
5878
  params: Array(),
5879
- signature: new Uint8Array()
5879
+ signature: String()
5880
5880
  };
5881
5881
 
5882
5882
  class TransactionMessage extends FormatInterface {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.4.84",
3
+ "version": "1.4.86",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": "./exports/node.js",