@0xobelisk/client 0.0.9 → 0.1.0

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 (42) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +327 -290
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +337 -300
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/libs/suiAccountManager/index.d.ts +1 -1
  7. package/dist/libs/suiAccountManager/keypair.d.ts +1 -1
  8. package/dist/libs/suiContractFactory/index.d.ts +0 -1
  9. package/dist/libs/suiInteractor/defaultConfig.d.ts +10 -0
  10. package/dist/libs/suiInteractor/index.d.ts +2 -0
  11. package/dist/libs/suiInteractor/suiInteractor.d.ts +204 -0
  12. package/dist/libs/suiInteractor/util.d.ts +1 -0
  13. package/dist/libs/suiModel/index.d.ts +2 -0
  14. package/dist/libs/suiModel/suiOwnedObject.d.ts +24 -0
  15. package/dist/libs/suiModel/suiSharedObject.d.ts +12 -0
  16. package/dist/libs/suiTxBuilder/index.d.ts +2 -2
  17. package/dist/libs/suiTxBuilder/util.d.ts +8 -8
  18. package/dist/metadata/index.d.ts +1 -1
  19. package/dist/obelisk.d.ts +122 -337
  20. package/dist/types/index.d.ts +48 -6
  21. package/package.json +3 -3
  22. package/src/index.ts +0 -1
  23. package/src/libs/suiAccountManager/index.ts +1 -1
  24. package/src/libs/suiAccountManager/keypair.ts +1 -1
  25. package/src/libs/suiContractFactory/index.ts +0 -1
  26. package/src/libs/{suiRpcProvider/defaultChainConfigs.ts → suiInteractor/defaultConfig.ts} +4 -2
  27. package/src/libs/suiInteractor/index.ts +2 -0
  28. package/src/libs/suiInteractor/suiInteractor.ts +269 -0
  29. package/src/libs/suiInteractor/util.ts +2 -0
  30. package/src/libs/suiModel/index.ts +2 -0
  31. package/src/libs/suiModel/suiOwnedObject.ts +62 -0
  32. package/src/libs/suiModel/suiSharedObject.ts +33 -0
  33. package/src/libs/suiTxBuilder/index.ts +1 -1
  34. package/src/libs/suiTxBuilder/util.ts +1 -1
  35. package/src/metadata/index.ts +7 -7
  36. package/src/obelisk.ts +38 -130
  37. package/src/types/index.ts +92 -10
  38. package/src/libs/suiAccountManager/types.ts +0 -10
  39. package/src/libs/suiRpcProvider/faucet.ts +0 -57
  40. package/src/libs/suiRpcProvider/index.ts +0 -150
  41. package/src/libs/suiRpcProvider/types.ts +0 -17
  42. package/src/libs/suiTxBuilder/types.ts +0 -32
@@ -0,0 +1,12 @@
1
+ import { Infer } from 'superstruct';
2
+ import { ObjectCallArg, ObjectId } from '@mysten/sui.js';
3
+ export declare class SuiSharedObject {
4
+ readonly objectId: string;
5
+ initialSharedVersion?: number | string;
6
+ constructor(param: {
7
+ objectId: string;
8
+ initialSharedVersion?: number;
9
+ mutable?: boolean;
10
+ });
11
+ asCallArg(mutable?: boolean): Infer<typeof ObjectCallArg> | Infer<typeof ObjectId>;
12
+ }
@@ -1,5 +1,5 @@
1
1
  import { TransactionBlock, TransactionExpiration, SuiObjectRef, SharedObjectRef, JsonRpcProvider, TransactionType, Transactions, ObjectCallArg } from '@mysten/sui.js';
2
- import type { SuiTxArg, SuiObjectArg, SuiVecTxArg } from './types';
2
+ import type { SuiTxArg, SuiObjectArg, SuiVecTxArg } from 'src/types';
3
3
  export declare class SuiTxBlock {
4
4
  txBlock: TransactionBlock;
5
5
  constructor(transaction?: TransactionBlock);
@@ -111,8 +111,8 @@ export declare class SuiTxBlock {
111
111
  resultIndex: number;
112
112
  })[];
113
113
  kind: "MoveCall";
114
- typeArguments: string[];
115
114
  target: `${string}::${string}::${string}`;
115
+ typeArguments: string[];
116
116
  } | {
117
117
  objects: ({
118
118
  kind: "Input";
@@ -1,5 +1,5 @@
1
1
  import { TransactionArgument, TransactionBlock } from '@mysten/sui.js';
2
- import { SuiTxArg, SuiInputTypes } from './types';
2
+ import { SuiTxArg, SuiInputTypes } from 'src/types';
3
3
  export declare const getDefaultSuiInputType: (value: any) => SuiInputTypes;
4
4
  /**
5
5
  * Since we know the elements in the array are the same type
@@ -15,12 +15,7 @@ export declare const getDefaultSuiInputType: (value: any) => SuiInputTypes;
15
15
  * @param args
16
16
  * @param type 'address' | 'bool' | 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'object'
17
17
  */
18
- export declare function makeVecParam(txBlock: TransactionBlock, args: SuiTxArg[], type?: SuiInputTypes): {
19
- kind: "Input";
20
- index: number;
21
- type?: "object" | "pure" | undefined;
22
- value?: any;
23
- } | ({
18
+ export declare function makeVecParam(txBlock: TransactionBlock, args: SuiTxArg[], type?: SuiInputTypes): ({
24
19
  kind: "GasCoin";
25
20
  } & ({
26
21
  kind: "Input";
@@ -71,6 +66,11 @@ export declare function makeVecParam(txBlock: TransactionBlock, args: SuiTxArg[]
71
66
  kind: "NestedResult";
72
67
  index: number;
73
68
  resultIndex: number;
74
- })[]);
69
+ })[]) | {
70
+ kind: "Input";
71
+ index: number;
72
+ type?: "object" | "pure" | undefined;
73
+ value?: any;
74
+ };
75
75
  export declare function isMoveVecArg(arg: any): any;
76
76
  export declare function convertArgs(txBlock: TransactionBlock, args: any[]): TransactionArgument[];
@@ -1,4 +1,4 @@
1
- import { NetworkType } from '../libs/suiRpcProvider/types';
1
+ import { NetworkType } from 'src/types';
2
2
  export declare function getMetadata(networkType: NetworkType, packageId: string): Promise<Record<string, {
3
3
  address: string;
4
4
  name: string;