@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
package/src/client/types.ts
CHANGED
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
import type { EnumOutputShape } from '@mysten/bcs';
|
|
5
5
|
import type {
|
|
6
|
-
|
|
6
|
+
EndOfEpochTransactionKind as BcsEndOfEpochTransactionKindSchema,
|
|
7
|
+
TransactionKind as BcsTransactionKindSchema,
|
|
8
|
+
} from '../bcs/transactions.js';
|
|
9
|
+
import type {
|
|
7
10
|
TransactionPlugin,
|
|
11
|
+
CallArg as BuilderCallArg,
|
|
12
|
+
Command as BuilderCommand,
|
|
13
|
+
TransactionData as BuilderTransactionData,
|
|
8
14
|
Transaction as TransactionInstance,
|
|
9
15
|
} from '../transactions/index.js';
|
|
10
16
|
import type { Signer } from '../cryptography/keypair.js';
|
|
@@ -22,6 +28,9 @@ export type SuiClientRegistration<
|
|
|
22
28
|
|
|
23
29
|
export type ClientWithExtensions<T, Base extends BaseClient = BaseClient> = Base & T;
|
|
24
30
|
|
|
31
|
+
type BcsTransactionKind = typeof BcsTransactionKindSchema.$inferType;
|
|
32
|
+
type BcsEndOfEpochTransactionKind = typeof BcsEndOfEpochTransactionKindSchema.$inferType;
|
|
33
|
+
|
|
25
34
|
export namespace SuiClientTypes {
|
|
26
35
|
export type Network = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {});
|
|
27
36
|
|
|
@@ -44,6 +53,214 @@ export namespace SuiClientTypes {
|
|
|
44
53
|
signal?: AbortSignal;
|
|
45
54
|
}
|
|
46
55
|
|
|
56
|
+
export type Order = 'ascending' | 'descending';
|
|
57
|
+
|
|
58
|
+
/** Opaque resume position, valid only for the stream that produced it. */
|
|
59
|
+
export type StreamResumeToken = string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Where a stream starts: at a checkpoint (inclusive), or after the frame that carried a resume
|
|
63
|
+
* token, so save a token only once its frame is processed.
|
|
64
|
+
*/
|
|
65
|
+
export type StreamStart =
|
|
66
|
+
| { checkpoint: CheckpointNumber; resumeToken?: never }
|
|
67
|
+
| { resumeToken: StreamResumeToken; checkpoint?: never };
|
|
68
|
+
|
|
69
|
+
/** Where a finite stream stops: before this checkpoint (exclusive). */
|
|
70
|
+
export interface StreamEnd {
|
|
71
|
+
checkpoint: CheckpointNumber;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface StreamRetryOptions {
|
|
75
|
+
/**
|
|
76
|
+
* First retry delay in milliseconds; each further failure doubles it.
|
|
77
|
+
* @default 250
|
|
78
|
+
*/
|
|
79
|
+
initialDelay?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Cap on the retry delay in milliseconds.
|
|
82
|
+
* @default 30_000
|
|
83
|
+
*/
|
|
84
|
+
maxDelay?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Consecutive failures without progress before the stream throws. 0 disables retries.
|
|
87
|
+
* @default 10
|
|
88
|
+
*/
|
|
89
|
+
maxAttempts?: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Why a failed request may succeed on retry.
|
|
94
|
+
* - `Unavailable`: the server could not be reached, the connection dropped, or a live feed ended.
|
|
95
|
+
* - `RateLimited`: the server or a proxy is limiting requests.
|
|
96
|
+
* - `ServerError`: any other failure that may clear on retry.
|
|
97
|
+
*/
|
|
98
|
+
export type RetryReason = 'Unavailable' | 'RateLimited' | 'ServerError';
|
|
99
|
+
|
|
100
|
+
/** Connection state reported to `onStatus`, for diagnostics only. Use frame tokens to resume. */
|
|
101
|
+
export type StreamStatus =
|
|
102
|
+
/** An attempt is starting; `attempt` counts consecutive failures without progress. */
|
|
103
|
+
| { $kind: 'Connecting'; attempt: number }
|
|
104
|
+
/** This attempt received its first page or live frame, or its GraphQL subscription opened. */
|
|
105
|
+
| { $kind: 'Connected' }
|
|
106
|
+
/** Waiting `delay` ms before the next attempt after `error`. */
|
|
107
|
+
| {
|
|
108
|
+
$kind: 'Retrying';
|
|
109
|
+
attempt: number;
|
|
110
|
+
delay: number;
|
|
111
|
+
reason: RetryReason;
|
|
112
|
+
error: unknown;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** Control frames to emit in addition to items. */
|
|
116
|
+
export interface StreamFrameOptions {
|
|
117
|
+
/** Emit a final Complete frame after a finite stream finishes. */
|
|
118
|
+
completion?: boolean;
|
|
119
|
+
/** Emit Progress frames carrying resumable positions that no item reported. */
|
|
120
|
+
progress?: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface StreamOptions<
|
|
124
|
+
Frames extends StreamFrameOptions = {},
|
|
125
|
+
> extends CoreClientMethodOptions {
|
|
126
|
+
/**
|
|
127
|
+
* Where to start: at a checkpoint, or after the frame that carried a resume token. Required
|
|
128
|
+
* for a finite ascending read.
|
|
129
|
+
*/
|
|
130
|
+
start?: StreamStart;
|
|
131
|
+
/** Where a finite stream stops (exclusive). */
|
|
132
|
+
end?: StreamEnd;
|
|
133
|
+
/** Defaults to the resume token's order, else `'ascending'`. */
|
|
134
|
+
order?: Order;
|
|
135
|
+
/**
|
|
136
|
+
* Keep following new checkpoints after the history.
|
|
137
|
+
* @default true for an ascending stream without an `end`
|
|
138
|
+
*/
|
|
139
|
+
follow?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* How a followed stream receives new data: a live subscription, or polling every
|
|
142
|
+
* `pollInterval`.
|
|
143
|
+
* @default 'subscribe'
|
|
144
|
+
*/
|
|
145
|
+
delivery?: 'subscribe' | 'poll';
|
|
146
|
+
/**
|
|
147
|
+
* Milliseconds between polls, and between reads while waiting for the server to index.
|
|
148
|
+
* @default 1000
|
|
149
|
+
*/
|
|
150
|
+
pollInterval?: number;
|
|
151
|
+
retry?: StreamRetryOptions;
|
|
152
|
+
/** Called synchronously with each status. Throwing ends the stream with that error. */
|
|
153
|
+
onStatus?: (status: StreamStatus) => void;
|
|
154
|
+
/** Control frames to emit alongside items. */
|
|
155
|
+
frames?: Frames;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Data to deliver with each streamed checkpoint. */
|
|
159
|
+
export interface StreamCheckpointInclude {
|
|
160
|
+
/**
|
|
161
|
+
* Deliver every transaction of the checkpoint, in execution order, with these fields. Each
|
|
162
|
+
* checkpoint is yielded once all of its transactions have been read.
|
|
163
|
+
*/
|
|
164
|
+
transactions?: TransactionInclude;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface StreamCheckpointsOptions<
|
|
168
|
+
Include extends StreamCheckpointInclude = {},
|
|
169
|
+
Frames extends StreamFrameOptions = {},
|
|
170
|
+
> extends StreamOptions<Frames> {
|
|
171
|
+
include?: Include;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface StreamTransactionsOptions<
|
|
175
|
+
Include extends TransactionInclude = {},
|
|
176
|
+
Frames extends StreamFrameOptions = {},
|
|
177
|
+
> extends StreamOptions<Frames> {
|
|
178
|
+
filter?: TransactionFilter;
|
|
179
|
+
include?: Include;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface StreamEventsOptions<
|
|
183
|
+
Frames extends StreamFrameOptions = {},
|
|
184
|
+
> extends StreamOptions<Frames> {
|
|
185
|
+
filter?: EventFilter;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface StreamCheckpoint<Include extends StreamCheckpointInclude = {}> {
|
|
189
|
+
$kind: 'Checkpoint';
|
|
190
|
+
/** Includes `transactions` when `include.transactions` is set. */
|
|
191
|
+
checkpoint: Checkpoint &
|
|
192
|
+
(Include extends { transactions: infer TransactionFields extends TransactionInclude }
|
|
193
|
+
? { transactions: TransactionResult<TransactionFields>[] }
|
|
194
|
+
: {});
|
|
195
|
+
resumeToken: StreamResumeToken;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface StreamTransaction<Include extends TransactionInclude = {}> {
|
|
199
|
+
$kind: 'Transaction';
|
|
200
|
+
transaction: TransactionResult<Include>;
|
|
201
|
+
resumeToken: StreamResumeToken;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface StreamEvent {
|
|
205
|
+
$kind: 'Event';
|
|
206
|
+
event: EventEntry;
|
|
207
|
+
resumeToken: StreamResumeToken;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** A resumable position that no item reported, such as the end of an empty range. */
|
|
211
|
+
export interface StreamProgressFrame {
|
|
212
|
+
$kind: 'Progress';
|
|
213
|
+
resumeToken: StreamResumeToken;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Sent once after a finite stream finishes, even an empty one.
|
|
218
|
+
* - `checkpointBound`: reached `end`.
|
|
219
|
+
* - `indexedTip`: reached the indexed tip read when the stream started (`follow: false`).
|
|
220
|
+
* - `genesis`: a descending read reached checkpoint 0.
|
|
221
|
+
* - `retentionLimit`: a descending read reached the oldest checkpoint the server retains.
|
|
222
|
+
*/
|
|
223
|
+
export interface StreamCompletionFrame {
|
|
224
|
+
$kind: 'Complete';
|
|
225
|
+
reason: 'checkpointBound' | 'indexedTip' | 'genesis' | 'retentionLimit';
|
|
226
|
+
/** Last delivered position, if there is one. */
|
|
227
|
+
resumeToken?: StreamResumeToken;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* `T` when `Frames[Key]` may be true; includes non-literal booleans. Distributes over a union of
|
|
232
|
+
* option objects, so a frame that any member enables is included.
|
|
233
|
+
*/
|
|
234
|
+
type EnabledFrame<
|
|
235
|
+
Frames extends StreamFrameOptions,
|
|
236
|
+
Key extends keyof StreamFrameOptions,
|
|
237
|
+
T,
|
|
238
|
+
> = Frames extends unknown
|
|
239
|
+
? Key extends keyof Frames
|
|
240
|
+
? true extends Frames[Key]
|
|
241
|
+
? T
|
|
242
|
+
: never
|
|
243
|
+
: never
|
|
244
|
+
: never;
|
|
245
|
+
|
|
246
|
+
export type StreamResult<Item, Frames extends StreamFrameOptions = {}> =
|
|
247
|
+
| Item
|
|
248
|
+
| EnabledFrame<Frames, 'completion', StreamCompletionFrame>
|
|
249
|
+
| EnabledFrame<Frames, 'progress', StreamProgressFrame>;
|
|
250
|
+
|
|
251
|
+
export type StreamCheckpointFrame<
|
|
252
|
+
Include extends StreamCheckpointInclude = {},
|
|
253
|
+
Frames extends StreamFrameOptions = {},
|
|
254
|
+
> = StreamResult<StreamCheckpoint<Include>, Frames>;
|
|
255
|
+
export type StreamTransactionFrame<
|
|
256
|
+
Include extends TransactionInclude = {},
|
|
257
|
+
Frames extends StreamFrameOptions = {},
|
|
258
|
+
> = StreamResult<StreamTransaction<Include>, Frames>;
|
|
259
|
+
export type StreamEventFrame<Frames extends StreamFrameOptions = {}> = StreamResult<
|
|
260
|
+
StreamEvent,
|
|
261
|
+
Frames
|
|
262
|
+
>;
|
|
263
|
+
|
|
47
264
|
/** Object methods */
|
|
48
265
|
export interface TransportMethods {
|
|
49
266
|
getObjects: <Include extends ObjectInclude = {}>(
|
|
@@ -53,8 +270,11 @@ export namespace SuiClientTypes {
|
|
|
53
270
|
options: ListOwnedObjectsOptions<Include>,
|
|
54
271
|
) => Promise<ListOwnedObjectsResponse<Include>>;
|
|
55
272
|
listCoins: (options: ListCoinsOptions) => Promise<ListCoinsResponse>;
|
|
56
|
-
listDynamicFields:
|
|
273
|
+
listDynamicFields: <Include extends DynamicFieldInclude = {}>(
|
|
274
|
+
options: ListDynamicFieldsOptions<Include>,
|
|
275
|
+
) => Promise<ListDynamicFieldsResponse<Include>>;
|
|
57
276
|
getDynamicField: (options: GetDynamicFieldOptions) => Promise<GetDynamicFieldResponse>;
|
|
277
|
+
getAddressAliases: (options: GetAddressAliasesOptions) => Promise<GetAddressAliasesResponse>;
|
|
58
278
|
}
|
|
59
279
|
|
|
60
280
|
export interface ObjectInclude {
|
|
@@ -81,7 +301,7 @@ export namespace SuiClientTypes {
|
|
|
81
301
|
* Include the JSON representation of the object's Move struct content.
|
|
82
302
|
*
|
|
83
303
|
* **Warning:** The exact shape and field names of this data may vary between different
|
|
84
|
-
* API implementations (
|
|
304
|
+
* API implementations (gRPC or GraphQL). For consistent data across APIs,
|
|
85
305
|
* use the `content` field and parse the BCS data directly.
|
|
86
306
|
*/
|
|
87
307
|
json?: boolean;
|
|
@@ -129,10 +349,18 @@ export namespace SuiClientTypes {
|
|
|
129
349
|
cursor?: string | null;
|
|
130
350
|
}
|
|
131
351
|
|
|
132
|
-
export interface
|
|
352
|
+
export interface DynamicFieldInclude {
|
|
353
|
+
/** Include each field's `value`. */
|
|
354
|
+
value?: boolean;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export interface ListDynamicFieldsOptions<
|
|
358
|
+
Include extends DynamicFieldInclude = {},
|
|
359
|
+
> extends CoreClientMethodOptions {
|
|
133
360
|
parentId: string;
|
|
134
361
|
limit?: number;
|
|
135
362
|
cursor?: string | null;
|
|
363
|
+
include?: Include & DynamicFieldInclude;
|
|
136
364
|
}
|
|
137
365
|
|
|
138
366
|
export interface GetDynamicFieldOptions extends CoreClientMethodOptions {
|
|
@@ -140,6 +368,28 @@ export namespace SuiClientTypes {
|
|
|
140
368
|
name: DynamicFieldName;
|
|
141
369
|
}
|
|
142
370
|
|
|
371
|
+
export interface GetAddressAliasesOptions extends CoreClientMethodOptions {
|
|
372
|
+
address: string;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* The addresses whose signatures are accepted for `address`. An address that never enabled
|
|
377
|
+
* aliases is only its own alias.
|
|
378
|
+
*/
|
|
379
|
+
export interface AddressAliases {
|
|
380
|
+
address: string;
|
|
381
|
+
/** Whether `address` has enabled aliases, so its alias set is an object on chain. */
|
|
382
|
+
enabled: boolean;
|
|
383
|
+
/** The current alias set; `[address]` when aliases are not enabled. */
|
|
384
|
+
aliases: string[];
|
|
385
|
+
/** The ID of the alias set object, derived from `address` whether or not it exists. */
|
|
386
|
+
objectId: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface GetAddressAliasesResponse {
|
|
390
|
+
addressAliases: AddressAliases;
|
|
391
|
+
}
|
|
392
|
+
|
|
143
393
|
export interface GetObjectsResponse<out Include extends ObjectInclude = {}> {
|
|
144
394
|
objects: (Object<Include> | Error)[];
|
|
145
395
|
}
|
|
@@ -175,7 +425,7 @@ export namespace SuiClientTypes {
|
|
|
175
425
|
* The JSON representation of the object's Move struct content.
|
|
176
426
|
*
|
|
177
427
|
* **Warning:** The exact shape and field names of this data may vary between different
|
|
178
|
-
* API implementations (
|
|
428
|
+
* API implementations (gRPC or GraphQL). For consistent data across APIs use
|
|
179
429
|
* the `content` field and parse the BCS data directly.
|
|
180
430
|
*/
|
|
181
431
|
json: Include extends { json: true } ? Record<string, unknown> | null : undefined;
|
|
@@ -205,24 +455,35 @@ export namespace SuiClientTypes {
|
|
|
205
455
|
balance: string;
|
|
206
456
|
}
|
|
207
457
|
|
|
208
|
-
export type DynamicFieldEntry = {
|
|
458
|
+
export type DynamicFieldEntry<Include extends DynamicFieldInclude = {}> = {
|
|
459
|
+
/** ID of the `0x2::dynamic_field::Field` object. */
|
|
209
460
|
fieldId: string;
|
|
461
|
+
/** Type of the `0x2::dynamic_field::Field` object. */
|
|
210
462
|
type: string;
|
|
211
463
|
name: DynamicFieldName;
|
|
464
|
+
/**
|
|
465
|
+
* Type of the value. For dynamic object fields, `listDynamicFields` reports the child object's
|
|
466
|
+
* type and `getDynamicField` reports `0x2::object::ID`.
|
|
467
|
+
*/
|
|
212
468
|
valueType: string;
|
|
469
|
+
/**
|
|
470
|
+
* The field's value; `value.type` always equals `valueType`. For dynamic object fields,
|
|
471
|
+
* `listDynamicFields` returns the child object's BCS-encoded content and `getDynamicField`
|
|
472
|
+
* the child's ID.
|
|
473
|
+
*/
|
|
474
|
+
value: Include extends { value: true } ? DynamicFieldValue : undefined;
|
|
213
475
|
} & ({ $kind: 'DynamicField'; childId?: never } | { $kind: 'DynamicObject'; childId: string });
|
|
214
476
|
|
|
215
|
-
export type DynamicField = DynamicFieldEntry & {
|
|
216
|
-
value: DynamicFieldValue;
|
|
477
|
+
export type DynamicField = DynamicFieldEntry<{ value: true }> & {
|
|
217
478
|
version: string;
|
|
218
479
|
digest: string;
|
|
219
480
|
previousTransaction: string | null;
|
|
220
481
|
};
|
|
221
482
|
|
|
222
|
-
export interface ListDynamicFieldsResponse {
|
|
483
|
+
export interface ListDynamicFieldsResponse<out Include extends DynamicFieldInclude = {}> {
|
|
223
484
|
hasNextPage: boolean;
|
|
224
485
|
cursor: string | null;
|
|
225
|
-
dynamicFields: DynamicFieldEntry[];
|
|
486
|
+
dynamicFields: DynamicFieldEntry<Include>[];
|
|
226
487
|
}
|
|
227
488
|
|
|
228
489
|
export interface GetDynamicFieldResponse {
|
|
@@ -324,6 +585,8 @@ export namespace SuiClientTypes {
|
|
|
324
585
|
|
|
325
586
|
export interface Transaction<out Include extends TransactionInclude = {}> {
|
|
326
587
|
digest: string;
|
|
588
|
+
/** The address that sent the transaction: `0x0` for system transactions. */
|
|
589
|
+
sender: string;
|
|
327
590
|
signatures: string[];
|
|
328
591
|
epoch: string | null;
|
|
329
592
|
/**
|
|
@@ -395,8 +658,8 @@ export namespace SuiClientTypes {
|
|
|
395
658
|
/**
|
|
396
659
|
* Include events emitted by the transaction.
|
|
397
660
|
*
|
|
398
|
-
* On the GraphQL transport,
|
|
399
|
-
*
|
|
661
|
+
* On the GraphQL transport, `executeTransaction` and `simulateTransaction` return at most
|
|
662
|
+
* the first 50 events of a transaction; gRPC returns the full event list.
|
|
400
663
|
*/
|
|
401
664
|
events?: boolean;
|
|
402
665
|
/** Include a map of object IDs to their types for all changed objects. */
|
|
@@ -427,7 +690,82 @@ export namespace SuiClientTypes {
|
|
|
427
690
|
amount: string;
|
|
428
691
|
}
|
|
429
692
|
|
|
430
|
-
|
|
693
|
+
/** Ledger transaction data. Narrow `kind.$kind` to read the transaction's payload. */
|
|
694
|
+
export interface TransactionData {
|
|
695
|
+
version: 2;
|
|
696
|
+
sender: string;
|
|
697
|
+
gasData: GasData;
|
|
698
|
+
expiration: TransactionExpiration | null;
|
|
699
|
+
/**
|
|
700
|
+
* The inputs of a `ProgrammableTransaction` or `ProgrammableSystemTransaction` kind; empty for
|
|
701
|
+
* every other kind.
|
|
702
|
+
*/
|
|
703
|
+
inputs: TransactionInput[];
|
|
704
|
+
/**
|
|
705
|
+
* The commands of a `ProgrammableTransaction` or `ProgrammableSystemTransaction` kind; empty
|
|
706
|
+
* for every other kind.
|
|
707
|
+
*/
|
|
708
|
+
commands: TransactionCommand[];
|
|
709
|
+
kind: TransactionKind;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export interface GasData {
|
|
713
|
+
budget: string;
|
|
714
|
+
price: string;
|
|
715
|
+
owner: string;
|
|
716
|
+
payment: { objectId: string; version: string; digest: string }[];
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export type TransactionExpiration = NonNullable<BuilderTransactionData['expiration']>;
|
|
720
|
+
/** A kind this SDK cannot fully map, inputs and commands included, is `Unknown`. */
|
|
721
|
+
export type TransactionKind = EnumOutputShape<{
|
|
722
|
+
[Kind in BcsTransactionKind['$kind'] | 'Unknown']: Kind extends 'Unknown'
|
|
723
|
+
? true
|
|
724
|
+
: Kind extends 'ProgrammableTransaction' | 'ProgrammableSystemTransaction'
|
|
725
|
+
? ProgrammableTransaction
|
|
726
|
+
: Kind extends 'EndOfEpochTransaction'
|
|
727
|
+
? EndOfEpochTransactionKind[]
|
|
728
|
+
: Kind extends 'Genesis'
|
|
729
|
+
? { objects: GenesisObject[] }
|
|
730
|
+
: NonNullable<BcsTransactionKind[Exclude<Kind, 'Unknown'>]>;
|
|
731
|
+
}>;
|
|
732
|
+
export interface ProgrammableTransaction {
|
|
733
|
+
inputs: TransactionInput[];
|
|
734
|
+
commands: TransactionCommand[];
|
|
735
|
+
}
|
|
736
|
+
/** A resolved input; transactions on chain never contain unresolved inputs. */
|
|
737
|
+
export type TransactionInput = Exclude<
|
|
738
|
+
BuilderCallArg,
|
|
739
|
+
{ $kind: 'UnresolvedPure' | 'UnresolvedObject' }
|
|
740
|
+
>;
|
|
741
|
+
/** A command; transactions on chain never contain intents. */
|
|
742
|
+
export type TransactionCommand = Exclude<BuilderCommand, { $kind: '$Intent' }>;
|
|
743
|
+
export type ActiveJwk = NonNullable<
|
|
744
|
+
TransactionKind['AuthenticatorStateUpdate']
|
|
745
|
+
>['newActiveJwks'][number];
|
|
746
|
+
/** An end-of-epoch operation; ones this SDK version does not recognize are `Unknown`. */
|
|
747
|
+
export type EndOfEpochTransactionKind = EnumOutputShape<{
|
|
748
|
+
[Kind in BcsEndOfEpochTransactionKind['$kind'] | 'Unknown']: Kind extends 'Unknown'
|
|
749
|
+
? true
|
|
750
|
+
: Kind extends 'BridgeStateCreate'
|
|
751
|
+
? BridgeStateCreate
|
|
752
|
+
: NonNullable<BcsEndOfEpochTransactionKind[Exclude<Kind, 'Unknown'>]>;
|
|
753
|
+
}>;
|
|
754
|
+
/** An object created by the genesis transaction. */
|
|
755
|
+
export interface GenesisObject {
|
|
756
|
+
objectId: string;
|
|
757
|
+
version: string;
|
|
758
|
+
owner: ObjectOwner;
|
|
759
|
+
/** The object's Move type, or `package` for a package. */
|
|
760
|
+
type: string;
|
|
761
|
+
}
|
|
762
|
+
export interface BridgeStateCreate {
|
|
763
|
+
/**
|
|
764
|
+
* The chain identifier the bridge was created for: the first 4 bytes of the genesis
|
|
765
|
+
* checkpoint digest, hex encoded.
|
|
766
|
+
*/
|
|
767
|
+
chainId: string;
|
|
768
|
+
}
|
|
431
769
|
|
|
432
770
|
export interface GetTransactionOptions<
|
|
433
771
|
Include extends TransactionInclude = {},
|
|
@@ -490,6 +828,14 @@ export namespace SuiClientTypes {
|
|
|
490
828
|
* Defaults to `true` (checks enabled).
|
|
491
829
|
*/
|
|
492
830
|
checksEnabled?: boolean;
|
|
831
|
+
/**
|
|
832
|
+
* Whether the server selects the sender's real gas payment during simulation. When
|
|
833
|
+
* disabled, a transaction without gas coins may be simulated with a mocked gas coin
|
|
834
|
+
* (reported as `gasPaymentMocked`). Ignored when `checksEnabled` is `false`.
|
|
835
|
+
*
|
|
836
|
+
* @default `true` when the gas payment is set to `[]`, otherwise `false`
|
|
837
|
+
*/
|
|
838
|
+
doGasSelection?: boolean;
|
|
493
839
|
}
|
|
494
840
|
|
|
495
841
|
/** Query methods */
|
|
@@ -498,17 +844,33 @@ export namespace SuiClientTypes {
|
|
|
498
844
|
options: ListTransactionsOptions<Include>,
|
|
499
845
|
) => Promise<ListTransactionsResponse<Include>>;
|
|
500
846
|
listEvents: (options: ListEventsOptions) => Promise<ListEventsResponse>;
|
|
847
|
+
listCheckpoints: (options: ListCheckpointsOptions) => Promise<ListCheckpointsResponse>;
|
|
501
848
|
}
|
|
502
849
|
|
|
503
850
|
/**
|
|
504
|
-
* A filter matching transactions.
|
|
851
|
+
* A filter matching transactions. Every specified predicate must match (predicates are
|
|
852
|
+
* ANDed), and an empty filter matches every transaction.
|
|
505
853
|
*
|
|
506
|
-
*
|
|
854
|
+
* At most one of `affectedAddress`, `affectedObject`, or `function` may be specified;
|
|
855
|
+
* `sender` can be combined with any of them.
|
|
507
856
|
*/
|
|
508
|
-
export type TransactionFilter =
|
|
857
|
+
export type TransactionFilter = {
|
|
858
|
+
/** Match transactions sent by this address. */
|
|
859
|
+
sender?: string;
|
|
860
|
+
} & (
|
|
509
861
|
| {
|
|
510
|
-
/**
|
|
511
|
-
|
|
862
|
+
/**
|
|
863
|
+
* Match transactions this address sent or paid gas for, or that changed objects it owned
|
|
864
|
+
* before or owns after the transaction, or its address balance.
|
|
865
|
+
*/
|
|
866
|
+
affectedAddress: string;
|
|
867
|
+
affectedObject?: never;
|
|
868
|
+
function?: never;
|
|
869
|
+
}
|
|
870
|
+
| {
|
|
871
|
+
/** Match transactions whose effects include a change to this object. */
|
|
872
|
+
affectedObject: string;
|
|
873
|
+
affectedAddress?: never;
|
|
512
874
|
function?: never;
|
|
513
875
|
}
|
|
514
876
|
| {
|
|
@@ -518,83 +880,107 @@ export namespace SuiClientTypes {
|
|
|
518
880
|
* `package::module::function`.
|
|
519
881
|
*/
|
|
520
882
|
function: string;
|
|
521
|
-
|
|
522
|
-
|
|
883
|
+
affectedAddress?: never;
|
|
884
|
+
affectedObject?: never;
|
|
885
|
+
}
|
|
886
|
+
| {
|
|
887
|
+
affectedAddress?: never;
|
|
888
|
+
affectedObject?: never;
|
|
889
|
+
function?: never;
|
|
890
|
+
}
|
|
891
|
+
);
|
|
523
892
|
|
|
524
893
|
/**
|
|
525
|
-
* A filter matching events.
|
|
894
|
+
* A filter matching events. Every specified predicate must match (predicates are ANDed),
|
|
895
|
+
* and an empty filter matches every event.
|
|
526
896
|
*
|
|
527
|
-
*
|
|
528
|
-
* JSON-RPC transport, an `eventType` naming a generic type must include type arguments —
|
|
529
|
-
* a bare generic name (e.g. `0xpkg::mod::Event` for events of type `0xpkg::mod::Event<T>`)
|
|
530
|
-
* matches any instantiation on gRPC and GraphQL, but matches nothing on JSON-RPC, which
|
|
531
|
-
* compares the full type for exact equality.
|
|
897
|
+
* `emitModule` and `eventType` cannot be combined; `sender` can be combined with either.
|
|
532
898
|
*/
|
|
533
|
-
export type EventFilter =
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
emitModule?: never;
|
|
538
|
-
eventType?: never;
|
|
539
|
-
}
|
|
899
|
+
export type EventFilter = {
|
|
900
|
+
/** Match events emitted by transactions sent by this address. */
|
|
901
|
+
sender?: string;
|
|
902
|
+
} & (
|
|
540
903
|
| {
|
|
541
|
-
/**
|
|
904
|
+
/**
|
|
905
|
+
* Match events emitted by a module, specified as `package` (any module in the
|
|
906
|
+
* package) or `package::module`.
|
|
907
|
+
*/
|
|
542
908
|
emitModule: string;
|
|
543
|
-
sender?: never;
|
|
544
909
|
eventType?: never;
|
|
545
910
|
}
|
|
546
911
|
| {
|
|
547
912
|
/**
|
|
548
|
-
* Match events by type:
|
|
549
|
-
* module (`package::module`), or events with a fully qualified type
|
|
550
|
-
*
|
|
913
|
+
* Match events by type: every event whose type is defined in a package (`package`)
|
|
914
|
+
* or module (`package::module`), or events with a fully qualified type name
|
|
915
|
+
* (`package::module::Name` or `package::module::Name<T1, T2>`).
|
|
551
916
|
*
|
|
552
917
|
* A bare generic name (`package::module::Name` without type arguments) matches
|
|
553
|
-
* any instantiation
|
|
554
|
-
*
|
|
918
|
+
* any instantiation, while a name with type arguments only matches that exact
|
|
919
|
+
* instantiation.
|
|
555
920
|
*/
|
|
556
921
|
eventType: string;
|
|
557
|
-
sender?: never;
|
|
558
922
|
emitModule?: never;
|
|
559
|
-
}
|
|
923
|
+
}
|
|
924
|
+
| {
|
|
925
|
+
emitModule?: never;
|
|
926
|
+
eventType?: never;
|
|
927
|
+
}
|
|
928
|
+
);
|
|
560
929
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
930
|
+
/** A checkpoint sequence number. */
|
|
931
|
+
export type CheckpointNumber = string | number | bigint;
|
|
932
|
+
|
|
933
|
+
/** Pagination and range options shared by the ledger query methods. */
|
|
934
|
+
export interface LedgerQueryOptions extends CoreClientMethodOptions {
|
|
565
935
|
/**
|
|
566
936
|
* Maximum number of items to return. Defaults to 50.
|
|
567
937
|
*
|
|
568
938
|
* Servers cap page sizes (50 by default): values above the server's cap cause the
|
|
569
|
-
* GraphQL
|
|
570
|
-
*
|
|
939
|
+
* GraphQL transport to throw, while gRPC servers silently truncate the page to their
|
|
940
|
+
* configured maximum.
|
|
571
941
|
*/
|
|
572
942
|
limit?: number;
|
|
573
943
|
/**
|
|
574
|
-
* Return items strictly after this cursor in ledger order
|
|
575
|
-
* an ascending page, or the `startCursor` of a descending
|
|
576
|
-
*
|
|
944
|
+
* Return items strictly after this cursor in ledger order, regardless of `order`.
|
|
945
|
+
* Usually the `endCursor` of an ascending page, or the `startCursor` of a descending
|
|
946
|
+
* page to poll for new items. Can be combined with `before` to read a window.
|
|
947
|
+
*
|
|
948
|
+
* Cursors are only valid for the query that produced them: pass them back with the same
|
|
949
|
+
* filter and checkpoint range.
|
|
577
950
|
*/
|
|
578
951
|
after?: string | null;
|
|
579
952
|
/**
|
|
580
|
-
* Return items strictly before this cursor in ledger order
|
|
581
|
-
* a descending page
|
|
582
|
-
*
|
|
953
|
+
* Return items strictly before this cursor in ledger order, regardless of `order`.
|
|
954
|
+
* Usually the `endCursor` of a descending page. Can be combined with `after` to read a
|
|
955
|
+
* window.
|
|
583
956
|
*/
|
|
584
957
|
before?: string | null;
|
|
585
|
-
/**
|
|
586
|
-
|
|
587
|
-
|
|
958
|
+
/**
|
|
959
|
+
* Order of returned results. Defaults to `descending` when only `before` is provided,
|
|
960
|
+
* and `ascending` (oldest first) otherwise.
|
|
961
|
+
*/
|
|
962
|
+
order?: Order;
|
|
963
|
+
/**
|
|
964
|
+
* Only return items from checkpoints at or after this sequence number (inclusive).
|
|
965
|
+
* Intersects with `after`/`before`.
|
|
966
|
+
*/
|
|
967
|
+
startCheckpoint?: CheckpointNumber;
|
|
968
|
+
/**
|
|
969
|
+
* Only return items from checkpoints before this sequence number (exclusive). Must not
|
|
970
|
+
* be less than `startCheckpoint`. Intersects with `after`/`before`.
|
|
971
|
+
*/
|
|
972
|
+
endCheckpoint?: CheckpointNumber;
|
|
588
973
|
}
|
|
589
974
|
|
|
590
|
-
|
|
591
|
-
|
|
975
|
+
/** Pagination fields shared by `listTransactions`, `listEvents` and `listCheckpoints`. */
|
|
976
|
+
export interface LedgerQueryResponse {
|
|
592
977
|
/**
|
|
593
978
|
* Whether more items may be available after this page.
|
|
594
979
|
*
|
|
595
|
-
*
|
|
596
|
-
* query can return fewer items than `limit` (even none) with
|
|
597
|
-
* continuing from `endCursor` always makes progress through the
|
|
980
|
+
* Servers can bound how much of the ledger a single request scans, on gRPC and GraphQL
|
|
981
|
+
* alike, so a query can return fewer items than `limit` (even none) with
|
|
982
|
+
* `hasNextPage: true`; continuing from `endCursor` always makes progress through the
|
|
983
|
+
* scanned range.
|
|
598
984
|
*/
|
|
599
985
|
hasNextPage: boolean;
|
|
600
986
|
/**
|
|
@@ -603,73 +989,62 @@ export namespace SuiClientTypes {
|
|
|
603
989
|
*/
|
|
604
990
|
startCursor: string | null;
|
|
605
991
|
/**
|
|
606
|
-
*
|
|
607
|
-
*
|
|
992
|
+
* Position to continue from: the last returned item on a final page, otherwise the
|
|
993
|
+
* server's scan position, which can be past the last item or set on an empty page.
|
|
994
|
+
* Continue the query by passing it as `after` (ascending) or `before` (descending).
|
|
995
|
+
* When paging a window (`after` + `before`),
|
|
996
|
+
* keep the fixed bound and replace the moving one with `endCursor`.
|
|
608
997
|
*/
|
|
609
998
|
endCursor: string | null;
|
|
610
999
|
}
|
|
611
1000
|
|
|
612
|
-
export interface
|
|
1001
|
+
export interface ListTransactionsOptions<
|
|
1002
|
+
Include extends TransactionInclude = {},
|
|
1003
|
+
> extends LedgerQueryOptions {
|
|
1004
|
+
filter?: TransactionFilter;
|
|
1005
|
+
include?: Include & TransactionInclude;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export interface ListTransactionsResponse<
|
|
1009
|
+
out Include extends TransactionInclude = {},
|
|
1010
|
+
> extends LedgerQueryResponse {
|
|
1011
|
+
transactions: TransactionResult<Include>[];
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
export interface ListEventsOptions extends LedgerQueryOptions {
|
|
613
1015
|
filter?: EventFilter;
|
|
614
|
-
/**
|
|
615
|
-
* Maximum number of items to return. Defaults to 50.
|
|
616
|
-
*
|
|
617
|
-
* Servers cap page sizes (50 by default): values above the server's cap cause the
|
|
618
|
-
* GraphQL and JSON-RPC transports to throw, while gRPC servers silently truncate
|
|
619
|
-
* the page to their configured maximum.
|
|
620
|
-
*/
|
|
621
|
-
limit?: number;
|
|
622
|
-
/**
|
|
623
|
-
* Return items strictly after this cursor in ledger order (usually the `endCursor` of
|
|
624
|
-
* an ascending page, or the `startCursor` of a descending page to poll for new items).
|
|
625
|
-
* Implies `order: 'ascending'`, and cannot be combined with `before`.
|
|
626
|
-
*/
|
|
627
|
-
after?: string | null;
|
|
628
|
-
/**
|
|
629
|
-
* Return items strictly before this cursor in ledger order (usually the `endCursor` of
|
|
630
|
-
* a descending page). Implies `order: 'descending'`, and cannot be combined with
|
|
631
|
-
* `after`.
|
|
632
|
-
*/
|
|
633
|
-
before?: string | null;
|
|
634
|
-
/** Order of returned results. Defaults to `ascending` (oldest first). */
|
|
635
|
-
order?: 'ascending' | 'descending';
|
|
636
1016
|
}
|
|
637
1017
|
|
|
638
1018
|
/** An event returned from a query, along with its position in the ledger. */
|
|
639
1019
|
export interface EventEntry extends Event {
|
|
640
|
-
/**
|
|
641
|
-
|
|
642
|
-
*
|
|
643
|
-
* `null` on the JSON-RPC transport, which does not expose checkpoint
|
|
644
|
-
* information for queried events.
|
|
645
|
-
*/
|
|
646
|
-
checkpoint: string | null;
|
|
1020
|
+
/** The sequence number of the checkpoint containing the emitting transaction. */
|
|
1021
|
+
checkpoint: string;
|
|
647
1022
|
/** The digest of the transaction that emitted this event. */
|
|
648
1023
|
transactionDigest: string;
|
|
649
1024
|
/** The index of this event within its transaction's event list. */
|
|
650
1025
|
eventIndex: number;
|
|
651
1026
|
}
|
|
652
1027
|
|
|
653
|
-
export interface ListEventsResponse {
|
|
1028
|
+
export interface ListEventsResponse extends LedgerQueryResponse {
|
|
654
1029
|
events: EventEntry[];
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
export interface ListCheckpointsOptions extends LedgerQueryOptions {}
|
|
1033
|
+
|
|
1034
|
+
/** A checkpoint summary. */
|
|
1035
|
+
export interface Checkpoint {
|
|
1036
|
+
/** The checkpoint's sequence number. */
|
|
1037
|
+
sequenceNumber: string;
|
|
1038
|
+
/** The digest of the checkpoint summary. */
|
|
1039
|
+
digest: string;
|
|
1040
|
+
/** The epoch the checkpoint belongs to. */
|
|
1041
|
+
epoch: string;
|
|
1042
|
+
/** The checkpoint's timestamp, in milliseconds since the Unix epoch. */
|
|
1043
|
+
timestampMs: number;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
export interface ListCheckpointsResponse extends LedgerQueryResponse {
|
|
1047
|
+
checkpoints: Checkpoint[];
|
|
673
1048
|
}
|
|
674
1049
|
|
|
675
1050
|
export interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}
|
|
@@ -763,6 +1138,43 @@ export namespace SuiClientTypes {
|
|
|
763
1138
|
stakeSubsidyDecreaseRate: number;
|
|
764
1139
|
}
|
|
765
1140
|
|
|
1141
|
+
/** Signature verification methods */
|
|
1142
|
+
export interface VerifySignatureBaseOptions extends CoreClientMethodOptions {
|
|
1143
|
+
/** The serialized signature (flag, signature and public key), Base64. */
|
|
1144
|
+
signature: string;
|
|
1145
|
+
/** The account the signature must be valid for. */
|
|
1146
|
+
address: string;
|
|
1147
|
+
/**
|
|
1148
|
+
* Accept a signature from any of `address`'s current address aliases, not only from `address`
|
|
1149
|
+
* itself. Defaults to `true`.
|
|
1150
|
+
*/
|
|
1151
|
+
checkAddressAliases?: boolean;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
export type VerifySignatureOptions = VerifySignatureBaseOptions &
|
|
1155
|
+
(
|
|
1156
|
+
| {
|
|
1157
|
+
/** The signed personal message; a string is UTF-8 encoded. */
|
|
1158
|
+
personalMessage: Uint8Array | string;
|
|
1159
|
+
transaction?: never;
|
|
1160
|
+
}
|
|
1161
|
+
| {
|
|
1162
|
+
/** The signed BCS `TransactionData` bytes. */
|
|
1163
|
+
transaction: Uint8Array;
|
|
1164
|
+
personalMessage?: never;
|
|
1165
|
+
}
|
|
1166
|
+
);
|
|
1167
|
+
|
|
1168
|
+
export interface VerifySignatureResponse {
|
|
1169
|
+
valid: boolean;
|
|
1170
|
+
/** Why verification failed, for logs. The text differs by transport, so don't match on it. */
|
|
1171
|
+
reason?: string;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
export interface TransportMethods {
|
|
1175
|
+
verifySignature: (options: VerifySignatureOptions) => Promise<VerifySignatureResponse>;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
766
1178
|
/** ZkLogin methods */
|
|
767
1179
|
export interface VerifyZkLoginSignatureOptions extends CoreClientMethodOptions {
|
|
768
1180
|
bytes: string;
|
|
@@ -777,6 +1189,10 @@ export namespace SuiClientTypes {
|
|
|
777
1189
|
}
|
|
778
1190
|
|
|
779
1191
|
export interface TransportMethods {
|
|
1192
|
+
/**
|
|
1193
|
+
* @deprecated Use `verifySignature`. This method accepts signatures from the address's
|
|
1194
|
+
* aliases, like `verifySignature` does by default.
|
|
1195
|
+
*/
|
|
780
1196
|
verifyZkLoginSignature: (
|
|
781
1197
|
options: VerifyZkLoginSignatureOptions,
|
|
782
1198
|
) => Promise<ZkLoginVerifyResponse>;
|
|
@@ -1126,7 +1542,7 @@ export namespace SuiClientTypes {
|
|
|
1126
1542
|
* The JSON representation of the event's Move struct data.
|
|
1127
1543
|
*
|
|
1128
1544
|
* **Warning:** The exact shape and field names of this data may vary between different
|
|
1129
|
-
* API implementations (
|
|
1545
|
+
* API implementations (gRPC or GraphQL). For consistent data across APIs use
|
|
1130
1546
|
* the `bcs` field and parse the BCS data directly.
|
|
1131
1547
|
*/
|
|
1132
1548
|
json: Record<string, unknown> | null;
|
|
@@ -1141,7 +1557,6 @@ export namespace SuiClientTypes {
|
|
|
1141
1557
|
export interface MoveLocation {
|
|
1142
1558
|
package?: string;
|
|
1143
1559
|
module?: string;
|
|
1144
|
-
function?: number;
|
|
1145
1560
|
functionName?: string;
|
|
1146
1561
|
instruction?: number;
|
|
1147
1562
|
}
|