@mysten/sui 1.43.1 → 1.44.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 +13 -0
- package/dist/cjs/experimental/core.d.ts +1 -0
- package/dist/cjs/experimental/core.js.map +2 -2
- package/dist/cjs/experimental/types.d.ts +6 -8
- package/dist/cjs/experimental/types.js.map +1 -1
- package/dist/cjs/graphql/core.d.ts +1 -1
- package/dist/cjs/graphql/core.js +81 -78
- package/dist/cjs/graphql/core.js.map +2 -2
- package/dist/cjs/graphql/generated/latest/tada-env.d.ts +3870 -5429
- package/dist/cjs/graphql/generated/latest/tada-env.js +3958 -5702
- package/dist/cjs/graphql/generated/latest/tada-env.js.map +2 -2
- package/dist/cjs/graphql/generated/queries.d.ts +2485 -3397
- package/dist/cjs/graphql/generated/queries.js +137 -172
- package/dist/cjs/graphql/generated/queries.js.map +3 -3
- package/dist/cjs/graphql/types.d.ts +1 -0
- package/dist/cjs/graphql/types.js.map +1 -1
- package/dist/cjs/grpc/client.d.ts +2 -0
- package/dist/cjs/grpc/client.js +2 -0
- package/dist/cjs/grpc/client.js.map +2 -2
- package/dist/cjs/grpc/core.d.ts +1 -0
- package/dist/cjs/grpc/core.js +10 -0
- package/dist/cjs/grpc/core.js.map +2 -2
- package/dist/cjs/jsonRpc/core.d.ts +1 -1
- package/dist/cjs/jsonRpc/core.js +7 -2
- package/dist/cjs/jsonRpc/core.js.map +2 -2
- package/dist/cjs/transactions/Transaction.js +2 -2
- package/dist/cjs/transactions/Transaction.js.map +1 -1
- 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 +1 -1
- package/dist/cjs/zklogin/publickey.js.map +1 -1
- package/dist/esm/experimental/core.d.ts +1 -0
- package/dist/esm/experimental/core.js.map +2 -2
- package/dist/esm/experimental/types.d.ts +6 -8
- package/dist/esm/graphql/core.d.ts +1 -1
- package/dist/esm/graphql/core.js +85 -82
- package/dist/esm/graphql/core.js.map +2 -2
- package/dist/esm/graphql/generated/latest/tada-env.d.ts +3870 -5429
- package/dist/esm/graphql/generated/latest/tada-env.js +3958 -5702
- package/dist/esm/graphql/generated/latest/tada-env.js.map +2 -2
- package/dist/esm/graphql/generated/queries.d.ts +2485 -3397
- package/dist/esm/graphql/generated/queries.js +137 -172
- package/dist/esm/graphql/generated/queries.js.map +3 -3
- package/dist/esm/graphql/types.d.ts +1 -0
- package/dist/esm/grpc/client.d.ts +2 -0
- package/dist/esm/grpc/client.js +2 -0
- package/dist/esm/grpc/client.js.map +2 -2
- package/dist/esm/grpc/core.d.ts +1 -0
- package/dist/esm/grpc/core.js +10 -0
- package/dist/esm/grpc/core.js.map +2 -2
- package/dist/esm/jsonRpc/core.d.ts +1 -1
- package/dist/esm/jsonRpc/core.js +7 -2
- package/dist/esm/jsonRpc/core.js.map +2 -2
- package/dist/esm/transactions/Transaction.js +2 -2
- package/dist/esm/transactions/Transaction.js.map +1 -1
- 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 +1 -1
- package/dist/esm/zklogin/publickey.js.map +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/experimental/core.ts +4 -0
- package/src/experimental/types.ts +8 -10
- package/src/graphql/core.ts +95 -95
- package/src/graphql/generated/latest/schema.graphql +2139 -2671
- package/src/graphql/generated/latest/tada-env.ts +3958 -5702
- package/src/graphql/generated/queries.ts +2344 -3281
- package/src/graphql/queries/getAllBalances.graphql +0 -1
- package/src/graphql/queries/getBalance.graphql +2 -3
- package/src/graphql/queries/getCoins.graphql +9 -4
- package/src/graphql/queries/getDynamicFields.graphql +1 -1
- package/src/graphql/queries/nameService.graphql +2 -10
- package/src/graphql/queries/objects.graphql +11 -22
- package/src/graphql/queries/transactions.graphql +16 -12
- package/src/graphql/queries/verifyZkLoginSignature.graphql +2 -2
- package/src/graphql/types.ts +1 -0
- package/src/grpc/client.ts +3 -0
- package/src/grpc/core.ts +16 -0
- package/src/jsonRpc/core.ts +9 -4
- package/src/transactions/Transaction.ts +2 -2
- package/src/version.ts +2 -2
- package/src/zklogin/publickey.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 1.44.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 44d9b4f: Update GraphQL client to use beta schema"
|
|
8
|
+
|
|
9
|
+
## 1.43.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [89fa2dc]
|
|
14
|
+
- @mysten/bcs@1.9.2
|
|
15
|
+
|
|
3
16
|
## 1.43.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -26,6 +26,7 @@ export declare abstract class Experimental_CoreClient extends Experimental_BaseC
|
|
|
26
26
|
abstract resolveTransactionPlugin(): TransactionPlugin;
|
|
27
27
|
abstract verifyZkLoginSignature(options: Experimental_SuiClientTypes.VerifyZkLoginSignatureOptions): Promise<Experimental_SuiClientTypes.ZkLoginVerifyResponse>;
|
|
28
28
|
abstract getMoveFunction(options: Experimental_SuiClientTypes.GetMoveFunctionOptions): Promise<Experimental_SuiClientTypes.GetMoveFunctionResponse>;
|
|
29
|
+
abstract defaultNameServiceName(options: Experimental_SuiClientTypes.DefaultNameServiceNameOptions): Promise<Experimental_SuiClientTypes.DefaultNameServiceNameResponse>;
|
|
29
30
|
getDynamicField(options: Experimental_SuiClientTypes.GetDynamicFieldOptions): Promise<Experimental_SuiClientTypes.GetDynamicFieldResponse>;
|
|
30
31
|
waitForTransaction({ signal, timeout, ...input }: {
|
|
31
32
|
/** An optional abort signal that can be used to cancel the wait. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/experimental/core.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { TypeTagSerializer } from '../bcs/type-tag-serializer.js';\nimport type { TransactionPlugin } from '../transactions/index.js';\nimport { deriveDynamicFieldID } from '../utils/dynamic-fields.js';\nimport { normalizeStructTag, parseStructTag, SUI_ADDRESS_LENGTH } from '../utils/sui-types.js';\nimport { Experimental_BaseClient } from './client.js';\nimport type { ClientWithExtensions, Experimental_SuiClientTypes } from './types.js';\nimport { MvrClient } from './mvr.js';\n\nexport type ClientWithCoreApi = ClientWithExtensions<{\n\tcore: Experimental_CoreClient;\n}>;\n\nexport interface Experimental_CoreClientOptions\n\textends Experimental_SuiClientTypes.SuiClientOptions {\n\tbase: Experimental_BaseClient;\n\tmvr?: Experimental_SuiClientTypes.MvrOptions;\n}\n\nconst DEFAULT_MVR_URLS: Record<string, string> = {\n\tmainnet: 'https://mainnet.mvr.mystenlabs.com',\n\ttestnet: 'https://testnet.mvr.mystenlabs.com',\n};\n\nexport abstract class Experimental_CoreClient\n\textends Experimental_BaseClient\n\timplements Experimental_SuiClientTypes.TransportMethods\n{\n\tcore = this;\n\tmvr: Experimental_SuiClientTypes.MvrMethods;\n\n\tconstructor(options: Experimental_CoreClientOptions) {\n\t\tsuper(options);\n\n\t\tthis.mvr = new MvrClient({\n\t\t\tcache: this.cache.scope('core.mvr'),\n\t\t\turl: options.mvr?.url ?? DEFAULT_MVR_URLS[this.network],\n\t\t\tpageSize: options.mvr?.pageSize,\n\t\t\toverrides: options.mvr?.overrides,\n\t\t});\n\t}\n\n\tabstract getObjects(\n\t\toptions: Experimental_SuiClientTypes.GetObjectsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetObjectsResponse>;\n\n\tasync getObject(\n\t\toptions: Experimental_SuiClientTypes.GetObjectOptions,\n\t): Promise<Experimental_SuiClientTypes.GetObjectResponse> {\n\t\tconst { objectId } = options;\n\t\tconst {\n\t\t\tobjects: [result],\n\t\t} = await this.getObjects({ objectIds: [objectId], signal: options.signal });\n\t\tif (result instanceof Error) {\n\t\t\tthrow result;\n\t\t}\n\t\treturn { object: result };\n\t}\n\n\tabstract getCoins(\n\t\toptions: Experimental_SuiClientTypes.GetCoinsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetCoinsResponse>;\n\n\tabstract getOwnedObjects(\n\t\toptions: Experimental_SuiClientTypes.GetOwnedObjectsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetOwnedObjectsResponse>;\n\n\tabstract getBalance(\n\t\toptions: Experimental_SuiClientTypes.GetBalanceOptions,\n\t): Promise<Experimental_SuiClientTypes.GetBalanceResponse>;\n\n\tabstract getAllBalances(\n\t\toptions: Experimental_SuiClientTypes.GetAllBalancesOptions,\n\t): Promise<Experimental_SuiClientTypes.GetAllBalancesResponse>;\n\n\tabstract getTransaction(\n\t\toptions: Experimental_SuiClientTypes.GetTransactionOptions,\n\t): Promise<Experimental_SuiClientTypes.GetTransactionResponse>;\n\n\tabstract executeTransaction(\n\t\toptions: Experimental_SuiClientTypes.ExecuteTransactionOptions,\n\t): Promise<Experimental_SuiClientTypes.ExecuteTransactionResponse>;\n\n\tabstract dryRunTransaction(\n\t\toptions: Experimental_SuiClientTypes.DryRunTransactionOptions,\n\t): Promise<Experimental_SuiClientTypes.DryRunTransactionResponse>;\n\n\tabstract getReferenceGasPrice(\n\t\toptions?: Experimental_SuiClientTypes.GetReferenceGasPriceOptions,\n\t): Promise<Experimental_SuiClientTypes.GetReferenceGasPriceResponse>;\n\n\tabstract getDynamicFields(\n\t\toptions: Experimental_SuiClientTypes.GetDynamicFieldsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetDynamicFieldsResponse>;\n\n\tabstract resolveTransactionPlugin(): TransactionPlugin;\n\n\tabstract verifyZkLoginSignature(\n\t\toptions: Experimental_SuiClientTypes.VerifyZkLoginSignatureOptions,\n\t): Promise<Experimental_SuiClientTypes.ZkLoginVerifyResponse>;\n\n\tabstract getMoveFunction(\n\t\toptions: Experimental_SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<Experimental_SuiClientTypes.GetMoveFunctionResponse>;\n\n\tasync getDynamicField(\n\t\toptions: Experimental_SuiClientTypes.GetDynamicFieldOptions,\n\t): Promise<Experimental_SuiClientTypes.GetDynamicFieldResponse> {\n\t\tconst normalizedNameType = TypeTagSerializer.parseFromStr(\n\t\t\t(\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: options.name.type,\n\t\t\t\t})\n\t\t\t).type,\n\t\t);\n\t\tconst fieldId = deriveDynamicFieldID(options.parentId, normalizedNameType, options.name.bcs);\n\t\tconst {\n\t\t\tobjects: [fieldObject],\n\t\t} = await this.getObjects({\n\t\t\tobjectIds: [fieldId],\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tif (fieldObject instanceof Error) {\n\t\t\tthrow fieldObject;\n\t\t}\n\n\t\tconst fieldType = parseStructTag(fieldObject.type);\n\t\tconst content = await fieldObject.content;\n\n\t\treturn {\n\t\t\tdynamicField: {\n\t\t\t\tid: fieldObject.id,\n\t\t\t\tdigest: fieldObject.digest,\n\t\t\t\tversion: fieldObject.version,\n\t\t\t\ttype: fieldObject.type,\n\t\t\t\tpreviousTransaction: fieldObject.previousTransaction,\n\t\t\t\tname: {\n\t\t\t\t\ttype:\n\t\t\t\t\t\ttypeof fieldType.typeParams[0] === 'string'\n\t\t\t\t\t\t\t? fieldType.typeParams[0]\n\t\t\t\t\t\t\t: normalizeStructTag(fieldType.typeParams[0]),\n\t\t\t\t\tbcs: options.name.bcs,\n\t\t\t\t},\n\t\t\t\tvalue: {\n\t\t\t\t\ttype:\n\t\t\t\t\t\ttypeof fieldType.typeParams[1] === 'string'\n\t\t\t\t\t\t\t? fieldType.typeParams[1]\n\t\t\t\t\t\t\t: normalizeStructTag(fieldType.typeParams[1]),\n\t\t\t\t\tbcs: content.slice(SUI_ADDRESS_LENGTH + options.name.bcs.length),\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tasync waitForTransaction({\n\t\tsignal,\n\t\ttimeout = 60 * 1000,\n\t\t...input\n\t}: {\n\t\t/** An optional abort signal that can be used to cancel the wait. */\n\t\tsignal?: AbortSignal;\n\t\t/** The amount of time to wait for transaction. Defaults to one minute. */\n\t\ttimeout?: number;\n\t} & Experimental_SuiClientTypes.GetTransactionOptions): Promise<Experimental_SuiClientTypes.GetTransactionResponse> {\n\t\tconst abortSignal = signal\n\t\t\t? AbortSignal.any([AbortSignal.timeout(timeout), signal])\n\t\t\t: AbortSignal.timeout(timeout);\n\n\t\tconst abortPromise = new Promise((_, reject) => {\n\t\t\tabortSignal.addEventListener('abort', () => reject(abortSignal.reason));\n\t\t});\n\n\t\tabortPromise.catch(() => {\n\t\t\t// Swallow unhandled rejections that might be thrown after early return\n\t\t});\n\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tabortSignal.throwIfAborted();\n\t\t\ttry {\n\t\t\t\treturn await this.getTransaction({\n\t\t\t\t\t...input,\n\t\t\t\t\tsignal: abortSignal,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tawait Promise.race([new Promise((resolve) => setTimeout(resolve, 2_000)), abortPromise]);\n\t\t\t}\n\t\t}\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iCAAkC;AAElC,4BAAqC;AACrC,uBAAuE;AACvE,oBAAwC;AAExC,iBAA0B;AAY1B,MAAM,mBAA2C;AAAA,EAChD,SAAS;AAAA,EACT,SAAS;AACV;AAEO,MAAe,gCACb,sCAET;AAAA,EAIC,YAAY,SAAyC;AACpD,UAAM,OAAO;AAJd,gBAAO;AAMN,SAAK,MAAM,IAAI,qBAAU;AAAA,MACxB,OAAO,KAAK,MAAM,MAAM,UAAU;AAAA,MAClC,KAAK,QAAQ,KAAK,OAAO,iBAAiB,KAAK,OAAO;AAAA,MACtD,UAAU,QAAQ,KAAK;AAAA,MACvB,WAAW,QAAQ,KAAK;AAAA,IACzB,CAAC;AAAA,EACF;AAAA,EAMA,MAAM,UACL,SACyD;AACzD,UAAM,EAAE,SAAS,IAAI;AACrB,UAAM;AAAA,MACL,SAAS,CAAC,MAAM;AAAA,IACjB,IAAI,MAAM,KAAK,WAAW,EAAE,WAAW,CAAC,QAAQ,GAAG,QAAQ,QAAQ,OAAO,CAAC;AAC3E,QAAI,kBAAkB,OAAO;AAC5B,YAAM;AAAA,IACP;AACA,WAAO,EAAE,QAAQ,OAAO;AAAA,EACzB;AAAA,
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { TypeTagSerializer } from '../bcs/type-tag-serializer.js';\nimport type { TransactionPlugin } from '../transactions/index.js';\nimport { deriveDynamicFieldID } from '../utils/dynamic-fields.js';\nimport { normalizeStructTag, parseStructTag, SUI_ADDRESS_LENGTH } from '../utils/sui-types.js';\nimport { Experimental_BaseClient } from './client.js';\nimport type { ClientWithExtensions, Experimental_SuiClientTypes } from './types.js';\nimport { MvrClient } from './mvr.js';\n\nexport type ClientWithCoreApi = ClientWithExtensions<{\n\tcore: Experimental_CoreClient;\n}>;\n\nexport interface Experimental_CoreClientOptions\n\textends Experimental_SuiClientTypes.SuiClientOptions {\n\tbase: Experimental_BaseClient;\n\tmvr?: Experimental_SuiClientTypes.MvrOptions;\n}\n\nconst DEFAULT_MVR_URLS: Record<string, string> = {\n\tmainnet: 'https://mainnet.mvr.mystenlabs.com',\n\ttestnet: 'https://testnet.mvr.mystenlabs.com',\n};\n\nexport abstract class Experimental_CoreClient\n\textends Experimental_BaseClient\n\timplements Experimental_SuiClientTypes.TransportMethods\n{\n\tcore = this;\n\tmvr: Experimental_SuiClientTypes.MvrMethods;\n\n\tconstructor(options: Experimental_CoreClientOptions) {\n\t\tsuper(options);\n\n\t\tthis.mvr = new MvrClient({\n\t\t\tcache: this.cache.scope('core.mvr'),\n\t\t\turl: options.mvr?.url ?? DEFAULT_MVR_URLS[this.network],\n\t\t\tpageSize: options.mvr?.pageSize,\n\t\t\toverrides: options.mvr?.overrides,\n\t\t});\n\t}\n\n\tabstract getObjects(\n\t\toptions: Experimental_SuiClientTypes.GetObjectsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetObjectsResponse>;\n\n\tasync getObject(\n\t\toptions: Experimental_SuiClientTypes.GetObjectOptions,\n\t): Promise<Experimental_SuiClientTypes.GetObjectResponse> {\n\t\tconst { objectId } = options;\n\t\tconst {\n\t\t\tobjects: [result],\n\t\t} = await this.getObjects({ objectIds: [objectId], signal: options.signal });\n\t\tif (result instanceof Error) {\n\t\t\tthrow result;\n\t\t}\n\t\treturn { object: result };\n\t}\n\n\tabstract getCoins(\n\t\toptions: Experimental_SuiClientTypes.GetCoinsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetCoinsResponse>;\n\n\tabstract getOwnedObjects(\n\t\toptions: Experimental_SuiClientTypes.GetOwnedObjectsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetOwnedObjectsResponse>;\n\n\tabstract getBalance(\n\t\toptions: Experimental_SuiClientTypes.GetBalanceOptions,\n\t): Promise<Experimental_SuiClientTypes.GetBalanceResponse>;\n\n\tabstract getAllBalances(\n\t\toptions: Experimental_SuiClientTypes.GetAllBalancesOptions,\n\t): Promise<Experimental_SuiClientTypes.GetAllBalancesResponse>;\n\n\tabstract getTransaction(\n\t\toptions: Experimental_SuiClientTypes.GetTransactionOptions,\n\t): Promise<Experimental_SuiClientTypes.GetTransactionResponse>;\n\n\tabstract executeTransaction(\n\t\toptions: Experimental_SuiClientTypes.ExecuteTransactionOptions,\n\t): Promise<Experimental_SuiClientTypes.ExecuteTransactionResponse>;\n\n\tabstract dryRunTransaction(\n\t\toptions: Experimental_SuiClientTypes.DryRunTransactionOptions,\n\t): Promise<Experimental_SuiClientTypes.DryRunTransactionResponse>;\n\n\tabstract getReferenceGasPrice(\n\t\toptions?: Experimental_SuiClientTypes.GetReferenceGasPriceOptions,\n\t): Promise<Experimental_SuiClientTypes.GetReferenceGasPriceResponse>;\n\n\tabstract getDynamicFields(\n\t\toptions: Experimental_SuiClientTypes.GetDynamicFieldsOptions,\n\t): Promise<Experimental_SuiClientTypes.GetDynamicFieldsResponse>;\n\n\tabstract resolveTransactionPlugin(): TransactionPlugin;\n\n\tabstract verifyZkLoginSignature(\n\t\toptions: Experimental_SuiClientTypes.VerifyZkLoginSignatureOptions,\n\t): Promise<Experimental_SuiClientTypes.ZkLoginVerifyResponse>;\n\n\tabstract getMoveFunction(\n\t\toptions: Experimental_SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<Experimental_SuiClientTypes.GetMoveFunctionResponse>;\n\n\tabstract defaultNameServiceName(\n\t\toptions: Experimental_SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<Experimental_SuiClientTypes.DefaultNameServiceNameResponse>;\n\n\tasync getDynamicField(\n\t\toptions: Experimental_SuiClientTypes.GetDynamicFieldOptions,\n\t): Promise<Experimental_SuiClientTypes.GetDynamicFieldResponse> {\n\t\tconst normalizedNameType = TypeTagSerializer.parseFromStr(\n\t\t\t(\n\t\t\t\tawait this.core.mvr.resolveType({\n\t\t\t\t\ttype: options.name.type,\n\t\t\t\t})\n\t\t\t).type,\n\t\t);\n\t\tconst fieldId = deriveDynamicFieldID(options.parentId, normalizedNameType, options.name.bcs);\n\t\tconst {\n\t\t\tobjects: [fieldObject],\n\t\t} = await this.getObjects({\n\t\t\tobjectIds: [fieldId],\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tif (fieldObject instanceof Error) {\n\t\t\tthrow fieldObject;\n\t\t}\n\n\t\tconst fieldType = parseStructTag(fieldObject.type);\n\t\tconst content = await fieldObject.content;\n\n\t\treturn {\n\t\t\tdynamicField: {\n\t\t\t\tid: fieldObject.id,\n\t\t\t\tdigest: fieldObject.digest,\n\t\t\t\tversion: fieldObject.version,\n\t\t\t\ttype: fieldObject.type,\n\t\t\t\tpreviousTransaction: fieldObject.previousTransaction,\n\t\t\t\tname: {\n\t\t\t\t\ttype:\n\t\t\t\t\t\ttypeof fieldType.typeParams[0] === 'string'\n\t\t\t\t\t\t\t? fieldType.typeParams[0]\n\t\t\t\t\t\t\t: normalizeStructTag(fieldType.typeParams[0]),\n\t\t\t\t\tbcs: options.name.bcs,\n\t\t\t\t},\n\t\t\t\tvalue: {\n\t\t\t\t\ttype:\n\t\t\t\t\t\ttypeof fieldType.typeParams[1] === 'string'\n\t\t\t\t\t\t\t? fieldType.typeParams[1]\n\t\t\t\t\t\t\t: normalizeStructTag(fieldType.typeParams[1]),\n\t\t\t\t\tbcs: content.slice(SUI_ADDRESS_LENGTH + options.name.bcs.length),\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tasync waitForTransaction({\n\t\tsignal,\n\t\ttimeout = 60 * 1000,\n\t\t...input\n\t}: {\n\t\t/** An optional abort signal that can be used to cancel the wait. */\n\t\tsignal?: AbortSignal;\n\t\t/** The amount of time to wait for transaction. Defaults to one minute. */\n\t\ttimeout?: number;\n\t} & Experimental_SuiClientTypes.GetTransactionOptions): Promise<Experimental_SuiClientTypes.GetTransactionResponse> {\n\t\tconst abortSignal = signal\n\t\t\t? AbortSignal.any([AbortSignal.timeout(timeout), signal])\n\t\t\t: AbortSignal.timeout(timeout);\n\n\t\tconst abortPromise = new Promise((_, reject) => {\n\t\t\tabortSignal.addEventListener('abort', () => reject(abortSignal.reason));\n\t\t});\n\n\t\tabortPromise.catch(() => {\n\t\t\t// Swallow unhandled rejections that might be thrown after early return\n\t\t});\n\n\t\t// eslint-disable-next-line no-constant-condition\n\t\twhile (true) {\n\t\t\tabortSignal.throwIfAborted();\n\t\t\ttry {\n\t\t\t\treturn await this.getTransaction({\n\t\t\t\t\t...input,\n\t\t\t\t\tsignal: abortSignal,\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tawait Promise.race([new Promise((resolve) => setTimeout(resolve, 2_000)), abortPromise]);\n\t\t\t}\n\t\t}\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iCAAkC;AAElC,4BAAqC;AACrC,uBAAuE;AACvE,oBAAwC;AAExC,iBAA0B;AAY1B,MAAM,mBAA2C;AAAA,EAChD,SAAS;AAAA,EACT,SAAS;AACV;AAEO,MAAe,gCACb,sCAET;AAAA,EAIC,YAAY,SAAyC;AACpD,UAAM,OAAO;AAJd,gBAAO;AAMN,SAAK,MAAM,IAAI,qBAAU;AAAA,MACxB,OAAO,KAAK,MAAM,MAAM,UAAU;AAAA,MAClC,KAAK,QAAQ,KAAK,OAAO,iBAAiB,KAAK,OAAO;AAAA,MACtD,UAAU,QAAQ,KAAK;AAAA,MACvB,WAAW,QAAQ,KAAK;AAAA,IACzB,CAAC;AAAA,EACF;AAAA,EAMA,MAAM,UACL,SACyD;AACzD,UAAM,EAAE,SAAS,IAAI;AACrB,UAAM;AAAA,MACL,SAAS,CAAC,MAAM;AAAA,IACjB,IAAI,MAAM,KAAK,WAAW,EAAE,WAAW,CAAC,QAAQ,GAAG,QAAQ,QAAQ,OAAO,CAAC;AAC3E,QAAI,kBAAkB,OAAO;AAC5B,YAAM;AAAA,IACP;AACA,WAAO,EAAE,QAAQ,OAAO;AAAA,EACzB;AAAA,EAoDA,MAAM,gBACL,SAC+D;AAC/D,UAAM,qBAAqB,6CAAkB;AAAA,OAE3C,MAAM,KAAK,KAAK,IAAI,YAAY;AAAA,QAC/B,MAAM,QAAQ,KAAK;AAAA,MACpB,CAAC,GACA;AAAA,IACH;AACA,UAAM,cAAU,4CAAqB,QAAQ,UAAU,oBAAoB,QAAQ,KAAK,GAAG;AAC3F,UAAM;AAAA,MACL,SAAS,CAAC,WAAW;AAAA,IACtB,IAAI,MAAM,KAAK,WAAW;AAAA,MACzB,WAAW,CAAC,OAAO;AAAA,MACnB,QAAQ,QAAQ;AAAA,IACjB,CAAC;AAED,QAAI,uBAAuB,OAAO;AACjC,YAAM;AAAA,IACP;AAEA,UAAM,gBAAY,iCAAe,YAAY,IAAI;AACjD,UAAM,UAAU,MAAM,YAAY;AAElC,WAAO;AAAA,MACN,cAAc;AAAA,QACb,IAAI,YAAY;AAAA,QAChB,QAAQ,YAAY;AAAA,QACpB,SAAS,YAAY;AAAA,QACrB,MAAM,YAAY;AAAA,QAClB,qBAAqB,YAAY;AAAA,QACjC,MAAM;AAAA,UACL,MACC,OAAO,UAAU,WAAW,CAAC,MAAM,WAChC,UAAU,WAAW,CAAC,QACtB,qCAAmB,UAAU,WAAW,CAAC,CAAC;AAAA,UAC9C,KAAK,QAAQ,KAAK;AAAA,QACnB;AAAA,QACA,OAAO;AAAA,UACN,MACC,OAAO,UAAU,WAAW,CAAC,MAAM,WAChC,UAAU,WAAW,CAAC,QACtB,qCAAmB,UAAU,WAAW,CAAC,CAAC;AAAA,UAC9C,KAAK,QAAQ,MAAM,sCAAqB,QAAQ,KAAK,IAAI,MAAM;AAAA,QAChE;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,mBAAmB;AAAA,IACxB;AAAA,IACA,UAAU,KAAK;AAAA,IACf,GAAG;AAAA,EACJ,GAKoH;AACnH,UAAM,cAAc,SACjB,YAAY,IAAI,CAAC,YAAY,QAAQ,OAAO,GAAG,MAAM,CAAC,IACtD,YAAY,QAAQ,OAAO;AAE9B,UAAM,eAAe,IAAI,QAAQ,CAAC,GAAG,WAAW;AAC/C,kBAAY,iBAAiB,SAAS,MAAM,OAAO,YAAY,MAAM,CAAC;AAAA,IACvE,CAAC;AAED,iBAAa,MAAM,MAAM;AAAA,IAEzB,CAAC;AAGD,WAAO,MAAM;AACZ,kBAAY,eAAe;AAC3B,UAAI;AACH,eAAO,MAAM,KAAK,eAAe;AAAA,UAChC,GAAG;AAAA,UACH,QAAQ;AAAA,QACT,CAAC;AAAA,MACF,QAAQ;AACP,cAAM,QAAQ,KAAK,CAAC,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAK,CAAC,GAAG,YAAY,CAAC;AAAA,MACxF;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -207,18 +207,16 @@ export declare namespace Experimental_SuiClientTypes {
|
|
|
207
207
|
verifyZkLoginSignature: (options: VerifyZkLoginSignatureOptions) => Promise<ZkLoginVerifyResponse>;
|
|
208
208
|
}
|
|
209
209
|
/** Name service methods */
|
|
210
|
-
interface
|
|
210
|
+
interface DefaultNameServiceNameOptions extends CoreClientMethodOptions {
|
|
211
211
|
address: string;
|
|
212
|
-
cursor?: string | null | undefined;
|
|
213
|
-
limit?: number | null | undefined;
|
|
214
212
|
}
|
|
215
|
-
interface
|
|
216
|
-
data:
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
interface DefaultNameServiceNameResponse {
|
|
214
|
+
data: {
|
|
215
|
+
name: string | null;
|
|
216
|
+
};
|
|
219
217
|
}
|
|
220
218
|
interface TransportMethods {
|
|
221
|
-
|
|
219
|
+
defaultNameServiceName: (options: DefaultNameServiceNameOptions) => Promise<DefaultNameServiceNameResponse>;
|
|
222
220
|
}
|
|
223
221
|
/** MVR methods */
|
|
224
222
|
interface TransportMethods {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/experimental/types.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport type { SerializedTransactionDataV2, TransactionPlugin } from '../transactions/index.js';\nimport type { ClientCache } from './cache.js';\nimport type { Experimental_BaseClient } from './client.js';\n\nexport type SuiClientRegistration<\n\tT extends Experimental_BaseClient = Experimental_BaseClient,\n\tName extends string = string,\n\tExtension = unknown,\n> = {\n\treadonly name: Name;\n\treadonly register: (client: T) => Extension;\n};\n\nexport type ClientWithExtensions<\n\tT,\n\tBase extends Experimental_BaseClient = Experimental_BaseClient,\n> = Base & T;\n\nexport namespace Experimental_SuiClientTypes {\n\texport type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});\n\n\texport interface SuiClientOptions {\n\t\tnetwork: Network;\n\t\tbase?: Experimental_BaseClient;\n\t\tcache?: ClientCache;\n\t}\n\n\texport interface MvrOptions {\n\t\turl?: string;\n\t\tpageSize?: number;\n\t\toverrides?: {\n\t\t\tpackages?: Record<string, string>;\n\t\t\ttypes?: Record<string, string>;\n\t\t};\n\t}\n\n\texport interface CoreClientMethodOptions {\n\t\tsignal?: AbortSignal;\n\t}\n\n\t/** Object methods */\n\texport interface TransportMethods {\n\t\tgetObjects: (options: GetObjectsOptions) => Promise<GetObjectsResponse>;\n\t\tgetOwnedObjects: (options: GetOwnedObjectsOptions) => Promise<GetOwnedObjectsResponse>;\n\t\tgetCoins: (options: GetCoinsOptions) => Promise<GetCoinsResponse>;\n\t\tgetDynamicFields: (options: GetDynamicFieldsOptions) => Promise<GetDynamicFieldsResponse>;\n\t\tgetDynamicField: (options: GetDynamicFieldOptions) => Promise<GetDynamicFieldResponse>;\n\t}\n\n\texport interface GetObjectsOptions extends CoreClientMethodOptions {\n\t\tobjectIds: string[];\n\t}\n\n\texport interface GetObjectOptions extends CoreClientMethodOptions {\n\t\tobjectId: string;\n\t}\n\n\texport interface GetOwnedObjectsOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t\ttype?: string;\n\t}\n\n\texport interface GetCoinsOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tcoinType: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t}\n\n\texport interface GetDynamicFieldsOptions extends CoreClientMethodOptions {\n\t\tparentId: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t}\n\n\texport interface GetDynamicFieldOptions extends CoreClientMethodOptions {\n\t\tparentId: string;\n\t\tname: DynamicFieldName;\n\t}\n\n\texport interface GetObjectsResponse {\n\t\tobjects: (ObjectResponse | Error)[];\n\t}\n\n\texport interface GetObjectResponse {\n\t\tobject: ObjectResponse;\n\t}\n\n\texport interface GetOwnedObjectsResponse {\n\t\tobjects: ObjectResponse[];\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t}\n\n\texport interface GetCoinsResponse {\n\t\tobjects: CoinResponse[];\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t}\n\n\texport interface ObjectResponse {\n\t\tid: string;\n\t\tversion: string;\n\t\tdigest: string;\n\t\towner: ObjectOwner;\n\t\ttype: string;\n\t\tcontent: PromiseLike<Uint8Array>;\n\t\tpreviousTransaction: string | null;\n\t}\n\n\texport interface CoinResponse extends ObjectResponse {\n\t\tbalance: string;\n\t}\n\n\texport interface GetDynamicFieldsResponse {\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t\tdynamicFields: {\n\t\t\tid: string;\n\t\t\ttype: string;\n\t\t\tname: DynamicFieldName;\n\t\t}[];\n\t}\n\n\texport interface GetDynamicFieldResponse {\n\t\tdynamicField: {\n\t\t\tname: DynamicFieldName;\n\t\t\tvalue: DynamicFieldValue;\n\t\t\tid: string;\n\t\t\tversion: string;\n\t\t\tdigest: string;\n\t\t\ttype: string;\n\t\t\tpreviousTransaction: string | null;\n\t\t};\n\t}\n\n\texport interface DynamicFieldName {\n\t\ttype: string;\n\t\tbcs: Uint8Array;\n\t}\n\n\texport interface DynamicFieldValue {\n\t\ttype: string;\n\t\tbcs: Uint8Array;\n\t}\n\n\t/** Balance methods */\n\texport interface TransportMethods {\n\t\tgetBalance: (options: GetBalanceOptions) => Promise<GetBalanceResponse>;\n\t\tgetAllBalances: (options: GetAllBalancesOptions) => Promise<GetAllBalancesResponse>;\n\t}\n\n\texport interface GetBalanceOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tcoinType: string;\n\t}\n\n\texport interface CoinBalance {\n\t\tcoinType: string;\n\t\tbalance: string;\n\t}\n\n\texport interface GetBalanceResponse {\n\t\tbalance: CoinBalance;\n\t}\n\n\texport interface GetAllBalancesOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t}\n\n\texport interface GetAllBalancesResponse {\n\t\tbalances: CoinBalance[];\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t}\n\n\t/** Transaction methods */\n\texport interface TransportMethods {\n\t\tgetTransaction: (options: GetTransactionOptions) => Promise<GetTransactionResponse>;\n\t\texecuteTransaction: (options: ExecuteTransactionOptions) => Promise<ExecuteTransactionResponse>;\n\t\tdryRunTransaction: (options: DryRunTransactionOptions) => Promise<DryRunTransactionResponse>;\n\t\tresolveTransactionPlugin: () => TransactionPlugin;\n\t}\n\n\texport interface TransactionResponse {\n\t\tdigest: string;\n\t\tsignatures: string[];\n\t\tepoch: string | null;\n\t\teffects: TransactionEffects;\n\t\tobjectTypes: PromiseLike<Record<string, string>>;\n\t\ttransaction: TransactionData;\n\t\tbalanceChanges: BalanceChange[];\n\t\t// TODO: add events\n\t\t// events?: Uint8Array;\n\t}\n\n\texport interface BalanceChange {\n\t\tcoinType: string;\n\t\taddress: string;\n\t\tamount: string;\n\t}\n\n\texport interface TransactionData extends SerializedTransactionDataV2 {\n\t\tbcs: Uint8Array;\n\t}\n\n\texport interface GetTransactionOptions extends CoreClientMethodOptions {\n\t\tdigest: string;\n\t}\n\n\texport interface GetTransactionResponse {\n\t\ttransaction: TransactionResponse;\n\t}\n\n\texport interface ExecuteTransactionOptions extends CoreClientMethodOptions {\n\t\ttransaction: Uint8Array;\n\t\tsignatures: string[];\n\t}\n\n\texport interface DryRunTransactionOptions extends CoreClientMethodOptions {\n\t\ttransaction: Uint8Array;\n\t}\n\n\texport interface DryRunTransactionResponse {\n\t\ttransaction: TransactionResponse;\n\t}\n\n\texport interface ExecuteTransactionResponse {\n\t\ttransaction: TransactionResponse;\n\t}\n\n\texport interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}\n\n\texport interface TransportMethods {\n\t\tgetReferenceGasPrice?: (\n\t\t\toptions?: GetReferenceGasPriceOptions,\n\t\t) => Promise<GetReferenceGasPriceResponse>;\n\t}\n\n\texport interface GetReferenceGasPriceResponse {\n\t\treferenceGasPrice: string;\n\t}\n\n\t/** ZkLogin methods */\n\texport interface VerifyZkLoginSignatureOptions extends CoreClientMethodOptions {\n\t\tbytes: string;\n\t\tsignature: string;\n\t\tintentScope: 'TransactionData' | 'PersonalMessage';\n\t\tauthor: string;\n\t}\n\n\texport interface ZkLoginVerifyResponse {\n\t\tsuccess: boolean;\n\t\terrors: string[];\n\t}\n\n\texport interface TransportMethods {\n\t\tverifyZkLoginSignature: (\n\t\t\toptions: VerifyZkLoginSignatureOptions,\n\t\t) => Promise<ZkLoginVerifyResponse>;\n\t}\n\n\t/** Name service methods */\n\texport interface ResolveNameServiceNamesOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tcursor?: string | null | undefined;\n\t\tlimit?: number | null | undefined;\n\t}\n\n\texport interface ResolveNameServiceNamesResponse {\n\t\tdata: string[];\n\t\thasNextPage: boolean;\n\t\tnextCursor: string | null;\n\t}\n\n\texport interface TransportMethods {\n\t\tresolveNameServiceNames?: (\n\t\t\toptions: ResolveNameServiceNamesOptions,\n\t\t) => Promise<ResolveNameServiceNamesResponse>;\n\t}\n\n\t/** MVR methods */\n\n\texport interface TransportMethods {\n\t\tmvr: MvrMethods;\n\t}\n\n\texport interface MvrMethods {\n\t\tresolvePackage: (options: MvrResolvePackageOptions) => Promise<MvrResolvePackageResponse>;\n\t\tresolveType: (options: MvrResolveTypeOptions) => Promise<MvrResolveTypeResponse>;\n\t\tresolve: (options: MvrResolveOptions) => Promise<MvrResolveResponse>;\n\t}\n\n\texport interface MvrResolvePackageOptions extends CoreClientMethodOptions {\n\t\tpackage: string;\n\t}\n\n\texport interface MvrResolveTypeOptions extends CoreClientMethodOptions {\n\t\ttype: string;\n\t}\n\n\texport interface MvrResolveOptions extends CoreClientMethodOptions {\n\t\tpackages?: string[];\n\t\ttypes?: string[];\n\t}\n\n\texport interface MvrResolvePackageResponse {\n\t\tpackage: string;\n\t}\n\n\texport interface MvrResolveTypeResponse {\n\t\ttype: string;\n\t}\n\n\texport interface MvrResolveResponse {\n\t\tpackages: Record<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\tpackage: string;\n\t\t\t}\n\t\t>;\n\t\ttypes: Record<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\ttype: string;\n\t\t\t}\n\t\t>;\n\t}\n\n\t/** Move package methods */\n\n\texport interface TransportMethods {\n\t\tgetMoveFunction: (options: GetMoveFunctionOptions) => Promise<GetMoveFunctionResponse>;\n\t}\n\n\texport interface GetMovePackageOptions extends CoreClientMethodOptions {\n\t\tpackageId: string;\n\t}\n\n\texport interface GetMovePackageResponse {\n\t\tpackage: PackageResponse;\n\t}\n\n\texport interface PackageResponse {\n\t\tstorageId: string;\n\t\toriginalId: string;\n\t\tversion: string;\n\t\tmodules: ModuleResponse[];\n\t}\n\n\texport interface ModuleResponse {\n\t\tname: string;\n\t\tdatatypes: DatatypeResponse[];\n\t\tfunctions: FunctionResponse[];\n\t}\n\n\texport type DatatypeResponse =\n\t\t| {\n\t\t\t\t$kind: 'struct';\n\t\t\t\ttypeName: string;\n\t\t\t\tdefiningId: string;\n\t\t\t\tmoduleName: string;\n\t\t\t\tname: string;\n\t\t\t\tabilities: Ability[];\n\t\t\t\ttypeParameters: TypeParameter[];\n\t\t\t\tfields: FieldDescriptor[];\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'enum';\n\t\t\t\ttypeName: string;\n\t\t\t\tdefiningId: string;\n\t\t\t\tmoduleName: string;\n\t\t\t\tname: string;\n\t\t\t\tabilities: Ability[];\n\t\t\t\ttypeParameters: TypeParameter[];\n\t\t\t\tvariants: VariantDescriptor[];\n\t\t };\n\n\texport type Ability = 'copy' | 'drop' | 'store' | 'key' | 'unknown';\n\texport type DatatypeKind = 'struct' | 'enum' | 'unknown';\n\n\texport interface TypeParameter {\n\t\tconstraints: Ability[];\n\t\tisPhantom: boolean;\n\t}\n\n\texport interface FieldDescriptor {\n\t\tname: string;\n\t\tposition: number;\n\t\ttype: OpenSignatureBody;\n\t}\n\n\texport interface VariantDescriptor {\n\t\tname: string;\n\t\tposition: number;\n\t\tfields: FieldDescriptor[];\n\t}\n\n\texport interface GetMoveFunctionOptions extends CoreClientMethodOptions {\n\t\tpackageId: string;\n\t\tmoduleName: string;\n\t\tname: string;\n\t}\n\n\texport interface GetMoveFunctionResponse {\n\t\tfunction: FunctionResponse;\n\t}\n\n\texport interface GetMoveDatatypeOptions extends CoreClientMethodOptions {\n\t\tpackageId: string;\n\t\tmoduleName: string;\n\t\tname: string;\n\t}\n\n\texport interface GetMoveDatatypeResponse {\n\t\tdatatype: DatatypeResponse;\n\t}\n\n\texport type Visibility = 'public' | 'friend' | 'private' | 'unknown';\n\n\texport interface FunctionResponse {\n\t\tpackageId: string;\n\t\tmoduleName: string;\n\t\tname: string;\n\t\tvisibility: Visibility;\n\t\tisEntry: boolean;\n\t\ttypeParameters: TypeParameter[];\n\t\tparameters: OpenSignature[];\n\t\treturns: OpenSignature[];\n\t}\n\n\texport type ReferenceType = 'mutable' | 'immutable' | 'unknown';\n\texport type OpenSignature = {\n\t\treference: ReferenceType | null;\n\t\tbody: OpenSignatureBody;\n\t};\n\n\texport type OpenSignatureBody =\n\t\t| {\n\t\t\t\t$kind: 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'bool' | 'address' | 'unknown';\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'vector';\n\t\t\t\tvector: OpenSignatureBody;\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'datatype';\n\t\t\t\tdatatype: {\n\t\t\t\t\ttypeName: string;\n\t\t\t\t\ttypeParameters: OpenSignatureBody[];\n\t\t\t\t};\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'typeParameter';\n\t\t\t\tindex: number;\n\t\t };\n\n\t/** ObjectOwner types */\n\n\texport interface AddressOwner {\n\t\t$kind: 'AddressOwner';\n\t\tAddressOwner: string;\n\t}\n\n\texport interface ParentOwner {\n\t\t$kind: 'ObjectOwner';\n\t\tObjectOwner: string;\n\t}\n\n\texport interface SharedOwner {\n\t\t$kind: 'Shared';\n\t\tShared: {\n\t\t\tinitialSharedVersion: string;\n\t\t};\n\t}\n\n\texport interface ImmutableOwner {\n\t\t$kind: 'Immutable';\n\t\tImmutable: true;\n\t}\n\n\texport interface ConsensusAddressOwner {\n\t\t$kind: 'ConsensusAddressOwner';\n\t\tConsensusAddressOwner: {\n\t\t\towner: string;\n\t\t\tstartVersion: string;\n\t\t};\n\t}\n\n\texport interface UnknownOwner {\n\t\t$kind: 'Unknown';\n\t}\n\n\texport type ObjectOwner =\n\t\t| AddressOwner\n\t\t| ParentOwner\n\t\t| SharedOwner\n\t\t| ImmutableOwner\n\t\t| ConsensusAddressOwner\n\t\t| UnknownOwner;\n\n\t/** Effects */\n\n\texport interface TransactionEffects {\n\t\tbcs: Uint8Array | null;\n\t\tdigest: string;\n\t\tversion: number;\n\t\tstatus: ExecutionStatus;\n\t\tgasUsed: GasCostSummary;\n\t\ttransactionDigest: string;\n\t\tgasObject: ChangedObject | null;\n\t\teventsDigest: string | null;\n\t\tdependencies: string[];\n\t\tlamportVersion: string | null;\n\t\tchangedObjects: ChangedObject[];\n\t\tunchangedConsensusObjects: UnchangedConsensusObject[];\n\t\tauxiliaryDataDigest: string | null;\n\t}\n\n\texport interface ChangedObject {\n\t\tid: string;\n\t\tinputState: 'Unknown' | 'DoesNotExist' | 'Exists';\n\t\tinputVersion: string | null;\n\t\tinputDigest: string | null;\n\t\tinputOwner: ObjectOwner | null;\n\t\toutputState: 'Unknown' | 'DoesNotExist' | 'ObjectWrite' | 'PackageWrite';\n\t\toutputVersion: string | null;\n\t\toutputDigest: string | null;\n\t\toutputOwner: ObjectOwner | null;\n\t\tidOperation: 'Unknown' | 'None' | 'Created' | 'Deleted';\n\t}\n\n\texport interface GasCostSummary {\n\t\tcomputationCost: string;\n\t\tstorageCost: string;\n\t\tstorageRebate: string;\n\t\tnonRefundableStorageFee: string;\n\t}\n\n\texport type ExecutionStatus =\n\t\t| {\n\t\t\t\tsuccess: true;\n\t\t\t\terror: null;\n\t\t }\n\t\t| {\n\t\t\t\tsuccess: false;\n\t\t\t\t// TODO: this should probably be typed better: https://github.com/bmwill/sui/blob/646a2c819346dc140cc649eb9fea368fb14f96e5/crates/sui-rpc-api/proto/sui/rpc/v2beta/execution_status.proto#L22\n\t\t\t\terror: string;\n\t\t };\n\n\texport interface UnchangedConsensusObject {\n\t\tkind:\n\t\t\t| 'Unknown'\n\t\t\t| 'ReadOnlyRoot'\n\t\t\t| 'MutateConsensusStreamEnded'\n\t\t\t| 'ReadConsensusStreamEnded'\n\t\t\t| 'Cancelled'\n\t\t\t| 'PerEpochConfig';\n\t\tobjectId: string;\n\t\tversion: string | null;\n\t\tdigest: string | null;\n\t}\n}\n"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport type { SerializedTransactionDataV2, TransactionPlugin } from '../transactions/index.js';\nimport type { ClientCache } from './cache.js';\nimport type { Experimental_BaseClient } from './client.js';\n\nexport type SuiClientRegistration<\n\tT extends Experimental_BaseClient = Experimental_BaseClient,\n\tName extends string = string,\n\tExtension = unknown,\n> = {\n\treadonly name: Name;\n\treadonly register: (client: T) => Extension;\n};\n\nexport type ClientWithExtensions<\n\tT,\n\tBase extends Experimental_BaseClient = Experimental_BaseClient,\n> = Base & T;\n\nexport namespace Experimental_SuiClientTypes {\n\texport type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});\n\n\texport interface SuiClientOptions {\n\t\tnetwork: Network;\n\t\tbase?: Experimental_BaseClient;\n\t\tcache?: ClientCache;\n\t}\n\n\texport interface MvrOptions {\n\t\turl?: string;\n\t\tpageSize?: number;\n\t\toverrides?: {\n\t\t\tpackages?: Record<string, string>;\n\t\t\ttypes?: Record<string, string>;\n\t\t};\n\t}\n\n\texport interface CoreClientMethodOptions {\n\t\tsignal?: AbortSignal;\n\t}\n\n\t/** Object methods */\n\texport interface TransportMethods {\n\t\tgetObjects: (options: GetObjectsOptions) => Promise<GetObjectsResponse>;\n\t\tgetOwnedObjects: (options: GetOwnedObjectsOptions) => Promise<GetOwnedObjectsResponse>;\n\t\tgetCoins: (options: GetCoinsOptions) => Promise<GetCoinsResponse>;\n\t\tgetDynamicFields: (options: GetDynamicFieldsOptions) => Promise<GetDynamicFieldsResponse>;\n\t\tgetDynamicField: (options: GetDynamicFieldOptions) => Promise<GetDynamicFieldResponse>;\n\t}\n\n\texport interface GetObjectsOptions extends CoreClientMethodOptions {\n\t\tobjectIds: string[];\n\t}\n\n\texport interface GetObjectOptions extends CoreClientMethodOptions {\n\t\tobjectId: string;\n\t}\n\n\texport interface GetOwnedObjectsOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t\ttype?: string;\n\t}\n\n\texport interface GetCoinsOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tcoinType: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t}\n\n\texport interface GetDynamicFieldsOptions extends CoreClientMethodOptions {\n\t\tparentId: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t}\n\n\texport interface GetDynamicFieldOptions extends CoreClientMethodOptions {\n\t\tparentId: string;\n\t\tname: DynamicFieldName;\n\t}\n\n\texport interface GetObjectsResponse {\n\t\tobjects: (ObjectResponse | Error)[];\n\t}\n\n\texport interface GetObjectResponse {\n\t\tobject: ObjectResponse;\n\t}\n\n\texport interface GetOwnedObjectsResponse {\n\t\tobjects: ObjectResponse[];\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t}\n\n\texport interface GetCoinsResponse {\n\t\tobjects: CoinResponse[];\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t}\n\n\texport interface ObjectResponse {\n\t\tid: string;\n\t\tversion: string;\n\t\tdigest: string;\n\t\towner: ObjectOwner;\n\t\ttype: string;\n\t\tcontent: PromiseLike<Uint8Array>;\n\t\tpreviousTransaction: string | null;\n\t}\n\n\texport interface CoinResponse extends ObjectResponse {\n\t\tbalance: string;\n\t}\n\n\texport interface GetDynamicFieldsResponse {\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t\tdynamicFields: {\n\t\t\tid: string;\n\t\t\ttype: string;\n\t\t\tname: DynamicFieldName;\n\t\t}[];\n\t}\n\n\texport interface GetDynamicFieldResponse {\n\t\tdynamicField: {\n\t\t\tname: DynamicFieldName;\n\t\t\tvalue: DynamicFieldValue;\n\t\t\tid: string;\n\t\t\tversion: string;\n\t\t\tdigest: string;\n\t\t\ttype: string;\n\t\t\tpreviousTransaction: string | null;\n\t\t};\n\t}\n\n\texport interface DynamicFieldName {\n\t\ttype: string;\n\t\tbcs: Uint8Array;\n\t}\n\n\texport interface DynamicFieldValue {\n\t\ttype: string;\n\t\tbcs: Uint8Array;\n\t}\n\n\t/** Balance methods */\n\texport interface TransportMethods {\n\t\tgetBalance: (options: GetBalanceOptions) => Promise<GetBalanceResponse>;\n\t\tgetAllBalances: (options: GetAllBalancesOptions) => Promise<GetAllBalancesResponse>;\n\t}\n\n\texport interface GetBalanceOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tcoinType: string;\n\t}\n\n\texport interface CoinBalance {\n\t\tcoinType: string;\n\t\tbalance: string;\n\t}\n\n\texport interface GetBalanceResponse {\n\t\tbalance: CoinBalance;\n\t}\n\n\texport interface GetAllBalancesOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t\tlimit?: number;\n\t\tcursor?: string | null;\n\t}\n\n\texport interface GetAllBalancesResponse {\n\t\tbalances: CoinBalance[];\n\t\thasNextPage: boolean;\n\t\tcursor: string | null;\n\t}\n\n\t/** Transaction methods */\n\texport interface TransportMethods {\n\t\tgetTransaction: (options: GetTransactionOptions) => Promise<GetTransactionResponse>;\n\t\texecuteTransaction: (options: ExecuteTransactionOptions) => Promise<ExecuteTransactionResponse>;\n\t\tdryRunTransaction: (options: DryRunTransactionOptions) => Promise<DryRunTransactionResponse>;\n\t\tresolveTransactionPlugin: () => TransactionPlugin;\n\t}\n\n\texport interface TransactionResponse {\n\t\tdigest: string;\n\t\tsignatures: string[];\n\t\tepoch: string | null;\n\t\teffects: TransactionEffects;\n\t\tobjectTypes: PromiseLike<Record<string, string>>;\n\t\ttransaction: TransactionData;\n\t\tbalanceChanges: BalanceChange[];\n\t\t// TODO: add events\n\t\t// events?: Uint8Array;\n\t}\n\n\texport interface BalanceChange {\n\t\tcoinType: string;\n\t\taddress: string;\n\t\tamount: string;\n\t}\n\n\texport interface TransactionData extends SerializedTransactionDataV2 {\n\t\tbcs: Uint8Array;\n\t}\n\n\texport interface GetTransactionOptions extends CoreClientMethodOptions {\n\t\tdigest: string;\n\t}\n\n\texport interface GetTransactionResponse {\n\t\ttransaction: TransactionResponse;\n\t}\n\n\texport interface ExecuteTransactionOptions extends CoreClientMethodOptions {\n\t\ttransaction: Uint8Array;\n\t\tsignatures: string[];\n\t}\n\n\texport interface DryRunTransactionOptions extends CoreClientMethodOptions {\n\t\ttransaction: Uint8Array;\n\t}\n\n\texport interface DryRunTransactionResponse {\n\t\ttransaction: TransactionResponse;\n\t}\n\n\texport interface ExecuteTransactionResponse {\n\t\ttransaction: TransactionResponse;\n\t}\n\n\texport interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}\n\n\texport interface TransportMethods {\n\t\tgetReferenceGasPrice?: (\n\t\t\toptions?: GetReferenceGasPriceOptions,\n\t\t) => Promise<GetReferenceGasPriceResponse>;\n\t}\n\n\texport interface GetReferenceGasPriceResponse {\n\t\treferenceGasPrice: string;\n\t}\n\n\t/** ZkLogin methods */\n\texport interface VerifyZkLoginSignatureOptions extends CoreClientMethodOptions {\n\t\tbytes: string;\n\t\tsignature: string;\n\t\tintentScope: 'TransactionData' | 'PersonalMessage';\n\t\tauthor: string;\n\t}\n\n\texport interface ZkLoginVerifyResponse {\n\t\tsuccess: boolean;\n\t\terrors: string[];\n\t}\n\n\texport interface TransportMethods {\n\t\tverifyZkLoginSignature: (\n\t\t\toptions: VerifyZkLoginSignatureOptions,\n\t\t) => Promise<ZkLoginVerifyResponse>;\n\t}\n\n\t/** Name service methods */\n\texport interface DefaultNameServiceNameOptions extends CoreClientMethodOptions {\n\t\taddress: string;\n\t}\n\n\texport interface DefaultNameServiceNameResponse {\n\t\tdata: {\n\t\t\tname: string | null;\n\t\t};\n\t}\n\n\texport interface TransportMethods {\n\t\tdefaultNameServiceName: (\n\t\t\toptions: DefaultNameServiceNameOptions,\n\t\t) => Promise<DefaultNameServiceNameResponse>;\n\t}\n\n\t/** MVR methods */\n\n\texport interface TransportMethods {\n\t\tmvr: MvrMethods;\n\t}\n\n\texport interface MvrMethods {\n\t\tresolvePackage: (options: MvrResolvePackageOptions) => Promise<MvrResolvePackageResponse>;\n\t\tresolveType: (options: MvrResolveTypeOptions) => Promise<MvrResolveTypeResponse>;\n\t\tresolve: (options: MvrResolveOptions) => Promise<MvrResolveResponse>;\n\t}\n\n\texport interface MvrResolvePackageOptions extends CoreClientMethodOptions {\n\t\tpackage: string;\n\t}\n\n\texport interface MvrResolveTypeOptions extends CoreClientMethodOptions {\n\t\ttype: string;\n\t}\n\n\texport interface MvrResolveOptions extends CoreClientMethodOptions {\n\t\tpackages?: string[];\n\t\ttypes?: string[];\n\t}\n\n\texport interface MvrResolvePackageResponse {\n\t\tpackage: string;\n\t}\n\n\texport interface MvrResolveTypeResponse {\n\t\ttype: string;\n\t}\n\n\texport interface MvrResolveResponse {\n\t\tpackages: Record<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\tpackage: string;\n\t\t\t}\n\t\t>;\n\t\ttypes: Record<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\ttype: string;\n\t\t\t}\n\t\t>;\n\t}\n\n\t/** Move package methods */\n\n\texport interface TransportMethods {\n\t\tgetMoveFunction: (options: GetMoveFunctionOptions) => Promise<GetMoveFunctionResponse>;\n\t}\n\n\texport interface GetMovePackageOptions extends CoreClientMethodOptions {\n\t\tpackageId: string;\n\t}\n\n\texport interface GetMovePackageResponse {\n\t\tpackage: PackageResponse;\n\t}\n\n\texport interface PackageResponse {\n\t\tstorageId: string;\n\t\toriginalId: string;\n\t\tversion: string;\n\t\tmodules: ModuleResponse[];\n\t}\n\n\texport interface ModuleResponse {\n\t\tname: string;\n\t\tdatatypes: DatatypeResponse[];\n\t\tfunctions: FunctionResponse[];\n\t}\n\n\texport type DatatypeResponse =\n\t\t| {\n\t\t\t\t$kind: 'struct';\n\t\t\t\ttypeName: string;\n\t\t\t\tdefiningId: string;\n\t\t\t\tmoduleName: string;\n\t\t\t\tname: string;\n\t\t\t\tabilities: Ability[];\n\t\t\t\ttypeParameters: TypeParameter[];\n\t\t\t\tfields: FieldDescriptor[];\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'enum';\n\t\t\t\ttypeName: string;\n\t\t\t\tdefiningId: string;\n\t\t\t\tmoduleName: string;\n\t\t\t\tname: string;\n\t\t\t\tabilities: Ability[];\n\t\t\t\ttypeParameters: TypeParameter[];\n\t\t\t\tvariants: VariantDescriptor[];\n\t\t };\n\n\texport type Ability = 'copy' | 'drop' | 'store' | 'key' | 'unknown';\n\texport type DatatypeKind = 'struct' | 'enum' | 'unknown';\n\n\texport interface TypeParameter {\n\t\tconstraints: Ability[];\n\t\tisPhantom: boolean;\n\t}\n\n\texport interface FieldDescriptor {\n\t\tname: string;\n\t\tposition: number;\n\t\ttype: OpenSignatureBody;\n\t}\n\n\texport interface VariantDescriptor {\n\t\tname: string;\n\t\tposition: number;\n\t\tfields: FieldDescriptor[];\n\t}\n\n\texport interface GetMoveFunctionOptions extends CoreClientMethodOptions {\n\t\tpackageId: string;\n\t\tmoduleName: string;\n\t\tname: string;\n\t}\n\n\texport interface GetMoveFunctionResponse {\n\t\tfunction: FunctionResponse;\n\t}\n\n\texport interface GetMoveDatatypeOptions extends CoreClientMethodOptions {\n\t\tpackageId: string;\n\t\tmoduleName: string;\n\t\tname: string;\n\t}\n\n\texport interface GetMoveDatatypeResponse {\n\t\tdatatype: DatatypeResponse;\n\t}\n\n\texport type Visibility = 'public' | 'friend' | 'private' | 'unknown';\n\n\texport interface FunctionResponse {\n\t\tpackageId: string;\n\t\tmoduleName: string;\n\t\tname: string;\n\t\tvisibility: Visibility;\n\t\tisEntry: boolean;\n\t\ttypeParameters: TypeParameter[];\n\t\tparameters: OpenSignature[];\n\t\treturns: OpenSignature[];\n\t}\n\n\texport type ReferenceType = 'mutable' | 'immutable' | 'unknown';\n\texport type OpenSignature = {\n\t\treference: ReferenceType | null;\n\t\tbody: OpenSignatureBody;\n\t};\n\n\texport type OpenSignatureBody =\n\t\t| {\n\t\t\t\t$kind: 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'bool' | 'address' | 'unknown';\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'vector';\n\t\t\t\tvector: OpenSignatureBody;\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'datatype';\n\t\t\t\tdatatype: {\n\t\t\t\t\ttypeName: string;\n\t\t\t\t\ttypeParameters: OpenSignatureBody[];\n\t\t\t\t};\n\t\t }\n\t\t| {\n\t\t\t\t$kind: 'typeParameter';\n\t\t\t\tindex: number;\n\t\t };\n\n\t/** ObjectOwner types */\n\n\texport interface AddressOwner {\n\t\t$kind: 'AddressOwner';\n\t\tAddressOwner: string;\n\t}\n\n\texport interface ParentOwner {\n\t\t$kind: 'ObjectOwner';\n\t\tObjectOwner: string;\n\t}\n\n\texport interface SharedOwner {\n\t\t$kind: 'Shared';\n\t\tShared: {\n\t\t\tinitialSharedVersion: string;\n\t\t};\n\t}\n\n\texport interface ImmutableOwner {\n\t\t$kind: 'Immutable';\n\t\tImmutable: true;\n\t}\n\n\texport interface ConsensusAddressOwner {\n\t\t$kind: 'ConsensusAddressOwner';\n\t\tConsensusAddressOwner: {\n\t\t\towner: string;\n\t\t\tstartVersion: string;\n\t\t};\n\t}\n\n\texport interface UnknownOwner {\n\t\t$kind: 'Unknown';\n\t}\n\n\texport type ObjectOwner =\n\t\t| AddressOwner\n\t\t| ParentOwner\n\t\t| SharedOwner\n\t\t| ImmutableOwner\n\t\t| ConsensusAddressOwner\n\t\t| UnknownOwner;\n\n\t/** Effects */\n\n\texport interface TransactionEffects {\n\t\tbcs: Uint8Array | null;\n\t\tdigest: string;\n\t\tversion: number;\n\t\tstatus: ExecutionStatus;\n\t\tgasUsed: GasCostSummary;\n\t\ttransactionDigest: string;\n\t\tgasObject: ChangedObject | null;\n\t\teventsDigest: string | null;\n\t\tdependencies: string[];\n\t\tlamportVersion: string | null;\n\t\tchangedObjects: ChangedObject[];\n\t\tunchangedConsensusObjects: UnchangedConsensusObject[];\n\t\tauxiliaryDataDigest: string | null;\n\t}\n\n\texport interface ChangedObject {\n\t\tid: string;\n\t\tinputState: 'Unknown' | 'DoesNotExist' | 'Exists';\n\t\tinputVersion: string | null;\n\t\tinputDigest: string | null;\n\t\tinputOwner: ObjectOwner | null;\n\t\toutputState: 'Unknown' | 'DoesNotExist' | 'ObjectWrite' | 'PackageWrite';\n\t\toutputVersion: string | null;\n\t\toutputDigest: string | null;\n\t\toutputOwner: ObjectOwner | null;\n\t\tidOperation: 'Unknown' | 'None' | 'Created' | 'Deleted';\n\t}\n\n\texport interface GasCostSummary {\n\t\tcomputationCost: string;\n\t\tstorageCost: string;\n\t\tstorageRebate: string;\n\t\tnonRefundableStorageFee: string;\n\t}\n\n\texport type ExecutionStatus =\n\t\t| {\n\t\t\t\tsuccess: true;\n\t\t\t\terror: null;\n\t\t }\n\t\t| {\n\t\t\t\tsuccess: false;\n\t\t\t\t// TODO: this should probably be typed better: https://github.com/bmwill/sui/blob/646a2c819346dc140cc649eb9fea368fb14f96e5/crates/sui-rpc-api/proto/sui/rpc/v2beta/execution_status.proto#L22\n\t\t\t\terror: string;\n\t\t };\n\n\texport interface UnchangedConsensusObject {\n\t\tkind:\n\t\t\t| 'Unknown'\n\t\t\t| 'ReadOnlyRoot'\n\t\t\t| 'MutateConsensusStreamEnded'\n\t\t\t| 'ReadConsensusStreamEnded'\n\t\t\t| 'Cancelled'\n\t\t\t| 'PerEpochConfig';\n\t\tobjectId: string;\n\t\tversion: string | null;\n\t\tdigest: string | null;\n\t}\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ export declare class GraphQLCoreClient extends Experimental_CoreClient {
|
|
|
18
18
|
getReferenceGasPrice(): Promise<Experimental_SuiClientTypes.GetReferenceGasPriceResponse>;
|
|
19
19
|
getDynamicFields(options: Experimental_SuiClientTypes.GetDynamicFieldsOptions): Promise<Experimental_SuiClientTypes.GetDynamicFieldsResponse>;
|
|
20
20
|
verifyZkLoginSignature(options: Experimental_SuiClientTypes.VerifyZkLoginSignatureOptions): Promise<Experimental_SuiClientTypes.ZkLoginVerifyResponse>;
|
|
21
|
-
|
|
21
|
+
defaultNameServiceName(options: Experimental_SuiClientTypes.DefaultNameServiceNameOptions): Promise<Experimental_SuiClientTypes.DefaultNameServiceNameResponse>;
|
|
22
22
|
getMoveFunction(options: Experimental_SuiClientTypes.GetMoveFunctionOptions): Promise<Experimental_SuiClientTypes.GetMoveFunctionResponse>;
|
|
23
23
|
resolveTransactionPlugin(): never;
|
|
24
24
|
}
|
package/dist/cjs/graphql/core.js
CHANGED
|
@@ -48,40 +48,38 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
48
48
|
__privateSet(this, _graphqlClient, graphqlClient);
|
|
49
49
|
}
|
|
50
50
|
async getObjects(options) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const objectsPage = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
51
|
+
const batches = (0, import_utils.chunk)(options.objectIds, 50);
|
|
52
|
+
const results = [];
|
|
53
|
+
for (const batch of batches) {
|
|
54
|
+
const page = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
56
55
|
query: import_queries.MultiGetObjectsDocument,
|
|
57
56
|
variables: {
|
|
58
|
-
|
|
59
|
-
cursor
|
|
57
|
+
objectKeys: batch.map((address) => ({ address }))
|
|
60
58
|
}
|
|
61
|
-
}, (result) => result.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
}, (result) => result.multiGetObjects);
|
|
60
|
+
results.push(
|
|
61
|
+
...batch.map((id) => (0, import_sui_types.normalizeSuiAddress)(id)).map(
|
|
62
|
+
(id) => page.find((obj) => obj?.address === id) ?? new import_errors.ObjectError("notFound", `Object ${id} not found`)
|
|
63
|
+
).map((obj) => {
|
|
64
|
+
if (obj instanceof import_errors.ObjectError) {
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
id: obj.address,
|
|
69
|
+
version: obj.version?.toString(),
|
|
70
|
+
digest: obj.digest,
|
|
71
|
+
owner: mapOwner(obj.owner),
|
|
72
|
+
type: obj.asMoveObject?.contents?.type?.repr,
|
|
73
|
+
content: Promise.resolve(
|
|
74
|
+
obj.asMoveObject?.contents?.bcs ? (0, import_utils.fromBase64)(obj.asMoveObject.contents.bcs) : new Uint8Array()
|
|
75
|
+
),
|
|
76
|
+
previousTransaction: obj.previousTransaction?.digest ?? null
|
|
77
|
+
};
|
|
78
|
+
})
|
|
79
|
+
);
|
|
65
80
|
}
|
|
66
81
|
return {
|
|
67
|
-
objects:
|
|
68
|
-
(id) => objects.find((obj) => obj.address === id) ?? new import_errors.ObjectError("notFound", `Object ${id} not found`)
|
|
69
|
-
).map((obj) => {
|
|
70
|
-
if (obj instanceof import_errors.ObjectError) {
|
|
71
|
-
return obj;
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
id: obj.address,
|
|
75
|
-
version: obj.version.toString(),
|
|
76
|
-
digest: obj.digest,
|
|
77
|
-
owner: mapOwner(obj.owner),
|
|
78
|
-
type: obj.asMoveObject?.contents?.type?.repr,
|
|
79
|
-
content: Promise.resolve(
|
|
80
|
-
obj.asMoveObject?.contents?.bcs ? (0, import_utils.fromBase64)(obj.asMoveObject.contents.bcs) : new Uint8Array()
|
|
81
|
-
),
|
|
82
|
-
previousTransaction: obj.previousTransactionBlock?.digest ?? null
|
|
83
|
-
};
|
|
84
|
-
})
|
|
82
|
+
objects: results
|
|
85
83
|
};
|
|
86
84
|
}
|
|
87
85
|
async getOwnedObjects(options) {
|
|
@@ -97,14 +95,14 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
97
95
|
return {
|
|
98
96
|
objects: objects.nodes.map((obj) => ({
|
|
99
97
|
id: obj.address,
|
|
100
|
-
version: obj.version
|
|
98
|
+
version: obj.version?.toString(),
|
|
101
99
|
digest: obj.digest,
|
|
102
100
|
owner: mapOwner(obj.owner),
|
|
103
101
|
type: obj.contents?.type?.repr,
|
|
104
102
|
content: Promise.resolve(
|
|
105
103
|
obj.contents?.bcs ? (0, import_utils.fromBase64)(obj.contents.bcs) : new Uint8Array()
|
|
106
104
|
),
|
|
107
|
-
previousTransaction: obj.
|
|
105
|
+
previousTransaction: obj.previousTransaction?.digest ?? null
|
|
108
106
|
})),
|
|
109
107
|
hasNextPage: objects.pageInfo.hasNextPage,
|
|
110
108
|
cursor: objects.pageInfo.endCursor ?? null
|
|
@@ -117,23 +115,23 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
117
115
|
owner: options.address,
|
|
118
116
|
cursor: options.cursor,
|
|
119
117
|
first: options.limit,
|
|
120
|
-
type: (await this.mvr.resolveType({ type: options.coinType })).type
|
|
118
|
+
type: `0x2::coin::Coin<${(await this.mvr.resolveType({ type: options.coinType })).type}>`
|
|
121
119
|
}
|
|
122
|
-
}, (result) => result.address?.
|
|
120
|
+
}, (result) => result.address?.objects);
|
|
123
121
|
return {
|
|
124
122
|
cursor: coins.pageInfo.endCursor ?? null,
|
|
125
123
|
hasNextPage: coins.pageInfo.hasNextPage,
|
|
126
124
|
objects: coins.nodes.map((coin) => ({
|
|
127
125
|
id: coin.address,
|
|
128
|
-
version: coin.version
|
|
126
|
+
version: coin.version?.toString(),
|
|
129
127
|
digest: coin.digest,
|
|
130
128
|
owner: mapOwner(coin.owner),
|
|
131
129
|
type: coin.contents?.type?.repr,
|
|
132
|
-
balance: coin.
|
|
130
|
+
balance: coin.contents?.json?.balance,
|
|
133
131
|
content: Promise.resolve(
|
|
134
132
|
coin.contents?.bcs ? (0, import_utils.fromBase64)(coin.contents.bcs) : new Uint8Array()
|
|
135
133
|
),
|
|
136
|
-
previousTransaction: coin.
|
|
134
|
+
previousTransaction: coin.previousTransaction?.digest ?? null
|
|
137
135
|
}))
|
|
138
136
|
};
|
|
139
137
|
}
|
|
@@ -147,7 +145,7 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
147
145
|
}, (result2) => result2.address?.balance);
|
|
148
146
|
return {
|
|
149
147
|
balance: {
|
|
150
|
-
coinType: result.coinType
|
|
148
|
+
coinType: result.coinType?.repr,
|
|
151
149
|
balance: result.totalBalance
|
|
152
150
|
}
|
|
153
151
|
};
|
|
@@ -161,7 +159,7 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
161
159
|
cursor: balances.pageInfo.endCursor ?? null,
|
|
162
160
|
hasNextPage: balances.pageInfo.hasNextPage,
|
|
163
161
|
balances: balances.nodes.map((balance) => ({
|
|
164
|
-
coinType: balance.coinType
|
|
162
|
+
coinType: balance.coinType?.repr,
|
|
165
163
|
balance: balance.totalBalance
|
|
166
164
|
}))
|
|
167
165
|
};
|
|
@@ -170,16 +168,19 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
170
168
|
const result = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
171
169
|
query: import_queries.GetTransactionBlockDocument,
|
|
172
170
|
variables: { digest: options.digest }
|
|
173
|
-
}, (result2) => result2.
|
|
171
|
+
}, (result2) => result2.transaction);
|
|
174
172
|
return {
|
|
175
173
|
transaction: parseTransaction(result)
|
|
176
174
|
};
|
|
177
175
|
}
|
|
178
176
|
async executeTransaction(options) {
|
|
179
177
|
const result = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
180
|
-
query: import_queries.
|
|
181
|
-
variables: {
|
|
182
|
-
|
|
178
|
+
query: import_queries.ExecuteTransactionDocument,
|
|
179
|
+
variables: {
|
|
180
|
+
transactionDataBcs: (0, import_utils.toBase64)(options.transaction),
|
|
181
|
+
signatures: options.signatures
|
|
182
|
+
}
|
|
183
|
+
}, (result2) => result2.executeTransaction);
|
|
183
184
|
if (result.errors) {
|
|
184
185
|
if (result.errors.length === 1) {
|
|
185
186
|
throw new Error(result.errors[0]);
|
|
@@ -187,19 +188,25 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
187
188
|
throw new AggregateError(result.errors.map((error) => new Error(error)));
|
|
188
189
|
}
|
|
189
190
|
return {
|
|
190
|
-
transaction: parseTransaction(result.effects
|
|
191
|
+
transaction: parseTransaction(result.effects?.transaction)
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
194
|
async dryRunTransaction(options) {
|
|
194
195
|
const result = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
195
|
-
query: import_queries.
|
|
196
|
-
variables: {
|
|
197
|
-
|
|
196
|
+
query: import_queries.SimulateTransactionDocument,
|
|
197
|
+
variables: {
|
|
198
|
+
transaction: {
|
|
199
|
+
bcs: {
|
|
200
|
+
value: (0, import_utils.toBase64)(options.transaction)
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}, (result2) => result2.simulateTransaction);
|
|
198
205
|
if (result.error) {
|
|
199
206
|
throw new Error(result.error);
|
|
200
207
|
}
|
|
201
208
|
return {
|
|
202
|
-
transaction: parseTransaction(result.transaction)
|
|
209
|
+
transaction: parseTransaction(result.effects?.transaction)
|
|
203
210
|
};
|
|
204
211
|
}
|
|
205
212
|
async getReferenceGasPrice() {
|
|
@@ -214,21 +221,21 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
214
221
|
const result = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
215
222
|
query: import_queries.GetDynamicFieldsDocument,
|
|
216
223
|
variables: { parentId: options.parentId }
|
|
217
|
-
}, (result2) => result2.
|
|
224
|
+
}, (result2) => result2.address?.dynamicFields);
|
|
218
225
|
return {
|
|
219
226
|
dynamicFields: result.nodes.map((dynamicField) => {
|
|
220
|
-
const valueType = dynamicField.value?.__typename === "MoveObject" ? dynamicField.value.contents?.type?.repr : dynamicField.value?.type
|
|
227
|
+
const valueType = dynamicField.value?.__typename === "MoveObject" ? dynamicField.value.contents?.type?.repr : dynamicField.value?.type?.repr;
|
|
221
228
|
return {
|
|
222
229
|
id: (0, import_dynamic_fields.deriveDynamicFieldID)(
|
|
223
230
|
options.parentId,
|
|
224
|
-
dynamicField.name?.type
|
|
231
|
+
dynamicField.name?.type?.repr,
|
|
225
232
|
(0, import_utils.fromBase64)(dynamicField.name?.bcs)
|
|
226
233
|
),
|
|
227
234
|
type: (0, import_sui_types.normalizeStructTag)(
|
|
228
|
-
dynamicField.value?.__typename === "MoveObject" ? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type
|
|
235
|
+
dynamicField.value?.__typename === "MoveObject" ? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>,0x2::object::ID>` : `0x2::dynamic_field::Field<${dynamicField.name?.type?.repr},${valueType}>`
|
|
229
236
|
),
|
|
230
237
|
name: {
|
|
231
|
-
type: dynamicField.name?.type
|
|
238
|
+
type: dynamicField.name?.type?.repr,
|
|
232
239
|
bcs: (0, import_utils.fromBase64)(dynamicField.name?.bcs)
|
|
233
240
|
},
|
|
234
241
|
valueType
|
|
@@ -248,26 +255,22 @@ class GraphQLCoreClient extends import_core.Experimental_CoreClient {
|
|
|
248
255
|
intentScope,
|
|
249
256
|
author: options.author
|
|
250
257
|
}
|
|
251
|
-
}, (result2) => result2.
|
|
258
|
+
}, (result2) => result2.verifyZkLoginSignature);
|
|
252
259
|
return {
|
|
253
|
-
success: result.success,
|
|
254
|
-
errors: result.
|
|
260
|
+
success: result.success ?? false,
|
|
261
|
+
errors: result.error ? [result.error] : []
|
|
255
262
|
};
|
|
256
263
|
}
|
|
257
|
-
async
|
|
258
|
-
const
|
|
259
|
-
query: import_queries.
|
|
264
|
+
async defaultNameServiceName(options) {
|
|
265
|
+
const name = await __privateMethod(this, _GraphQLCoreClient_instances, graphqlQuery_fn).call(this, {
|
|
266
|
+
query: import_queries.DefaultSuinsNameDocument,
|
|
260
267
|
signal: options.signal,
|
|
261
268
|
variables: {
|
|
262
|
-
address: options.address
|
|
263
|
-
cursor: options.cursor,
|
|
264
|
-
limit: options.limit
|
|
269
|
+
address: options.address
|
|
265
270
|
}
|
|
266
|
-
}, (result) => result.address?.
|
|
271
|
+
}, (result) => result.address?.defaultSuinsName ?? null);
|
|
267
272
|
return {
|
|
268
|
-
|
|
269
|
-
nextCursor: suinsRegistrations.pageInfo.endCursor ?? null,
|
|
270
|
-
data: suinsRegistrations.nodes.map((node) => node.domain) ?? []
|
|
273
|
+
data: { name }
|
|
271
274
|
};
|
|
272
275
|
}
|
|
273
276
|
async getMoveFunction(options) {
|
|
@@ -352,19 +355,19 @@ class GraphQLResponseError extends Error {
|
|
|
352
355
|
function mapOwner(owner) {
|
|
353
356
|
switch (owner.__typename) {
|
|
354
357
|
case "AddressOwner":
|
|
355
|
-
return { $kind: "AddressOwner", AddressOwner: owner.
|
|
358
|
+
return { $kind: "AddressOwner", AddressOwner: owner.address?.address };
|
|
356
359
|
case "ConsensusAddressOwner":
|
|
357
360
|
return {
|
|
358
361
|
$kind: "ConsensusAddressOwner",
|
|
359
362
|
ConsensusAddressOwner: {
|
|
360
|
-
owner: owner
|
|
363
|
+
owner: owner?.address?.address,
|
|
361
364
|
startVersion: String(owner.startVersion)
|
|
362
365
|
}
|
|
363
366
|
};
|
|
367
|
+
case "ObjectOwner":
|
|
368
|
+
return { $kind: "ObjectOwner", ObjectOwner: owner.address?.address };
|
|
364
369
|
case "Immutable":
|
|
365
370
|
return { $kind: "Immutable", Immutable: true };
|
|
366
|
-
case "Parent":
|
|
367
|
-
return { $kind: "ObjectOwner", ObjectOwner: owner.parent?.address };
|
|
368
371
|
case "Shared":
|
|
369
372
|
return {
|
|
370
373
|
$kind: "Shared",
|
|
@@ -374,33 +377,33 @@ function mapOwner(owner) {
|
|
|
374
377
|
}
|
|
375
378
|
function parseTransaction(transaction) {
|
|
376
379
|
const objectTypes = {};
|
|
377
|
-
transaction.effects?.unchangedConsensusObjects
|
|
380
|
+
transaction.effects?.unchangedConsensusObjects?.nodes.forEach((node) => {
|
|
378
381
|
if (node.__typename === "ConsensusObjectRead") {
|
|
379
|
-
const type = node.object?.asMoveObject?.contents?.type
|
|
382
|
+
const type = node.object?.asMoveObject?.contents?.type?.repr;
|
|
380
383
|
const address = node.object?.asMoveObject?.address;
|
|
381
384
|
if (type && address) {
|
|
382
385
|
objectTypes[address] = type;
|
|
383
386
|
}
|
|
384
387
|
}
|
|
385
388
|
});
|
|
386
|
-
transaction.effects?.objectChanges
|
|
389
|
+
transaction.effects?.objectChanges?.nodes.forEach((node) => {
|
|
387
390
|
const address = node.address;
|
|
388
|
-
const type = node.inputState?.asMoveObject?.contents?.type
|
|
391
|
+
const type = node.inputState?.asMoveObject?.contents?.type?.repr ?? node.outputState?.asMoveObject?.contents?.type?.repr;
|
|
389
392
|
if (address && type) {
|
|
390
393
|
objectTypes[address] = type;
|
|
391
394
|
}
|
|
392
395
|
});
|
|
393
|
-
if (transaction.effects?.balanceChanges
|
|
396
|
+
if (transaction.effects?.balanceChanges?.pageInfo.hasNextPage) {
|
|
394
397
|
throw new Error("Pagination for balance changes is not supported");
|
|
395
398
|
}
|
|
396
399
|
return {
|
|
397
400
|
digest: transaction.digest,
|
|
398
|
-
effects: (0, import_utils2.parseTransactionEffectsBcs)((0, import_utils.fromBase64)(transaction.effects?.
|
|
401
|
+
effects: (0, import_utils2.parseTransactionEffectsBcs)((0, import_utils.fromBase64)(transaction.effects?.effectsBcs)),
|
|
399
402
|
epoch: transaction.effects?.epoch?.epochId?.toString() ?? null,
|
|
400
403
|
objectTypes: Promise.resolve(objectTypes),
|
|
401
|
-
transaction: (0, import_utils2.parseTransactionBcs)((0, import_utils.fromBase64)(transaction.
|
|
402
|
-
signatures: transaction.signatures,
|
|
403
|
-
balanceChanges: transaction.effects?.balanceChanges
|
|
404
|
+
transaction: (0, import_utils2.parseTransactionBcs)((0, import_utils.fromBase64)(transaction.transactionBcs)),
|
|
405
|
+
signatures: transaction.signatures.map((sig) => sig.signatureBytes),
|
|
406
|
+
balanceChanges: transaction.effects?.balanceChanges?.nodes.map((change) => ({
|
|
404
407
|
coinType: change?.coinType?.repr,
|
|
405
408
|
address: change.owner?.address,
|
|
406
409
|
amount: change.amount
|