@leofcoin/lib 1.2.21 → 1.2.22

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/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ContractMessage, TransactionMessage } from '@leofcoin/messages';
2
- import { CodecHash } from '@leofcoin/codec-format-interface';
3
2
  import { validators as validators$1, contractFactory as contractFactory$1 } from '@leofcoin/addresses';
4
3
  export { default as nodeConfig } from './node-config.js';
5
4
  import { parseUnits, formatUnits } from '@leofcoin/utils';
@@ -52,7 +51,7 @@ const calculateReward = (validators, fees) => {
52
51
  }, []);
53
52
  return validators;
54
53
  };
55
- const createTransactionHash = async (transaction) => (await new CodecHash(transaction, { name: 'transaction-message' })).digest;
54
+ const createTransactionHash = async (transaction) => (await new TransactionMessage(transaction)).peernetHash.digest;
56
55
  const signTransaction = async (transaction, wallet) => {
57
56
  const signature = await wallet.sign(await createTransactionHash(transaction));
58
57
  const signedTransaction = { ...transaction, signature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/lib",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "typings": "./exports/typings/index.d.ts",
package/src/index.ts CHANGED
@@ -73,7 +73,7 @@ export const calculateReward = (validators, fees): [] => {
73
73
  }
74
74
 
75
75
  export const createTransactionHash = async (transaction: transaction): Promise<Uint8Array> =>
76
- (await new CodecHash(transaction, {name: 'transaction-message'})).digest
76
+ (await new TransactionMessage(transaction)).peernetHash.digest
77
77
 
78
78
  export const signTransaction = async (transaction: transaction, wallet: signable): Promise<signedTransaction> => {
79
79
  const signature = await wallet.sign(await createTransactionHash(transaction))