suidouble 0.0.46 → 0.0.48

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.
Files changed (2) hide show
  1. package/lib/SuiMaster.js +16 -2
  2. package/package.json +1 -1
package/lib/SuiMaster.js CHANGED
@@ -11,6 +11,7 @@ const { SuiClient, getFullnodeUrl } = require('@mysten/sui.js/client');
11
11
  const { MIST_PER_SUI } = require('@mysten/sui.js/utils');
12
12
  const { Ed25519Keypair } = require('@mysten/sui.js/keypairs/ed25519');
13
13
  const { requestSuiFromFaucetV0, getFaucetHost } = require('@mysten/sui.js/faucet');
14
+ const { TransactionBlock,Transactions } = require('@mysten/sui.js/transactions');
14
15
 
15
16
  class SuiMaster extends SuiCommonMethods {
16
17
  constructor(params = {}) {
@@ -138,6 +139,14 @@ class SuiMaster extends SuiCommonMethods {
138
139
  return BigInt(MIST_PER_SUI);
139
140
  }
140
141
 
142
+ get TransactionBlock() {
143
+ return TransactionBlock;
144
+ }
145
+
146
+ get Transactions() {
147
+ return Transactions;
148
+ }
149
+
141
150
  /**
142
151
  * Referencing it here to get rid of circullar dependency. So you can always call SuiObject contructor if you have instance of SuiMaster
143
152
  */
@@ -228,6 +237,8 @@ class SuiMaster extends SuiCommonMethods {
228
237
  if (this._signer) {
229
238
  if (this._signer.toSuiAddress) {
230
239
  this._address = this._signer.toSuiAddress(); // after Sui's refactor Keypair's method
240
+ } else if (this._signer.connectedAddress) {
241
+ this._address = this._signer.connectedAddress;
231
242
  } else {
232
243
  this._address = await this._signer.getAddress(); // old method
233
244
  }
@@ -246,9 +257,10 @@ class SuiMaster extends SuiCommonMethods {
246
257
  async signAndExecuteTransactionBlock(params) {
247
258
  if (this._keypair) {
248
259
  params.signer = this._keypair;
260
+ return this._provider.signAndExecuteTransactionBlock(params);
261
+ } else if (this._signer) {
262
+ return this._signer.signAndExecuteTransactionBlock(params);
249
263
  }
250
-
251
- return this._provider.signAndExecuteTransactionBlock(params);
252
264
  }
253
265
 
254
266
  async requestSuiFromFaucet() {
@@ -384,5 +396,7 @@ class SuiMaster extends SuiCommonMethods {
384
396
  };
385
397
 
386
398
  SuiMaster.MIST_PER_SUI = BigInt(MIST_PER_SUI);
399
+ SuiMaster.TransactionBlock = TransactionBlock;
400
+ SuiMaster.Transactions = Transactions;
387
401
 
388
402
  module.exports = SuiMaster;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
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": {