@mysten/sui 2.39.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +162 -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 +4 -2
- package/dist/client/index.mjs +5 -2
- 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 +12 -0
- package/dist/client/transaction-data.d.mts.map +1 -0
- package/dist/client/transaction-data.mjs +469 -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 +3 -1
- package/dist/client/utils.d.mts.map +1 -1
- package/dist/client/utils.mjs +91 -26
- 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 +293 -117
- 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.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.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 +14 -13
- 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 +135 -133
- 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/data/v1.d.mts +239 -239
- 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/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 +250 -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 +3 -4
- 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 -1
- 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 +587 -0
- package/src/client/transaction-resolver.ts +158 -69
- package/src/client/types.ts +530 -115
- package/src/client/utils.ts +147 -50
- 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
package/dist/jsonRpc/client.mjs
DELETED
|
@@ -1,868 +0,0 @@
|
|
|
1
|
-
import { normalizeSuiNSName } from "../utils/suins.mjs";
|
|
2
|
-
import { isValidNamedPackage } from "../utils/named-packages.mjs";
|
|
3
|
-
import { isValidSuiAddress, isValidSuiObjectId, isValidTransactionDigest, normalizeSuiAddress, normalizeSuiObjectId } from "../utils/sui-types.mjs";
|
|
4
|
-
import { BaseClient } from "../client/client.mjs";
|
|
5
|
-
import { hasMvrName } from "../client/mvr.mjs";
|
|
6
|
-
import { JsonRpcHTTPTransport } from "./http-transport.mjs";
|
|
7
|
-
import { isCoinReservationDigest } from "../utils/coin-reservation.mjs";
|
|
8
|
-
import { isTransaction } from "../transactions/Transaction.mjs";
|
|
9
|
-
import { JSONRpcCoreClient } from "./core.mjs";
|
|
10
|
-
import { fromBase58, toBase64, toHex } from "@mysten/bcs";
|
|
11
|
-
|
|
12
|
-
//#region src/jsonRpc/client.ts
|
|
13
|
-
const SUI_CLIENT_BRAND = Symbol.for("@mysten/SuiJsonRpcClient");
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
16
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
17
|
-
*/
|
|
18
|
-
function isSuiJsonRpcClient(client) {
|
|
19
|
-
return typeof client === "object" && client !== null && client[SUI_CLIENT_BRAND] === true;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
23
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
24
|
-
*/
|
|
25
|
-
var SuiJsonRpcClient = class extends BaseClient {
|
|
26
|
-
get [SUI_CLIENT_BRAND]() {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Establish a connection to a Sui RPC endpoint
|
|
31
|
-
*
|
|
32
|
-
* @param options configuration options for the API Client
|
|
33
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
34
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
35
|
-
*/
|
|
36
|
-
constructor(options) {
|
|
37
|
-
super({ network: options.network });
|
|
38
|
-
this.jsonRpc = this;
|
|
39
|
-
this.transport = options.transport ?? new JsonRpcHTTPTransport({ url: options.url });
|
|
40
|
-
this.core = new JSONRpcCoreClient({
|
|
41
|
-
jsonRpcClient: this,
|
|
42
|
-
mvr: options.mvr
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
47
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
48
|
-
*/
|
|
49
|
-
async getRpcApiVersion({ signal } = {}) {
|
|
50
|
-
return (await this.transport.request({
|
|
51
|
-
method: "rpc.discover",
|
|
52
|
-
params: [],
|
|
53
|
-
signal
|
|
54
|
-
})).info.version;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get all Coin<`coin_type`> objects owned by an address.
|
|
58
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
59
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
60
|
-
*/
|
|
61
|
-
async getCoins({ coinType, owner, cursor, limit, signal }) {
|
|
62
|
-
if (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) throw new Error("Invalid Sui address");
|
|
63
|
-
if (coinType && hasMvrName(coinType)) coinType = (await this.core.mvr.resolveType({
|
|
64
|
-
type: coinType,
|
|
65
|
-
signal
|
|
66
|
-
})).type;
|
|
67
|
-
const result = await this.transport.request({
|
|
68
|
-
method: "suix_getCoins",
|
|
69
|
-
params: [
|
|
70
|
-
owner,
|
|
71
|
-
coinType,
|
|
72
|
-
cursor,
|
|
73
|
-
limit
|
|
74
|
-
],
|
|
75
|
-
signal
|
|
76
|
-
});
|
|
77
|
-
return {
|
|
78
|
-
...result,
|
|
79
|
-
data: result.data.filter((coin) => !isCoinReservationDigest(coin.digest))
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get all Coin objects owned by an address.
|
|
84
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
85
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
86
|
-
*/
|
|
87
|
-
async getAllCoins(input) {
|
|
88
|
-
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
89
|
-
const result = await this.transport.request({
|
|
90
|
-
method: "suix_getAllCoins",
|
|
91
|
-
params: [
|
|
92
|
-
input.owner,
|
|
93
|
-
input.cursor,
|
|
94
|
-
input.limit
|
|
95
|
-
],
|
|
96
|
-
signal: input.signal
|
|
97
|
-
});
|
|
98
|
-
return {
|
|
99
|
-
...result,
|
|
100
|
-
data: result.data.filter((coin) => !isCoinReservationDigest(coin.digest))
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Get the total coin balance for one coin type, owned by the address owner.
|
|
105
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
106
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
107
|
-
*/
|
|
108
|
-
async getBalance({ owner, coinType, signal }) {
|
|
109
|
-
if (!owner || !isValidSuiAddress(normalizeSuiAddress(owner))) throw new Error("Invalid Sui address");
|
|
110
|
-
if (coinType && hasMvrName(coinType)) coinType = (await this.core.mvr.resolveType({
|
|
111
|
-
type: coinType,
|
|
112
|
-
signal
|
|
113
|
-
})).type;
|
|
114
|
-
return await this.transport.request({
|
|
115
|
-
method: "suix_getBalance",
|
|
116
|
-
params: [owner, coinType],
|
|
117
|
-
signal
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Get the total coin balance for all coin types, owned by the address owner.
|
|
122
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
123
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
124
|
-
*/
|
|
125
|
-
async getAllBalances(input) {
|
|
126
|
-
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
127
|
-
return await this.transport.request({
|
|
128
|
-
method: "suix_getAllBalances",
|
|
129
|
-
params: [input.owner],
|
|
130
|
-
signal: input.signal
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Fetch CoinMetadata for a given coin type
|
|
135
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
136
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
137
|
-
*/
|
|
138
|
-
async getCoinMetadata({ coinType, signal }) {
|
|
139
|
-
if (coinType && hasMvrName(coinType)) coinType = (await this.core.mvr.resolveType({
|
|
140
|
-
type: coinType,
|
|
141
|
-
signal
|
|
142
|
-
})).type;
|
|
143
|
-
return await this.transport.request({
|
|
144
|
-
method: "suix_getCoinMetadata",
|
|
145
|
-
params: [coinType],
|
|
146
|
-
signal
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Fetch total supply for a coin
|
|
151
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
152
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
153
|
-
*/
|
|
154
|
-
async getTotalSupply({ coinType, signal }) {
|
|
155
|
-
if (coinType && hasMvrName(coinType)) coinType = (await this.core.mvr.resolveType({
|
|
156
|
-
type: coinType,
|
|
157
|
-
signal
|
|
158
|
-
})).type;
|
|
159
|
-
return await this.transport.request({
|
|
160
|
-
method: "suix_getTotalSupply",
|
|
161
|
-
params: [coinType],
|
|
162
|
-
signal
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Invoke any RPC method
|
|
167
|
-
* @param method the method to be invoked
|
|
168
|
-
* @param args the arguments to be passed to the RPC request
|
|
169
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
170
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
171
|
-
*/
|
|
172
|
-
async call(method, params, { signal } = {}) {
|
|
173
|
-
return await this.transport.request({
|
|
174
|
-
method,
|
|
175
|
-
params,
|
|
176
|
-
signal
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Get Move function argument types like read, write and full access
|
|
181
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
182
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
183
|
-
*/
|
|
184
|
-
async getMoveFunctionArgTypes({ package: pkg, module, function: fn, signal }) {
|
|
185
|
-
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({
|
|
186
|
-
package: pkg,
|
|
187
|
-
signal
|
|
188
|
-
})).package;
|
|
189
|
-
return await this.transport.request({
|
|
190
|
-
method: "sui_getMoveFunctionArgTypes",
|
|
191
|
-
params: [
|
|
192
|
-
pkg,
|
|
193
|
-
module,
|
|
194
|
-
fn
|
|
195
|
-
],
|
|
196
|
-
signal
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get a map from module name to
|
|
201
|
-
* structured representations of Move modules
|
|
202
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
203
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
204
|
-
*/
|
|
205
|
-
async getNormalizedMoveModulesByPackage({ package: pkg, signal }) {
|
|
206
|
-
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({
|
|
207
|
-
package: pkg,
|
|
208
|
-
signal
|
|
209
|
-
})).package;
|
|
210
|
-
return await this.transport.request({
|
|
211
|
-
method: "sui_getNormalizedMoveModulesByPackage",
|
|
212
|
-
params: [pkg],
|
|
213
|
-
signal
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Get a structured representation of Move module
|
|
218
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
219
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
220
|
-
*/
|
|
221
|
-
async getNormalizedMoveModule({ package: pkg, module, signal }) {
|
|
222
|
-
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({
|
|
223
|
-
package: pkg,
|
|
224
|
-
signal
|
|
225
|
-
})).package;
|
|
226
|
-
return await this.transport.request({
|
|
227
|
-
method: "sui_getNormalizedMoveModule",
|
|
228
|
-
params: [pkg, module],
|
|
229
|
-
signal
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Get a structured representation of Move function
|
|
234
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
235
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
236
|
-
*/
|
|
237
|
-
async getNormalizedMoveFunction({ package: pkg, module, function: fn, signal }) {
|
|
238
|
-
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({
|
|
239
|
-
package: pkg,
|
|
240
|
-
signal
|
|
241
|
-
})).package;
|
|
242
|
-
return await this.transport.request({
|
|
243
|
-
method: "sui_getNormalizedMoveFunction",
|
|
244
|
-
params: [
|
|
245
|
-
pkg,
|
|
246
|
-
module,
|
|
247
|
-
fn
|
|
248
|
-
],
|
|
249
|
-
signal
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Get a structured representation of Move struct
|
|
254
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
255
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
256
|
-
*/
|
|
257
|
-
async getNormalizedMoveStruct({ package: pkg, module, struct, signal }) {
|
|
258
|
-
if (pkg && isValidNamedPackage(pkg)) pkg = (await this.core.mvr.resolvePackage({
|
|
259
|
-
package: pkg,
|
|
260
|
-
signal
|
|
261
|
-
})).package;
|
|
262
|
-
return await this.transport.request({
|
|
263
|
-
method: "sui_getNormalizedMoveStruct",
|
|
264
|
-
params: [
|
|
265
|
-
pkg,
|
|
266
|
-
module,
|
|
267
|
-
struct
|
|
268
|
-
],
|
|
269
|
-
signal
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Get all objects owned by an address
|
|
274
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
275
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
276
|
-
*/
|
|
277
|
-
async getOwnedObjects(input) {
|
|
278
|
-
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
279
|
-
const filter = input.filter ? { ...input.filter } : void 0;
|
|
280
|
-
if (filter && "MoveModule" in filter && isValidNamedPackage(filter.MoveModule.package)) filter.MoveModule = {
|
|
281
|
-
module: filter.MoveModule.module,
|
|
282
|
-
package: (await this.core.mvr.resolvePackage({
|
|
283
|
-
package: filter.MoveModule.package,
|
|
284
|
-
signal: input.signal
|
|
285
|
-
})).package
|
|
286
|
-
};
|
|
287
|
-
else if (filter && "StructType" in filter && hasMvrName(filter.StructType)) filter.StructType = (await this.core.mvr.resolveType({
|
|
288
|
-
type: filter.StructType,
|
|
289
|
-
signal: input.signal
|
|
290
|
-
})).type;
|
|
291
|
-
return await this.transport.request({
|
|
292
|
-
method: "suix_getOwnedObjects",
|
|
293
|
-
params: [
|
|
294
|
-
input.owner,
|
|
295
|
-
{
|
|
296
|
-
filter,
|
|
297
|
-
options: input.options
|
|
298
|
-
},
|
|
299
|
-
input.cursor,
|
|
300
|
-
input.limit
|
|
301
|
-
],
|
|
302
|
-
signal: input.signal
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Get details about an object
|
|
307
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
308
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
309
|
-
*/
|
|
310
|
-
async getObject(input) {
|
|
311
|
-
if (!input.id || !isValidSuiObjectId(normalizeSuiObjectId(input.id))) throw new Error("Invalid Sui Object id");
|
|
312
|
-
return await this.transport.request({
|
|
313
|
-
method: "sui_getObject",
|
|
314
|
-
params: [input.id, input.options],
|
|
315
|
-
signal: input.signal
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
320
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
321
|
-
*/
|
|
322
|
-
async tryGetPastObject(input) {
|
|
323
|
-
return await this.transport.request({
|
|
324
|
-
method: "sui_tryGetPastObject",
|
|
325
|
-
params: [
|
|
326
|
-
input.id,
|
|
327
|
-
input.version,
|
|
328
|
-
input.options
|
|
329
|
-
],
|
|
330
|
-
signal: input.signal
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Batch get details about a list of objects. If any of the object ids are duplicates the call will fail
|
|
335
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
336
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
337
|
-
*/
|
|
338
|
-
async multiGetObjects(input) {
|
|
339
|
-
input.ids.forEach((id) => {
|
|
340
|
-
if (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) throw new Error(`Invalid Sui Object id ${id}`);
|
|
341
|
-
});
|
|
342
|
-
if (input.ids.length !== new Set(input.ids).size) throw new Error(`Duplicate object ids in batch call ${input.ids}`);
|
|
343
|
-
return await this.transport.request({
|
|
344
|
-
method: "sui_multiGetObjects",
|
|
345
|
-
params: [input.ids, input.options],
|
|
346
|
-
signal: input.signal
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Get transaction blocks for a given query criteria
|
|
351
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
352
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
353
|
-
*/
|
|
354
|
-
async queryTransactionBlocks({ filter, options, cursor, limit, order, signal }) {
|
|
355
|
-
if (filter && "MoveFunction" in filter && isValidNamedPackage(filter.MoveFunction.package)) filter = {
|
|
356
|
-
...filter,
|
|
357
|
-
MoveFunction: { package: (await this.core.mvr.resolvePackage({
|
|
358
|
-
package: filter.MoveFunction.package,
|
|
359
|
-
signal
|
|
360
|
-
})).package }
|
|
361
|
-
};
|
|
362
|
-
return await this.transport.request({
|
|
363
|
-
method: "suix_queryTransactionBlocks",
|
|
364
|
-
params: [
|
|
365
|
-
{
|
|
366
|
-
filter,
|
|
367
|
-
options
|
|
368
|
-
},
|
|
369
|
-
cursor,
|
|
370
|
-
limit,
|
|
371
|
-
(order || "descending") === "descending"
|
|
372
|
-
],
|
|
373
|
-
signal
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
378
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
379
|
-
*/
|
|
380
|
-
async getTransactionBlock(input) {
|
|
381
|
-
if (!isValidTransactionDigest(input.digest)) throw new Error("Invalid Transaction digest");
|
|
382
|
-
return await this.transport.request({
|
|
383
|
-
method: "sui_getTransactionBlock",
|
|
384
|
-
params: [input.digest, input.options],
|
|
385
|
-
signal: input.signal
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
390
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
391
|
-
*/
|
|
392
|
-
async multiGetTransactionBlocks(input) {
|
|
393
|
-
input.digests.forEach((d) => {
|
|
394
|
-
if (!isValidTransactionDigest(d)) throw new Error(`Invalid Transaction digest ${d}`);
|
|
395
|
-
});
|
|
396
|
-
if (input.digests.length !== new Set(input.digests).size) throw new Error(`Duplicate digests in batch call ${input.digests}`);
|
|
397
|
-
return await this.transport.request({
|
|
398
|
-
method: "sui_multiGetTransactionBlocks",
|
|
399
|
-
params: [input.digests, input.options],
|
|
400
|
-
signal: input.signal
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
405
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
406
|
-
*/
|
|
407
|
-
async executeTransactionBlock({ transactionBlock, signature, options, signal }) {
|
|
408
|
-
return await this.transport.request({
|
|
409
|
-
method: "sui_executeTransactionBlock",
|
|
410
|
-
params: [
|
|
411
|
-
typeof transactionBlock === "string" ? transactionBlock : toBase64(transactionBlock),
|
|
412
|
-
Array.isArray(signature) ? signature : [signature],
|
|
413
|
-
options
|
|
414
|
-
],
|
|
415
|
-
signal
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
420
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
421
|
-
*/
|
|
422
|
-
async signAndExecuteTransaction({ transaction, signer, ...input }) {
|
|
423
|
-
let transactionBytes;
|
|
424
|
-
if (transaction instanceof Uint8Array) transactionBytes = transaction;
|
|
425
|
-
else {
|
|
426
|
-
transaction.setSenderIfNotSet(signer.toSuiAddress());
|
|
427
|
-
transactionBytes = await transaction.build({ client: this });
|
|
428
|
-
}
|
|
429
|
-
const { signature, bytes } = await signer.signTransaction(transactionBytes);
|
|
430
|
-
return this.executeTransactionBlock({
|
|
431
|
-
transactionBlock: bytes,
|
|
432
|
-
signature,
|
|
433
|
-
...input
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* Get total number of transactions
|
|
438
|
-
*/
|
|
439
|
-
/**
|
|
440
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
441
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
442
|
-
*/
|
|
443
|
-
async getTotalTransactionBlocks({ signal } = {}) {
|
|
444
|
-
const resp = await this.transport.request({
|
|
445
|
-
method: "sui_getTotalTransactionBlocks",
|
|
446
|
-
params: [],
|
|
447
|
-
signal
|
|
448
|
-
});
|
|
449
|
-
return BigInt(resp);
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Getting the reference gas price for the network
|
|
453
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
454
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
455
|
-
*/
|
|
456
|
-
async getReferenceGasPrice({ signal } = {}) {
|
|
457
|
-
const resp = await this.transport.request({
|
|
458
|
-
method: "suix_getReferenceGasPrice",
|
|
459
|
-
params: [],
|
|
460
|
-
signal
|
|
461
|
-
});
|
|
462
|
-
return BigInt(resp);
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Return the delegated stakes for an address
|
|
466
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
467
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
468
|
-
*/
|
|
469
|
-
async getStakes(input) {
|
|
470
|
-
if (!input.owner || !isValidSuiAddress(normalizeSuiAddress(input.owner))) throw new Error("Invalid Sui address");
|
|
471
|
-
return await this.transport.request({
|
|
472
|
-
method: "suix_getStakes",
|
|
473
|
-
params: [input.owner],
|
|
474
|
-
signal: input.signal
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Return the delegated stakes queried by id.
|
|
479
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
480
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
481
|
-
*/
|
|
482
|
-
async getStakesByIds(input) {
|
|
483
|
-
input.stakedSuiIds.forEach((id) => {
|
|
484
|
-
if (!id || !isValidSuiObjectId(normalizeSuiObjectId(id))) throw new Error(`Invalid Sui Stake id ${id}`);
|
|
485
|
-
});
|
|
486
|
-
return await this.transport.request({
|
|
487
|
-
method: "suix_getStakesByIds",
|
|
488
|
-
params: [input.stakedSuiIds],
|
|
489
|
-
signal: input.signal
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
/**
|
|
493
|
-
* Return the latest system state content.
|
|
494
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
495
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
496
|
-
*/
|
|
497
|
-
async getLatestSuiSystemState({ signal } = {}) {
|
|
498
|
-
return await this.transport.request({
|
|
499
|
-
method: "suix_getLatestSuiSystemState",
|
|
500
|
-
params: [],
|
|
501
|
-
signal
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Get events for a given query criteria
|
|
506
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
507
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
508
|
-
*/
|
|
509
|
-
async queryEvents({ query, cursor, limit, order, signal }) {
|
|
510
|
-
if (query && "MoveEventType" in query && hasMvrName(query.MoveEventType)) query = {
|
|
511
|
-
...query,
|
|
512
|
-
MoveEventType: (await this.core.mvr.resolveType({
|
|
513
|
-
type: query.MoveEventType,
|
|
514
|
-
signal
|
|
515
|
-
})).type
|
|
516
|
-
};
|
|
517
|
-
if (query && "MoveEventModule" in query && isValidNamedPackage(query.MoveEventModule.package)) query = {
|
|
518
|
-
...query,
|
|
519
|
-
MoveEventModule: {
|
|
520
|
-
module: query.MoveEventModule.module,
|
|
521
|
-
package: (await this.core.mvr.resolvePackage({
|
|
522
|
-
package: query.MoveEventModule.package,
|
|
523
|
-
signal
|
|
524
|
-
})).package
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
if ("MoveModule" in query && isValidNamedPackage(query.MoveModule.package)) query = {
|
|
528
|
-
...query,
|
|
529
|
-
MoveModule: {
|
|
530
|
-
module: query.MoveModule.module,
|
|
531
|
-
package: (await this.core.mvr.resolvePackage({
|
|
532
|
-
package: query.MoveModule.package,
|
|
533
|
-
signal
|
|
534
|
-
})).package
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
return await this.transport.request({
|
|
538
|
-
method: "suix_queryEvents",
|
|
539
|
-
params: [
|
|
540
|
-
query,
|
|
541
|
-
cursor,
|
|
542
|
-
limit,
|
|
543
|
-
(order || "descending") === "descending"
|
|
544
|
-
],
|
|
545
|
-
signal
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
/**
|
|
549
|
-
* Runs the transaction block in dev-inspect mode. Which allows for nearly any
|
|
550
|
-
* transaction (or Move call) with any arguments. Detailed results are
|
|
551
|
-
* provided, including both the transaction effects and any return values.
|
|
552
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
553
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
554
|
-
*/
|
|
555
|
-
async devInspectTransactionBlock(input) {
|
|
556
|
-
let devInspectTxBytes;
|
|
557
|
-
if (isTransaction(input.transactionBlock)) {
|
|
558
|
-
input.transactionBlock.setSenderIfNotSet(input.sender);
|
|
559
|
-
devInspectTxBytes = toBase64(await input.transactionBlock.build({
|
|
560
|
-
client: this,
|
|
561
|
-
onlyTransactionKind: true
|
|
562
|
-
}));
|
|
563
|
-
} else if (typeof input.transactionBlock === "string") devInspectTxBytes = input.transactionBlock;
|
|
564
|
-
else if (input.transactionBlock instanceof Uint8Array) devInspectTxBytes = toBase64(input.transactionBlock);
|
|
565
|
-
else throw new Error("Unknown transaction block format.");
|
|
566
|
-
input.signal?.throwIfAborted();
|
|
567
|
-
return await this.transport.request({
|
|
568
|
-
method: "sui_devInspectTransactionBlock",
|
|
569
|
-
params: [
|
|
570
|
-
input.sender,
|
|
571
|
-
devInspectTxBytes,
|
|
572
|
-
input.gasPrice?.toString(),
|
|
573
|
-
input.epoch
|
|
574
|
-
],
|
|
575
|
-
signal: input.signal
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* Dry run a transaction block and return the result.
|
|
580
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
581
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
582
|
-
*/
|
|
583
|
-
async dryRunTransactionBlock(input) {
|
|
584
|
-
return await this.transport.request({
|
|
585
|
-
method: "sui_dryRunTransactionBlock",
|
|
586
|
-
params: [typeof input.transactionBlock === "string" ? input.transactionBlock : toBase64(input.transactionBlock)]
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Return the list of dynamic field objects owned by an object
|
|
591
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
592
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
593
|
-
*/
|
|
594
|
-
async getDynamicFields(input) {
|
|
595
|
-
if (!input.parentId || !isValidSuiObjectId(normalizeSuiObjectId(input.parentId))) throw new Error("Invalid Sui Object id");
|
|
596
|
-
return await this.transport.request({
|
|
597
|
-
method: "suix_getDynamicFields",
|
|
598
|
-
params: [
|
|
599
|
-
input.parentId,
|
|
600
|
-
input.cursor,
|
|
601
|
-
input.limit
|
|
602
|
-
],
|
|
603
|
-
signal: input.signal
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Return the dynamic field object information for a specified object
|
|
608
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
609
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
610
|
-
*/
|
|
611
|
-
async getDynamicFieldObject(input) {
|
|
612
|
-
return await this.transport.request({
|
|
613
|
-
method: "suix_getDynamicFieldObject",
|
|
614
|
-
params: [input.parentId, input.name],
|
|
615
|
-
signal: input.signal
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* Get the sequence number of the latest checkpoint that has been executed
|
|
620
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
621
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
622
|
-
*/
|
|
623
|
-
async getLatestCheckpointSequenceNumber({ signal } = {}) {
|
|
624
|
-
const resp = await this.transport.request({
|
|
625
|
-
method: "sui_getLatestCheckpointSequenceNumber",
|
|
626
|
-
params: [],
|
|
627
|
-
signal
|
|
628
|
-
});
|
|
629
|
-
return String(resp);
|
|
630
|
-
}
|
|
631
|
-
/**
|
|
632
|
-
* Returns information about a given checkpoint
|
|
633
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
634
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
635
|
-
*/
|
|
636
|
-
async getCheckpoint(input) {
|
|
637
|
-
return await this.transport.request({
|
|
638
|
-
method: "sui_getCheckpoint",
|
|
639
|
-
params: [input.id],
|
|
640
|
-
signal: input.signal
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* Returns historical checkpoints paginated
|
|
645
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
646
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
647
|
-
*/
|
|
648
|
-
async getCheckpoints(input) {
|
|
649
|
-
return await this.transport.request({
|
|
650
|
-
method: "sui_getCheckpoints",
|
|
651
|
-
params: [
|
|
652
|
-
input.cursor,
|
|
653
|
-
input?.limit,
|
|
654
|
-
input.descendingOrder
|
|
655
|
-
],
|
|
656
|
-
signal: input.signal
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
/**
|
|
660
|
-
* Return the committee information for the asked epoch
|
|
661
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
662
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
663
|
-
*/
|
|
664
|
-
async getCommitteeInfo(input) {
|
|
665
|
-
return await this.transport.request({
|
|
666
|
-
method: "suix_getCommitteeInfo",
|
|
667
|
-
params: [input?.epoch],
|
|
668
|
-
signal: input?.signal
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
/**
|
|
672
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
673
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
674
|
-
*/
|
|
675
|
-
async getNetworkMetrics({ signal } = {}) {
|
|
676
|
-
return await this.transport.request({
|
|
677
|
-
method: "suix_getNetworkMetrics",
|
|
678
|
-
params: [],
|
|
679
|
-
signal
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
/**
|
|
683
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
684
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
685
|
-
*/
|
|
686
|
-
async getAddressMetrics({ signal } = {}) {
|
|
687
|
-
return await this.transport.request({
|
|
688
|
-
method: "suix_getLatestAddressMetrics",
|
|
689
|
-
params: [],
|
|
690
|
-
signal
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
695
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
696
|
-
*/
|
|
697
|
-
async getEpochMetrics(input) {
|
|
698
|
-
return await this.transport.request({
|
|
699
|
-
method: "suix_getEpochMetrics",
|
|
700
|
-
params: [
|
|
701
|
-
input?.cursor,
|
|
702
|
-
input?.limit,
|
|
703
|
-
input?.descendingOrder
|
|
704
|
-
],
|
|
705
|
-
signal: input?.signal
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
/**
|
|
709
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
710
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
711
|
-
*/
|
|
712
|
-
async getAllEpochAddressMetrics(input) {
|
|
713
|
-
return await this.transport.request({
|
|
714
|
-
method: "suix_getAllEpochAddressMetrics",
|
|
715
|
-
params: [input?.descendingOrder],
|
|
716
|
-
signal: input?.signal
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Return the committee information for the asked epoch
|
|
721
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
722
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
723
|
-
*/
|
|
724
|
-
async getEpochs(input) {
|
|
725
|
-
return await this.transport.request({
|
|
726
|
-
method: "suix_getEpochs",
|
|
727
|
-
params: [
|
|
728
|
-
input?.cursor,
|
|
729
|
-
input?.limit,
|
|
730
|
-
input?.descendingOrder
|
|
731
|
-
],
|
|
732
|
-
signal: input?.signal
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
/**
|
|
736
|
-
* Returns list of top move calls by usage
|
|
737
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
738
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
739
|
-
*/
|
|
740
|
-
async getMoveCallMetrics({ signal } = {}) {
|
|
741
|
-
return await this.transport.request({
|
|
742
|
-
method: "suix_getMoveCallMetrics",
|
|
743
|
-
params: [],
|
|
744
|
-
signal
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* Return the committee information for the asked epoch
|
|
749
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
750
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
751
|
-
*/
|
|
752
|
-
async getCurrentEpoch({ signal } = {}) {
|
|
753
|
-
return await this.transport.request({
|
|
754
|
-
method: "suix_getCurrentEpoch",
|
|
755
|
-
params: [],
|
|
756
|
-
signal
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* Return the Validators APYs
|
|
761
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
762
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
763
|
-
*/
|
|
764
|
-
async getValidatorsApy({ signal } = {}) {
|
|
765
|
-
return await this.transport.request({
|
|
766
|
-
method: "suix_getValidatorsApy",
|
|
767
|
-
params: [],
|
|
768
|
-
signal
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
773
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
774
|
-
*/
|
|
775
|
-
async getChainIdentifier({ signal } = {}) {
|
|
776
|
-
return toHex(fromBase58((await this.getCheckpoint({
|
|
777
|
-
id: "0",
|
|
778
|
-
signal
|
|
779
|
-
})).digest).slice(0, 4));
|
|
780
|
-
}
|
|
781
|
-
/**
|
|
782
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
783
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
784
|
-
*/
|
|
785
|
-
async resolveNameServiceAddress(input) {
|
|
786
|
-
return await this.transport.request({
|
|
787
|
-
method: "suix_resolveNameServiceAddress",
|
|
788
|
-
params: [input.name],
|
|
789
|
-
signal: input.signal
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
794
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
795
|
-
*/
|
|
796
|
-
async resolveNameServiceNames({ format = "dot", ...input }) {
|
|
797
|
-
const { nextCursor, hasNextPage, data } = await this.transport.request({
|
|
798
|
-
method: "suix_resolveNameServiceNames",
|
|
799
|
-
params: [
|
|
800
|
-
input.address,
|
|
801
|
-
input.cursor,
|
|
802
|
-
input.limit
|
|
803
|
-
],
|
|
804
|
-
signal: input.signal
|
|
805
|
-
});
|
|
806
|
-
return {
|
|
807
|
-
hasNextPage,
|
|
808
|
-
nextCursor,
|
|
809
|
-
data: data.map((name) => normalizeSuiNSName(name, format))
|
|
810
|
-
};
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
814
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
815
|
-
*/
|
|
816
|
-
async getProtocolConfig(input) {
|
|
817
|
-
return await this.transport.request({
|
|
818
|
-
method: "sui_getProtocolConfig",
|
|
819
|
-
params: [input?.version],
|
|
820
|
-
signal: input?.signal
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
825
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
826
|
-
*/
|
|
827
|
-
async verifyZkLoginSignature(input) {
|
|
828
|
-
return await this.transport.request({
|
|
829
|
-
method: "sui_verifyZkLoginSignature",
|
|
830
|
-
params: [
|
|
831
|
-
input.bytes,
|
|
832
|
-
input.signature,
|
|
833
|
-
input.intentScope,
|
|
834
|
-
input.author
|
|
835
|
-
],
|
|
836
|
-
signal: input.signal
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* Wait for a transaction block result to be available over the API.
|
|
841
|
-
* This can be used in conjunction with `executeTransactionBlock` to wait for the transaction to
|
|
842
|
-
* be available via the API.
|
|
843
|
-
* This currently polls the `getTransactionBlock` API to check for the transaction.
|
|
844
|
-
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
845
|
-
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
846
|
-
*/
|
|
847
|
-
async waitForTransaction({ signal, timeout = 60 * 1e3, pollInterval = 2 * 1e3, ...input }) {
|
|
848
|
-
const timeoutSignal = AbortSignal.timeout(timeout);
|
|
849
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
850
|
-
timeoutSignal.addEventListener("abort", () => reject(timeoutSignal.reason));
|
|
851
|
-
});
|
|
852
|
-
timeoutPromise.catch(() => {});
|
|
853
|
-
while (!timeoutSignal.aborted) {
|
|
854
|
-
signal?.throwIfAborted();
|
|
855
|
-
try {
|
|
856
|
-
return await this.getTransactionBlock(input);
|
|
857
|
-
} catch {
|
|
858
|
-
await Promise.race([new Promise((resolve) => setTimeout(resolve, pollInterval)), timeoutPromise]);
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
timeoutSignal.throwIfAborted();
|
|
862
|
-
throw new Error("Unexpected error while waiting for transaction block.");
|
|
863
|
-
}
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
//#endregion
|
|
867
|
-
export { SuiJsonRpcClient, isSuiJsonRpcClient };
|
|
868
|
-
//# sourceMappingURL=client.mjs.map
|