@0xobelisk/sui-client 0.5.17 → 0.5.18

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 (43) hide show
  1. package/dist/index.js +343 -201
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +333 -194
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +11 -5
  6. package/src/index.ts +9 -8
  7. package/src/libs/multiSig/client.ts +2 -2
  8. package/src/libs/multiSig/publickey.ts +3 -3
  9. package/src/libs/suiAccountManager/index.ts +6 -5
  10. package/src/libs/suiAccountManager/keypair.ts +1 -1
  11. package/src/libs/suiAccountManager/util.ts +1 -1
  12. package/src/libs/suiContractFactory/index.ts +1 -1
  13. package/src/libs/suiContractFactory/types.ts +1 -1
  14. package/src/libs/suiInteractor/suiInteractor.ts +4 -4
  15. package/src/libs/suiModel/suiOwnedObject.ts +6 -4
  16. package/src/libs/suiModel/suiSharedObject.ts +5 -3
  17. package/src/libs/suiTxBuilder/index.ts +102 -84
  18. package/src/libs/suiTxBuilder/util.ts +113 -42
  19. package/src/metadata/index.ts +2 -3
  20. package/src/obelisk.ts +199 -90
  21. package/src/types/index.ts +46 -32
  22. package/dist/index.d.ts +0 -14
  23. package/dist/libs/multiSig/client.d.ts +0 -15
  24. package/dist/libs/multiSig/index.d.ts +0 -1
  25. package/dist/libs/multiSig/publickey.d.ts +0 -2
  26. package/dist/libs/suiAccountManager/crypto.d.ts +0 -1
  27. package/dist/libs/suiAccountManager/index.d.ts +0 -39
  28. package/dist/libs/suiAccountManager/keypair.d.ts +0 -21
  29. package/dist/libs/suiAccountManager/util.d.ts +0 -29
  30. package/dist/libs/suiContractFactory/index.d.ts +0 -20
  31. package/dist/libs/suiContractFactory/types.d.ts +0 -49
  32. package/dist/libs/suiInteractor/index.d.ts +0 -1
  33. package/dist/libs/suiInteractor/suiInteractor.d.ts +0 -50
  34. package/dist/libs/suiInteractor/util.d.ts +0 -1
  35. package/dist/libs/suiModel/index.d.ts +0 -2
  36. package/dist/libs/suiModel/suiOwnedObject.d.ts +0 -24
  37. package/dist/libs/suiModel/suiSharedObject.d.ts +0 -11
  38. package/dist/libs/suiTxBuilder/index.d.ts +0 -333
  39. package/dist/libs/suiTxBuilder/util.d.ts +0 -58
  40. package/dist/metadata/index.d.ts +0 -3
  41. package/dist/obelisk.d.ts +0 -136
  42. package/dist/types/index.d.ts +0 -152
  43. package/dist/utils/index.d.ts +0 -3
