@0xobelisk/sui-client 0.5.28 → 0.5.29

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.
@@ -254,11 +254,11 @@ export declare class SuiTx {
254
254
  } | {
255
255
  $kind: "Input";
256
256
  Input: number;
257
- type?: "pure" | undefined;
257
+ type?: "pure";
258
258
  } | {
259
259
  $kind: "Input";
260
260
  Input: number;
261
- type?: "object" | undefined;
261
+ type?: "object";
262
262
  } | {
263
263
  $kind: "Result";
264
264
  Result: number;
@@ -280,17 +280,17 @@ export declare class SuiTx {
280
280
  object(value: string | TransactionObjectInput): {
281
281
  $kind: "Input";
282
282
  Input: number;
283
- type?: "object" | undefined;
283
+ type?: "object";
284
284
  };
285
285
  objectRef(ref: SuiObjectRef): {
286
286
  $kind: "Input";
287
287
  Input: number;
288
- type?: "object" | undefined;
288
+ type?: "object";
289
289
  };
290
290
  sharedObjectRef(ref: typeof bcs.SharedObjectRef.$inferType): {
291
291
  $kind: "Input";
292
292
  Input: number;
293
- type?: "object" | undefined;
293
+ type?: "object";
294
294
  };
295
295
  setSender(sender: string): void;
296
296
  setSenderIfNotSet(sender: string): void;
@@ -309,7 +309,7 @@ export declare class SuiTx {
309
309
  build(params?: {
310
310
  client?: SuiClient;
311
311
  onlyTransactionKind?: boolean;
312
- }): Promise<Uint8Array>;
312
+ }): Promise<Uint8Array<ArrayBufferLike>>;
313
313
  getDigest(params?: {
314
314
  client?: SuiClient;
315
315
  }): Promise<string>;
@@ -1,6 +1,6 @@
1
1
  import type { TransactionArgument, Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
2
2
  import type { SuiObjectArg, SuiAddressArg, SuiTxArg, SuiVecTxArg, SuiInputTypes, SuiAmountsArg } from 'src/types';
3
- export declare const getDefaultSuiInputType: (value: SuiTxArg) => 'u64' | 'bool' | 'object' | undefined;
3
+ export declare const getDefaultSuiInputType: (value: SuiTxArg) => "u64" | "bool" | "object" | undefined;
4
4
  /**
5
5
  * Since we know the elements in the array are the same type
6
6
  * If type is not provided, we will try to infer the type from the first element
@@ -60,10 +60,22 @@ export interface MessageMeta {
60
60
  readonly meta: SuiMoveMoudleFuncType;
61
61
  }
62
62
  export interface ContractQuery extends MessageMeta {
63
- (tx: Transaction, params: (TransactionArgument | SerializedBcs<any>)[], typeArguments?: string[], isRaw?: boolean): Promise<DevInspectResults | TransactionResult>;
63
+ (): Promise<DevInspectResults | TransactionResult>;
64
+ ({ tx, params, typeArguments, isRaw, }: {
65
+ tx: Transaction;
66
+ params?: (TransactionArgument | SerializedBcs<any>)[];
67
+ typeArguments?: string[];
68
+ isRaw?: boolean;
69
+ }): Promise<DevInspectResults | TransactionResult>;
64
70
  }
65
71
  export interface ContractTx extends MessageMeta {
66
- (tx: Transaction, params: (TransactionArgument | SerializedBcs<any>)[], typeArguments?: string[], isRaw?: boolean): Promise<SuiTransactionBlockResponse | TransactionResult>;
72
+ (): Promise<SuiTransactionBlockResponse | TransactionResult>;
73
+ ({ tx, params, typeArguments, isRaw, }: {
74
+ tx: Transaction;
75
+ params?: (TransactionArgument | SerializedBcs<any>)[];
76
+ typeArguments?: string[];
77
+ isRaw?: boolean;
78
+ }): Promise<SuiTransactionBlockResponse | TransactionResult>;
67
79
  }
68
80
  export type MapMessageTx = Record<string, ContractTx>;
69
81
  export type MapMessageQuery = Record<string, ContractQuery>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xobelisk/sui-client",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
4
4
  "description": "Tookit for interacting with move eps framework",
5
5
  "keywords": [
6
6
  "sui",
package/src/dubhe.ts CHANGED
@@ -58,19 +58,24 @@ function createQuery(
58
58
  meta: SuiMoveMoudleFuncType,
59
59
  fn: (
60
60
  tx: Transaction,
61
- params: (TransactionArgument | SerializedBcs<any>)[],
61
+ params?: (TransactionArgument | SerializedBcs<any>)[],
62
62
  typeArguments?: string[],
63
63
  isRaw?: boolean
64
64
  ) => Promise<DevInspectResults | TransactionResult>
65
65
  ): ContractQuery {
66
66
  return withMeta(
67
67
  meta,
68
- async (
69
- tx: Transaction,
70
- params: (TransactionArgument | SerializedBcs<any>)[],
71
- typeArguments?: string[],
72
- isRaw?: boolean
73
- ): Promise<DevInspectResults | TransactionResult> => {
68
+ async ({
69
+ tx,
70
+ params,
71
+ typeArguments,
72
+ isRaw,
73
+ }: {
74
+ tx: Transaction;
75
+ params?: (TransactionArgument | SerializedBcs<any>)[];
76
+ typeArguments?: string[];
77
+ isRaw?: boolean;
78
+ }): Promise<DevInspectResults | TransactionResult> => {
74
79
  const result = await fn(tx, params, typeArguments, isRaw);
75
80
  return result;
76
81
  }
@@ -81,19 +86,24 @@ function createTx(
81
86
  meta: SuiMoveMoudleFuncType,
82
87
  fn: (
83
88
  tx: Transaction,
84
- params: (TransactionArgument | SerializedBcs<any>)[],
89
+ params?: (TransactionArgument | SerializedBcs<any>)[],
85
90
  typeArguments?: string[],
86
91
  isRaw?: boolean
87
92
  ) => Promise<SuiTransactionBlockResponse | TransactionResult>
88
93
  ): ContractTx {
89
94
  return withMeta(
90
95
  meta,
91
- async (
92
- tx: Transaction,
93
- params: (TransactionArgument | SerializedBcs<any>)[],
94
- typeArguments?: string[],
95
- isRaw?: boolean
96
- ): Promise<SuiTransactionBlockResponse | TransactionResult> => {
96
+ async ({
97
+ tx,
98
+ params,
99
+ typeArguments,
100
+ isRaw,
101
+ }: {
102
+ tx: Transaction;
103
+ params?: (TransactionArgument | SerializedBcs<any>)[];
104
+ typeArguments?: string[];
105
+ isRaw?: boolean;
106
+ }): Promise<SuiTransactionBlockResponse | TransactionResult> => {
97
107
  return await fn(tx, params, typeArguments, isRaw);
98
108
  }
99
109
  );
@@ -307,7 +317,7 @@ export class Dubhe {
307
317
  #exec = async (
308
318
  meta: SuiMoveMoudleFuncType,
309
319
  tx: Transaction,
310
- params: (TransactionArgument | SerializedBcs<any>)[],
320
+ params?: (TransactionArgument | SerializedBcs<any>)[],
311
321
  typeArguments?: string[],
312
322
  isRaw?: boolean
313
323
  ) => {
@@ -330,7 +340,7 @@ export class Dubhe {
330
340
  #read = async (
331
341
  meta: SuiMoveMoudleFuncType,
332
342
  tx: Transaction,
333
- params: (TransactionArgument | SerializedBcs<any>)[],
343
+ params?: (TransactionArgument | SerializedBcs<any>)[],
334
344
  typeArguments?: string[],
335
345
  isRaw?: boolean
336
346
  ) => {
@@ -85,21 +85,33 @@ export interface MessageMeta {
85
85
  }
86
86
 
87
87
  export interface ContractQuery extends MessageMeta {
88
- (
89
- tx: Transaction,
90
- params: (TransactionArgument | SerializedBcs<any>)[],
91
- typeArguments?: string[],
92
- isRaw?: boolean
93
- ): Promise<DevInspectResults | TransactionResult>;
88
+ (): Promise<DevInspectResults | TransactionResult>;
89
+ ({
90
+ tx,
91
+ params,
92
+ typeArguments,
93
+ isRaw,
94
+ }: {
95
+ tx: Transaction;
96
+ params?: (TransactionArgument | SerializedBcs<any>)[];
97
+ typeArguments?: string[];
98
+ isRaw?: boolean;
99
+ }): Promise<DevInspectResults | TransactionResult>;
94
100
  }
95
101
 
96
102
  export interface ContractTx extends MessageMeta {
97
- (
98
- tx: Transaction,
99
- params: (TransactionArgument | SerializedBcs<any>)[],
100
- typeArguments?: string[],
101
- isRaw?: boolean
102
- ): Promise<SuiTransactionBlockResponse | TransactionResult>;
103
+ (): Promise<SuiTransactionBlockResponse | TransactionResult>;
104
+ ({
105
+ tx,
106
+ params,
107
+ typeArguments,
108
+ isRaw,
109
+ }: {
110
+ tx: Transaction;
111
+ params?: (TransactionArgument | SerializedBcs<any>)[];
112
+ typeArguments?: string[];
113
+ isRaw?: boolean;
114
+ }): Promise<SuiTransactionBlockResponse | TransactionResult>;
103
115
  }
104
116
 
105
117
  export type MapMessageTx = Record<string, ContractTx>;