@0xobelisk/sui-client 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xobelisk/sui-client",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Tookit for interacting with move eps framework",
5
5
  "keywords": [
6
6
  "sui",
package/src/dubhe.ts CHANGED
@@ -699,20 +699,20 @@ export class Dubhe {
699
699
 
700
700
  async state({
701
701
  schema,
702
- struct,
702
+ field,
703
703
  objectId,
704
704
  storageType,
705
705
  params,
706
706
  }: {
707
707
  schema: string;
708
- struct: string;
708
+ field: string;
709
709
  objectId: string;
710
710
  storageType: string; // 'StorageValue<V>' | 'StorageMap<K, V>' | 'StorageDoubleMap<K1, K2, V>'
711
711
  params: any[];
712
712
  }) {
713
713
  const tx = new Transaction();
714
714
  const moduleName = `${schema}_schema`;
715
- const functionName = `get_${struct}`;
715
+ const functionName = `get_${field}`;
716
716
  const schemaObject = tx.object(objectId);
717
717
  // Parse storage type
718
718
  const storageValueMatch = storageType.match(/^StorageValue<(.+)>$/);
@@ -721,7 +721,9 @@ export class Dubhe {
721
721
  /^StorageDoubleMap<(.+),\s*(.+),\s*(.+)>$/
722
722
  );
723
723
 
724
- let processedParams = [schemaObject];
724
+ let processedParams: (TransactionArgument | SerializedBcs<any>)[] = [
725
+ schemaObject,
726
+ ];
725
727
 
726
728
  if (storageValueMatch) {
727
729
  // StorageValue only needs the object ID
@@ -762,21 +764,21 @@ export class Dubhe {
762
764
  // Handle basic types
763
765
  switch (keyType.toLowerCase()) {
764
766
  case 'u8':
765
- return tx.pure(value, 'u8');
767
+ return tx.pure.u8(value);
766
768
  case 'u16':
767
- return tx.pure(value, 'u16');
769
+ return tx.pure.u16(value);
768
770
  case 'u32':
769
- return tx.pure(value, 'u32');
771
+ return tx.pure.u32(value);
770
772
  case 'u64':
771
- return tx.pure(value, 'u64');
773
+ return tx.pure.u64(value);
772
774
  case 'u128':
773
- return tx.pure(value, 'u128');
775
+ return tx.pure.u128(value);
774
776
  case 'u256':
775
- return tx.pure(value, 'u256');
777
+ return tx.pure.u256(value);
776
778
  case 'bool':
777
- return tx.pure(value, 'bool');
779
+ return tx.pure.bool(value);
778
780
  case 'address':
779
- return tx.pure(value, 'address');
781
+ return tx.pure.address(value);
780
782
  default:
781
783
  // Check if it's an object type
782
784
  if (keyType.includes('::')) {