@mysten/sui 2.20.3 → 2.21.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/CHANGELOG.md +18 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +20 -20
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs +4 -1
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/mvr.d.mts.map +1 -1
- package/dist/client/mvr.mjs +29 -7
- package/dist/client/mvr.mjs.map +1 -1
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +1 -1
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts +13 -5
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +68 -46
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/index.d.mts +2 -2
- package/dist/grpc/index.mjs +2 -2
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/jsonRpc/client.d.mts +160 -0
- package/dist/jsonRpc/client.d.mts.map +1 -1
- package/dist/jsonRpc/client.mjs +142 -0
- package/dist/jsonRpc/client.mjs.map +1 -1
- package/dist/jsonRpc/core.d.mts +80 -0
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +80 -0
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/jsonRpc/errors.d.mts +12 -0
- package/dist/jsonRpc/errors.d.mts.map +1 -1
- package/dist/jsonRpc/errors.mjs +12 -0
- package/dist/jsonRpc/errors.mjs.map +1 -1
- package/dist/jsonRpc/http-transport.d.mts +30 -0
- package/dist/jsonRpc/http-transport.d.mts.map +1 -1
- package/dist/jsonRpc/http-transport.mjs +16 -0
- package/dist/jsonRpc/http-transport.mjs.map +1 -1
- package/dist/jsonRpc/network.d.mts +4 -0
- package/dist/jsonRpc/network.d.mts.map +1 -1
- package/dist/jsonRpc/network.mjs +4 -0
- package/dist/jsonRpc/network.mjs.map +1 -1
- package/dist/jsonRpc/types/chain.d.mts +68 -0
- package/dist/jsonRpc/types/chain.d.mts.map +1 -1
- package/dist/jsonRpc/types/changes.d.mts +24 -0
- package/dist/jsonRpc/types/changes.d.mts.map +1 -1
- package/dist/jsonRpc/types/coins.d.mts +4 -0
- package/dist/jsonRpc/types/coins.d.mts.map +1 -1
- package/dist/jsonRpc/types/common.d.mts +4 -0
- package/dist/jsonRpc/types/common.d.mts.map +1 -1
- package/dist/jsonRpc/types/generated.d.mts +497 -16
- package/dist/jsonRpc/types/generated.d.mts.map +1 -1
- package/dist/jsonRpc/types/params.d.mts +289 -41
- package/dist/jsonRpc/types/params.d.mts.map +1 -1
- package/dist/transactions/Transaction.d.mts +9 -9
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/dist/zklogin/bcs.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/client/core.ts +1 -0
- package/src/client/mvr.ts +39 -6
- package/src/grpc/client.ts +10 -7
- package/src/grpc/core.ts +251 -168
- package/src/grpc/index.ts +5 -1
- package/src/jsonRpc/client.ts +160 -0
- package/src/jsonRpc/core.ts +80 -0
- package/src/jsonRpc/errors.ts +12 -0
- package/src/jsonRpc/http-transport.ts +30 -0
- package/src/jsonRpc/network.ts +4 -0
- package/src/jsonRpc/types/chain.ts +68 -0
- package/src/jsonRpc/types/changes.ts +24 -0
- package/src/jsonRpc/types/coins.ts +4 -0
- package/src/jsonRpc/types/common.ts +4 -0
- package/src/jsonRpc/types/generated.ts +497 -16
- package/src/jsonRpc/types/params.ts +289 -41
- package/src/version.ts +1 -1
package/dist/jsonRpc/client.mjs
CHANGED
|
@@ -11,9 +11,17 @@ import { fromBase58, toBase64, toHex } from "@mysten/bcs";
|
|
|
11
11
|
|
|
12
12
|
//#region src/jsonRpc/client.ts
|
|
13
13
|
const SUI_CLIENT_BRAND = Symbol.for("@mysten/SuiJsonRpcClient");
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
16
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
17
|
+
*/
|
|
14
18
|
function isSuiJsonRpcClient(client) {
|
|
15
19
|
return typeof client === "object" && client !== null && client[SUI_CLIENT_BRAND] === true;
|
|
16
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
23
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
24
|
+
*/
|
|
17
25
|
var SuiJsonRpcClient = class extends BaseClient {
|
|
18
26
|
get [SUI_CLIENT_BRAND]() {
|
|
19
27
|
return true;
|
|
@@ -22,6 +30,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
22
30
|
* Establish a connection to a Sui RPC endpoint
|
|
23
31
|
*
|
|
24
32
|
* @param options configuration options for the API Client
|
|
33
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
34
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
25
35
|
*/
|
|
26
36
|
constructor(options) {
|
|
27
37
|
super({ network: options.network });
|
|
@@ -32,6 +42,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
32
42
|
mvr: options.mvr
|
|
33
43
|
});
|
|
34
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
47
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
48
|
+
*/
|
|
35
49
|
async getRpcApiVersion({ signal } = {}) {
|
|
36
50
|
return (await this.transport.request({
|
|
37
51
|
method: "rpc.discover",
|
|
@@ -41,6 +55,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
41
55
|
}
|
|
42
56
|
/**
|
|
43
57
|
* Get all Coin<`coin_type`> objects owned by an address.
|
|
58
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
59
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
44
60
|
*/
|
|
45
61
|
async getCoins({ coinType, owner, cursor, limit, signal }) {
|
|
46
62
|
if (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) throw new Error("Invalid Sui address");
|
|
@@ -62,6 +78,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
62
78
|
}
|
|
63
79
|
/**
|
|
64
80
|
* Get all Coin objects owned by an address.
|
|
81
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
82
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
65
83
|
*/
|
|
66
84
|
async getAllCoins(input) {
|
|
67
85
|
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
@@ -81,6 +99,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
81
99
|
}
|
|
82
100
|
/**
|
|
83
101
|
* Get the total coin balance for one coin type, owned by the address owner.
|
|
102
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
103
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
84
104
|
*/
|
|
85
105
|
async getBalance({ owner, coinType, signal }) {
|
|
86
106
|
if (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) throw new Error("Invalid Sui address");
|
|
@@ -93,6 +113,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
93
113
|
}
|
|
94
114
|
/**
|
|
95
115
|
* Get the total coin balance for all coin types, owned by the address owner.
|
|
116
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
117
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
96
118
|
*/
|
|
97
119
|
async getAllBalances(input) {
|
|
98
120
|
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
@@ -104,6 +126,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
104
126
|
}
|
|
105
127
|
/**
|
|
106
128
|
* Fetch CoinMetadata for a given coin type
|
|
129
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
130
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
107
131
|
*/
|
|
108
132
|
async getCoinMetadata({ coinType, signal }) {
|
|
109
133
|
if (coinType && hasMvrName(coinType)) coinType = (await this.core.mvr.resolveType({ type: coinType })).type;
|
|
@@ -115,6 +139,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
115
139
|
}
|
|
116
140
|
/**
|
|
117
141
|
* Fetch total supply for a coin
|
|
142
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
143
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
118
144
|
*/
|
|
119
145
|
async getTotalSupply({ coinType, signal }) {
|
|
120
146
|
if (coinType && hasMvrName(coinType)) coinType = (await this.core.mvr.resolveType({ type: coinType })).type;
|
|
@@ -128,6 +154,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
128
154
|
* Invoke any RPC method
|
|
129
155
|
* @param method the method to be invoked
|
|
130
156
|
* @param args the arguments to be passed to the RPC request
|
|
157
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
158
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
131
159
|
*/
|
|
132
160
|
async call(method, params, { signal } = {}) {
|
|
133
161
|
return await this.transport.request({
|
|
@@ -138,6 +166,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
138
166
|
}
|
|
139
167
|
/**
|
|
140
168
|
* Get Move function argument types like read, write and full access
|
|
169
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
170
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
141
171
|
*/
|
|
142
172
|
async getMoveFunctionArgTypes({ package: pkg, module, function: fn, signal }) {
|
|
143
173
|
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({ package: pkg })).package;
|
|
@@ -154,6 +184,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
154
184
|
/**
|
|
155
185
|
* Get a map from module name to
|
|
156
186
|
* structured representations of Move modules
|
|
187
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
188
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
157
189
|
*/
|
|
158
190
|
async getNormalizedMoveModulesByPackage({ package: pkg, signal }) {
|
|
159
191
|
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({ package: pkg })).package;
|
|
@@ -165,6 +197,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
165
197
|
}
|
|
166
198
|
/**
|
|
167
199
|
* Get a structured representation of Move module
|
|
200
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
201
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
168
202
|
*/
|
|
169
203
|
async getNormalizedMoveModule({ package: pkg, module, signal }) {
|
|
170
204
|
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({ package: pkg })).package;
|
|
@@ -176,6 +210,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
176
210
|
}
|
|
177
211
|
/**
|
|
178
212
|
* Get a structured representation of Move function
|
|
213
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
214
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
179
215
|
*/
|
|
180
216
|
async getNormalizedMoveFunction({ package: pkg, module, function: fn, signal }) {
|
|
181
217
|
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({ package: pkg })).package;
|
|
@@ -191,6 +227,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
191
227
|
}
|
|
192
228
|
/**
|
|
193
229
|
* Get a structured representation of Move struct
|
|
230
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
231
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
194
232
|
*/
|
|
195
233
|
async getNormalizedMoveStruct({ package: pkg, module, struct, signal }) {
|
|
196
234
|
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({ package: pkg })).package;
|
|
@@ -206,6 +244,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
206
244
|
}
|
|
207
245
|
/**
|
|
208
246
|
* Get all objects owned by an address
|
|
247
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
248
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
209
249
|
*/
|
|
210
250
|
async getOwnedObjects(input) {
|
|
211
251
|
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
@@ -231,6 +271,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
231
271
|
}
|
|
232
272
|
/**
|
|
233
273
|
* Get details about an object
|
|
274
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
275
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
234
276
|
*/
|
|
235
277
|
async getObject(input) {
|
|
236
278
|
if (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) throw new Error("Invalid Sui Object id");
|
|
@@ -240,6 +282,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
240
282
|
signal: input.signal
|
|
241
283
|
});
|
|
242
284
|
}
|
|
285
|
+
/**
|
|
286
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
287
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
288
|
+
*/
|
|
243
289
|
async tryGetPastObject(input) {
|
|
244
290
|
return await this.transport.request({
|
|
245
291
|
method: "sui_tryGetPastObject",
|
|
@@ -253,6 +299,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
253
299
|
}
|
|
254
300
|
/**
|
|
255
301
|
* Batch get details about a list of objects. If any of the object ids are duplicates the call will fail
|
|
302
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
303
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
256
304
|
*/
|
|
257
305
|
async multiGetObjects(input) {
|
|
258
306
|
input.ids.forEach((id) => {
|
|
@@ -267,6 +315,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
267
315
|
}
|
|
268
316
|
/**
|
|
269
317
|
* Get transaction blocks for a given query criteria
|
|
318
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
319
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
270
320
|
*/
|
|
271
321
|
async queryTransactionBlocks({ filter, options, cursor, limit, order, signal }) {
|
|
272
322
|
if (filter && "MoveFunction" in filter && isValidNamedPackage(filter.MoveFunction.package)) filter = {
|
|
@@ -287,6 +337,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
287
337
|
signal
|
|
288
338
|
});
|
|
289
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
342
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
343
|
+
*/
|
|
290
344
|
async getTransactionBlock(input) {
|
|
291
345
|
if (!isValidTransactionDigest(input.digest)) throw new Error("Invalid Transaction digest");
|
|
292
346
|
return await this.transport.request({
|
|
@@ -295,6 +349,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
295
349
|
signal: input.signal
|
|
296
350
|
});
|
|
297
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
354
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
355
|
+
*/
|
|
298
356
|
async multiGetTransactionBlocks(input) {
|
|
299
357
|
input.digests.forEach((d) => {
|
|
300
358
|
if (!isValidTransactionDigest(d)) throw new Error(`Invalid Transaction digest ${d}`);
|
|
@@ -306,6 +364,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
306
364
|
signal: input.signal
|
|
307
365
|
});
|
|
308
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
369
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
370
|
+
*/
|
|
309
371
|
async executeTransactionBlock({ transactionBlock, signature, options, signal }) {
|
|
310
372
|
return await this.transport.request({
|
|
311
373
|
method: "sui_executeTransactionBlock",
|
|
@@ -317,6 +379,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
317
379
|
signal
|
|
318
380
|
});
|
|
319
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
384
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
385
|
+
*/
|
|
320
386
|
async signAndExecuteTransaction({ transaction, signer, ...input }) {
|
|
321
387
|
let transactionBytes;
|
|
322
388
|
if (transaction instanceof Uint8Array) transactionBytes = transaction;
|
|
@@ -334,6 +400,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
334
400
|
/**
|
|
335
401
|
* Get total number of transactions
|
|
336
402
|
*/
|
|
403
|
+
/**
|
|
404
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
405
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
406
|
+
*/
|
|
337
407
|
async getTotalTransactionBlocks({ signal } = {}) {
|
|
338
408
|
const resp = await this.transport.request({
|
|
339
409
|
method: "sui_getTotalTransactionBlocks",
|
|
@@ -344,6 +414,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
344
414
|
}
|
|
345
415
|
/**
|
|
346
416
|
* Getting the reference gas price for the network
|
|
417
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
418
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
347
419
|
*/
|
|
348
420
|
async getReferenceGasPrice({ signal } = {}) {
|
|
349
421
|
const resp = await this.transport.request({
|
|
@@ -355,6 +427,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
355
427
|
}
|
|
356
428
|
/**
|
|
357
429
|
* Return the delegated stakes for an address
|
|
430
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
431
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
358
432
|
*/
|
|
359
433
|
async getStakes(input) {
|
|
360
434
|
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
@@ -366,6 +440,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
366
440
|
}
|
|
367
441
|
/**
|
|
368
442
|
* Return the delegated stakes queried by id.
|
|
443
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
444
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
369
445
|
*/
|
|
370
446
|
async getStakesByIds(input) {
|
|
371
447
|
input.stakedSuiIds.forEach((id) => {
|
|
@@ -379,6 +455,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
379
455
|
}
|
|
380
456
|
/**
|
|
381
457
|
* Return the latest system state content.
|
|
458
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
459
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
382
460
|
*/
|
|
383
461
|
async getLatestSuiSystemState({ signal } = {}) {
|
|
384
462
|
return await this.transport.request({
|
|
@@ -389,6 +467,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
389
467
|
}
|
|
390
468
|
/**
|
|
391
469
|
* Get events for a given query criteria
|
|
470
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
471
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
392
472
|
*/
|
|
393
473
|
async queryEvents({ query, cursor, limit, order, signal }) {
|
|
394
474
|
if (query && "MoveEventType" in query && hasMvrName(query.MoveEventType)) query = {
|
|
@@ -424,6 +504,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
424
504
|
* Runs the transaction block in dev-inspect mode. Which allows for nearly any
|
|
425
505
|
* transaction (or Move call) with any arguments. Detailed results are
|
|
426
506
|
* provided, including both the transaction effects and any return values.
|
|
507
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
508
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
427
509
|
*/
|
|
428
510
|
async devInspectTransactionBlock(input) {
|
|
429
511
|
let devInspectTxBytes;
|
|
@@ -450,6 +532,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
450
532
|
}
|
|
451
533
|
/**
|
|
452
534
|
* Dry run a transaction block and return the result.
|
|
535
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
536
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
453
537
|
*/
|
|
454
538
|
async dryRunTransactionBlock(input) {
|
|
455
539
|
return await this.transport.request({
|
|
@@ -459,6 +543,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
459
543
|
}
|
|
460
544
|
/**
|
|
461
545
|
* Return the list of dynamic field objects owned by an object
|
|
546
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
547
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
462
548
|
*/
|
|
463
549
|
async getDynamicFields(input) {
|
|
464
550
|
if (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) throw new Error("Invalid Sui Object id");
|
|
@@ -474,6 +560,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
474
560
|
}
|
|
475
561
|
/**
|
|
476
562
|
* Return the dynamic field object information for a specified object
|
|
563
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
564
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
477
565
|
*/
|
|
478
566
|
async getDynamicFieldObject(input) {
|
|
479
567
|
return await this.transport.request({
|
|
@@ -484,6 +572,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
484
572
|
}
|
|
485
573
|
/**
|
|
486
574
|
* Get the sequence number of the latest checkpoint that has been executed
|
|
575
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
576
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
487
577
|
*/
|
|
488
578
|
async getLatestCheckpointSequenceNumber({ signal } = {}) {
|
|
489
579
|
const resp = await this.transport.request({
|
|
@@ -495,6 +585,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
495
585
|
}
|
|
496
586
|
/**
|
|
497
587
|
* Returns information about a given checkpoint
|
|
588
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
589
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
498
590
|
*/
|
|
499
591
|
async getCheckpoint(input) {
|
|
500
592
|
return await this.transport.request({
|
|
@@ -505,6 +597,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
505
597
|
}
|
|
506
598
|
/**
|
|
507
599
|
* Returns historical checkpoints paginated
|
|
600
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
601
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
508
602
|
*/
|
|
509
603
|
async getCheckpoints(input) {
|
|
510
604
|
return await this.transport.request({
|
|
@@ -519,6 +613,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
519
613
|
}
|
|
520
614
|
/**
|
|
521
615
|
* Return the committee information for the asked epoch
|
|
616
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
617
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
522
618
|
*/
|
|
523
619
|
async getCommitteeInfo(input) {
|
|
524
620
|
return await this.transport.request({
|
|
@@ -527,6 +623,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
527
623
|
signal: input?.signal
|
|
528
624
|
});
|
|
529
625
|
}
|
|
626
|
+
/**
|
|
627
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
628
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
629
|
+
*/
|
|
530
630
|
async getNetworkMetrics({ signal } = {}) {
|
|
531
631
|
return await this.transport.request({
|
|
532
632
|
method: "suix_getNetworkMetrics",
|
|
@@ -534,6 +634,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
534
634
|
signal
|
|
535
635
|
});
|
|
536
636
|
}
|
|
637
|
+
/**
|
|
638
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
639
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
640
|
+
*/
|
|
537
641
|
async getAddressMetrics({ signal } = {}) {
|
|
538
642
|
return await this.transport.request({
|
|
539
643
|
method: "suix_getLatestAddressMetrics",
|
|
@@ -541,6 +645,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
541
645
|
signal
|
|
542
646
|
});
|
|
543
647
|
}
|
|
648
|
+
/**
|
|
649
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
650
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
651
|
+
*/
|
|
544
652
|
async getEpochMetrics(input) {
|
|
545
653
|
return await this.transport.request({
|
|
546
654
|
method: "suix_getEpochMetrics",
|
|
@@ -552,6 +660,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
552
660
|
signal: input?.signal
|
|
553
661
|
});
|
|
554
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
665
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
666
|
+
*/
|
|
555
667
|
async getAllEpochAddressMetrics(input) {
|
|
556
668
|
return await this.transport.request({
|
|
557
669
|
method: "suix_getAllEpochAddressMetrics",
|
|
@@ -561,6 +673,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
561
673
|
}
|
|
562
674
|
/**
|
|
563
675
|
* Return the committee information for the asked epoch
|
|
676
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
677
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
564
678
|
*/
|
|
565
679
|
async getEpochs(input) {
|
|
566
680
|
return await this.transport.request({
|
|
@@ -575,6 +689,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
575
689
|
}
|
|
576
690
|
/**
|
|
577
691
|
* Returns list of top move calls by usage
|
|
692
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
693
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
578
694
|
*/
|
|
579
695
|
async getMoveCallMetrics({ signal } = {}) {
|
|
580
696
|
return await this.transport.request({
|
|
@@ -585,6 +701,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
585
701
|
}
|
|
586
702
|
/**
|
|
587
703
|
* Return the committee information for the asked epoch
|
|
704
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
705
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
588
706
|
*/
|
|
589
707
|
async getCurrentEpoch({ signal } = {}) {
|
|
590
708
|
return await this.transport.request({
|
|
@@ -595,6 +713,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
595
713
|
}
|
|
596
714
|
/**
|
|
597
715
|
* Return the Validators APYs
|
|
716
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
717
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
598
718
|
*/
|
|
599
719
|
async getValidatorsApy({ signal } = {}) {
|
|
600
720
|
return await this.transport.request({
|
|
@@ -603,12 +723,20 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
603
723
|
signal
|
|
604
724
|
});
|
|
605
725
|
}
|
|
726
|
+
/**
|
|
727
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
728
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
729
|
+
*/
|
|
606
730
|
async getChainIdentifier({ signal } = {}) {
|
|
607
731
|
return toHex(fromBase58((await this.getCheckpoint({
|
|
608
732
|
id: "0",
|
|
609
733
|
signal
|
|
610
734
|
})).digest).slice(0, 4));
|
|
611
735
|
}
|
|
736
|
+
/**
|
|
737
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
738
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
739
|
+
*/
|
|
612
740
|
async resolveNameServiceAddress(input) {
|
|
613
741
|
return await this.transport.request({
|
|
614
742
|
method: "suix_resolveNameServiceAddress",
|
|
@@ -616,6 +744,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
616
744
|
signal: input.signal
|
|
617
745
|
});
|
|
618
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
749
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
750
|
+
*/
|
|
619
751
|
async resolveNameServiceNames({ format = "dot", ...input }) {
|
|
620
752
|
const { nextCursor, hasNextPage, data } = await this.transport.request({
|
|
621
753
|
method: "suix_resolveNameServiceNames",
|
|
@@ -632,6 +764,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
632
764
|
data: data.map((name) => normalizeSuiNSName(name, format))
|
|
633
765
|
};
|
|
634
766
|
}
|
|
767
|
+
/**
|
|
768
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
769
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
770
|
+
*/
|
|
635
771
|
async getProtocolConfig(input) {
|
|
636
772
|
return await this.transport.request({
|
|
637
773
|
method: "sui_getProtocolConfig",
|
|
@@ -639,6 +775,10 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
639
775
|
signal: input?.signal
|
|
640
776
|
});
|
|
641
777
|
}
|
|
778
|
+
/**
|
|
779
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
780
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
781
|
+
*/
|
|
642
782
|
async verifyZkLoginSignature(input) {
|
|
643
783
|
return await this.transport.request({
|
|
644
784
|
method: "sui_verifyZkLoginSignature",
|
|
@@ -656,6 +796,8 @@ var SuiJsonRpcClient = class extends BaseClient {
|
|
|
656
796
|
* This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to
|
|
657
797
|
* be available via the API.
|
|
658
798
|
* This currently polls the `getTransactionBlock` API to check for the transaction.
|
|
799
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
800
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
659
801
|
*/
|
|
660
802
|
async waitForTransaction({ signal, timeout = 60 * 1e3, pollInterval = 2 * 1e3, ...input }) {
|
|
661
803
|
const timeoutSignal = AbortSignal.timeout(timeout);
|