@leofcoin/lib 1.2.66 → 1.2.67

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.
@@ -25,8 +25,8 @@ export declare const nativeTokenMessage: string;
25
25
  export declare const nameServiceMessage: string;
26
26
  export declare const validatorsMessage: string;
27
27
  export declare const createContractMessage: (creator: any, contract: any, constructorParameters?: any[]) => Promise<ContractMessage>;
28
- export declare const calculateFee: (transaction: any, format?: boolean) => Promise<string | 0 | import("@ethersproject/bignumber").BigNumber>;
29
- export declare const calculateTransactionFee: (transaction: any) => Promise<string | 0 | import("@ethersproject/bignumber").BigNumber>;
28
+ export declare const calculateFee: (transaction: any, format?: boolean) => Promise<string | bigint | 0>;
29
+ export declare const calculateTransactionFee: (transaction: any) => Promise<string | bigint | 0>;
30
30
  export declare const calculateReward: (validators: any, fees: any) => [];
31
31
  export declare const createTransactionHash: (transaction: rawTransaction | TransactionMessage | RawTransactionMessage) => Promise<Uint8Array>;
32
32
  export declare const signTransaction: (transaction: rawTransaction, wallet: signable) => Promise<signedTransaction>;
package/exports/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ContractMessage, TransactionMessage, RawTransactionMessage } from '@leofcoin/messages';
2
2
  import { validators as validators$1, contractFactory as contractFactory$1 } from '@leofcoin/addresses';
3
3
  export { default as nodeConfig } from './node-config.js';
4
- import { parseUnits, formatUnits } from '@leofcoin/utils';
4
+ import { toBigInt, formatUnits } from '@leofcoin/utils';
5
5
  import { toBase58 } from '@vandeurenglenn/typed-array-utils';
6
6
  import '@vandeurenglenn/base58';
7
7
 
@@ -32,9 +32,9 @@ const calculateFee = async (transaction, format = false) => {
32
32
  if (transaction.to === validators$1)
33
33
  return 0;
34
34
  transaction = await new TransactionMessage(transaction);
35
- let fee = parseUnits(String(transaction.encoded.length));
35
+ let fee = toBigInt(String(transaction.encoded.length));
36
36
  // fee per gb
37
- fee = fee.div(1073741824);
37
+ fee /= 1073741824n;
38
38
  // fee = fee.div(1000000)
39
39
  return format ? formatUnits(fee.toString()) : fee;
40
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/lib",
3
- "version": "1.2.66",
3
+ "version": "1.2.67",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "typings": "./exports/typings/index.d.ts",
@@ -39,11 +39,11 @@
39
39
  "author": "",
40
40
  "license": "MIT",
41
41
  "dependencies": {
42
- "@leofcoin/addresses": "^1.0.38",
43
- "@leofcoin/messages": "^1.4.33",
42
+ "@leofcoin/addresses": "^1.0.43",
43
+ "@leofcoin/messages": "^1.4.36",
44
44
  "@leofcoin/peernet": "^1.1.80",
45
45
  "@leofcoin/storage": "^3.5.32",
46
- "@leofcoin/utils": "^1.1.30",
46
+ "@leofcoin/utils": "^1.1.33",
47
47
  "@vandeurenglenn/base32": "^1.2.4",
48
48
  "@vandeurenglenn/base58": "^1.1.9",
49
49
  "@vandeurenglenn/typed-array-utils": "^1.2.0"