suidouble 1.0.4-1 → 1.0.4-2

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.
@@ -42,6 +42,10 @@ class SuiInBrowser extends SuiCommonMethods {
42
42
  return await this._activeAdapter.signAndExecuteTransactionBlock(params);
43
43
  }
44
44
 
45
+ async signAndExecuteTransaction(params) {
46
+ return await this._activeAdapter.signAndExecuteTransaction(params);
47
+ }
48
+
45
49
  get client() {
46
50
  return this._client;
47
51
  }
@@ -8,6 +8,8 @@ const Feature = {
8
8
  EVENTS: 'standard:events',
9
9
  SUI_SIGN_AND_EXECUTE_TX_BLOCK: 'sui:signAndExecuteTransactionBlock',
10
10
  SUI_SIGN_TX_BLOCK: 'sui:signTransactionBlock',
11
+ SUI_SIGN_AND_EXECUTE_TX: 'sui:signAndExecuteTransaction',
12
+ SUI_SIGN_TX: 'sui:signTransaction',
11
13
  SUI_SIGN_MESSAGE: 'sui:signMessage'
12
14
  };
13
15
 
@@ -30,10 +32,30 @@ class SuiInBrowserAdapter extends SuiCommonMethods {
30
32
  this._isConnected = false;
31
33
  }
32
34
 
35
+ async signAndExecuteTransaction(params) {
36
+ if (this.hasFeature(Feature.SUI_SIGN_AND_EXECUTE_TX)) {
37
+ return await this.getFeature(Feature.SUI_SIGN_AND_EXECUTE_TX).signAndExecuteTransaction(params);
38
+ } else {
39
+ // outdated wallet?
40
+ params.transactionBlock = params.transaction;
41
+ return await this.getFeature(Feature.SUI_SIGN_AND_EXECUTE_TX_BLOCK).signAndExecuteTransactionBlock(params);
42
+ }
43
+ }
44
+
33
45
  async signAndExecuteTransactionBlock(params) {
34
46
  return await this.getFeature(Feature.SUI_SIGN_AND_EXECUTE_TX_BLOCK).signAndExecuteTransactionBlock(params);
35
47
  }
36
48
 
49
+ async signTransactionBlock(params) {
50
+ if (this.hasFeature(Feature.SUI_SIGN_TX)) {
51
+ return await this.getFeature(Feature.SUI_SIGN_TX).signTransaction(params);
52
+ } else {
53
+ // outdated wallet?
54
+ params.transactionBlock = params.transaction;
55
+ return await this.getFeature(Feature.SUI_SIGN_TX_BLOCK).signTransactionBlock(params);
56
+ }
57
+ }
58
+
37
59
  async signTransactionBlock(params) {
38
60
  return await this.getFeature(Feature.SUI_SIGN_TX_BLOCK).signTransactionBlock(params);
39
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "1.0.4-1",
3
+ "version": "1.0.4-2",
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": {