@mysten/sui 1.26.1 → 1.27.1
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 +13 -0
- package/dist/cjs/bcs/bcs.d.ts +3 -2
- package/dist/cjs/bcs/bcs.js +3 -3
- package/dist/cjs/bcs/bcs.js.map +2 -2
- package/dist/cjs/bcs/effects.d.ts +18 -12
- package/dist/cjs/bcs/index.d.ts +460 -453
- package/dist/cjs/bcs/index.js +4 -4
- package/dist/cjs/bcs/index.js.map +1 -1
- package/dist/cjs/client/client.d.ts +38 -16
- package/dist/cjs/client/client.js +142 -62
- package/dist/cjs/client/client.js.map +2 -2
- package/dist/cjs/client/http-transport.d.ts +2 -0
- package/dist/cjs/client/http-transport.js +7 -0
- package/dist/cjs/client/http-transport.js.map +2 -2
- package/dist/cjs/client/rpc-websocket-client.d.ts +2 -1
- package/dist/cjs/client/rpc-websocket-client.js +7 -2
- package/dist/cjs/client/rpc-websocket-client.js.map +2 -2
- package/dist/cjs/client/types/generated.d.ts +1 -0
- package/dist/cjs/client/types/generated.js.map +1 -1
- package/dist/cjs/client/types/params.d.ts +56 -0
- package/dist/cjs/client/types/params.js.map +1 -1
- package/dist/cjs/experimental/cache.d.ts +11 -0
- package/dist/cjs/experimental/cache.js +79 -0
- package/dist/cjs/experimental/cache.js.map +7 -0
- package/dist/cjs/experimental/client.d.ts +4 -2
- package/dist/cjs/experimental/client.js +4 -2
- package/dist/cjs/experimental/client.js.map +2 -2
- package/dist/cjs/experimental/core.d.ts +10 -2
- package/dist/cjs/experimental/core.js +59 -1
- package/dist/cjs/experimental/core.js.map +2 -2
- package/dist/cjs/experimental/index.d.ts +5 -0
- package/dist/cjs/experimental/index.js +29 -0
- package/dist/cjs/experimental/index.js.map +7 -0
- package/dist/cjs/experimental/transports/jsonRPC.d.ts +19 -5
- package/dist/cjs/experimental/transports/jsonRPC.js +270 -12
- package/dist/cjs/experimental/transports/jsonRPC.js.map +2 -2
- package/dist/cjs/experimental/types.d.ts +84 -41
- package/dist/cjs/experimental/types.js.map +1 -1
- package/dist/cjs/keypairs/secp256k1/keypair.js +1 -1
- package/dist/cjs/keypairs/secp256k1/keypair.js.map +2 -2
- package/dist/cjs/keypairs/secp256r1/keypair.js +1 -1
- package/dist/cjs/keypairs/secp256r1/keypair.js.map +2 -2
- package/dist/cjs/multisig/publickey.js +5 -5
- package/dist/cjs/multisig/publickey.js.map +2 -2
- package/dist/cjs/multisig/signer.js +2 -2
- package/dist/cjs/multisig/signer.js.map +2 -2
- package/dist/cjs/transactions/intents/CoinWithBalance.d.ts +2 -2
- package/dist/cjs/transactions/intents/CoinWithBalance.js +6 -1
- package/dist/cjs/transactions/intents/CoinWithBalance.js.map +2 -2
- package/dist/cjs/transactions/plugins/utils.js +2 -2
- package/dist/cjs/transactions/plugins/utils.js.map +2 -2
- package/dist/cjs/version.d.ts +2 -2
- package/dist/cjs/version.js +2 -2
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bcs/bcs.d.ts +3 -2
- package/dist/esm/bcs/bcs.js +3 -3
- package/dist/esm/bcs/bcs.js.map +2 -2
- package/dist/esm/bcs/effects.d.ts +18 -12
- package/dist/esm/bcs/index.d.ts +460 -453
- package/dist/esm/bcs/index.js +4 -4
- package/dist/esm/bcs/index.js.map +1 -1
- package/dist/esm/client/client.d.ts +38 -16
- package/dist/esm/client/client.js +143 -63
- package/dist/esm/client/client.js.map +2 -2
- package/dist/esm/client/http-transport.d.ts +2 -0
- package/dist/esm/client/http-transport.js +7 -0
- package/dist/esm/client/http-transport.js.map +2 -2
- package/dist/esm/client/rpc-websocket-client.d.ts +2 -1
- package/dist/esm/client/rpc-websocket-client.js +7 -2
- package/dist/esm/client/rpc-websocket-client.js.map +2 -2
- package/dist/esm/client/types/generated.d.ts +1 -0
- package/dist/esm/client/types/params.d.ts +56 -0
- package/dist/esm/experimental/cache.d.ts +11 -0
- package/dist/esm/experimental/cache.js +59 -0
- package/dist/esm/experimental/cache.js.map +7 -0
- package/dist/esm/experimental/client.d.ts +4 -2
- package/dist/esm/experimental/client.js +4 -2
- package/dist/esm/experimental/client.js.map +2 -2
- package/dist/esm/experimental/core.d.ts +10 -2
- package/dist/esm/experimental/core.js +60 -2
- package/dist/esm/experimental/core.js.map +2 -2
- package/dist/esm/experimental/index.d.ts +5 -0
- package/dist/esm/experimental/index.js +9 -0
- package/dist/esm/experimental/index.js.map +7 -0
- package/dist/esm/experimental/transports/jsonRPC.d.ts +19 -5
- package/dist/esm/experimental/transports/jsonRPC.js +270 -12
- package/dist/esm/experimental/transports/jsonRPC.js.map +2 -2
- package/dist/esm/experimental/types.d.ts +84 -41
- package/dist/esm/keypairs/secp256k1/keypair.js +1 -1
- package/dist/esm/keypairs/secp256k1/keypair.js.map +2 -2
- package/dist/esm/keypairs/secp256r1/keypair.js +1 -1
- package/dist/esm/keypairs/secp256r1/keypair.js.map +2 -2
- package/dist/esm/multisig/publickey.js +5 -5
- package/dist/esm/multisig/publickey.js.map +2 -2
- package/dist/esm/multisig/signer.js +2 -2
- package/dist/esm/multisig/signer.js.map +2 -2
- package/dist/esm/transactions/intents/CoinWithBalance.d.ts +2 -2
- package/dist/esm/transactions/intents/CoinWithBalance.js +6 -1
- package/dist/esm/transactions/intents/CoinWithBalance.js.map +2 -2
- package/dist/esm/transactions/plugins/utils.js +2 -2
- package/dist/esm/transactions/plugins/utils.js.map +2 -2
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.js +2 -2
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/experimental/package.json +6 -0
- package/package.json +7 -2
- package/src/bcs/bcs.ts +3 -3
- package/src/bcs/index.ts +3 -3
- package/src/client/client.ts +119 -26
- package/src/client/http-transport.ts +10 -0
- package/src/client/rpc-websocket-client.ts +8 -1
- package/src/client/types/generated.ts +1 -0
- package/src/client/types/params.ts +68 -6
- package/src/experimental/cache.ts +64 -0
- package/src/experimental/client.ts +4 -2
- package/src/experimental/core.ts +89 -2
- package/src/experimental/index.ts +20 -0
- package/src/experimental/transports/jsonRPC.ts +319 -9
- package/src/experimental/types.ts +92 -48
- package/src/keypairs/secp256k1/keypair.ts +1 -1
- package/src/keypairs/secp256r1/keypair.ts +1 -1
- package/src/multisig/publickey.ts +5 -5
- package/src/multisig/signer.ts +2 -2
- package/src/transactions/__tests__/bcs.test.ts +2 -2
- package/src/transactions/intents/CoinWithBalance.ts +11 -3
- package/src/transactions/plugins/utils.ts +2 -2
- package/src/version.ts +2 -2
|
@@ -23,6 +23,7 @@ export interface DevInspectTransactionBlockParams {
|
|
|
23
23
|
epoch?: string | null | undefined;
|
|
24
24
|
/** Additional arguments including gas_budget, gas_objects, gas_sponsor and skip_checks. */
|
|
25
25
|
additionalArgs?: RpcTypes.DevInspectArgs | null | undefined;
|
|
26
|
+
signal?: AbortSignal;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* Return transaction execution effects including the gas cost summary, while the effects are not
|
|
@@ -30,6 +31,7 @@ export interface DevInspectTransactionBlockParams {
|
|
|
30
31
|
*/
|
|
31
32
|
export interface DryRunTransactionBlockParams {
|
|
32
33
|
transactionBlock: Uint8Array | string;
|
|
34
|
+
signal?: AbortSignal;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Execute the transaction and wait for results if desired. Request types: 1. WaitForEffectsCert: waits
|
|
@@ -53,14 +55,17 @@ export interface ExecuteTransactionBlockParams {
|
|
|
53
55
|
options?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;
|
|
54
56
|
/** @deprecated requestType will be ignored by JSON RPC in the future */
|
|
55
57
|
requestType?: RpcTypes.ExecuteTransactionRequestType | null | undefined;
|
|
58
|
+
signal?: AbortSignal;
|
|
56
59
|
}
|
|
57
60
|
/** Return the first four bytes of the chain's genesis checkpoint digest. */
|
|
58
61
|
export interface GetChainIdentifierParams {
|
|
62
|
+
signal?: AbortSignal;
|
|
59
63
|
}
|
|
60
64
|
/** Return a checkpoint */
|
|
61
65
|
export interface GetCheckpointParams {
|
|
62
66
|
/** Checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input. */
|
|
63
67
|
id: RpcTypes.CheckpointId;
|
|
68
|
+
signal?: AbortSignal;
|
|
64
69
|
}
|
|
65
70
|
/** Return paginated list of checkpoints */
|
|
66
71
|
export interface GetCheckpointsParams {
|
|
@@ -73,41 +78,49 @@ export interface GetCheckpointsParams {
|
|
|
73
78
|
limit?: number | null | undefined;
|
|
74
79
|
/** query result ordering, default to false (ascending order), oldest record first. */
|
|
75
80
|
descendingOrder: boolean;
|
|
81
|
+
signal?: AbortSignal;
|
|
76
82
|
}
|
|
77
83
|
/** Return transaction events. */
|
|
78
84
|
export interface GetEventsParams {
|
|
79
85
|
/** the event query criteria. */
|
|
80
86
|
transactionDigest: string;
|
|
87
|
+
signal?: AbortSignal;
|
|
81
88
|
}
|
|
82
89
|
/** Return the sequence number of the latest checkpoint that has been executed */
|
|
83
90
|
export interface GetLatestCheckpointSequenceNumberParams {
|
|
91
|
+
signal?: AbortSignal;
|
|
84
92
|
}
|
|
85
93
|
/** Return the argument types of a Move function, based on normalized Type. */
|
|
86
94
|
export interface GetMoveFunctionArgTypesParams {
|
|
87
95
|
package: string;
|
|
88
96
|
module: string;
|
|
89
97
|
function: string;
|
|
98
|
+
signal?: AbortSignal;
|
|
90
99
|
}
|
|
91
100
|
/** Return a structured representation of Move function */
|
|
92
101
|
export interface GetNormalizedMoveFunctionParams {
|
|
93
102
|
package: string;
|
|
94
103
|
module: string;
|
|
95
104
|
function: string;
|
|
105
|
+
signal?: AbortSignal;
|
|
96
106
|
}
|
|
97
107
|
/** Return a structured representation of Move module */
|
|
98
108
|
export interface GetNormalizedMoveModuleParams {
|
|
99
109
|
package: string;
|
|
100
110
|
module: string;
|
|
111
|
+
signal?: AbortSignal;
|
|
101
112
|
}
|
|
102
113
|
/** Return structured representations of all modules in the given package */
|
|
103
114
|
export interface GetNormalizedMoveModulesByPackageParams {
|
|
104
115
|
package: string;
|
|
116
|
+
signal?: AbortSignal;
|
|
105
117
|
}
|
|
106
118
|
/** Return a structured representation of Move struct */
|
|
107
119
|
export interface GetNormalizedMoveStructParams {
|
|
108
120
|
package: string;
|
|
109
121
|
module: string;
|
|
110
122
|
struct: string;
|
|
123
|
+
signal?: AbortSignal;
|
|
111
124
|
}
|
|
112
125
|
/** Return the object information for a specified object */
|
|
113
126
|
export interface GetObjectParams {
|
|
@@ -115,6 +128,7 @@ export interface GetObjectParams {
|
|
|
115
128
|
id: string;
|
|
116
129
|
/** options for specifying the content to be returned */
|
|
117
130
|
options?: RpcTypes.SuiObjectDataOptions | null | undefined;
|
|
131
|
+
signal?: AbortSignal;
|
|
118
132
|
}
|
|
119
133
|
/**
|
|
120
134
|
* Return the protocol config table for the given version number. If the version number is not
|
|
@@ -126,9 +140,11 @@ export interface GetProtocolConfigParams {
|
|
|
126
140
|
* will be returned.
|
|
127
141
|
*/
|
|
128
142
|
version?: string | null | undefined;
|
|
143
|
+
signal?: AbortSignal;
|
|
129
144
|
}
|
|
130
145
|
/** Return the total number of transaction blocks known to the server. */
|
|
131
146
|
export interface GetTotalTransactionBlocksParams {
|
|
147
|
+
signal?: AbortSignal;
|
|
132
148
|
}
|
|
133
149
|
/** Return the transaction response object. */
|
|
134
150
|
export interface GetTransactionBlockParams {
|
|
@@ -136,6 +152,7 @@ export interface GetTransactionBlockParams {
|
|
|
136
152
|
digest: string;
|
|
137
153
|
/** options for specifying the content to be returned */
|
|
138
154
|
options?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;
|
|
155
|
+
signal?: AbortSignal;
|
|
139
156
|
}
|
|
140
157
|
/** Return the object data for a list of objects */
|
|
141
158
|
export interface MultiGetObjectsParams {
|
|
@@ -143,6 +160,7 @@ export interface MultiGetObjectsParams {
|
|
|
143
160
|
ids: string[];
|
|
144
161
|
/** options for specifying the content to be returned */
|
|
145
162
|
options?: RpcTypes.SuiObjectDataOptions | null | undefined;
|
|
163
|
+
signal?: AbortSignal;
|
|
146
164
|
}
|
|
147
165
|
/**
|
|
148
166
|
* Returns an ordered list of transaction responses The method will throw an error if the input
|
|
@@ -153,6 +171,7 @@ export interface MultiGetTransactionBlocksParams {
|
|
|
153
171
|
digests: string[];
|
|
154
172
|
/** config options to control which fields to fetch */
|
|
155
173
|
options?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;
|
|
174
|
+
signal?: AbortSignal;
|
|
156
175
|
}
|
|
157
176
|
/**
|
|
158
177
|
* Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by
|
|
@@ -166,6 +185,7 @@ export interface TryGetPastObjectParams {
|
|
|
166
185
|
version: number;
|
|
167
186
|
/** options for specifying the content to be returned */
|
|
168
187
|
options?: RpcTypes.SuiObjectDataOptions | null | undefined;
|
|
188
|
+
signal?: AbortSignal;
|
|
169
189
|
}
|
|
170
190
|
/**
|
|
171
191
|
* Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by
|
|
@@ -177,6 +197,7 @@ export interface TryMultiGetPastObjectsParams {
|
|
|
177
197
|
pastObjects: RpcTypes.GetPastObjectRequest[];
|
|
178
198
|
/** options for specifying the content to be returned */
|
|
179
199
|
options?: RpcTypes.SuiObjectDataOptions | null | undefined;
|
|
200
|
+
signal?: AbortSignal;
|
|
180
201
|
}
|
|
181
202
|
/** Verify a zklogin signature for the given bytes, intent scope and author. */
|
|
182
203
|
export interface VerifyZkLoginSignatureParams {
|
|
@@ -191,11 +212,13 @@ export interface VerifyZkLoginSignatureParams {
|
|
|
191
212
|
intentScope: RpcTypes.ZkLoginIntentScope;
|
|
192
213
|
/** The author of the signature. */
|
|
193
214
|
author: string;
|
|
215
|
+
signal?: AbortSignal;
|
|
194
216
|
}
|
|
195
217
|
/** Return the total coin balance for all coin type, owned by the address owner. */
|
|
196
218
|
export interface GetAllBalancesParams {
|
|
197
219
|
/** the owner's Sui address */
|
|
198
220
|
owner: string;
|
|
221
|
+
signal?: AbortSignal;
|
|
199
222
|
}
|
|
200
223
|
/** Return all Coin objects owned by an address. */
|
|
201
224
|
export interface GetAllCoinsParams {
|
|
@@ -205,6 +228,7 @@ export interface GetAllCoinsParams {
|
|
|
205
228
|
cursor?: string | null | undefined;
|
|
206
229
|
/** maximum number of items per page */
|
|
207
230
|
limit?: number | null | undefined;
|
|
231
|
+
signal?: AbortSignal;
|
|
208
232
|
}
|
|
209
233
|
/** Return the total coin balance for one coin type, owned by the address owner. */
|
|
210
234
|
export interface GetBalanceParams {
|
|
@@ -215,6 +239,7 @@ export interface GetBalanceParams {
|
|
|
215
239
|
* default to 0x2::sui::SUI if not specified.
|
|
216
240
|
*/
|
|
217
241
|
coinType?: string | null | undefined;
|
|
242
|
+
signal?: AbortSignal;
|
|
218
243
|
}
|
|
219
244
|
/**
|
|
220
245
|
* Return metadata (e.g., symbol, decimals) for a coin. Note that if the coin's metadata was wrapped in
|
|
@@ -224,6 +249,7 @@ export interface GetBalanceParams {
|
|
|
224
249
|
export interface GetCoinMetadataParams {
|
|
225
250
|
/** type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) */
|
|
226
251
|
coinType: string;
|
|
252
|
+
signal?: AbortSignal;
|
|
227
253
|
}
|
|
228
254
|
/** Return all Coin<`coin_type`> objects owned by an address. */
|
|
229
255
|
export interface GetCoinsParams {
|
|
@@ -238,11 +264,13 @@ export interface GetCoinsParams {
|
|
|
238
264
|
cursor?: string | null | undefined;
|
|
239
265
|
/** maximum number of items per page */
|
|
240
266
|
limit?: number | null | undefined;
|
|
267
|
+
signal?: AbortSignal;
|
|
241
268
|
}
|
|
242
269
|
/** Return the committee information for the asked `epoch`. */
|
|
243
270
|
export interface GetCommitteeInfoParams {
|
|
244
271
|
/** The epoch of interest. If None, default to the latest epoch */
|
|
245
272
|
epoch?: string | null | undefined;
|
|
273
|
+
signal?: AbortSignal;
|
|
246
274
|
}
|
|
247
275
|
/** Return the dynamic field object information for a specified object */
|
|
248
276
|
export interface GetDynamicFieldObjectParams {
|
|
@@ -250,6 +278,7 @@ export interface GetDynamicFieldObjectParams {
|
|
|
250
278
|
parentId: string;
|
|
251
279
|
/** The Name of the dynamic field */
|
|
252
280
|
name: RpcTypes.DynamicFieldName;
|
|
281
|
+
signal?: AbortSignal;
|
|
253
282
|
}
|
|
254
283
|
/** Return the list of dynamic field objects owned by an object. */
|
|
255
284
|
export interface GetDynamicFieldsParams {
|
|
@@ -262,9 +291,11 @@ export interface GetDynamicFieldsParams {
|
|
|
262
291
|
cursor?: string | null | undefined;
|
|
263
292
|
/** Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */
|
|
264
293
|
limit?: number | null | undefined;
|
|
294
|
+
signal?: AbortSignal;
|
|
265
295
|
}
|
|
266
296
|
/** Return the latest SUI system state object on-chain. */
|
|
267
297
|
export interface GetLatestSuiSystemStateParams {
|
|
298
|
+
signal?: AbortSignal;
|
|
268
299
|
}
|
|
269
300
|
/**
|
|
270
301
|
* Return the list of objects owned by an address. Note that if the address owns more than
|
|
@@ -281,25 +312,31 @@ export type GetOwnedObjectsParams = {
|
|
|
281
312
|
cursor?: string | null | undefined;
|
|
282
313
|
/** Max number of items returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */
|
|
283
314
|
limit?: number | null | undefined;
|
|
315
|
+
signal?: AbortSignal;
|
|
284
316
|
} & RpcTypes.SuiObjectResponseQuery;
|
|
285
317
|
/** Return the reference gas price for the network */
|
|
286
318
|
export interface GetReferenceGasPriceParams {
|
|
319
|
+
signal?: AbortSignal;
|
|
287
320
|
}
|
|
288
321
|
/** Return all [DelegatedStake]. */
|
|
289
322
|
export interface GetStakesParams {
|
|
290
323
|
owner: string;
|
|
324
|
+
signal?: AbortSignal;
|
|
291
325
|
}
|
|
292
326
|
/** Return one or more [DelegatedStake]. If a Stake was withdrawn its status will be Unstaked. */
|
|
293
327
|
export interface GetStakesByIdsParams {
|
|
294
328
|
stakedSuiIds: string[];
|
|
329
|
+
signal?: AbortSignal;
|
|
295
330
|
}
|
|
296
331
|
/** Return total supply for a coin */
|
|
297
332
|
export interface GetTotalSupplyParams {
|
|
298
333
|
/** type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) */
|
|
299
334
|
coinType: string;
|
|
335
|
+
signal?: AbortSignal;
|
|
300
336
|
}
|
|
301
337
|
/** Return the validator APY */
|
|
302
338
|
export interface GetValidatorsApyParams {
|
|
339
|
+
signal?: AbortSignal;
|
|
303
340
|
}
|
|
304
341
|
/** Return list of events for a specified query criteria. */
|
|
305
342
|
export interface QueryEventsParams {
|
|
@@ -314,6 +351,7 @@ export interface QueryEventsParams {
|
|
|
314
351
|
limit?: number | null | undefined;
|
|
315
352
|
/** query result ordering, default to false (ascending order), oldest record first. */
|
|
316
353
|
order?: 'ascending' | 'descending' | null | undefined;
|
|
354
|
+
signal?: AbortSignal;
|
|
317
355
|
}
|
|
318
356
|
/** Return list of transactions for a specified query criteria. */
|
|
319
357
|
export type QueryTransactionBlocksParams = {
|
|
@@ -326,11 +364,13 @@ export type QueryTransactionBlocksParams = {
|
|
|
326
364
|
limit?: number | null | undefined;
|
|
327
365
|
/** query result ordering, default to false (ascending order), oldest record first. */
|
|
328
366
|
order?: 'ascending' | 'descending' | null | undefined;
|
|
367
|
+
signal?: AbortSignal;
|
|
329
368
|
} & RpcTypes.SuiTransactionBlockResponseQuery;
|
|
330
369
|
/** Return the resolved address given resolver and name */
|
|
331
370
|
export interface ResolveNameServiceAddressParams {
|
|
332
371
|
/** The name to resolve */
|
|
333
372
|
name: string;
|
|
373
|
+
signal?: AbortSignal;
|
|
334
374
|
}
|
|
335
375
|
/**
|
|
336
376
|
* Return the resolved names given address, if multiple names are resolved, the first one is the
|
|
@@ -341,6 +381,7 @@ export interface ResolveNameServiceNamesParams {
|
|
|
341
381
|
address: string;
|
|
342
382
|
cursor?: string | null | undefined;
|
|
343
383
|
limit?: number | null | undefined;
|
|
384
|
+
signal?: AbortSignal;
|
|
344
385
|
}
|
|
345
386
|
/** Subscribe to a stream of Sui event */
|
|
346
387
|
export interface SubscribeEventParams {
|
|
@@ -349,10 +390,12 @@ export interface SubscribeEventParams {
|
|
|
349
390
|
* [Event filter](https://docs.sui.io/build/event_api#event-filters) documentation for examples.
|
|
350
391
|
*/
|
|
351
392
|
filter: RpcTypes.SuiEventFilter;
|
|
393
|
+
signal?: AbortSignal;
|
|
352
394
|
}
|
|
353
395
|
/** Subscribe to a stream of Sui transaction effects */
|
|
354
396
|
export interface SubscribeTransactionParams {
|
|
355
397
|
filter: RpcTypes.TransactionFilter;
|
|
398
|
+
signal?: AbortSignal;
|
|
356
399
|
}
|
|
357
400
|
/** Create an unsigned batched transaction. */
|
|
358
401
|
export interface UnsafeBatchTransactionParams {
|
|
@@ -369,6 +412,7 @@ export interface UnsafeBatchTransactionParams {
|
|
|
369
412
|
gasBudget: string;
|
|
370
413
|
/** Whether this is a regular transaction or a Dev Inspect Transaction */
|
|
371
414
|
txnBuilderMode?: RpcTypes.SuiTransactionBlockBuilderMode | null | undefined;
|
|
415
|
+
signal?: AbortSignal;
|
|
372
416
|
}
|
|
373
417
|
/** Create an unsigned transaction to merge multiple coins into one coin. */
|
|
374
418
|
export interface UnsafeMergeCoinsParams {
|
|
@@ -388,6 +432,7 @@ export interface UnsafeMergeCoinsParams {
|
|
|
388
432
|
gas?: string | null | undefined;
|
|
389
433
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
390
434
|
gasBudget: string;
|
|
435
|
+
signal?: AbortSignal;
|
|
391
436
|
}
|
|
392
437
|
/**
|
|
393
438
|
* Create an unsigned transaction to execute a Move call on the network, by calling the specified
|
|
@@ -421,6 +466,7 @@ export interface UnsafeMoveCallParams {
|
|
|
421
466
|
* `SuiTransactionBlockBuilderMode::Commit` when it's None.
|
|
422
467
|
*/
|
|
423
468
|
executionMode?: RpcTypes.SuiTransactionBlockBuilderMode | null | undefined;
|
|
469
|
+
signal?: AbortSignal;
|
|
424
470
|
}
|
|
425
471
|
/**
|
|
426
472
|
* Send `Coin<T>` to a list of addresses, where `T` can be any coin type, following a list of amounts,
|
|
@@ -444,6 +490,7 @@ export interface UnsafePayParams {
|
|
|
444
490
|
gas?: string | null | undefined;
|
|
445
491
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
446
492
|
gasBudget: string;
|
|
493
|
+
signal?: AbortSignal;
|
|
447
494
|
}
|
|
448
495
|
/**
|
|
449
496
|
* Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas
|
|
@@ -461,6 +508,7 @@ export interface UnsafePayAllSuiParams {
|
|
|
461
508
|
recipient: string;
|
|
462
509
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
463
510
|
gasBudget: string;
|
|
511
|
+
signal?: AbortSignal;
|
|
464
512
|
}
|
|
465
513
|
/**
|
|
466
514
|
* Send SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and
|
|
@@ -482,6 +530,7 @@ export interface UnsafePaySuiParams {
|
|
|
482
530
|
amounts: string[];
|
|
483
531
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
484
532
|
gasBudget: string;
|
|
533
|
+
signal?: AbortSignal;
|
|
485
534
|
}
|
|
486
535
|
/** Create an unsigned transaction to publish a Move package. */
|
|
487
536
|
export interface UnsafePublishParams {
|
|
@@ -498,6 +547,7 @@ export interface UnsafePublishParams {
|
|
|
498
547
|
gas?: string | null | undefined;
|
|
499
548
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
500
549
|
gasBudget: string;
|
|
550
|
+
signal?: AbortSignal;
|
|
501
551
|
}
|
|
502
552
|
/** Add stake to a validator's staking pool using multiple coins and amount. */
|
|
503
553
|
export interface UnsafeRequestAddStakeParams {
|
|
@@ -516,6 +566,7 @@ export interface UnsafeRequestAddStakeParams {
|
|
|
516
566
|
gas?: string | null | undefined;
|
|
517
567
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
518
568
|
gasBudget: string;
|
|
569
|
+
signal?: AbortSignal;
|
|
519
570
|
}
|
|
520
571
|
/** Withdraw stake from a validator's staking pool. */
|
|
521
572
|
export interface UnsafeRequestWithdrawStakeParams {
|
|
@@ -530,6 +581,7 @@ export interface UnsafeRequestWithdrawStakeParams {
|
|
|
530
581
|
gas?: string | null | undefined;
|
|
531
582
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
532
583
|
gasBudget: string;
|
|
584
|
+
signal?: AbortSignal;
|
|
533
585
|
}
|
|
534
586
|
/** Create an unsigned transaction to split a coin object into multiple coins. */
|
|
535
587
|
export interface UnsafeSplitCoinParams {
|
|
@@ -546,6 +598,7 @@ export interface UnsafeSplitCoinParams {
|
|
|
546
598
|
gas?: string | null | undefined;
|
|
547
599
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
548
600
|
gasBudget: string;
|
|
601
|
+
signal?: AbortSignal;
|
|
549
602
|
}
|
|
550
603
|
/** Create an unsigned transaction to split a coin object into multiple equal-size coins. */
|
|
551
604
|
export interface UnsafeSplitCoinEqualParams {
|
|
@@ -562,6 +615,7 @@ export interface UnsafeSplitCoinEqualParams {
|
|
|
562
615
|
gas?: string | null | undefined;
|
|
563
616
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
564
617
|
gasBudget: string;
|
|
618
|
+
signal?: AbortSignal;
|
|
565
619
|
}
|
|
566
620
|
/**
|
|
567
621
|
* Create an unsigned transaction to transfer an object from one address to another. The object's type
|
|
@@ -581,6 +635,7 @@ export interface UnsafeTransferObjectParams {
|
|
|
581
635
|
gasBudget: string;
|
|
582
636
|
/** the recipient's Sui address */
|
|
583
637
|
recipient: string;
|
|
638
|
+
signal?: AbortSignal;
|
|
584
639
|
}
|
|
585
640
|
/**
|
|
586
641
|
* Create an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used
|
|
@@ -597,4 +652,5 @@ export interface UnsafeTransferSuiParams {
|
|
|
597
652
|
recipient: string;
|
|
598
653
|
/** the amount to be split out and transferred */
|
|
599
654
|
amount?: string | null | undefined;
|
|
655
|
+
signal?: AbortSignal;
|
|
600
656
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/client/types/params.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * ######################################\n * ### DO NOT EDIT THIS FILE DIRECTLY ###\n * ######################################\n *\n * This file is generated from:\n * /crates/sui-open-rpc/spec/openrpc.json\n */\n\nimport type { Transaction } from '../../transactions/index.js';\nimport type * as RpcTypes from './generated.js';\n\n/**\n * Runs the transaction in dev-inspect mode. Which allows for nearly any transaction (or Move call)\n * with any arguments. Detailed results are provided, including both the transaction effects and any\n * return values.\n */\nexport interface DevInspectTransactionBlockParams {\n\tsender: string;\n\t/** BCS encoded TransactionKind(as opposed to TransactionData, which include gasBudget and gasPrice) */\n\ttransactionBlock: Transaction | Uint8Array | string;\n\t/** Gas is not charged, but gas usage is still calculated. Default to use reference gas price */\n\tgasPrice?: bigint | number | null | undefined;\n\t/** The epoch to perform the call. Will be set from the system state object if not provided */\n\tepoch?: string | null | undefined;\n\t/** Additional arguments including gas_budget, gas_objects, gas_sponsor and skip_checks. */\n\tadditionalArgs?: RpcTypes.DevInspectArgs | null | undefined;\n}\n/**\n * Return transaction execution effects including the gas cost summary, while the effects are not\n * committed to the chain.\n */\nexport interface DryRunTransactionBlockParams {\n\ttransactionBlock: Uint8Array | string;\n}\n/**\n * Execute the transaction and wait for results if desired. Request types: 1. WaitForEffectsCert: waits\n * for TransactionEffectsCert and then return to client. This mode is a proxy for transaction\n * finality. 2. WaitForLocalExecution: waits for TransactionEffectsCert and make sure the node executed\n * the transaction locally before returning the client. The local execution makes sure this node is\n * aware of this transaction when client fires subsequent queries. However if the node fails to execute\n * the transaction locally in a timely manner, a bool type in the response is set to false to indicated\n * the case. request_type is default to be `WaitForEffectsCert` unless options.show_events or\n * options.show_effects is true\n */\nexport interface ExecuteTransactionBlockParams {\n\t/** BCS serialized transaction data bytes without its type tag, as base-64 encoded string. */\n\ttransactionBlock: Uint8Array | string;\n\t/**\n\t * A list of signatures (`flag || signature || pubkey` bytes, as base-64 encoded string). Signature is\n\t * committed to the intent message of the transaction data, as base-64 encoded string.\n\t */\n\tsignature: string | string[];\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;\n\t/** @deprecated requestType will be ignored by JSON RPC in the future */\n\trequestType?: RpcTypes.ExecuteTransactionRequestType | null | undefined;\n}\n/** Return the first four bytes of the chain's genesis checkpoint digest. */\nexport interface GetChainIdentifierParams {}\n/** Return a checkpoint */\nexport interface GetCheckpointParams {\n\t/** Checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input. */\n\tid: RpcTypes.CheckpointId;\n}\n/** Return paginated list of checkpoints */\nexport interface GetCheckpointsParams {\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT_CHECKPOINTS] if not specified. */\n\tlimit?: number | null | undefined;\n\t/** query result ordering, default to false (ascending order), oldest record first. */\n\tdescendingOrder: boolean;\n}\n/** Return transaction events. */\nexport interface GetEventsParams {\n\t/** the event query criteria. */\n\ttransactionDigest: string;\n}\n/** Return the sequence number of the latest checkpoint that has been executed */\nexport interface GetLatestCheckpointSequenceNumberParams {}\n/** Return the argument types of a Move function, based on normalized Type. */\nexport interface GetMoveFunctionArgTypesParams {\n\tpackage: string;\n\tmodule: string;\n\tfunction: string;\n}\n/** Return a structured representation of Move function */\nexport interface GetNormalizedMoveFunctionParams {\n\tpackage: string;\n\tmodule: string;\n\tfunction: string;\n}\n/** Return a structured representation of Move module */\nexport interface GetNormalizedMoveModuleParams {\n\tpackage: string;\n\tmodule: string;\n}\n/** Return structured representations of all modules in the given package */\nexport interface GetNormalizedMoveModulesByPackageParams {\n\tpackage: string;\n}\n/** Return a structured representation of Move struct */\nexport interface GetNormalizedMoveStructParams {\n\tpackage: string;\n\tmodule: string;\n\tstruct: string;\n}\n/** Return the object information for a specified object */\nexport interface GetObjectParams {\n\t/** the ID of the queried object */\n\tid: string;\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n}\n/**\n * Return the protocol config table for the given version number. If the version number is not\n * specified, If none is specified, the node uses the version of the latest epoch it has processed.\n */\nexport interface GetProtocolConfigParams {\n\t/**\n\t * An optional protocol version specifier. If omitted, the latest protocol config table for the node\n\t * will be returned.\n\t */\n\tversion?: string | null | undefined;\n}\n/** Return the total number of transaction blocks known to the server. */\nexport interface GetTotalTransactionBlocksParams {}\n/** Return the transaction response object. */\nexport interface GetTransactionBlockParams {\n\t/** the digest of the queried transaction */\n\tdigest: string;\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;\n}\n/** Return the object data for a list of objects */\nexport interface MultiGetObjectsParams {\n\t/** the IDs of the queried objects */\n\tids: string[];\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n}\n/**\n * Returns an ordered list of transaction responses The method will throw an error if the input\n * contains any duplicate or the input size exceeds QUERY_MAX_RESULT_LIMIT\n */\nexport interface MultiGetTransactionBlocksParams {\n\t/** A list of transaction digests. */\n\tdigests: string[];\n\t/** config options to control which fields to fetch */\n\toptions?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;\n}\n/**\n * Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by\n * this API, even if the object and version exists/existed. The result may vary across nodes depending\n * on their pruning policies. Return the object information for a specified version\n */\nexport interface TryGetPastObjectParams {\n\t/** the ID of the queried object */\n\tid: string;\n\t/** the version of the queried object. If None, default to the latest known version */\n\tversion: number;\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n}\n/**\n * Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by\n * this API, even if the object and version exists/existed. The result may vary across nodes depending\n * on their pruning policies. Return the object information for a specified version\n */\nexport interface TryMultiGetPastObjectsParams {\n\t/** a vector of object and versions to be queried */\n\tpastObjects: RpcTypes.GetPastObjectRequest[];\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n}\n/** Verify a zklogin signature for the given bytes, intent scope and author. */\nexport interface VerifyZkLoginSignatureParams {\n\t/**\n\t * The Base64 string of bcs bytes for raw transaction data or personal message indicated by\n\t * intent_scope.\n\t */\n\tbytes: string;\n\t/** The Base64 string of the zklogin signature to verify. */\n\tsignature: string;\n\t/** The intent scope, either transaction data or personal message. Used to parse bytes. */\n\tintentScope: RpcTypes.ZkLoginIntentScope;\n\t/** The author of the signature. */\n\tauthor: string;\n}\n/** Return the total coin balance for all coin type, owned by the address owner. */\nexport interface GetAllBalancesParams {\n\t/** the owner's Sui address */\n\towner: string;\n}\n/** Return all Coin objects owned by an address. */\nexport interface GetAllCoinsParams {\n\t/** the owner's Sui address */\n\towner: string;\n\t/** optional paging cursor */\n\tcursor?: string | null | undefined;\n\t/** maximum number of items per page */\n\tlimit?: number | null | undefined;\n}\n/** Return the total coin balance for one coin type, owned by the address owner. */\nexport interface GetBalanceParams {\n\t/** the owner's Sui address */\n\towner: string;\n\t/**\n\t * optional type names for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC),\n\t * default to 0x2::sui::SUI if not specified.\n\t */\n\tcoinType?: string | null | undefined;\n}\n/**\n * Return metadata (e.g., symbol, decimals) for a coin. Note that if the coin's metadata was wrapped in\n * the transaction that published its marker type, or the latest version of the metadata object is\n * wrapped or deleted, it will not be found.\n */\nexport interface GetCoinMetadataParams {\n\t/** type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) */\n\tcoinType: string;\n}\n/** Return all Coin<`coin_type`> objects owned by an address. */\nexport interface GetCoinsParams {\n\t/** the owner's Sui address */\n\towner: string;\n\t/**\n\t * optional type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC),\n\t * default to 0x2::sui::SUI if not specified.\n\t */\n\tcoinType?: string | null | undefined;\n\t/** optional paging cursor */\n\tcursor?: string | null | undefined;\n\t/** maximum number of items per page */\n\tlimit?: number | null | undefined;\n}\n/** Return the committee information for the asked `epoch`. */\nexport interface GetCommitteeInfoParams {\n\t/** The epoch of interest. If None, default to the latest epoch */\n\tepoch?: string | null | undefined;\n}\n/** Return the dynamic field object information for a specified object */\nexport interface GetDynamicFieldObjectParams {\n\t/** The ID of the queried parent object */\n\tparentId: string;\n\t/** The Name of the dynamic field */\n\tname: RpcTypes.DynamicFieldName;\n}\n/** Return the list of dynamic field objects owned by an object. */\nexport interface GetDynamicFieldsParams {\n\t/** The ID of the parent object */\n\tparentId: string;\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */\n\tlimit?: number | null | undefined;\n}\n/** Return the latest SUI system state object on-chain. */\nexport interface GetLatestSuiSystemStateParams {}\n/**\n * Return the list of objects owned by an address. Note that if the address owns more than\n * `QUERY_MAX_RESULT_LIMIT` objects, the pagination is not accurate, because previous page may have\n * been updated when the next page is fetched. Please use suix_queryObjects if this is a concern.\n */\nexport type GetOwnedObjectsParams = {\n\t/** the owner's Sui address */\n\towner: string;\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Max number of items returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */\n\tlimit?: number | null | undefined;\n} & RpcTypes.SuiObjectResponseQuery;\n/** Return the reference gas price for the network */\nexport interface GetReferenceGasPriceParams {}\n/** Return all [DelegatedStake]. */\nexport interface GetStakesParams {\n\towner: string;\n}\n/** Return one or more [DelegatedStake]. If a Stake was withdrawn its status will be Unstaked. */\nexport interface GetStakesByIdsParams {\n\tstakedSuiIds: string[];\n}\n/** Return total supply for a coin */\nexport interface GetTotalSupplyParams {\n\t/** type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) */\n\tcoinType: string;\n}\n/** Return the validator APY */\nexport interface GetValidatorsApyParams {}\n/** Return list of events for a specified query criteria. */\nexport interface QueryEventsParams {\n\t/**\n\t * The event query criteria. See [Event filter](https://docs.sui.io/build/event_api#event-filters)\n\t * documentation for examples.\n\t */\n\tquery: RpcTypes.SuiEventFilter;\n\t/** optional paging cursor */\n\tcursor?: RpcTypes.EventId | null | undefined;\n\t/** maximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */\n\tlimit?: number | null | undefined;\n\t/** query result ordering, default to false (ascending order), oldest record first. */\n\torder?: 'ascending' | 'descending' | null | undefined;\n}\n/** Return list of transactions for a specified query criteria. */\nexport type QueryTransactionBlocksParams = {\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Maximum item returned per page, default to QUERY_MAX_RESULT_LIMIT if not specified. */\n\tlimit?: number | null | undefined;\n\t/** query result ordering, default to false (ascending order), oldest record first. */\n\torder?: 'ascending' | 'descending' | null | undefined;\n} & RpcTypes.SuiTransactionBlockResponseQuery;\n/** Return the resolved address given resolver and name */\nexport interface ResolveNameServiceAddressParams {\n\t/** The name to resolve */\n\tname: string;\n}\n/**\n * Return the resolved names given address, if multiple names are resolved, the first one is the\n * primary name.\n */\nexport interface ResolveNameServiceNamesParams {\n\t/** The address to resolve */\n\taddress: string;\n\tcursor?: string | null | undefined;\n\tlimit?: number | null | undefined;\n}\n/** Subscribe to a stream of Sui event */\nexport interface SubscribeEventParams {\n\t/**\n\t * The filter criteria of the event stream. See\n\t * [Event filter](https://docs.sui.io/build/event_api#event-filters) documentation for examples.\n\t */\n\tfilter: RpcTypes.SuiEventFilter;\n}\n/** Subscribe to a stream of Sui transaction effects */\nexport interface SubscribeTransactionParams {\n\tfilter: RpcTypes.TransactionFilter;\n}\n/** Create an unsigned batched transaction. */\nexport interface UnsafeBatchTransactionParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** list of transaction request parameters */\n\tsingleTransactionParams: RpcTypes.RPCTransactionRequestParams[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/** Whether this is a regular transaction or a Dev Inspect Transaction */\n\ttxnBuilderMode?: RpcTypes.SuiTransactionBlockBuilderMode | null | undefined;\n}\n/** Create an unsigned transaction to merge multiple coins into one coin. */\nexport interface UnsafeMergeCoinsParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the coin object to merge into, this coin will remain after the transaction */\n\tprimaryCoin: string;\n\t/**\n\t * the coin object to be merged, this coin will be destroyed, the balance will be added to\n\t * `primary_coin`\n\t */\n\tcoinToMerge: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/**\n * Create an unsigned transaction to execute a Move call on the network, by calling the specified\n * function in the module of a given package.\n */\nexport interface UnsafeMoveCallParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Move package ID, e.g. `0x2` */\n\tpackageObjectId: string;\n\t/** the Move module name, e.g. `pay` */\n\tmodule: string;\n\t/** the move function name, e.g. `split` */\n\tfunction: string;\n\t/** the type arguments of the Move function */\n\ttypeArguments: string[];\n\t/**\n\t * the arguments to be passed into the Move function, in [SuiJson](https://docs.sui.io/build/sui-json)\n\t * format\n\t */\n\targuments: unknown[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/**\n\t * Whether this is a Normal transaction or a Dev Inspect Transaction. Default to be\n\t * `SuiTransactionBlockBuilderMode::Commit` when it's None.\n\t */\n\texecutionMode?: RpcTypes.SuiTransactionBlockBuilderMode | null | undefined;\n}\n/**\n * Send `Coin<T>` to a list of addresses, where `T` can be any coin type, following a list of amounts,\n * The object specified in the `gas` field will be used to pay the gas fee for the transaction. The gas\n * object can not appear in `input_coins`. If the gas object is not specified, the RPC server will\n * auto-select one.\n */\nexport interface UnsafePayParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coins to be used in this transaction */\n\tinputCoins: string[];\n\t/** the recipients' addresses, the length of this vector must be the same as amounts. */\n\trecipients: string[];\n\t/** the amounts to be transferred to recipients, following the same order */\n\tamounts: string[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/**\n * Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas\n * coin object. Specifically, what pay_all_sui does are: 1. accumulate all SUI from input coins and\n * deposit all SUI to the first input coin 2. transfer the updated first coin to the recipient and also\n * use this first coin as gas coin object. 3. the balance of the first input coin after tx is\n * sum(input_coins) - actual_gas_cost. 4. all other input coins other than the first are deleted.\n */\nexport interface UnsafePayAllSuiParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coins to be used in this transaction, including the coin for gas payment. */\n\tinputCoins: string[];\n\t/** the recipient address, */\n\trecipient: string;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/**\n * Send SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and\n * does not require a separate gas coin object. Specifically, what pay_sui does are: 1. debit each\n * input_coin to create new coin following the order of amounts and assign it to the corresponding\n * recipient. 2. accumulate all residual SUI from input coins left and deposit all SUI to the first\n * input coin, then use the first input coin as the gas coin object. 3. the balance of the first input\n * coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost 4. all other input coints other\n * than the first one are deleted.\n */\nexport interface UnsafePaySuiParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coins to be used in this transaction, including the coin for gas payment. */\n\tinputCoins: string[];\n\t/** the recipients' addresses, the length of this vector must be the same as amounts. */\n\trecipients: string[];\n\t/** the amounts to be transferred to recipients, following the same order */\n\tamounts: string[];\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/** Create an unsigned transaction to publish a Move package. */\nexport interface UnsafePublishParams {\n\t/** the transaction signer's Sui address */\n\tsender: string;\n\t/** the compiled bytes of a Move package */\n\tcompiledModules: string[];\n\t/** a list of transitive dependency addresses that this set of modules depends on. */\n\tdependencies: string[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/** Add stake to a validator's staking pool using multiple coins and amount. */\nexport interface UnsafeRequestAddStakeParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** Coin<SUI> object to stake */\n\tcoins: string[];\n\t/** stake amount */\n\tamount?: string | null | undefined;\n\t/** the validator's Sui address */\n\tvalidator: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/** Withdraw stake from a validator's staking pool. */\nexport interface UnsafeRequestWithdrawStakeParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** StakedSui object ID */\n\tstakedSui: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/** Create an unsigned transaction to split a coin object into multiple coins. */\nexport interface UnsafeSplitCoinParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the coin object to be spilt */\n\tcoinObjectId: string;\n\t/** the amounts to split out from the coin */\n\tsplitAmounts: string[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/** Create an unsigned transaction to split a coin object into multiple equal-size coins. */\nexport interface UnsafeSplitCoinEqualParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the coin object to be spilt */\n\tcoinObjectId: string;\n\t/** the number of coins to split into */\n\tsplitCount: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n}\n/**\n * Create an unsigned transaction to transfer an object from one address to another. The object's type\n * must allow public transfers\n */\nexport interface UnsafeTransferObjectParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the ID of the object to be transferred */\n\tobjectId: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/** the recipient's Sui address */\n\trecipient: string;\n}\n/**\n * Create an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used\n * as the gas object.\n */\nexport interface UnsafeTransferSuiParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coin object to be used in this transaction */\n\tsuiObjectId: string;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/** the recipient's Sui address */\n\trecipient: string;\n\t/** the amount to be split out and transferred */\n\tamount?: string | null | undefined;\n}\n"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * ######################################\n * ### DO NOT EDIT THIS FILE DIRECTLY ###\n * ######################################\n *\n * This file is generated from:\n * /crates/sui-open-rpc/spec/openrpc.json\n */\n\nimport type { Transaction } from '../../transactions/index.js';\nimport type * as RpcTypes from './generated.js';\n\n/**\n * Runs the transaction in dev-inspect mode. Which allows for nearly any transaction (or Move call)\n * with any arguments. Detailed results are provided, including both the transaction effects and any\n * return values.\n */\nexport interface DevInspectTransactionBlockParams {\n\tsender: string;\n\t/** BCS encoded TransactionKind(as opposed to TransactionData, which include gasBudget and gasPrice) */\n\ttransactionBlock: Transaction | Uint8Array | string;\n\t/** Gas is not charged, but gas usage is still calculated. Default to use reference gas price */\n\tgasPrice?: bigint | number | null | undefined;\n\t/** The epoch to perform the call. Will be set from the system state object if not provided */\n\tepoch?: string | null | undefined;\n\t/** Additional arguments including gas_budget, gas_objects, gas_sponsor and skip_checks. */\n\tadditionalArgs?: RpcTypes.DevInspectArgs | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Return transaction execution effects including the gas cost summary, while the effects are not\n * committed to the chain.\n */\nexport interface DryRunTransactionBlockParams {\n\ttransactionBlock: Uint8Array | string;\n\tsignal?: AbortSignal;\n}\n/**\n * Execute the transaction and wait for results if desired. Request types: 1. WaitForEffectsCert: waits\n * for TransactionEffectsCert and then return to client. This mode is a proxy for transaction\n * finality. 2. WaitForLocalExecution: waits for TransactionEffectsCert and make sure the node executed\n * the transaction locally before returning the client. The local execution makes sure this node is\n * aware of this transaction when client fires subsequent queries. However if the node fails to execute\n * the transaction locally in a timely manner, a bool type in the response is set to false to indicated\n * the case. request_type is default to be `WaitForEffectsCert` unless options.show_events or\n * options.show_effects is true\n */\nexport interface ExecuteTransactionBlockParams {\n\t/** BCS serialized transaction data bytes without its type tag, as base-64 encoded string. */\n\ttransactionBlock: Uint8Array | string;\n\t/**\n\t * A list of signatures (`flag || signature || pubkey` bytes, as base-64 encoded string). Signature is\n\t * committed to the intent message of the transaction data, as base-64 encoded string.\n\t */\n\tsignature: string | string[];\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;\n\t/** @deprecated requestType will be ignored by JSON RPC in the future */\n\trequestType?: RpcTypes.ExecuteTransactionRequestType | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the first four bytes of the chain's genesis checkpoint digest. */\nexport interface GetChainIdentifierParams {\n\tsignal?: AbortSignal;\n}\n/** Return a checkpoint */\nexport interface GetCheckpointParams {\n\t/** Checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input. */\n\tid: RpcTypes.CheckpointId;\n\tsignal?: AbortSignal;\n}\n/** Return paginated list of checkpoints */\nexport interface GetCheckpointsParams {\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT_CHECKPOINTS] if not specified. */\n\tlimit?: number | null | undefined;\n\t/** query result ordering, default to false (ascending order), oldest record first. */\n\tdescendingOrder: boolean;\n\tsignal?: AbortSignal;\n}\n/** Return transaction events. */\nexport interface GetEventsParams {\n\t/** the event query criteria. */\n\ttransactionDigest: string;\n\tsignal?: AbortSignal;\n}\n/** Return the sequence number of the latest checkpoint that has been executed */\nexport interface GetLatestCheckpointSequenceNumberParams {\n\tsignal?: AbortSignal;\n}\n/** Return the argument types of a Move function, based on normalized Type. */\nexport interface GetMoveFunctionArgTypesParams {\n\tpackage: string;\n\tmodule: string;\n\tfunction: string;\n\tsignal?: AbortSignal;\n}\n/** Return a structured representation of Move function */\nexport interface GetNormalizedMoveFunctionParams {\n\tpackage: string;\n\tmodule: string;\n\tfunction: string;\n\tsignal?: AbortSignal;\n}\n/** Return a structured representation of Move module */\nexport interface GetNormalizedMoveModuleParams {\n\tpackage: string;\n\tmodule: string;\n\tsignal?: AbortSignal;\n}\n/** Return structured representations of all modules in the given package */\nexport interface GetNormalizedMoveModulesByPackageParams {\n\tpackage: string;\n\tsignal?: AbortSignal;\n}\n/** Return a structured representation of Move struct */\nexport interface GetNormalizedMoveStructParams {\n\tpackage: string;\n\tmodule: string;\n\tstruct: string;\n\tsignal?: AbortSignal;\n}\n/** Return the object information for a specified object */\nexport interface GetObjectParams {\n\t/** the ID of the queried object */\n\tid: string;\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Return the protocol config table for the given version number. If the version number is not\n * specified, If none is specified, the node uses the version of the latest epoch it has processed.\n */\nexport interface GetProtocolConfigParams {\n\t/**\n\t * An optional protocol version specifier. If omitted, the latest protocol config table for the node\n\t * will be returned.\n\t */\n\tversion?: string | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the total number of transaction blocks known to the server. */\nexport interface GetTotalTransactionBlocksParams {\n\tsignal?: AbortSignal;\n}\n/** Return the transaction response object. */\nexport interface GetTransactionBlockParams {\n\t/** the digest of the queried transaction */\n\tdigest: string;\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the object data for a list of objects */\nexport interface MultiGetObjectsParams {\n\t/** the IDs of the queried objects */\n\tids: string[];\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Returns an ordered list of transaction responses The method will throw an error if the input\n * contains any duplicate or the input size exceeds QUERY_MAX_RESULT_LIMIT\n */\nexport interface MultiGetTransactionBlocksParams {\n\t/** A list of transaction digests. */\n\tdigests: string[];\n\t/** config options to control which fields to fetch */\n\toptions?: RpcTypes.SuiTransactionBlockResponseOptions | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by\n * this API, even if the object and version exists/existed. The result may vary across nodes depending\n * on their pruning policies. Return the object information for a specified version\n */\nexport interface TryGetPastObjectParams {\n\t/** the ID of the queried object */\n\tid: string;\n\t/** the version of the queried object. If None, default to the latest known version */\n\tversion: number;\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by\n * this API, even if the object and version exists/existed. The result may vary across nodes depending\n * on their pruning policies. Return the object information for a specified version\n */\nexport interface TryMultiGetPastObjectsParams {\n\t/** a vector of object and versions to be queried */\n\tpastObjects: RpcTypes.GetPastObjectRequest[];\n\t/** options for specifying the content to be returned */\n\toptions?: RpcTypes.SuiObjectDataOptions | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Verify a zklogin signature for the given bytes, intent scope and author. */\nexport interface VerifyZkLoginSignatureParams {\n\t/**\n\t * The Base64 string of bcs bytes for raw transaction data or personal message indicated by\n\t * intent_scope.\n\t */\n\tbytes: string;\n\t/** The Base64 string of the zklogin signature to verify. */\n\tsignature: string;\n\t/** The intent scope, either transaction data or personal message. Used to parse bytes. */\n\tintentScope: RpcTypes.ZkLoginIntentScope;\n\t/** The author of the signature. */\n\tauthor: string;\n\tsignal?: AbortSignal;\n}\n/** Return the total coin balance for all coin type, owned by the address owner. */\nexport interface GetAllBalancesParams {\n\t/** the owner's Sui address */\n\towner: string;\n\tsignal?: AbortSignal;\n}\n/** Return all Coin objects owned by an address. */\nexport interface GetAllCoinsParams {\n\t/** the owner's Sui address */\n\towner: string;\n\t/** optional paging cursor */\n\tcursor?: string | null | undefined;\n\t/** maximum number of items per page */\n\tlimit?: number | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the total coin balance for one coin type, owned by the address owner. */\nexport interface GetBalanceParams {\n\t/** the owner's Sui address */\n\towner: string;\n\t/**\n\t * optional type names for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC),\n\t * default to 0x2::sui::SUI if not specified.\n\t */\n\tcoinType?: string | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Return metadata (e.g., symbol, decimals) for a coin. Note that if the coin's metadata was wrapped in\n * the transaction that published its marker type, or the latest version of the metadata object is\n * wrapped or deleted, it will not be found.\n */\nexport interface GetCoinMetadataParams {\n\t/** type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) */\n\tcoinType: string;\n\tsignal?: AbortSignal;\n}\n/** Return all Coin<`coin_type`> objects owned by an address. */\nexport interface GetCoinsParams {\n\t/** the owner's Sui address */\n\towner: string;\n\t/**\n\t * optional type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC),\n\t * default to 0x2::sui::SUI if not specified.\n\t */\n\tcoinType?: string | null | undefined;\n\t/** optional paging cursor */\n\tcursor?: string | null | undefined;\n\t/** maximum number of items per page */\n\tlimit?: number | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the committee information for the asked `epoch`. */\nexport interface GetCommitteeInfoParams {\n\t/** The epoch of interest. If None, default to the latest epoch */\n\tepoch?: string | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the dynamic field object information for a specified object */\nexport interface GetDynamicFieldObjectParams {\n\t/** The ID of the queried parent object */\n\tparentId: string;\n\t/** The Name of the dynamic field */\n\tname: RpcTypes.DynamicFieldName;\n\tsignal?: AbortSignal;\n}\n/** Return the list of dynamic field objects owned by an object. */\nexport interface GetDynamicFieldsParams {\n\t/** The ID of the parent object */\n\tparentId: string;\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Maximum item returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */\n\tlimit?: number | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return the latest SUI system state object on-chain. */\nexport interface GetLatestSuiSystemStateParams {\n\tsignal?: AbortSignal;\n}\n/**\n * Return the list of objects owned by an address. Note that if the address owns more than\n * `QUERY_MAX_RESULT_LIMIT` objects, the pagination is not accurate, because previous page may have\n * been updated when the next page is fetched. Please use suix_queryObjects if this is a concern.\n */\nexport type GetOwnedObjectsParams = {\n\t/** the owner's Sui address */\n\towner: string;\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Max number of items returned per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */\n\tlimit?: number | null | undefined;\n\tsignal?: AbortSignal;\n} & RpcTypes.SuiObjectResponseQuery;\n/** Return the reference gas price for the network */\nexport interface GetReferenceGasPriceParams {\n\tsignal?: AbortSignal;\n}\n/** Return all [DelegatedStake]. */\nexport interface GetStakesParams {\n\towner: string;\n\tsignal?: AbortSignal;\n}\n/** Return one or more [DelegatedStake]. If a Stake was withdrawn its status will be Unstaked. */\nexport interface GetStakesByIdsParams {\n\tstakedSuiIds: string[];\n\tsignal?: AbortSignal;\n}\n/** Return total supply for a coin */\nexport interface GetTotalSupplyParams {\n\t/** type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC) */\n\tcoinType: string;\n\tsignal?: AbortSignal;\n}\n/** Return the validator APY */\nexport interface GetValidatorsApyParams {\n\tsignal?: AbortSignal;\n}\n/** Return list of events for a specified query criteria. */\nexport interface QueryEventsParams {\n\t/**\n\t * The event query criteria. See [Event filter](https://docs.sui.io/build/event_api#event-filters)\n\t * documentation for examples.\n\t */\n\tquery: RpcTypes.SuiEventFilter;\n\t/** optional paging cursor */\n\tcursor?: RpcTypes.EventId | null | undefined;\n\t/** maximum number of items per page, default to [QUERY_MAX_RESULT_LIMIT] if not specified. */\n\tlimit?: number | null | undefined;\n\t/** query result ordering, default to false (ascending order), oldest record first. */\n\torder?: 'ascending' | 'descending' | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Return list of transactions for a specified query criteria. */\nexport type QueryTransactionBlocksParams = {\n\t/**\n\t * An optional paging cursor. If provided, the query will start from the next item after the specified\n\t * cursor. Default to start from the first item if not specified.\n\t */\n\tcursor?: string | null | undefined;\n\t/** Maximum item returned per page, default to QUERY_MAX_RESULT_LIMIT if not specified. */\n\tlimit?: number | null | undefined;\n\t/** query result ordering, default to false (ascending order), oldest record first. */\n\torder?: 'ascending' | 'descending' | null | undefined;\n\tsignal?: AbortSignal;\n} & RpcTypes.SuiTransactionBlockResponseQuery;\n/** Return the resolved address given resolver and name */\nexport interface ResolveNameServiceAddressParams {\n\t/** The name to resolve */\n\tname: string;\n\tsignal?: AbortSignal;\n}\n/**\n * Return the resolved names given address, if multiple names are resolved, the first one is the\n * primary name.\n */\nexport interface ResolveNameServiceNamesParams {\n\t/** The address to resolve */\n\taddress: string;\n\tcursor?: string | null | undefined;\n\tlimit?: number | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Subscribe to a stream of Sui event */\nexport interface SubscribeEventParams {\n\t/**\n\t * The filter criteria of the event stream. See\n\t * [Event filter](https://docs.sui.io/build/event_api#event-filters) documentation for examples.\n\t */\n\tfilter: RpcTypes.SuiEventFilter;\n\tsignal?: AbortSignal;\n}\n/** Subscribe to a stream of Sui transaction effects */\nexport interface SubscribeTransactionParams {\n\tfilter: RpcTypes.TransactionFilter;\n\tsignal?: AbortSignal;\n}\n/** Create an unsigned batched transaction. */\nexport interface UnsafeBatchTransactionParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** list of transaction request parameters */\n\tsingleTransactionParams: RpcTypes.RPCTransactionRequestParams[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/** Whether this is a regular transaction or a Dev Inspect Transaction */\n\ttxnBuilderMode?: RpcTypes.SuiTransactionBlockBuilderMode | null | undefined;\n\tsignal?: AbortSignal;\n}\n/** Create an unsigned transaction to merge multiple coins into one coin. */\nexport interface UnsafeMergeCoinsParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the coin object to merge into, this coin will remain after the transaction */\n\tprimaryCoin: string;\n\t/**\n\t * the coin object to be merged, this coin will be destroyed, the balance will be added to\n\t * `primary_coin`\n\t */\n\tcoinToMerge: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/**\n * Create an unsigned transaction to execute a Move call on the network, by calling the specified\n * function in the module of a given package.\n */\nexport interface UnsafeMoveCallParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Move package ID, e.g. `0x2` */\n\tpackageObjectId: string;\n\t/** the Move module name, e.g. `pay` */\n\tmodule: string;\n\t/** the move function name, e.g. `split` */\n\tfunction: string;\n\t/** the type arguments of the Move function */\n\ttypeArguments: string[];\n\t/**\n\t * the arguments to be passed into the Move function, in [SuiJson](https://docs.sui.io/build/sui-json)\n\t * format\n\t */\n\targuments: unknown[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/**\n\t * Whether this is a Normal transaction or a Dev Inspect Transaction. Default to be\n\t * `SuiTransactionBlockBuilderMode::Commit` when it's None.\n\t */\n\texecutionMode?: RpcTypes.SuiTransactionBlockBuilderMode | null | undefined;\n\tsignal?: AbortSignal;\n}\n/**\n * Send `Coin<T>` to a list of addresses, where `T` can be any coin type, following a list of amounts,\n * The object specified in the `gas` field will be used to pay the gas fee for the transaction. The gas\n * object can not appear in `input_coins`. If the gas object is not specified, the RPC server will\n * auto-select one.\n */\nexport interface UnsafePayParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coins to be used in this transaction */\n\tinputCoins: string[];\n\t/** the recipients' addresses, the length of this vector must be the same as amounts. */\n\trecipients: string[];\n\t/** the amounts to be transferred to recipients, following the same order */\n\tamounts: string[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/**\n * Send all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas\n * coin object. Specifically, what pay_all_sui does are: 1. accumulate all SUI from input coins and\n * deposit all SUI to the first input coin 2. transfer the updated first coin to the recipient and also\n * use this first coin as gas coin object. 3. the balance of the first input coin after tx is\n * sum(input_coins) - actual_gas_cost. 4. all other input coins other than the first are deleted.\n */\nexport interface UnsafePayAllSuiParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coins to be used in this transaction, including the coin for gas payment. */\n\tinputCoins: string[];\n\t/** the recipient address, */\n\trecipient: string;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/**\n * Send SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and\n * does not require a separate gas coin object. Specifically, what pay_sui does are: 1. debit each\n * input_coin to create new coin following the order of amounts and assign it to the corresponding\n * recipient. 2. accumulate all residual SUI from input coins left and deposit all SUI to the first\n * input coin, then use the first input coin as the gas coin object. 3. the balance of the first input\n * coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost 4. all other input coints other\n * than the first one are deleted.\n */\nexport interface UnsafePaySuiParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coins to be used in this transaction, including the coin for gas payment. */\n\tinputCoins: string[];\n\t/** the recipients' addresses, the length of this vector must be the same as amounts. */\n\trecipients: string[];\n\t/** the amounts to be transferred to recipients, following the same order */\n\tamounts: string[];\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/** Create an unsigned transaction to publish a Move package. */\nexport interface UnsafePublishParams {\n\t/** the transaction signer's Sui address */\n\tsender: string;\n\t/** the compiled bytes of a Move package */\n\tcompiledModules: string[];\n\t/** a list of transitive dependency addresses that this set of modules depends on. */\n\tdependencies: string[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/** Add stake to a validator's staking pool using multiple coins and amount. */\nexport interface UnsafeRequestAddStakeParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** Coin<SUI> object to stake */\n\tcoins: string[];\n\t/** stake amount */\n\tamount?: string | null | undefined;\n\t/** the validator's Sui address */\n\tvalidator: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/** Withdraw stake from a validator's staking pool. */\nexport interface UnsafeRequestWithdrawStakeParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** StakedSui object ID */\n\tstakedSui: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/** Create an unsigned transaction to split a coin object into multiple coins. */\nexport interface UnsafeSplitCoinParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the coin object to be spilt */\n\tcoinObjectId: string;\n\t/** the amounts to split out from the coin */\n\tsplitAmounts: string[];\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/** Create an unsigned transaction to split a coin object into multiple equal-size coins. */\nexport interface UnsafeSplitCoinEqualParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the coin object to be spilt */\n\tcoinObjectId: string;\n\t/** the number of coins to split into */\n\tsplitCount: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\tsignal?: AbortSignal;\n}\n/**\n * Create an unsigned transaction to transfer an object from one address to another. The object's type\n * must allow public transfers\n */\nexport interface UnsafeTransferObjectParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the ID of the object to be transferred */\n\tobjectId: string;\n\t/**\n\t * gas object to be used in this transaction, node will pick one from the signer's possession if not\n\t * provided\n\t */\n\tgas?: string | null | undefined;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/** the recipient's Sui address */\n\trecipient: string;\n\tsignal?: AbortSignal;\n}\n/**\n * Create an unsigned transaction to send SUI coin object to a Sui address. The SUI object is also used\n * as the gas object.\n */\nexport interface UnsafeTransferSuiParams {\n\t/** the transaction signer's Sui address */\n\tsigner: string;\n\t/** the Sui coin object to be used in this transaction */\n\tsuiObjectId: string;\n\t/** the gas budget, the transaction will fail if the gas cost exceed the budget */\n\tgasBudget: string;\n\t/** the recipient's Sui address */\n\trecipient: string;\n\t/** the amount to be split out and transferred */\n\tamount?: string | null | undefined;\n\tsignal?: AbortSignal;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ClientCacheOptions {
|
|
2
|
+
prefix?: string[];
|
|
3
|
+
cache?: Map<string, unknown>;
|
|
4
|
+
}
|
|
5
|
+
export declare class ClientCache {
|
|
6
|
+
#private;
|
|
7
|
+
constructor({ prefix, cache }?: ClientCacheOptions);
|
|
8
|
+
read<T>(key: [string, ...string[]], load: () => T | Promise<T>): T | Promise<T>;
|
|
9
|
+
clear(prefix?: string[]): void;
|
|
10
|
+
scope(prefix: string | string[]): ClientCache;
|
|
11
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __typeError = (msg) => {
|
|
7
|
+
throw TypeError(msg);
|
|
8
|
+
};
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
23
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
24
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
25
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
26
|
+
var cache_exports = {};
|
|
27
|
+
__export(cache_exports, {
|
|
28
|
+
ClientCache: () => ClientCache
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(cache_exports);
|
|
31
|
+
var _prefix, _cache;
|
|
32
|
+
const _ClientCache = class _ClientCache {
|
|
33
|
+
constructor({ prefix, cache } = {}) {
|
|
34
|
+
__privateAdd(this, _prefix);
|
|
35
|
+
__privateAdd(this, _cache);
|
|
36
|
+
__privateSet(this, _prefix, prefix ?? []);
|
|
37
|
+
__privateSet(this, _cache, cache ?? /* @__PURE__ */ new Map());
|
|
38
|
+
}
|
|
39
|
+
read(key, load) {
|
|
40
|
+
const cacheKey = [__privateGet(this, _prefix), ...key].join(":");
|
|
41
|
+
if (__privateGet(this, _cache).has(cacheKey)) {
|
|
42
|
+
return __privateGet(this, _cache).get(cacheKey);
|
|
43
|
+
}
|
|
44
|
+
const result = load();
|
|
45
|
+
__privateGet(this, _cache).set(cacheKey, result);
|
|
46
|
+
if (typeof result === "object" && result !== null && "then" in result) {
|
|
47
|
+
return Promise.resolve(result).then((v) => {
|
|
48
|
+
__privateGet(this, _cache).set(cacheKey, v);
|
|
49
|
+
return v;
|
|
50
|
+
}).catch((err) => {
|
|
51
|
+
__privateGet(this, _cache).delete(cacheKey);
|
|
52
|
+
throw err;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
clear(prefix) {
|
|
58
|
+
const prefixKey = [...__privateGet(this, _prefix), ...prefix ?? []].join(":");
|
|
59
|
+
if (!prefixKey) {
|
|
60
|
+
__privateGet(this, _cache).clear();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
for (const key of __privateGet(this, _cache).keys()) {
|
|
64
|
+
if (key.startsWith(prefixKey)) {
|
|
65
|
+
__privateGet(this, _cache).delete(key);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
scope(prefix) {
|
|
70
|
+
return new _ClientCache({
|
|
71
|
+
prefix: [...__privateGet(this, _prefix), ...Array.isArray(prefix) ? prefix : [prefix]],
|
|
72
|
+
cache: __privateGet(this, _cache)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
_prefix = new WeakMap();
|
|
77
|
+
_cache = new WeakMap();
|
|
78
|
+
let ClientCache = _ClientCache;
|
|
79
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/experimental/cache.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface ClientCacheOptions {\n\tprefix?: string[];\n\tcache?: Map<string, unknown>;\n}\n\nexport class ClientCache {\n\t#prefix: string[];\n\t#cache: Map<string, unknown>;\n\n\tconstructor({ prefix, cache }: ClientCacheOptions = {}) {\n\t\tthis.#prefix = prefix ?? [];\n\t\tthis.#cache = cache ?? new Map();\n\t}\n\n\tread<T>(key: [string, ...string[]], load: () => T | Promise<T>): T | Promise<T> {\n\t\tconst cacheKey = [this.#prefix, ...key].join(':');\n\n\t\tif (this.#cache.has(cacheKey)) {\n\t\t\treturn this.#cache.get(cacheKey) as T;\n\t\t}\n\n\t\tconst result = load();\n\n\t\tthis.#cache.set(cacheKey, result);\n\n\t\tif (typeof result === 'object' && result !== null && 'then' in result) {\n\t\t\treturn Promise.resolve(result)\n\t\t\t\t.then((v) => {\n\t\t\t\t\tthis.#cache.set(cacheKey, v);\n\t\t\t\t\treturn v as T;\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\tthis.#cache.delete(cacheKey);\n\t\t\t\t\tthrow err;\n\t\t\t\t});\n\t\t}\n\n\t\treturn result as T;\n\t}\n\n\tclear(prefix?: string[]) {\n\t\tconst prefixKey = [...this.#prefix, ...(prefix ?? [])].join(':');\n\t\tif (!prefixKey) {\n\t\t\tthis.#cache.clear();\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const key of this.#cache.keys()) {\n\t\t\tif (key.startsWith(prefixKey)) {\n\t\t\t\tthis.#cache.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tscope(prefix: string | string[]) {\n\t\treturn new ClientCache({\n\t\t\tprefix: [...this.#prefix, ...(Array.isArray(prefix) ? prefix : [prefix])],\n\t\t\tcache: this.#cache,\n\t\t});\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,MAAM,eAAN,MAAM,aAAY;AAAA,EAIxB,YAAY,EAAE,QAAQ,MAAM,IAAwB,CAAC,GAAG;AAHxD;AACA;AAGC,uBAAK,SAAU,UAAU,CAAC;AAC1B,uBAAK,QAAS,SAAS,oBAAI,IAAI;AAAA,EAChC;AAAA,EAEA,KAAQ,KAA4B,MAA4C;AAC/E,UAAM,WAAW,CAAC,mBAAK,UAAS,GAAG,GAAG,EAAE,KAAK,GAAG;AAEhD,QAAI,mBAAK,QAAO,IAAI,QAAQ,GAAG;AAC9B,aAAO,mBAAK,QAAO,IAAI,QAAQ;AAAA,IAChC;AAEA,UAAM,SAAS,KAAK;AAEpB,uBAAK,QAAO,IAAI,UAAU,MAAM;AAEhC,QAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,UAAU,QAAQ;AACtE,aAAO,QAAQ,QAAQ,MAAM,EAC3B,KAAK,CAAC,MAAM;AACZ,2BAAK,QAAO,IAAI,UAAU,CAAC;AAC3B,eAAO;AAAA,MACR,CAAC,EACA,MAAM,CAAC,QAAQ;AACf,2BAAK,QAAO,OAAO,QAAQ;AAC3B,cAAM;AAAA,MACP,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,MAAM,QAAmB;AACxB,UAAM,YAAY,CAAC,GAAG,mBAAK,UAAS,GAAI,UAAU,CAAC,CAAE,EAAE,KAAK,GAAG;AAC/D,QAAI,CAAC,WAAW;AACf,yBAAK,QAAO,MAAM;AAClB;AAAA,IACD;AAEA,eAAW,OAAO,mBAAK,QAAO,KAAK,GAAG;AACrC,UAAI,IAAI,WAAW,SAAS,GAAG;AAC9B,2BAAK,QAAO,OAAO,GAAG;AAAA,MACvB;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,QAA2B;AAChC,WAAO,IAAI,aAAY;AAAA,MACtB,QAAQ,CAAC,GAAG,mBAAK,UAAS,GAAI,MAAM,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM,CAAE;AAAA,MACxE,OAAO,mBAAK;AAAA,IACb,CAAC;AAAA,EACF;AACD;AAtDC;AACA;AAFM,IAAM,cAAN;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { ClientCache } from './cache.js';
|
|
1
2
|
import type { Experimental_CoreClient } from './core.js';
|
|
2
3
|
import type { ClientWithExtensions, Experimental_SuiClientTypes, Simplify, SuiClientRegistration, UnionToIntersection } from './types.js';
|
|
3
|
-
export declare abstract class
|
|
4
|
+
export declare abstract class Experimental_BaseClient {
|
|
4
5
|
network: Experimental_SuiClientTypes.Network;
|
|
6
|
+
cache: ClientCache;
|
|
5
7
|
constructor({ network }: Experimental_SuiClientTypes.SuiClientOptions);
|
|
6
8
|
abstract core: Experimental_CoreClient;
|
|
7
|
-
$extend<const Registrations extends SuiClientRegistration<this>[]>(...registrations: Registrations): ClientWithExtensions<Simplify<Omit<{ [K in keyof this]: this[K]; }, keyof
|
|
9
|
+
$extend<const Registrations extends SuiClientRegistration<this>[]>(...registrations: Registrations): ClientWithExtensions<Simplify<Omit<{ [K in keyof this]: this[K]; }, keyof Experimental_BaseClient> & UnionToIntersection<{ [K in keyof Registrations]: Registrations[K] extends SuiClientRegistration<this, infer Name extends string, infer Extension> ? { [K2 in Name]: Extension; } : never; }[number]>>>;
|
|
8
10
|
}
|
|
@@ -18,11 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var client_exports = {};
|
|
20
20
|
__export(client_exports, {
|
|
21
|
-
|
|
21
|
+
Experimental_BaseClient: () => Experimental_BaseClient
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(client_exports);
|
|
24
|
-
|
|
24
|
+
var import_cache = require("./cache.js");
|
|
25
|
+
class Experimental_BaseClient {
|
|
25
26
|
constructor({ network }) {
|
|
27
|
+
this.cache = new import_cache.ClientCache();
|
|
26
28
|
this.network = network;
|
|
27
29
|
}
|
|
28
30
|
$extend(...registrations) {
|