@0xobelisk/sui-client 0.5.18 → 0.5.19

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 (35) hide show
  1. package/dist/index.d.ts +15 -0
  2. package/dist/index.js +93 -134
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +63 -104
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/libs/multiSig/client.d.ts +15 -0
  7. package/dist/libs/multiSig/index.d.ts +1 -0
  8. package/dist/libs/multiSig/publickey.d.ts +2 -0
  9. package/dist/libs/suiAccountManager/crypto.d.ts +1 -0
  10. package/dist/libs/suiAccountManager/index.d.ts +39 -0
  11. package/dist/libs/suiAccountManager/keypair.d.ts +21 -0
  12. package/dist/libs/suiAccountManager/util.d.ts +29 -0
  13. package/dist/libs/suiContractFactory/index.d.ts +20 -0
  14. package/dist/libs/suiContractFactory/types.d.ts +49 -0
  15. package/dist/libs/suiInteractor/index.d.ts +1 -0
  16. package/dist/libs/suiInteractor/suiInteractor.d.ts +50 -0
  17. package/dist/libs/suiInteractor/util.d.ts +1 -0
  18. package/dist/libs/suiModel/index.d.ts +2 -0
  19. package/dist/libs/suiModel/suiOwnedObject.d.ts +24 -0
  20. package/dist/libs/suiModel/suiSharedObject.d.ts +11 -0
  21. package/dist/libs/suiTxBuilder/index.d.ts +538 -0
  22. package/dist/libs/suiTxBuilder/util.d.ts +49 -0
  23. package/dist/metadata/index.d.ts +3 -0
  24. package/dist/obelisk.d.ts +140 -0
  25. package/dist/types/index.d.ts +202 -0
  26. package/dist/utils/index.d.ts +3 -0
  27. package/package.json +2 -5
  28. package/src/libs/multiSig/client.ts +1 -1
  29. package/src/libs/suiAccountManager/index.ts +4 -5
  30. package/src/libs/suiInteractor/index.ts +0 -1
  31. package/src/libs/suiModel/suiOwnedObject.ts +2 -2
  32. package/src/libs/suiModel/suiSharedObject.ts +2 -2
  33. package/src/libs/suiTxBuilder/index.ts +43 -49
  34. package/src/libs/suiTxBuilder/util.ts +65 -129
  35. package/src/types/index.ts +40 -16
