@0xobelisk/sui-client 1.0.3 → 1.0.5

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.
@@ -0,0 +1,10 @@
1
+ import { NetworkType } from 'src/types';
2
+ export interface NetworkConfig {
3
+ fullNode: string;
4
+ graphql?: string;
5
+ network: string;
6
+ txExplorer: string;
7
+ accountExplorer: string;
8
+ explorer: string;
9
+ }
10
+ export declare const getDefaultURL: (networkType?: NetworkType) => NetworkConfig;
@@ -1 +1,3 @@
1
1
  export { SuiInteractor } from './suiInteractor';
2
+ export { getDefaultURL } from './defaultConfig';
3
+ export type { NetworkConfig } from './defaultConfig';
@@ -17,6 +17,11 @@ export declare class SuiInteractor {
17
17
  constructor(fullNodeUrls: string[], network?: NetworkType);
18
18
  switchToNextClient(): void;
19
19
  sendTx(transactionBlock: Uint8Array | string, signature: string | string[]): Promise<SuiTransactionBlockResponse>;
20
+ waitForTransaction({ digest, timeout, pollInterval, }: {
21
+ digest: string;
22
+ timeout?: number;
23
+ pollInterval?: number;
24
+ }): Promise<SuiTransactionBlockResponse>;
20
25
  getObjects(ids: string[], options?: SuiObjectDataOptions): Promise<SuiObjectData[]>;
21
26
  getObject(id: string): Promise<SuiObjectData>;
22
27
  getDynamicFieldObject(parentId: string, name: RpcTypes.DynamicFieldName): Promise<RpcTypes.SuiObjectResponse>;
@@ -47,7 +47,7 @@ export declare class SuiTx {
47
47
  resultIndex: number;
48
48
  })[];
49
49
  kind: "MoveCall";
50
- target: `${string}::${string}::${string}`;
50
+ target: import("valibot").GenericSchema<`${string}::${string}::${string}`>;
51
51
  } | {
52
52
  address: {
53
53
  kind: "Input";
@@ -336,9 +336,21 @@ export declare class SuiTx {
336
336
  transferSuiToMany(recipients: SuiAddressArg[], amounts: (SuiTxArg | number | bigint)[]): this;
337
337
  transferSui(address: SuiAddressArg, amount: SuiTxArg | number | bigint): this;
338
338
  takeAmountFromCoins(coins: SuiObjectArg[], amount: SuiTxArg | number | bigint): TransactionObjectArgument[];
339
- splitSUIFromGas(amounts: SuiAmountsArg[]): import("@mysten/sui/transactions").TransactionResult;
339
+ splitSUIFromGas(amounts: SuiAmountsArg[]): {
340
+ $kind: "Result";
341
+ Result: number;
342
+ } & {
343
+ $kind: "NestedResult";
344
+ NestedResult: [number, number];
345
+ }[];
340
346
  splitMultiCoins(coins: SuiObjectArg[], amounts: SuiAmountsArg[]): {
341
- splitedCoins: import("@mysten/sui/transactions").TransactionResult;
347
+ splitedCoins: {
348
+ $kind: "Result";
349
+ Result: number;
350
+ } & {
351
+ $kind: "NestedResult";
352
+ NestedResult: [number, number];
353
+ }[];
342
354
  mergedCoin: TransactionObjectArgument;
343
355
  };
344
356
  transferCoinToMany(coins: SuiObjectArg[], sender: SuiAddressArg, recipients: SuiAddressArg[], amounts: SuiAmountsArg[]): this;
@@ -2,7 +2,7 @@ import type { Infer } from 'superstruct';
2
2
  import type { BcsType, SerializedBcs } from '@mysten/bcs';
3
3
  import type { TransactionArgument } from '@mysten/sui/transactions';
4
4
  import type { Transaction, TransactionObjectArgument, TransactionResult, Argument, Inputs } from '@mysten/sui/transactions';
5
- import type { SuiMoveNormalizedModules, DevInspectResults, SuiTransactionBlockResponse, DisplayFieldsResponse, SuiMoveNormalizedType, MoveStruct } from '@mysten/sui/client';
5
+ import type { SuiMoveNormalizedModules, DevInspectResults, SuiTransactionBlockResponse, DisplayFieldsResponse, MoveStruct, SuiMoveNormalizedEnum, SuiMoveNormalizedStruct } from '@mysten/sui/client';
6
6
  import { SuiTx } from '../libs/suiTxBuilder';
7
7
  import { SuiMoveMoudleFuncType } from '../libs/suiContractFactory/types';
8
8
  export declare const ObjectContentFields: import("superstruct").Struct<Record<string, any>, null>;
@@ -79,24 +79,14 @@ export type MapMessageTx = Record<string, ContractTx>;
79
79
  export type MapMessageQuery = Record<string, ContractQuery>;
80
80
  export type MapMoudleFuncTx = Record<string, MapMessageTx>;
81
81
  export type MapMoudleFuncQuery = Record<string, MapMessageQuery>;
82
- export type MoveStructValueType = {
83
- fields: {
84
- type: SuiMoveNormalizedType;
85
- name: string;
86
- }[];
87
- abilities: {
88
- abilities: string[];
89
- };
90
- typeParameters: {
91
- constraints: {
92
- abilities: string[];
93
- };
94
- isPhantom: boolean;
95
- }[];
96
- };
97
82
  export type MoveStructType = {
98
83
  objectId: string;
99
- objectType: MoveStructValueType;
84
+ objectType: SuiMoveNormalizedStruct;
85
+ objectName: string;
86
+ };
87
+ export type MoveEnumType = {
88
+ objectId: string;
89
+ objectType: SuiMoveNormalizedEnum;
100
90
  objectName: string;
101
91
  };
102
92
  export type MapObjectStruct = Record<string, BcsType<any, any>>;
@@ -1,3 +1,4 @@
1
1
  export declare function capitalizeFirstLetter(input: string): string;
2
2
  export declare function normalizeHexAddress(input: string): string | null;
3
3
  export declare function numberToAddressHex(num: number): string;
4
+ export declare function normalizePackageId(input: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xobelisk/sui-client",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Tookit for interacting with move eps framework",
5
5
  "keywords": [
6
6
  "sui",
@@ -37,8 +37,8 @@
37
37
  "src"
38
38
  ],
39
39
  "dependencies": {
40
- "@mysten/bcs": "^1.0.4",
41
- "@mysten/sui": "^1.7.0",
40
+ "@mysten/bcs": "^1.2.1",
41
+ "@mysten/sui": "^1.19.0",
42
42
  "@noble/curves": "^1.4.2",
43
43
  "@noble/hashes": "^1.4.0",
44
44
  "@scure/bip39": "^1.3.0",