suidouble 1.21.0 → 1.24.0

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/lib/SuiEvent.js CHANGED
@@ -40,6 +40,10 @@ export default class SuiEvent extends Event {
40
40
  return this._data ? (''+this._data.type).split('<')[0].split('::').pop() : null;
41
41
  }
42
42
 
43
+ get type() {
44
+ return this._data ? (''+this._data.type) : null;
45
+ }
46
+
43
47
  get data() {
44
48
  return this._data;
45
49
  }
@@ -53,7 +53,6 @@ export default class SuiPackageModule extends SuiCommonMethods {
53
53
  function: methodName,
54
54
  });
55
55
 
56
- // console.log(ret);
57
56
  return ret;
58
57
  }
59
58
 
@@ -295,7 +294,7 @@ export default class SuiPackageModule extends SuiCommonMethods {
295
294
  const moduleFilter = {};
296
295
 
297
296
  // we need very first package version's id here. So we are getting it from normalized data
298
- const normalizedPackageAddress = await this.getNormalizedPackageAddress();
297
+ let normalizedPackageAddress = await this.getNormalizedPackageAddress();
299
298
  if (params.eventTypeName) {
300
299
  moduleFilter.MoveEventType = `${normalizedPackageAddress}::${this._moduleName}::${params.eventTypeName}`;
301
300
  this.log('queriying for events of type: ', moduleFilter.MoveEventType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "1.21.0",
3
+ "version": "1.24.0",
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
  "type": "module",
@@ -22,8 +22,10 @@
22
22
  "author": "suidouble (https://github.com/suidouble)",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@mysten/sui": "^1.21.0",
25
+ "@mysten/bcs": "^1.5.0",
26
+ "@mysten/sui": "^1.24.0",
26
27
  "@polymedia/coinmeta": "^0.0.17",
28
+ "@scure/bip39": "^1.5.4",
27
29
  "@wallet-standard/core": "^1.0.3",
28
30
  "websocket": "^1.0.35"
29
31
  },
@@ -86,6 +86,8 @@ test('attach a local package', async t => {
86
86
  t.not(contract.address, contractAddressV1);
87
87
  t.equal(contract.version, 2);
88
88
 
89
+ await new Promise((res)=>setTimeout(res, 1000)); // wait for upgrade in rpc
90
+
89
91
  contractAddressV2 = contract.address;
90
92
 
91
93
  // let's quickly check it worked, there should be event ChatShopCreated created and we can fetch it from contract's module
@@ -259,7 +261,7 @@ test('testing paginatedResponse', async t => {
259
261
  const moveCallResult = await contract.moveCall('suidouble_chat', 'fill', [chatTopMessage.id, contract.arg('string', 'the message response'), contract.arg('string', 'metadata')]);
260
262
  t.ok(moveCallResult.created.length >= 60); // it's 60 in move code, but let's keep chat flexible
261
263
 
262
- const eventsResponse = await contract.fetchEvents('suidouble_chat');
264
+ const eventsResponse = await contract.modules.suidouble_chat.fetchEvents({eventTypeName: 'ChatResponseCreated'});
263
265
  const idsInEventsDict = {};
264
266
  let responsesInEventsCount = 0;
265
267
  do {
@@ -274,7 +276,7 @@ test('testing paginatedResponse', async t => {
274
276
  t.ok(responsesInEventsCount >= 60); // it's 60 in move code, but let's keep chat flexible
275
277
 
276
278
  // or using SuiPaginatedResponse forEach itterator:
277
- const anotherEventsResponse = await contract.fetchEvents('suidouble_chat');
279
+ const anotherEventsResponse = await contract.modules.suidouble_chat.fetchEvents({eventTypeName: 'ChatResponseCreated'});
278
280
  let loopsInForEach = 0;
279
281
  const idsInLoopDict = {};
280
282
  await anotherEventsResponse.forEach(async (event)=>{ //
@@ -21,6 +21,6 @@ dependencies = [
21
21
  ]
22
22
 
23
23
  [move.toolchain-version]
24
- compiler-version = "1.40.3"
24
+ compiler-version = "1.44.2"
25
25
  edition = "2024.beta"
26
26
  flavor = "sui"
@@ -22,6 +22,6 @@ dependencies = [
22
22
  ]
23
23
 
24
24
  [move.toolchain-version]
25
- compiler-version = "1.40.3"
25
+ compiler-version = "1.44.2"
26
26
  edition = "2024"
27
27
  flavor = "sui"