@mysten/sui 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/client/client.d.ts +1 -1
- package/dist/cjs/client/client.js +19 -6
- package/dist/cjs/client/client.js.map +2 -2
- package/dist/cjs/transactions/Arguments.d.ts +26 -4
- package/dist/cjs/transactions/Arguments.js +4 -1
- package/dist/cjs/transactions/Arguments.js.map +2 -2
- package/dist/cjs/transactions/Transaction.d.ts +28 -4
- package/dist/cjs/transactions/Transaction.js +53 -25
- package/dist/cjs/transactions/Transaction.js.map +2 -2
- package/dist/cjs/transactions/executor/parallel.d.ts +2 -2
- package/dist/cjs/transactions/executor/parallel.js +5 -6
- package/dist/cjs/transactions/executor/parallel.js.map +2 -2
- package/dist/cjs/transactions/executor/serial.d.ts +5 -3
- package/dist/cjs/transactions/executor/serial.js +9 -3
- package/dist/cjs/transactions/executor/serial.js.map +2 -2
- package/dist/cjs/transactions/object.d.ts +8 -0
- package/dist/cjs/transactions/object.js +34 -0
- package/dist/cjs/transactions/object.js.map +7 -0
- package/dist/cjs/verify/verify.d.ts +6 -2
- package/dist/cjs/verify/verify.js +4 -4
- package/dist/cjs/verify/verify.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/cjs/zklogin/publickey.js.map +2 -2
- package/dist/esm/client/client.d.ts +1 -1
- package/dist/esm/client/client.js +19 -6
- package/dist/esm/client/client.js.map +2 -2
- package/dist/esm/transactions/Arguments.d.ts +26 -4
- package/dist/esm/transactions/Arguments.js +4 -1
- package/dist/esm/transactions/Arguments.js.map +2 -2
- package/dist/esm/transactions/Transaction.d.ts +28 -4
- package/dist/esm/transactions/Transaction.js +53 -25
- package/dist/esm/transactions/Transaction.js.map +2 -2
- package/dist/esm/transactions/executor/parallel.d.ts +2 -2
- package/dist/esm/transactions/executor/parallel.js +5 -6
- package/dist/esm/transactions/executor/parallel.js.map +2 -2
- package/dist/esm/transactions/executor/serial.d.ts +5 -3
- package/dist/esm/transactions/executor/serial.js +9 -3
- package/dist/esm/transactions/executor/serial.js.map +2 -2
- package/dist/esm/transactions/object.d.ts +8 -0
- package/dist/esm/transactions/object.js +14 -0
- package/dist/esm/transactions/object.js.map +7 -0
- package/dist/esm/verify/verify.d.ts +6 -2
- package/dist/esm/verify/verify.js +4 -4
- package/dist/esm/verify/verify.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/esm/zklogin/publickey.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/client/client.ts +22 -10
- package/src/transactions/Arguments.ts +4 -1
- package/src/transactions/Transaction.ts +71 -28
- package/src/transactions/executor/parallel.ts +10 -7
- package/src/transactions/executor/serial.ts +12 -2
- package/src/transactions/object.ts +17 -0
- package/src/verify/verify.ts +7 -3
- package/src/version.ts +2 -2
- package/src/zklogin/publickey.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 143cd9d: Add new tx.object methods for defining inputs for well known object ids:
|
|
8
|
+
|
|
9
|
+
- `tx.object.system()`: `0x5`
|
|
10
|
+
- `tx.object.clock()`: `0x6`
|
|
11
|
+
- `tx.object.random()`: `0x8`
|
|
12
|
+
- `tx.object.denyList()`: `0x403`
|
|
13
|
+
|
|
14
|
+
- 4019dd7: Add default budget to transactions executed through the SerialTransactionExecutor class
|
|
15
|
+
- 4019dd7: Add options argument to executeTransaction methods on transaction executor classes
|
|
16
|
+
- 00a974d: Add global registry for transaction plugins
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 4357ac6: Add options argument to verifyTransactionSignature
|
|
21
|
+
|
|
22
|
+
## 1.6.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- a3e32fe: `WaitForLocalExecution` now waits using client.waitForTransaction rather than sending
|
|
27
|
+
requestType to the RPC node. This change will preserve readAfterWrite consistency when local
|
|
28
|
+
execution is removed from fullnodes, at the cost of more network requests and higher latency.
|
|
29
|
+
|
|
3
30
|
## 1.5.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -103,7 +103,7 @@ export declare class SuiClient {
|
|
|
103
103
|
queryTransactionBlocks(input: QueryTransactionBlocksParams): Promise<PaginatedTransactionResponse>;
|
|
104
104
|
getTransactionBlock(input: GetTransactionBlockParams): Promise<SuiTransactionBlockResponse>;
|
|
105
105
|
multiGetTransactionBlocks(input: MultiGetTransactionBlocksParams): Promise<SuiTransactionBlockResponse[]>;
|
|
106
|
-
executeTransactionBlock(
|
|
106
|
+
executeTransactionBlock({ transactionBlock, signature, options, requestType, }: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse>;
|
|
107
107
|
signAndExecuteTransaction({ transaction, signer, ...input }: {
|
|
108
108
|
transaction: Uint8Array | Transaction;
|
|
109
109
|
signer: Signer;
|
|
@@ -264,16 +264,29 @@ class SuiClient {
|
|
|
264
264
|
params: [input.digests, input.options]
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
-
async executeTransactionBlock(
|
|
268
|
-
|
|
267
|
+
async executeTransactionBlock({
|
|
268
|
+
transactionBlock,
|
|
269
|
+
signature,
|
|
270
|
+
options,
|
|
271
|
+
requestType
|
|
272
|
+
}) {
|
|
273
|
+
const result = await this.transport.request({
|
|
269
274
|
method: "sui_executeTransactionBlock",
|
|
270
275
|
params: [
|
|
271
|
-
typeof
|
|
272
|
-
Array.isArray(
|
|
273
|
-
|
|
274
|
-
input.requestType
|
|
276
|
+
typeof transactionBlock === "string" ? transactionBlock : (0, import_bcs.toB64)(transactionBlock),
|
|
277
|
+
Array.isArray(signature) ? signature : [signature],
|
|
278
|
+
options
|
|
275
279
|
]
|
|
276
280
|
});
|
|
281
|
+
if (requestType === "WaitForLocalExecution") {
|
|
282
|
+
try {
|
|
283
|
+
await this.waitForTransaction({
|
|
284
|
+
digest: result.digest
|
|
285
|
+
});
|
|
286
|
+
} catch (_) {
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return result;
|
|
277
290
|
}
|
|
278
291
|
async signAndExecuteTransaction({
|
|
279
292
|
transaction,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/client/client.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { fromB58, toB64, toHEX } from '@mysten/bcs';\n\nimport type { Signer } from '../cryptography/index.js';\nimport type { Transaction } from '../transactions/index.js';\nimport { isTransaction } from '../transactions/index.js';\nimport {\n\tisValidSuiAddress,\n\tisValidSuiObjectId,\n\tisValidTransactionDigest,\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n} from '../utils/sui-types.js';\nimport { normalizeSuiNSName } from '../utils/suins.js';\nimport { SuiHTTPTransport } from './http-transport.js';\nimport type { SuiTransport } from './http-transport.js';\nimport type {\n\tAddressMetrics,\n\tAllEpochsAddressMetrics,\n\tCheckpoint,\n\tCheckpointPage,\n\tCoinBalance,\n\tCoinMetadata,\n\tCoinSupply,\n\tCommitteeInfo,\n\tDelegatedStake,\n\tDevInspectResults,\n\tDevInspectTransactionBlockParams,\n\tDryRunTransactionBlockParams,\n\tDryRunTransactionBlockResponse,\n\tDynamicFieldPage,\n\tEpochInfo,\n\tEpochMetricsPage,\n\tEpochPage,\n\tExecuteTransactionBlockParams,\n\tGetAllBalancesParams,\n\tGetAllCoinsParams,\n\tGetBalanceParams,\n\tGetCheckpointParams,\n\tGetCheckpointsParams,\n\tGetCoinMetadataParams,\n\tGetCoinsParams,\n\tGetCommitteeInfoParams,\n\tGetDynamicFieldObjectParams,\n\tGetDynamicFieldsParams,\n\tGetMoveFunctionArgTypesParams,\n\tGetNormalizedMoveFunctionParams,\n\tGetNormalizedMoveModuleParams,\n\tGetNormalizedMoveModulesByPackageParams,\n\tGetNormalizedMoveStructParams,\n\tGetObjectParams,\n\tGetOwnedObjectsParams,\n\tGetProtocolConfigParams,\n\tGetStakesByIdsParams,\n\tGetStakesParams,\n\tGetTotalSupplyParams,\n\tGetTransactionBlockParams,\n\tMoveCallMetrics,\n\tMultiGetObjectsParams,\n\tMultiGetTransactionBlocksParams,\n\tNetworkMetrics,\n\tObjectRead,\n\tOrder,\n\tPaginatedCoins,\n\tPaginatedEvents,\n\tPaginatedObjectsResponse,\n\tPaginatedTransactionResponse,\n\tProtocolConfig,\n\tQueryEventsParams,\n\tQueryTransactionBlocksParams,\n\tResolvedNameServiceNames,\n\tResolveNameServiceAddressParams,\n\tResolveNameServiceNamesParams,\n\tSubscribeEventParams,\n\tSubscribeTransactionParams,\n\tSuiEvent,\n\tSuiMoveFunctionArgType,\n\tSuiMoveNormalizedFunction,\n\tSuiMoveNormalizedModule,\n\tSuiMoveNormalizedModules,\n\tSuiMoveNormalizedStruct,\n\tSuiObjectResponse,\n\tSuiObjectResponseQuery,\n\tSuiSystemStateSummary,\n\tSuiTransactionBlockResponse,\n\tSuiTransactionBlockResponseQuery,\n\tTransactionEffects,\n\tTryGetPastObjectParams,\n\tUnsubscribe,\n\tValidatorsApy,\n} from './types/index.js';\n\nexport interface PaginationArguments<Cursor> {\n\t/** Optional paging cursor */\n\tcursor?: Cursor;\n\t/** Maximum item returned per page */\n\tlimit?: number | null;\n}\n\nexport interface OrderArguments {\n\torder?: Order | null;\n}\n\n/**\n * Configuration options for the SuiClient\n * You must provide either a `url` or a `transport`\n */\nexport type SuiClientOptions = NetworkOrTransport;\n\ntype NetworkOrTransport =\n\t| {\n\t\t\turl: string;\n\t\t\ttransport?: never;\n\t }\n\t| {\n\t\t\ttransport: SuiTransport;\n\t\t\turl?: never;\n\t };\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiClient') as never;\n\nexport function isSuiClient(client: unknown): client is SuiClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport class SuiClient {\n\tprotected transport: SuiTransport;\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Establish a connection to a Sui RPC endpoint\n\t *\n\t * @param options configuration options for the API Client\n\t */\n\tconstructor(options: SuiClientOptions) {\n\t\tthis.transport = options.transport ?? new SuiHTTPTransport({ url: options.url });\n\t}\n\n\tasync getRpcApiVersion(): Promise<string | undefined> {\n\t\tconst resp = await this.transport.request<{ info: { version: string } }>({\n\t\t\tmethod: 'rpc.discover',\n\t\t\tparams: [],\n\t\t});\n\n\t\treturn resp.info.version;\n\t}\n\n\t/**\n\t * Get all Coin<`coin_type`> objects owned by an address.\n\t */\n\tasync getCoins(input: GetCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoins',\n\t\t\tparams: [input.owner, input.coinType, input.cursor, input.limit],\n\t\t});\n\t}\n\n\t/**\n\t * Get all Coin objects owned by an address.\n\t */\n\tasync getAllCoins(input: GetAllCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllCoins',\n\t\t\tparams: [input.owner, input.cursor, input.limit],\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for one coin type, owned by the address owner.\n\t */\n\tasync getBalance(input: GetBalanceParams): Promise<CoinBalance> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getBalance',\n\t\t\tparams: [input.owner, input.coinType],\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for all coin types, owned by the address owner.\n\t */\n\tasync getAllBalances(input: GetAllBalancesParams): Promise<CoinBalance[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({ method: 'suix_getAllBalances', params: [input.owner] });\n\t}\n\n\t/**\n\t * Fetch CoinMetadata for a given coin type\n\t */\n\tasync getCoinMetadata(input: GetCoinMetadataParams): Promise<CoinMetadata | null> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoinMetadata',\n\t\t\tparams: [input.coinType],\n\t\t});\n\t}\n\n\t/**\n\t * Fetch total supply for a coin\n\t */\n\tasync getTotalSupply(input: GetTotalSupplyParams): Promise<CoinSupply> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getTotalSupply',\n\t\t\tparams: [input.coinType],\n\t\t});\n\t}\n\n\t/**\n\t * Invoke any RPC method\n\t * @param method the method to be invoked\n\t * @param args the arguments to be passed to the RPC request\n\t */\n\tasync call<T = unknown>(method: string, params: unknown[]): Promise<T> {\n\t\treturn await this.transport.request({ method, params });\n\t}\n\n\t/**\n\t * Get Move function argument types like read, write and full access\n\t */\n\tasync getMoveFunctionArgTypes(\n\t\tinput: GetMoveFunctionArgTypesParams,\n\t): Promise<SuiMoveFunctionArgType[]> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getMoveFunctionArgTypes',\n\t\t\tparams: [input.package, input.module, input.function],\n\t\t});\n\t}\n\n\t/**\n\t * Get a map from module name to\n\t * structured representations of Move modules\n\t */\n\tasync getNormalizedMoveModulesByPackage(\n\t\tinput: GetNormalizedMoveModulesByPackageParams,\n\t): Promise<SuiMoveNormalizedModules> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModulesByPackage',\n\t\t\tparams: [input.package],\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move module\n\t */\n\tasync getNormalizedMoveModule(\n\t\tinput: GetNormalizedMoveModuleParams,\n\t): Promise<SuiMoveNormalizedModule> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModule',\n\t\t\tparams: [input.package, input.module],\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move function\n\t */\n\tasync getNormalizedMoveFunction(\n\t\tinput: GetNormalizedMoveFunctionParams,\n\t): Promise<SuiMoveNormalizedFunction> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveFunction',\n\t\t\tparams: [input.package, input.module, input.function],\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move struct\n\t */\n\tasync getNormalizedMoveStruct(\n\t\tinput: GetNormalizedMoveStructParams,\n\t): Promise<SuiMoveNormalizedStruct> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveStruct',\n\t\t\tparams: [input.package, input.module, input.struct],\n\t\t});\n\t}\n\n\t/**\n\t * Get all objects owned by an address\n\t */\n\tasync getOwnedObjects(input: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getOwnedObjects',\n\t\t\tparams: [\n\t\t\t\tinput.owner,\n\t\t\t\t{\n\t\t\t\t\tfilter: input.filter,\n\t\t\t\t\toptions: input.options,\n\t\t\t\t} as SuiObjectResponseQuery,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Get details about an object\n\t */\n\tasync getObject(input: GetObjectParams): Promise<SuiObjectResponse> {\n\t\tif (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getObject',\n\t\t\tparams: [input.id, input.options],\n\t\t});\n\t}\n\n\tasync tryGetPastObject(input: TryGetPastObjectParams): Promise<ObjectRead> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_tryGetPastObject',\n\t\t\tparams: [input.id, input.version, input.options],\n\t\t});\n\t}\n\n\t/**\n\t * Batch get details about a list of objects. If any of the object ids are duplicates the call will fail\n\t */\n\tasync multiGetObjects(input: MultiGetObjectsParams): Promise<SuiObjectResponse[]> {\n\t\tinput.ids.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Object id ${id}`);\n\t\t\t}\n\t\t});\n\t\tconst hasDuplicates = input.ids.length !== new Set(input.ids).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate object ids in batch call ${input.ids}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetObjects',\n\t\t\tparams: [input.ids, input.options],\n\t\t});\n\t}\n\n\t/**\n\t * Get transaction blocks for a given query criteria\n\t */\n\tasync queryTransactionBlocks(\n\t\tinput: QueryTransactionBlocksParams,\n\t): Promise<PaginatedTransactionResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryTransactionBlocks',\n\t\t\tparams: [\n\t\t\t\t{\n\t\t\t\t\tfilter: input.filter,\n\t\t\t\t\toptions: input.options,\n\t\t\t\t} as SuiTransactionBlockResponseQuery,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t\t(input.order || 'descending') === 'descending',\n\t\t\t],\n\t\t});\n\t}\n\n\tasync getTransactionBlock(\n\t\tinput: GetTransactionBlockParams,\n\t): Promise<SuiTransactionBlockResponse> {\n\t\tif (!isValidTransactionDigest(input.digest)) {\n\t\t\tthrow new Error('Invalid Transaction digest');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getTransactionBlock',\n\t\t\tparams: [input.digest, input.options],\n\t\t});\n\t}\n\n\tasync multiGetTransactionBlocks(\n\t\tinput: MultiGetTransactionBlocksParams,\n\t): Promise<SuiTransactionBlockResponse[]> {\n\t\tinput.digests.forEach((d) => {\n\t\t\tif (!isValidTransactionDigest(d)) {\n\t\t\t\tthrow new Error(`Invalid Transaction digest ${d}`);\n\t\t\t}\n\t\t});\n\n\t\tconst hasDuplicates = input.digests.length !== new Set(input.digests).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate digests in batch call ${input.digests}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetTransactionBlocks',\n\t\t\tparams: [input.digests, input.options],\n\t\t});\n\t}\n\n\tasync executeTransactionBlock(\n\t\tinput: ExecuteTransactionBlockParams,\n\t): Promise<SuiTransactionBlockResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_executeTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof input.transactionBlock === 'string'\n\t\t\t\t\t? input.transactionBlock\n\t\t\t\t\t: toB64(input.transactionBlock),\n\t\t\t\tArray.isArray(input.signature) ? input.signature : [input.signature],\n\t\t\t\tinput.options,\n\t\t\t\tinput.requestType,\n\t\t\t],\n\t\t});\n\t}\n\n\tasync signAndExecuteTransaction({\n\t\ttransaction,\n\t\tsigner,\n\t\t...input\n\t}: {\n\t\ttransaction: Uint8Array | Transaction;\n\t\tsigner: Signer;\n\t} & Omit<\n\t\tExecuteTransactionBlockParams,\n\t\t'transactionBlock' | 'signature'\n\t>): Promise<SuiTransactionBlockResponse> {\n\t\tlet transactionBytes;\n\n\t\tif (transaction instanceof Uint8Array) {\n\t\t\ttransactionBytes = transaction;\n\t\t} else {\n\t\t\ttransaction.setSenderIfNotSet(signer.toSuiAddress());\n\t\t\ttransactionBytes = await transaction.build({ client: this });\n\t\t}\n\n\t\tconst { signature, bytes } = await signer.signTransaction(transactionBytes);\n\n\t\treturn this.executeTransactionBlock({\n\t\t\ttransactionBlock: bytes,\n\t\t\tsignature,\n\t\t\t...input,\n\t\t});\n\t}\n\n\t/**\n\t * Get total number of transactions\n\t */\n\n\tasync getTotalTransactionBlocks(): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'sui_getTotalTransactionBlocks',\n\t\t\tparams: [],\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Getting the reference gas price for the network\n\t */\n\tasync getReferenceGasPrice(): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'suix_getReferenceGasPrice',\n\t\t\tparams: [],\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Return the delegated stakes for an address\n\t */\n\tasync getStakes(input: GetStakesParams): Promise<DelegatedStake[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({ method: 'suix_getStakes', params: [input.owner] });\n\t}\n\n\t/**\n\t * Return the delegated stakes queried by id.\n\t */\n\tasync getStakesByIds(input: GetStakesByIdsParams): Promise<DelegatedStake[]> {\n\t\tinput.stakedSuiIds.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Stake id ${id}`);\n\t\t\t}\n\t\t});\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getStakesByIds',\n\t\t\tparams: [input.stakedSuiIds],\n\t\t});\n\t}\n\n\t/**\n\t * Return the latest system state content.\n\t */\n\tasync getLatestSuiSystemState(): Promise<SuiSystemStateSummary> {\n\t\treturn await this.transport.request({ method: 'suix_getLatestSuiSystemState', params: [] });\n\t}\n\n\t/**\n\t * Get events for a given query criteria\n\t */\n\tasync queryEvents(input: QueryEventsParams): Promise<PaginatedEvents> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryEvents',\n\t\t\tparams: [\n\t\t\t\tinput.query,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t\t(input.order || 'descending') === 'descending',\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Subscribe to get notifications whenever an event matching the filter occurs\n\t *\n\t * @deprecated\n\t */\n\tasync subscribeEvent(\n\t\tinput: SubscribeEventParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: SuiEvent) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeEvent',\n\t\t\tunsubscribe: 'suix_unsubscribeEvent',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated\n\t */\n\tasync subscribeTransaction(\n\t\tinput: SubscribeTransactionParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: TransactionEffects) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeTransaction',\n\t\t\tunsubscribe: 'suix_unsubscribeTransaction',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t});\n\t}\n\n\t/**\n\t * Runs the transaction block in dev-inspect mode. Which allows for nearly any\n\t * transaction (or Move call) with any arguments. Detailed results are\n\t * provided, including both the transaction effects and any return values.\n\t */\n\tasync devInspectTransactionBlock(\n\t\tinput: DevInspectTransactionBlockParams,\n\t): Promise<DevInspectResults> {\n\t\tlet devInspectTxBytes;\n\t\tif (isTransaction(input.transactionBlock)) {\n\t\t\tinput.transactionBlock.setSenderIfNotSet(input.sender);\n\t\t\tdevInspectTxBytes = toB64(\n\t\t\t\tawait input.transactionBlock.build({\n\t\t\t\t\tclient: this,\n\t\t\t\t\tonlyTransactionKind: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else if (typeof input.transactionBlock === 'string') {\n\t\t\tdevInspectTxBytes = input.transactionBlock;\n\t\t} else if (input.transactionBlock instanceof Uint8Array) {\n\t\t\tdevInspectTxBytes = toB64(input.transactionBlock);\n\t\t} else {\n\t\t\tthrow new Error('Unknown transaction block format.');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_devInspectTransactionBlock',\n\t\t\tparams: [input.sender, devInspectTxBytes, input.gasPrice?.toString(), input.epoch],\n\t\t});\n\t}\n\n\t/**\n\t * Dry run a transaction block and return the result.\n\t */\n\tasync dryRunTransactionBlock(\n\t\tinput: DryRunTransactionBlockParams,\n\t): Promise<DryRunTransactionBlockResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_dryRunTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof input.transactionBlock === 'string'\n\t\t\t\t\t? input.transactionBlock\n\t\t\t\t\t: toB64(input.transactionBlock),\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Return the list of dynamic field objects owned by an object\n\t */\n\tasync getDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage> {\n\t\tif (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFields',\n\t\t\tparams: [input.parentId, input.cursor, input.limit],\n\t\t});\n\t}\n\n\t/**\n\t * Return the dynamic field object information for a specified object\n\t */\n\tasync getDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFieldObject',\n\t\t\tparams: [input.parentId, input.name],\n\t\t});\n\t}\n\n\t/**\n\t * Get the sequence number of the latest checkpoint that has been executed\n\t */\n\tasync getLatestCheckpointSequenceNumber(): Promise<string> {\n\t\tconst resp = await this.transport.request({\n\t\t\tmethod: 'sui_getLatestCheckpointSequenceNumber',\n\t\t\tparams: [],\n\t\t});\n\t\treturn String(resp);\n\t}\n\n\t/**\n\t * Returns information about a given checkpoint\n\t */\n\tasync getCheckpoint(input: GetCheckpointParams): Promise<Checkpoint> {\n\t\treturn await this.transport.request({ method: 'sui_getCheckpoint', params: [input.id] });\n\t}\n\n\t/**\n\t * Returns historical checkpoints paginated\n\t */\n\tasync getCheckpoints(\n\t\tinput: PaginationArguments<CheckpointPage['nextCursor']> & GetCheckpointsParams,\n\t): Promise<CheckpointPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getCheckpoints',\n\t\t\tparams: [input.cursor, input?.limit, input.descendingOrder],\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCommitteeInfo(input?: GetCommitteeInfoParams): Promise<CommitteeInfo> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCommitteeInfo',\n\t\t\tparams: [input?.epoch],\n\t\t});\n\t}\n\n\tasync getNetworkMetrics(): Promise<NetworkMetrics> {\n\t\treturn await this.transport.request({ method: 'suix_getNetworkMetrics', params: [] });\n\t}\n\n\tasync getAddressMetrics(): Promise<AddressMetrics> {\n\t\treturn await this.transport.request({ method: 'suix_getLatestAddressMetrics', params: [] });\n\t}\n\n\tasync getEpochMetrics(\n\t\tinput?: { descendingOrder?: boolean } & PaginationArguments<EpochMetricsPage['nextCursor']>,\n\t): Promise<EpochMetricsPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochMetrics',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t});\n\t}\n\n\tasync getAllEpochAddressMetrics(input?: {\n\t\tdescendingOrder?: boolean;\n\t}): Promise<AllEpochsAddressMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllEpochAddressMetrics',\n\t\t\tparams: [input?.descendingOrder],\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getEpochs(\n\t\tinput?: {\n\t\t\tdescendingOrder?: boolean;\n\t\t} & PaginationArguments<EpochPage['nextCursor']>,\n\t): Promise<EpochPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochs',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t});\n\t}\n\n\t/**\n\t * Returns list of top move calls by usage\n\t */\n\tasync getMoveCallMetrics(): Promise<MoveCallMetrics> {\n\t\treturn await this.transport.request({ method: 'suix_getMoveCallMetrics', params: [] });\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCurrentEpoch(): Promise<EpochInfo> {\n\t\treturn await this.transport.request({ method: 'suix_getCurrentEpoch', params: [] });\n\t}\n\n\t/**\n\t * Return the Validators APYs\n\t */\n\tasync getValidatorsApy(): Promise<ValidatorsApy> {\n\t\treturn await this.transport.request({ method: 'suix_getValidatorsApy', params: [] });\n\t}\n\n\t// TODO: Migrate this to `sui_getChainIdentifier` once it is widely available.\n\tasync getChainIdentifier(): Promise<string> {\n\t\tconst checkpoint = await this.getCheckpoint({ id: '0' });\n\t\tconst bytes = fromB58(checkpoint.digest);\n\t\treturn toHEX(bytes.slice(0, 4));\n\t}\n\n\tasync resolveNameServiceAddress(input: ResolveNameServiceAddressParams): Promise<string | null> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_resolveNameServiceAddress',\n\t\t\tparams: [input.name],\n\t\t});\n\t}\n\n\tasync resolveNameServiceNames({\n\t\tformat = 'dot',\n\t\t...input\n\t}: ResolveNameServiceNamesParams & {\n\t\tformat?: 'at' | 'dot';\n\t}): Promise<ResolvedNameServiceNames> {\n\t\tconst { nextCursor, hasNextPage, data }: ResolvedNameServiceNames =\n\t\t\tawait this.transport.request({\n\t\t\t\tmethod: 'suix_resolveNameServiceNames',\n\t\t\t\tparams: [input.address, input.cursor, input.limit],\n\t\t\t});\n\n\t\treturn {\n\t\t\thasNextPage,\n\t\t\tnextCursor,\n\t\t\tdata: data.map((name) => normalizeSuiNSName(name, format)),\n\t\t};\n\t}\n\n\tasync getProtocolConfig(input?: GetProtocolConfigParams): Promise<ProtocolConfig> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getProtocolConfig',\n\t\t\tparams: [input?.version],\n\t\t});\n\t}\n\n\t/**\n\t * Wait for a transaction block result to be available over the API.\n\t * This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to\n\t * be available via the API.\n\t * This currently polls the `getTransactionBlock` API to check for the transaction.\n\t */\n\tasync waitForTransaction({\n\t\tsignal,\n\t\ttimeout = 60 * 1000,\n\t\tpollInterval = 2 * 1000,\n\t\t...input\n\t}: {\n\t\t/** An optional abort signal that can be used to cancel */\n\t\tsignal?: AbortSignal;\n\t\t/** The amount of time to wait for a transaction block. Defaults to one minute. */\n\t\ttimeout?: number;\n\t\t/** The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. */\n\t\tpollInterval?: number;\n\t} & Parameters<SuiClient['getTransactionBlock']>[0]): Promise<SuiTransactionBlockResponse> {\n\t\tconst timeoutSignal = AbortSignal.timeout(timeout);\n\t\tconst timeoutPromise = new Promise((_, reject) => {\n\t\t\ttimeoutSignal.addEventListener('abort', () => reject(timeoutSignal.reason));\n\t\t});\n\n\t\ttimeoutPromise.catch(() => {\n\t\t\t// Swallow unhandled rejections that might be thrown after early return\n\t\t});\n\n\t\twhile (!timeoutSignal.aborted) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\ttry {\n\t\t\t\treturn await this.getTransactionBlock(input);\n\t\t\t} catch (e) {\n\t\t\t\t// Wait for either the next poll interval, or the timeout.\n\t\t\t\tawait Promise.race([\n\t\t\t\t\tnew Promise((resolve) => setTimeout(resolve, pollInterval)),\n\t\t\t\t\ttimeoutPromise,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\n\t\ttimeoutSignal.throwIfAborted();\n\n\t\t// This should never happen, because the above case should always throw, but just adding it in the event that something goes horribly wrong.\n\t\tthrow new Error('Unexpected error while waiting for transaction block.');\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAsC;AAItC,0BAA8B;AAC9B,uBAMO;AACP,mBAAmC;AACnC,4BAAiC;AAyGjC,MAAM,mBAAmB,OAAO,IAAI,mBAAmB;AAEhD,SAAS,YAAY,QAAsC;AACjE,SACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAAe,gBAAgB,MAAM;AAEzF;AAEO,MAAM,UAAU;AAAA,EAGtB,KAAK,gBAAgB,IAAI;AACxB,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,YAAY,SAA2B;AACtC,SAAK,YAAY,QAAQ,aAAa,IAAI,uCAAiB,EAAE,KAAK,QAAQ,IAAI,CAAC;AAAA,EAChF;AAAA,EAEA,MAAM,mBAAgD;AACrD,UAAM,OAAO,MAAM,KAAK,UAAU,QAAuC;AAAA,MACxE,QAAQ;AAAA,MACR,QAAQ,CAAC;AAAA,IACV,CAAC;AAED,WAAO,KAAK,KAAK;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,SAAS,OAAgD;AAC9D,QAAI,CAAC,MAAM,SAAS,KAAC,wCAAkB,sCAAoB,MAAM,KAAK,CAAC,GAAG;AACzE,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACtC;AAEA,WAAO,MAAM,KAAK,UAAU,QAAQ;AAAA,MACnC,QAAQ;AAAA,MACR,QAAQ,CAAC,MAAM,OAAO,MAAM,UAAU,MAAM,QAAQ,MAAM,KAAK;AAAA,IAChE,CAAC;AAAA,EAC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ten/bcs';\n\nimport type { Signer } from '../cryptography/index.js';\nimport type { Transaction } from '../transactions/index.js';\nimport { isTransaction } from '../transactions/index.js';\nimport {\n\tisValidSuiAddress,\n\tisValidSuiObjectId,\n\tisValidTransactionDigest,\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n} from '../utils/sui-types.js';\nimport { normalizeSuiNSName } from '../utils/suins.js';\nimport { SuiHTTPTransport } from './http-transport.js';\nimport type { SuiTransport } from './http-transport.js';\nimport type {\n\tAddressMetrics,\n\tAllEpochsAddressMetrics,\n\tCheckpoint,\n\tCheckpointPage,\n\tCoinBalance,\n\tCoinMetadata,\n\tCoinSupply,\n\tCommitteeInfo,\n\tDelegatedStake,\n\tDevInspectResults,\n\tDevInspectTransactionBlockParams,\n\tDryRunTransactionBlockParams,\n\tDryRunTransactionBlockResponse,\n\tDynamicFieldPage,\n\tEpochInfo,\n\tEpochMetricsPage,\n\tEpochPage,\n\tExecuteTransactionBlockParams,\n\tGetAllBalancesParams,\n\tGetAllCoinsParams,\n\tGetBalanceParams,\n\tGetCheckpointParams,\n\tGetCheckpointsParams,\n\tGetCoinMetadataParams,\n\tGetCoinsParams,\n\tGetCommitteeInfoParams,\n\tGetDynamicFieldObjectParams,\n\tGetDynamicFieldsParams,\n\tGetMoveFunctionArgTypesParams,\n\tGetNormalizedMoveFunctionParams,\n\tGetNormalizedMoveModuleParams,\n\tGetNormalizedMoveModulesByPackageParams,\n\tGetNormalizedMoveStructParams,\n\tGetObjectParams,\n\tGetOwnedObjectsParams,\n\tGetProtocolConfigParams,\n\tGetStakesByIdsParams,\n\tGetStakesParams,\n\tGetTotalSupplyParams,\n\tGetTransactionBlockParams,\n\tMoveCallMetrics,\n\tMultiGetObjectsParams,\n\tMultiGetTransactionBlocksParams,\n\tNetworkMetrics,\n\tObjectRead,\n\tOrder,\n\tPaginatedCoins,\n\tPaginatedEvents,\n\tPaginatedObjectsResponse,\n\tPaginatedTransactionResponse,\n\tProtocolConfig,\n\tQueryEventsParams,\n\tQueryTransactionBlocksParams,\n\tResolvedNameServiceNames,\n\tResolveNameServiceAddressParams,\n\tResolveNameServiceNamesParams,\n\tSubscribeEventParams,\n\tSubscribeTransactionParams,\n\tSuiEvent,\n\tSuiMoveFunctionArgType,\n\tSuiMoveNormalizedFunction,\n\tSuiMoveNormalizedModule,\n\tSuiMoveNormalizedModules,\n\tSuiMoveNormalizedStruct,\n\tSuiObjectResponse,\n\tSuiObjectResponseQuery,\n\tSuiSystemStateSummary,\n\tSuiTransactionBlockResponse,\n\tSuiTransactionBlockResponseQuery,\n\tTransactionEffects,\n\tTryGetPastObjectParams,\n\tUnsubscribe,\n\tValidatorsApy,\n} from './types/index.js';\n\nexport interface PaginationArguments<Cursor> {\n\t/** Optional paging cursor */\n\tcursor?: Cursor;\n\t/** Maximum item returned per page */\n\tlimit?: number | null;\n}\n\nexport interface OrderArguments {\n\torder?: Order | null;\n}\n\n/**\n * Configuration options for the SuiClient\n * You must provide either a `url` or a `transport`\n */\nexport type SuiClientOptions = NetworkOrTransport;\n\ntype NetworkOrTransport =\n\t| {\n\t\t\turl: string;\n\t\t\ttransport?: never;\n\t }\n\t| {\n\t\t\ttransport: SuiTransport;\n\t\t\turl?: never;\n\t };\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiClient') as never;\n\nexport function isSuiClient(client: unknown): client is SuiClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport class SuiClient {\n\tprotected transport: SuiTransport;\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Establish a connection to a Sui RPC endpoint\n\t *\n\t * @param options configuration options for the API Client\n\t */\n\tconstructor(options: SuiClientOptions) {\n\t\tthis.transport = options.transport ?? new SuiHTTPTransport({ url: options.url });\n\t}\n\n\tasync getRpcApiVersion(): Promise<string | undefined> {\n\t\tconst resp = await this.transport.request<{ info: { version: string } }>({\n\t\t\tmethod: 'rpc.discover',\n\t\t\tparams: [],\n\t\t});\n\n\t\treturn resp.info.version;\n\t}\n\n\t/**\n\t * Get all Coin<`coin_type`> objects owned by an address.\n\t */\n\tasync getCoins(input: GetCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoins',\n\t\t\tparams: [input.owner, input.coinType, input.cursor, input.limit],\n\t\t});\n\t}\n\n\t/**\n\t * Get all Coin objects owned by an address.\n\t */\n\tasync getAllCoins(input: GetAllCoinsParams): Promise<PaginatedCoins> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllCoins',\n\t\t\tparams: [input.owner, input.cursor, input.limit],\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for one coin type, owned by the address owner.\n\t */\n\tasync getBalance(input: GetBalanceParams): Promise<CoinBalance> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getBalance',\n\t\t\tparams: [input.owner, input.coinType],\n\t\t});\n\t}\n\n\t/**\n\t * Get the total coin balance for all coin types, owned by the address owner.\n\t */\n\tasync getAllBalances(input: GetAllBalancesParams): Promise<CoinBalance[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({ method: 'suix_getAllBalances', params: [input.owner] });\n\t}\n\n\t/**\n\t * Fetch CoinMetadata for a given coin type\n\t */\n\tasync getCoinMetadata(input: GetCoinMetadataParams): Promise<CoinMetadata | null> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCoinMetadata',\n\t\t\tparams: [input.coinType],\n\t\t});\n\t}\n\n\t/**\n\t * Fetch total supply for a coin\n\t */\n\tasync getTotalSupply(input: GetTotalSupplyParams): Promise<CoinSupply> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getTotalSupply',\n\t\t\tparams: [input.coinType],\n\t\t});\n\t}\n\n\t/**\n\t * Invoke any RPC method\n\t * @param method the method to be invoked\n\t * @param args the arguments to be passed to the RPC request\n\t */\n\tasync call<T = unknown>(method: string, params: unknown[]): Promise<T> {\n\t\treturn await this.transport.request({ method, params });\n\t}\n\n\t/**\n\t * Get Move function argument types like read, write and full access\n\t */\n\tasync getMoveFunctionArgTypes(\n\t\tinput: GetMoveFunctionArgTypesParams,\n\t): Promise<SuiMoveFunctionArgType[]> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getMoveFunctionArgTypes',\n\t\t\tparams: [input.package, input.module, input.function],\n\t\t});\n\t}\n\n\t/**\n\t * Get a map from module name to\n\t * structured representations of Move modules\n\t */\n\tasync getNormalizedMoveModulesByPackage(\n\t\tinput: GetNormalizedMoveModulesByPackageParams,\n\t): Promise<SuiMoveNormalizedModules> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModulesByPackage',\n\t\t\tparams: [input.package],\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move module\n\t */\n\tasync getNormalizedMoveModule(\n\t\tinput: GetNormalizedMoveModuleParams,\n\t): Promise<SuiMoveNormalizedModule> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveModule',\n\t\t\tparams: [input.package, input.module],\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move function\n\t */\n\tasync getNormalizedMoveFunction(\n\t\tinput: GetNormalizedMoveFunctionParams,\n\t): Promise<SuiMoveNormalizedFunction> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveFunction',\n\t\t\tparams: [input.package, input.module, input.function],\n\t\t});\n\t}\n\n\t/**\n\t * Get a structured representation of Move struct\n\t */\n\tasync getNormalizedMoveStruct(\n\t\tinput: GetNormalizedMoveStructParams,\n\t): Promise<SuiMoveNormalizedStruct> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getNormalizedMoveStruct',\n\t\t\tparams: [input.package, input.module, input.struct],\n\t\t});\n\t}\n\n\t/**\n\t * Get all objects owned by an address\n\t */\n\tasync getOwnedObjects(input: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getOwnedObjects',\n\t\t\tparams: [\n\t\t\t\tinput.owner,\n\t\t\t\t{\n\t\t\t\t\tfilter: input.filter,\n\t\t\t\t\toptions: input.options,\n\t\t\t\t} as SuiObjectResponseQuery,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Get details about an object\n\t */\n\tasync getObject(input: GetObjectParams): Promise<SuiObjectResponse> {\n\t\tif (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getObject',\n\t\t\tparams: [input.id, input.options],\n\t\t});\n\t}\n\n\tasync tryGetPastObject(input: TryGetPastObjectParams): Promise<ObjectRead> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_tryGetPastObject',\n\t\t\tparams: [input.id, input.version, input.options],\n\t\t});\n\t}\n\n\t/**\n\t * Batch get details about a list of objects. If any of the object ids are duplicates the call will fail\n\t */\n\tasync multiGetObjects(input: MultiGetObjectsParams): Promise<SuiObjectResponse[]> {\n\t\tinput.ids.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Object id ${id}`);\n\t\t\t}\n\t\t});\n\t\tconst hasDuplicates = input.ids.length !== new Set(input.ids).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate object ids in batch call ${input.ids}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetObjects',\n\t\t\tparams: [input.ids, input.options],\n\t\t});\n\t}\n\n\t/**\n\t * Get transaction blocks for a given query criteria\n\t */\n\tasync queryTransactionBlocks(\n\t\tinput: QueryTransactionBlocksParams,\n\t): Promise<PaginatedTransactionResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryTransactionBlocks',\n\t\t\tparams: [\n\t\t\t\t{\n\t\t\t\t\tfilter: input.filter,\n\t\t\t\t\toptions: input.options,\n\t\t\t\t} as SuiTransactionBlockResponseQuery,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t\t(input.order || 'descending') === 'descending',\n\t\t\t],\n\t\t});\n\t}\n\n\tasync getTransactionBlock(\n\t\tinput: GetTransactionBlockParams,\n\t): Promise<SuiTransactionBlockResponse> {\n\t\tif (!isValidTransactionDigest(input.digest)) {\n\t\t\tthrow new Error('Invalid Transaction digest');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getTransactionBlock',\n\t\t\tparams: [input.digest, input.options],\n\t\t});\n\t}\n\n\tasync multiGetTransactionBlocks(\n\t\tinput: MultiGetTransactionBlocksParams,\n\t): Promise<SuiTransactionBlockResponse[]> {\n\t\tinput.digests.forEach((d) => {\n\t\t\tif (!isValidTransactionDigest(d)) {\n\t\t\t\tthrow new Error(`Invalid Transaction digest ${d}`);\n\t\t\t}\n\t\t});\n\n\t\tconst hasDuplicates = input.digests.length !== new Set(input.digests).size;\n\t\tif (hasDuplicates) {\n\t\t\tthrow new Error(`Duplicate digests in batch call ${input.digests}`);\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_multiGetTransactionBlocks',\n\t\t\tparams: [input.digests, input.options],\n\t\t});\n\t}\n\n\tasync executeTransactionBlock({\n\t\ttransactionBlock,\n\t\tsignature,\n\t\toptions,\n\t\trequestType,\n\t}: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse> {\n\t\tconst result: SuiTransactionBlockResponse = await this.transport.request({\n\t\t\tmethod: 'sui_executeTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof transactionBlock === 'string' ? transactionBlock : toB64(transactionBlock),\n\t\t\t\tArray.isArray(signature) ? signature : [signature],\n\t\t\t\toptions,\n\t\t\t],\n\t\t});\n\n\t\tif (requestType === 'WaitForLocalExecution') {\n\t\t\ttry {\n\t\t\t\tawait this.waitForTransaction({\n\t\t\t\t\tdigest: result.digest,\n\t\t\t\t});\n\t\t\t} catch (_) {\n\t\t\t\t// Ignore error while waiting for transaction\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tasync signAndExecuteTransaction({\n\t\ttransaction,\n\t\tsigner,\n\t\t...input\n\t}: {\n\t\ttransaction: Uint8Array | Transaction;\n\t\tsigner: Signer;\n\t} & Omit<\n\t\tExecuteTransactionBlockParams,\n\t\t'transactionBlock' | 'signature'\n\t>): Promise<SuiTransactionBlockResponse> {\n\t\tlet transactionBytes;\n\n\t\tif (transaction instanceof Uint8Array) {\n\t\t\ttransactionBytes = transaction;\n\t\t} else {\n\t\t\ttransaction.setSenderIfNotSet(signer.toSuiAddress());\n\t\t\ttransactionBytes = await transaction.build({ client: this });\n\t\t}\n\n\t\tconst { signature, bytes } = await signer.signTransaction(transactionBytes);\n\n\t\treturn this.executeTransactionBlock({\n\t\t\ttransactionBlock: bytes,\n\t\t\tsignature,\n\t\t\t...input,\n\t\t});\n\t}\n\n\t/**\n\t * Get total number of transactions\n\t */\n\n\tasync getTotalTransactionBlocks(): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'sui_getTotalTransactionBlocks',\n\t\t\tparams: [],\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Getting the reference gas price for the network\n\t */\n\tasync getReferenceGasPrice(): Promise<bigint> {\n\t\tconst resp = await this.transport.request<string>({\n\t\t\tmethod: 'suix_getReferenceGasPrice',\n\t\t\tparams: [],\n\t\t});\n\t\treturn BigInt(resp);\n\t}\n\n\t/**\n\t * Return the delegated stakes for an address\n\t */\n\tasync getStakes(input: GetStakesParams): Promise<DelegatedStake[]> {\n\t\tif (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) {\n\t\t\tthrow new Error('Invalid Sui address');\n\t\t}\n\t\treturn await this.transport.request({ method: 'suix_getStakes', params: [input.owner] });\n\t}\n\n\t/**\n\t * Return the delegated stakes queried by id.\n\t */\n\tasync getStakesByIds(input: GetStakesByIdsParams): Promise<DelegatedStake[]> {\n\t\tinput.stakedSuiIds.forEach((id) => {\n\t\t\tif (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) {\n\t\t\t\tthrow new Error(`Invalid Sui Stake id ${id}`);\n\t\t\t}\n\t\t});\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getStakesByIds',\n\t\t\tparams: [input.stakedSuiIds],\n\t\t});\n\t}\n\n\t/**\n\t * Return the latest system state content.\n\t */\n\tasync getLatestSuiSystemState(): Promise<SuiSystemStateSummary> {\n\t\treturn await this.transport.request({ method: 'suix_getLatestSuiSystemState', params: [] });\n\t}\n\n\t/**\n\t * Get events for a given query criteria\n\t */\n\tasync queryEvents(input: QueryEventsParams): Promise<PaginatedEvents> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_queryEvents',\n\t\t\tparams: [\n\t\t\t\tinput.query,\n\t\t\t\tinput.cursor,\n\t\t\t\tinput.limit,\n\t\t\t\t(input.order || 'descending') === 'descending',\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Subscribe to get notifications whenever an event matching the filter occurs\n\t *\n\t * @deprecated\n\t */\n\tasync subscribeEvent(\n\t\tinput: SubscribeEventParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: SuiEvent) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeEvent',\n\t\t\tunsubscribe: 'suix_unsubscribeEvent',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t});\n\t}\n\n\t/**\n\t * @deprecated\n\t */\n\tasync subscribeTransaction(\n\t\tinput: SubscribeTransactionParams & {\n\t\t\t/** function to run when we receive a notification of a new event matching the filter */\n\t\t\tonMessage: (event: TransactionEffects) => void;\n\t\t},\n\t): Promise<Unsubscribe> {\n\t\treturn this.transport.subscribe({\n\t\t\tmethod: 'suix_subscribeTransaction',\n\t\t\tunsubscribe: 'suix_unsubscribeTransaction',\n\t\t\tparams: [input.filter],\n\t\t\tonMessage: input.onMessage,\n\t\t});\n\t}\n\n\t/**\n\t * Runs the transaction block in dev-inspect mode. Which allows for nearly any\n\t * transaction (or Move call) with any arguments. Detailed results are\n\t * provided, including both the transaction effects and any return values.\n\t */\n\tasync devInspectTransactionBlock(\n\t\tinput: DevInspectTransactionBlockParams,\n\t): Promise<DevInspectResults> {\n\t\tlet devInspectTxBytes;\n\t\tif (isTransaction(input.transactionBlock)) {\n\t\t\tinput.transactionBlock.setSenderIfNotSet(input.sender);\n\t\t\tdevInspectTxBytes = toB64(\n\t\t\t\tawait input.transactionBlock.build({\n\t\t\t\t\tclient: this,\n\t\t\t\t\tonlyTransactionKind: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t} else if (typeof input.transactionBlock === 'string') {\n\t\t\tdevInspectTxBytes = input.transactionBlock;\n\t\t} else if (input.transactionBlock instanceof Uint8Array) {\n\t\t\tdevInspectTxBytes = toB64(input.transactionBlock);\n\t\t} else {\n\t\t\tthrow new Error('Unknown transaction block format.');\n\t\t}\n\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_devInspectTransactionBlock',\n\t\t\tparams: [input.sender, devInspectTxBytes, input.gasPrice?.toString(), input.epoch],\n\t\t});\n\t}\n\n\t/**\n\t * Dry run a transaction block and return the result.\n\t */\n\tasync dryRunTransactionBlock(\n\t\tinput: DryRunTransactionBlockParams,\n\t): Promise<DryRunTransactionBlockResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_dryRunTransactionBlock',\n\t\t\tparams: [\n\t\t\t\ttypeof input.transactionBlock === 'string'\n\t\t\t\t\t? input.transactionBlock\n\t\t\t\t\t: toB64(input.transactionBlock),\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * Return the list of dynamic field objects owned by an object\n\t */\n\tasync getDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage> {\n\t\tif (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) {\n\t\t\tthrow new Error('Invalid Sui Object id');\n\t\t}\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFields',\n\t\t\tparams: [input.parentId, input.cursor, input.limit],\n\t\t});\n\t}\n\n\t/**\n\t * Return the dynamic field object information for a specified object\n\t */\n\tasync getDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getDynamicFieldObject',\n\t\t\tparams: [input.parentId, input.name],\n\t\t});\n\t}\n\n\t/**\n\t * Get the sequence number of the latest checkpoint that has been executed\n\t */\n\tasync getLatestCheckpointSequenceNumber(): Promise<string> {\n\t\tconst resp = await this.transport.request({\n\t\t\tmethod: 'sui_getLatestCheckpointSequenceNumber',\n\t\t\tparams: [],\n\t\t});\n\t\treturn String(resp);\n\t}\n\n\t/**\n\t * Returns information about a given checkpoint\n\t */\n\tasync getCheckpoint(input: GetCheckpointParams): Promise<Checkpoint> {\n\t\treturn await this.transport.request({ method: 'sui_getCheckpoint', params: [input.id] });\n\t}\n\n\t/**\n\t * Returns historical checkpoints paginated\n\t */\n\tasync getCheckpoints(\n\t\tinput: PaginationArguments<CheckpointPage['nextCursor']> & GetCheckpointsParams,\n\t): Promise<CheckpointPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getCheckpoints',\n\t\t\tparams: [input.cursor, input?.limit, input.descendingOrder],\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCommitteeInfo(input?: GetCommitteeInfoParams): Promise<CommitteeInfo> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getCommitteeInfo',\n\t\t\tparams: [input?.epoch],\n\t\t});\n\t}\n\n\tasync getNetworkMetrics(): Promise<NetworkMetrics> {\n\t\treturn await this.transport.request({ method: 'suix_getNetworkMetrics', params: [] });\n\t}\n\n\tasync getAddressMetrics(): Promise<AddressMetrics> {\n\t\treturn await this.transport.request({ method: 'suix_getLatestAddressMetrics', params: [] });\n\t}\n\n\tasync getEpochMetrics(\n\t\tinput?: { descendingOrder?: boolean } & PaginationArguments<EpochMetricsPage['nextCursor']>,\n\t): Promise<EpochMetricsPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochMetrics',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t});\n\t}\n\n\tasync getAllEpochAddressMetrics(input?: {\n\t\tdescendingOrder?: boolean;\n\t}): Promise<AllEpochsAddressMetrics> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getAllEpochAddressMetrics',\n\t\t\tparams: [input?.descendingOrder],\n\t\t});\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getEpochs(\n\t\tinput?: {\n\t\t\tdescendingOrder?: boolean;\n\t\t} & PaginationArguments<EpochPage['nextCursor']>,\n\t): Promise<EpochPage> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_getEpochs',\n\t\t\tparams: [input?.cursor, input?.limit, input?.descendingOrder],\n\t\t});\n\t}\n\n\t/**\n\t * Returns list of top move calls by usage\n\t */\n\tasync getMoveCallMetrics(): Promise<MoveCallMetrics> {\n\t\treturn await this.transport.request({ method: 'suix_getMoveCallMetrics', params: [] });\n\t}\n\n\t/**\n\t * Return the committee information for the asked epoch\n\t */\n\tasync getCurrentEpoch(): Promise<EpochInfo> {\n\t\treturn await this.transport.request({ method: 'suix_getCurrentEpoch', params: [] });\n\t}\n\n\t/**\n\t * Return the Validators APYs\n\t */\n\tasync getValidatorsApy(): Promise<ValidatorsApy> {\n\t\treturn await this.transport.request({ method: 'suix_getValidatorsApy', params: [] });\n\t}\n\n\t// TODO: Migrate this to `sui_getChainIdentifier` once it is widely available.\n\tasync getChainIdentifier(): Promise<string> {\n\t\tconst checkpoint = await this.getCheckpoint({ id: '0' });\n\t\tconst bytes = fromB58(checkpoint.digest);\n\t\treturn toHEX(bytes.slice(0, 4));\n\t}\n\n\tasync resolveNameServiceAddress(input: ResolveNameServiceAddressParams): Promise<string | null> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'suix_resolveNameServiceAddress',\n\t\t\tparams: [input.name],\n\t\t});\n\t}\n\n\tasync resolveNameServiceNames({\n\t\tformat = 'dot',\n\t\t...input\n\t}: ResolveNameServiceNamesParams & {\n\t\tformat?: 'at' | 'dot';\n\t}): Promise<ResolvedNameServiceNames> {\n\t\tconst { nextCursor, hasNextPage, data }: ResolvedNameServiceNames =\n\t\t\tawait this.transport.request({\n\t\t\t\tmethod: 'suix_resolveNameServiceNames',\n\t\t\t\tparams: [input.address, input.cursor, input.limit],\n\t\t\t});\n\n\t\treturn {\n\t\t\thasNextPage,\n\t\t\tnextCursor,\n\t\t\tdata: data.map((name) => normalizeSuiNSName(name, format)),\n\t\t};\n\t}\n\n\tasync getProtocolConfig(input?: GetProtocolConfigParams): Promise<ProtocolConfig> {\n\t\treturn await this.transport.request({\n\t\t\tmethod: 'sui_getProtocolConfig',\n\t\t\tparams: [input?.version],\n\t\t});\n\t}\n\n\t/**\n\t * Wait for a transaction block result to be available over the API.\n\t * This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to\n\t * be available via the API.\n\t * This currently polls the `getTransactionBlock` API to check for the transaction.\n\t */\n\tasync waitForTransaction({\n\t\tsignal,\n\t\ttimeout = 60 * 1000,\n\t\tpollInterval = 2 * 1000,\n\t\t...input\n\t}: {\n\t\t/** An optional abort signal that can be used to cancel */\n\t\tsignal?: AbortSignal;\n\t\t/** The amount of time to wait for a transaction block. Defaults to one minute. */\n\t\ttimeout?: number;\n\t\t/** The amount of time to wait between checks for the transaction block. Defaults to 2 seconds. */\n\t\tpollInterval?: number;\n\t} & Parameters<SuiClient['getTransactionBlock']>[0]): Promise<SuiTransactionBlockResponse> {\n\t\tconst timeoutSignal = AbortSignal.timeout(timeout);\n\t\tconst timeoutPromise = new Promise((_, reject) => {\n\t\t\ttimeoutSignal.addEventListener('abort', () => reject(timeoutSignal.reason));\n\t\t});\n\n\t\ttimeoutPromise.catch(() => {\n\t\t\t// Swallow unhandled rejections that might be thrown after early return\n\t\t});\n\n\t\twhile (!timeoutSignal.aborted) {\n\t\t\tsignal?.throwIfAborted();\n\t\t\ttry {\n\t\t\t\treturn await this.getTransactionBlock(input);\n\t\t\t} catch (e) {\n\t\t\t\t// Wait for either the next poll interval, or the timeout.\n\t\t\t\tawait Promise.race([\n\t\t\t\t\tnew Promise((resolve) => setTimeout(resolve, pollInterval)),\n\t\t\t\t\ttimeoutPromise,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\n\t\ttimeoutSignal.throwIfAborted();\n\n\t\t// This should never happen, because the above case should always throw, but just adding it in the event that something goes horribly wrong.\n\t\tthrow new Error('Unexpected error while waiting for transaction block.');\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAsC;AAItC,0BAA8B;AAC9B,uBAMO;AACP,mBAAmC;AACnC,4BAAiC;AAyGjC,MAAM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,iCAAmB,MAAM,MAAM,CAAC;AAAA,IAC1D;AAAA,EACD;AAAA,EAEA,MAAM,kBAAkB,OAA0D;AACjF,WAAO,MAAM,KAAK,UAAU,QAAQ;AAAA,MACnC,QAAQ;AAAA,MACR,QAAQ,CAAC,OAAO,OAAO;AAAA,IACxB,CAAC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,mBAAmB;AAAA,IACxB;AAAA,IACA,UAAU,KAAK;AAAA,IACf,eAAe,IAAI;AAAA,IACnB,GAAG;AAAA,EACJ,GAO2F;AAC1F,UAAM,gBAAgB,YAAY,QAAQ,OAAO;AACjD,UAAM,iBAAiB,IAAI,QAAQ,CAAC,GAAG,WAAW;AACjD,oBAAc,iBAAiB,SAAS,MAAM,OAAO,cAAc,MAAM,CAAC;AAAA,IAC3E,CAAC;AAED,mBAAe,MAAM,MAAM;AAAA,IAE3B,CAAC;AAED,WAAO,CAAC,cAAc,SAAS;AAC9B,cAAQ,eAAe;AACvB,UAAI;AACH,eAAO,MAAM,KAAK,oBAAoB,KAAK;AAAA,MAC5C,SAAS,GAAG;AAEX,cAAM,QAAQ,KAAK;AAAA,UAClB,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,YAAY,CAAC;AAAA,UAC1D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,kBAAc,eAAe;AAG7B,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACxE;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -953,10 +953,32 @@ export declare const Arguments: {
|
|
|
953
953
|
NestedResult: [number, number];
|
|
954
954
|
};
|
|
955
955
|
};
|
|
956
|
-
object:
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
956
|
+
object: {
|
|
957
|
+
(value: TransactionObjectInput): (tx: Transaction) => {
|
|
958
|
+
$kind: "Input";
|
|
959
|
+
Input: number;
|
|
960
|
+
type?: "object";
|
|
961
|
+
};
|
|
962
|
+
system(): (tx: Transaction) => {
|
|
963
|
+
$kind: "Input";
|
|
964
|
+
Input: number;
|
|
965
|
+
type?: "object";
|
|
966
|
+
};
|
|
967
|
+
clock(): (tx: Transaction) => {
|
|
968
|
+
$kind: "Input";
|
|
969
|
+
Input: number;
|
|
970
|
+
type?: "object";
|
|
971
|
+
};
|
|
972
|
+
random(): (tx: Transaction) => {
|
|
973
|
+
$kind: "Input";
|
|
974
|
+
Input: number;
|
|
975
|
+
type?: "object";
|
|
976
|
+
};
|
|
977
|
+
denyList(): (tx: Transaction) => {
|
|
978
|
+
$kind: "Input";
|
|
979
|
+
Input: number;
|
|
980
|
+
type?: "object";
|
|
981
|
+
};
|
|
960
982
|
};
|
|
961
983
|
sharedObjectRef: (args_0: {
|
|
962
984
|
objectId: string;
|
|
@@ -21,10 +21,13 @@ __export(Arguments_exports, {
|
|
|
21
21
|
Arguments: () => Arguments
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Arguments_exports);
|
|
24
|
+
var import_object = require("./object.js");
|
|
24
25
|
var import_pure = require("./pure.js");
|
|
25
26
|
const Arguments = {
|
|
26
27
|
pure: (0, import_pure.createPure)((value) => (tx) => tx.pure(value)),
|
|
27
|
-
object: (
|
|
28
|
+
object: (0, import_object.createObjectMethods)(
|
|
29
|
+
(value) => (tx) => tx.object(value)
|
|
30
|
+
),
|
|
28
31
|
sharedObjectRef: (...args) => (tx) => tx.sharedObjectRef(...args),
|
|
29
32
|
objectRef: (...args) => (tx) => tx.objectRef(...args),
|
|
30
33
|
receivingRef: (...args) => (tx) => tx.receivingRef(...args)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/transactions/Arguments.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Inputs } from './Inputs.js';\nimport { createPure } from './pure.js';\nimport type { Transaction, TransactionObjectInput } from './Transaction.js';\n\nexport const Arguments = {\n\tpure: createPure((value) => (tx: Transaction) => tx.pure(value)),\n\tobject: (value: TransactionObjectInput) => (tx: Transaction) => tx.object(value),\n\tsharedObjectRef:\n\t\t(...args: Parameters<(typeof Inputs)['SharedObjectRef']>) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.sharedObjectRef(...args),\n\tobjectRef:\n\t\t(...args: Parameters<(typeof Inputs)['ObjectRef']>) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.objectRef(...args),\n\treceivingRef:\n\t\t(...args: Parameters<(typeof Inputs)['ReceivingRef']>) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.receivingRef(...args),\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAA2B;AAGpB,MAAM,YAAY;AAAA,EACxB,UAAM,wBAAW,CAAC,UAAU,CAAC,OAAoB,GAAG,KAAK,KAAK,CAAC;AAAA,EAC/D,
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Inputs } from './Inputs.js';\nimport { createObjectMethods } from './object.js';\nimport { createPure } from './pure.js';\nimport type { Transaction, TransactionObjectInput } from './Transaction.js';\n\nexport const Arguments = {\n\tpure: createPure((value) => (tx: Transaction) => tx.pure(value)),\n\tobject: createObjectMethods(\n\t\t(value: TransactionObjectInput) => (tx: Transaction) => tx.object(value),\n\t),\n\tsharedObjectRef:\n\t\t(...args: Parameters<(typeof Inputs)['SharedObjectRef']>) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.sharedObjectRef(...args),\n\tobjectRef:\n\t\t(...args: Parameters<(typeof Inputs)['ObjectRef']>) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.objectRef(...args),\n\treceivingRef:\n\t\t(...args: Parameters<(typeof Inputs)['ReceivingRef']>) =>\n\t\t(tx: Transaction) =>\n\t\t\ttx.receivingRef(...args),\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAAoC;AACpC,kBAA2B;AAGpB,MAAM,YAAY;AAAA,EACxB,UAAM,wBAAW,CAAC,UAAU,CAAC,OAAoB,GAAG,KAAK,KAAK,CAAC;AAAA,EAC/D,YAAQ;AAAA,IACP,CAAC,UAAkC,CAAC,OAAoB,GAAG,OAAO,KAAK;AAAA,EACxE;AAAA,EACA,iBACC,IAAI,SACJ,CAAC,OACA,GAAG,gBAAgB,GAAG,IAAI;AAAA,EAC5B,WACC,IAAI,SACJ,CAAC,OACA,GAAG,UAAU,GAAG,IAAI;AAAA,EACtB,cACC,IAAI,SACJ,CAAC,OACA,GAAG,aAAa,GAAG,IAAI;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -42,6 +42,8 @@ export declare class Transaction {
|
|
|
42
42
|
* - A byte array (or base64-encoded bytes) containing BCS transaction data.
|
|
43
43
|
*/
|
|
44
44
|
static from(transaction: string | Uint8Array | Transaction): Transaction;
|
|
45
|
+
static registerGlobalSerializationPlugin(step: TransactionPlugin): void;
|
|
46
|
+
static registerGlobalBuildPlugin(step: TransactionPlugin): void;
|
|
45
47
|
addSerializationPlugin(step: TransactionPlugin): void;
|
|
46
48
|
addBuildPlugin(step: TransactionPlugin): void;
|
|
47
49
|
addIntentResolver(intent: string, resolver: TransactionPlugin): void;
|
|
@@ -590,10 +592,32 @@ export declare class Transaction {
|
|
|
590
592
|
/**
|
|
591
593
|
* Add a new object input to the transaction.
|
|
592
594
|
*/
|
|
593
|
-
object
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
595
|
+
object: {
|
|
596
|
+
(value: TransactionObjectInput): {
|
|
597
|
+
$kind: "Input";
|
|
598
|
+
Input: number;
|
|
599
|
+
type?: "object";
|
|
600
|
+
};
|
|
601
|
+
system(): {
|
|
602
|
+
$kind: "Input";
|
|
603
|
+
Input: number;
|
|
604
|
+
type?: "object";
|
|
605
|
+
};
|
|
606
|
+
clock(): {
|
|
607
|
+
$kind: "Input";
|
|
608
|
+
Input: number;
|
|
609
|
+
type?: "object";
|
|
610
|
+
};
|
|
611
|
+
random(): {
|
|
612
|
+
$kind: "Input";
|
|
613
|
+
Input: number;
|
|
614
|
+
type?: "object";
|
|
615
|
+
};
|
|
616
|
+
denyList(): {
|
|
617
|
+
$kind: "Input";
|
|
618
|
+
Input: number;
|
|
619
|
+
type?: "object";
|
|
620
|
+
};
|
|
597
621
|
};
|
|
598
622
|
/**
|
|
599
623
|
* Add a new object input to the transaction using the fully-resolved object reference.
|
|
@@ -39,6 +39,7 @@ var import_v1 = require("./data/v1.js");
|
|
|
39
39
|
var import_v2 = require("./data/v2.js");
|
|
40
40
|
var import_Inputs = require("./Inputs.js");
|
|
41
41
|
var import_json_rpc_resolver = require("./json-rpc-resolver.js");
|
|
42
|
+
var import_object = require("./object.js");
|
|
42
43
|
var import_pure = require("./pure.js");
|
|
43
44
|
var import_TransactionData = require("./TransactionData.js");
|
|
44
45
|
var import_utils = require("./utils.js");
|
|
@@ -83,14 +84,58 @@ const TRANSACTION_BRAND = Symbol.for("@mysten/transaction");
|
|
|
83
84
|
function isTransaction(obj) {
|
|
84
85
|
return !!obj && typeof obj === "object" && obj[TRANSACTION_BRAND] === true;
|
|
85
86
|
}
|
|
87
|
+
const modulePluginRegistry = {
|
|
88
|
+
buildPlugins: [],
|
|
89
|
+
serializationPlugins: []
|
|
90
|
+
};
|
|
91
|
+
const TRANSACTION_REGISTRY_KEY = Symbol.for("@mysten/transaction/registry");
|
|
92
|
+
function getGlobalPluginRegistry() {
|
|
93
|
+
try {
|
|
94
|
+
const target = globalThis;
|
|
95
|
+
if (!target[TRANSACTION_REGISTRY_KEY]) {
|
|
96
|
+
target[TRANSACTION_REGISTRY_KEY] = modulePluginRegistry;
|
|
97
|
+
}
|
|
98
|
+
return target[TRANSACTION_REGISTRY_KEY];
|
|
99
|
+
} catch (e) {
|
|
100
|
+
return modulePluginRegistry;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
86
103
|
const _Transaction = class _Transaction {
|
|
87
104
|
constructor() {
|
|
88
105
|
__privateAdd(this, _Transaction_instances);
|
|
89
|
-
__privateAdd(this, _serializationPlugins
|
|
90
|
-
__privateAdd(this, _buildPlugins
|
|
106
|
+
__privateAdd(this, _serializationPlugins);
|
|
107
|
+
__privateAdd(this, _buildPlugins);
|
|
91
108
|
__privateAdd(this, _intentResolvers, /* @__PURE__ */ new Map());
|
|
92
109
|
__privateAdd(this, _data);
|
|
110
|
+
/**
|
|
111
|
+
* Add a new object input to the transaction.
|
|
112
|
+
*/
|
|
113
|
+
this.object = (0, import_object.createObjectMethods)(
|
|
114
|
+
(value) => {
|
|
115
|
+
if (typeof value === "function") {
|
|
116
|
+
return this.object(value(this));
|
|
117
|
+
}
|
|
118
|
+
if (typeof value === "object" && (0, import_valibot.is)(import_internal.Argument, value)) {
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
const id = (0, import_utils.getIdFromCallArg)(value);
|
|
122
|
+
const inserted = __privateGet(this, _data).inputs.find((i) => id === (0, import_utils.getIdFromCallArg)(i));
|
|
123
|
+
if (inserted?.Object?.SharedObject && typeof value === "object" && value.Object?.SharedObject) {
|
|
124
|
+
inserted.Object.SharedObject.mutable = inserted.Object.SharedObject.mutable || value.Object.SharedObject.mutable;
|
|
125
|
+
}
|
|
126
|
+
return inserted ? { $kind: "Input", Input: __privateGet(this, _data).inputs.indexOf(inserted), type: "object" } : __privateGet(this, _data).addInput(
|
|
127
|
+
"object",
|
|
128
|
+
typeof value === "string" ? {
|
|
129
|
+
$kind: "UnresolvedObject",
|
|
130
|
+
UnresolvedObject: { objectId: (0, import_sui_types.normalizeSuiAddress)(value) }
|
|
131
|
+
} : value
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
const globalPlugins = getGlobalPluginRegistry();
|
|
93
136
|
__privateSet(this, _data, new import_TransactionData.TransactionDataBuilder());
|
|
137
|
+
__privateSet(this, _buildPlugins, [...globalPlugins.buildPlugins]);
|
|
138
|
+
__privateSet(this, _serializationPlugins, [...globalPlugins.serializationPlugins]);
|
|
94
139
|
}
|
|
95
140
|
/**
|
|
96
141
|
* Converts from a serialize transaction kind (built with `build({ onlyTransactionKind: true })`) to a `Transaction` class.
|
|
@@ -122,6 +167,12 @@ const _Transaction = class _Transaction {
|
|
|
122
167
|
}
|
|
123
168
|
return newTransaction;
|
|
124
169
|
}
|
|
170
|
+
static registerGlobalSerializationPlugin(step) {
|
|
171
|
+
getGlobalPluginRegistry().serializationPlugins.push(step);
|
|
172
|
+
}
|
|
173
|
+
static registerGlobalBuildPlugin(step) {
|
|
174
|
+
getGlobalPluginRegistry().buildPlugins.push(step);
|
|
175
|
+
}
|
|
125
176
|
addSerializationPlugin(step) {
|
|
126
177
|
__privateGet(this, _serializationPlugins).push(step);
|
|
127
178
|
}
|
|
@@ -204,29 +255,6 @@ const _Transaction = class _Transaction {
|
|
|
204
255
|
get gas() {
|
|
205
256
|
return { $kind: "GasCoin", GasCoin: true };
|
|
206
257
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Add a new object input to the transaction.
|
|
209
|
-
*/
|
|
210
|
-
object(value) {
|
|
211
|
-
if (typeof value === "function") {
|
|
212
|
-
return this.object(value(this));
|
|
213
|
-
}
|
|
214
|
-
if (typeof value === "object" && (0, import_valibot.is)(import_internal.Argument, value)) {
|
|
215
|
-
return value;
|
|
216
|
-
}
|
|
217
|
-
const id = (0, import_utils.getIdFromCallArg)(value);
|
|
218
|
-
const inserted = __privateGet(this, _data).inputs.find((i) => id === (0, import_utils.getIdFromCallArg)(i));
|
|
219
|
-
if (inserted?.Object?.SharedObject && typeof value === "object" && value.Object?.SharedObject) {
|
|
220
|
-
inserted.Object.SharedObject.mutable = inserted.Object.SharedObject.mutable || value.Object.SharedObject.mutable;
|
|
221
|
-
}
|
|
222
|
-
return inserted ? { $kind: "Input", Input: __privateGet(this, _data).inputs.indexOf(inserted), type: "object" } : __privateGet(this, _data).addInput(
|
|
223
|
-
"object",
|
|
224
|
-
typeof value === "string" ? {
|
|
225
|
-
$kind: "UnresolvedObject",
|
|
226
|
-
UnresolvedObject: { objectId: (0, import_sui_types.normalizeSuiAddress)(value) }
|
|
227
|
-
} : value
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
258
|
/**
|
|
231
259
|
* Add a new object input to the transaction using the fully-resolved object reference.
|
|
232
260
|
* If you only have an object ID, use `builder.object(id)` instead.
|