@easysui/sdk 0.2.1 → 1.0.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.
- package/README.md +1 -1
- package/dist/index.d.mts +178 -15
- package/dist/index.d.ts +178 -15
- package/dist/index.js +15958 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15967 -87
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -9
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Keypair } from '@mysten/sui/cryptography';
|
|
2
2
|
import { Transaction } from '@mysten/sui/transactions';
|
|
3
|
-
import * as
|
|
4
|
-
import { SuiTransactionBlockResponse,
|
|
5
|
-
import { SuiTransactionBlockResponse as SuiTransactionBlockResponse$1 } from '@mysten/sui/jsonRpc';
|
|
3
|
+
import * as _mysten_sui_jsonRpc from '@mysten/sui/jsonRpc';
|
|
4
|
+
import { SuiTransactionBlockResponse, SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
6
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
7
6
|
|
|
8
7
|
type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet';
|
|
@@ -13,7 +12,7 @@ interface StaticConfig {
|
|
|
13
12
|
declare const STATIC_CONFIGS: Record<Network, StaticConfig>;
|
|
14
13
|
|
|
15
14
|
declare const DENY_LIST_ID = "0x403";
|
|
16
|
-
declare const CLOCK_ID
|
|
15
|
+
declare const CLOCK_ID = "0x0000000000000000000000000000000000000000000000000000000000000006";
|
|
17
16
|
interface BaseConfigVars {
|
|
18
17
|
NETWORK: Network;
|
|
19
18
|
RPC: string;
|
|
@@ -58,6 +57,168 @@ declare function getDeployBytes(): Promise<string>;
|
|
|
58
57
|
|
|
59
58
|
declare function getKeypair(privkey: string): Keypair;
|
|
60
59
|
|
|
60
|
+
type HexAddress = `0x${string}`;
|
|
61
|
+
type ObjectId = HexAddress;
|
|
62
|
+
type Digest = string;
|
|
63
|
+
interface SuiPublishResponse {
|
|
64
|
+
transaction: {
|
|
65
|
+
V1: TransactionV1;
|
|
66
|
+
};
|
|
67
|
+
effects: {
|
|
68
|
+
V2: EffectsV2;
|
|
69
|
+
};
|
|
70
|
+
clever_error: string | null;
|
|
71
|
+
events: unknown | null;
|
|
72
|
+
changed_objects: ChangedObjectFlat[];
|
|
73
|
+
unchanged_loaded_runtime_objects: unknown[];
|
|
74
|
+
balance_changes: BalanceChange[];
|
|
75
|
+
checkpoint: number;
|
|
76
|
+
}
|
|
77
|
+
interface TransactionV1 {
|
|
78
|
+
kind: {
|
|
79
|
+
ProgrammableTransaction: ProgrammableTransaction;
|
|
80
|
+
};
|
|
81
|
+
sender: HexAddress;
|
|
82
|
+
gas_data: GasData;
|
|
83
|
+
expiration: "None" | {
|
|
84
|
+
Epoch: number;
|
|
85
|
+
} | {
|
|
86
|
+
EpochId: number;
|
|
87
|
+
} | unknown;
|
|
88
|
+
}
|
|
89
|
+
interface ProgrammableTransaction {
|
|
90
|
+
inputs: PTInput[];
|
|
91
|
+
commands: PTCommand[];
|
|
92
|
+
}
|
|
93
|
+
type PTInput = {
|
|
94
|
+
Pure: number[];
|
|
95
|
+
} | {
|
|
96
|
+
Object: PTObjectArg;
|
|
97
|
+
} | Record<string, unknown>;
|
|
98
|
+
type PTObjectArg = {
|
|
99
|
+
ImmOrOwnedObject: ObjectRef;
|
|
100
|
+
} | {
|
|
101
|
+
SharedObject: SharedObjectRef;
|
|
102
|
+
} | {
|
|
103
|
+
Receiving: ObjectRef;
|
|
104
|
+
} | Record<string, unknown>;
|
|
105
|
+
interface ObjectRef {
|
|
106
|
+
objectId: ObjectId;
|
|
107
|
+
version: string | number;
|
|
108
|
+
digest: Digest;
|
|
109
|
+
}
|
|
110
|
+
interface SharedObjectRef {
|
|
111
|
+
objectId: ObjectId;
|
|
112
|
+
initialSharedVersion: string | number;
|
|
113
|
+
mutable: boolean;
|
|
114
|
+
}
|
|
115
|
+
type PTCommand = {
|
|
116
|
+
Publish: [number[][], HexAddress[]];
|
|
117
|
+
} | {
|
|
118
|
+
TransferObjects: [PTArgument[], PTArgument];
|
|
119
|
+
} | {
|
|
120
|
+
MoveCall: unknown;
|
|
121
|
+
} | {
|
|
122
|
+
SplitCoins: unknown;
|
|
123
|
+
} | {
|
|
124
|
+
MergeCoins: unknown;
|
|
125
|
+
} | {
|
|
126
|
+
MakeMoveVec: unknown;
|
|
127
|
+
} | {
|
|
128
|
+
Upgrade: unknown;
|
|
129
|
+
} | Record<string, unknown>;
|
|
130
|
+
type PTArgument = {
|
|
131
|
+
Input: number;
|
|
132
|
+
} | {
|
|
133
|
+
Result: number;
|
|
134
|
+
} | {
|
|
135
|
+
NestedResult: [number, number];
|
|
136
|
+
} | {
|
|
137
|
+
GasCoin: true;
|
|
138
|
+
} | Record<string, unknown>;
|
|
139
|
+
interface GasData {
|
|
140
|
+
payment: [ObjectId, number, Digest][];
|
|
141
|
+
owner: HexAddress;
|
|
142
|
+
price: number;
|
|
143
|
+
budget: number;
|
|
144
|
+
}
|
|
145
|
+
interface EffectsV2 {
|
|
146
|
+
status: "Success" | {
|
|
147
|
+
Failure: unknown;
|
|
148
|
+
} | string;
|
|
149
|
+
executed_epoch: number;
|
|
150
|
+
gas_used: GasUsed;
|
|
151
|
+
transaction_digest: Digest;
|
|
152
|
+
gas_object_index: number;
|
|
153
|
+
events_digest: Digest | null;
|
|
154
|
+
dependencies: Digest[];
|
|
155
|
+
lamport_version: number;
|
|
156
|
+
changed_objects: ChangedObjectTuple[];
|
|
157
|
+
unchanged_consensus_objects: unknown[];
|
|
158
|
+
aux_data_digest: Digest | null;
|
|
159
|
+
}
|
|
160
|
+
interface GasUsed {
|
|
161
|
+
computationCost: string;
|
|
162
|
+
storageCost: string;
|
|
163
|
+
storageRebate: string;
|
|
164
|
+
nonRefundableStorageFee: string;
|
|
165
|
+
}
|
|
166
|
+
type ChangedObjectTuple = [
|
|
167
|
+
ObjectId,
|
|
168
|
+
{
|
|
169
|
+
input_state: "NotExist" | {
|
|
170
|
+
Exist: [[number, Digest], OwnerV2];
|
|
171
|
+
} | unknown;
|
|
172
|
+
output_state: {
|
|
173
|
+
ObjectWrite: [Digest, OwnerV2];
|
|
174
|
+
} | {
|
|
175
|
+
PackageWrite: [number, Digest];
|
|
176
|
+
} | unknown;
|
|
177
|
+
id_operation: "Created" | "None" | "Deleted" | string;
|
|
178
|
+
}
|
|
179
|
+
];
|
|
180
|
+
type OwnerV2 = {
|
|
181
|
+
AddressOwner: HexAddress;
|
|
182
|
+
} | {
|
|
183
|
+
ObjectOwner: ObjectId;
|
|
184
|
+
} | {
|
|
185
|
+
Shared: {
|
|
186
|
+
initial_shared_version: number | string;
|
|
187
|
+
};
|
|
188
|
+
} | {
|
|
189
|
+
Immutable: true;
|
|
190
|
+
} | Record<string, unknown>;
|
|
191
|
+
interface ChangedObjectFlat {
|
|
192
|
+
objectId: ObjectId;
|
|
193
|
+
inputState: "INPUT_OBJECT_STATE_DOES_NOT_EXIST" | "INPUT_OBJECT_STATE_EXISTS" | string;
|
|
194
|
+
outputState: "OUTPUT_OBJECT_STATE_OBJECT_WRITE" | "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" | string;
|
|
195
|
+
inputVersion?: string;
|
|
196
|
+
inputDigest?: Digest;
|
|
197
|
+
inputOwner?: OwnerFlat;
|
|
198
|
+
outputVersion?: string;
|
|
199
|
+
outputDigest?: Digest;
|
|
200
|
+
outputOwner?: OwnerFlat;
|
|
201
|
+
idOperation: "CREATED" | "NONE" | "DELETED" | string;
|
|
202
|
+
objectType: string;
|
|
203
|
+
}
|
|
204
|
+
type OwnerFlat = {
|
|
205
|
+
kind: "ADDRESS";
|
|
206
|
+
address: HexAddress;
|
|
207
|
+
} | {
|
|
208
|
+
kind: "OBJECT";
|
|
209
|
+
objectId: ObjectId;
|
|
210
|
+
} | {
|
|
211
|
+
kind: "SHARED";
|
|
212
|
+
initialSharedVersion?: string | number;
|
|
213
|
+
} | {
|
|
214
|
+
kind: "IMMUTABLE";
|
|
215
|
+
} | Record<string, unknown>;
|
|
216
|
+
interface BalanceChange {
|
|
217
|
+
address: HexAddress;
|
|
218
|
+
coin_type: string;
|
|
219
|
+
amount: number;
|
|
220
|
+
}
|
|
221
|
+
|
|
61
222
|
declare class PublishSingleton {
|
|
62
223
|
private readonly publishResp;
|
|
63
224
|
private static instance;
|
|
@@ -65,16 +226,18 @@ declare class PublishSingleton {
|
|
|
65
226
|
private static getPackagePath;
|
|
66
227
|
static publish(signer?: Keypair, packagePath?: string): Promise<void>;
|
|
67
228
|
private static getInstance;
|
|
68
|
-
static publishResponse():
|
|
229
|
+
static publishResponse(): SuiPublishResponse;
|
|
69
230
|
static get packageId(): string;
|
|
70
231
|
static findObjectIdByType(type: string, fail?: boolean): string;
|
|
71
232
|
static get upgradeCapId(): string;
|
|
72
233
|
static get usdcTreasuryCap(): string;
|
|
73
234
|
private static getPublishCmd;
|
|
74
235
|
static getPublishBytes(signer?: string, packagePath?: string): Promise<string>;
|
|
75
|
-
static publishPackage(signer: Keypair, packagePath: string): Promise<
|
|
76
|
-
static findPublishedPackage(resp:
|
|
77
|
-
static findObjectChangeCreatedByType(resp:
|
|
236
|
+
static publishPackage(signer: Keypair, packagePath: string): Promise<SuiPublishResponse>;
|
|
237
|
+
static findPublishedPackage(resp: SuiPublishResponse): ChangedObjectFlat | undefined;
|
|
238
|
+
static findObjectChangeCreatedByType(resp: SuiPublishResponse, type: string): ChangedObjectFlat | undefined;
|
|
239
|
+
static get pubFile(): string;
|
|
240
|
+
static cleanPubFile(): void;
|
|
78
241
|
}
|
|
79
242
|
|
|
80
243
|
declare enum FORMAT_TYPES {
|
|
@@ -103,9 +266,9 @@ declare class SuiClient {
|
|
|
103
266
|
private client;
|
|
104
267
|
private constructor();
|
|
105
268
|
private static getInstance;
|
|
106
|
-
static get client():
|
|
269
|
+
static get client(): SuiJsonRpcClient;
|
|
107
270
|
private static waitForTransaction;
|
|
108
|
-
static signAndExecute(ptb: Transaction, signer: Keypair): Promise<SuiTransactionBlockResponse
|
|
271
|
+
static signAndExecute(ptb: Transaction, signer: Keypair): Promise<SuiTransactionBlockResponse>;
|
|
109
272
|
static toMoveArg(ptb: Transaction, value: any, type?: MoveType): any;
|
|
110
273
|
static moveCall({ signer, target, typeArgs, args, argTypes, ptb, withTransfer, }: {
|
|
111
274
|
signer: Keypair;
|
|
@@ -115,7 +278,7 @@ declare class SuiClient {
|
|
|
115
278
|
argTypes?: MoveType[];
|
|
116
279
|
ptb?: Transaction;
|
|
117
280
|
withTransfer?: boolean;
|
|
118
|
-
}): Promise<SuiTransactionBlockResponse
|
|
281
|
+
}): Promise<SuiTransactionBlockResponse>;
|
|
119
282
|
static getMoveCallBytes({ signer, target, typeArgs, args, argTypes, ptb, withTransfer, gasOwner, format }: {
|
|
120
283
|
signer: string;
|
|
121
284
|
target: string;
|
|
@@ -130,16 +293,16 @@ declare class SuiClient {
|
|
|
130
293
|
static getMoveCallBytesFromPTB(ptb: Transaction, signer: string, gasOwner?: string, format?: FORMAT_TYPES): Promise<string>;
|
|
131
294
|
static toBytes(bytes: Uint8Array | string): Uint8Array<ArrayBufferLike>;
|
|
132
295
|
static getSignature(signatureOrKeypair: string | Keypair, bytes: Uint8Array): Promise<string>;
|
|
133
|
-
static executeMoveCallBytes(bytes: Uint8Array | string, senderSignature: string | Keypair, gasOwnerSignature?: string | Keypair): Promise<SuiTransactionBlockResponse
|
|
296
|
+
static executeMoveCallBytes(bytes: Uint8Array | string, senderSignature: string | Keypair, gasOwnerSignature?: string | Keypair): Promise<SuiTransactionBlockResponse>;
|
|
134
297
|
static getPTB(target: string, typeArgs?: string[], args?: any[], argTypes?: MoveType[], signer?: string, withTransfer?: boolean, ptb?: Transaction): Transaction;
|
|
135
|
-
static public_transfer(objects: string[], from: Keypair, to: string): Promise<SuiTransactionBlockResponse
|
|
136
|
-
static devInspect(ptb: Transaction, sender: string): Promise<
|
|
298
|
+
static public_transfer(objects: string[], from: Keypair, to: string): Promise<SuiTransactionBlockResponse>;
|
|
299
|
+
static devInspect(ptb: Transaction, sender: string): Promise<_mysten_sui_jsonRpc.DevInspectResults>;
|
|
137
300
|
static devInspectRaw(ptb: Transaction, sender: string): Promise<number[] | undefined>;
|
|
138
301
|
static devInspectBool(ptb: Transaction, sender: string): Promise<boolean | undefined>;
|
|
139
302
|
static devInspectU64(ptb: Transaction, sender: string): Promise<bigint>;
|
|
140
303
|
static devInspectAddress(ptb: Transaction, sender: string): Promise<string | undefined>;
|
|
141
304
|
static devInspectString(ptb: Transaction, sender: string): Promise<string>;
|
|
142
|
-
static getObject(id: string): Promise<
|
|
305
|
+
static getObject(id: string): Promise<_mysten_sui_jsonRpc.SuiObjectResponse>;
|
|
143
306
|
static getObjectsByType(owner: string, type: string): Promise<(string | undefined)[]>;
|
|
144
307
|
}
|
|
145
308
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Keypair } from '@mysten/sui/cryptography';
|
|
2
2
|
import { Transaction } from '@mysten/sui/transactions';
|
|
3
|
-
import * as
|
|
4
|
-
import { SuiTransactionBlockResponse,
|
|
5
|
-
import { SuiTransactionBlockResponse as SuiTransactionBlockResponse$1 } from '@mysten/sui/jsonRpc';
|
|
3
|
+
import * as _mysten_sui_jsonRpc from '@mysten/sui/jsonRpc';
|
|
4
|
+
import { SuiTransactionBlockResponse, SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
6
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
7
6
|
|
|
8
7
|
type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet';
|
|
@@ -13,7 +12,7 @@ interface StaticConfig {
|
|
|
13
12
|
declare const STATIC_CONFIGS: Record<Network, StaticConfig>;
|
|
14
13
|
|
|
15
14
|
declare const DENY_LIST_ID = "0x403";
|
|
16
|
-
declare const CLOCK_ID
|
|
15
|
+
declare const CLOCK_ID = "0x0000000000000000000000000000000000000000000000000000000000000006";
|
|
17
16
|
interface BaseConfigVars {
|
|
18
17
|
NETWORK: Network;
|
|
19
18
|
RPC: string;
|
|
@@ -58,6 +57,168 @@ declare function getDeployBytes(): Promise<string>;
|
|
|
58
57
|
|
|
59
58
|
declare function getKeypair(privkey: string): Keypair;
|
|
60
59
|
|
|
60
|
+
type HexAddress = `0x${string}`;
|
|
61
|
+
type ObjectId = HexAddress;
|
|
62
|
+
type Digest = string;
|
|
63
|
+
interface SuiPublishResponse {
|
|
64
|
+
transaction: {
|
|
65
|
+
V1: TransactionV1;
|
|
66
|
+
};
|
|
67
|
+
effects: {
|
|
68
|
+
V2: EffectsV2;
|
|
69
|
+
};
|
|
70
|
+
clever_error: string | null;
|
|
71
|
+
events: unknown | null;
|
|
72
|
+
changed_objects: ChangedObjectFlat[];
|
|
73
|
+
unchanged_loaded_runtime_objects: unknown[];
|
|
74
|
+
balance_changes: BalanceChange[];
|
|
75
|
+
checkpoint: number;
|
|
76
|
+
}
|
|
77
|
+
interface TransactionV1 {
|
|
78
|
+
kind: {
|
|
79
|
+
ProgrammableTransaction: ProgrammableTransaction;
|
|
80
|
+
};
|
|
81
|
+
sender: HexAddress;
|
|
82
|
+
gas_data: GasData;
|
|
83
|
+
expiration: "None" | {
|
|
84
|
+
Epoch: number;
|
|
85
|
+
} | {
|
|
86
|
+
EpochId: number;
|
|
87
|
+
} | unknown;
|
|
88
|
+
}
|
|
89
|
+
interface ProgrammableTransaction {
|
|
90
|
+
inputs: PTInput[];
|
|
91
|
+
commands: PTCommand[];
|
|
92
|
+
}
|
|
93
|
+
type PTInput = {
|
|
94
|
+
Pure: number[];
|
|
95
|
+
} | {
|
|
96
|
+
Object: PTObjectArg;
|
|
97
|
+
} | Record<string, unknown>;
|
|
98
|
+
type PTObjectArg = {
|
|
99
|
+
ImmOrOwnedObject: ObjectRef;
|
|
100
|
+
} | {
|
|
101
|
+
SharedObject: SharedObjectRef;
|
|
102
|
+
} | {
|
|
103
|
+
Receiving: ObjectRef;
|
|
104
|
+
} | Record<string, unknown>;
|
|
105
|
+
interface ObjectRef {
|
|
106
|
+
objectId: ObjectId;
|
|
107
|
+
version: string | number;
|
|
108
|
+
digest: Digest;
|
|
109
|
+
}
|
|
110
|
+
interface SharedObjectRef {
|
|
111
|
+
objectId: ObjectId;
|
|
112
|
+
initialSharedVersion: string | number;
|
|
113
|
+
mutable: boolean;
|
|
114
|
+
}
|
|
115
|
+
type PTCommand = {
|
|
116
|
+
Publish: [number[][], HexAddress[]];
|
|
117
|
+
} | {
|
|
118
|
+
TransferObjects: [PTArgument[], PTArgument];
|
|
119
|
+
} | {
|
|
120
|
+
MoveCall: unknown;
|
|
121
|
+
} | {
|
|
122
|
+
SplitCoins: unknown;
|
|
123
|
+
} | {
|
|
124
|
+
MergeCoins: unknown;
|
|
125
|
+
} | {
|
|
126
|
+
MakeMoveVec: unknown;
|
|
127
|
+
} | {
|
|
128
|
+
Upgrade: unknown;
|
|
129
|
+
} | Record<string, unknown>;
|
|
130
|
+
type PTArgument = {
|
|
131
|
+
Input: number;
|
|
132
|
+
} | {
|
|
133
|
+
Result: number;
|
|
134
|
+
} | {
|
|
135
|
+
NestedResult: [number, number];
|
|
136
|
+
} | {
|
|
137
|
+
GasCoin: true;
|
|
138
|
+
} | Record<string, unknown>;
|
|
139
|
+
interface GasData {
|
|
140
|
+
payment: [ObjectId, number, Digest][];
|
|
141
|
+
owner: HexAddress;
|
|
142
|
+
price: number;
|
|
143
|
+
budget: number;
|
|
144
|
+
}
|
|
145
|
+
interface EffectsV2 {
|
|
146
|
+
status: "Success" | {
|
|
147
|
+
Failure: unknown;
|
|
148
|
+
} | string;
|
|
149
|
+
executed_epoch: number;
|
|
150
|
+
gas_used: GasUsed;
|
|
151
|
+
transaction_digest: Digest;
|
|
152
|
+
gas_object_index: number;
|
|
153
|
+
events_digest: Digest | null;
|
|
154
|
+
dependencies: Digest[];
|
|
155
|
+
lamport_version: number;
|
|
156
|
+
changed_objects: ChangedObjectTuple[];
|
|
157
|
+
unchanged_consensus_objects: unknown[];
|
|
158
|
+
aux_data_digest: Digest | null;
|
|
159
|
+
}
|
|
160
|
+
interface GasUsed {
|
|
161
|
+
computationCost: string;
|
|
162
|
+
storageCost: string;
|
|
163
|
+
storageRebate: string;
|
|
164
|
+
nonRefundableStorageFee: string;
|
|
165
|
+
}
|
|
166
|
+
type ChangedObjectTuple = [
|
|
167
|
+
ObjectId,
|
|
168
|
+
{
|
|
169
|
+
input_state: "NotExist" | {
|
|
170
|
+
Exist: [[number, Digest], OwnerV2];
|
|
171
|
+
} | unknown;
|
|
172
|
+
output_state: {
|
|
173
|
+
ObjectWrite: [Digest, OwnerV2];
|
|
174
|
+
} | {
|
|
175
|
+
PackageWrite: [number, Digest];
|
|
176
|
+
} | unknown;
|
|
177
|
+
id_operation: "Created" | "None" | "Deleted" | string;
|
|
178
|
+
}
|
|
179
|
+
];
|
|
180
|
+
type OwnerV2 = {
|
|
181
|
+
AddressOwner: HexAddress;
|
|
182
|
+
} | {
|
|
183
|
+
ObjectOwner: ObjectId;
|
|
184
|
+
} | {
|
|
185
|
+
Shared: {
|
|
186
|
+
initial_shared_version: number | string;
|
|
187
|
+
};
|
|
188
|
+
} | {
|
|
189
|
+
Immutable: true;
|
|
190
|
+
} | Record<string, unknown>;
|
|
191
|
+
interface ChangedObjectFlat {
|
|
192
|
+
objectId: ObjectId;
|
|
193
|
+
inputState: "INPUT_OBJECT_STATE_DOES_NOT_EXIST" | "INPUT_OBJECT_STATE_EXISTS" | string;
|
|
194
|
+
outputState: "OUTPUT_OBJECT_STATE_OBJECT_WRITE" | "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" | string;
|
|
195
|
+
inputVersion?: string;
|
|
196
|
+
inputDigest?: Digest;
|
|
197
|
+
inputOwner?: OwnerFlat;
|
|
198
|
+
outputVersion?: string;
|
|
199
|
+
outputDigest?: Digest;
|
|
200
|
+
outputOwner?: OwnerFlat;
|
|
201
|
+
idOperation: "CREATED" | "NONE" | "DELETED" | string;
|
|
202
|
+
objectType: string;
|
|
203
|
+
}
|
|
204
|
+
type OwnerFlat = {
|
|
205
|
+
kind: "ADDRESS";
|
|
206
|
+
address: HexAddress;
|
|
207
|
+
} | {
|
|
208
|
+
kind: "OBJECT";
|
|
209
|
+
objectId: ObjectId;
|
|
210
|
+
} | {
|
|
211
|
+
kind: "SHARED";
|
|
212
|
+
initialSharedVersion?: string | number;
|
|
213
|
+
} | {
|
|
214
|
+
kind: "IMMUTABLE";
|
|
215
|
+
} | Record<string, unknown>;
|
|
216
|
+
interface BalanceChange {
|
|
217
|
+
address: HexAddress;
|
|
218
|
+
coin_type: string;
|
|
219
|
+
amount: number;
|
|
220
|
+
}
|
|
221
|
+
|
|
61
222
|
declare class PublishSingleton {
|
|
62
223
|
private readonly publishResp;
|
|
63
224
|
private static instance;
|
|
@@ -65,16 +226,18 @@ declare class PublishSingleton {
|
|
|
65
226
|
private static getPackagePath;
|
|
66
227
|
static publish(signer?: Keypair, packagePath?: string): Promise<void>;
|
|
67
228
|
private static getInstance;
|
|
68
|
-
static publishResponse():
|
|
229
|
+
static publishResponse(): SuiPublishResponse;
|
|
69
230
|
static get packageId(): string;
|
|
70
231
|
static findObjectIdByType(type: string, fail?: boolean): string;
|
|
71
232
|
static get upgradeCapId(): string;
|
|
72
233
|
static get usdcTreasuryCap(): string;
|
|
73
234
|
private static getPublishCmd;
|
|
74
235
|
static getPublishBytes(signer?: string, packagePath?: string): Promise<string>;
|
|
75
|
-
static publishPackage(signer: Keypair, packagePath: string): Promise<
|
|
76
|
-
static findPublishedPackage(resp:
|
|
77
|
-
static findObjectChangeCreatedByType(resp:
|
|
236
|
+
static publishPackage(signer: Keypair, packagePath: string): Promise<SuiPublishResponse>;
|
|
237
|
+
static findPublishedPackage(resp: SuiPublishResponse): ChangedObjectFlat | undefined;
|
|
238
|
+
static findObjectChangeCreatedByType(resp: SuiPublishResponse, type: string): ChangedObjectFlat | undefined;
|
|
239
|
+
static get pubFile(): string;
|
|
240
|
+
static cleanPubFile(): void;
|
|
78
241
|
}
|
|
79
242
|
|
|
80
243
|
declare enum FORMAT_TYPES {
|
|
@@ -103,9 +266,9 @@ declare class SuiClient {
|
|
|
103
266
|
private client;
|
|
104
267
|
private constructor();
|
|
105
268
|
private static getInstance;
|
|
106
|
-
static get client():
|
|
269
|
+
static get client(): SuiJsonRpcClient;
|
|
107
270
|
private static waitForTransaction;
|
|
108
|
-
static signAndExecute(ptb: Transaction, signer: Keypair): Promise<SuiTransactionBlockResponse
|
|
271
|
+
static signAndExecute(ptb: Transaction, signer: Keypair): Promise<SuiTransactionBlockResponse>;
|
|
109
272
|
static toMoveArg(ptb: Transaction, value: any, type?: MoveType): any;
|
|
110
273
|
static moveCall({ signer, target, typeArgs, args, argTypes, ptb, withTransfer, }: {
|
|
111
274
|
signer: Keypair;
|
|
@@ -115,7 +278,7 @@ declare class SuiClient {
|
|
|
115
278
|
argTypes?: MoveType[];
|
|
116
279
|
ptb?: Transaction;
|
|
117
280
|
withTransfer?: boolean;
|
|
118
|
-
}): Promise<SuiTransactionBlockResponse
|
|
281
|
+
}): Promise<SuiTransactionBlockResponse>;
|
|
119
282
|
static getMoveCallBytes({ signer, target, typeArgs, args, argTypes, ptb, withTransfer, gasOwner, format }: {
|
|
120
283
|
signer: string;
|
|
121
284
|
target: string;
|
|
@@ -130,16 +293,16 @@ declare class SuiClient {
|
|
|
130
293
|
static getMoveCallBytesFromPTB(ptb: Transaction, signer: string, gasOwner?: string, format?: FORMAT_TYPES): Promise<string>;
|
|
131
294
|
static toBytes(bytes: Uint8Array | string): Uint8Array<ArrayBufferLike>;
|
|
132
295
|
static getSignature(signatureOrKeypair: string | Keypair, bytes: Uint8Array): Promise<string>;
|
|
133
|
-
static executeMoveCallBytes(bytes: Uint8Array | string, senderSignature: string | Keypair, gasOwnerSignature?: string | Keypair): Promise<SuiTransactionBlockResponse
|
|
296
|
+
static executeMoveCallBytes(bytes: Uint8Array | string, senderSignature: string | Keypair, gasOwnerSignature?: string | Keypair): Promise<SuiTransactionBlockResponse>;
|
|
134
297
|
static getPTB(target: string, typeArgs?: string[], args?: any[], argTypes?: MoveType[], signer?: string, withTransfer?: boolean, ptb?: Transaction): Transaction;
|
|
135
|
-
static public_transfer(objects: string[], from: Keypair, to: string): Promise<SuiTransactionBlockResponse
|
|
136
|
-
static devInspect(ptb: Transaction, sender: string): Promise<
|
|
298
|
+
static public_transfer(objects: string[], from: Keypair, to: string): Promise<SuiTransactionBlockResponse>;
|
|
299
|
+
static devInspect(ptb: Transaction, sender: string): Promise<_mysten_sui_jsonRpc.DevInspectResults>;
|
|
137
300
|
static devInspectRaw(ptb: Transaction, sender: string): Promise<number[] | undefined>;
|
|
138
301
|
static devInspectBool(ptb: Transaction, sender: string): Promise<boolean | undefined>;
|
|
139
302
|
static devInspectU64(ptb: Transaction, sender: string): Promise<bigint>;
|
|
140
303
|
static devInspectAddress(ptb: Transaction, sender: string): Promise<string | undefined>;
|
|
141
304
|
static devInspectString(ptb: Transaction, sender: string): Promise<string>;
|
|
142
|
-
static getObject(id: string): Promise<
|
|
305
|
+
static getObject(id: string): Promise<_mysten_sui_jsonRpc.SuiObjectResponse>;
|
|
143
306
|
static getObjectsByType(owner: string, type: string): Promise<(string | undefined)[]>;
|
|
144
307
|
}
|
|
145
308
|
|