@0xobelisk/client 0.3.6 → 0.4.2

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.
@@ -1,49 +0,0 @@
1
- import { SuiMoveNormalizedModules, SuiMoveNormalizedType } from "@mysten/sui.js";
2
- export type ContractFactoryParams = {
3
- packageId?: string;
4
- metadata?: SuiMoveNormalizedModules;
5
- };
6
- export type SuiMoveMoudleValueType = {
7
- address: string;
8
- name: string;
9
- fileFormatVersion: number;
10
- friends: {
11
- address: string;
12
- name: string;
13
- }[];
14
- structs: Record<string, {
15
- fields: {
16
- type: SuiMoveNormalizedType;
17
- name: string;
18
- }[];
19
- abilities: {
20
- abilities: string[];
21
- };
22
- typeParameters: {
23
- constraints: {
24
- abilities: string[];
25
- };
26
- isPhantom: boolean;
27
- }[];
28
- }>;
29
- exposedFunctions: Record<string, {
30
- visibility: "Private" | "Public" | "Friend";
31
- isEntry: boolean;
32
- typeParameters: {
33
- abilities: string[];
34
- }[];
35
- parameters: SuiMoveNormalizedType[];
36
- return: SuiMoveNormalizedType[];
37
- }>;
38
- };
39
- export type SuiMoveMoudleFuncType = {
40
- moudleName: string;
41
- funcName: string;
42
- visibility: "Private" | "Public" | "Friend";
43
- isEntry: boolean;
44
- typeParameters: {
45
- abilities: string[];
46
- }[];
47
- parameters: SuiMoveNormalizedType[];
48
- return: SuiMoveNormalizedType[];
49
- };
@@ -1,10 +0,0 @@
1
- import type { Connection } from '@mysten/sui.js';
2
- import type { NetworkType } from 'src/types';
3
- export declare const defaultGasBudget: number;
4
- export declare const defaultGasPrice = 1000;
5
- /**
6
- * @description Get the default fullnode url and faucet url for the given network type
7
- * @param networkType, 'testnet' | 'mainnet' | 'devnet' | 'localnet', default is 'devnet'
8
- * @returns { fullNode: string, websocket: string, faucet?: string }
9
- */
10
- export declare const getDefaultConnection: (networkType?: NetworkType) => Connection;
@@ -1,2 +0,0 @@
1
- export { SuiInteractor } from './suiInteractor';
2
- export { getDefaultConnection } from './defaultConfig';
@@ -1,205 +0,0 @@
1
- import { SuiTransactionBlockResponse, JsonRpcProvider, DynamicFieldName, SuiAddress } from '@mysten/sui.js';
2
- import { FaucetNetworkType, NetworkType, ObjectData, EntityData } from 'src/types';
3
- import { SuiOwnedObject, SuiSharedObject } from '../suiModel';
4
- /**
5
- * `SuiTransactionSender` is used to send transaction with a given gas coin.
6
- * It always uses the gas coin to pay for the gas,
7
- * and update the gas coin after the transaction.
8
- */
9
- export declare class SuiInteractor {
10
- readonly providers: JsonRpcProvider[];
11
- currentProvider: JsonRpcProvider;
12
- network?: NetworkType;
13
- constructor(fullNodeUrls: string[], network?: NetworkType);
14
- switchToNextProvider(): void;
15
- sendTx(transactionBlock: Uint8Array | string, signature: string | string[]): Promise<SuiTransactionBlockResponse>;
16
- getObjects(ids: string[]): Promise<ObjectData[]>;
17
- getObject(id: string): Promise<ObjectData>;
18
- getEntitiesObjects(ids: string[]): Promise<EntityData[]>;
19
- getDynamicFieldObject(parentId: string, name: string | DynamicFieldName): Promise<{
20
- data?: {
21
- objectId: string;
22
- version: string;
23
- digest: string;
24
- type?: string | null | undefined;
25
- bcs?: {
26
- type: string;
27
- version: string;
28
- hasPublicTransfer: boolean;
29
- dataType: "moveObject";
30
- bcsBytes: string;
31
- } | {
32
- id: string;
33
- dataType: "package";
34
- moduleMap: Record<string, string>;
35
- } | null | undefined;
36
- owner?: {
37
- AddressOwner: string;
38
- } | {
39
- ObjectOwner: string;
40
- } | {
41
- Shared: {
42
- initial_shared_version: string | null;
43
- };
44
- } | "Immutable" | null | undefined;
45
- storageRebate?: string | null | undefined;
46
- previousTransaction?: string | null | undefined;
47
- content?: {
48
- type: string;
49
- fields: Record<string, any>;
50
- hasPublicTransfer: boolean;
51
- dataType: "moveObject";
52
- } | {
53
- disassembled: Record<string, unknown>;
54
- dataType: "package";
55
- } | null | undefined;
56
- display?: Record<string, string> | {
57
- data?: Record<string, string> | null | undefined;
58
- error?: {
59
- code: string;
60
- version?: string | undefined;
61
- digest?: string | undefined;
62
- error?: string | undefined;
63
- object_id?: string | undefined;
64
- parent_object_id?: string | undefined;
65
- } | null | undefined;
66
- } | null | undefined;
67
- } | null | undefined;
68
- error?: {
69
- code: string;
70
- version?: string | undefined;
71
- digest?: string | undefined;
72
- error?: string | undefined;
73
- object_id?: string | undefined;
74
- parent_object_id?: string | undefined;
75
- } | null | undefined;
76
- }>;
77
- getDynamicFields(parentId: string, cursor?: string, limit?: number): Promise<{
78
- data: {
79
- type: "DynamicField" | "DynamicObject";
80
- objectType: string;
81
- objectId: string;
82
- version: number;
83
- digest: string;
84
- name: {
85
- type: string;
86
- value?: any;
87
- };
88
- bcsName: string;
89
- }[];
90
- nextCursor: string | null;
91
- hasNextPage: boolean;
92
- }>;
93
- getOwnedObjects(owner: SuiAddress, cursor?: string, limit?: number): Promise<{
94
- data: {
95
- data?: {
96
- objectId: string;
97
- version: string;
98
- digest: string;
99
- type?: string | null | undefined;
100
- bcs?: {
101
- type: string;
102
- version: string;
103
- hasPublicTransfer: boolean;
104
- dataType: "moveObject";
105
- bcsBytes: string;
106
- } | {
107
- id: string;
108
- dataType: "package";
109
- moduleMap: Record<string, string>;
110
- } | null | undefined;
111
- owner?: "Immutable" | {
112
- AddressOwner: string;
113
- } | {
114
- ObjectOwner: string;
115
- } | {
116
- Shared: {
117
- initial_shared_version: string | null;
118
- };
119
- } | null | undefined;
120
- storageRebate?: string | null | undefined;
121
- previousTransaction?: string | null | undefined;
122
- content?: {
123
- type: string;
124
- fields: Record<string, any>;
125
- hasPublicTransfer: boolean;
126
- dataType: "moveObject";
127
- } | {
128
- disassembled: Record<string, unknown>;
129
- dataType: "package";
130
- } | null | undefined;
131
- display?: Record<string, string> | {
132
- data?: Record<string, string> | null | undefined;
133
- error?: {
134
- code: string;
135
- version?: string | undefined;
136
- digest?: string | undefined;
137
- error?: string | undefined;
138
- object_id?: string | undefined;
139
- parent_object_id?: string | undefined;
140
- } | null | undefined;
141
- } | null | undefined;
142
- } | null | undefined;
143
- error?: {
144
- code: string;
145
- version?: string | undefined;
146
- digest?: string | undefined;
147
- error?: string | undefined;
148
- object_id?: string | undefined;
149
- parent_object_id?: string | undefined;
150
- } | null | undefined;
151
- }[];
152
- hasNextPage: boolean;
153
- nextCursor?: string | null | undefined;
154
- }>;
155
- getNormalizedMoveModulesByPackage(packageId: string): Promise<Record<string, {
156
- address: string;
157
- name: string;
158
- fileFormatVersion: number;
159
- friends: {
160
- address: string;
161
- name: string;
162
- }[];
163
- structs: Record<string, {
164
- fields: {
165
- type: import("@mysten/sui.js").SuiMoveNormalizedType;
166
- name: string;
167
- }[];
168
- abilities: {
169
- abilities: string[];
170
- };
171
- typeParameters: {
172
- constraints: {
173
- abilities: string[];
174
- };
175
- isPhantom: boolean;
176
- }[];
177
- }>;
178
- exposedFunctions: Record<string, {
179
- visibility: "Private" | "Public" | "Friend";
180
- isEntry: boolean;
181
- typeParameters: {
182
- abilities: string[];
183
- }[];
184
- parameters: import("@mysten/sui.js").SuiMoveNormalizedType[];
185
- return: import("@mysten/sui.js").SuiMoveNormalizedType[];
186
- }>;
187
- }>>;
188
- /**
189
- * @description Update objects in a batch
190
- * @param suiObjects
191
- */
192
- updateObjects(suiObjects: (SuiOwnedObject | SuiSharedObject)[]): Promise<void>;
193
- /**
194
- * @description Select coins that add up to the given amount.
195
- * @param addr the address of the owner
196
- * @param amount the amount that is needed for the coin
197
- * @param coinType the coin type, default is '0x2::SUI::SUI'
198
- */
199
- selectCoins(addr: string, amount: number, coinType?: string): Promise<{
200
- objectId: string;
201
- digest: string;
202
- version: string;
203
- }[]>;
204
- requestFaucet(address: SuiAddress, network: FaucetNetworkType): Promise<void>;
205
- }
@@ -1 +0,0 @@
1
- export declare const delay: (ms: number) => Promise<unknown>;
@@ -1,2 +0,0 @@
1
- export { SuiOwnedObject } from './suiOwnedObject';
2
- export { SuiSharedObject } from './suiSharedObject';
@@ -1,24 +0,0 @@
1
- import { Infer } from 'superstruct';
2
- import { SuiTransactionBlockResponse, ObjectCallArg, ObjectId } from '@mysten/sui.js';
3
- export declare class SuiOwnedObject {
4
- readonly objectId: string;
5
- version?: number | string;
6
- digest?: string;
7
- constructor(param: {
8
- objectId: string;
9
- version?: string;
10
- digest?: string;
11
- });
12
- /**
13
- * Check if the object is fully initialized.
14
- * So that when it's used as an input, it won't be necessary to fetch from fullnode again.
15
- * Which can save time when sending transactions.
16
- */
17
- isFullObject(): boolean;
18
- asCallArg(): Infer<typeof ObjectCallArg> | Infer<typeof ObjectId>;
19
- /**
20
- * Update object version & digest based on the transaction response.
21
- * @param txResponse
22
- */
23
- updateFromTxResponse(txResponse: SuiTransactionBlockResponse): void;
24
- }
@@ -1,12 +0,0 @@
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
- }