@@ -0,0 +1,15 @@
1
+ export * from '@mysten/sui/client';
2
+ export * from '@mysten/sui/utils';
3
+ export * from '@mysten/sui/transactions';
4
+ export * from '@mysten/sui/bcs';
5
+ export * from '@mysten/sui/keypairs/ed25519';
6
+ export * from '@mysten/sui/keypairs/secp256k1';
7
+ export * from '@mysten/sui/keypairs/secp256r1';
8
+ export { bcs, BcsType } from '@mysten/bcs';
9
+ export { Obelisk } from './obelisk';
10
+ export { SuiAccountManager } from './libs/suiAccountManager';
11
+ export { SuiTx } from './libs/suiTxBuilder';
12
+ export { MultiSigClient } from './libs/multiSig';
13
+ export { SuiContractFactory } from './libs/suiContractFactory';
14
+ export { loadMetadata } from './metadata';
15
+ export type * from './types';
package/dist/index.js CHANGED
@@ -44,13 +44,13 @@ var __privateAdd = (obj, member, value) => {
44
44
  // src/index.ts
45
45
  var src_exports = {};
46
46
  __export(src_exports, {
47
- BcsType: () => import_bcs4.BcsType,
47
+ BcsType: () => import_bcs3.BcsType,
48
48
  MultiSigClient: () => MultiSigClient,
49
49
  Obelisk: () => Obelisk,
50
50
  SuiAccountManager: () => SuiAccountManager,
51
51
  SuiContractFactory: () => SuiContractFactory,
52
52
  SuiTx: () => SuiTx,
53
- bcs: () => import_bcs4.bcs,
53
+ bcs: () => import_bcs3.bcs,
54
54
  loadMetadata: () => loadMetadata
55
55
  });
56
56
  module.exports = __toCommonJS(src_exports);
@@ -61,7 +61,7 @@ __reExport(src_exports, require("@mysten/sui/bcs"), module.exports);
61
61
  __reExport(src_exports, require("@mysten/sui/keypairs/ed25519"), module.exports);
62
62
  __reExport(src_exports, require("@mysten/sui/keypairs/secp256k1"), module.exports);
63
63
  __reExport(src_exports, require("@mysten/sui/keypairs/secp256r1"), module.exports);
64
- var import_bcs4 = require("@mysten/bcs");
64
+ var import_bcs3 = require("@mysten/bcs");
65
65
 
66
66
  // src/obelisk.ts
67
67
  var import_keccak256 = __toESM(require("keccak256"));
@@ -70,7 +70,6 @@ var import_transactions3 = require("@mysten/sui/transactions");
70
70
 
71
71
  // src/libs/suiAccountManager/index.ts
72
72
  var import_ed255192 = require("@mysten/sui/keypairs/ed25519");
73
- var import_cryptography = require("@mysten/sui/cryptography");
74
73
 
75
74
  // src/libs/suiAccountManager/keypair.ts
76
75
  var import_ed25519 = require("@mysten/sui/keypairs/ed25519");
@@ -132,6 +131,7 @@ var generateMnemonic = (numberOfWords = 24) => {
132
131
  };
133
132
 
134
133
  // src/libs/suiAccountManager/index.ts
134
+ var import_cryptography = require("@mysten/sui/cryptography");
135
135
  var SuiAccountManager = class {
136
136
  /**
137
137
  * Support the following ways to init the SuiToolkit:
@@ -205,7 +205,6 @@ var import_utils3 = require("@mysten/sui/utils");
205
205
  var import_utils2 = require("@mysten/sui/utils");
206
206
  var import_transactions = require("@mysten/sui/transactions");
207
207
  var import_bcs = require("@mysten/bcs");
208
- var import_bcs2 = require("@mysten/sui/bcs");
209
208
  var getDefaultSuiInputType = (value) => {
210
209
  if (typeof value === "string" && (0, import_utils2.isValidSuiObjectId)(value)) {
211
210
  return "object";
@@ -217,10 +216,7 @@ var getDefaultSuiInputType = (value) => {
217
216
  return void 0;
218
217
  }
219
218
  };
220
- function isPureArg(arg) {
221
- return arg.Pure !== void 0;
222
- }
223
- function makeVecParam(tx, args, type) {
219
+ function makeVecParam(txBlock, args, type) {
224
220
  if (args.length === 0)
225
221
  throw new Error("Transaction builder error: Empty array is not allowed");
226
222
  const defaultSuiType = getDefaultSuiInputType(args[0]);
@@ -229,32 +225,17 @@ function makeVecParam(tx, args, type) {
229
225
  type = type || defaultSuiType;
230
226
  if (type === "object") {
231
227
  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
+ (arg) => typeof arg === "string" && (0, import_utils2.isValidSuiObjectId)(arg) ? txBlock.object((0, import_utils2.normalizeSuiObjectId)(arg)) : convertObjArg(txBlock, arg)
233
229
  );
234
- return tx.makeMoveVec({ elements });
230
+ return txBlock.makeMoveVec({ elements });
235
231
  } else if (typeof type === "string" && !VECTOR_REGEX.test(type) && !STRUCT_REGEX.test(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
+ const bcsSchema = (0, import_transactions.getPureBcsSchema)(type);
233
+ return txBlock.pure(import_bcs.bcs.vector(bcsSchema).serialize(args));
255
234
  } else {
256
- const elements = args.map((arg) => convertObjArg(tx, arg));
257
- return tx.makeMoveVec({ elements, type });
235
+ const elements = args.map(
236
+ (arg) => convertObjArg(txBlock, arg)
237
+ );
238
+ return txBlock.makeMoveVec({ elements, type });
258
239
  }
259
240
  }
260
241
  function isMoveVecArg(arg) {
@@ -265,74 +246,61 @@ function isMoveVecArg(arg) {
265
246
  }
266
247
  return false;
267
248
  }
268
- function convertArgs(tx, args) {
249
+ function convertArgs(txBlock, args) {
269
250
  return args.map((arg) => {
270
- if (typeof arg === "string" && (0, import_utils2.isValidSuiObjectId)(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);
274
- } else if (isMoveVecArg(arg)) {
251
+ if (arg instanceof import_bcs.SerializedBcs || (0, import_bcs.isSerializedBcs)(arg)) {
252
+ return txBlock.pure(arg);
253
+ }
254
+ if (isMoveVecArg(arg)) {
275
255
  const vecType = "vecType" in arg;
276
- return vecType ? makeVecParam(tx, arg.value, arg.vecType) : makeVecParam(tx, arg);
277
- } else if ((0, import_bcs.isSerializedBcs)(arg)) {
278
- return arg;
279
- } else {
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
- }
256
+ return vecType ? makeVecParam(txBlock, arg.value, arg.vecType) : makeVecParam(txBlock, arg);
290
257
  }
258
+ return arg;
291
259
  });
292
260
  }
293
- function convertAddressArg(tx, arg) {
261
+ function convertAddressArg(txBlock, arg) {
294
262
  if (typeof arg === "string" && (0, import_utils2.isValidSuiAddress)(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));
263
+ return txBlock.pure.address((0, import_utils2.normalizeSuiAddress)(arg));
300
264
  } else {
301
- return arg;
265
+ return convertArgs(txBlock, [arg])[0];
302
266
  }
303
267
  }
304
- function convertObjArg(tx, arg) {
268
+ function convertObjArg(txb, arg) {
305
269
  if (typeof arg === "string") {
306
- return tx.object(arg);
270
+ return txb.object(arg);
307
271
  }
308
272
  if ("digest" in arg && "version" in arg && "objectId" in arg) {
309
- return tx.objectRef(arg);
273
+ return txb.objectRef(arg);
310
274
  }
311
275
  if ("objectId" in arg && "initialSharedVersion" in arg && "mutable" in arg) {
312
- return tx.sharedObjectRef(arg);
276
+ return txb.sharedObjectRef(arg);
313
277
  }
314
278
  if ("Object" in arg) {
315
279
  if ("ImmOrOwnedObject" in arg.Object) {
316
- return tx.object(
317
- import_transactions.Inputs.ObjectRef(arg.Object.ImmOrOwnedObject)
318
- );
280
+ return txb.object(import_transactions.Inputs.ObjectRef(arg.Object.ImmOrOwnedObject));
319
281
  } 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));
282
+ return txb.object(import_transactions.Inputs.SharedObjectRef(arg.Object.SharedObject));
327
283
  } else {
328
284
  throw new Error("Invalid argument type");
329
285
  }
330
286
  }
331
- if ("kind" in arg) {
287
+ if (typeof arg === "function") {
288
+ return arg;
289
+ }
290
+ if ("GasCoin" in arg || "Input" in arg || "Result" in arg || "NestedResult" in arg) {
332
291
  return arg;
333
292
  }
334
293
  throw new Error("Invalid argument type");
335
294
  }
295
+ function convertAmounts(txBlock, amounts) {
296
+ return amounts.map((amount) => {
297
+ if (typeof amount === "number" || typeof amount === "bigint") {
298
+ return amount;
299
+ } else {
300
+ return convertArgs(txBlock, [amount])[0];
301
+ }
302
+ });
303
+ }
336
304
 
337
305
  // src/libs/suiTxBuilder/index.ts
338
306
  var SuiTx = class {
@@ -359,8 +327,8 @@ var SuiTx = class {
359
327
  address(value) {
360
328
  return this.tx.pure.address(value);
361
329
  }
362
- pure(value) {
363
- return this.tx.pure(value);
330
+ get pure() {
331
+ return this.tx.pure.bind(this.tx);
364
332
  }
365
333
  object(value) {
366
334
  return this.tx.object(value);
@@ -395,6 +363,9 @@ var SuiTx = class {
395
363
  serialize() {
396
364
  return this.tx.serialize();
397
365
  }
366
+ toJSON() {
367
+ return this.tx.toJSON();
368
+ }
398
369
  sign(params) {
399
370
  return this.tx.sign(params);
400
371
  }
@@ -413,24 +384,11 @@ var SuiTx = class {
413
384
  }) {
414
385
  return this.tx.publish({ modules, dependencies });
415
386
  }
416
- upgrade({
417
- modules,
418
- dependencies,
419
- package: packageId,
420
- ticket
421
- }) {
422
- return this.tx.upgrade({
423
- modules,
424
- dependencies,
425
- package: packageId,
426
- ticket
427
- });
387
+ upgrade(...args) {
388
+ return this.tx.upgrade(...args);
428
389
  }
429
- makeMoveVec({
430
- elements,
431
- type
432
- }) {
433
- return this.tx.makeMoveVec({ elements, type });
390
+ makeMoveVec(...args) {
391
+ return this.tx.makeMoveVec(...args);
434
392
  }
435
393
  /* Override methods of TransactionBlock */
436
394
  transferObjects(objects, address) {
@@ -482,7 +440,9 @@ var SuiTx = class {
482
440
  }
483
441
  const coins = this.tx.splitCoins(
484
442
  this.tx.gas,
485
- convertArgs(this.tx, amounts)
443
+ amounts.map(
444
+ (amount) => typeof amount === "number" || typeof amount === "bigint" ? amount : convertArgs(this.tx, [amount])[0]
445
+ )
486
446
  );
487
447
  const recipientObjects = recipients.map(
488
448
  (recipient) => convertAddressArg(this.tx, recipient)
@@ -501,10 +461,9 @@ var SuiTx = class {
501
461
  if (coins.length > 1) {
502
462
  this.tx.mergeCoins(mergedCoin, coinObjects.slice(1));
503
463
  }
504
- const [sendCoin] = this.tx.splitCoins(
505
- mergedCoin,
506
- convertArgs(this.tx, [amount])
507
- );
464
+ const [sendCoin] = this.tx.splitCoins(mergedCoin, [
465
+ typeof amount === "number" || typeof amount === "bigint" ? amount : convertArgs(this.tx, [amount])[0]
466
+ ]);
508
467
  return [sendCoin, mergedCoin];
509
468
  }
510
469
  splitSUIFromGas(amounts) {
@@ -518,7 +477,7 @@ var SuiTx = class {
518
477
  }
519
478
  const splitedCoins = this.tx.splitCoins(
520
479
  mergedCoin,
521
- convertArgs(this.tx, amounts)
480
+ convertAmounts(this.tx, amounts)
522
481
  );
523
482
  return { splitedCoins, mergedCoin };
524
483
  }
@@ -548,14 +507,14 @@ var SuiTx = class {
548
507
  stakeSui(amount, validatorAddr) {
549
508
  const [stakeCoin] = this.tx.splitCoins(
550
509
  this.tx.gas,
551
- convertArgs(this.tx, [amount])
510
+ convertAmounts(this.tx, [amount])
552
511
  );
553
512
  return this.tx.moveCall({
554
513
  target: "0x3::sui_system::request_add_stake",
555
514
  arguments: convertArgs(this.tx, [
556
- import_utils3.SUI_SYSTEM_STATE_OBJECT_ID,
515
+ this.tx.object(import_utils3.SUI_SYSTEM_STATE_OBJECT_ID),
557
516
  stakeCoin,
558
- this.tx.pure.address(validatorAddr.toString())
517
+ convertAddressArg(this.tx, validatorAddr)
559
518
  ])
560
519
  });
561
520
  }
@@ -990,7 +949,7 @@ function numberToAddressHex(num) {
990
949
  }
991
950
 
992
951
  // src/obelisk.ts
993
- var import_bcs3 = require("@mysten/bcs");
952
+ var import_bcs2 = require("@mysten/bcs");
994
953
  function isUndefined(value) {
995
954
  return value === void 0;
996
955
  }
@@ -1350,32 +1309,32 @@ var Obelisk = class {
1350
1309
  let baseType = res[1];
1351
1310
  const value = Uint8Array.from(baseValue);
1352
1311
  if (baseType === "address") {
1353
- const Address = import_bcs3.bcs.bytes(32).transform({
1312
+ const Address = import_bcs2.bcs.bytes(32).transform({
1354
1313
  // 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)
1314
+ input: (val) => (0, import_bcs2.fromHEX)(val),
1315
+ output: (val) => (0, import_bcs2.toHEX)(val)
1357
1316
  });
1358
1317
  returnValues.push(Address.parse(value));
1359
1318
  } else if (baseType === "u8") {
1360
- returnValues.push(import_bcs3.bcs.u8().parse(value));
1319
+ returnValues.push(import_bcs2.bcs.u8().parse(value));
1361
1320
  } else if (baseType === "u16") {
1362
- returnValues.push(import_bcs3.bcs.u16().parse(value));
1321
+ returnValues.push(import_bcs2.bcs.u16().parse(value));
1363
1322
  } else if (baseType === "u32") {
1364
- returnValues.push(import_bcs3.bcs.u32().parse(value));
1323
+ returnValues.push(import_bcs2.bcs.u32().parse(value));
1365
1324
  } else if (baseType === "u64") {
1366
- returnValues.push(import_bcs3.bcs.u64().parse(value));
1325
+ returnValues.push(import_bcs2.bcs.u64().parse(value));
1367
1326
  } else if (baseType === "u128") {
1368
- returnValues.push(import_bcs3.bcs.u128().parse(value));
1327
+ returnValues.push(import_bcs2.bcs.u128().parse(value));
1369
1328
  } else if (baseType === "u256") {
1370
- returnValues.push(import_bcs3.bcs.u256().parse(value));
1329
+ returnValues.push(import_bcs2.bcs.u256().parse(value));
1371
1330
  } else if (baseType === "bool") {
1372
- returnValues.push(import_bcs3.bcs.bool().parse(value));
1331
+ returnValues.push(import_bcs2.bcs.bool().parse(value));
1373
1332
  } else if (baseType === "0x1::ascii::String") {
1374
- returnValues.push(import_bcs3.bcs.string().parse(value));
1333
+ returnValues.push(import_bcs2.bcs.string().parse(value));
1375
1334
  } else if (baseType === "vector<u8>") {
1376
- returnValues.push(import_bcs3.bcs.vector(import_bcs3.bcs.u8()).parse(value));
1335
+ returnValues.push(import_bcs2.bcs.vector(import_bcs2.bcs.u8()).parse(value));
1377
1336
  } else if (baseType === "0x1::option::Option<u8>") {
1378
- returnValues.push(import_bcs3.bcs.option(import_bcs3.bcs.u8()).parse(value));
1337
+ returnValues.push(import_bcs2.bcs.option(import_bcs2.bcs.u8()).parse(value));
1379
1338
  }
1380
1339
  }
1381
1340
  return returnValues;
@@ -1398,7 +1357,7 @@ var Obelisk = class {
1398
1357
  const res = getResult.results[0].returnValues[0];
1399
1358
  let baseValue = res[0];
1400
1359
  const value = Uint8Array.from(baseValue);
1401
- return import_bcs3.bcs.bool().parse(value);
1360
+ return import_bcs2.bcs.bool().parse(value);
1402
1361
  } else {
1403
1362
  return void 0;
1404
1363
  }
@@ -1461,10 +1420,10 @@ var Obelisk = class {
1461
1420
  const hashBytes = (0, import_keccak256.default)(bytes);
1462
1421
  const hashU8Array = Array.from(hashBytes);
1463
1422
  const value = Uint8Array.from(hashU8Array);
1464
- const Address = import_bcs3.bcs.bytes(32).transform({
1423
+ const Address = import_bcs2.bcs.bytes(32).transform({
1465
1424
  // 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)
1425
+ input: (val) => (0, import_bcs2.fromHEX)(val),
1426
+ output: (val) => (0, import_bcs2.toHEX)(val)
1468
1427
  });
1469
1428
  const data = Address.parse(value);
1470
1429
  return "0x" + data;
@@ -1485,7 +1444,7 @@ var Obelisk = class {
1485
1444
  if (checkObjectId !== null) {
1486
1445
  objectId = checkObjectId;
1487
1446
  const bytes = Buffer.from(objectId.slice(2), "hex");
1488
- const numberBytes = import_bcs3.bcs.u256().serialize(x).toBytes();
1447
+ const numberBytes = import_bcs2.bcs.u256().serialize(x).toBytes();
1489
1448
  return this.entity_key_from_bytes(Buffer.concat([bytes, numberBytes]));
1490
1449
  } else {
1491
1450
  return void 0;
@@ -1507,32 +1466,32 @@ var Obelisk = class {
1507
1466
  let baseType = res[1];
1508
1467
  const value2 = Uint8Array.from(baseValue);
1509
1468
  if (baseType === "address") {
1510
- const Address = import_bcs3.bcs.bytes(32).transform({
1469
+ const Address = import_bcs2.bcs.bytes(32).transform({
1511
1470
  // 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)
1471
+ input: (val) => (0, import_bcs2.fromHEX)(val),
1472
+ output: (val) => (0, import_bcs2.toHEX)(val)
1514
1473
  });
1515
1474
  returnValues.push(Address.parse(value2));
1516
1475
  } else if (baseType === "u8") {
1517
- returnValues.push(import_bcs3.bcs.u8().parse(value2));
1476
+ returnValues.push(import_bcs2.bcs.u8().parse(value2));
1518
1477
  } else if (baseType === "u16") {
1519
- returnValues.push(import_bcs3.bcs.u16().parse(value2));
1478
+ returnValues.push(import_bcs2.bcs.u16().parse(value2));
1520
1479
  } else if (baseType === "u32") {
1521
- returnValues.push(import_bcs3.bcs.u32().parse(value2));
1480
+ returnValues.push(import_bcs2.bcs.u32().parse(value2));
1522
1481
  } else if (baseType === "u64") {
1523
- returnValues.push(import_bcs3.bcs.u64().parse(value2));
1482
+ returnValues.push(import_bcs2.bcs.u64().parse(value2));
1524
1483
  } else if (baseType === "u128") {
1525
- returnValues.push(import_bcs3.bcs.u128().parse(value2));
1484
+ returnValues.push(import_bcs2.bcs.u128().parse(value2));
1526
1485
  } else if (baseType === "u256") {
1527
- returnValues.push(import_bcs3.bcs.u256().parse(value2));
1486
+ returnValues.push(import_bcs2.bcs.u256().parse(value2));
1528
1487
  } else if (baseType === "bool") {
1529
- returnValues.push(import_bcs3.bcs.bool().parse(value2));
1488
+ returnValues.push(import_bcs2.bcs.bool().parse(value2));
1530
1489
  } else if (baseType === "0x1::ascii::String") {
1531
- returnValues.push(import_bcs3.bcs.string().parse(value2));
1490
+ returnValues.push(import_bcs2.bcs.string().parse(value2));
1532
1491
  } else if (baseType === "vector<u8>") {
1533
- returnValues.push(import_bcs3.bcs.vector(import_bcs3.bcs.u8()).parse(value2));
1492
+ returnValues.push(import_bcs2.bcs.vector(import_bcs2.bcs.u8()).parse(value2));
1534
1493
  } else if (baseType === "0x1::option::Option<u8>") {
1535
- returnValues.push(import_bcs3.bcs.option(import_bcs3.bcs.u8()).parse(value2));
1494
+ returnValues.push(import_bcs2.bcs.option(import_bcs2.bcs.u8()).parse(value2));
1536
1495
  }
1537
1496
  }
1538
1497
  return returnValues;