@suigar/mcp 0.1.0 → 0.1.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 +19 -0
- package/dist/bin.cjs +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/index.cjs +43 -50
- package/dist/index.d.cts +818 -8
- package/dist/index.d.mts +818 -8
- package/dist/index.mjs +1 -8
- package/{node_modules/@suigar/sui-rpc-pool/dist/index.cjs → dist/server-BD-123-u.mjs} +2084 -671
- package/{node_modules/@suigar/sui-rpc-pool/dist/index.mjs → dist/server-Cmo8UaHE.cjs} +2341 -645
- package/dist/server.cjs +3 -432
- package/dist/server.mjs +1 -430
- package/package.json +75 -61
- package/dist/client.cjs +0 -46
- package/dist/client.d.cts +0 -17
- package/dist/client.d.mts +0 -17
- package/dist/client.mjs +0 -43
- package/dist/coin.cjs +0 -86
- package/dist/coin.d.cts +0 -35
- package/dist/coin.d.mts +0 -35
- package/dist/coin.mjs +0 -86
- package/dist/config.cjs +0 -183
- package/dist/config.d.cts +0 -15
- package/dist/config.d.mts +0 -15
- package/dist/config.mjs +0 -174
- package/dist/mcp-support.cjs +0 -62
- package/dist/mcp-support.d.cts +0 -16
- package/dist/mcp-support.d.mts +0 -16
- package/dist/mcp-support.mjs +0 -60
- package/dist/metadata.cjs +0 -51
- package/dist/metadata.d.cts +0 -52
- package/dist/metadata.d.mts +0 -52
- package/dist/metadata.mjs +0 -47
- package/dist/tools.cjs +0 -617
- package/dist/tools.d.cts +0 -158
- package/dist/tools.d.mts +0 -158
- package/dist/tools.mjs +0 -608
- package/dist/transactions.cjs +0 -294
- package/dist/transactions.d.cts +0 -40
- package/dist/transactions.d.mts +0 -40
- package/dist/transactions.mjs +0 -286
- package/dist/types.d.cts +0 -111
- package/dist/types.d.mts +0 -111
- package/node_modules/@suigar/currency-registry/dist/index.cjs +0 -121
- package/node_modules/@suigar/currency-registry/dist/index.d.cts +0 -50
- package/node_modules/@suigar/currency-registry/dist/index.d.mts +0 -50
- package/node_modules/@suigar/currency-registry/dist/index.mjs +0 -110
- package/node_modules/@suigar/currency-registry/package.json +0 -31
- package/node_modules/@suigar/game-registry/dist/index.cjs +0 -310
- package/node_modules/@suigar/game-registry/dist/index.d.cts +0 -65
- package/node_modules/@suigar/game-registry/dist/index.d.mts +0 -65
- package/node_modules/@suigar/game-registry/dist/index.mjs +0 -292
- package/node_modules/@suigar/game-registry/package.json +0 -31
- package/node_modules/@suigar/sui-rpc-pool/dist/index.d.cts +0 -465
- package/node_modules/@suigar/sui-rpc-pool/dist/index.d.mts +0 -465
- package/node_modules/@suigar/sui-rpc-pool/package.json +0 -31
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
import { SuiGraphQLClient } from "@mysten/sui/graphql";
|
|
2
|
-
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
3
|
-
|
|
4
|
-
//#region src/index.d.ts
|
|
5
|
-
type NetworkName = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});
|
|
6
|
-
type SuiNetwork = NetworkName;
|
|
7
|
-
type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
8
|
-
[key: string]: JsonValue;
|
|
9
|
-
};
|
|
10
|
-
type NumericInput = string | number | undefined | null;
|
|
11
|
-
type BooleanInput = string | boolean | number | undefined | null;
|
|
12
|
-
type ResilientGrpcPoolOptions = {
|
|
13
|
-
network?: string;
|
|
14
|
-
providerUrl?: string;
|
|
15
|
-
extraPublicEndpoints?: string[];
|
|
16
|
-
defaultPublicEndpoints?: string[];
|
|
17
|
-
requestTimeoutMs?: number;
|
|
18
|
-
maxAttempts?: number;
|
|
19
|
-
cooldownMs?: number;
|
|
20
|
-
maxCooldownMs?: number;
|
|
21
|
-
failureThreshold?: number;
|
|
22
|
-
retryBackoffMs?: number;
|
|
23
|
-
maxRetryRounds?: number;
|
|
24
|
-
debug?: boolean;
|
|
25
|
-
};
|
|
26
|
-
type ResilientGrpcCallOptions<T = unknown> = {
|
|
27
|
-
isDeterministicError?: (error: unknown) => boolean;
|
|
28
|
-
resolveDeterministicError?: (error: unknown) => T | undefined;
|
|
29
|
-
};
|
|
30
|
-
type SuiRequestTraceAttempt = {
|
|
31
|
-
endpointUrl: string;
|
|
32
|
-
startedAt: number;
|
|
33
|
-
endedAt: number;
|
|
34
|
-
durationMs: number;
|
|
35
|
-
success: boolean;
|
|
36
|
-
errorMessage?: string | null;
|
|
37
|
-
};
|
|
38
|
-
type SuiRequestTrace = {
|
|
39
|
-
id: string;
|
|
40
|
-
method: string;
|
|
41
|
-
transport: 'grpc' | 'graphql';
|
|
42
|
-
network: SuiNetwork;
|
|
43
|
-
startedAt: number;
|
|
44
|
-
endedAt: number;
|
|
45
|
-
durationMs: number;
|
|
46
|
-
success: boolean;
|
|
47
|
-
endpointUrl: string | null;
|
|
48
|
-
attempts: SuiRequestTraceAttempt[];
|
|
49
|
-
params?: JsonValue;
|
|
50
|
-
result?: JsonValue;
|
|
51
|
-
metadata?: Record<string, JsonValue>;
|
|
52
|
-
errorMessage?: string | null;
|
|
53
|
-
};
|
|
54
|
-
type SuiRequestTraceSink = (trace: SuiRequestTrace) => void;
|
|
55
|
-
type ResilientGrpcTuningInput = {
|
|
56
|
-
requestTimeoutMs?: NumericInput;
|
|
57
|
-
maxAttempts?: NumericInput;
|
|
58
|
-
cooldownMs?: NumericInput;
|
|
59
|
-
maxCooldownMs?: NumericInput;
|
|
60
|
-
failureThreshold?: NumericInput;
|
|
61
|
-
retryBackoffMs?: NumericInput;
|
|
62
|
-
maxRetryRounds?: NumericInput;
|
|
63
|
-
debug?: BooleanInput;
|
|
64
|
-
};
|
|
65
|
-
type ResilientGrpcTuning = Required<Pick<ResilientGrpcPoolOptions, 'requestTimeoutMs' | 'maxAttempts' | 'cooldownMs' | 'maxCooldownMs' | 'failureThreshold' | 'retryBackoffMs' | 'maxRetryRounds' | 'debug'>>;
|
|
66
|
-
type GrpcEndpointsByNetwork = {
|
|
67
|
-
mainnet?: string | string[] | undefined | null;
|
|
68
|
-
testnet?: string | string[] | undefined | null;
|
|
69
|
-
devnet?: string | string[] | undefined | null;
|
|
70
|
-
localnet?: string | string[] | undefined | null;
|
|
71
|
-
};
|
|
72
|
-
declare const setSuiRequestTraceSink: (sink: SuiRequestTraceSink | null) => void;
|
|
73
|
-
declare const addSuiRequestTraceSink: (sink: SuiRequestTraceSink) => () => void;
|
|
74
|
-
type SuiObjectDataOptions = {
|
|
75
|
-
showType?: boolean;
|
|
76
|
-
showOwner?: boolean;
|
|
77
|
-
showPreviousTransaction?: boolean;
|
|
78
|
-
showStorageRebate?: boolean;
|
|
79
|
-
showContent?: boolean;
|
|
80
|
-
showDisplay?: boolean;
|
|
81
|
-
showBcs?: boolean;
|
|
82
|
-
};
|
|
83
|
-
type SuiParsedData = {
|
|
84
|
-
dataType?: string;
|
|
85
|
-
type?: string;
|
|
86
|
-
fields?: Record<string, unknown>;
|
|
87
|
-
hasPublicTransfer?: boolean;
|
|
88
|
-
} & Record<string, unknown>;
|
|
89
|
-
type SuiMoveObject = {
|
|
90
|
-
dataType: 'moveObject';
|
|
91
|
-
type?: string;
|
|
92
|
-
fields?: Record<string, unknown>;
|
|
93
|
-
hasPublicTransfer?: boolean;
|
|
94
|
-
} & Record<string, unknown>;
|
|
95
|
-
type ObjectOwner = {
|
|
96
|
-
AddressOwner: string;
|
|
97
|
-
} | {
|
|
98
|
-
ObjectOwner: string;
|
|
99
|
-
} | {
|
|
100
|
-
Shared: {
|
|
101
|
-
initial_shared_version?: string;
|
|
102
|
-
} | Record<string, unknown>;
|
|
103
|
-
} | {
|
|
104
|
-
Immutable: true;
|
|
105
|
-
} | {
|
|
106
|
-
ConsensusAddressOwner: {
|
|
107
|
-
owner?: string;
|
|
108
|
-
startVersion?: string;
|
|
109
|
-
};
|
|
110
|
-
} | Record<string, unknown>;
|
|
111
|
-
type SuiObjectData = {
|
|
112
|
-
objectId?: string;
|
|
113
|
-
version?: string;
|
|
114
|
-
digest?: string;
|
|
115
|
-
type?: string;
|
|
116
|
-
owner?: ObjectOwner;
|
|
117
|
-
previousTransaction?: string;
|
|
118
|
-
storageRebate?: string;
|
|
119
|
-
content?: SuiParsedData | null;
|
|
120
|
-
bcs?: {
|
|
121
|
-
bcsBytes: string;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
type SuiObjectResponse = {
|
|
125
|
-
data: SuiObjectData | null;
|
|
126
|
-
error?: Record<string, unknown>;
|
|
127
|
-
};
|
|
128
|
-
type GetObjectParams = {
|
|
129
|
-
id: string;
|
|
130
|
-
options?: SuiObjectDataOptions | null;
|
|
131
|
-
};
|
|
132
|
-
type MultiGetObjectsParams = {
|
|
133
|
-
ids: string[];
|
|
134
|
-
options?: SuiObjectDataOptions | null;
|
|
135
|
-
};
|
|
136
|
-
type GetOwnedObjectsParams = {
|
|
137
|
-
owner: string;
|
|
138
|
-
filter?: {
|
|
139
|
-
StructType: string;
|
|
140
|
-
} | {
|
|
141
|
-
MoveModule: {
|
|
142
|
-
package: string;
|
|
143
|
-
module: string;
|
|
144
|
-
};
|
|
145
|
-
} | {
|
|
146
|
-
MatchAll: unknown[];
|
|
147
|
-
} | {
|
|
148
|
-
MatchAny: unknown[];
|
|
149
|
-
} | {
|
|
150
|
-
MatchNone: unknown[];
|
|
151
|
-
} | Record<string, unknown> | null;
|
|
152
|
-
options?: SuiObjectDataOptions | null;
|
|
153
|
-
cursor?: string | null;
|
|
154
|
-
limit?: number | null;
|
|
155
|
-
};
|
|
156
|
-
type PaginatedObjectsResponse = {
|
|
157
|
-
data: SuiObjectResponse[];
|
|
158
|
-
hasNextPage: boolean;
|
|
159
|
-
nextCursor: string | null;
|
|
160
|
-
};
|
|
161
|
-
type GetCoinsParams = {
|
|
162
|
-
owner: string;
|
|
163
|
-
coinType?: string | null;
|
|
164
|
-
cursor?: string | null;
|
|
165
|
-
limit?: number | null;
|
|
166
|
-
};
|
|
167
|
-
type PaginatedCoins = {
|
|
168
|
-
data: Array<{
|
|
169
|
-
coinObjectId: string;
|
|
170
|
-
version: string;
|
|
171
|
-
digest: string;
|
|
172
|
-
coinType: string;
|
|
173
|
-
balance: string;
|
|
174
|
-
previousTransaction: string;
|
|
175
|
-
}>;
|
|
176
|
-
hasNextPage: boolean;
|
|
177
|
-
nextCursor: string | null;
|
|
178
|
-
};
|
|
179
|
-
type GetBalanceParams = {
|
|
180
|
-
owner: string;
|
|
181
|
-
coinType?: string | null;
|
|
182
|
-
};
|
|
183
|
-
type CoinBalance = {
|
|
184
|
-
coinType: string;
|
|
185
|
-
totalBalance: string;
|
|
186
|
-
coinObjectCount: number;
|
|
187
|
-
lockedBalance: Record<string, string>;
|
|
188
|
-
};
|
|
189
|
-
type GetAllBalancesParams = {
|
|
190
|
-
owner: string;
|
|
191
|
-
};
|
|
192
|
-
type DynamicFieldInfo = {
|
|
193
|
-
name: {
|
|
194
|
-
type?: string;
|
|
195
|
-
value?: unknown;
|
|
196
|
-
bcsName?: string;
|
|
197
|
-
} & Record<string, unknown>;
|
|
198
|
-
bcsEncoding: 'base64';
|
|
199
|
-
bcsName: string;
|
|
200
|
-
type: 'DynamicField' | 'DynamicObject';
|
|
201
|
-
objectType: string;
|
|
202
|
-
objectId: string;
|
|
203
|
-
version: string;
|
|
204
|
-
digest: string;
|
|
205
|
-
};
|
|
206
|
-
type DynamicFieldPage = {
|
|
207
|
-
data: DynamicFieldInfo[];
|
|
208
|
-
hasNextPage: boolean;
|
|
209
|
-
nextCursor: string | null;
|
|
210
|
-
};
|
|
211
|
-
type GetDynamicFieldsParams = {
|
|
212
|
-
parentId: string;
|
|
213
|
-
cursor?: string | null;
|
|
214
|
-
limit?: number | null;
|
|
215
|
-
};
|
|
216
|
-
type GetDynamicFieldObjectParams = {
|
|
217
|
-
parentId: string;
|
|
218
|
-
name: {
|
|
219
|
-
type?: string;
|
|
220
|
-
value?: unknown;
|
|
221
|
-
bcsName?: string;
|
|
222
|
-
} & Record<string, unknown>;
|
|
223
|
-
};
|
|
224
|
-
type PaginatedStrings = {
|
|
225
|
-
data: string[];
|
|
226
|
-
hasNextPage: boolean;
|
|
227
|
-
nextCursor: string | null;
|
|
228
|
-
};
|
|
229
|
-
type ResolveNameServiceNamesParams = {
|
|
230
|
-
address: string;
|
|
231
|
-
limit?: number | null;
|
|
232
|
-
};
|
|
233
|
-
type ResolveNameServiceAddressParams = {
|
|
234
|
-
name: string;
|
|
235
|
-
};
|
|
236
|
-
type EventId = {
|
|
237
|
-
txDigest: string;
|
|
238
|
-
eventSeq: string;
|
|
239
|
-
cursor?: string;
|
|
240
|
-
};
|
|
241
|
-
type SuiEvent = {
|
|
242
|
-
id: EventId;
|
|
243
|
-
type: string;
|
|
244
|
-
packageId?: string;
|
|
245
|
-
transactionModule?: string;
|
|
246
|
-
sender?: string;
|
|
247
|
-
parsedJson?: Record<string, unknown> | null;
|
|
248
|
-
bcs?: string;
|
|
249
|
-
timestampMs?: string | null;
|
|
250
|
-
};
|
|
251
|
-
type SuiEventFilter = {
|
|
252
|
-
MoveEventType: string;
|
|
253
|
-
} | {
|
|
254
|
-
MoveEventModule: {
|
|
255
|
-
package: string;
|
|
256
|
-
module: string;
|
|
257
|
-
};
|
|
258
|
-
} | {
|
|
259
|
-
Sender: string;
|
|
260
|
-
};
|
|
261
|
-
type QueryEventsParams = {
|
|
262
|
-
query: SuiEventFilter;
|
|
263
|
-
cursor?: EventId | null;
|
|
264
|
-
limit?: number | null;
|
|
265
|
-
order?: 'ascending' | 'descending';
|
|
266
|
-
};
|
|
267
|
-
type PaginatedEvents = {
|
|
268
|
-
data: SuiEvent[];
|
|
269
|
-
hasNextPage: boolean;
|
|
270
|
-
nextCursor: EventId | null;
|
|
271
|
-
};
|
|
272
|
-
type SuiObjectChangeCreated = {
|
|
273
|
-
type: 'created';
|
|
274
|
-
sender?: string;
|
|
275
|
-
owner?: ObjectOwner;
|
|
276
|
-
objectType?: string;
|
|
277
|
-
objectId: string;
|
|
278
|
-
version?: string;
|
|
279
|
-
digest?: string;
|
|
280
|
-
};
|
|
281
|
-
type SuiObjectChange = SuiObjectChangeCreated | {
|
|
282
|
-
type: 'mutated' | 'deleted' | 'transferred' | 'published' | 'wrapped';
|
|
283
|
-
sender?: string;
|
|
284
|
-
owner?: ObjectOwner;
|
|
285
|
-
objectType?: string;
|
|
286
|
-
objectId: string;
|
|
287
|
-
version?: string;
|
|
288
|
-
digest?: string;
|
|
289
|
-
};
|
|
290
|
-
type SuiTransactionBlockResponse = {
|
|
291
|
-
digest: string;
|
|
292
|
-
transaction?: {
|
|
293
|
-
data?: Record<string, unknown>;
|
|
294
|
-
};
|
|
295
|
-
effects?: {
|
|
296
|
-
status: {
|
|
297
|
-
status: 'success' | 'failure';
|
|
298
|
-
error?: string;
|
|
299
|
-
};
|
|
300
|
-
transactionDigest?: string;
|
|
301
|
-
gasUsed?: Record<string, unknown>;
|
|
302
|
-
created?: Array<{
|
|
303
|
-
owner?: ObjectOwner;
|
|
304
|
-
reference?: {
|
|
305
|
-
objectId: string;
|
|
306
|
-
version?: string;
|
|
307
|
-
digest?: string;
|
|
308
|
-
};
|
|
309
|
-
}>;
|
|
310
|
-
mutated?: Array<{
|
|
311
|
-
owner?: ObjectOwner;
|
|
312
|
-
reference?: {
|
|
313
|
-
objectId: string;
|
|
314
|
-
version?: string;
|
|
315
|
-
digest?: string;
|
|
316
|
-
};
|
|
317
|
-
}>;
|
|
318
|
-
};
|
|
319
|
-
events?: SuiEvent[];
|
|
320
|
-
balanceChanges?: Array<{
|
|
321
|
-
owner: ObjectOwner | null;
|
|
322
|
-
coinType: string;
|
|
323
|
-
amount: string;
|
|
324
|
-
}>;
|
|
325
|
-
objectChanges?: SuiObjectChange[];
|
|
326
|
-
timestampMs?: string | null;
|
|
327
|
-
};
|
|
328
|
-
type QueryTransactionBlocksParams = {
|
|
329
|
-
filter?: {
|
|
330
|
-
FromAddress?: string;
|
|
331
|
-
ToAddress?: string;
|
|
332
|
-
} | null;
|
|
333
|
-
options?: {
|
|
334
|
-
showInput?: boolean;
|
|
335
|
-
showEffects?: boolean;
|
|
336
|
-
showEvents?: boolean;
|
|
337
|
-
showBalanceChanges?: boolean;
|
|
338
|
-
showObjectChanges?: boolean;
|
|
339
|
-
} | null;
|
|
340
|
-
cursor?: string | null;
|
|
341
|
-
limit?: number | null;
|
|
342
|
-
order?: 'ascending' | 'descending';
|
|
343
|
-
};
|
|
344
|
-
type PaginatedTransactionResponse = {
|
|
345
|
-
data: SuiTransactionBlockResponse[];
|
|
346
|
-
hasNextPage: boolean;
|
|
347
|
-
nextCursor: string | null;
|
|
348
|
-
};
|
|
349
|
-
type WaitForTransactionParams = {
|
|
350
|
-
digest?: string;
|
|
351
|
-
result?: unknown;
|
|
352
|
-
options?: {
|
|
353
|
-
showEffects?: boolean;
|
|
354
|
-
showEvents?: boolean;
|
|
355
|
-
showBalanceChanges?: boolean;
|
|
356
|
-
showObjectChanges?: boolean;
|
|
357
|
-
showInput?: boolean;
|
|
358
|
-
} | null;
|
|
359
|
-
timeout?: number;
|
|
360
|
-
};
|
|
361
|
-
type SuiCompatClient = {
|
|
362
|
-
getObject(params: GetObjectParams): Promise<SuiObjectResponse>;
|
|
363
|
-
multiGetObjects(params: MultiGetObjectsParams): Promise<SuiObjectResponse[]>;
|
|
364
|
-
getOwnedObjects(params: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse>;
|
|
365
|
-
getCoins(params: GetCoinsParams): Promise<PaginatedCoins>;
|
|
366
|
-
getBalance(params: GetBalanceParams): Promise<CoinBalance>;
|
|
367
|
-
getAllBalances(params: GetAllBalancesParams): Promise<CoinBalance[]>;
|
|
368
|
-
getDynamicFields(params: GetDynamicFieldsParams): Promise<DynamicFieldPage>;
|
|
369
|
-
getDynamicFieldObject(params: GetDynamicFieldObjectParams): Promise<SuiObjectResponse>;
|
|
370
|
-
resolveNameServiceNames(params: ResolveNameServiceNamesParams): Promise<PaginatedStrings>;
|
|
371
|
-
resolveNameServiceAddress(params: ResolveNameServiceAddressParams): Promise<string | null>;
|
|
372
|
-
getReferenceGasPrice(): Promise<bigint>;
|
|
373
|
-
queryEvents(params: QueryEventsParams): Promise<PaginatedEvents>;
|
|
374
|
-
queryTransactionBlocks(params: QueryTransactionBlocksParams): Promise<PaginatedTransactionResponse>;
|
|
375
|
-
waitForTransaction(params: WaitForTransactionParams): Promise<SuiTransactionBlockResponse>;
|
|
376
|
-
};
|
|
377
|
-
type BuildSuiCompatClientOptions = {
|
|
378
|
-
network: SuiNetwork;
|
|
379
|
-
defaultCoinType?: string;
|
|
380
|
-
graphqlUrl?: string;
|
|
381
|
-
graphqlClient?: SuiGraphQLClient;
|
|
382
|
-
grpcPool?: ResilientGrpcPool;
|
|
383
|
-
resolveGrpcClient?: (endpointUrl: string) => SuiGrpcClient;
|
|
384
|
-
providerGrpcUrl?: string;
|
|
385
|
-
};
|
|
386
|
-
type GraphQLPageInfo = {
|
|
387
|
-
hasNextPage: boolean;
|
|
388
|
-
hasPreviousPage: boolean;
|
|
389
|
-
startCursor: string | null;
|
|
390
|
-
endCursor: string | null;
|
|
391
|
-
};
|
|
392
|
-
type GraphQLEventNode = {
|
|
393
|
-
sequenceNumber: number;
|
|
394
|
-
timestamp?: string | null;
|
|
395
|
-
sender?: {
|
|
396
|
-
address?: string | null;
|
|
397
|
-
} | null;
|
|
398
|
-
transaction?: {
|
|
399
|
-
digest?: string | null;
|
|
400
|
-
} | null;
|
|
401
|
-
transactionModule?: {
|
|
402
|
-
name?: string | null;
|
|
403
|
-
package?: {
|
|
404
|
-
address?: string | null;
|
|
405
|
-
} | null;
|
|
406
|
-
} | null;
|
|
407
|
-
contents?: {
|
|
408
|
-
type?: {
|
|
409
|
-
repr?: string | null;
|
|
410
|
-
} | null;
|
|
411
|
-
json?: Record<string, unknown> | null;
|
|
412
|
-
} | null;
|
|
413
|
-
};
|
|
414
|
-
declare const normalizeNetwork: (value: string | undefined) => NetworkName;
|
|
415
|
-
declare const normalizeGrpcUrl: (value: string) => string | null;
|
|
416
|
-
declare const parseGrpcList: (value: string | undefined) => string[];
|
|
417
|
-
declare const uniqueGrpcUrls: (values: string[]) => string[];
|
|
418
|
-
declare const resolveResilientGrpcTuning: (input?: ResilientGrpcTuningInput) => ResilientGrpcTuning;
|
|
419
|
-
declare const resolveExtraGrpcEndpoints: (network: string | undefined, endpointsByNetwork?: GrpcEndpointsByNetwork) => string[];
|
|
420
|
-
declare class ResilientGrpcPool {
|
|
421
|
-
private readonly network;
|
|
422
|
-
private readonly providerUrl;
|
|
423
|
-
private readonly endpoints;
|
|
424
|
-
private readonly maxAttempts;
|
|
425
|
-
private readonly failureThreshold;
|
|
426
|
-
private readonly cooldownMs;
|
|
427
|
-
private readonly maxCooldownMs;
|
|
428
|
-
private readonly requestTimeoutMs;
|
|
429
|
-
private readonly retryBackoffMs;
|
|
430
|
-
private readonly maxRetryRounds;
|
|
431
|
-
private readonly debug;
|
|
432
|
-
constructor(options: ResilientGrpcPoolOptions);
|
|
433
|
-
getProviderUrl(): string;
|
|
434
|
-
call<T>(method: string, invoke: (endpointUrl: string) => Promise<T>, options?: ResilientGrpcCallOptions<T>): Promise<T>;
|
|
435
|
-
private pickAttemptOrder;
|
|
436
|
-
private endpointScore;
|
|
437
|
-
private invoke;
|
|
438
|
-
private markSuccess;
|
|
439
|
-
private markFailure;
|
|
440
|
-
}
|
|
441
|
-
declare const getOrCreateResilientGrpcPool: (options: ResilientGrpcPoolOptions) => ResilientGrpcPool;
|
|
442
|
-
declare const getResilientGrpcPool: (network: string | undefined, providerUrl: string | undefined, options?: Omit<ResilientGrpcPoolOptions, "network" | "providerUrl">) => ResilientGrpcPool;
|
|
443
|
-
type ResilientSuiClientRuntimeOptions = ResilientGrpcPoolOptions;
|
|
444
|
-
type ResilientSuiCompatClientOptions = Omit<BuildSuiCompatClientOptions, 'network' | 'grpcPool' | 'providerGrpcUrl' | 'resolveGrpcClient'> & {
|
|
445
|
-
rawClient?: SuiGrpcClient;
|
|
446
|
-
};
|
|
447
|
-
declare class ResilientSuiClientRuntime {
|
|
448
|
-
readonly network: SuiNetwork;
|
|
449
|
-
readonly grpcPool: ResilientGrpcPool;
|
|
450
|
-
private readonly grpcClientByUrl;
|
|
451
|
-
constructor(options: ResilientSuiClientRuntimeOptions);
|
|
452
|
-
getProviderUrl(): string;
|
|
453
|
-
getGrpcClient(endpointUrl?: string): SuiGrpcClient;
|
|
454
|
-
createCompatClient(options?: ResilientSuiCompatClientOptions): SuiCompatClient;
|
|
455
|
-
}
|
|
456
|
-
declare const getOrCreateResilientSuiClientRuntime: (options: ResilientSuiClientRuntimeOptions) => ResilientSuiClientRuntime;
|
|
457
|
-
declare const getResilientSuiClientRuntime: (network: string | undefined, providerUrl: string | undefined, options?: Omit<ResilientSuiClientRuntimeOptions, "network" | "providerUrl">) => ResilientSuiClientRuntime;
|
|
458
|
-
declare const encodeEventCursor: (eventSeq: string, cursor: string) => string;
|
|
459
|
-
declare const decodeEventCursor: (cursor: EventId | null | undefined) => string | null;
|
|
460
|
-
declare const stripEncodedEventSeq: (value: string) => string;
|
|
461
|
-
declare const buildPaginatedEventCursor: (pageInfo: Pick<GraphQLPageInfo, "startCursor" | "endCursor"> | null | undefined, node: Pick<GraphQLEventNode, "sequenceNumber" | "transaction"> | null | undefined, order: "ascending" | "descending") => EventId | null;
|
|
462
|
-
declare const toSuiTransactionBlockResponse: (result: any) => SuiTransactionBlockResponse;
|
|
463
|
-
declare const buildSuiCompatClient: (grpcClient: SuiGrpcClient, options: BuildSuiCompatClientOptions) => SuiCompatClient;
|
|
464
|
-
//#endregion
|
|
465
|
-
export { BuildSuiCompatClientOptions, CoinBalance, DynamicFieldInfo, DynamicFieldPage, EventId, GetAllBalancesParams, GetBalanceParams, GetCoinsParams, GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetObjectParams, GetOwnedObjectsParams, GrpcEndpointsByNetwork, MultiGetObjectsParams, NetworkName, ObjectOwner, PaginatedCoins, PaginatedEvents, PaginatedObjectsResponse, PaginatedStrings, PaginatedTransactionResponse, QueryEventsParams, QueryTransactionBlocksParams, ResilientGrpcCallOptions, ResilientGrpcPool, ResilientGrpcPoolOptions, ResilientGrpcTuning, ResilientGrpcTuningInput, ResilientSuiClientRuntime, ResilientSuiClientRuntimeOptions, ResilientSuiCompatClientOptions, ResolveNameServiceAddressParams, ResolveNameServiceNamesParams, SuiCompatClient, SuiEvent, SuiEventFilter, SuiMoveObject, SuiNetwork, SuiObjectChange, SuiObjectChangeCreated, SuiObjectData, SuiObjectDataOptions, SuiObjectResponse, SuiParsedData, SuiRequestTrace, SuiRequestTraceAttempt, SuiRequestTraceSink, SuiTransactionBlockResponse, WaitForTransactionParams, addSuiRequestTraceSink, buildPaginatedEventCursor, buildSuiCompatClient, decodeEventCursor, encodeEventCursor, getOrCreateResilientGrpcPool, getOrCreateResilientSuiClientRuntime, getResilientGrpcPool, getResilientSuiClientRuntime, normalizeGrpcUrl, normalizeNetwork, parseGrpcList, resolveExtraGrpcEndpoints, resolveResilientGrpcTuning, setSuiRequestTraceSink, stripEncodedEventSeq, toSuiTransactionBlockResponse, uniqueGrpcUrls };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@suigar/sui-rpc-pool",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "Shared resilient Sui RPC pool for Suigar",
|
|
5
|
-
"private": true,
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"sideEffects": false,
|
|
9
|
-
"main": "./dist/index.cjs",
|
|
10
|
-
"module": "./dist/index.mjs",
|
|
11
|
-
"types": "./dist/index.d.mts",
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsdown",
|
|
14
|
-
"clean": "rm -rf dist",
|
|
15
|
-
"typecheck": "tsc --noEmit"
|
|
16
|
-
},
|
|
17
|
-
"exports": {
|
|
18
|
-
".": {
|
|
19
|
-
"types": "./dist/index.d.mts",
|
|
20
|
-
"require": "./dist/index.cjs",
|
|
21
|
-
"import": "./dist/index.mjs"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"tsdown": "catalog:tooling",
|
|
29
|
-
"typescript": "catalog:tooling"
|
|
30
|
-
}
|
|
31
|
-
}
|