@0xobelisk/sui-client 0.5.22 → 0.5.24

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/dist/index.js CHANGED
@@ -318,17 +318,11 @@ var SuiTx = class {
318
318
  get blockData() {
319
319
  return this.tx.blockData;
320
320
  }
321
- autoPure(value, type) {
322
- if (type === void 0) {
323
- return convertArgs(this.tx, [value]);
324
- }
325
- return;
326
- }
327
321
  address(value) {
328
322
  return this.tx.pure.address(value);
329
323
  }
330
324
  get pure() {
331
- return this.tx.pure.bind(this.tx);
325
+ return this.tx.pure;
332
326
  }
333
327
  object(value) {
334
328
  return this.tx.object(value);
@@ -400,7 +394,7 @@ var SuiTx = class {
400
394
  splitCoins(coin, amounts) {
401
395
  const res = this.tx.splitCoins(
402
396
  convertObjArg(this.tx, coin),
403
- convertArgs(this.tx, amounts)
397
+ convertAmounts(this.tx, amounts)
404
398
  );
405
399
  return amounts.map((_, i) => res[i]);
406
400
  }
@@ -461,13 +455,14 @@ var SuiTx = class {
461
455
  if (coins.length > 1) {
462
456
  this.tx.mergeCoins(mergedCoin, coinObjects.slice(1));
463
457
  }
464
- const [sendCoin] = this.tx.splitCoins(mergedCoin, [
465
- typeof amount === "number" || typeof amount === "bigint" ? amount : convertArgs(this.tx, [amount])[0]
466
- ]);
458
+ const [sendCoin] = this.tx.splitCoins(
459
+ mergedCoin,
460
+ convertAmounts(this.tx, [amount])
461
+ );
467
462
  return [sendCoin, mergedCoin];
468
463
  }
469
464
  splitSUIFromGas(amounts) {
470
- return this.tx.splitCoins(this.tx.gas, convertArgs(this.tx, amounts));
465
+ return this.tx.splitCoins(this.tx.gas, convertAmounts(this.tx, amounts));
471
466
  }
472
467
  splitMultiCoins(coins, amounts) {
473
468
  const coinObjects = coins.map((coin) => convertObjArg(this.tx, coin));
@@ -802,7 +797,8 @@ var SuiInteractor = class {
802
797
  selectedCoins.push({
803
798
  objectId: coinData.coinObjectId,
804
799
  digest: coinData.digest,
805
- version: coinData.version
800
+ version: coinData.version,
801
+ balance: coinData.balance
806
802
  });
807
803
  totalAmount = totalAmount + parseInt(coinData.balance);
808
804
  if (totalAmount >= amount) {
@@ -1012,6 +1008,7 @@ var Obelisk = class {
1012
1008
  u256: import_bcs2.bcs.u256(),
1013
1009
  bool: import_bcs2.bcs.bool(),
1014
1010
  "0x1::ascii::String": import_bcs2.bcs.string(),
1011
+ "0x1::string::String": import_bcs2.bcs.string(),
1015
1012
  "0x1::option::Option<address>": import_bcs2.bcs.option(
1016
1013
  import_bcs2.bcs.bytes(32).transform({
1017
1014
  // To change the input type, you need to provide a type definition for the input
@@ -1554,36 +1551,6 @@ var Obelisk = class {
1554
1551
  );
1555
1552
  return this.view(dryResult);
1556
1553
  }
1557
- // async getEntities(
1558
- // worldId: string,
1559
- // schemaName: string,
1560
- // cursor?: string,
1561
- // limit?: number
1562
- // ) {
1563
- // let schemaModuleName = `${schemaName}_schema`;
1564
- // const tx = new TransactionBlock();
1565
- // let params = [tx.pure(worldId)] as SuiTxArgument[];
1566
- // const tableResult = (await this.query[schemaonentModuleName].entities(
1567
- // tx,
1568
- // params
1569
- // )) as DevInspectResults;
1570
- // const entities = tableResult.results as SuiReturnValues;
1571
- // const bcs = new BCS(getSuiMoveConfig());
1572
- // let value = Uint8Array.from(entities[0].returnValues[0][0]);
1573
- // let tableId = '0x' + bcs.de('address', value);
1574
- // let dynamicFields = await this.suiInteractor.getDynamicFields(
1575
- // tableId,
1576
- // cursor,
1577
- // limit
1578
- // );
1579
- // let objectIds = dynamicFields.data.map((field) => field.objectId);
1580
- // let objectDatas = await this.suiInteractor.getEntitiesObjects(objectIds);
1581
- // return {
1582
- // data: objectDatas,
1583
- // nextCursor: dynamicFields.nextCursor,
1584
- // hasNextPage: dynamicFields.hasNextPage,
1585
- // };
1586
- // }
1587
1554
  async getOwnedObjects(owner, cursor, limit) {
1588
1555
  const ownedObjects = await this.suiInteractor.getOwnedObjects(
1589
1556
  owner,
@@ -1700,8 +1667,8 @@ var MultiSigClient = class _MultiSigClient {
1700
1667
 
1701
1668
  // src/metadata/index.ts
1702
1669
  var import_client4 = require("@mysten/sui/client");
1703
- async function loadMetadata(networkType, packageId) {
1704
- const fullnodeUrls = [(0, import_client4.getFullnodeUrl)(networkType)];
1670
+ async function loadMetadata(networkType, packageId, fullnodeUrls) {
1671
+ fullnodeUrls = fullnodeUrls || [(0, import_client4.getFullnodeUrl)(networkType)];
1705
1672
  const suiInteractor = new SuiInteractor(fullnodeUrls);
1706
1673
  if (packageId !== void 0) {
1707
1674
  const jsonData = await suiInteractor.getNormalizedMoveModulesByPackage(