package/dist/index.js CHANGED
@@ -44,33 +44,36 @@ var __privateAdd = (obj, member, value) => {
44
44
  // src/index.ts
45
45
  var src_exports = {};
46
46
  __export(src_exports, {
47
- BCS: () => import_bcs4.BCS,
47
+ BcsType: () => import_bcs4.BcsType,
48
48
  MultiSigClient: () => MultiSigClient,
49
49
  Obelisk: () => Obelisk,
50
50
  SuiAccountManager: () => SuiAccountManager,
51
51
  SuiContractFactory: () => SuiContractFactory,
52
- SuiTxBlock: () => SuiTxBlock,
53
- getSuiMoveConfig: () => import_bcs4.getSuiMoveConfig,
52
+ SuiTx: () => SuiTx,
53
+ bcs: () => import_bcs4.bcs,
54
54
  loadMetadata: () => loadMetadata
55
55
  });
56
56
  module.exports = __toCommonJS(src_exports);
57
- __reExport(src_exports, require("@mysten/sui.js/client"), module.exports);
58
- __reExport(src_exports, require("@mysten/sui.js/utils"), module.exports);
59
- __reExport(src_exports, require("@mysten/sui.js/transactions"), module.exports);
60
- __reExport(src_exports, require("@mysten/sui.js/keypairs/ed25519"), module.exports);
61
- __reExport(src_exports, require("@mysten/sui.js/keypairs/secp256k1"), module.exports);
62
- __reExport(src_exports, require("@mysten/sui.js/keypairs/secp256r1"), module.exports);
57
+ __reExport(src_exports, require("@mysten/sui/client"), module.exports);
58
+ __reExport(src_exports, require("@mysten/sui/utils"), module.exports);
59
+ __reExport(src_exports, require("@mysten/sui/transactions"), module.exports);
60
+ __reExport(src_exports, require("@mysten/sui/bcs"), module.exports);
61
+ __reExport(src_exports, require("@mysten/sui/keypairs/ed25519"), module.exports);
62
+ __reExport(src_exports, require("@mysten/sui/keypairs/secp256k1"), module.exports);
63
+ __reExport(src_exports, require("@mysten/sui/keypairs/secp256r1"), module.exports);
63
64
  var import_bcs4 = require("@mysten/bcs");
64
65
 
65
66
  // src/obelisk.ts
66
- var import_client2 = require("@mysten/sui.js/client");
67
- var import_transactions3 = require("@mysten/sui.js/transactions");
67
+ var import_keccak256 = __toESM(require("keccak256"));
68
+ var import_client2 = require("@mysten/sui/client");
69
+ var import_transactions3 = require("@mysten/sui/transactions");
68
70
 
69
71
  // src/libs/suiAccountManager/index.ts
70
- var import_ed255192 = require("@mysten/sui.js/keypairs/ed25519");
72
+ var import_ed255192 = require("@mysten/sui/keypairs/ed25519");
73
+ var import_cryptography = require("@mysten/sui/cryptography");
71
74
 
72
75
  // src/libs/suiAccountManager/keypair.ts
73
- var import_ed25519 = require("@mysten/sui.js/keypairs/ed25519");
76
+ var import_ed25519 = require("@mysten/sui/keypairs/ed25519");
74
77
  var getDerivePathForSUI = (derivePathParams = {}) => {
75
78
  const {
76
79
  accountIndex = 0,
@@ -85,7 +88,7 @@ var getKeyPair = (mnemonics, derivePathParams = {}) => {
85
88
  };
86
89
 
87
90
  // src/libs/suiAccountManager/util.ts
88
- var import_utils = require("@mysten/sui.js/utils");
91
+ var import_utils = require("@mysten/sui/utils");
89
92
  var isHex = (str) => /^0x[0-9a-fA-F]+$|^[0-9a-fA-F]+$/.test(str);
90
93
  var isBase64 = (str) => /^[a-zA-Z0-9+/]+={0,2}$/g.test(str);
91
94
  var fromHEX = (hexStr) => {
@@ -129,7 +132,6 @@ var generateMnemonic = (numberOfWords = 24) => {
129
132
  };
130
133
 
131
134
  // src/libs/suiAccountManager/index.ts
132
- var import_cryptography = require("@mysten/sui.js/cryptography");
133
135
  var SuiAccountManager = class {
134
136
  /**
135
137
  * Support the following ways to init the SuiToolkit:
@@ -196,14 +198,14 @@ var SuiAccountManager = class {
196
198
  };
197
199
 
198
200
  // src/libs/suiTxBuilder/index.ts
199
- var import_transactions2 = require("@mysten/sui.js/transactions");
200
- var import_utils3 = require("@mysten/sui.js/utils");
201
+ var import_transactions2 = require("@mysten/sui/transactions");
202
+ var import_utils3 = require("@mysten/sui/utils");
201
203
 
202
204
  // src/libs/suiTxBuilder/util.ts
203
- var import_utils2 = require("@mysten/sui.js/utils");
204
- var import_transactions = require("@mysten/sui.js/transactions");
205
- var import_bcs = require("@mysten/sui.js/bcs");
206
- var import_bcs2 = require("@mysten/bcs");
205
+ var import_utils2 = require("@mysten/sui/utils");
206
+ var import_transactions = require("@mysten/sui/transactions");
207
+ var import_bcs = require("@mysten/bcs");
208
+ var import_bcs2 = require("@mysten/sui/bcs");
207
209
  var getDefaultSuiInputType = (value) => {
208
210
  if (typeof value === "string" && (0, import_utils2.isValidSuiObjectId)(value)) {
209
211
  return "object";
@@ -215,7 +217,10 @@ var getDefaultSuiInputType = (value) => {
215
217
  return void 0;
216
218
  }
217
219
  };
218
- function makeVecParam(txBlock, args, type) {
220
+ function isPureArg(arg) {
221
+ return arg.Pure !== void 0;
222
+ }
223
+ function makeVecParam(tx, args, type) {
219
224
  if (args.length === 0)
220
225
  throw new Error("Transaction builder error: Empty array is not allowed");
221
226
  const defaultSuiType = getDefaultSuiInputType(args[0]);
@@ -223,17 +228,33 @@ function makeVecParam(txBlock, args, type) {
223
228
  const STRUCT_REGEX = /^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;
224
229
  type = type || defaultSuiType;
225
230
  if (type === "object") {
226
- const objects = args.map(
227
- (arg) => typeof arg === "string" && (0, import_utils2.isValidSuiObjectId)(arg) ? txBlock.object((0, import_utils2.normalizeSuiObjectId)(arg)) : convertObjArg(txBlock, arg)
231
+ const elements = args.map(
232
+ (arg) => typeof arg === "string" && (0, import_utils2.isValidSuiObjectId)(arg) ? tx.object((0, import_utils2.normalizeSuiObjectId)(arg)) : convertObjArg(tx, arg)
228
233
  );
229
- return txBlock.makeMoveVec({ objects });
234
+ return tx.makeMoveVec({ elements });
230
235
  } else if (typeof type === "string" && !VECTOR_REGEX.test(type) && !STRUCT_REGEX.test(type)) {
231
- return txBlock.pure(args, `vector<${type}>`);
236
+ if (type === "address") {
237
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.Address).serialize(args));
238
+ } else if (type === "bool") {
239
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.Bool).serialize(args));
240
+ } else if (type === "u8") {
241
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U8).serialize(args));
242
+ } else if (type === "u16") {
243
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U16).serialize(args));
244
+ } else if (type === "u32") {
245
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U32).serialize(args));
246
+ } else if (type === "u64") {
247
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U64).serialize(args));
248
+ } else if (type === "u128") {
249
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U128).serialize(args));
250
+ } else if (type === "u256") {
251
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U256).serialize(args));
252
+ } else {
253
+ return tx.pure(import_bcs2.bcs.vector(import_bcs2.bcs.U8).serialize(args));
254
+ }
232
255
  } else {
233
- const objects = args.map(
234
- (arg) => convertObjArg(txBlock, arg)
235
- );
236
- return txBlock.makeMoveVec({ objects, type });
256
+ const elements = args.map((arg) => convertObjArg(tx, arg));
257
+ return tx.makeMoveVec({ elements, type });
237
258
  }
238
259
  }
239
260
  function isMoveVecArg(arg) {
@@ -244,48 +265,65 @@ function isMoveVecArg(arg) {
244
265
  }
245
266
  return false;
246
267
  }
247
- function convertArgs(txBlock, args) {
268
+ function convertArgs(tx, args) {
248
269
  return args.map((arg) => {
249
270
  if (typeof arg === "string" && (0, import_utils2.isValidSuiObjectId)(arg)) {
250
- return txBlock.object((0, import_utils2.normalizeSuiObjectId)(arg));
251
- } else if (typeof arg == "object" && !(0, import_bcs2.isSerializedBcs)(arg) && !(0, import_bcs.isPureArg)(arg) && !isMoveVecArg(arg)) {
252
- return convertObjArg(txBlock, arg);
271
+ return tx.object((0, import_utils2.normalizeSuiObjectId)(arg));
272
+ } else if (typeof arg == "object" && !(0, import_bcs.isSerializedBcs)(arg) && !isPureArg(arg) && !isMoveVecArg(arg)) {
273
+ return convertObjArg(tx, arg);
253
274
  } else if (isMoveVecArg(arg)) {
254
275
  const vecType = "vecType" in arg;
255
- return vecType ? makeVecParam(txBlock, arg.value, arg.vecType) : makeVecParam(txBlock, arg);
256
- } else if ((0, import_bcs2.isSerializedBcs)(arg)) {
276
+ return vecType ? makeVecParam(tx, arg.value, arg.vecType) : makeVecParam(tx, arg);
277
+ } else if ((0, import_bcs.isSerializedBcs)(arg)) {
257
278
  return arg;
258
279
  } else {
259
- return txBlock.pure(arg);
280
+ let argType = getDefaultSuiInputType(arg);
281
+ if (argType === "address") {
282
+ return tx.pure.address(arg);
283
+ } else if (argType === "u64") {
284
+ return tx.pure.u64(arg);
285
+ } else if (argType === "bool") {
286
+ return tx.pure.bool(arg);
287
+ } else {
288
+ return tx.pure.u64(arg);
289
+ }
260
290
  }
261
291
  });
262
292
  }
263
- function convertAddressArg(txBlock, arg) {
293
+ function convertAddressArg(tx, arg) {
264
294
  if (typeof arg === "string" && (0, import_utils2.isValidSuiAddress)(arg)) {
265
- return txBlock.pure.address((0, import_utils2.normalizeSuiAddress)(arg));
266
- } else if (typeof arg == "object" && !(0, import_bcs2.isSerializedBcs)(arg) && !(0, import_bcs.isPureArg)(arg)) {
267
- return convertObjArg(txBlock, arg);
268
- } else if ((0, import_bcs.isPureArg)(arg)) {
269
- return txBlock.pure(arg);
295
+ return tx.pure.address((0, import_utils2.normalizeSuiAddress)(arg));
296
+ } else if (typeof arg == "object" && !(0, import_bcs.isSerializedBcs)(arg) && !isPureArg(arg)) {
297
+ return convertObjArg(tx, arg);
298
+ } else if (isPureArg(arg)) {
299
+ return tx.pure(Uint8Array.from(arg.Pure));
270
300
  } else {
271
301
  return arg;
272
302
  }
273
303
  }
274
- function convertObjArg(txb, arg) {
304
+ function convertObjArg(tx, arg) {
275
305
  if (typeof arg === "string") {
276
- return txb.object(arg);
306
+ return tx.object(arg);
277
307
  }
278
308
  if ("digest" in arg && "version" in arg && "objectId" in arg) {
279
- return txb.objectRef(arg);
309
+ return tx.objectRef(arg);
280
310
  }
281
311
  if ("objectId" in arg && "initialSharedVersion" in arg && "mutable" in arg) {
282
- return txb.sharedObjectRef(arg);
312
+ return tx.sharedObjectRef(arg);
283
313
  }
284
314
  if ("Object" in arg) {
285
- if ("ImmOrOwned" in arg.Object) {
286
- return txb.object(import_transactions.Inputs.ObjectRef(arg.Object.ImmOrOwned));
287
- } else if ("Shared" in arg.Object) {
288
- return txb.object(import_transactions.Inputs.SharedObjectRef(arg.Object.Shared));
315
+ if ("ImmOrOwnedObject" in arg.Object) {
316
+ return tx.object(
317
+ import_transactions.Inputs.ObjectRef(arg.Object.ImmOrOwnedObject)
318
+ );
319
+ } else if ("SharedObject" in arg.Object) {
320
+ return tx.object(
321
+ import_transactions.Inputs.SharedObjectRef(
322
+ arg.Object.SharedObject
323
+ )
324
+ );
325
+ } else if ("Receiving" in arg.Object) {
326
+ return tx.object(import_transactions.Inputs.ReceivingRef(arg.Object.Receiving));
289
327
  } else {
290
328
  throw new Error("Invalid argument type");
291
329
  }
@@ -297,108 +335,123 @@ function convertObjArg(txb, arg) {
297
335
  }
298
336
 
299
337
  // src/libs/suiTxBuilder/index.ts
300
- var SuiTxBlock = class {
338
+ var SuiTx = class {
301
339
  constructor(transaction) {
302
- this.txBlock = new import_transactions2.TransactionBlock(transaction);
340
+ if (transaction !== void 0) {
341
+ this.tx = import_transactions2.Transaction.from(transaction);
342
+ } else {
343
+ this.tx = new import_transactions2.Transaction();
344
+ }
303
345
  }
304
346
  /* Directly wrap methods and properties of TransactionBlock */
305
347
  get gas() {
306
- return this.txBlock.gas;
348
+ return this.tx.gas;
307
349
  }
308
350
  get blockData() {
309
- return this.txBlock.blockData;
351
+ return this.tx.blockData;
352
+ }
353
+ autoPure(value, type) {
354
+ if (type === void 0) {
355
+ return convertArgs(this.tx, [value]);
356
+ }
357
+ return;
310
358
  }
311
359
  address(value) {
312
- return this.txBlock.pure(value, "address");
360
+ return this.tx.pure.address(value);
313
361
  }
314
- pure(value, type) {
315
- return this.txBlock.pure(value, type);
362
+ pure(value) {
363
+ return this.tx.pure(value);
316
364
  }
317
365
  object(value) {
318
- return this.txBlock.object(value);
366
+ return this.tx.object(value);
319
367
  }
320
368
  objectRef(ref) {
321
- return this.txBlock.objectRef(ref);
369
+ return this.tx.objectRef(ref);
322
370
  }
323
371
  sharedObjectRef(ref) {
324
- return this.txBlock.sharedObjectRef(ref);
372
+ return this.tx.sharedObjectRef(ref);
325
373
  }
326
374
  setSender(sender) {
327
- return this.txBlock.setSender(sender);
375
+ return this.tx.setSender(sender);
328
376
  }
329
377
  setSenderIfNotSet(sender) {
330
- return this.txBlock.setSenderIfNotSet(sender);
378
+ return this.tx.setSenderIfNotSet(sender);
331
379
  }
332
380
  setExpiration(expiration) {
333
- return this.txBlock.setExpiration(expiration);
381
+ return this.tx.setExpiration(expiration);
334
382
  }
335
383
  setGasPrice(price) {
336
- return this.txBlock.setGasPrice(price);
384
+ return this.tx.setGasPrice(price);
337
385
  }
338
386
  setGasBudget(budget) {
339
- return this.txBlock.setGasBudget(budget);
387
+ return this.tx.setGasBudget(budget);
340
388
  }
341
389
  setGasOwner(owner) {
342
- return this.txBlock.setGasOwner(owner);
390
+ return this.tx.setGasOwner(owner);
343
391
  }
344
392
  setGasPayment(payments) {
345
- return this.txBlock.setGasPayment(payments);
393
+ return this.tx.setGasPayment(payments);
346
394
  }
347
395
  serialize() {
348
- return this.txBlock.serialize();
396
+ return this.tx.serialize();
349
397
  }
350
398
  sign(params) {
351
- return this.txBlock.sign(params);
399
+ return this.tx.sign(params);
352
400
  }
353
401
  build(params = {}) {
354
- return this.txBlock.build(params);
402
+ return this.tx.build(params);
355
403
  }
356
404
  getDigest(params = {}) {
357
- return this.txBlock.getDigest(params);
405
+ return this.tx.getDigest(params);
358
406
  }
359
407
  add(...args) {
360
- return this.txBlock.add(...args);
408
+ return this.tx.add(...args);
361
409
  }
362
410
  publish({
363
411
  modules,
364
412
  dependencies
365
413
  }) {
366
- return this.txBlock.publish({ modules, dependencies });
414
+ return this.tx.publish({ modules, dependencies });
367
415
  }
368
416
  upgrade({
369
417
  modules,
370
418
  dependencies,
371
- packageId,
419
+ package: packageId,
372
420
  ticket
373
421
  }) {
374
- return this.txBlock.upgrade({ modules, dependencies, packageId, ticket });
422
+ return this.tx.upgrade({
423
+ modules,
424
+ dependencies,
425
+ package: packageId,
426
+ ticket
427
+ });
375
428
  }
376
429
  makeMoveVec({
377
- objects,
430
+ elements,
378
431
  type
379
432
  }) {
380
- return this.txBlock.makeMoveVec({ objects, type });
433
+ return this.tx.makeMoveVec({ elements, type });
381
434
  }
382
435
  /* Override methods of TransactionBlock */
383
436
  transferObjects(objects, address) {
384
- return this.txBlock.transferObjects(
385
- objects.map((object) => convertObjArg(this.txBlock, object)),
386
- convertAddressArg(this.txBlock, address)
437
+ return this.tx.transferObjects(
438
+ objects.map((object) => convertObjArg(this.tx, object)),
439
+ convertAddressArg(this.tx, address)
387
440
  );
388
441
  }
389
442
  splitCoins(coin, amounts) {
390
- const res = this.txBlock.splitCoins(
391
- convertObjArg(this.txBlock, coin),
392
- convertArgs(this.txBlock, amounts)
443
+ const res = this.tx.splitCoins(
444
+ convertObjArg(this.tx, coin),
445
+ convertArgs(this.tx, amounts)
393
446
  );
394
447
  return amounts.map((_, i) => res[i]);
395
448
  }
396
449
  mergeCoins(destination, sources) {
397
- const destinationObject = convertObjArg(this.txBlock, destination);
450
+ const destinationObject = convertObjArg(this.tx, destination);
398
451
  const sourceObjects = sources.map(
399
- (source) => convertObjArg(this.txBlock, source)
452
+ (source) => convertObjArg(this.tx, source)
400
453
  );
401
- return this.txBlock.mergeCoins(destinationObject, sourceObjects);
454
+ return this.tx.mergeCoins(destinationObject, sourceObjects);
402
455
  }
403
456
  /**
404
457
  * @description Move call
@@ -413,8 +466,8 @@ var SuiTxBlock = class {
413
466
  throw new Error(
414
467
  "Invalid target format. Expected `${string}::${string}::${string}`"
415
468
  );
416
- const convertedArgs = convertArgs(this.txBlock, args);
417
- return this.txBlock.moveCall({
469
+ const convertedArgs = convertArgs(this.tx, args);
470
+ return this.tx.moveCall({
418
471
  target,
419
472
  arguments: convertedArgs,
420
473
  typeArguments: typeArgs
@@ -427,15 +480,15 @@ var SuiTxBlock = class {
427
480
  "transferSuiToMany: recipients.length !== amounts.length"
428
481
  );
429
482
  }
430
- const coins = this.txBlock.splitCoins(
431
- this.txBlock.gas,
432
- convertArgs(this.txBlock, amounts)
483
+ const coins = this.tx.splitCoins(
484
+ this.tx.gas,
485
+ convertArgs(this.tx, amounts)
433
486
  );
434
487
  const recipientObjects = recipients.map(
435
- (recipient) => convertAddressArg(this.txBlock, recipient)
488
+ (recipient) => convertAddressArg(this.tx, recipient)
436
489
  );
437
490
  recipientObjects.forEach((address, index) => {
438
- this.txBlock.transferObjects([coins[index]], address);
491
+ this.tx.transferObjects([coins[index]], address);
439
492
  });
440
493
  return this;
441
494
  }
@@ -443,32 +496,29 @@ var SuiTxBlock = class {
443
496
  return this.transferSuiToMany([address], [amount]);
444
497
  }
445
498
  takeAmountFromCoins(coins, amount) {
446
- const coinObjects = coins.map((coin) => convertObjArg(this.txBlock, coin));
499
+ const coinObjects = coins.map((coin) => convertObjArg(this.tx, coin));
447
500
  const mergedCoin = coinObjects[0];
448
501
  if (coins.length > 1) {
449
- this.txBlock.mergeCoins(mergedCoin, coinObjects.slice(1));
502
+ this.tx.mergeCoins(mergedCoin, coinObjects.slice(1));
450
503
  }
451
- const [sendCoin] = this.txBlock.splitCoins(
504
+ const [sendCoin] = this.tx.splitCoins(
452
505
  mergedCoin,
453
- convertArgs(this.txBlock, [amount])
506
+ convertArgs(this.tx, [amount])
454
507
  );
455
508
  return [sendCoin, mergedCoin];
456
509
  }
457
510
  splitSUIFromGas(amounts) {
458
- return this.txBlock.splitCoins(
459
- this.txBlock.gas,
460
- convertArgs(this.txBlock, amounts)
461
- );
511
+ return this.tx.splitCoins(this.tx.gas, convertArgs(this.tx, amounts));
462
512
  }
463
513
  splitMultiCoins(coins, amounts) {
464
- const coinObjects = coins.map((coin) => convertObjArg(this.txBlock, coin));
514
+ const coinObjects = coins.map((coin) => convertObjArg(this.tx, coin));
465
515
  const mergedCoin = coinObjects[0];
466
516
  if (coins.length > 1) {
467
- this.txBlock.mergeCoins(mergedCoin, coinObjects.slice(1));
517
+ this.tx.mergeCoins(mergedCoin, coinObjects.slice(1));
468
518
  }
469
- const splitedCoins = this.txBlock.splitCoins(
519
+ const splitedCoins = this.tx.splitCoins(
470
520
  mergedCoin,
471
- convertArgs(this.txBlock, amounts)
521
+ convertArgs(this.tx, amounts)
472
522
  );
473
523
  return { splitedCoins, mergedCoin };
474
524
  }
@@ -478,45 +528,42 @@ var SuiTxBlock = class {
478
528
  "transferSuiToMany: recipients.length !== amounts.length"
479
529
  );
480
530
  }
481
- const coinObjects = coins.map((coin) => convertObjArg(this.txBlock, coin));
531
+ const coinObjects = coins.map((coin) => convertObjArg(this.tx, coin));
482
532
  const { splitedCoins, mergedCoin } = this.splitMultiCoins(
483
533
  coinObjects,
484
534
  amounts
485
535
  );
486
536
  const recipientObjects = recipients.map(
487
- (recipient) => convertAddressArg(this.txBlock, recipient)
537
+ (recipient) => convertAddressArg(this.tx, recipient)
488
538
  );
489
539
  recipientObjects.forEach((address, index) => {
490
- this.txBlock.transferObjects([splitedCoins[index]], address);
540
+ this.tx.transferObjects([splitedCoins[index]], address);
491
541
  });
492
- this.txBlock.transferObjects(
493
- [mergedCoin],
494
- convertAddressArg(this.txBlock, sender)
495
- );
542
+ this.tx.transferObjects([mergedCoin], convertAddressArg(this.tx, sender));
496
543
  return this;
497
544
  }
498
545
  transferCoin(coins, sender, recipient, amount) {
499
546
  return this.transferCoinToMany(coins, sender, [recipient], [amount]);
500
547
  }
501
548
  stakeSui(amount, validatorAddr) {
502
- const [stakeCoin] = this.txBlock.splitCoins(
503
- this.txBlock.gas,
504
- convertArgs(this.txBlock, [amount])
549
+ const [stakeCoin] = this.tx.splitCoins(
550
+ this.tx.gas,
551
+ convertArgs(this.tx, [amount])
505
552
  );
506
- return this.txBlock.moveCall({
553
+ return this.tx.moveCall({
507
554
  target: "0x3::sui_system::request_add_stake",
508
- arguments: convertArgs(this.txBlock, [
555
+ arguments: convertArgs(this.tx, [
509
556
  import_utils3.SUI_SYSTEM_STATE_OBJECT_ID,
510
557
  stakeCoin,
511
- this.txBlock.pure(validatorAddr)
558
+ this.tx.pure.address(validatorAddr.toString())
512
559
  ])
513
560
  });
514
561
  }
515
562
  };
516
563
 
517
564
  // src/libs/suiInteractor/suiInteractor.ts
518
- var import_client = require("@mysten/sui.js/client");
519
- var import_faucet = require("@mysten/sui.js/faucet");
565
+ var import_client = require("@mysten/sui/client");
566
+ var import_faucet = require("@mysten/sui/faucet");
520
567
 
521
568
  // src/libs/suiModel/suiOwnedObject.ts
522
569
  var SuiOwnedObject = class {
@@ -538,8 +585,10 @@ var SuiOwnedObject = class {
538
585
  return this.objectId;
539
586
  }
540
587
  return {
588
+ $kind: "Object",
541
589
  Object: {
542
- ImmOrOwned: {
590
+ $kind: "ImmOrOwnedObject",
591
+ ImmOrOwnedObject: {
543
592
  objectId: this.objectId,
544
593
  version: this.version,
545
594
  digest: this.digest
@@ -578,8 +627,10 @@ var SuiSharedObject = class {
578
627
  return this.objectId;
579
628
  }
580
629
  return {
630
+ $kind: "Object",
581
631
  Object: {
582
- Shared: {
632
+ $kind: "SharedObject",
633
+ SharedObject: {
583
634
  objectId: this.objectId,
584
635
  initialSharedVersion: this.initialSharedVersion,
585
636
  mutable
@@ -939,7 +990,6 @@ function numberToAddressHex(num) {
939
990
  }
940
991
 
941
992
  // src/obelisk.ts
942
- var import_keccak256 = __toESM(require("keccak256"));
943
993
  var import_bcs3 = require("@mysten/bcs");
944
994
  function isUndefined(value) {
945
995
  return value === void 0;
@@ -965,7 +1015,7 @@ function createTx(meta, fn) {
965
1015
  }
966
1016
  );
967
1017
  }
968
- var _query, _tx, _exec, _read;
1018
+ var _query, _tx, _struct, _exec, _read;
969
1019
  var Obelisk = class {
970
1020
  /**
971
1021
  * Support the following ways to init the ObeliskClient:
@@ -989,6 +1039,7 @@ var Obelisk = class {
989
1039
  } = {}) {
990
1040
  __privateAdd(this, _query, {});
991
1041
  __privateAdd(this, _tx, {});
1042
+ __privateAdd(this, _struct, {});
992
1043
  __privateAdd(this, _exec, async (meta, tx, params, typeArguments, isRaw) => {
993
1044
  if (isRaw === true) {
994
1045
  return tx.moveCall({
@@ -1025,33 +1076,37 @@ var Obelisk = class {
1025
1076
  this.packageId = packageId;
1026
1077
  if (metadata !== void 0) {
1027
1078
  this.metadata = metadata;
1028
- Object.values(metadata).forEach((value) => {
1029
- const data = value;
1030
- const moduleName = data.name;
1031
- Object.entries(data.exposedFunctions).forEach(([funcName, value2]) => {
1032
- const meta = value2;
1033
- meta.moduleName = moduleName;
1034
- meta.funcName = funcName;
1035
- if (isUndefined(__privateGet(this, _query)[moduleName])) {
1036
- __privateGet(this, _query)[moduleName] = {};
1037
- }
1038
- if (isUndefined(__privateGet(this, _query)[moduleName][funcName])) {
1039
- __privateGet(this, _query)[moduleName][funcName] = createQuery(
1040
- meta,
1041
- (tx, p, typeArguments, isRaw) => __privateGet(this, _read).call(this, meta, tx, p, typeArguments, isRaw)
1042
- );
1043
- }
1044
- if (isUndefined(__privateGet(this, _tx)[moduleName])) {
1045
- __privateGet(this, _tx)[moduleName] = {};
1046
- }
1047
- if (isUndefined(__privateGet(this, _tx)[moduleName][funcName])) {
1048
- __privateGet(this, _tx)[moduleName][funcName] = createTx(
1049
- meta,
1050
- (tx, p, typeArguments, isRaw) => __privateGet(this, _exec).call(this, meta, tx, p, typeArguments, isRaw)
1051
- );
1052
- }
1053
- });
1054
- });
1079
+ Object.values(metadata).forEach(
1080
+ (moudlevalue) => {
1081
+ const data = moudlevalue;
1082
+ const moduleName = data.name;
1083
+ Object.entries(data.exposedFunctions).forEach(
1084
+ ([funcName, funcvalue]) => {
1085
+ const meta = funcvalue;
1086
+ meta.moduleName = moduleName;
1087
+ meta.funcName = funcName;
1088
+ if (isUndefined(__privateGet(this, _query)[moduleName])) {
1089
+ __privateGet(this, _query)[moduleName] = {};
1090
+ }
1091
+ if (isUndefined(__privateGet(this, _query)[moduleName][funcName])) {
1092
+ __privateGet(this, _query)[moduleName][funcName] = createQuery(
1093
+ meta,
1094
+ (tx, p, typeArguments, isRaw) => __privateGet(this, _read).call(this, meta, tx, p, typeArguments, isRaw)
1095
+ );
1096
+ }
1097
+ if (isUndefined(__privateGet(this, _tx)[moduleName])) {
1098
+ __privateGet(this, _tx)[moduleName] = {};
1099
+ }
1100
+ if (isUndefined(__privateGet(this, _tx)[moduleName][funcName])) {
1101
+ __privateGet(this, _tx)[moduleName][funcName] = createTx(
1102
+ meta,
1103
+ (tx, p, typeArguments, isRaw) => __privateGet(this, _exec).call(this, meta, tx, p, typeArguments, isRaw)
1104
+ );
1105
+ }
1106
+ }
1107
+ );
1108
+ }
1109
+ );
1055
1110
  }
1056
1111
  this.contractFactory = new SuiContractFactory({
1057
1112
  packageId,
@@ -1064,6 +1119,9 @@ var Obelisk = class {
1064
1119
  get tx() {
1065
1120
  return __privateGet(this, _tx);
1066
1121
  }
1122
+ get struct() {
1123
+ return __privateGet(this, _struct);
1124
+ }
1067
1125
  /**
1068
1126
  * if derivePathParams is not provided or mnemonics is empty, it will return the keypair.
1069
1127
  * else:
@@ -1096,11 +1154,20 @@ var Obelisk = class {
1096
1154
  getMetadata() {
1097
1155
  return this.contractFactory.metadata;
1098
1156
  }
1157
+ getNetwork() {
1158
+ return this.suiInteractor.network;
1159
+ }
1099
1160
  /**
1100
1161
  * Request some SUI from faucet
1101
1162
  * @Returns {Promise<boolean>}, true if the request is successful, false otherwise.
1102
1163
  */
1103
- async requestFaucet(address, network) {
1164
+ async requestFaucet(address, network, derivePathParams) {
1165
+ if (address === void 0) {
1166
+ address = this.accountManager.getAddress(derivePathParams);
1167
+ }
1168
+ if (network === void 0) {
1169
+ network = this.getNetwork();
1170
+ }
1104
1171
  return this.suiInteractor.requestFaucet(address, network);
1105
1172
  }
1106
1173
  async getBalance(coinType, derivePathParams) {
@@ -1124,18 +1191,21 @@ var Obelisk = class {
1124
1191
  return this.suiInteractor.getObjects(objectIds);
1125
1192
  }
1126
1193
  async signTxn(tx, derivePathParams) {
1127
- if (tx instanceof SuiTxBlock || tx instanceof import_transactions3.TransactionBlock) {
1194
+ if (tx instanceof SuiTx || tx instanceof import_transactions3.Transaction) {
1128
1195
  tx.setSender(this.getAddress(derivePathParams));
1129
1196
  }
1130
- const txBlock = tx instanceof SuiTxBlock ? tx.txBlock : tx;
1131
- const txBytes = txBlock instanceof import_transactions3.TransactionBlock ? await txBlock.build({ client: this.client() }) : txBlock;
1197
+ const txBlock = tx instanceof SuiTx ? tx.tx : tx;
1198
+ const txBytes = txBlock instanceof import_transactions3.Transaction ? await txBlock.build({ client: this.client() }) : txBlock;
1132
1199
  const keyPair = this.getKeypair(derivePathParams);
1133
- return await keyPair.signTransactionBlock(txBytes);
1200
+ return await keyPair.signTransaction(txBytes);
1134
1201
  }
1135
1202
  async signAndSendTxn(tx, derivePathParams) {
1136
1203
  const { bytes, signature } = await this.signTxn(tx, derivePathParams);
1137
1204
  return this.suiInteractor.sendTx(bytes, signature);
1138
1205
  }
1206
+ async sendTxn(transactionBlock, signature) {
1207
+ return this.suiInteractor.sendTx(transactionBlock, signature);
1208
+ }
1139
1209
  /**
1140
1210
  * Transfer the given amount of SUI to the recipient
1141
1211
  * @param recipient
@@ -1143,7 +1213,7 @@ var Obelisk = class {
1143
1213
  * @param derivePathParams
1144
1214
  */
1145
1215
  async transferSui(recipient, amount, derivePathParams) {
1146
- const tx = new SuiTxBlock();
1216
+ const tx = new SuiTx();
1147
1217
  tx.transferSui(recipient, amount);
1148
1218
  return this.signAndSendTxn(tx, derivePathParams);
1149
1219
  }
@@ -1154,7 +1224,7 @@ var Obelisk = class {
1154
1224
  * @param derivePathParams
1155
1225
  */
1156
1226
  async transferSuiToMany(recipients, amounts, derivePathParams) {
1157
- const tx = new SuiTxBlock();
1227
+ const tx = new SuiTx();
1158
1228
  tx.transferSuiToMany(recipients, amounts);
1159
1229
  return this.signAndSendTxn(tx, derivePathParams);
1160
1230
  }
@@ -1166,7 +1236,7 @@ var Obelisk = class {
1166
1236
  * @param derivePathParams the derive path params for the current signer
1167
1237
  */
1168
1238
  async transferCoinToMany(recipients, amounts, coinType, derivePathParams) {
1169
- const tx = new SuiTxBlock();
1239
+ const tx = new SuiTx();
1170
1240
  const owner = this.accountManager.getAddress(derivePathParams);
1171
1241
  const totalAmount = amounts.reduce((a, b) => a + b, 0);
1172
1242
  const coins = await this.suiInteractor.selectCoins(
@@ -1191,7 +1261,7 @@ var Obelisk = class {
1191
1261
  );
1192
1262
  }
1193
1263
  async transferObjects(objects, recipient, derivePathParams) {
1194
- const tx = new SuiTxBlock();
1264
+ const tx = new SuiTx();
1195
1265
  tx.transferObjects(objects, recipient);
1196
1266
  return this.signAndSendTxn(tx, derivePathParams);
1197
1267
  }
@@ -1202,7 +1272,7 @@ var Obelisk = class {
1202
1272
  typeArguments = [],
1203
1273
  derivePathParams
1204
1274
  } = callParams;
1205
- const tx = new SuiTxBlock();
1275
+ const tx = new SuiTx();
1206
1276
  tx.moveCall(target, args, typeArguments);
1207
1277
  return this.signAndSendTxn(tx, derivePathParams);
1208
1278
  }
@@ -1229,7 +1299,7 @@ var Obelisk = class {
1229
1299
  * @param derivePathParams the derive path params for the current signer
1230
1300
  */
1231
1301
  async stakeSui(amount, validatorAddr, derivePathParams) {
1232
- const tx = new SuiTxBlock();
1302
+ const tx = new SuiTx();
1233
1303
  tx.stakeSui(amount, validatorAddr);
1234
1304
  return this.signAndSendTxn(tx, derivePathParams);
1235
1305
  }
@@ -1241,7 +1311,7 @@ var Obelisk = class {
1241
1311
  * @returns the effects and events of the transaction, such as object changes, gas cost, event emitted.
1242
1312
  */
1243
1313
  async inspectTxn(tx, derivePathParams) {
1244
- const txBlock = tx instanceof SuiTxBlock ? tx.txBlock : tx;
1314
+ const txBlock = tx instanceof SuiTx ? tx.tx : tx;
1245
1315
  return this.suiInteractor.currentClient.devInspectTransactionBlock({
1246
1316
  transactionBlock: txBlock,
1247
1317
  sender: this.getAddress(derivePathParams)
@@ -1263,36 +1333,62 @@ var Obelisk = class {
1263
1333
  }
1264
1334
  async getEntity(worldId, schemaName, entityId) {
1265
1335
  const schemaModuleName = `${schemaName}_schema`;
1266
- const tx = new import_transactions3.TransactionBlock();
1267
- const params = [tx.pure(worldId)];
1336
+ const tx = new import_transactions3.Transaction();
1337
+ const params = [tx.pure.address(worldId)];
1268
1338
  if (entityId !== void 0) {
1269
- params.push(tx.pure(entityId));
1339
+ params.push(tx.pure.address(entityId));
1270
1340
  }
1271
1341
  const getResult = await this.query[schemaModuleName].get(
1272
1342
  tx,
1273
1343
  params
1274
1344
  );
1275
- let returnValue = [];
1345
+ let returnValues = [];
1276
1346
  if (getResult.effects.status.status === "success") {
1277
1347
  const resultList = getResult.results[0].returnValues;
1278
1348
  for (const res of resultList) {
1279
- const bcs = new import_bcs3.BCS((0, import_bcs3.getSuiMoveConfig)());
1280
- const value = Uint8Array.from(res[0]);
1281
- const bcsType = res[1].replace(/0x1::ascii::String/g, "string");
1282
- const data = bcs.de(bcsType, value);
1283
- returnValue.push(data);
1349
+ let baseValue = res[0];
1350
+ let baseType = res[1];
1351
+ const value = Uint8Array.from(baseValue);
1352
+ if (baseType === "address") {
1353
+ const Address = import_bcs3.bcs.bytes(32).transform({
1354
+ // To change the input type, you need to provide a type definition for the input
1355
+ input: (val) => (0, import_bcs3.fromHEX)(val),
1356
+ output: (val) => (0, import_bcs3.toHEX)(val)
1357
+ });
1358
+ returnValues.push(Address.parse(value));
1359
+ } else if (baseType === "u8") {
1360
+ returnValues.push(import_bcs3.bcs.u8().parse(value));
1361
+ } else if (baseType === "u16") {
1362
+ returnValues.push(import_bcs3.bcs.u16().parse(value));
1363
+ } else if (baseType === "u32") {
1364
+ returnValues.push(import_bcs3.bcs.u32().parse(value));
1365
+ } else if (baseType === "u64") {
1366
+ returnValues.push(import_bcs3.bcs.u64().parse(value));
1367
+ } else if (baseType === "u128") {
1368
+ returnValues.push(import_bcs3.bcs.u128().parse(value));
1369
+ } else if (baseType === "u256") {
1370
+ returnValues.push(import_bcs3.bcs.u256().parse(value));
1371
+ } else if (baseType === "bool") {
1372
+ returnValues.push(import_bcs3.bcs.bool().parse(value));
1373
+ } else if (baseType === "0x1::ascii::String") {
1374
+ returnValues.push(import_bcs3.bcs.string().parse(value));
1375
+ } else if (baseType === "vector<u8>") {
1376
+ returnValues.push(import_bcs3.bcs.vector(import_bcs3.bcs.u8()).parse(value));
1377
+ } else if (baseType === "0x1::option::Option<u8>") {
1378
+ returnValues.push(import_bcs3.bcs.option(import_bcs3.bcs.u8()).parse(value));
1379
+ }
1284
1380
  }
1285
- return returnValue;
1381
+ return returnValues;
1286
1382
  } else {
1287
1383
  return void 0;
1288
1384
  }
1289
1385
  }
1290
1386
  async containEntity(worldId, schemaName, entityId) {
1291
1387
  const schemaModuleName = `${schemaName}_schema`;
1292
- const tx = new import_transactions3.TransactionBlock();
1293
- const params = [tx.pure(worldId)];
1388
+ const tx = new import_transactions3.Transaction();
1389
+ const params = [tx.pure.address(worldId)];
1294
1390
  if (entityId !== void 0) {
1295
- params.push(tx.pure(entityId));
1391
+ params.push(tx.pure.address(entityId));
1296
1392
  }
1297
1393
  const getResult = await this.query[schemaModuleName].contains(
1298
1394
  tx,
@@ -1300,9 +1396,9 @@ var Obelisk = class {
1300
1396
  );
1301
1397
  if (getResult.effects.status.status === "success") {
1302
1398
  const res = getResult.results[0].returnValues[0];
1303
- const bcs = new import_bcs3.BCS((0, import_bcs3.getSuiMoveConfig)());
1304
- const value = Uint8Array.from(res[0]);
1305
- return bcs.de(res[1], value);
1399
+ let baseValue = res[0];
1400
+ const value = Uint8Array.from(baseValue);
1401
+ return import_bcs3.bcs.bool().parse(value);
1306
1402
  } else {
1307
1403
  return void 0;
1308
1404
  }
@@ -1364,9 +1460,13 @@ var Obelisk = class {
1364
1460
  async entity_key_from_bytes(bytes) {
1365
1461
  const hashBytes = (0, import_keccak256.default)(bytes);
1366
1462
  const hashU8Array = Array.from(hashBytes);
1367
- const bcs = new import_bcs3.BCS((0, import_bcs3.getSuiMoveConfig)());
1368
1463
  const value = Uint8Array.from(hashU8Array);
1369
- const data = bcs.de("address", value);
1464
+ const Address = import_bcs3.bcs.bytes(32).transform({
1465
+ // To change the input type, you need to provide a type definition for the input
1466
+ input: (val) => (0, import_bcs3.fromHEX)(val),
1467
+ output: (val) => (0, import_bcs3.toHEX)(val)
1468
+ });
1469
+ const data = Address.parse(value);
1370
1470
  return "0x" + data;
1371
1471
  }
1372
1472
  async entity_key_from_address_with_seed(objectId, seed) {
@@ -1384,9 +1484,8 @@ var Obelisk = class {
1384
1484
  const checkObjectId = normalizeHexAddress(objectId);
1385
1485
  if (checkObjectId !== null) {
1386
1486
  objectId = checkObjectId;
1387
- const bcs = new import_bcs3.BCS((0, import_bcs3.getSuiMoveConfig)());
1388
1487
  const bytes = Buffer.from(objectId.slice(2), "hex");
1389
- const numberBytes = bcs.ser("u256", x).toBytes();
1488
+ const numberBytes = import_bcs3.bcs.u256().serialize(x).toBytes();
1390
1489
  return this.entity_key_from_bytes(Buffer.concat([bytes, numberBytes]));
1391
1490
  } else {
1392
1491
  return void 0;
@@ -1395,23 +1494,65 @@ var Obelisk = class {
1395
1494
  async entity_key_from_u256(x) {
1396
1495
  return numberToAddressHex(x);
1397
1496
  }
1398
- async formatData(type, value) {
1399
- const bcs = new import_bcs3.BCS((0, import_bcs3.getSuiMoveConfig)());
1400
- const u8Value = Uint8Array.from(value);
1401
- return bcs.de(type, u8Value);
1497
+ // async formatData(type: string, value: Buffer | number[] | Uint8Array) {
1498
+ // const u8Value = Uint8Array.from(value);
1499
+ // return bcs.de(type, u8Value);
1500
+ // }
1501
+ async autoFormatDryValue(value) {
1502
+ let returnValues = [];
1503
+ if (value.effects.status.status === "success") {
1504
+ const resultList = value.results[0].returnValues;
1505
+ for (const res of resultList) {
1506
+ let baseValue = res[0];
1507
+ let baseType = res[1];
1508
+ const value2 = Uint8Array.from(baseValue);
1509
+ if (baseType === "address") {
1510
+ const Address = import_bcs3.bcs.bytes(32).transform({
1511
+ // To change the input type, you need to provide a type definition for the input
1512
+ input: (val) => (0, import_bcs3.fromHEX)(val),
1513
+ output: (val) => (0, import_bcs3.toHEX)(val)
1514
+ });
1515
+ returnValues.push(Address.parse(value2));
1516
+ } else if (baseType === "u8") {
1517
+ returnValues.push(import_bcs3.bcs.u8().parse(value2));
1518
+ } else if (baseType === "u16") {
1519
+ returnValues.push(import_bcs3.bcs.u16().parse(value2));
1520
+ } else if (baseType === "u32") {
1521
+ returnValues.push(import_bcs3.bcs.u32().parse(value2));
1522
+ } else if (baseType === "u64") {
1523
+ returnValues.push(import_bcs3.bcs.u64().parse(value2));
1524
+ } else if (baseType === "u128") {
1525
+ returnValues.push(import_bcs3.bcs.u128().parse(value2));
1526
+ } else if (baseType === "u256") {
1527
+ returnValues.push(import_bcs3.bcs.u256().parse(value2));
1528
+ } else if (baseType === "bool") {
1529
+ returnValues.push(import_bcs3.bcs.bool().parse(value2));
1530
+ } else if (baseType === "0x1::ascii::String") {
1531
+ returnValues.push(import_bcs3.bcs.string().parse(value2));
1532
+ } else if (baseType === "vector<u8>") {
1533
+ returnValues.push(import_bcs3.bcs.vector(import_bcs3.bcs.u8()).parse(value2));
1534
+ } else if (baseType === "0x1::option::Option<u8>") {
1535
+ returnValues.push(import_bcs3.bcs.option(import_bcs3.bcs.u8()).parse(value2));
1536
+ }
1537
+ }
1538
+ return returnValues;
1539
+ } else {
1540
+ return void 0;
1541
+ }
1402
1542
  }
1403
1543
  };
1404
1544
  _query = new WeakMap();
1405
1545
  _tx = new WeakMap();
1546
+ _struct = new WeakMap();
1406
1547
  _exec = new WeakMap();
1407
1548
  _read = new WeakMap();
1408
1549
 
1409
1550
  // src/libs/multiSig/client.ts
1410
- var import_multisig = require("@mysten/sui.js/multisig");
1551
+ var import_multisig = require("@mysten/sui/multisig");
1411
1552
 
1412
1553
  // src/libs/multiSig/publickey.ts
1413
- var import_ed255193 = require("@mysten/sui.js/keypairs/ed25519");
1414
- var import_utils5 = require("@mysten/sui.js/utils");
1554
+ var import_ed255193 = require("@mysten/sui/keypairs/ed25519");
1555
+ var import_utils5 = require("@mysten/sui/utils");
1415
1556
  function ed25519PublicKeyFromBase64(rawPubkey) {
1416
1557
  let bytes = (0, import_utils5.fromB64)(rawPubkey);
1417
1558
  if (bytes.length !== 32 && bytes.length !== 33)
@@ -1448,7 +1589,7 @@ var MultiSigClient = class _MultiSigClient {
1448
1589
  };
1449
1590
 
1450
1591
  // src/metadata/index.ts
1451
- var import_client4 = require("@mysten/sui.js/client");
1592
+ var import_client4 = require("@mysten/sui/client");
1452
1593
  async function loadMetadata(networkType, packageId) {
1453
1594
  const fullnodeUrls = [(0, import_client4.getFullnodeUrl)(networkType)];
1454
1595
  const suiInteractor = new SuiInteractor(fullnodeUrls);
@@ -1463,19 +1604,20 @@ async function loadMetadata(networkType, packageId) {
1463
1604
  }
1464
1605
  // Annotate the CommonJS export names for ESM import in node:
1465
1606
  0 && (module.exports = {
1466
- BCS,
1607
+ BcsType,
1467
1608
  MultiSigClient,
1468
1609
  Obelisk,
1469
1610
  SuiAccountManager,
1470
1611
  SuiContractFactory,
1471
- SuiTxBlock,
1472
- getSuiMoveConfig,
1612
+ SuiTx,
1613
+ bcs,
1473
1614
  loadMetadata,
1474
- ...require("@mysten/sui.js/client"),
1475
- ...require("@mysten/sui.js/utils"),
1476
- ...require("@mysten/sui.js/transactions"),
1477
- ...require("@mysten/sui.js/keypairs/ed25519"),
1478
- ...require("@mysten/sui.js/keypairs/secp256k1"),
1479
- ...require("@mysten/sui.js/keypairs/secp256r1")
1615
+ ...require("@mysten/sui/client"),
1616
+ ...require("@mysten/sui/utils"),
1617
+ ...require("@mysten/sui/transactions"),
1618
+ ...require("@mysten/sui/bcs"),
1619
+ ...require("@mysten/sui/keypairs/ed25519"),
1620
+ ...require("@mysten/sui/keypairs/secp256k1"),
1621
+ ...require("@mysten/sui/keypairs/secp256r1")
1480
1622
  });
1481
1623
  //# sourceMappingURL=index.js.map