suidouble 0.0.30 → 0.0.32

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/index.js CHANGED
@@ -8,4 +8,5 @@ module.exports = {
8
8
  SuiInBrowser,
9
9
  SuiTestScenario,
10
10
  SuiLocalTestValidator,
11
+ MIST_PER_SUI: SuiMaster.MIST_PER_SUI,
11
12
  };
package/lib/SuiMaster.js CHANGED
@@ -100,6 +100,10 @@ class SuiMaster extends SuiCommonMethods {
100
100
  this._packages = {};
101
101
  }
102
102
 
103
+ get MIST_PER_SUI() {
104
+ return BigInt(sui.MIST_PER_SUI);
105
+ }
106
+
103
107
  get objectStorage() {
104
108
  return this._objectStorage;
105
109
  }
@@ -232,6 +236,6 @@ class SuiMaster extends SuiCommonMethods {
232
236
  }
233
237
  };
234
238
 
235
-
239
+ SuiMaster.MIST_PER_SUI = BigInt(sui.MIST_PER_SUI);
236
240
 
237
241
  module.exports = SuiMaster;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "Set of provider, package and object classes for javascript representation of Sui Move smart contracts. Use same code for publishing, upgrading, integration testing, interaction with smart contracts and integration in browser web3 dapps",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,7 +3,7 @@
3
3
  const t = require('tap');
4
4
  const { test } = t;
5
5
 
6
- const { SuiMaster } = require('..');
6
+ const { SuiMaster, MIST_PER_SUI } = require('..');
7
7
 
8
8
  test('initialization', async t => {
9
9
  t.plan(2);
@@ -55,6 +55,19 @@ test('keypair generation with seed phrase works ok', async t => {
55
55
  t.equal(`${suiMasterNextAccount.address}`, `0xa6fb5c51b751e07a3e3b3af1f40f3115004702aad5a96263ff0be9078195f43b`, 'Ed25519 next account generated ok');
56
56
  });
57
57
 
58
+ test('SuiMaster has MIST_PER_SUI property available as BigInt', async t => {
59
+ const suiMaster = new SuiMaster({provider: 'test', as: 'somebody'});
60
+
61
+ t.ok(suiMaster.MIST_PER_SUI);
62
+
63
+ t.equal(typeof suiMaster.MIST_PER_SUI, 'bigint');
64
+ t.ok(suiMaster.MIST_PER_SUI > BigInt(0));
65
+
66
+
67
+ t.equal(suiMaster.MIST_PER_SUI, SuiMaster.MIST_PER_SUI);
68
+ t.equal(suiMaster.MIST_PER_SUI, MIST_PER_SUI); // available as global library export too
69
+ });
70
+
58
71
  test('connecting to different chains', async t => {
59
72
  const suiMaster = new SuiMaster({provider: 'test', as: 'somebody'});
60
73
  await suiMaster.initialize();