@mysten/sui 2.39.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +169 -0
- package/README.md +5 -188
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/bcs.d.mts.map +1 -1
- package/dist/bcs/bcs.mjs +49 -22
- package/dist/bcs/bcs.mjs.map +1 -1
- package/dist/bcs/effects.mjs +49 -20
- package/dist/bcs/effects.mjs.map +1 -1
- package/dist/bcs/index.d.mts +1441 -624
- package/dist/bcs/index.d.mts.map +1 -1
- package/dist/bcs/index.mjs +2 -1
- package/dist/bcs/index.mjs.map +1 -1
- package/dist/bcs/transactions.d.mts +1059 -0
- package/dist/bcs/transactions.d.mts.map +1 -0
- package/dist/bcs/transactions.mjs +33 -14
- package/dist/bcs/transactions.mjs.map +1 -1
- package/dist/bcs/types.d.mts +6 -1
- package/dist/bcs/types.d.mts.map +1 -1
- package/dist/client/core-resolver.mjs +4 -4
- package/dist/client/core-resolver.mjs.map +1 -1
- package/dist/client/core.d.mts +55 -4
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs +98 -1
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/errors.mjs +11 -1
- package/dist/client/errors.mjs.map +1 -1
- package/dist/client/index.d.mts +5 -3
- package/dist/client/index.mjs +6 -3
- package/dist/client/mvr.d.mts +12 -2
- package/dist/client/mvr.d.mts.map +1 -1
- package/dist/client/mvr.mjs +34 -13
- package/dist/client/mvr.mjs.map +1 -1
- package/dist/client/query-filters.mjs +80 -76
- package/dist/client/query-filters.mjs.map +1 -1
- package/dist/client/stream/adapter.d.mts +102 -0
- package/dist/client/stream/adapter.d.mts.map +1 -0
- package/dist/client/stream/errors.d.mts +14 -0
- package/dist/client/stream/errors.d.mts.map +1 -0
- package/dist/client/stream/errors.mjs +25 -0
- package/dist/client/stream/errors.mjs.map +1 -0
- package/dist/client/stream/filter.mjs +18 -0
- package/dist/client/stream/filter.mjs.map +1 -0
- package/dist/client/stream/follow.mjs +48 -0
- package/dist/client/stream/follow.mjs.map +1 -0
- package/dist/client/stream/index.d.mts +4 -0
- package/dist/client/stream/pager.mjs +123 -0
- package/dist/client/stream/pager.mjs.map +1 -0
- package/dist/client/stream/plan.mjs +79 -0
- package/dist/client/stream/plan.mjs.map +1 -0
- package/dist/client/stream/position.d.mts +30 -0
- package/dist/client/stream/position.d.mts.map +1 -0
- package/dist/client/stream/position.mjs +121 -0
- package/dist/client/stream/position.mjs.map +1 -0
- package/dist/client/stream/run.d.mts +2 -0
- package/dist/client/stream/run.mjs +99 -0
- package/dist/client/stream/run.mjs.map +1 -0
- package/dist/client/stream/session.mjs +205 -0
- package/dist/client/stream/session.mjs.map +1 -0
- package/dist/client/stream/status.mjs +47 -0
- package/dist/client/stream/status.mjs.map +1 -0
- package/dist/client/stream/token.mjs +80 -0
- package/dist/client/stream/token.mjs.map +1 -0
- package/dist/client/transaction-data.d.mts +17 -0
- package/dist/client/transaction-data.d.mts.map +1 -0
- package/dist/client/transaction-data.mjs +472 -0
- package/dist/client/transaction-data.mjs.map +1 -0
- package/dist/client/transaction-resolver.mjs +102 -58
- package/dist/client/transaction-resolver.mjs.map +1 -1
- package/dist/client/types.d.mts +560 -240
- package/dist/client/types.d.mts.map +1 -1
- package/dist/client/utils.d.mts +2 -2
- package/dist/client/utils.d.mts.map +1 -1
- package/dist/client/utils.mjs +91 -30
- package/dist/client/utils.mjs.map +1 -1
- package/dist/cryptography/index.d.mts +1 -1
- package/dist/cryptography/keypair.d.mts +1 -1
- package/dist/cryptography/publickey.d.mts +11 -0
- package/dist/cryptography/publickey.d.mts.map +1 -1
- package/dist/cryptography/publickey.mjs +12 -1
- package/dist/cryptography/publickey.mjs.map +1 -1
- package/dist/cryptography/signature.d.mts +8 -8
- package/dist/cryptography/signature.mjs +18 -7
- package/dist/cryptography/signature.mjs.map +1 -1
- package/dist/graphql/client.d.mts +51 -35
- package/dist/graphql/client.d.mts.map +1 -1
- package/dist/graphql/client.mjs +125 -69
- package/dist/graphql/client.mjs.map +1 -1
- package/dist/graphql/core.d.mts +14 -9
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +294 -118
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/errors.d.mts +20 -0
- package/dist/graphql/errors.d.mts.map +1 -0
- package/dist/graphql/errors.mjs +19 -0
- package/dist/graphql/errors.mjs.map +1 -0
- package/dist/graphql/filters.mjs +32 -0
- package/dist/graphql/filters.mjs.map +1 -0
- package/dist/graphql/generated/queries.d.mts.map +1 -1
- package/dist/graphql/generated/queries.mjs +1216 -208
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/graphql/generated/tada-env.d.mts +820 -11
- package/dist/graphql/index.d.mts +2 -1
- package/dist/graphql/index.mjs +2 -1
- package/dist/graphql/sse-parser.mjs +82 -0
- package/dist/graphql/sse-parser.mjs.map +1 -0
- package/dist/graphql/stream/families.mjs +306 -0
- package/dist/graphql/stream/families.mjs.map +1 -0
- package/dist/graphql/stream/index.mjs +38 -0
- package/dist/graphql/stream/index.mjs.map +1 -0
- package/dist/graphql/stream/live.mjs +60 -0
- package/dist/graphql/stream/live.mjs.map +1 -0
- package/dist/graphql/stream/page.mjs +38 -0
- package/dist/graphql/stream/page.mjs.map +1 -0
- package/dist/graphql/stream/query.mjs +47 -0
- package/dist/graphql/stream/query.mjs.map +1 -0
- package/dist/graphql/subscribe.mjs +70 -0
- package/dist/graphql/subscribe.mjs.map +1 -0
- package/dist/grpc/client.d.mts +31 -27
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +42 -46
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts +13 -6
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +254 -166
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/filters.mjs +44 -34
- package/dist/grpc/filters.mjs.map +1 -1
- package/dist/grpc/grpc-web-pull.mjs +245 -0
- package/dist/grpc/grpc-web-pull.mjs.map +1 -0
- package/dist/grpc/index.d.mts +2 -1
- package/dist/grpc/index.mjs +1 -1
- package/dist/grpc/network-error.mjs +31 -0
- package/dist/grpc/network-error.mjs.map +1 -0
- package/dist/grpc/proto/google/rpc/error_details.mjs +306 -0
- package/dist/grpc/proto/google/rpc/error_details.mjs.map +1 -0
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/error_reason.d.mts +176 -1
- package/dist/grpc/proto/sui/rpc/v2/error_reason.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/error_reason.mjs +175 -0
- package/dist/grpc/proto/sui/rpc/v2/error_reason.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/executed_transaction.d.mts +2 -2
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.d.mts +111 -0
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs +46 -0
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.d.mts +24 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs +25 -7
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/object.mjs +1 -1
- package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts +111 -9
- package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/query_options.mjs +63 -19
- package/dist/grpc/proto/sui/rpc/v2/query_options.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature.d.mts +5 -5
- package/dist/grpc/proto/sui/rpc/v2/signature.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_scheme.d.mts +5 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_scheme.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_scheme.mjs +4 -0
- package/dist/grpc/proto/sui/rpc/v2/signature_scheme.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.d.mts +20 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs +30 -13
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.mjs.map +1 -1
- 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 +20 -14
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.mjs +8 -5
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts +11 -5
- package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction.mjs +6 -0
- package/dist/grpc/proto/sui/rpc/v2/transaction.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts +6 -2
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs.map +1 -1
- package/dist/grpc/proto/types.d.mts +7 -7
- package/dist/grpc/proto/types.mjs +3 -2
- package/dist/grpc/pull-call.d.mts +20 -0
- package/dist/grpc/pull-call.d.mts.map +1 -0
- package/dist/grpc/pull-call.mjs +28 -0
- package/dist/grpc/pull-call.mjs.map +1 -0
- package/dist/grpc/stream/call.mjs +238 -0
- package/dist/grpc/stream/call.mjs.map +1 -0
- package/dist/grpc/stream/families.d.mts +26 -0
- package/dist/grpc/stream/families.d.mts.map +1 -0
- package/dist/grpc/stream/families.mjs +145 -0
- package/dist/grpc/stream/families.mjs.map +1 -0
- package/dist/grpc/stream/index.d.mts +41 -0
- package/dist/grpc/stream/index.d.mts.map +1 -0
- package/dist/grpc/stream/index.mjs +127 -0
- package/dist/grpc/stream/index.mjs.map +1 -0
- package/dist/grpc/stream/live.mjs +31 -0
- package/dist/grpc/stream/live.mjs.map +1 -0
- package/dist/grpc/stream/page.mjs +120 -0
- package/dist/grpc/stream/page.mjs.map +1 -0
- package/dist/grpc/stream-types.d.mts +28 -0
- package/dist/grpc/stream-types.d.mts.map +1 -0
- package/dist/grpc/transport.d.mts +8 -3
- package/dist/grpc/transport.d.mts.map +1 -1
- package/dist/grpc/transport.mjs +88 -45
- package/dist/grpc/transport.mjs.map +1 -1
- package/dist/jsonRpc/index.d.mts +34 -12
- package/dist/jsonRpc/index.d.mts.map +1 -0
- package/dist/jsonRpc/index.mjs +39 -5
- package/dist/jsonRpc/index.mjs.map +1 -0
- package/dist/jsonRpc/types.d.mts +420 -0
- package/dist/jsonRpc/types.d.mts.map +1 -0
- package/dist/keypairs/passkey/keypair.d.mts +1 -1
- package/dist/multisig/publickey.d.mts +12 -4
- package/dist/multisig/publickey.d.mts.map +1 -1
- package/dist/multisig/publickey.mjs +5 -5
- package/dist/multisig/publickey.mjs.map +1 -1
- package/dist/multisig/signer.d.mts +1 -1
- package/dist/transactions/ObjectCache.d.mts +1 -1
- package/dist/transactions/ObjectCache.mjs +5 -5
- package/dist/transactions/ObjectCache.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +10 -9
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/transactions/Transaction.mjs +17 -6
- package/dist/transactions/Transaction.mjs.map +1 -1
- package/dist/transactions/data/internal.d.mts +2 -0
- package/dist/transactions/data/internal.d.mts.map +1 -1
- package/dist/transactions/data/internal.mjs +2 -1
- package/dist/transactions/data/internal.mjs.map +1 -1
- package/dist/transactions/executor/parallel.d.mts +2 -2
- package/dist/transactions/executor/serial.d.mts +1 -1
- package/dist/transactions/executor/serial.mjs +2 -2
- package/dist/transactions/executor/serial.mjs.map +1 -1
- package/dist/transactions/index.d.mts +3 -2
- package/dist/transactions/index.mjs +4 -3
- package/dist/transactions/intents/AllowanceBalance.mjs +1 -1
- package/dist/transactions/intents/CoinWithBalance.mjs +1 -1
- package/dist/transactions/resolve.d.mts +6 -0
- package/dist/transactions/resolve.d.mts.map +1 -1
- package/dist/transactions/resolve.mjs.map +1 -1
- package/dist/transactions/restricted-move-calls.d.mts +25 -0
- package/dist/transactions/restricted-move-calls.d.mts.map +1 -0
- package/dist/transactions/restricted-move-calls.mjs +47 -0
- package/dist/transactions/restricted-move-calls.mjs.map +1 -0
- package/dist/transactions/serializer.d.mts +1 -4
- package/dist/transactions/serializer.d.mts.map +1 -1
- package/dist/transactions/serializer.mjs +1 -44
- package/dist/transactions/serializer.mjs.map +1 -1
- package/dist/transactions/utils.d.mts +0 -1
- package/dist/transactions/utils.d.mts.map +1 -1
- package/dist/transactions/utils.mjs.map +1 -1
- package/dist/utils/abort.mjs +89 -0
- package/dist/utils/abort.mjs.map +1 -0
- package/dist/utils/coin-reservation.mjs +1 -4
- package/dist/utils/coin-reservation.mjs.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/sui-types.mjs +1 -1
- package/dist/verify/index.d.mts +2 -2
- package/dist/verify/verify.d.mts +74 -24
- package/dist/verify/verify.d.mts.map +1 -1
- package/dist/verify/verify.mjs +128 -42
- package/dist/verify/verify.mjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/dist/zklogin/publickey.d.mts.map +1 -1
- package/dist/zklogin/publickey.mjs +15 -20
- package/dist/zklogin/publickey.mjs.map +1 -1
- package/docs/bcs.md +2 -2
- package/docs/clients/core.md +19 -18
- package/docs/clients/executing.md +53 -8
- package/docs/clients/graphql.md +81 -11
- package/docs/clients/grpc.md +31 -15
- package/docs/clients/index.md +8 -7
- package/docs/clients/querying.md +134 -30
- package/docs/clients/streaming.md +324 -0
- package/docs/cryptography/index.md +85 -58
- package/docs/llms-index.md +4 -2
- package/docs/migrations/sui-2.0/dapp-kit.md +3 -2
- package/docs/migrations/sui-2.0/json-rpc-migration.md +106 -79
- package/docs/migrations/sui-3.0/index.md +247 -0
- package/docs/plugins.md +10 -10
- package/docs/sdk-building.md +3 -4
- package/docs/transactions/coins-and-balances.md +6 -11
- package/docs/transactions/reference.md +36 -1
- package/package.json +4 -5
- package/src/bcs/bcs.ts +80 -41
- package/src/bcs/effects.ts +61 -25
- package/src/bcs/index.ts +2 -0
- package/src/bcs/transactions.ts +36 -17
- package/src/bcs/types.ts +10 -4
- package/src/client/core-resolver.ts +3 -5
- package/src/client/core.ts +180 -8
- package/src/client/errors.ts +12 -0
- package/src/client/index.ts +4 -2
- package/src/client/mvr.ts +37 -10
- package/src/client/query-filters.ts +151 -97
- package/src/client/stream/adapter.ts +110 -0
- package/src/client/stream/errors.ts +40 -0
- package/src/client/stream/filter.ts +17 -0
- package/src/client/stream/follow.ts +63 -0
- package/src/client/stream/index.ts +9 -0
- package/src/client/stream/pager.ts +158 -0
- package/src/client/stream/plan.ts +147 -0
- package/src/client/stream/position.ts +143 -0
- package/src/client/stream/run.ts +147 -0
- package/src/client/stream/session.ts +259 -0
- package/src/client/stream/status.ts +44 -0
- package/src/client/stream/token.ts +104 -0
- package/src/client/transaction-data.ts +610 -0
- package/src/client/transaction-resolver.ts +158 -69
- package/src/client/types.ts +530 -115
- package/src/client/utils.ts +146 -61
- package/src/cryptography/publickey.ts +12 -1
- package/src/cryptography/signature.ts +6 -3
- package/src/graphql/client.ts +204 -135
- package/src/graphql/core.ts +446 -139
- package/src/graphql/errors.ts +24 -0
- package/src/graphql/filters.ts +48 -0
- package/src/graphql/generated/queries.ts +1455 -277
- package/src/graphql/generated/schema.graphql +282 -9
- package/src/graphql/generated/tada-env.ts +933 -4
- package/src/graphql/queries/checkpoints.graphql +34 -0
- package/src/graphql/queries/getDynamicFields.graphql +1 -0
- package/src/graphql/queries/listEvents.graphql +16 -24
- package/src/graphql/queries/streams.graphql +212 -0
- package/src/graphql/queries/transactions.graphql +71 -28
- package/src/graphql/queries/verifySignature.graphql +17 -0
- package/src/graphql/sse-parser.ts +99 -0
- package/src/graphql/stream/families.ts +515 -0
- package/src/graphql/stream/index.ts +55 -0
- package/src/graphql/stream/live.ts +70 -0
- package/src/graphql/stream/page.ts +47 -0
- package/src/graphql/stream/query.ts +52 -0
- package/src/graphql/subscribe.ts +83 -0
- package/src/grpc/client.ts +81 -79
- package/src/grpc/core.ts +388 -274
- package/src/grpc/filters.ts +59 -60
- package/src/grpc/grpc-web-pull.ts +360 -0
- package/src/grpc/index.ts +5 -0
- package/src/grpc/network-error.ts +33 -0
- package/src/grpc/proto/sui/rpc/v2/error_reason.ts +175 -0
- package/src/grpc/proto/sui/rpc/v2/ledger_service.ts +145 -0
- package/src/grpc/proto/sui/rpc/v2/move_package_service.ts +43 -1
- package/src/grpc/proto/sui/rpc/v2/query_options.ts +132 -8
- package/src/grpc/proto/sui/rpc/v2/signature.ts +4 -4
- package/src/grpc/proto/sui/rpc/v2/signature_scheme.ts +4 -0
- package/src/grpc/proto/sui/rpc/v2/signature_verification_service.ts +30 -0
- package/src/grpc/proto/sui/rpc/v2/subscription_service.client.ts +16 -10
- package/src/grpc/proto/sui/rpc/v2/transaction.ts +6 -0
- package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +5 -1
- package/src/grpc/pull-call.ts +54 -0
- package/src/grpc/stream/call.ts +317 -0
- package/src/grpc/stream/families.ts +228 -0
- package/src/grpc/stream/index.ts +182 -0
- package/src/grpc/stream/live.ts +33 -0
- package/src/grpc/stream/page.ts +161 -0
- package/src/grpc/stream-types.ts +33 -0
- package/src/grpc/transport.ts +116 -59
- package/src/jsonRpc/index.ts +60 -17
- package/src/jsonRpc/types.ts +421 -0
- package/src/multisig/publickey.ts +19 -7
- package/src/transactions/ObjectCache.ts +6 -6
- package/src/transactions/Transaction.ts +30 -6
- package/src/transactions/data/internal.ts +2 -0
- package/src/transactions/executor/serial.ts +2 -2
- package/src/transactions/index.ts +8 -1
- package/src/transactions/resolve.ts +6 -0
- package/src/transactions/restricted-move-calls.ts +87 -0
- package/src/transactions/serializer.ts +0 -70
- package/src/transactions/utils.ts +0 -37
- package/src/utils/abort.ts +101 -0
- package/src/verify/index.ts +1 -0
- package/src/verify/verify.ts +190 -62
- package/src/version.ts +1 -1
- package/src/zklogin/publickey.ts +18 -34
- package/dist/client/core-resolver.d.mts +0 -9
- package/dist/client/core-resolver.d.mts.map +0 -1
- package/dist/jsonRpc/client.d.mts +0 -507
- package/dist/jsonRpc/client.d.mts.map +0 -1
- package/dist/jsonRpc/client.mjs +0 -868
- package/dist/jsonRpc/client.mjs.map +0 -1
- package/dist/jsonRpc/core.d.mts +0 -168
- package/dist/jsonRpc/core.d.mts.map +0 -1
- package/dist/jsonRpc/core.mjs +0 -1054
- package/dist/jsonRpc/core.mjs.map +0 -1
- package/dist/jsonRpc/errors.d.mts +0 -27
- package/dist/jsonRpc/errors.d.mts.map +0 -1
- package/dist/jsonRpc/errors.mjs +0 -50
- package/dist/jsonRpc/errors.mjs.map +0 -1
- package/dist/jsonRpc/http-transport.d.mts +0 -62
- package/dist/jsonRpc/http-transport.d.mts.map +0 -1
- package/dist/jsonRpc/http-transport.mjs +0 -60
- package/dist/jsonRpc/http-transport.mjs.map +0 -1
- package/dist/jsonRpc/network.d.mts +0 -9
- package/dist/jsonRpc/network.d.mts.map +0 -1
- package/dist/jsonRpc/network.mjs +0 -18
- package/dist/jsonRpc/network.mjs.map +0 -1
- package/dist/jsonRpc/types/chain.d.mts +0 -169
- package/dist/jsonRpc/types/chain.d.mts.map +0 -1
- package/dist/jsonRpc/types/changes.d.mts +0 -48
- package/dist/jsonRpc/types/changes.d.mts.map +0 -1
- package/dist/jsonRpc/types/coins.d.mts +0 -15
- package/dist/jsonRpc/types/coins.d.mts.map +0 -1
- package/dist/jsonRpc/types/common.d.mts +0 -9
- package/dist/jsonRpc/types/common.d.mts.map +0 -1
- package/dist/jsonRpc/types/generated.d.mts +0 -1976
- package/dist/jsonRpc/types/generated.d.mts.map +0 -1
- package/dist/jsonRpc/types/index.d.mts +0 -6
- package/dist/jsonRpc/types/params.d.mts +0 -898
- package/dist/jsonRpc/types/params.d.mts.map +0 -1
- package/src/graphql/generated/tsconfig.tada.json +0 -11
- package/src/graphql/queries/verifyZkLoginSignature.graphql +0 -15
- package/src/jsonRpc/client.ts +0 -1252
- package/src/jsonRpc/core.ts +0 -1557
- package/src/jsonRpc/errors.ts +0 -57
- package/src/jsonRpc/http-transport.ts +0 -118
- package/src/jsonRpc/network.ts +0 -21
- package/src/jsonRpc/types/chain.ts +0 -190
- package/src/jsonRpc/types/changes.ts +0 -35
- package/src/jsonRpc/types/coins.ts +0 -14
- package/src/jsonRpc/types/common.ts +0 -8
- package/src/jsonRpc/types/generated.ts +0 -2165
- package/src/jsonRpc/types/index.ts +0 -9
- package/src/jsonRpc/types/params.ts +0 -908
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SuiStreamError } from "../../client/stream/errors.mjs";
|
|
2
|
+
import { LedgerStreamStateDocument } from "../generated/queries.mjs";
|
|
3
|
+
import { SuiGraphQLRequestError } from "../errors.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/graphql/stream/query.ts
|
|
6
|
+
/** Response error codes that may clear on retry. */
|
|
7
|
+
const RETRY_REASONS = {
|
|
8
|
+
INTERNAL_SERVER_ERROR: "ServerError",
|
|
9
|
+
REQUEST_TIMEOUT: "ServerError",
|
|
10
|
+
RESOURCE_EXHAUSTED: "RateLimited"
|
|
11
|
+
};
|
|
12
|
+
/** A result's data, or its errors thrown. The errors may clear on retry only if each of them may. */
|
|
13
|
+
function unwrap(result) {
|
|
14
|
+
const errors = result.errors ?? [];
|
|
15
|
+
const message = errors.map((error) => error.message).join("\n");
|
|
16
|
+
if (errors.length > 0) {
|
|
17
|
+
const reasons = errors.map(({ extensions }) => RETRY_REASONS[String(extensions?.code)]);
|
|
18
|
+
throw new SuiGraphQLRequestError(message, {
|
|
19
|
+
reason: reasons.every((each) => each !== void 0) ? reasons[0] : void 0,
|
|
20
|
+
cause: errors
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (!result.data) throw new SuiStreamError("Protocol", "GraphQL response has no data");
|
|
24
|
+
return result.data;
|
|
25
|
+
}
|
|
26
|
+
async function queryData(client, options) {
|
|
27
|
+
return unwrap(await client.query(options));
|
|
28
|
+
}
|
|
29
|
+
function notIndexedYet() {
|
|
30
|
+
return new SuiGraphQLRequestError("No checkpoint has been indexed yet", { reason: "Unavailable" });
|
|
31
|
+
}
|
|
32
|
+
/** The chain identity and the indexed tip in one request. */
|
|
33
|
+
async function readChainTip(client, signal) {
|
|
34
|
+
const data = await queryData(client, {
|
|
35
|
+
query: LedgerStreamStateDocument,
|
|
36
|
+
signal
|
|
37
|
+
});
|
|
38
|
+
if (!data.checkpoint) throw notIndexedYet();
|
|
39
|
+
return {
|
|
40
|
+
chain: data.chainIdentifier,
|
|
41
|
+
tip: BigInt(data.checkpoint.sequenceNumber)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { notIndexedYet, queryData, readChainTip, unwrap };
|
|
47
|
+
//# sourceMappingURL=query.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.mjs","names":[],"sources":["../../../src/graphql/stream/query.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { SuiStreamError } from '../../client/stream/index.js';\nimport type { SuiClientTypes } from '../../client/types.js';\nimport type { GraphQLQueryOptions, GraphQLQueryResult, SuiGraphQLClient } from '../client.js';\nimport { SuiGraphQLRequestError } from '../errors.js';\nimport { LedgerStreamStateDocument } from '../generated/queries.js';\n\n/** Response error codes that may clear on retry. */\nconst RETRY_REASONS: Record<string, SuiClientTypes.RetryReason> = {\n\tINTERNAL_SERVER_ERROR: 'ServerError',\n\tREQUEST_TIMEOUT: 'ServerError',\n\t// A reconnect gets a fresh server meter; a limit hit on every attempt fails once the budget runs out.\n\tRESOURCE_EXHAUSTED: 'RateLimited',\n};\n\n/** A result's data, or its errors thrown. The errors may clear on retry only if each of them may. */\nexport function unwrap<Result>(result: GraphQLQueryResult<Result>): Result {\n\tconst errors = result.errors ?? [];\n\tconst message = errors.map((error) => error.message).join('\\n');\n\tif (errors.length > 0) {\n\t\tconst reasons = errors.map(({ extensions }) => RETRY_REASONS[String(extensions?.code)]);\n\t\tconst reason = reasons.every((each) => each !== undefined) ? reasons[0] : undefined;\n\t\tthrow new SuiGraphQLRequestError(message, { reason, cause: errors });\n\t}\n\tif (!result.data) throw new SuiStreamError('Protocol', 'GraphQL response has no data');\n\treturn result.data;\n}\n\nexport async function queryData<Result, Variables>(\n\tclient: SuiGraphQLClient,\n\toptions: GraphQLQueryOptions<Result, Variables>,\n): Promise<Result> {\n\treturn unwrap(await client.query(options));\n}\n\nexport function notIndexedYet() {\n\treturn new SuiGraphQLRequestError('No checkpoint has been indexed yet', {\n\t\treason: 'Unavailable',\n\t});\n}\n\n/** The chain identity and the indexed tip in one request. */\nexport async function readChainTip(\n\tclient: SuiGraphQLClient,\n\tsignal: AbortSignal,\n): Promise<{ chain: string; tip: bigint }> {\n\tconst data = await queryData(client, { query: LedgerStreamStateDocument, signal });\n\tif (!data.checkpoint) throw notIndexedYet();\n\treturn { chain: data.chainIdentifier, tip: BigInt(data.checkpoint.sequenceNumber) };\n}\n"],"mappings":";;;;;;AAUA,MAAM,gBAA4D;CACjE,uBAAuB;CACvB,iBAAiB;CAEjB,oBAAoB;CACpB;;AAGD,SAAgB,OAAe,QAA4C;CAC1E,MAAM,SAAS,OAAO,UAAU,EAAE;CAClC,MAAM,UAAU,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC,KAAK,KAAK;AAC/D,KAAI,OAAO,SAAS,GAAG;EACtB,MAAM,UAAU,OAAO,KAAK,EAAE,iBAAiB,cAAc,OAAO,YAAY,KAAK,EAAE;AAEvF,QAAM,IAAI,uBAAuB,SAAS;GAAE,QAD7B,QAAQ,OAAO,SAAS,SAAS,OAAU,GAAG,QAAQ,KAAK;GACtB,OAAO;GAAQ,CAAC;;AAErE,KAAI,CAAC,OAAO,KAAM,OAAM,IAAI,eAAe,YAAY,+BAA+B;AACtF,QAAO,OAAO;;AAGf,eAAsB,UACrB,QACA,SACkB;AAClB,QAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,CAAC;;AAG3C,SAAgB,gBAAgB;AAC/B,QAAO,IAAI,uBAAuB,sCAAsC,EACvE,QAAQ,eACR,CAAC;;;AAIH,eAAsB,aACrB,QACA,QAC0C;CAC1C,MAAM,OAAO,MAAM,UAAU,QAAQ;EAAE,OAAO;EAA2B;EAAQ,CAAC;AAClF,KAAI,CAAC,KAAK,WAAY,OAAM,eAAe;AAC3C,QAAO;EAAE,OAAO,KAAK;EAAiB,KAAK,OAAO,KAAK,WAAW,eAAe;EAAE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { httpStatusReason } from "../client/errors.mjs";
|
|
2
|
+
import { cancelQuietly } from "../client/utils.mjs";
|
|
3
|
+
import { SuiGraphQLRequestError } from "./errors.mjs";
|
|
4
|
+
import { ServerSentEventParser } from "./sse-parser.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/graphql/subscribe.ts
|
|
7
|
+
/** The largest SSE message, in characters, before the subscription fails. */
|
|
8
|
+
const MAX_MESSAGE_SIZE = 16 * 1024 * 1024;
|
|
9
|
+
/**
|
|
10
|
+
* Read a GraphQL-over-SSE response body.
|
|
11
|
+
* @yields GraphQL responses, preserving partial data and errors.
|
|
12
|
+
*/
|
|
13
|
+
async function* readGraphQLSSE(response, signal, onOpen) {
|
|
14
|
+
if (signal.aborted) {
|
|
15
|
+
cancelQuietly(response.body);
|
|
16
|
+
signal.throwIfAborted();
|
|
17
|
+
}
|
|
18
|
+
if (!response.ok) {
|
|
19
|
+
cancelQuietly(response.body);
|
|
20
|
+
throw new SuiGraphQLRequestError(`GraphQL subscription failed: ${response.statusText} (${response.status})`, { reason: httpStatusReason(response.status) });
|
|
21
|
+
}
|
|
22
|
+
if (response.headers.get("content-type")?.split(";", 1)[0].trim().toLowerCase() !== "text/event-stream" || !response.body) {
|
|
23
|
+
cancelQuietly(response.body);
|
|
24
|
+
throw new SuiGraphQLRequestError("GraphQL subscription requires a text/event-stream response");
|
|
25
|
+
}
|
|
26
|
+
onOpen?.();
|
|
27
|
+
const reader = response.body.getReader();
|
|
28
|
+
const decoder = new TextDecoder();
|
|
29
|
+
const parser = new ServerSentEventParser(MAX_MESSAGE_SIZE);
|
|
30
|
+
const abort = () => {
|
|
31
|
+
cancelQuietly(reader, signal.reason);
|
|
32
|
+
};
|
|
33
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
34
|
+
try {
|
|
35
|
+
while (true) {
|
|
36
|
+
let chunk;
|
|
37
|
+
try {
|
|
38
|
+
chunk = await reader.read();
|
|
39
|
+
} catch (cause) {
|
|
40
|
+
signal.throwIfAborted();
|
|
41
|
+
throw new SuiGraphQLRequestError("GraphQL subscription body could not be read", {
|
|
42
|
+
reason: "Unavailable",
|
|
43
|
+
cause
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
signal.throwIfAborted();
|
|
47
|
+
for (const message of parser.feed(decoder.decode(chunk.value, { stream: !chunk.done }))) {
|
|
48
|
+
signal.throwIfAborted();
|
|
49
|
+
if (message.event === "complete") return;
|
|
50
|
+
if (message.event && message.event !== "next" && message.event !== "message") continue;
|
|
51
|
+
let result;
|
|
52
|
+
try {
|
|
53
|
+
result = JSON.parse(message.data);
|
|
54
|
+
} catch (cause) {
|
|
55
|
+
throw new SuiGraphQLRequestError("Invalid GraphQL subscription response", { cause });
|
|
56
|
+
}
|
|
57
|
+
yield result;
|
|
58
|
+
}
|
|
59
|
+
if (chunk.done) return;
|
|
60
|
+
}
|
|
61
|
+
} finally {
|
|
62
|
+
signal.removeEventListener("abort", abort);
|
|
63
|
+
cancelQuietly(reader);
|
|
64
|
+
reader.releaseLock();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { readGraphQLSSE };
|
|
70
|
+
//# sourceMappingURL=subscribe.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.mjs","names":[],"sources":["../../src/graphql/subscribe.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { GraphQLQueryResult } from './client.js';\nimport { httpStatusReason } from '../client/errors.js';\nimport { cancelQuietly } from '../client/utils.js';\nimport { SuiGraphQLRequestError } from './errors.js';\nimport { ServerSentEventParser } from './sse-parser.js';\n\n/** The largest SSE message, in characters, before the subscription fails. */\nconst MAX_MESSAGE_SIZE = 16 * 1024 * 1024;\n\n/**\n * Read a GraphQL-over-SSE response body.\n * @yields GraphQL responses, preserving partial data and errors.\n */\nexport async function* readGraphQLSSE<Result>(\n\tresponse: Response,\n\tsignal: AbortSignal,\n\tonOpen?: () => void,\n): AsyncGenerator<GraphQLQueryResult<Result>> {\n\t// A custom `fetch` that ignores the signal can resolve after the abort.\n\tif (signal.aborted) {\n\t\tcancelQuietly(response.body);\n\t\tsignal.throwIfAborted();\n\t}\n\tif (!response.ok) {\n\t\tcancelQuietly(response.body);\n\t\tthrow new SuiGraphQLRequestError(\n\t\t\t`GraphQL subscription failed: ${response.statusText} (${response.status})`,\n\t\t\t{ reason: httpStatusReason(response.status) },\n\t\t);\n\t}\n\tif (\n\t\tresponse.headers.get('content-type')?.split(';', 1)[0].trim().toLowerCase() !==\n\t\t\t'text/event-stream' ||\n\t\t!response.body\n\t) {\n\t\tcancelQuietly(response.body);\n\t\tthrow new SuiGraphQLRequestError('GraphQL subscription requires a text/event-stream response');\n\t}\n\tonOpen?.();\n\tconst reader = response.body.getReader();\n\tconst decoder = new TextDecoder();\n\tconst parser = new ServerSentEventParser(MAX_MESSAGE_SIZE);\n\tconst abort = () => {\n\t\tcancelQuietly(reader, signal.reason);\n\t};\n\tsignal.addEventListener('abort', abort, { once: true });\n\ttry {\n\t\twhile (true) {\n\t\t\tlet chunk: ReadableStreamReadResult<Uint8Array>;\n\t\t\ttry {\n\t\t\t\tchunk = await reader.read();\n\t\t\t} catch (cause) {\n\t\t\t\tsignal.throwIfAborted();\n\t\t\t\tthrow new SuiGraphQLRequestError('GraphQL subscription body could not be read', {\n\t\t\t\t\treason: 'Unavailable',\n\t\t\t\t\tcause,\n\t\t\t\t});\n\t\t\t}\n\t\t\tsignal.throwIfAborted();\n\t\t\tfor (const message of parser.feed(decoder.decode(chunk.value, { stream: !chunk.done }))) {\n\t\t\t\tsignal.throwIfAborted();\n\t\t\t\tif (message.event === 'complete') return;\n\t\t\t\tif (message.event && message.event !== 'next' && message.event !== 'message') continue;\n\t\t\t\tlet result: GraphQLQueryResult<Result>;\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.parse(message.data);\n\t\t\t\t} catch (cause) {\n\t\t\t\t\tthrow new SuiGraphQLRequestError('Invalid GraphQL subscription response', { cause });\n\t\t\t\t}\n\t\t\t\tyield result;\n\t\t\t}\n\t\t\t// Sui closes a finished subscription without a `complete` event.\n\t\t\tif (chunk.done) return;\n\t\t}\n\t} finally {\n\t\tsignal.removeEventListener('abort', abort);\n\t\tcancelQuietly(reader);\n\t\treader.releaseLock();\n\t}\n}\n"],"mappings":";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B,OAAO;AACf,WAAM,IAAI,uBAAuB,yCAAyC,EAAE,OAAO,CAAC;;AAErF,UAAM;;AAGP,OAAI,MAAM,KAAM;;WAER;AACT,SAAO,oBAAoB,SAAS,MAAM;AAC1C,gBAAc,OAAO;AACrB,SAAO,aAAa"}
|
package/dist/grpc/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SuiClientTypes } from "../client/types.mjs";
|
|
2
1
|
import { TransactionPlugin } from "../transactions/resolve.mjs";
|
|
2
|
+
import { SuiClientTypes } from "../client/types.mjs";
|
|
3
3
|
import "../transactions/index.mjs";
|
|
4
4
|
import { BaseClient } from "../client/client.mjs";
|
|
5
5
|
import "../client/index.mjs";
|
|
@@ -14,6 +14,7 @@ import { SubscriptionServiceClient } from "./proto/sui/rpc/v2/subscription_servi
|
|
|
14
14
|
import { GrpcCoreClient } from "./core.mjs";
|
|
15
15
|
import { NameServiceClient } from "./proto/sui/rpc/v2/name_service.client.mjs";
|
|
16
16
|
import { ForkingServiceClient } from "./proto/sui/forking/v1alpha/forking_service.client.mjs";
|
|
17
|
+
import { GrpcStreamCheckpointsOptions, GrpcStreamEventsOptions, GrpcStreamTransactionsOptions } from "./stream-types.mjs";
|
|
17
18
|
import { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
18
19
|
import { GrpcWebOptions } from "@protobuf-ts/grpcweb-transport";
|
|
19
20
|
|
|
@@ -24,24 +25,17 @@ interface SuiGrpcTransportOptions extends GrpcWebOptions {
|
|
|
24
25
|
type SuiGrpcClientOptions = {
|
|
25
26
|
network: SuiClientTypes.Network;
|
|
26
27
|
mvr?: SuiClientTypes.MvrOptions;
|
|
28
|
+
/**
|
|
29
|
+
* `package`, `package::module` or `package::module::function` entries that transactions built
|
|
30
|
+
* with this client can't call. A per-call `restrictedMoveCalls` on `build` or `toJSON` takes
|
|
31
|
+
* precedence. Defaults to `DEFAULT_RESTRICTED_MOVE_CALLS`.
|
|
32
|
+
*/
|
|
33
|
+
restrictedMoveCalls?: readonly string[];
|
|
27
34
|
} & ({
|
|
28
35
|
transport: RpcTransport;
|
|
29
36
|
} | SuiGrpcTransportOptions);
|
|
30
37
|
declare const SUI_CLIENT_BRAND: never;
|
|
31
38
|
declare function isSuiGrpcClient(client: unknown): client is SuiGrpcClient;
|
|
32
|
-
interface DynamicFieldInclude {
|
|
33
|
-
value?: boolean;
|
|
34
|
-
}
|
|
35
|
-
type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> = SuiClientTypes.DynamicFieldEntry & {
|
|
36
|
-
value: Include extends {
|
|
37
|
-
value: true;
|
|
38
|
-
} ? SuiClientTypes.DynamicFieldValue : undefined;
|
|
39
|
-
};
|
|
40
|
-
interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {
|
|
41
|
-
hasNextPage: boolean;
|
|
42
|
-
cursor: string | null;
|
|
43
|
-
dynamicFields: DynamicFieldEntryWithValue<Include>[];
|
|
44
|
-
}
|
|
45
39
|
interface GrpcTransactionInclude extends SuiClientTypes.TransactionInclude {
|
|
46
40
|
/** Include the parsed protobuf JSON value for the gRPC transaction response. */
|
|
47
41
|
protoJson?: boolean;
|
|
@@ -79,16 +73,6 @@ interface GrpcSignAndExecuteTransactionOptions<Include extends GrpcTransactionIn
|
|
|
79
73
|
}
|
|
80
74
|
interface GrpcSimulateTransactionOptions<Include extends GrpcSimulateTransactionInclude = {}> extends SuiClientTypes.SimulateTransactionOptions<Include> {
|
|
81
75
|
include?: Include & GrpcSimulateTransactionInclude;
|
|
82
|
-
/**
|
|
83
|
-
* Overrides whether the server selects gas payment during simulation.
|
|
84
|
-
*
|
|
85
|
-
* When not set, gas selection is enabled only when the transaction's gas payment is explicitly
|
|
86
|
-
* set to an empty list (`[]`); the server then pays gas from the sender's address balance or
|
|
87
|
-
* coin objects. Transactions with gas coins set are simulated as-is, and transactions without a
|
|
88
|
-
* gas payment are simulated with a mocked gas coin (reported as `gasPaymentMocked` on the
|
|
89
|
-
* result).
|
|
90
|
-
*/
|
|
91
|
-
doGasSelection?: boolean;
|
|
92
76
|
}
|
|
93
77
|
declare class SuiGrpcClient extends BaseClient implements SuiClientTypes.TransportMethods {
|
|
94
78
|
[SUI_CLIENT_BRAND]: boolean;
|
|
@@ -119,18 +103,38 @@ declare class SuiGrpcClient extends BaseClient implements SuiClientTypes.Transpo
|
|
|
119
103
|
getCurrentSystemState(input?: SuiClientTypes.GetCurrentSystemStateOptions): Promise<SuiClientTypes.GetCurrentSystemStateResponse>;
|
|
120
104
|
getProtocolConfig(input?: SuiClientTypes.GetProtocolConfigOptions): Promise<SuiClientTypes.GetProtocolConfigResponse>;
|
|
121
105
|
getChainIdentifier(input?: SuiClientTypes.GetChainIdentifierOptions): Promise<SuiClientTypes.GetChainIdentifierResponse>;
|
|
122
|
-
listDynamicFields<Include extends DynamicFieldInclude = {}>(input: SuiClientTypes.ListDynamicFieldsOptions
|
|
123
|
-
include?: Include & DynamicFieldInclude;
|
|
124
|
-
}): Promise<ListDynamicFieldsWithValueResponse<Include>>;
|
|
106
|
+
listDynamicFields<Include extends SuiClientTypes.DynamicFieldInclude = {}>(input: SuiClientTypes.ListDynamicFieldsOptions<Include>): Promise<SuiClientTypes.ListDynamicFieldsResponse<Include>>;
|
|
125
107
|
getDynamicField(input: SuiClientTypes.GetDynamicFieldOptions): Promise<SuiClientTypes.GetDynamicFieldResponse>;
|
|
108
|
+
getAddressAliases(input: SuiClientTypes.GetAddressAliasesOptions): Promise<SuiClientTypes.GetAddressAliasesResponse>;
|
|
126
109
|
getDynamicObjectField<Include extends SuiClientTypes.ObjectInclude = {}>(input: SuiClientTypes.GetDynamicObjectFieldOptions<Include>): Promise<SuiClientTypes.GetDynamicObjectFieldResponse<Include>>;
|
|
127
110
|
listTransactions<Include extends SuiClientTypes.TransactionInclude = {}>(input: SuiClientTypes.ListTransactionsOptions<Include>): Promise<SuiClientTypes.ListTransactionsResponse<Include>>;
|
|
128
111
|
listEvents(input: SuiClientTypes.ListEventsOptions): Promise<SuiClientTypes.ListEventsResponse>;
|
|
112
|
+
listCheckpoints(input: SuiClientTypes.ListCheckpointsOptions): Promise<SuiClientTypes.ListCheckpointsResponse>;
|
|
129
113
|
getMoveFunction(input: SuiClientTypes.GetMoveFunctionOptions): Promise<SuiClientTypes.GetMoveFunctionResponse>;
|
|
130
114
|
resolveTransactionPlugin(): TransactionPlugin;
|
|
115
|
+
verifySignature(input: SuiClientTypes.VerifySignatureOptions): Promise<SuiClientTypes.VerifySignatureResponse>;
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated Use `verifySignature`. This method accepts signatures from the address's aliases,
|
|
118
|
+
* like `verifySignature` does by default.
|
|
119
|
+
*/
|
|
131
120
|
verifyZkLoginSignature(input: SuiClientTypes.VerifyZkLoginSignatureOptions): Promise<SuiClientTypes.ZkLoginVerifyResponse>;
|
|
132
121
|
defaultNameServiceName(input: SuiClientTypes.DefaultNameServiceNameOptions): Promise<SuiClientTypes.DefaultNameServiceNameResponse>;
|
|
133
122
|
resolveNameServiceAddress(input: SuiClientTypes.ResolveNameServiceAddressOptions): Promise<SuiClientTypes.ResolveNameServiceAddressResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Streams checkpoints in ledger order, resumable from any frame's `resumeToken`, following new
|
|
125
|
+
* checkpoints by default. `grpcFilter` keeps only checkpoints with a matching transaction.
|
|
126
|
+
*/
|
|
127
|
+
streamCheckpoints<Include extends SuiClientTypes.StreamCheckpointInclude = {}, Frames extends SuiClientTypes.StreamFrameOptions = {}>(options?: GrpcStreamCheckpointsOptions<Include, Frames>): AsyncGenerator<SuiClientTypes.StreamCheckpointFrame<Include, Frames>>;
|
|
128
|
+
/**
|
|
129
|
+
* Streams transactions matching `filter` in ledger order, resumable from any frame's
|
|
130
|
+
* `resumeToken`. `grpcFilter` replaces `filter` with a native filter.
|
|
131
|
+
*/
|
|
132
|
+
streamTransactions<Include extends SuiClientTypes.TransactionInclude = {}, Frames extends SuiClientTypes.StreamFrameOptions = {}>(options?: GrpcStreamTransactionsOptions<Include, Frames>): AsyncGenerator<SuiClientTypes.StreamTransactionFrame<Include, Frames>>;
|
|
133
|
+
/**
|
|
134
|
+
* Streams events matching `filter` in ledger order, resumable from any frame's `resumeToken`.
|
|
135
|
+
* `grpcFilter` replaces `filter` with a native filter.
|
|
136
|
+
*/
|
|
137
|
+
streamEvents<Frames extends SuiClientTypes.StreamFrameOptions = {}>(options?: GrpcStreamEventsOptions<Frames>): AsyncGenerator<SuiClientTypes.StreamEventFrame<Frames>>;
|
|
134
138
|
}
|
|
135
139
|
//#endregion
|
|
136
140
|
export { GrpcExecuteTransactionOptions, GrpcGetTransactionOptions, GrpcSignAndExecuteTransactionOptions, GrpcSimulateTransactionInclude, GrpcSimulateTransactionOptions, GrpcSimulateTransactionProtoJson, GrpcSimulateTransactionResult, GrpcTransactionInclude, GrpcTransactionProtoJson, GrpcTransactionResult, GrpcWaitForTransactionOptions, SuiGrpcClient, SuiGrpcClientOptions, isSuiGrpcClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/grpc/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/grpc/client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAwBU,uBAAA,SAAgC,cAAA;EACzC,SAAA;AAAA;AAAA,KAGW,oBAAA;EACX,OAAA,EAAS,cAAA,CAAe,OAAA;EACxB,GAAA,GAAM,cAAA,CAAe,UAAA;EANZ;;;;;EAYT,mBAAA;AAAA;EAGE,SAAA,EAAW,YAAA;AAAA,IAEX,uBAAA;AAAA,cAGG,gBAAA;AAAA,iBAEU,eAAA,CAAgB,MAAA,YAAkB,MAAA,IAAU,aAAA;AAAA,UAM3C,sBAAA,SAA+B,cAAA,CAAe,kBAAA;EAXrC;EAazB,SAAA;AAAA;AAAA,UAGgB,8BAAA,SAAuC,cAAA,CAAe,0BAAA;EA5B9C;EA8BxB,SAAA;AAAA;AAA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B,OAAA,GAAU,6BAAA,CAA8B,OAAA,EAAS,MAAA,IAC/C,cAAA,CAAe,cAAA,CAAe,sBAAA,CAAuB,OAAA,EAAS,MAAA;EArS3C;;;;EA6StB,YAAA,gBAA4B,cAAA,CAAe,kBAAA,MAAA,CAC1C,OAAA,GAAU,uBAAA,CAAwB,MAAA,IAChC,cAAA,CAAe,cAAA,CAAe,gBAAA,CAAiB,MAAA;AAAA"}
|
package/dist/grpc/client.mjs
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { normalizeStructTag } from "../utils/sui-types.mjs";
|
|
2
1
|
import { BaseClient } from "../client/client.mjs";
|
|
3
2
|
import { TransactionExecutionServiceClient } from "./proto/sui/rpc/v2/transaction_execution_service.client.mjs";
|
|
4
3
|
import { LedgerServiceClient } from "./proto/sui/rpc/v2/ledger_service.client.mjs";
|
|
5
4
|
import { MovePackageServiceClient } from "./proto/sui/rpc/v2/move_package_service.client.mjs";
|
|
6
5
|
import { SignatureVerificationServiceClient } from "./proto/sui/rpc/v2/signature_verification_service.client.mjs";
|
|
7
|
-
import { DynamicField_DynamicFieldKind } from "./proto/sui/rpc/v2/state_service.mjs";
|
|
8
6
|
import { StateServiceClient } from "./proto/sui/rpc/v2/state_service.client.mjs";
|
|
9
7
|
import { SubscriptionServiceClient } from "./proto/sui/rpc/v2/subscription_service.client.mjs";
|
|
10
|
-
import { GrpcWebFetchTransport, withClientProtocolVersion } from "./transport.mjs";
|
|
11
8
|
import { GrpcCoreClient } from "./core.mjs";
|
|
12
9
|
import { NameServiceClient } from "./proto/sui/rpc/v2/name_service.client.mjs";
|
|
13
10
|
import { ForkingServiceClient } from "./proto/sui/forking/v1alpha/forking_service.client.mjs";
|
|
14
|
-
import {
|
|
11
|
+
import { GrpcWebFetchTransport, withClientDefaults } from "./transport.mjs";
|
|
15
12
|
|
|
16
13
|
//#region src/grpc/client.ts
|
|
17
14
|
const SUI_CLIENT_BRAND = Symbol.for("@mysten/SuiGrpcClient");
|
|
@@ -27,8 +24,8 @@ var SuiGrpcClient = class extends BaseClient {
|
|
|
27
24
|
}
|
|
28
25
|
constructor(options) {
|
|
29
26
|
super({ network: options.network });
|
|
30
|
-
const { network: _network, mvr: _mvr, abort: _abort, transport: providedTransport, ...transportOptions } = options;
|
|
31
|
-
const transport =
|
|
27
|
+
const { network: _network, mvr: _mvr, restrictedMoveCalls: _restrictedMoveCalls, abort: _abort, transport: providedTransport, ...transportOptions } = options;
|
|
28
|
+
const transport = withClientDefaults(providedTransport ?? new GrpcWebFetchTransport(transportOptions));
|
|
32
29
|
this.transactionExecutionService = new TransactionExecutionServiceClient(transport);
|
|
33
30
|
this.ledgerService = new LedgerServiceClient(transport);
|
|
34
31
|
this.stateService = new StateServiceClient(transport);
|
|
@@ -39,9 +36,11 @@ var SuiGrpcClient = class extends BaseClient {
|
|
|
39
36
|
this.forkingService = new ForkingServiceClient(transport);
|
|
40
37
|
this.core = new GrpcCoreClient({
|
|
41
38
|
client: this,
|
|
39
|
+
transport,
|
|
42
40
|
base: this,
|
|
43
41
|
network: options.network,
|
|
44
|
-
mvr: options.mvr
|
|
42
|
+
mvr: options.mvr,
|
|
43
|
+
restrictedMoveCalls: options.restrictedMoveCalls
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
46
|
getObjects(input) {
|
|
@@ -92,49 +91,15 @@ var SuiGrpcClient = class extends BaseClient {
|
|
|
92
91
|
getChainIdentifier(input) {
|
|
93
92
|
return this.core.getChainIdentifier(input);
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const paths = [
|
|
98
|
-
"field_id",
|
|
99
|
-
"name",
|
|
100
|
-
"value_type",
|
|
101
|
-
"kind",
|
|
102
|
-
"child_id"
|
|
103
|
-
];
|
|
104
|
-
if (includeValue) paths.push("value");
|
|
105
|
-
const response = await this.stateService.listDynamicFields({
|
|
106
|
-
parent: input.parentId,
|
|
107
|
-
pageToken: input.cursor ? fromBase64(input.cursor) : void 0,
|
|
108
|
-
pageSize: input.limit,
|
|
109
|
-
readMask: { paths }
|
|
110
|
-
}, { abort: input.signal });
|
|
111
|
-
return {
|
|
112
|
-
dynamicFields: response.response.dynamicFields.map((field) => {
|
|
113
|
-
const isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;
|
|
114
|
-
const fieldType = isDynamicObject ? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${field.name?.name}>,0x2::object::ID>` : `0x2::dynamic_field::Field<${field.name?.name},${field.valueType}>`;
|
|
115
|
-
return {
|
|
116
|
-
$kind: isDynamicObject ? "DynamicObject" : "DynamicField",
|
|
117
|
-
fieldId: field.fieldId,
|
|
118
|
-
name: {
|
|
119
|
-
type: field.name?.name,
|
|
120
|
-
bcs: field.name?.value
|
|
121
|
-
},
|
|
122
|
-
valueType: field.valueType,
|
|
123
|
-
type: normalizeStructTag(fieldType),
|
|
124
|
-
childId: field.childId,
|
|
125
|
-
value: includeValue ? {
|
|
126
|
-
type: field.valueType,
|
|
127
|
-
bcs: field.value?.value ?? new Uint8Array()
|
|
128
|
-
} : void 0
|
|
129
|
-
};
|
|
130
|
-
}),
|
|
131
|
-
cursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null,
|
|
132
|
-
hasNextPage: response.response.nextPageToken !== void 0
|
|
133
|
-
};
|
|
94
|
+
listDynamicFields(input) {
|
|
95
|
+
return this.core.listDynamicFields(input);
|
|
134
96
|
}
|
|
135
97
|
getDynamicField(input) {
|
|
136
98
|
return this.core.getDynamicField(input);
|
|
137
99
|
}
|
|
100
|
+
getAddressAliases(input) {
|
|
101
|
+
return this.core.getAddressAliases(input);
|
|
102
|
+
}
|
|
138
103
|
getDynamicObjectField(input) {
|
|
139
104
|
return this.core.getDynamicObjectField(input);
|
|
140
105
|
}
|
|
@@ -144,12 +109,22 @@ var SuiGrpcClient = class extends BaseClient {
|
|
|
144
109
|
listEvents(input) {
|
|
145
110
|
return this.core.listEvents(input);
|
|
146
111
|
}
|
|
112
|
+
listCheckpoints(input) {
|
|
113
|
+
return this.core.listCheckpoints(input);
|
|
114
|
+
}
|
|
147
115
|
getMoveFunction(input) {
|
|
148
116
|
return this.core.getMoveFunction(input);
|
|
149
117
|
}
|
|
150
118
|
resolveTransactionPlugin() {
|
|
151
119
|
return this.core.resolveTransactionPlugin();
|
|
152
120
|
}
|
|
121
|
+
verifySignature(input) {
|
|
122
|
+
return this.core.verifySignature(input);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @deprecated Use `verifySignature`. This method accepts signatures from the address's aliases,
|
|
126
|
+
* like `verifySignature` does by default.
|
|
127
|
+
*/
|
|
153
128
|
verifyZkLoginSignature(input) {
|
|
154
129
|
return this.core.verifyZkLoginSignature(input);
|
|
155
130
|
}
|
|
@@ -159,6 +134,27 @@ var SuiGrpcClient = class extends BaseClient {
|
|
|
159
134
|
resolveNameServiceAddress(input) {
|
|
160
135
|
return this.core.resolveNameServiceAddress(input);
|
|
161
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Streams checkpoints in ledger order, resumable from any frame's `resumeToken`, following new
|
|
139
|
+
* checkpoints by default. `grpcFilter` keeps only checkpoints with a matching transaction.
|
|
140
|
+
*/
|
|
141
|
+
streamCheckpoints(options) {
|
|
142
|
+
return this.core.streamCheckpoints(options);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Streams transactions matching `filter` in ledger order, resumable from any frame's
|
|
146
|
+
* `resumeToken`. `grpcFilter` replaces `filter` with a native filter.
|
|
147
|
+
*/
|
|
148
|
+
streamTransactions(options) {
|
|
149
|
+
return this.core.streamTransactions(options);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Streams events matching `filter` in ledger order, resumable from any frame's `resumeToken`.
|
|
153
|
+
* `grpcFilter` replaces `filter` with a native filter.
|
|
154
|
+
*/
|
|
155
|
+
streamEvents(options) {
|
|
156
|
+
return this.core.streamEvents(options);
|
|
157
|
+
}
|
|
162
158
|
};
|
|
163
159
|
|
|
164
160
|
//#endregion
|
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 { 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';\nimport { GrpcWebFetchTransport, withClientProtocolVersion } from './transport.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 interface GrpcTransactionInclude extends SuiClientTypes.TransactionInclude {\n\t/** Include the parsed protobuf JSON value for the gRPC transaction response. */\n\tprotoJson?: boolean;\n}\n\nexport interface GrpcSimulateTransactionInclude extends SuiClientTypes.SimulateTransactionInclude {\n\t/** Include the parsed protobuf JSON value for the gRPC simulation response. */\n\tprotoJson?: boolean;\n}\n\nexport type GrpcTransactionProtoJson = ReturnType<\n\ttypeof import('./proto/sui/rpc/v2/executed_transaction.js').ExecutedTransaction.toJson\n>;\n\nexport type GrpcSimulateTransactionProtoJson = ReturnType<\n\ttypeof import('./proto/sui/rpc/v2/transaction_execution_service.js').SimulateTransactionResponse.toJson\n>;\n\ntype ProtoJson<Include extends { protoJson?: boolean }, Json> = Include['protoJson'] extends true\n\t? Json\n\t: undefined;\n\nexport type GrpcTransactionResult<Include extends GrpcTransactionInclude = {}> =\n\tSuiClientTypes.TransactionResult<Include> & {\n\t\tprotoJson: ProtoJson<Include, GrpcTransactionProtoJson>;\n\t};\n\nexport type GrpcSimulateTransactionResult<Include extends GrpcSimulateTransactionInclude = {}> =\n\tSuiClientTypes.SimulateTransactionResult<Include> & {\n\t\tprotoJson: ProtoJson<Include, GrpcSimulateTransactionProtoJson>;\n\t};\n\nexport interface GrpcGetTransactionOptions<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.GetTransactionOptions<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcWaitForTransactionByDigest<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.WaitForTransactionByDigest<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcWaitForTransactionByResult<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.WaitForTransactionByResult<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport type GrpcWaitForTransactionOptions<Include extends GrpcTransactionInclude = {}> =\n\tGrpcWaitForTransactionByDigest<Include> | GrpcWaitForTransactionByResult<Include>;\n\nexport interface GrpcExecuteTransactionOptions<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.ExecuteTransactionOptions<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcSignAndExecuteTransactionOptions<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.SignAndExecuteTransactionOptions<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcSimulateTransactionOptions<\n\tInclude extends GrpcSimulateTransactionInclude = {},\n> extends SuiClientTypes.SimulateTransactionOptions<Include> {\n\tinclude?: Include & GrpcSimulateTransactionInclude;\n\t/**\n\t * Overrides whether the server selects gas payment during simulation.\n\t *\n\t * When not set, gas selection is enabled only when the transaction's gas payment is explicitly\n\t * set to an empty list (`[]`); the server then pays gas from the sender's address balance or\n\t * coin objects. Transactions with gas coins set are simulated as-is, and transactions without a\n\t * gas payment are simulated with a mocked gas coin (reported as `gasPaymentMocked` on the\n\t * result).\n\t */\n\tdoGasSelection?: boolean;\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 {\n\t\t\tnetwork: _network,\n\t\t\tmvr: _mvr,\n\t\t\t// Not forwarded: every Core API call passes its own `signal`, which would overwrite it.\n\t\t\tabort: _abort,\n\t\t\ttransport: providedTransport,\n\t\t\t...transportOptions\n\t\t} = options as SuiGrpcClientOptions & SuiGrpcTransportOptions & { transport?: RpcTransport };\n\n\t\t// Add the protocol-version default for every transport, including native gRPC.\n\t\tconst transport = withClientProtocolVersion(\n\t\t\tprovidedTransport ?? new GrpcWebFetchTransport(transportOptions),\n\t\t);\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 GrpcTransactionInclude = {}>(\n\t\tinput: GrpcGetTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.getTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\texecuteTransaction<Include extends GrpcTransactionInclude = {}>(\n\t\tinput: GrpcExecuteTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.executeTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\tsignAndExecuteTransaction<Include extends GrpcTransactionInclude = {}>(\n\t\tinput: GrpcSignAndExecuteTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.signAndExecuteTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\twaitForTransaction<Include extends GrpcTransactionInclude = {}>(\n\t\tinput: GrpcWaitForTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.waitForTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\tsimulateTransaction<Include extends GrpcSimulateTransactionInclude = {}>(\n\t\tinput: GrpcSimulateTransactionOptions<Include>,\n\t): Promise<GrpcSimulateTransactionResult<Include>> {\n\t\treturn this.core.simulateTransaction(input) as Promise<GrpcSimulateTransactionResult<Include>>;\n\t}\n\n\tgetReferenceGasPrice(\n\t\tinput?: SuiClientTypes.GetReferenceGasPriceOptions,\n\t): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {\n\t\treturn this.core.getReferenceGasPrice(input);\n\t}\n\n\tgetCurrentSystemState(\n\t\tinput?: SuiClientTypes.GetCurrentSystemStateOptions,\n\t): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {\n\t\treturn this.core.getCurrentSystemState(input);\n\t}\n\n\tgetProtocolConfig(\n\t\tinput?: SuiClientTypes.GetProtocolConfigOptions,\n\t): Promise<SuiClientTypes.GetProtocolConfigResponse> {\n\t\treturn this.core.getProtocolConfig(input);\n\t}\n\n\tgetChainIdentifier(\n\t\tinput?: SuiClientTypes.GetChainIdentifierOptions,\n\t): Promise<SuiClientTypes.GetChainIdentifierResponse> {\n\t\treturn this.core.getChainIdentifier(input);\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\tgetDynamicObjectField<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetDynamicObjectFieldOptions<Include>,\n\t): Promise<SuiClientTypes.GetDynamicObjectFieldResponse<Include>> {\n\t\treturn this.core.getDynamicObjectField(input);\n\t}\n\n\tlistTransactions<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.ListTransactionsOptions<Include>,\n\t): Promise<SuiClientTypes.ListTransactionsResponse<Include>> {\n\t\treturn this.core.listTransactions(input);\n\t}\n\n\tlistEvents(input: SuiClientTypes.ListEventsOptions): Promise<SuiClientTypes.ListEventsResponse> {\n\t\treturn this.core.listEvents(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\tresolveNameServiceAddress(\n\t\tinput: SuiClientTypes.ResolveNameServiceAddressOptions,\n\t): Promise<SuiClientTypes.ResolveNameServiceAddressResponse> {\n\t\treturn this.core.resolveNameServiceAddress(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;;AAoGzF,IAAa,gBAAb,cAAmC,WAAsD;CAExF,IAAI,MAAiC;AACpC,SAAO,KAAK,KAAK;;CAWlB,KAAK,oBAAoB;AACxB,SAAO;;CAGR,YAAY,SAA+B;AAC1C,QAAM,EAAE,SA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GF,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,sBACC,OACiE;AACjE,SAAO,KAAK,KAAK,sBAAsB,MAAM;;CAG9C,iBACC,OAC4D;AAC5D,SAAO,KAAK,KAAK,iBAAiB,MAAM;;CAGzC,WAAW,OAAqF;AAC/F,SAAO,KAAK,KAAK,WAAW,MAAM;;CAGnC,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;;CAG/C,0BACC,OAC4D;AAC5D,SAAO,KAAK,KAAK,0BAA0B,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 { 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 { 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';\nimport { GrpcWebFetchTransport, withClientDefaults } from './transport.js';\nimport type { GrpcWebOptions } from '@protobuf-ts/grpcweb-transport';\nimport type {\n\tGrpcStreamCheckpointsOptions,\n\tGrpcStreamEventsOptions,\n\tGrpcStreamTransactionsOptions,\n} from './stream-types.js';\n\ninterface SuiGrpcTransportOptions extends GrpcWebOptions {\n\ttransport?: never;\n}\n\nexport type SuiGrpcClientOptions = {\n\tnetwork: SuiClientTypes.Network;\n\tmvr?: SuiClientTypes.MvrOptions;\n\t/**\n\t * `package`, `package::module` or `package::module::function` entries that transactions built\n\t * with this client can't call. A per-call `restrictedMoveCalls` on `build` or `toJSON` takes\n\t * precedence. Defaults to `DEFAULT_RESTRICTED_MOVE_CALLS`.\n\t */\n\trestrictedMoveCalls?: readonly string[];\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 GrpcTransactionInclude extends SuiClientTypes.TransactionInclude {\n\t/** Include the parsed protobuf JSON value for the gRPC transaction response. */\n\tprotoJson?: boolean;\n}\n\nexport interface GrpcSimulateTransactionInclude extends SuiClientTypes.SimulateTransactionInclude {\n\t/** Include the parsed protobuf JSON value for the gRPC simulation response. */\n\tprotoJson?: boolean;\n}\n\nexport type GrpcTransactionProtoJson = ReturnType<\n\ttypeof import('./proto/sui/rpc/v2/executed_transaction.js').ExecutedTransaction.toJson\n>;\n\nexport type GrpcSimulateTransactionProtoJson = ReturnType<\n\ttypeof import('./proto/sui/rpc/v2/transaction_execution_service.js').SimulateTransactionResponse.toJson\n>;\n\ntype ProtoJson<Include extends { protoJson?: boolean }, Json> = Include['protoJson'] extends true\n\t? Json\n\t: undefined;\n\nexport type GrpcTransactionResult<Include extends GrpcTransactionInclude = {}> =\n\tSuiClientTypes.TransactionResult<Include> & {\n\t\tprotoJson: ProtoJson<Include, GrpcTransactionProtoJson>;\n\t};\n\nexport type GrpcSimulateTransactionResult<Include extends GrpcSimulateTransactionInclude = {}> =\n\tSuiClientTypes.SimulateTransactionResult<Include> & {\n\t\tprotoJson: ProtoJson<Include, GrpcSimulateTransactionProtoJson>;\n\t};\n\nexport interface GrpcGetTransactionOptions<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.GetTransactionOptions<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcWaitForTransactionByDigest<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.WaitForTransactionByDigest<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcWaitForTransactionByResult<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.WaitForTransactionByResult<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport type GrpcWaitForTransactionOptions<Include extends GrpcTransactionInclude = {}> =\n\tGrpcWaitForTransactionByDigest<Include> | GrpcWaitForTransactionByResult<Include>;\n\nexport interface GrpcExecuteTransactionOptions<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.ExecuteTransactionOptions<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcSignAndExecuteTransactionOptions<\n\tInclude extends GrpcTransactionInclude = {},\n> extends SuiClientTypes.SignAndExecuteTransactionOptions<Include> {\n\tinclude?: Include & GrpcTransactionInclude;\n}\n\nexport interface GrpcSimulateTransactionOptions<\n\tInclude extends GrpcSimulateTransactionInclude = {},\n> extends SuiClientTypes.SimulateTransactionOptions<Include> {\n\tinclude?: Include & GrpcSimulateTransactionInclude;\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 {\n\t\t\tnetwork: _network,\n\t\t\tmvr: _mvr,\n\t\t\trestrictedMoveCalls: _restrictedMoveCalls,\n\t\t\t// Not forwarded: every Core API call passes its own `signal`, which would overwrite it.\n\t\t\tabort: _abort,\n\t\t\ttransport: providedTransport,\n\t\t\t...transportOptions\n\t\t} = options as SuiGrpcClientOptions & SuiGrpcTransportOptions & { transport?: RpcTransport };\n\n\t\t// Add the protocol-version header and fill unset request oneofs for every transport,\n\t\t// including native gRPC.\n\t\tconst transport = withClientDefaults(\n\t\t\tprovidedTransport ?? new GrpcWebFetchTransport(transportOptions),\n\t\t);\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\ttransport,\n\t\t\tbase: this,\n\t\t\tnetwork: options.network,\n\t\t\tmvr: options.mvr,\n\t\t\trestrictedMoveCalls: options.restrictedMoveCalls,\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 GrpcTransactionInclude = {}>(\n\t\tinput: GrpcGetTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.getTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\texecuteTransaction<Include extends GrpcTransactionInclude = {}>(\n\t\tinput: GrpcExecuteTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.executeTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\tsignAndExecuteTransaction<Include extends GrpcTransactionInclude = {}>(\n\t\tinput: GrpcSignAndExecuteTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.signAndExecuteTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\twaitForTransaction<Include extends GrpcTransactionInclude = {}>(\n\t\tinput: GrpcWaitForTransactionOptions<Include>,\n\t): Promise<GrpcTransactionResult<Include>> {\n\t\treturn this.core.waitForTransaction(input) as Promise<GrpcTransactionResult<Include>>;\n\t}\n\n\tsimulateTransaction<Include extends GrpcSimulateTransactionInclude = {}>(\n\t\tinput: GrpcSimulateTransactionOptions<Include>,\n\t): Promise<GrpcSimulateTransactionResult<Include>> {\n\t\treturn this.core.simulateTransaction(input) as Promise<GrpcSimulateTransactionResult<Include>>;\n\t}\n\n\tgetReferenceGasPrice(\n\t\tinput?: SuiClientTypes.GetReferenceGasPriceOptions,\n\t): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {\n\t\treturn this.core.getReferenceGasPrice(input);\n\t}\n\n\tgetCurrentSystemState(\n\t\tinput?: SuiClientTypes.GetCurrentSystemStateOptions,\n\t): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {\n\t\treturn this.core.getCurrentSystemState(input);\n\t}\n\n\tgetProtocolConfig(\n\t\tinput?: SuiClientTypes.GetProtocolConfigOptions,\n\t): Promise<SuiClientTypes.GetProtocolConfigResponse> {\n\t\treturn this.core.getProtocolConfig(input);\n\t}\n\n\tgetChainIdentifier(\n\t\tinput?: SuiClientTypes.GetChainIdentifierOptions,\n\t): Promise<SuiClientTypes.GetChainIdentifierResponse> {\n\t\treturn this.core.getChainIdentifier(input);\n\t}\n\n\tlistDynamicFields<Include extends SuiClientTypes.DynamicFieldInclude = {}>(\n\t\tinput: SuiClientTypes.ListDynamicFieldsOptions<Include>,\n\t): Promise<SuiClientTypes.ListDynamicFieldsResponse<Include>> {\n\t\treturn this.core.listDynamicFields(input);\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\tgetAddressAliases(\n\t\tinput: SuiClientTypes.GetAddressAliasesOptions,\n\t): Promise<SuiClientTypes.GetAddressAliasesResponse> {\n\t\treturn this.core.getAddressAliases(input);\n\t}\n\n\tgetDynamicObjectField<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetDynamicObjectFieldOptions<Include>,\n\t): Promise<SuiClientTypes.GetDynamicObjectFieldResponse<Include>> {\n\t\treturn this.core.getDynamicObjectField(input);\n\t}\n\n\tlistTransactions<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.ListTransactionsOptions<Include>,\n\t): Promise<SuiClientTypes.ListTransactionsResponse<Include>> {\n\t\treturn this.core.listTransactions(input);\n\t}\n\n\tlistEvents(input: SuiClientTypes.ListEventsOptions): Promise<SuiClientTypes.ListEventsResponse> {\n\t\treturn this.core.listEvents(input);\n\t}\n\n\tlistCheckpoints(\n\t\tinput: SuiClientTypes.ListCheckpointsOptions,\n\t): Promise<SuiClientTypes.ListCheckpointsResponse> {\n\t\treturn this.core.listCheckpoints(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\tverifySignature(\n\t\tinput: SuiClientTypes.VerifySignatureOptions,\n\t): Promise<SuiClientTypes.VerifySignatureResponse> {\n\t\treturn this.core.verifySignature(input);\n\t}\n\n\t/**\n\t * @deprecated Use `verifySignature`. This method accepts signatures from the address's aliases,\n\t * like `verifySignature` does by default.\n\t */\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\tresolveNameServiceAddress(\n\t\tinput: SuiClientTypes.ResolveNameServiceAddressOptions,\n\t): Promise<SuiClientTypes.ResolveNameServiceAddressResponse> {\n\t\treturn this.core.resolveNameServiceAddress(input);\n\t}\n\n\t/**\n\t * Streams checkpoints in ledger order, resumable from any frame's `resumeToken`, following new\n\t * checkpoints by default. `grpcFilter` keeps only checkpoints with a matching transaction.\n\t */\n\tstreamCheckpoints<\n\t\tInclude extends SuiClientTypes.StreamCheckpointInclude = {},\n\t\tFrames extends SuiClientTypes.StreamFrameOptions = {},\n\t>(\n\t\toptions?: GrpcStreamCheckpointsOptions<Include, Frames>,\n\t): AsyncGenerator<SuiClientTypes.StreamCheckpointFrame<Include, Frames>> {\n\t\treturn this.core.streamCheckpoints(options);\n\t}\n\n\t/**\n\t * Streams transactions matching `filter` in ledger order, resumable from any frame's\n\t * `resumeToken`. `grpcFilter` replaces `filter` with a native filter.\n\t */\n\tstreamTransactions<\n\t\tInclude extends SuiClientTypes.TransactionInclude = {},\n\t\tFrames extends SuiClientTypes.StreamFrameOptions = {},\n\t>(\n\t\toptions?: GrpcStreamTransactionsOptions<Include, Frames>,\n\t): AsyncGenerator<SuiClientTypes.StreamTransactionFrame<Include, Frames>> {\n\t\treturn this.core.streamTransactions(options);\n\t}\n\n\t/**\n\t * Streams events matching `filter` in ledger order, resumable from any frame's `resumeToken`.\n\t * `grpcFilter` replaces `filter` with a native filter.\n\t */\n\tstreamEvents<Frames extends SuiClientTypes.StreamFrameOptions = {}>(\n\t\toptions?: GrpcStreamEventsOptions<Frames>,\n\t): AsyncGenerator<SuiClientTypes.StreamEventFrame<Frames>> {\n\t\treturn this.core.streamEvents(options);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AA4CA,MAAM,mBAAmB,OAAO,IAAI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uB,MAAM;;CAG/C,uBACC,OACyD;AACzD,SAAO,KAAK,KAAK,uBAAuB,MAAM;;CAG/C,0BACC,OAC4D;AAC5D,SAAO,KAAK,KAAK,0BAA0B,MAAM;;;;;;CAOlD,kBAIC,SACwE;AACxE,SAAO,KAAK,KAAK,kBAAkB,QAAQ;;;;;;CAO5C,mBAIC,SACyE;AACzE,SAAO,KAAK,KAAK,mBAAmB,QAAQ;;;;;;CAO7C,aACC,SAC0D;AAC1D,SAAO,KAAK,KAAK,aAAa,QAAQ"}
|
package/dist/grpc/core.d.mts
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import { SuiClientTypes } from "../client/types.mjs";
|
|
2
1
|
import { TransactionDataBuilder } from "../transactions/TransactionData.mjs";
|
|
3
2
|
import { BuildTransactionOptions } from "../transactions/resolve.mjs";
|
|
3
|
+
import { SuiClientTypes } from "../client/types.mjs";
|
|
4
4
|
import "../transactions/index.mjs";
|
|
5
5
|
import { CoreClient, CoreClientOptions } from "../client/core.mjs";
|
|
6
6
|
import "../client/index.mjs";
|
|
7
|
+
import "./proto/sui/rpc/v2/event.mjs";
|
|
7
8
|
import "./proto/sui/rpc/v2/effects.mjs";
|
|
8
9
|
import { ExecutedTransaction } from "./proto/sui/rpc/v2/executed_transaction.mjs";
|
|
9
10
|
import { SimulateTransactionResponse } from "./proto/sui/rpc/v2/transaction_execution_service.mjs";
|
|
11
|
+
import "./proto/sui/rpc/v2/checkpoint.mjs";
|
|
12
|
+
import { GrpcLedgerStreamAdapter, GrpcLedgerStreamRequest } from "./stream/index.mjs";
|
|
10
13
|
import { SuiGrpcClient } from "./client.mjs";
|
|
14
|
+
import { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
11
15
|
|
|
12
16
|
//#region src/grpc/core.d.ts
|
|
13
17
|
interface GrpcCoreClientOptions extends CoreClientOptions {
|
|
14
18
|
client: SuiGrpcClient;
|
|
19
|
+
/** The transport ledger streams read from; `SuiGrpcClient` passes its own. */
|
|
20
|
+
transport?: RpcTransport;
|
|
15
21
|
}
|
|
16
22
|
declare class GrpcCoreClient extends CoreClient {
|
|
17
23
|
#private;
|
|
18
24
|
constructor({
|
|
19
25
|
client,
|
|
26
|
+
transport,
|
|
20
27
|
...options
|
|
21
28
|
}: GrpcCoreClientOptions);
|
|
29
|
+
protected createLedgerStreamAdapter(request: GrpcLedgerStreamRequest): GrpcLedgerStreamAdapter;
|
|
22
30
|
getObjects<Include extends SuiClientTypes.ObjectInclude = {}>(options: SuiClientTypes.GetObjectsOptions<Include>): Promise<SuiClientTypes.GetObjectsResponse<Include>>;
|
|
23
31
|
listOwnedObjects<Include extends SuiClientTypes.ObjectInclude = {}>(options: SuiClientTypes.ListOwnedObjectsOptions<Include>): Promise<SuiClientTypes.ListOwnedObjectsResponse<Include>>;
|
|
24
32
|
listCoins(options: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse>;
|
|
@@ -27,16 +35,15 @@ declare class GrpcCoreClient extends CoreClient {
|
|
|
27
35
|
listBalances(options: SuiClientTypes.ListBalancesOptions): Promise<SuiClientTypes.ListBalancesResponse>;
|
|
28
36
|
getTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.GetTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
29
37
|
executeTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.ExecuteTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
30
|
-
simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(options: SuiClientTypes.SimulateTransactionOptions<Include>
|
|
31
|
-
doGasSelection?: boolean;
|
|
32
|
-
}): Promise<SuiClientTypes.SimulateTransactionResult<Include>>;
|
|
38
|
+
simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(options: SuiClientTypes.SimulateTransactionOptions<Include>): Promise<SuiClientTypes.SimulateTransactionResult<Include>>;
|
|
33
39
|
getReferenceGasPrice(options?: SuiClientTypes.GetReferenceGasPriceOptions): Promise<SuiClientTypes.GetReferenceGasPriceResponse>;
|
|
34
40
|
getProtocolConfig(options?: SuiClientTypes.GetProtocolConfigOptions): Promise<SuiClientTypes.GetProtocolConfigResponse>;
|
|
35
41
|
getCurrentSystemState(options?: SuiClientTypes.GetCurrentSystemStateOptions): Promise<SuiClientTypes.GetCurrentSystemStateResponse>;
|
|
36
|
-
listDynamicFields(options: SuiClientTypes.ListDynamicFieldsOptions): Promise<SuiClientTypes.ListDynamicFieldsResponse
|
|
42
|
+
listDynamicFields<Include extends SuiClientTypes.DynamicFieldInclude = {}>(options: SuiClientTypes.ListDynamicFieldsOptions<Include>): Promise<SuiClientTypes.ListDynamicFieldsResponse<Include>>;
|
|
37
43
|
listTransactions<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.ListTransactionsOptions<Include>): Promise<SuiClientTypes.ListTransactionsResponse<Include>>;
|
|
38
44
|
listEvents(options: SuiClientTypes.ListEventsOptions): Promise<SuiClientTypes.ListEventsResponse>;
|
|
39
|
-
|
|
45
|
+
listCheckpoints(options: SuiClientTypes.ListCheckpointsOptions): Promise<SuiClientTypes.ListCheckpointsResponse>;
|
|
46
|
+
verifySignature(options: SuiClientTypes.VerifySignatureOptions): Promise<SuiClientTypes.VerifySignatureResponse>;
|
|
40
47
|
defaultNameServiceName(options: SuiClientTypes.DefaultNameServiceNameOptions): Promise<SuiClientTypes.DefaultNameServiceNameResponse>;
|
|
41
48
|
resolveNameServiceAddress(options: SuiClientTypes.ResolveNameServiceAddressOptions): Promise<SuiClientTypes.ResolveNameServiceAddressResponse>;
|
|
42
49
|
getMoveFunction(options: SuiClientTypes.GetMoveFunctionOptions): Promise<SuiClientTypes.GetMoveFunctionResponse>;
|
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
|
+
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