@mysten/sui 2.20.2 → 2.20.4
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 +21 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +20 -20
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs +4 -1
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/mvr.d.mts.map +1 -1
- package/dist/client/mvr.mjs +29 -7
- package/dist/client/mvr.mjs.map +1 -1
- package/dist/client/transaction-resolver.mjs +1 -0
- package/dist/client/transaction-resolver.mjs.map +1 -1
- package/dist/cryptography/signature.d.mts +8 -8
- package/dist/graphql/core.mjs +3 -1
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/generated/queries.d.mts.map +1 -1
- package/dist/graphql/generated/queries.mjs +6 -2
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +1 -1
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts +4 -4
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +45 -27
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/jsonRpc/client.d.mts +160 -0
- package/dist/jsonRpc/client.d.mts.map +1 -1
- package/dist/jsonRpc/client.mjs +142 -0
- package/dist/jsonRpc/client.mjs.map +1 -1
- package/dist/jsonRpc/core.d.mts +80 -0
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +80 -0
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/jsonRpc/errors.d.mts +12 -0
- package/dist/jsonRpc/errors.d.mts.map +1 -1
- package/dist/jsonRpc/errors.mjs +12 -0
- package/dist/jsonRpc/errors.mjs.map +1 -1
- package/dist/jsonRpc/http-transport.d.mts +30 -0
- package/dist/jsonRpc/http-transport.d.mts.map +1 -1
- package/dist/jsonRpc/http-transport.mjs +16 -0
- package/dist/jsonRpc/http-transport.mjs.map +1 -1
- package/dist/jsonRpc/network.d.mts +4 -0
- package/dist/jsonRpc/network.d.mts.map +1 -1
- package/dist/jsonRpc/network.mjs +4 -0
- package/dist/jsonRpc/network.mjs.map +1 -1
- package/dist/jsonRpc/types/chain.d.mts +68 -0
- package/dist/jsonRpc/types/chain.d.mts.map +1 -1
- package/dist/jsonRpc/types/changes.d.mts +24 -0
- package/dist/jsonRpc/types/changes.d.mts.map +1 -1
- package/dist/jsonRpc/types/coins.d.mts +4 -0
- package/dist/jsonRpc/types/coins.d.mts.map +1 -1
- package/dist/jsonRpc/types/common.d.mts +4 -0
- package/dist/jsonRpc/types/common.d.mts.map +1 -1
- package/dist/jsonRpc/types/generated.d.mts +497 -16
- package/dist/jsonRpc/types/generated.d.mts.map +1 -1
- package/dist/jsonRpc/types/params.d.mts +289 -41
- package/dist/jsonRpc/types/params.d.mts.map +1 -1
- package/dist/transactions/Transaction.d.mts +9 -9
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/transactions/data/v1.d.mts +220 -220
- package/dist/transactions/data/v1.d.mts.map +1 -1
- package/dist/transactions/data/v2.d.mts +16 -16
- package/dist/transactions/data/v2.d.mts.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +3 -3
- package/src/client/core.ts +1 -0
- package/src/client/mvr.ts +39 -6
- package/src/client/transaction-resolver.ts +1 -0
- package/src/graphql/core.ts +2 -0
- package/src/graphql/generated/queries.ts +211 -4923
- package/src/graphql/queries/transactions.graphql +10 -2
- package/src/grpc/client.ts +10 -7
- package/src/grpc/core.ts +204 -134
- package/src/jsonRpc/client.ts +160 -0
- package/src/jsonRpc/core.ts +80 -0
- package/src/jsonRpc/errors.ts +12 -0
- package/src/jsonRpc/http-transport.ts +30 -0
- package/src/jsonRpc/network.ts +4 -0
- package/src/jsonRpc/types/chain.ts +68 -0
- package/src/jsonRpc/types/changes.ts +24 -0
- package/src/jsonRpc/types/coins.ts +4 -0
- package/src/jsonRpc/types/common.ts +4 -0
- package/src/jsonRpc/types/generated.ts +497 -16
- package/src/jsonRpc/types/params.ts +289 -41
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/grpc/client.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAsBU,uBAAA,SAAgC,cAAA;EACzC,SAAA;AAAA;AAAA,KAGW,oBAAA;EACX,OAAA,EAAS,cAAA,CAAe,OAAA;EACxB,GAAA,GAAM,cAAA,CAAe,UAAA;AAAA;EAGnB,SAAA,EAAW,YAAA;AAAA,IAEX,uBAAA;AAAA,cAGG,gBAAA;AAAA,iBAEU,eAAA,CAAgB,MAAA,YAAkB,MAAA,IAAU,aAAA;AAAA,UAM3C,mBAAA;EAChB,KAAA;AAAA;AAAA,KAGW,0BAAA,iBAA2C,mBAAA,SACtD,cAAA,CAAe,iBAAA;EACd,KAAA,EAAO,OAAA;IAAkB,KAAA;EAAA,IAAgB,cAAA,CAAe,iBAAA;AAAA;AAAA,UAGzC,kCAAA,iBAAmD,mBAAA;EACnE,WAAA;EACA,MAAA;EACA,aAAA,EAAe,0BAAA,CAA2B,OAAA;AAAA;AAAA,cAG9B,aAAA,SAAsB,UAAA,YAAsB,cAAA,CAAe,gBAAA;EAAA,CAclE,gBAAA;EAbL,IAAA,EAAM,cAAA;EAAA,IACF,GAAA,CAAA,GAAO,cAAA,CAAe,UAAA;EAG1B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AA,CAAe,sBAAA,GACpB,OAAA,CAAQ,cAAA,CAAe,uBAAA;EAI1B,wBAAA,CAAA,GAA4B,iBAAA;EAI5B,sBAAA,CACC,KAAA,EAAO,cAAA,CAAe,6BAAA,GACpB,OAAA,CAAQ,cAAA,CAAe,qBAAA;EAI1B,sBAAA,CACC,KAAA,EAAO,cAAA,CAAe,6BAAA,GACpB,OAAA,CAAQ,cAAA,CAAe,8BAAA;AAAA"}
|
package/dist/grpc/client.mjs
CHANGED
|
@@ -100,7 +100,7 @@ var SuiGrpcClient = class extends BaseClient {
|
|
|
100
100
|
pageToken: input.cursor ? fromBase64(input.cursor) : void 0,
|
|
101
101
|
pageSize: input.limit,
|
|
102
102
|
readMask: { paths }
|
|
103
|
-
});
|
|
103
|
+
}, { abort: input.signal });
|
|
104
104
|
return {
|
|
105
105
|
dynamicFields: response.response.dynamicFields.map((field) => {
|
|
106
106
|
const isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;
|
package/dist/grpc/client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","names":[],"sources":["../../src/grpc/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { GrpcWebOptions } from '@protobuf-ts/grpcweb-transport';\nimport { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport';\nimport { TransactionExecutionServiceClient } from './proto/sui/rpc/v2/transaction_execution_service.client.js';\nimport { LedgerServiceClient } from './proto/sui/rpc/v2/ledger_service.client.js';\nimport { MovePackageServiceClient } from './proto/sui/rpc/v2/move_package_service.client.js';\nimport { SignatureVerificationServiceClient } from './proto/sui/rpc/v2/signature_verification_service.client.js';\nimport type { RpcTransport } from '@protobuf-ts/runtime-rpc';\nimport { StateServiceClient } from './proto/sui/rpc/v2/state_service.client.js';\nimport { SubscriptionServiceClient } from './proto/sui/rpc/v2/subscription_service.client.js';\nimport { GrpcCoreClient } from './core.js';\nimport type { SuiClientTypes } from '../client/index.js';\nimport { BaseClient } from '../client/index.js';\nimport { DynamicField_DynamicFieldKind } from './proto/sui/rpc/v2/state_service.js';\nimport { normalizeStructTag } from '../utils/sui-types.js';\nimport { fromBase64, toBase64 } from '@mysten/utils';\nimport { NameServiceClient } from './proto/sui/rpc/v2/name_service.client.js';\nimport { ForkingServiceClient } from './proto/sui/forking/v1alpha/forking_service.client.js';\nimport type { TransactionPlugin } from '../transactions/index.js';\n\ninterface SuiGrpcTransportOptions extends GrpcWebOptions {\n\ttransport?: never;\n}\n\nexport type SuiGrpcClientOptions = {\n\tnetwork: SuiClientTypes.Network;\n\tmvr?: SuiClientTypes.MvrOptions;\n} & (\n\t| {\n\t\t\ttransport: RpcTransport;\n\t }\n\t| SuiGrpcTransportOptions\n);\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiGrpcClient') as never;\n\nexport function isSuiGrpcClient(client: unknown): client is SuiGrpcClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport interface DynamicFieldInclude {\n\tvalue?: boolean;\n}\n\nexport type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> =\n\tSuiClientTypes.DynamicFieldEntry & {\n\t\tvalue: Include extends { value: true } ? SuiClientTypes.DynamicFieldValue : undefined;\n\t};\n\nexport interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {\n\thasNextPage: boolean;\n\tcursor: string | null;\n\tdynamicFields: DynamicFieldEntryWithValue<Include>[];\n}\n\nexport class SuiGrpcClient extends BaseClient implements SuiClientTypes.TransportMethods {\n\tcore: GrpcCoreClient;\n\tget mvr(): SuiClientTypes.MvrMethods {\n\t\treturn this.core.mvr;\n\t}\n\ttransactionExecutionService: TransactionExecutionServiceClient;\n\tledgerService: LedgerServiceClient;\n\tstateService: StateServiceClient;\n\tsubscriptionService: SubscriptionServiceClient;\n\tmovePackageService: MovePackageServiceClient;\n\tsignatureVerificationService: SignatureVerificationServiceClient;\n\tnameService: NameServiceClient;\n\tforkingService: ForkingServiceClient;\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\tconstructor(options: SuiGrpcClientOptions) {\n\t\tsuper({ network: options.network });\n\t\tconst transport =\n\t\t\toptions.transport ??\n\t\t\tnew GrpcWebFetchTransport({ baseUrl: options.baseUrl, fetchInit: options.fetchInit });\n\t\tthis.transactionExecutionService = new TransactionExecutionServiceClient(transport);\n\t\tthis.ledgerService = new LedgerServiceClient(transport);\n\t\tthis.stateService = new StateServiceClient(transport);\n\t\tthis.subscriptionService = new SubscriptionServiceClient(transport);\n\t\tthis.movePackageService = new MovePackageServiceClient(transport);\n\t\tthis.signatureVerificationService = new SignatureVerificationServiceClient(transport);\n\t\tthis.nameService = new NameServiceClient(transport);\n\t\tthis.forkingService = new ForkingServiceClient(transport);\n\n\t\tthis.core = new GrpcCoreClient({\n\t\t\tclient: this,\n\t\t\tbase: this,\n\t\t\tnetwork: options.network,\n\t\t\tmvr: options.mvr,\n\t\t});\n\t}\n\n\tgetObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectsResponse<Include>> {\n\t\treturn this.core.getObjects(input);\n\t}\n\n\tgetObject<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectResponse<Include>> {\n\t\treturn this.core.getObject(input);\n\t}\n\n\tlistCoins(input: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse> {\n\t\treturn this.core.listCoins(input);\n\t}\n\n\tlistOwnedObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.ListOwnedObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.ListOwnedObjectsResponse<Include>> {\n\t\treturn this.core.listOwnedObjects(input);\n\t}\n\n\tgetBalance(input: SuiClientTypes.GetBalanceOptions): Promise<SuiClientTypes.GetBalanceResponse> {\n\t\treturn this.core.getBalance(input);\n\t}\n\n\tlistBalances(\n\t\tinput: SuiClientTypes.ListBalancesOptions,\n\t): Promise<SuiClientTypes.ListBalancesResponse> {\n\t\treturn this.core.listBalances(input);\n\t}\n\n\tgetCoinMetadata(\n\t\tinput: SuiClientTypes.GetCoinMetadataOptions,\n\t): Promise<SuiClientTypes.GetCoinMetadataResponse> {\n\t\treturn this.core.getCoinMetadata(input);\n\t}\n\n\tgetTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.GetTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.getTransaction(input);\n\t}\n\n\texecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.ExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.executeTransaction(input);\n\t}\n\n\tsignAndExecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SignAndExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.signAndExecuteTransaction(input);\n\t}\n\n\twaitForTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.WaitForTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.waitForTransaction(input);\n\t}\n\n\tsimulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SimulateTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {\n\t\treturn this.core.simulateTransaction(input);\n\t}\n\n\tgetReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {\n\t\treturn this.core.getReferenceGasPrice();\n\t}\n\n\tasync listDynamicFields<Include extends DynamicFieldInclude = {}>(\n\t\tinput: SuiClientTypes.ListDynamicFieldsOptions & { include?: Include & DynamicFieldInclude },\n\t): Promise<ListDynamicFieldsWithValueResponse<Include>> {\n\t\tconst includeValue = input.include?.value ?? false;\n\t\tconst paths = ['field_id', 'name', 'value_type', 'kind', 'child_id'];\n\t\tif (includeValue) {\n\t\t\tpaths.push('value');\n\t\t}\n\n\t\tconst response = await this.stateService.listDynamicFields({\n\t\t\tparent: input.parentId,\n\t\t\tpageToken: input.cursor ? fromBase64(input.cursor) : undefined,\n\t\t\tpageSize: input.limit,\n\t\t\treadMask: {\n\t\t\t\tpaths,\n\t\t\t},\n\t\t});\n\n\t\treturn {\n\t\t\tdynamicFields: response.response.dynamicFields.map(\n\t\t\t\t(field): DynamicFieldEntryWithValue<Include> => {\n\t\t\t\t\tconst isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;\n\t\t\t\t\tconst fieldType = isDynamicObject\n\t\t\t\t\t\t? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${field.name?.name!}>,0x2::object::ID>`\n\t\t\t\t\t\t: `0x2::dynamic_field::Field<${field.name?.name!},${field.valueType!}>`;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',\n\t\t\t\t\t\tfieldId: field.fieldId!,\n\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\ttype: field.name?.name!,\n\t\t\t\t\t\t\tbcs: field.name?.value!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvalueType: field.valueType!,\n\t\t\t\t\t\ttype: normalizeStructTag(fieldType),\n\t\t\t\t\t\tchildId: field.childId,\n\t\t\t\t\t\tvalue: (includeValue\n\t\t\t\t\t\t\t? { type: field.valueType!, bcs: field.value?.value ?? new Uint8Array() }\n\t\t\t\t\t\t\t: undefined) as DynamicFieldEntryWithValue<Include>['value'],\n\t\t\t\t\t} as DynamicFieldEntryWithValue<Include>;\n\t\t\t\t},\n\t\t\t),\n\t\t\tcursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null,\n\t\t\thasNextPage: response.response.nextPageToken !== undefined,\n\t\t};\n\t}\n\n\tgetDynamicField(\n\t\tinput: SuiClientTypes.GetDynamicFieldOptions,\n\t): Promise<SuiClientTypes.GetDynamicFieldResponse> {\n\t\treturn this.core.getDynamicField(input);\n\t}\n\n\tgetMoveFunction(\n\t\tinput: SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<SuiClientTypes.GetMoveFunctionResponse> {\n\t\treturn this.core.getMoveFunction(input);\n\t}\n\n\tresolveTransactionPlugin(): TransactionPlugin {\n\t\treturn this.core.resolveTransactionPlugin();\n\t}\n\n\tverifyZkLoginSignature(\n\t\tinput: SuiClientTypes.VerifyZkLoginSignatureOptions,\n\t): Promise<SuiClientTypes.ZkLoginVerifyResponse> {\n\t\treturn this.core.verifyZkLoginSignature(input);\n\t}\n\n\tdefaultNameServiceName(\n\t\tinput: SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {\n\t\treturn this.core.defaultNameServiceName(input);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAM,mBAAmB,OAAO,IAAI,wBAAwB;AAE5D,SAAgB,gBAAgB,QAA0C;AACzE,QACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAAe,sBAAsB;;AAmBzF,IAAa,gBAAb,cAAmC,WAAsD;CAExF,IAAI,MAAiC;AACpC,SAAO,KAAK,KAAK;;CAWlB,KAAK,oBAAoB;AACxB,SAAO;;CAGR,YAAY,SAA+B;AAC1C,QAAM,EAAE,SAAS,QAAQ,SAAS,CAAC;EACnC,MAAM,YACL,QAAQ,aACR,IAAI,sBAAsB;GAAE,SAAS,QAAQ;GAAS,WAAW,QAAQ;GAAW,CAAC;AACtF,OAAK,8BAA8B,IAAI,kCAAkC,UAAU;AACnF,OAAK,gBA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Q;GAAW;AACpE,MAAI,aACH,OAAM,KAAK,QAAQ;EAGpB,MAAM,WAAW,MAAM,KAAK,aAAa,kBAAkB;GAC1D,QAAQ,MAAM;GACd,WAAW,MAAM,SAAS,WAAW,MAAM,OAAO,GAAG;GACrD,UAAU,MAAM;GAChB,UAAU,EACT,OACA;GACD,CAAC;AAEF,SAAO;GACN,eAAe,SAAS,SAAS,cAAc,KAC7C,UAA+C;IAC/C,MAAM,kBAAkB,MAAM,SAAS,8BAA8B;IACrE,MAAM,YAAY,kBACf,gEAAgE,MAAM,MAAM,KAAM,sBAClF,6BAA6B,MAAM,MAAM,KAAM,GAAG,MAAM,UAAW;AACtE,WAAO;KACN,OAAO,kBAAkB,kBAAkB;KAC3C,SAAS,MAAM;KACf,MAAM;MACL,MAAM,MAAM,MAAM;MAClB,KAAK,MAAM,MAAM;MACjB;KACD,WAAW,MAAM;KACjB,MAAM,mBAAmB,UAAU;KACnC,SAAS,MAAM;KACf,OAAQ,eACL;MAAE,MAAM,MAAM;MAAY,KAAK,MAAM,OAAO,SAAS,IAAI,YAAY;MAAE,GACvE;KACH;KAEF;GACD,QAAQ,SAAS,SAAS,gBAAgB,SAAS,SAAS,SAAS,cAAc,GAAG;GACtF,aAAa,SAAS,SAAS,kBAAkB;GACjD;;CAGF,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,2BAA8C;AAC7C,SAAO,KAAK,KAAK,0BAA0B;;CAG5C,uBACC,OACgD;AAChD,SAAO,KAAK,KAAK,uBAAuB,MAAM;;CAG/C,uBACC,OACyD;AACzD,SAAO,KAAK,KAAK,uBAAuB,MAAM"}
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../../src/grpc/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { GrpcWebOptions } from '@protobuf-ts/grpcweb-transport';\nimport { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport';\nimport { TransactionExecutionServiceClient } from './proto/sui/rpc/v2/transaction_execution_service.client.js';\nimport { LedgerServiceClient } from './proto/sui/rpc/v2/ledger_service.client.js';\nimport { MovePackageServiceClient } from './proto/sui/rpc/v2/move_package_service.client.js';\nimport { SignatureVerificationServiceClient } from './proto/sui/rpc/v2/signature_verification_service.client.js';\nimport type { RpcTransport } from '@protobuf-ts/runtime-rpc';\nimport { StateServiceClient } from './proto/sui/rpc/v2/state_service.client.js';\nimport { SubscriptionServiceClient } from './proto/sui/rpc/v2/subscription_service.client.js';\nimport { GrpcCoreClient } from './core.js';\nimport type { SuiClientTypes } from '../client/index.js';\nimport { BaseClient } from '../client/index.js';\nimport { DynamicField_DynamicFieldKind } from './proto/sui/rpc/v2/state_service.js';\nimport { normalizeStructTag } from '../utils/sui-types.js';\nimport { fromBase64, toBase64 } from '@mysten/utils';\nimport { NameServiceClient } from './proto/sui/rpc/v2/name_service.client.js';\nimport { ForkingServiceClient } from './proto/sui/forking/v1alpha/forking_service.client.js';\nimport type { TransactionPlugin } from '../transactions/index.js';\n\ninterface SuiGrpcTransportOptions extends GrpcWebOptions {\n\ttransport?: never;\n}\n\nexport type SuiGrpcClientOptions = {\n\tnetwork: SuiClientTypes.Network;\n\tmvr?: SuiClientTypes.MvrOptions;\n} & (\n\t| {\n\t\t\ttransport: RpcTransport;\n\t }\n\t| SuiGrpcTransportOptions\n);\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiGrpcClient') as never;\n\nexport function isSuiGrpcClient(client: unknown): client is SuiGrpcClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport interface DynamicFieldInclude {\n\tvalue?: boolean;\n}\n\nexport type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> =\n\tSuiClientTypes.DynamicFieldEntry & {\n\t\tvalue: Include extends { value: true } ? SuiClientTypes.DynamicFieldValue : undefined;\n\t};\n\nexport interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {\n\thasNextPage: boolean;\n\tcursor: string | null;\n\tdynamicFields: DynamicFieldEntryWithValue<Include>[];\n}\n\nexport class SuiGrpcClient extends BaseClient implements SuiClientTypes.TransportMethods {\n\tcore: GrpcCoreClient;\n\tget mvr(): SuiClientTypes.MvrMethods {\n\t\treturn this.core.mvr;\n\t}\n\ttransactionExecutionService: TransactionExecutionServiceClient;\n\tledgerService: LedgerServiceClient;\n\tstateService: StateServiceClient;\n\tsubscriptionService: SubscriptionServiceClient;\n\tmovePackageService: MovePackageServiceClient;\n\tsignatureVerificationService: SignatureVerificationServiceClient;\n\tnameService: NameServiceClient;\n\tforkingService: ForkingServiceClient;\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\tconstructor(options: SuiGrpcClientOptions) {\n\t\tsuper({ network: options.network });\n\t\tconst transport =\n\t\t\toptions.transport ??\n\t\t\tnew GrpcWebFetchTransport({ baseUrl: options.baseUrl, fetchInit: options.fetchInit });\n\t\tthis.transactionExecutionService = new TransactionExecutionServiceClient(transport);\n\t\tthis.ledgerService = new LedgerServiceClient(transport);\n\t\tthis.stateService = new StateServiceClient(transport);\n\t\tthis.subscriptionService = new SubscriptionServiceClient(transport);\n\t\tthis.movePackageService = new MovePackageServiceClient(transport);\n\t\tthis.signatureVerificationService = new SignatureVerificationServiceClient(transport);\n\t\tthis.nameService = new NameServiceClient(transport);\n\t\tthis.forkingService = new ForkingServiceClient(transport);\n\n\t\tthis.core = new GrpcCoreClient({\n\t\t\tclient: this,\n\t\t\tbase: this,\n\t\t\tnetwork: options.network,\n\t\t\tmvr: options.mvr,\n\t\t});\n\t}\n\n\tgetObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectsResponse<Include>> {\n\t\treturn this.core.getObjects(input);\n\t}\n\n\tgetObject<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectResponse<Include>> {\n\t\treturn this.core.getObject(input);\n\t}\n\n\tlistCoins(input: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse> {\n\t\treturn this.core.listCoins(input);\n\t}\n\n\tlistOwnedObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.ListOwnedObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.ListOwnedObjectsResponse<Include>> {\n\t\treturn this.core.listOwnedObjects(input);\n\t}\n\n\tgetBalance(input: SuiClientTypes.GetBalanceOptions): Promise<SuiClientTypes.GetBalanceResponse> {\n\t\treturn this.core.getBalance(input);\n\t}\n\n\tlistBalances(\n\t\tinput: SuiClientTypes.ListBalancesOptions,\n\t): Promise<SuiClientTypes.ListBalancesResponse> {\n\t\treturn this.core.listBalances(input);\n\t}\n\n\tgetCoinMetadata(\n\t\tinput: SuiClientTypes.GetCoinMetadataOptions,\n\t): Promise<SuiClientTypes.GetCoinMetadataResponse> {\n\t\treturn this.core.getCoinMetadata(input);\n\t}\n\n\tgetTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.GetTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.getTransaction(input);\n\t}\n\n\texecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.ExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.executeTransaction(input);\n\t}\n\n\tsignAndExecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SignAndExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.signAndExecuteTransaction(input);\n\t}\n\n\twaitForTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.WaitForTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.waitForTransaction(input);\n\t}\n\n\tsimulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SimulateTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {\n\t\treturn this.core.simulateTransaction(input);\n\t}\n\n\tgetReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {\n\t\treturn this.core.getReferenceGasPrice();\n\t}\n\n\tasync listDynamicFields<Include extends DynamicFieldInclude = {}>(\n\t\tinput: SuiClientTypes.ListDynamicFieldsOptions & { include?: Include & DynamicFieldInclude },\n\t): Promise<ListDynamicFieldsWithValueResponse<Include>> {\n\t\tconst includeValue = input.include?.value ?? false;\n\t\tconst paths = ['field_id', 'name', 'value_type', 'kind', 'child_id'];\n\t\tif (includeValue) {\n\t\t\tpaths.push('value');\n\t\t}\n\n\t\tconst response = await this.stateService.listDynamicFields(\n\t\t\t{\n\t\t\t\tparent: input.parentId,\n\t\t\t\tpageToken: input.cursor ? fromBase64(input.cursor) : undefined,\n\t\t\t\tpageSize: input.limit,\n\t\t\t\treadMask: {\n\t\t\t\t\tpaths,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{ abort: input.signal },\n\t\t);\n\n\t\treturn {\n\t\t\tdynamicFields: response.response.dynamicFields.map(\n\t\t\t\t(field): DynamicFieldEntryWithValue<Include> => {\n\t\t\t\t\tconst isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;\n\t\t\t\t\tconst fieldType = isDynamicObject\n\t\t\t\t\t\t? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${field.name?.name!}>,0x2::object::ID>`\n\t\t\t\t\t\t: `0x2::dynamic_field::Field<${field.name?.name!},${field.valueType!}>`;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',\n\t\t\t\t\t\tfieldId: field.fieldId!,\n\t\t\t\t\t\tname: {\n\t\t\t\t\t\t\ttype: field.name?.name!,\n\t\t\t\t\t\t\tbcs: field.name?.value!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvalueType: field.valueType!,\n\t\t\t\t\t\ttype: normalizeStructTag(fieldType),\n\t\t\t\t\t\tchildId: field.childId,\n\t\t\t\t\t\tvalue: (includeValue\n\t\t\t\t\t\t\t? { type: field.valueType!, bcs: field.value?.value ?? new Uint8Array() }\n\t\t\t\t\t\t\t: undefined) as DynamicFieldEntryWithValue<Include>['value'],\n\t\t\t\t\t} as DynamicFieldEntryWithValue<Include>;\n\t\t\t\t},\n\t\t\t),\n\t\t\tcursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null,\n\t\t\thasNextPage: response.response.nextPageToken !== undefined,\n\t\t};\n\t}\n\n\tgetDynamicField(\n\t\tinput: SuiClientTypes.GetDynamicFieldOptions,\n\t): Promise<SuiClientTypes.GetDynamicFieldResponse> {\n\t\treturn this.core.getDynamicField(input);\n\t}\n\n\tgetMoveFunction(\n\t\tinput: SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<SuiClientTypes.GetMoveFunctionResponse> {\n\t\treturn this.core.getMoveFunction(input);\n\t}\n\n\tresolveTransactionPlugin(): TransactionPlugin {\n\t\treturn this.core.resolveTransactionPlugin();\n\t}\n\n\tverifyZkLoginSignature(\n\t\tinput: SuiClientTypes.VerifyZkLoginSignatureOptions,\n\t): Promise<SuiClientTypes.ZkLoginVerifyResponse> {\n\t\treturn this.core.verifyZkLoginSignature(input);\n\t}\n\n\tdefaultNameServiceName(\n\t\tinput: SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {\n\t\treturn this.core.defaultNameServiceName(input);\n\t}\n}\n"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gB,SAAS,SAAS,SAAS,cAAc,GAAG;GACtF,aAAa,SAAS,SAAS,kBAAkB;GACjD;;CAGF,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,2BAA8C;AAC7C,SAAO,KAAK,KAAK,0BAA0B;;CAG5C,uBACC,OACgD;AAChD,SAAO,KAAK,KAAK,uBAAuB,MAAM;;CAG/C,uBACC,OACyD;AACzD,SAAO,KAAK,KAAK,uBAAuB,MAAM"}
|
package/dist/grpc/core.d.mts
CHANGED
|
@@ -26,14 +26,14 @@ declare class GrpcCoreClient extends CoreClient {
|
|
|
26
26
|
getTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.GetTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
27
27
|
executeTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.ExecuteTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
28
28
|
simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(options: SuiClientTypes.SimulateTransactionOptions<Include>): Promise<SuiClientTypes.SimulateTransactionResult<Include>>;
|
|
29
|
-
getReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse>;
|
|
30
|
-
getProtocolConfig(): Promise<SuiClientTypes.GetProtocolConfigResponse>;
|
|
31
|
-
getCurrentSystemState(): Promise<SuiClientTypes.GetCurrentSystemStateResponse>;
|
|
29
|
+
getReferenceGasPrice(options?: SuiClientTypes.GetReferenceGasPriceOptions): Promise<SuiClientTypes.GetReferenceGasPriceResponse>;
|
|
30
|
+
getProtocolConfig(options?: SuiClientTypes.GetProtocolConfigOptions): Promise<SuiClientTypes.GetProtocolConfigResponse>;
|
|
31
|
+
getCurrentSystemState(options?: SuiClientTypes.GetCurrentSystemStateOptions): Promise<SuiClientTypes.GetCurrentSystemStateResponse>;
|
|
32
32
|
listDynamicFields(options: SuiClientTypes.ListDynamicFieldsOptions): Promise<SuiClientTypes.ListDynamicFieldsResponse>;
|
|
33
33
|
verifyZkLoginSignature(options: SuiClientTypes.VerifyZkLoginSignatureOptions): Promise<SuiClientTypes.ZkLoginVerifyResponse>;
|
|
34
34
|
defaultNameServiceName(options: SuiClientTypes.DefaultNameServiceNameOptions): Promise<SuiClientTypes.DefaultNameServiceNameResponse>;
|
|
35
35
|
getMoveFunction(options: SuiClientTypes.GetMoveFunctionOptions): Promise<SuiClientTypes.GetMoveFunctionResponse>;
|
|
36
|
-
getChainIdentifier(
|
|
36
|
+
getChainIdentifier(options?: SuiClientTypes.GetChainIdentifierOptions): Promise<SuiClientTypes.GetChainIdentifierResponse>;
|
|
37
37
|
resolveTransactionPlugin(): (transactionData: TransactionDataBuilder, options: BuildTransactionOptions, next: () => Promise<void>) => Promise<void>;
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
package/dist/grpc/core.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.mts","names":[],"sources":["../../src/grpc/core.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"core.d.mts","names":[],"sources":["../../src/grpc/core.ts"],"mappings":";;;;;;;;;;UAiDiB,qBAAA,SAA8B,iBAAA;EAC9C,MAAA,EAAQ,aAAA;AAAA;AAAA,cAEI,cAAA,SAAuB,UAAA;EAAA;;IAErB,MAAA;IAAA,GAAW;EAAA,GAAW,qBAAA;EAK9B,UAAA,iBAA2B,cAAA,CAAe,aAAA,MAAA,CAC/C,OAAA,EAAS,cAAA,CAAe,iBAAA,CAAkB,OAAA,IACxC,OAAA,CAAQ,cAAA,CAAe,kBAAA,CAAmB,OAAA;EAqFvC,gBAAA,iBAAiC,cAAA,CAAe,aAAA,MAAA,CACrD,OAAA,EAAS,cAAA,CAAe,uBAAA,CAAwB,OAAA,IAC9C,OAAA,CAAQ,cAAA,CAA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Ae,6BAAA,GACtB,OAAA,CAAQ,cAAA,CAAe,qBAAA;EAoCpB,sBAAA,CACL,OAAA,EAAS,cAAA,CAAe,6BAAA,GACtB,OAAA,CAAQ,cAAA,CAAe,8BAAA;EAiBpB,eAAA,CACL,OAAA,EAAS,cAAA,CAAe,sBAAA,GACtB,OAAA,CAAQ,cAAA,CAAe,uBAAA;EA4DpB,kBAAA,CACL,OAAA,GAAU,cAAA,CAAe,yBAAA,GACvB,OAAA,CAAQ,cAAA,CAAe,0BAAA;EAmB1B,wBAAA,CAAA,IAGE,eAAA,EAAiB,sBAAA,EACjB,OAAA,EAAS,uBAAA,EACT,IAAA,QAAY,OAAA,WAAa,OAAA;AAAA"}
|
package/dist/grpc/core.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { normalizeStructTag, normalizeSuiAddress } from "../utils/sui-types.mjs";
|
|
2
2
|
import { bcs as suiBcs } from "../bcs/index.mjs";
|
|
3
|
+
import { raceSignal } from "../client/mvr.mjs";
|
|
3
4
|
import { CoreClient } from "../client/core.mjs";
|
|
4
5
|
import { formatMoveAbortMessage } from "../client/utils.mjs";
|
|
5
6
|
import { SimulationError } from "../client/errors.mjs";
|
|
@@ -39,7 +40,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
39
40
|
const response = await this.#client.ledgerService.batchGetObjects({
|
|
40
41
|
requests: batch.map((id) => ({ objectId: id })),
|
|
41
42
|
readMask: { paths }
|
|
42
|
-
});
|
|
43
|
+
}, { abort: options.signal });
|
|
43
44
|
results.push(...response.response.objects.map((object) => {
|
|
44
45
|
if (object.result.oneofKind === "error") return new Error(object.result.error.message);
|
|
45
46
|
if (object.result.oneofKind !== "object") return /* @__PURE__ */ new Error("Unexpected result type");
|
|
@@ -80,11 +81,14 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
80
81
|
if (options.include?.display) paths.push("display");
|
|
81
82
|
const response = await this.#client.stateService.listOwnedObjects({
|
|
82
83
|
owner: options.owner,
|
|
83
|
-
objectType: options.type ? (await this.mvr.resolveType({
|
|
84
|
+
objectType: options.type ? (await this.mvr.resolveType({
|
|
85
|
+
type: options.type,
|
|
86
|
+
signal: options.signal
|
|
87
|
+
})).type : void 0,
|
|
84
88
|
pageToken: options.cursor ? fromBase64(options.cursor) : void 0,
|
|
85
89
|
pageSize: options.limit,
|
|
86
90
|
readMask: { paths }
|
|
87
|
-
});
|
|
91
|
+
}, { abort: options.signal });
|
|
88
92
|
return {
|
|
89
93
|
objects: response.response.objects.map((object) => ({
|
|
90
94
|
objectId: object.objectId,
|
|
@@ -114,11 +118,14 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
114
118
|
const coinType = options.coinType ?? SUI_TYPE_ARG;
|
|
115
119
|
const response = await this.#client.stateService.listOwnedObjects({
|
|
116
120
|
owner: options.owner,
|
|
117
|
-
objectType: `0x2::coin::Coin<${(await this.mvr.resolveType({
|
|
121
|
+
objectType: `0x2::coin::Coin<${(await this.mvr.resolveType({
|
|
122
|
+
type: coinType,
|
|
123
|
+
signal: options.signal
|
|
124
|
+
})).type}>`,
|
|
118
125
|
pageToken: options.cursor ? fromBase64(options.cursor) : void 0,
|
|
119
126
|
pageSize: options.limit,
|
|
120
127
|
readMask: { paths }
|
|
121
|
-
});
|
|
128
|
+
}, { abort: options.signal });
|
|
122
129
|
return {
|
|
123
130
|
objects: response.response.objects.map((object) => ({
|
|
124
131
|
objectId: object.objectId,
|
|
@@ -136,8 +143,11 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
136
143
|
const coinType = options.coinType ?? SUI_TYPE_ARG;
|
|
137
144
|
const result = await this.#client.stateService.getBalance({
|
|
138
145
|
owner: options.owner,
|
|
139
|
-
coinType: (await this.mvr.resolveType({
|
|
140
|
-
|
|
146
|
+
coinType: (await this.mvr.resolveType({
|
|
147
|
+
type: coinType,
|
|
148
|
+
signal: options.signal
|
|
149
|
+
})).type
|
|
150
|
+
}, { abort: options.signal });
|
|
141
151
|
return { balance: {
|
|
142
152
|
balance: result.response.balance?.balance?.toString() ?? "0",
|
|
143
153
|
coinType: result.response.balance?.coinType ?? coinType,
|
|
@@ -146,11 +156,15 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
146
156
|
} };
|
|
147
157
|
}
|
|
148
158
|
async getCoinMetadata(options) {
|
|
149
|
-
const coinType = (await this.mvr.resolveType({
|
|
159
|
+
const coinType = (await this.mvr.resolveType({
|
|
160
|
+
type: options.coinType,
|
|
161
|
+
signal: options.signal
|
|
162
|
+
})).type;
|
|
150
163
|
let response;
|
|
151
164
|
try {
|
|
152
|
-
({response} = await this.#client.stateService.getCoinInfo({ coinType }));
|
|
153
|
-
} catch {
|
|
165
|
+
({response} = await this.#client.stateService.getCoinInfo({ coinType }, { abort: options.signal }));
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (options.signal?.aborted) throw error;
|
|
154
168
|
return { coinMetadata: null };
|
|
155
169
|
}
|
|
156
170
|
if (!response.metadata) return { coinMetadata: null };
|
|
@@ -168,7 +182,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
168
182
|
owner: options.owner,
|
|
169
183
|
pageToken: options.cursor ? fromBase64(options.cursor) : void 0,
|
|
170
184
|
pageSize: options.limit
|
|
171
|
-
});
|
|
185
|
+
}, { abort: options.signal });
|
|
172
186
|
return {
|
|
173
187
|
hasNextPage: !!result.response.nextPageToken,
|
|
174
188
|
cursor: result.response.nextPageToken ? toBase64(result.response.nextPageToken) : null,
|
|
@@ -199,7 +213,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
199
213
|
const { response } = await this.#client.ledgerService.getTransaction({
|
|
200
214
|
digest: options.digest,
|
|
201
215
|
readMask: { paths }
|
|
202
|
-
});
|
|
216
|
+
}, { abort: options.signal });
|
|
203
217
|
if (!response.transaction) throw new Error(`Transaction ${options.digest} not found`);
|
|
204
218
|
return parseTransaction(response.transaction, options.include);
|
|
205
219
|
}
|
|
@@ -226,7 +240,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
226
240
|
signature: { oneofKind: void 0 }
|
|
227
241
|
})),
|
|
228
242
|
readMask: { paths }
|
|
229
|
-
});
|
|
243
|
+
}, { abort: options.signal });
|
|
230
244
|
return parseTransaction(response.transaction, options.include);
|
|
231
245
|
}
|
|
232
246
|
async simulateTransaction(options) {
|
|
@@ -252,7 +266,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
252
266
|
readMask: { paths },
|
|
253
267
|
doGasSelection: false,
|
|
254
268
|
checks: options.checksEnabled === false ? SimulateTransactionRequest_TransactionChecks.DISABLED : SimulateTransactionRequest_TransactionChecks.ENABLED
|
|
255
|
-
});
|
|
269
|
+
}, { abort: options.signal });
|
|
256
270
|
const transactionResult = parseTransaction(response.transaction, options.include);
|
|
257
271
|
const commandResults = options.include?.commandResults && response.commandOutputs ? response.commandOutputs.map((output) => ({
|
|
258
272
|
returnValues: (output.returnValues ?? []).map((rv) => ({ bcs: rv.value?.value ?? null })),
|
|
@@ -269,11 +283,11 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
269
283
|
commandResults
|
|
270
284
|
};
|
|
271
285
|
}
|
|
272
|
-
async getReferenceGasPrice() {
|
|
273
|
-
return { referenceGasPrice: (await this.#client.ledgerService.getEpoch({ readMask: { paths: ["reference_gas_price"] } })).response.epoch?.referenceGasPrice?.toString() ?? "" };
|
|
286
|
+
async getReferenceGasPrice(options) {
|
|
287
|
+
return { referenceGasPrice: (await this.#client.ledgerService.getEpoch({ readMask: { paths: ["reference_gas_price"] } }, { abort: options?.signal })).response.epoch?.referenceGasPrice?.toString() ?? "" };
|
|
274
288
|
}
|
|
275
|
-
async getProtocolConfig() {
|
|
276
|
-
const protocolConfig = (await this.#client.ledgerService.getEpoch({ readMask: { paths: ["protocol_config"] } })).response.epoch?.protocolConfig;
|
|
289
|
+
async getProtocolConfig(options) {
|
|
290
|
+
const protocolConfig = (await this.#client.ledgerService.getEpoch({ readMask: { paths: ["protocol_config"] } }, { abort: options?.signal })).response.epoch?.protocolConfig;
|
|
277
291
|
if (!protocolConfig) throw new Error("Protocol config not found in response");
|
|
278
292
|
const featureFlags = { ...protocolConfig.featureFlags };
|
|
279
293
|
const attributes = {};
|
|
@@ -284,7 +298,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
284
298
|
attributes
|
|
285
299
|
} };
|
|
286
300
|
}
|
|
287
|
-
async getCurrentSystemState() {
|
|
301
|
+
async getCurrentSystemState(options) {
|
|
288
302
|
const epoch = (await this.#client.ledgerService.getEpoch({ readMask: { paths: [
|
|
289
303
|
"system_state.version",
|
|
290
304
|
"system_state.epoch",
|
|
@@ -299,7 +313,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
299
313
|
"system_state.parameters",
|
|
300
314
|
"system_state.storage_fund",
|
|
301
315
|
"system_state.stake_subsidy"
|
|
302
|
-
] } })).response.epoch;
|
|
316
|
+
] } }, { abort: options?.signal })).response.epoch;
|
|
303
317
|
const systemState = epoch?.systemState;
|
|
304
318
|
if (!systemState) throw new Error("System state not found in response");
|
|
305
319
|
const startMs = epoch?.start?.seconds ? Number(epoch.start.seconds) * 1e3 + Math.floor((epoch.start.nanos || 0) / 1e6) : systemState.epochStartTimestampMs ? Number(systemState.epochStartTimestampMs) : null;
|
|
@@ -352,22 +366,25 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
352
366
|
},
|
|
353
367
|
address: options.address,
|
|
354
368
|
jwks: []
|
|
355
|
-
});
|
|
369
|
+
}, { abort: options.signal });
|
|
356
370
|
return {
|
|
357
371
|
success: response.isValid ?? false,
|
|
358
372
|
errors: response.reason ? [response.reason] : []
|
|
359
373
|
};
|
|
360
374
|
}
|
|
361
375
|
async defaultNameServiceName(options) {
|
|
362
|
-
return { data: { name: (await this.#client.nameService.reverseLookupName({ address: options.address })).response.record?.name ?? null } };
|
|
376
|
+
return { data: { name: (await this.#client.nameService.reverseLookupName({ address: options.address }, { abort: options.signal })).response.record?.name ?? null } };
|
|
363
377
|
}
|
|
364
378
|
async getMoveFunction(options) {
|
|
365
|
-
const resolvedPackageId = (await this.mvr.resolvePackage({
|
|
379
|
+
const resolvedPackageId = (await this.mvr.resolvePackage({
|
|
380
|
+
package: options.packageId,
|
|
381
|
+
signal: options.signal
|
|
382
|
+
})).package;
|
|
366
383
|
const { response } = await this.#client.movePackageService.getFunction({
|
|
367
384
|
packageId: resolvedPackageId,
|
|
368
385
|
moduleName: options.moduleName,
|
|
369
386
|
name: options.name
|
|
370
|
-
});
|
|
387
|
+
}, { abort: options.signal });
|
|
371
388
|
let visibility = "unknown";
|
|
372
389
|
switch (response.function?.visibility) {
|
|
373
390
|
case FunctionDescriptor_Visibility.PUBLIC:
|
|
@@ -402,12 +419,12 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
402
419
|
returns: response.function?.returns?.map((ret) => parseNormalizedSuiMoveType(ret)) ?? []
|
|
403
420
|
} };
|
|
404
421
|
}
|
|
405
|
-
async getChainIdentifier(
|
|
406
|
-
return this.cache.read(["chainIdentifier"], async () => {
|
|
422
|
+
async getChainIdentifier(options) {
|
|
423
|
+
return raceSignal(Promise.resolve(this.cache.read(["chainIdentifier"], async () => {
|
|
407
424
|
const { response } = await this.#client.ledgerService.getServiceInfo({});
|
|
408
425
|
if (!response.chainId) throw new Error("Chain identifier not found in service info");
|
|
409
426
|
return { chainIdentifier: response.chainId };
|
|
410
|
-
});
|
|
427
|
+
})), options?.signal);
|
|
411
428
|
}
|
|
412
429
|
resolveTransactionPlugin() {
|
|
413
430
|
const client = this.#client;
|
|
@@ -420,6 +437,7 @@ var GrpcCoreClient = class extends CoreClient {
|
|
|
420
437
|
response = (await client.transactionExecutionService.simulateTransaction({
|
|
421
438
|
transaction: grpcTransaction,
|
|
422
439
|
doGasSelection: !options.onlyTransactionKind && (snapshot.gasData.budget == null || snapshot.gasData.payment == null),
|
|
440
|
+
checks: options.onlyTransactionKind ? SimulateTransactionRequest_TransactionChecks.DISABLED : SimulateTransactionRequest_TransactionChecks.ENABLED,
|
|
423
441
|
readMask: { paths: [
|
|
424
442
|
"transaction.transaction.sender",
|
|
425
443
|
"transaction.transaction.gas_payment",
|