@haneullabs/haneul 2.5.2 → 2.13.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 +129 -0
- package/README.md +36 -36
- package/dist/bcs/bcs.d.mts +6 -7
- package/dist/bcs/bcs.d.mts.map +1 -1
- package/dist/bcs/bcs.mjs.map +1 -1
- package/dist/bcs/effects.mjs.map +1 -1
- package/dist/bcs/index.d.mts +2 -2
- package/dist/bcs/index.d.mts.map +1 -1
- package/dist/bcs/index.mjs +2 -2
- package/dist/bcs/index.mjs.map +1 -1
- package/dist/bcs/pure.d.mts.map +1 -1
- package/dist/bcs/type-tag-serializer.d.mts.map +1 -1
- package/dist/bcs/types.d.mts +0 -1
- package/dist/bcs/types.d.mts.map +1 -1
- package/dist/client/cache.d.mts.map +1 -1
- package/dist/client/client.d.mts.map +1 -1
- package/dist/client/core-resolver.d.mts.map +1 -1
- package/dist/client/core-resolver.mjs +87 -68
- package/dist/client/core-resolver.mjs.map +1 -1
- package/dist/client/core.d.mts +9 -8
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs +29 -10
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/errors.d.mts.map +1 -1
- package/dist/client/mvr.d.mts +0 -1
- package/dist/client/mvr.d.mts.map +1 -1
- package/dist/client/types.d.mts +110 -24
- package/dist/client/types.d.mts.map +1 -1
- package/dist/client/utils.d.mts.map +1 -1
- package/dist/client/utils.mjs +7 -7
- package/dist/client/utils.mjs.map +1 -1
- package/dist/cryptography/index.d.mts +2 -2
- package/dist/cryptography/index.mjs +2 -2
- package/dist/cryptography/intent.d.mts +2 -2
- package/dist/cryptography/intent.d.mts.map +1 -1
- package/dist/cryptography/intent.mjs +2 -2
- package/dist/cryptography/intent.mjs.map +1 -1
- package/dist/cryptography/keypair.d.mts +3 -3
- package/dist/cryptography/keypair.d.mts.map +1 -1
- package/dist/cryptography/keypair.mjs +3 -3
- package/dist/cryptography/keypair.mjs.map +1 -1
- package/dist/cryptography/mnemonics.d.mts +5 -5
- package/dist/cryptography/mnemonics.d.mts.map +1 -1
- package/dist/cryptography/mnemonics.mjs +7 -7
- package/dist/cryptography/mnemonics.mjs.map +1 -1
- package/dist/cryptography/publickey.d.mts +1 -2
- package/dist/cryptography/publickey.d.mts.map +1 -1
- package/dist/cryptography/publickey.mjs +7 -7
- package/dist/cryptography/publickey.mjs.map +1 -1
- package/dist/cryptography/signature-scheme.d.mts.map +1 -1
- package/dist/cryptography/signature.d.mts +10 -13
- package/dist/cryptography/signature.d.mts.map +1 -1
- package/dist/cryptography/signature.mjs +2 -2
- package/dist/cryptography/signature.mjs.map +1 -1
- package/dist/faucet/faucet.d.mts +2 -2
- package/dist/faucet/faucet.d.mts.map +1 -1
- package/dist/faucet/faucet.mjs +2 -2
- package/dist/faucet/faucet.mjs.map +1 -1
- package/dist/faucet/index.d.mts +2 -2
- package/dist/faucet/index.mjs +2 -2
- package/dist/graphql/client.d.mts +20 -5
- package/dist/graphql/client.d.mts.map +1 -1
- package/dist/graphql/client.mjs +55 -7
- package/dist/graphql/client.mjs.map +1 -1
- package/dist/graphql/core.d.mts +6 -5
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +43 -47
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/generated/queries.d.mts +0 -1
- package/dist/graphql/generated/queries.d.mts.map +1 -1
- package/dist/graphql/generated/queries.mjs +46 -10
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/graphql/generated/tada-env.d.mts +706 -98
- package/dist/graphql/generated/tada-env.d.mts.map +1 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.mjs +2 -2
- package/dist/graphql/schema/index.d.mts +0 -1
- package/dist/graphql/schema/index.d.mts.map +1 -1
- package/dist/graphql/types.d.mts.map +1 -1
- package/dist/grpc/client.d.mts +20 -5
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +47 -7
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts +6 -5
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +35 -34
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/index.d.mts +2 -2
- package/dist/grpc/index.mjs +2 -2
- package/dist/grpc/proto/google/protobuf/any.d.mts +0 -1
- package/dist/grpc/proto/google/protobuf/any.d.mts.map +1 -1
- package/dist/grpc/proto/google/protobuf/duration.d.mts +0 -1
- package/dist/grpc/proto/google/protobuf/duration.d.mts.map +1 -1
- package/dist/grpc/proto/google/protobuf/field_mask.d.mts +0 -1
- package/dist/grpc/proto/google/protobuf/field_mask.d.mts.map +1 -1
- package/dist/grpc/proto/google/protobuf/struct.d.mts +1 -2
- package/dist/grpc/proto/google/protobuf/struct.d.mts.map +1 -1
- package/dist/grpc/proto/google/protobuf/timestamp.d.mts +0 -1
- package/dist/grpc/proto/google/protobuf/timestamp.d.mts.map +1 -1
- package/dist/grpc/proto/google/rpc/status.d.mts +0 -1
- package/dist/grpc/proto/google/rpc/status.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/argument.d.mts +1 -2
- package/dist/grpc/proto/haneul/rpc/v2/argument.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/balance_change.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/balance_change.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/bcs.d.mts +1 -2
- package/dist/grpc/proto/haneul/rpc/v2/bcs.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/bcs.mjs.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/checkpoint.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/checkpoint.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/checkpoint_contents.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/checkpoint_contents.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/checkpoint_summary.d.mts +1 -2
- package/dist/grpc/proto/haneul/rpc/v2/checkpoint_summary.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/effects.d.mts +5 -6
- package/dist/grpc/proto/haneul/rpc/v2/effects.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/epoch.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/epoch.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/error_reason.d.mts +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/error_reason.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/event.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/event.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/executed_transaction.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/executed_transaction.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/execution_status.d.mts +8 -9
- package/dist/grpc/proto/haneul/rpc/v2/execution_status.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/execution_status.mjs +4 -4
- package/dist/grpc/proto/haneul/rpc/v2/execution_status.mjs.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/gas_cost_summary.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/gas_cost_summary.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/input.d.mts +3 -4
- package/dist/grpc/proto/haneul/rpc/v2/input.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/jwk.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/jwk.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/ledger_service.client.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/ledger_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/ledger_service.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/ledger_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/move_package.d.mts +5 -6
- package/dist/grpc/proto/haneul/rpc/v2/move_package.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/move_package_service.client.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/move_package_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/move_package_service.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/move_package_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/name_service.client.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/name_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/name_service.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/name_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/object.d.mts +38 -2
- package/dist/grpc/proto/haneul/rpc/v2/object.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/object.mjs +26 -1
- package/dist/grpc/proto/haneul/rpc/v2/object.mjs.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/object_reference.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/object_reference.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/owner.d.mts +1 -2
- package/dist/grpc/proto/haneul/rpc/v2/owner.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/protocol_config.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/protocol_config.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature.d.mts +1 -2
- package/dist/grpc/proto/haneul/rpc/v2/signature.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature.mjs.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_scheme.d.mts +2 -2
- package/dist/grpc/proto/haneul/rpc/v2/signature_scheme.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_scheme.mjs +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_scheme.mjs.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_verification_service.client.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_verification_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_verification_service.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/signature_verification_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/state_service.client.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/state_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/state_service.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/state_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/subscription_service.client.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/subscription_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/subscription_service.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/subscription_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/system_state.d.mts +3 -4
- package/dist/grpc/proto/haneul/rpc/v2/system_state.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/system_state.mjs +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/system_state.mjs.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/transaction.d.mts +4 -5
- package/dist/grpc/proto/haneul/rpc/v2/transaction.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.client.d.mts +0 -1
- package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.client.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.d.mts +9 -2
- package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.d.mts.map +1 -1
- package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.mjs +23 -12
- package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.mjs.map +1 -1
- package/dist/grpc/proto/types.d.mts +2 -2
- package/dist/grpc/proto/types.d.mts.map +1 -1
- package/dist/grpc/proto/types.mjs +2 -1
- package/dist/jsonRpc/client.d.mts +4 -7
- package/dist/jsonRpc/client.d.mts.map +1 -1
- package/dist/jsonRpc/client.mjs +4 -33
- package/dist/jsonRpc/client.mjs.map +1 -1
- package/dist/jsonRpc/core.d.mts +8 -15
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +81 -34
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/jsonRpc/errors.d.mts.map +1 -1
- package/dist/jsonRpc/http-transport.d.mts +1 -17
- package/dist/jsonRpc/http-transport.d.mts.map +1 -1
- package/dist/jsonRpc/http-transport.mjs +0 -23
- package/dist/jsonRpc/http-transport.mjs.map +1 -1
- package/dist/jsonRpc/index.d.mts +3 -3
- package/dist/jsonRpc/network.d.mts.map +1 -1
- package/dist/jsonRpc/types/chain.d.mts.map +1 -1
- package/dist/jsonRpc/types/changes.d.mts.map +1 -1
- package/dist/jsonRpc/types/coins.d.mts.map +1 -1
- package/dist/jsonRpc/types/common.d.mts +1 -2
- package/dist/jsonRpc/types/common.d.mts.map +1 -1
- package/dist/jsonRpc/types/generated.d.mts +101 -129
- package/dist/jsonRpc/types/generated.d.mts.map +1 -1
- package/dist/jsonRpc/types/index.d.mts +1 -1
- package/dist/jsonRpc/types/params.d.mts +9 -14
- package/dist/jsonRpc/types/params.d.mts.map +1 -1
- package/dist/keypairs/ed25519/keypair.d.mts +8 -6
- package/dist/keypairs/ed25519/keypair.d.mts.map +1 -1
- package/dist/keypairs/ed25519/keypair.mjs +13 -9
- package/dist/keypairs/ed25519/keypair.mjs.map +1 -1
- package/dist/keypairs/ed25519/publickey.d.mts +0 -1
- package/dist/keypairs/ed25519/publickey.d.mts.map +1 -1
- package/dist/keypairs/passkey/keypair.d.mts +12 -5
- package/dist/keypairs/passkey/keypair.d.mts.map +1 -1
- package/dist/keypairs/passkey/keypair.mjs +20 -7
- package/dist/keypairs/passkey/keypair.mjs.map +1 -1
- package/dist/keypairs/passkey/publickey.d.mts +0 -1
- package/dist/keypairs/passkey/publickey.d.mts.map +1 -1
- package/dist/keypairs/passkey/types.d.mts.map +1 -1
- package/dist/keypairs/secp256k1/keypair.d.mts +3 -3
- package/dist/keypairs/secp256k1/keypair.d.mts.map +1 -1
- package/dist/keypairs/secp256k1/keypair.mjs +6 -6
- package/dist/keypairs/secp256k1/keypair.mjs.map +1 -1
- package/dist/keypairs/secp256k1/publickey.d.mts +0 -1
- package/dist/keypairs/secp256k1/publickey.d.mts.map +1 -1
- package/dist/keypairs/secp256r1/keypair.d.mts +3 -3
- package/dist/keypairs/secp256r1/keypair.d.mts.map +1 -1
- package/dist/keypairs/secp256r1/keypair.mjs +6 -6
- package/dist/keypairs/secp256r1/keypair.mjs.map +1 -1
- package/dist/keypairs/secp256r1/publickey.d.mts +0 -1
- package/dist/keypairs/secp256r1/publickey.d.mts.map +1 -1
- package/dist/multisig/publickey.d.mts +1 -0
- package/dist/multisig/publickey.d.mts.map +1 -1
- package/dist/multisig/publickey.mjs +7 -7
- package/dist/multisig/publickey.mjs.map +1 -1
- package/dist/multisig/signer.d.mts.map +1 -1
- package/dist/transactions/Arguments.d.mts.map +1 -1
- package/dist/transactions/Commands.d.mts +1 -1
- package/dist/transactions/Commands.d.mts.map +1 -1
- package/dist/transactions/Commands.mjs.map +1 -1
- package/dist/transactions/Inputs.d.mts.map +1 -1
- package/dist/transactions/ObjectCache.d.mts +3 -3
- package/dist/transactions/ObjectCache.d.mts.map +1 -1
- package/dist/transactions/Transaction.d.mts +26 -0
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/transactions/Transaction.mjs +23 -1
- package/dist/transactions/Transaction.mjs.map +1 -1
- package/dist/transactions/TransactionData.d.mts.map +1 -1
- package/dist/transactions/TransactionData.mjs +8 -8
- package/dist/transactions/TransactionData.mjs.map +1 -1
- package/dist/transactions/data/internal.d.mts +109 -109
- package/dist/transactions/data/internal.d.mts.map +1 -1
- package/dist/transactions/data/internal.mjs.map +1 -1
- package/dist/transactions/data/v1.d.mts +220 -221
- package/dist/transactions/data/v1.d.mts.map +1 -1
- package/dist/transactions/data/v2.d.mts.map +1 -1
- package/dist/transactions/data/v2.mjs.map +1 -1
- package/dist/transactions/executor/caching.mjs +2 -2
- package/dist/transactions/executor/caching.mjs.map +1 -1
- package/dist/transactions/executor/parallel.d.mts +1 -1
- package/dist/transactions/executor/parallel.d.mts.map +1 -1
- package/dist/transactions/executor/parallel.mjs +1 -1
- package/dist/transactions/executor/parallel.mjs.map +1 -1
- package/dist/transactions/executor/serial.d.mts +3 -3
- package/dist/transactions/executor/serial.d.mts.map +1 -1
- package/dist/transactions/executor/serial.mjs.map +1 -1
- package/dist/transactions/intents/CoinWithBalance.d.mts.map +1 -1
- package/dist/transactions/intents/CoinWithBalance.mjs +174 -97
- package/dist/transactions/intents/CoinWithBalance.mjs.map +1 -1
- package/dist/transactions/object.d.mts.map +1 -1
- package/dist/transactions/pure.d.mts.map +1 -1
- package/dist/transactions/pure.mjs +12 -12
- package/dist/transactions/pure.mjs.map +1 -1
- package/dist/transactions/resolve.d.mts.map +1 -1
- package/dist/transactions/resolve.mjs +3 -3
- package/dist/transactions/resolve.mjs.map +1 -1
- package/dist/transactions/serializer.d.mts.map +1 -1
- package/dist/transactions/serializer.mjs +15 -15
- 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/utils/coin-reservation.mjs +67 -0
- package/dist/utils/coin-reservation.mjs.map +1 -0
- package/dist/utils/constants.d.mts +2 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +2 -1
- package/dist/utils/constants.mjs.map +1 -1
- package/dist/utils/derived-objects.d.mts +0 -1
- package/dist/utils/derived-objects.d.mts.map +1 -1
- package/dist/utils/dynamic-fields.d.mts.map +1 -1
- package/dist/utils/dynamic-fields.mjs +4 -4
- package/dist/utils/dynamic-fields.mjs.map +1 -1
- package/dist/utils/format.d.mts.map +1 -1
- package/dist/utils/haneul-types.d.mts.map +1 -1
- package/dist/utils/haneul-types.mjs +8 -0
- package/dist/utils/haneul-types.mjs.map +1 -1
- package/dist/utils/haneulns.d.mts.map +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.mjs +2 -2
- package/dist/utils/move-registry.d.mts.map +1 -1
- package/dist/verify/verify.d.mts.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/address.d.mts.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/dist/zklogin/bcs.d.mts.map +1 -1
- package/dist/zklogin/jwt-decode.d.mts +0 -1
- package/dist/zklogin/jwt-decode.d.mts.map +1 -1
- package/dist/zklogin/jwt-utils.d.mts +0 -1
- package/dist/zklogin/jwt-utils.d.mts.map +1 -1
- package/dist/zklogin/nonce.d.mts.map +1 -1
- package/dist/zklogin/poseidon.d.mts.map +1 -1
- package/dist/zklogin/publickey.d.mts +0 -1
- package/dist/zklogin/publickey.d.mts.map +1 -1
- package/dist/zklogin/signature.d.mts.map +1 -1
- package/dist/zklogin/utils.d.mts.map +1 -1
- package/dist/zklogin/utils.mjs +1 -1
- package/dist/zklogin/utils.mjs.map +1 -1
- package/docs/bcs.md +132 -0
- package/docs/clients/core.md +616 -0
- package/docs/clients/graphql.md +99 -0
- package/docs/clients/grpc.md +152 -0
- package/docs/clients/index.md +93 -0
- package/docs/clients/json-rpc.md +235 -0
- package/docs/cryptography/keypairs.md +259 -0
- package/docs/cryptography/multisig.md +192 -0
- package/docs/cryptography/passkey.md +111 -0
- package/docs/cryptography/webcrypto-signer.md +81 -0
- package/docs/executors.md +148 -0
- package/docs/faucet.md +26 -0
- package/docs/hello-haneul.md +115 -0
- package/docs/index.md +56 -0
- package/docs/install.md +61 -0
- package/docs/llm-docs.md +32 -0
- package/docs/llms-index.md +66 -0
- package/docs/migrations/0.38.md +57 -0
- package/docs/migrations/haneul-1.0.md +454 -0
- package/docs/migrations/haneul-2.0/agent-prompt.md +42 -0
- package/docs/migrations/haneul-2.0/dapp-kit.md +350 -0
- package/docs/migrations/haneul-2.0/deepbook-v3.md +33 -0
- package/docs/migrations/haneul-2.0/haneul.md +341 -0
- package/docs/migrations/haneul-2.0/haneulns.md +42 -0
- package/docs/migrations/haneul-2.0/index.md +161 -0
- package/docs/migrations/haneul-2.0/json-rpc-migration.md +399 -0
- package/docs/migrations/haneul-2.0/kiosk.md +120 -0
- package/docs/migrations/haneul-2.0/sdk-maintainers.md +91 -0
- package/docs/migrations/haneul-2.0/seal.md +14 -0
- package/docs/migrations/haneul-2.0/wallet-builders.md +66 -0
- package/docs/migrations/haneul-2.0/walrus.md +41 -0
- package/docs/migrations/haneul-2.0/zksend.md +94 -0
- package/docs/plugins.md +255 -0
- package/docs/sdk-building.md +341 -0
- package/docs/transaction-building/basics.md +297 -0
- package/docs/transaction-building/gas.md +62 -0
- package/docs/transaction-building/intents.md +61 -0
- package/docs/transaction-building/offline.md +71 -0
- package/docs/transaction-building/sponsored-transactions.md +22 -0
- package/docs/utils/derived_objects.md +80 -0
- package/docs/utils/index.md +53 -0
- package/docs/zklogin.md +78 -0
- package/package.json +199 -199
- package/src/bcs/bcs.ts +13 -13
- package/src/bcs/effects.ts +20 -20
- package/src/bcs/index.ts +2 -2
- package/src/client/core-resolver.ts +150 -100
- package/src/client/core.ts +62 -22
- package/src/client/types.ts +109 -24
- package/src/cryptography/index.ts +2 -2
- package/src/cryptography/keypair.ts +2 -2
- package/src/cryptography/mnemonics.ts +7 -7
- package/src/cryptography/publickey.ts +5 -5
- package/src/faucet/faucet.ts +1 -1
- package/src/faucet/index.ts +1 -1
- package/src/graphql/client.ts +100 -8
- package/src/graphql/core.ts +73 -80
- package/src/graphql/generated/queries.ts +301 -51
- package/src/graphql/generated/schema.graphql +407 -104
- package/src/graphql/generated/tada-env.ts +779 -58
- package/src/graphql/index.ts +1 -1
- package/src/graphql/queries/getAllBalances.graphql +1 -1
- package/src/graphql/queries/getBalance.graphql +1 -1
- package/src/graphql/queries/getCoins.graphql +2 -2
- package/src/graphql/queries/getDynamicFields.graphql +9 -1
- package/src/graphql/queries/getMoveFunction.graphql +1 -1
- package/src/graphql/queries/getProtocolConfig.graphql +18 -0
- package/src/graphql/queries/nameService.graphql +1 -1
- package/src/graphql/queries/objects.graphql +11 -1
- package/src/graphql/queries/transactions.graphql +1 -3
- package/src/graphql/queries/verifyZkLoginSignature.graphql +1 -2
- package/src/grpc/client.ts +66 -8
- package/src/grpc/core.ts +74 -35
- package/src/grpc/index.ts +1 -1
- package/src/grpc/proto/haneul/rpc/v2/bcs.ts +1 -1
- package/src/grpc/proto/haneul/rpc/v2/execution_status.ts +4 -4
- package/src/grpc/proto/haneul/rpc/v2/object.ts +44 -0
- package/src/grpc/proto/haneul/rpc/v2/signature.ts +1 -1
- package/src/grpc/proto/haneul/rpc/v2/signature_scheme.ts +1 -1
- package/src/grpc/proto/haneul/rpc/v2/system_state.ts +4 -4
- package/src/grpc/proto/haneul/rpc/v2/transaction_execution_service.ts +16 -0
- package/src/jsonRpc/client.ts +5 -23
- package/src/jsonRpc/core.ts +114 -41
- package/src/jsonRpc/http-transport.ts +0 -52
- package/src/jsonRpc/index.ts +0 -1
- package/src/jsonRpc/types/common.ts +0 -1
- package/src/jsonRpc/types/generated.ts +2 -2
- package/src/jsonRpc/types/params.ts +6 -6
- package/src/keypairs/ed25519/keypair.ts +14 -10
- package/src/keypairs/passkey/keypair.ts +22 -8
- package/src/keypairs/secp256k1/keypair.ts +6 -6
- package/src/keypairs/secp256r1/keypair.ts +6 -6
- package/src/transactions/Commands.ts +1 -1
- package/src/transactions/Transaction.ts +38 -1
- package/src/transactions/TransactionData.ts +3 -3
- package/src/transactions/__tests__/bcs.test.ts +3 -3
- package/src/transactions/data/internal.ts +12 -12
- package/src/transactions/data/v2.ts +6 -6
- package/src/transactions/executor/caching.ts +2 -2
- package/src/transactions/executor/parallel.ts +1 -2
- package/src/transactions/executor/serial.ts +1 -1
- package/src/transactions/intents/CoinWithBalance.ts +247 -121
- package/src/utils/coin-reservation.ts +84 -0
- package/src/utils/constants.ts +2 -0
- package/src/utils/haneul-types.ts +16 -1
- package/src/utils/index.ts +1 -0
- package/src/version.ts +1 -1
- package/src/zklogin/utils.ts +1 -1
- package/dist/jsonRpc/rpc-websocket-client.d.mts +0 -26
- package/dist/jsonRpc/rpc-websocket-client.d.mts.map +0 -1
- package/dist/jsonRpc/rpc-websocket-client.mjs +0 -135
- package/dist/jsonRpc/rpc-websocket-client.mjs.map +0 -1
- package/src/jsonRpc/rpc-websocket-client.ts +0 -241
package/src/graphql/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
query getAllBalances($owner:
|
|
4
|
+
query getAllBalances($owner: HaneulAddress!, $limit: Int, $cursor: String) {
|
|
5
5
|
address(address: $owner) {
|
|
6
6
|
balances(first: $limit, after: $cursor) {
|
|
7
7
|
pageInfo {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
query getBalance($owner:
|
|
4
|
+
query getBalance($owner: HaneulAddress!, $coinType: String = "0x2::haneul::HANEUL") {
|
|
5
5
|
address(address: $owner) {
|
|
6
6
|
balance(coinType: $coinType) {
|
|
7
7
|
coinType {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
query getCoins(
|
|
5
|
-
$owner:
|
|
5
|
+
$owner: HaneulAddress!
|
|
6
6
|
$first: Int
|
|
7
7
|
$cursor: String
|
|
8
|
-
$type: String = "0x2::coin::Coin<0x2::
|
|
8
|
+
$type: String = "0x2::coin::Coin<0x2::haneul::HANEUL>"
|
|
9
9
|
) {
|
|
10
10
|
address(address: $owner) {
|
|
11
11
|
address
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
query getDynamicFields(
|
|
4
|
+
query getDynamicFields(
|
|
5
|
+
$parentId: HaneulAddress!
|
|
6
|
+
$first: Int
|
|
7
|
+
$cursor: String
|
|
8
|
+
$includeValue: Boolean = false
|
|
9
|
+
) {
|
|
5
10
|
address(address: $parentId) {
|
|
6
11
|
dynamicFields(first: $first, after: $cursor) {
|
|
7
12
|
pageInfo {
|
|
@@ -18,12 +23,15 @@ query getDynamicFields($parentId: SuiAddress!, $first: Int, $cursor: String) {
|
|
|
18
23
|
value {
|
|
19
24
|
__typename
|
|
20
25
|
... on MoveValue {
|
|
26
|
+
bcs @include(if: $includeValue)
|
|
21
27
|
type {
|
|
22
28
|
repr
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
... on MoveObject {
|
|
32
|
+
address
|
|
26
33
|
contents {
|
|
34
|
+
bcs @include(if: $includeValue)
|
|
27
35
|
type {
|
|
28
36
|
repr
|
|
29
37
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
query getOwnedObjects(
|
|
5
|
-
$owner:
|
|
5
|
+
$owner: HaneulAddress!
|
|
6
6
|
$limit: Int
|
|
7
7
|
$cursor: String
|
|
8
8
|
$filter: ObjectFilter
|
|
@@ -10,6 +10,7 @@ query getOwnedObjects(
|
|
|
10
10
|
$includePreviousTransaction: Boolean = false
|
|
11
11
|
$includeObjectBcs: Boolean = false
|
|
12
12
|
$includeJson: Boolean = false
|
|
13
|
+
$includeDisplay: Boolean = false
|
|
13
14
|
) {
|
|
14
15
|
address(address: $owner) {
|
|
15
16
|
objects(first: $limit, after: $cursor, filter: $filter) {
|
|
@@ -30,6 +31,7 @@ query multiGetObjects(
|
|
|
30
31
|
$includePreviousTransaction: Boolean = false
|
|
31
32
|
$includeObjectBcs: Boolean = false
|
|
32
33
|
$includeJson: Boolean = false
|
|
34
|
+
$includeDisplay: Boolean = false
|
|
33
35
|
) {
|
|
34
36
|
multiGetObjects(keys: $objectKeys) {
|
|
35
37
|
...OBJECT_FIELDS
|
|
@@ -45,6 +47,10 @@ fragment OBJECT_FIELDS on Object {
|
|
|
45
47
|
contents {
|
|
46
48
|
bcs @include(if: $includeContent)
|
|
47
49
|
json @include(if: $includeJson)
|
|
50
|
+
display @include(if: $includeDisplay) {
|
|
51
|
+
output
|
|
52
|
+
errors
|
|
53
|
+
}
|
|
48
54
|
type {
|
|
49
55
|
repr
|
|
50
56
|
}
|
|
@@ -69,6 +75,10 @@ fragment MOVE_OBJECT_FIELDS on MoveObject {
|
|
|
69
75
|
contents {
|
|
70
76
|
bcs @include(if: $includeContent)
|
|
71
77
|
json @include(if: $includeJson)
|
|
78
|
+
display @include(if: $includeDisplay) {
|
|
79
|
+
output
|
|
80
|
+
errors
|
|
81
|
+
}
|
|
72
82
|
type {
|
|
73
83
|
repr
|
|
74
84
|
}
|
|
@@ -18,7 +18,6 @@ query simulateTransaction(
|
|
|
18
18
|
doGasSelection: $doGasSelection
|
|
19
19
|
checksEnabled: $checksEnabled
|
|
20
20
|
) {
|
|
21
|
-
error
|
|
22
21
|
effects {
|
|
23
22
|
transaction {
|
|
24
23
|
...TRANSACTION_FIELDS
|
|
@@ -50,7 +49,6 @@ mutation executeTransaction(
|
|
|
50
49
|
$includeBcs: Boolean = false
|
|
51
50
|
) {
|
|
52
51
|
executeTransaction(transactionDataBcs: $transactionDataBcs, signatures: $signatures) {
|
|
53
|
-
errors
|
|
54
52
|
effects {
|
|
55
53
|
transaction {
|
|
56
54
|
...TRANSACTION_FIELDS
|
|
@@ -138,6 +136,7 @@ fragment TRANSACTION_FIELDS on Transaction {
|
|
|
138
136
|
repr
|
|
139
137
|
}
|
|
140
138
|
bcs
|
|
139
|
+
json
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
}
|
|
@@ -146,7 +145,6 @@ fragment TRANSACTION_FIELDS on Transaction {
|
|
|
146
145
|
|
|
147
146
|
query resolveTransaction($transaction: JSON!, $doGasSelection: Boolean = true) {
|
|
148
147
|
simulateTransaction(transaction: $transaction, doGasSelection: $doGasSelection) {
|
|
149
|
-
error
|
|
150
148
|
effects {
|
|
151
149
|
transaction {
|
|
152
150
|
transactionBcs
|
|
@@ -2,7 +2,7 @@ query verifyZkLoginSignature(
|
|
|
2
2
|
$bytes: Base64!
|
|
3
3
|
$signature: Base64!
|
|
4
4
|
$intentScope: ZkLoginIntentScope!
|
|
5
|
-
$author:
|
|
5
|
+
$author: HaneulAddress!
|
|
6
6
|
) {
|
|
7
7
|
verifyZkLoginSignature(
|
|
8
8
|
bytes: $bytes
|
|
@@ -11,6 +11,5 @@ query verifyZkLoginSignature(
|
|
|
11
11
|
author: $author
|
|
12
12
|
) {
|
|
13
13
|
success
|
|
14
|
-
error
|
|
15
14
|
}
|
|
16
15
|
}
|
package/src/grpc/client.ts
CHANGED
|
@@ -13,6 +13,9 @@ import { SubscriptionServiceClient } from './proto/haneul/rpc/v2/subscription_se
|
|
|
13
13
|
import { GrpcCoreClient } from './core.js';
|
|
14
14
|
import type { HaneulClientTypes } from '../client/index.js';
|
|
15
15
|
import { BaseClient } from '../client/index.js';
|
|
16
|
+
import { DynamicField_DynamicFieldKind } from './proto/haneul/rpc/v2/state_service.js';
|
|
17
|
+
import { normalizeStructTag } from '../utils/haneul-types.js';
|
|
18
|
+
import { fromBase64, toBase64 } from '@haneullabs/utils';
|
|
16
19
|
import { NameServiceClient } from './proto/haneul/rpc/v2/name_service.client.js';
|
|
17
20
|
import type { TransactionPlugin } from '../transactions/index.js';
|
|
18
21
|
|
|
@@ -30,14 +33,29 @@ export type HaneulGrpcClientOptions = {
|
|
|
30
33
|
| HaneulGrpcTransportOptions
|
|
31
34
|
);
|
|
32
35
|
|
|
33
|
-
const
|
|
36
|
+
const HANEUL_CLIENT_BRAND = Symbol.for('@haneullabs/HaneulGrpcClient') as never;
|
|
34
37
|
|
|
35
|
-
export function
|
|
38
|
+
export function isHaneulGrpcClient(client: unknown): client is HaneulGrpcClient {
|
|
36
39
|
return (
|
|
37
|
-
typeof client === 'object' && client !== null && (client as any)[
|
|
40
|
+
typeof client === 'object' && client !== null && (client as any)[HANEUL_CLIENT_BRAND] === true
|
|
38
41
|
);
|
|
39
42
|
}
|
|
40
43
|
|
|
44
|
+
export interface DynamicFieldInclude {
|
|
45
|
+
value?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> =
|
|
49
|
+
HaneulClientTypes.DynamicFieldEntry & {
|
|
50
|
+
value: Include extends { value: true } ? HaneulClientTypes.DynamicFieldValue : undefined;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {
|
|
54
|
+
hasNextPage: boolean;
|
|
55
|
+
cursor: string | null;
|
|
56
|
+
dynamicFields: DynamicFieldEntryWithValue<Include>[];
|
|
57
|
+
}
|
|
58
|
+
|
|
41
59
|
export class HaneulGrpcClient extends BaseClient implements HaneulClientTypes.TransportMethods {
|
|
42
60
|
core: GrpcCoreClient;
|
|
43
61
|
get mvr(): HaneulClientTypes.MvrMethods {
|
|
@@ -51,7 +69,7 @@ export class HaneulGrpcClient extends BaseClient implements HaneulClientTypes.Tr
|
|
|
51
69
|
signatureVerificationService: SignatureVerificationServiceClient;
|
|
52
70
|
nameService: NameServiceClient;
|
|
53
71
|
|
|
54
|
-
get [
|
|
72
|
+
get [HANEUL_CLIENT_BRAND]() {
|
|
55
73
|
return true;
|
|
56
74
|
}
|
|
57
75
|
|
|
@@ -148,10 +166,50 @@ export class HaneulGrpcClient extends BaseClient implements HaneulClientTypes.Tr
|
|
|
148
166
|
return this.core.getReferenceGasPrice();
|
|
149
167
|
}
|
|
150
168
|
|
|
151
|
-
listDynamicFields(
|
|
152
|
-
input: HaneulClientTypes.ListDynamicFieldsOptions,
|
|
153
|
-
): Promise<
|
|
154
|
-
|
|
169
|
+
async listDynamicFields<Include extends DynamicFieldInclude = {}>(
|
|
170
|
+
input: HaneulClientTypes.ListDynamicFieldsOptions & { include?: Include & DynamicFieldInclude },
|
|
171
|
+
): Promise<ListDynamicFieldsWithValueResponse<Include>> {
|
|
172
|
+
const includeValue = input.include?.value ?? false;
|
|
173
|
+
const paths = ['field_id', 'name', 'value_type', 'kind', 'child_id'];
|
|
174
|
+
if (includeValue) {
|
|
175
|
+
paths.push('value');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const response = await this.stateService.listDynamicFields({
|
|
179
|
+
parent: input.parentId,
|
|
180
|
+
pageToken: input.cursor ? fromBase64(input.cursor) : undefined,
|
|
181
|
+
pageSize: input.limit,
|
|
182
|
+
readMask: {
|
|
183
|
+
paths,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
dynamicFields: response.response.dynamicFields.map(
|
|
189
|
+
(field): DynamicFieldEntryWithValue<Include> => {
|
|
190
|
+
const isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;
|
|
191
|
+
const fieldType = isDynamicObject
|
|
192
|
+
? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${field.name?.name!}>,0x2::object::ID>`
|
|
193
|
+
: `0x2::dynamic_field::Field<${field.name?.name!},${field.valueType!}>`;
|
|
194
|
+
return {
|
|
195
|
+
$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',
|
|
196
|
+
fieldId: field.fieldId!,
|
|
197
|
+
name: {
|
|
198
|
+
type: field.name?.name!,
|
|
199
|
+
bcs: field.name?.value!,
|
|
200
|
+
},
|
|
201
|
+
valueType: field.valueType!,
|
|
202
|
+
type: normalizeStructTag(fieldType),
|
|
203
|
+
childId: field.childId,
|
|
204
|
+
value: (includeValue
|
|
205
|
+
? { type: field.valueType!, bcs: field.value?.value ?? new Uint8Array() }
|
|
206
|
+
: undefined) as DynamicFieldEntryWithValue<Include>['value'],
|
|
207
|
+
} as DynamicFieldEntryWithValue<Include>;
|
|
208
|
+
},
|
|
209
|
+
),
|
|
210
|
+
cursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null,
|
|
211
|
+
hasNextPage: response.response.nextPageToken !== undefined,
|
|
212
|
+
};
|
|
155
213
|
}
|
|
156
214
|
|
|
157
215
|
getDynamicField(
|
package/src/grpc/core.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { CoreClient, formatMoveAbortMessage, SimulationError } from '../client/i
|
|
|
6
6
|
import type { HaneulGrpcClient } from './client.js';
|
|
7
7
|
import type { Owner } from './proto/haneul/rpc/v2/owner.js';
|
|
8
8
|
import { Owner_OwnerKind } from './proto/haneul/rpc/v2/owner.js';
|
|
9
|
-
import { DynamicField_DynamicFieldKind } from './proto/haneul/rpc/v2/state_service.js';
|
|
10
9
|
import { chunk, fromBase64, toBase64 } from '@haneullabs/utils';
|
|
11
10
|
import type { ExecutedTransaction } from './proto/haneul/rpc/v2/executed_transaction.js';
|
|
12
11
|
import type { TransactionEffects } from './proto/haneul/rpc/v2/effects.js';
|
|
@@ -45,6 +44,7 @@ import {
|
|
|
45
44
|
grpcTransactionToTransactionData,
|
|
46
45
|
} from '../client/transaction-resolver.js';
|
|
47
46
|
import { Value } from './proto/google/protobuf/struct.js';
|
|
47
|
+
import { SimulateTransactionRequest_TransactionChecks } from './proto/haneul/rpc/v2/transaction_execution_service.js';
|
|
48
48
|
|
|
49
49
|
export interface GrpcCoreClientOptions extends CoreClientOptions {
|
|
50
50
|
client: HaneulGrpcClient;
|
|
@@ -56,7 +56,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
56
56
|
this.#client = client;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
async getObjects<Include extends HaneulClientTypes.ObjectInclude =
|
|
59
|
+
async getObjects<Include extends HaneulClientTypes.ObjectInclude = {}>(
|
|
60
60
|
options: HaneulClientTypes.GetObjectsOptions<Include>,
|
|
61
61
|
): Promise<HaneulClientTypes.GetObjectsResponse<Include>> {
|
|
62
62
|
const batches = chunk(options.objectIds, 50);
|
|
@@ -75,6 +75,9 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
75
75
|
if (options.include?.json) {
|
|
76
76
|
paths.push('json');
|
|
77
77
|
}
|
|
78
|
+
if (options.include?.display) {
|
|
79
|
+
paths.push('display');
|
|
80
|
+
}
|
|
78
81
|
|
|
79
82
|
for (const batch of batches) {
|
|
80
83
|
const response = await this.#client.ledgerService.batchGetObjects({
|
|
@@ -111,6 +114,11 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
111
114
|
: null
|
|
112
115
|
: undefined;
|
|
113
116
|
|
|
117
|
+
const displayData = mapDisplayProto(
|
|
118
|
+
options.include?.display,
|
|
119
|
+
object.result.object.display,
|
|
120
|
+
);
|
|
121
|
+
|
|
114
122
|
return {
|
|
115
123
|
objectId: object.result.object.objectId!,
|
|
116
124
|
version: object.result.object.version?.toString()!,
|
|
@@ -122,6 +130,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
122
130
|
undefined) as HaneulClientTypes.Object<Include>['previousTransaction'],
|
|
123
131
|
objectBcs: objectBcs as HaneulClientTypes.Object<Include>['objectBcs'],
|
|
124
132
|
json: jsonContent as HaneulClientTypes.Object<Include>['json'],
|
|
133
|
+
display: displayData as HaneulClientTypes.Object<Include>['display'],
|
|
125
134
|
};
|
|
126
135
|
}),
|
|
127
136
|
);
|
|
@@ -131,7 +140,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
131
140
|
objects: results,
|
|
132
141
|
};
|
|
133
142
|
}
|
|
134
|
-
async listOwnedObjects<Include extends HaneulClientTypes.ObjectInclude =
|
|
143
|
+
async listOwnedObjects<Include extends HaneulClientTypes.ObjectInclude = {}>(
|
|
135
144
|
options: HaneulClientTypes.ListOwnedObjectsOptions<Include>,
|
|
136
145
|
): Promise<HaneulClientTypes.ListOwnedObjectsResponse<Include>> {
|
|
137
146
|
const paths = ['owner', 'object_type', 'digest', 'version', 'object_id'];
|
|
@@ -147,6 +156,9 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
147
156
|
if (options.include?.json) {
|
|
148
157
|
paths.push('json');
|
|
149
158
|
}
|
|
159
|
+
if (options.include?.display) {
|
|
160
|
+
paths.push('display');
|
|
161
|
+
}
|
|
150
162
|
|
|
151
163
|
const response = await this.#client.stateService.listOwnedObjects({
|
|
152
164
|
owner: options.owner,
|
|
@@ -176,6 +188,10 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
176
188
|
? (Value.toJson(object.json) as Record<string, unknown>)
|
|
177
189
|
: null
|
|
178
190
|
: undefined) as HaneulClientTypes.Object<Include>['json'],
|
|
191
|
+
display: mapDisplayProto(
|
|
192
|
+
options.include?.display,
|
|
193
|
+
object.display,
|
|
194
|
+
) as HaneulClientTypes.Object<Include>['display'],
|
|
179
195
|
}),
|
|
180
196
|
);
|
|
181
197
|
|
|
@@ -285,7 +301,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
285
301
|
})),
|
|
286
302
|
};
|
|
287
303
|
}
|
|
288
|
-
async getTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
304
|
+
async getTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
289
305
|
options: HaneulClientTypes.GetTransactionOptions<Include>,
|
|
290
306
|
): Promise<HaneulClientTypes.TransactionResult<Include>> {
|
|
291
307
|
const paths = ['digest', 'transaction.digest', 'signatures', 'effects.status'];
|
|
@@ -327,7 +343,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
327
343
|
|
|
328
344
|
return parseTransaction(response.transaction, options.include);
|
|
329
345
|
}
|
|
330
|
-
async executeTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
346
|
+
async executeTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
331
347
|
options: HaneulClientTypes.ExecuteTransactionOptions<Include>,
|
|
332
348
|
): Promise<HaneulClientTypes.TransactionResult<Include>> {
|
|
333
349
|
const paths = ['digest', 'transaction.digest', 'signatures', 'effects.status'];
|
|
@@ -377,7 +393,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
377
393
|
|
|
378
394
|
return parseTransaction(response.transaction!, options.include);
|
|
379
395
|
}
|
|
380
|
-
async simulateTransaction<Include extends HaneulClientTypes.SimulateTransactionInclude =
|
|
396
|
+
async simulateTransaction<Include extends HaneulClientTypes.SimulateTransactionInclude = {}>(
|
|
381
397
|
options: HaneulClientTypes.SimulateTransactionOptions<Include>,
|
|
382
398
|
): Promise<HaneulClientTypes.SimulateTransactionResult<Include>> {
|
|
383
399
|
const paths = [
|
|
@@ -432,6 +448,10 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
432
448
|
paths,
|
|
433
449
|
},
|
|
434
450
|
doGasSelection: false,
|
|
451
|
+
checks:
|
|
452
|
+
options.checksEnabled === false
|
|
453
|
+
? SimulateTransactionRequest_TransactionChecks.DISABLED
|
|
454
|
+
: SimulateTransactionRequest_TransactionChecks.ENABLED,
|
|
435
455
|
});
|
|
436
456
|
|
|
437
457
|
const transactionResult = parseTransaction(response.transaction!, options.include);
|
|
@@ -477,6 +497,33 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
477
497
|
};
|
|
478
498
|
}
|
|
479
499
|
|
|
500
|
+
async getProtocolConfig(): Promise<HaneulClientTypes.GetProtocolConfigResponse> {
|
|
501
|
+
const response = await this.#client.ledgerService.getEpoch({
|
|
502
|
+
readMask: { paths: ['protocol_config'] },
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
const protocolConfig = response.response.epoch?.protocolConfig;
|
|
506
|
+
if (!protocolConfig) {
|
|
507
|
+
throw new Error('Protocol config not found in response');
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const featureFlags: Record<string, boolean> = { ...protocolConfig.featureFlags };
|
|
511
|
+
const attributes: Record<string, string | null> = {};
|
|
512
|
+
if (protocolConfig.attributes) {
|
|
513
|
+
for (const [key, value] of Object.entries(protocolConfig.attributes)) {
|
|
514
|
+
attributes[key] = value ?? null;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return {
|
|
519
|
+
protocolConfig: {
|
|
520
|
+
protocolVersion: protocolConfig.protocolVersion?.toString() ?? (null as never),
|
|
521
|
+
featureFlags,
|
|
522
|
+
attributes,
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
|
|
480
527
|
async getCurrentSystemState(): Promise<HaneulClientTypes.GetCurrentSystemStateResponse> {
|
|
481
528
|
const response = await this.#client.ledgerService.getEpoch({
|
|
482
529
|
readMask: {
|
|
@@ -561,34 +608,7 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
561
608
|
async listDynamicFields(
|
|
562
609
|
options: HaneulClientTypes.ListDynamicFieldsOptions,
|
|
563
610
|
): Promise<HaneulClientTypes.ListDynamicFieldsResponse> {
|
|
564
|
-
|
|
565
|
-
parent: options.parentId,
|
|
566
|
-
pageToken: options.cursor ? fromBase64(options.cursor) : undefined,
|
|
567
|
-
pageSize: options.limit,
|
|
568
|
-
readMask: {
|
|
569
|
-
paths: ['field_id', 'name', 'value_type', 'kind'],
|
|
570
|
-
},
|
|
571
|
-
});
|
|
572
|
-
|
|
573
|
-
return {
|
|
574
|
-
dynamicFields: response.response.dynamicFields.map((field) => {
|
|
575
|
-
const isDynamicObject = field.kind === DynamicField_DynamicFieldKind.OBJECT;
|
|
576
|
-
const fieldType = isDynamicObject
|
|
577
|
-
? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${field.name?.name!}>,0x2::object::ID>`
|
|
578
|
-
: `0x2::dynamic_field::Field<${field.name?.name!},${field.valueType!}>`;
|
|
579
|
-
return {
|
|
580
|
-
fieldId: field.fieldId!,
|
|
581
|
-
name: {
|
|
582
|
-
type: field.name?.name!,
|
|
583
|
-
bcs: field.name?.value!,
|
|
584
|
-
},
|
|
585
|
-
valueType: field.valueType!,
|
|
586
|
-
type: normalizeStructTag(fieldType),
|
|
587
|
-
};
|
|
588
|
-
}),
|
|
589
|
-
cursor: response.response.nextPageToken ? toBase64(response.response.nextPageToken) : null,
|
|
590
|
-
hasNextPage: response.response.nextPageToken !== undefined,
|
|
591
|
-
};
|
|
611
|
+
return this.#client.listDynamicFields(options);
|
|
592
612
|
}
|
|
593
613
|
|
|
594
614
|
async verifyZkLoginSignature(
|
|
@@ -780,6 +800,24 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
780
800
|
}
|
|
781
801
|
}
|
|
782
802
|
|
|
803
|
+
function mapDisplayProto(
|
|
804
|
+
include: boolean | undefined,
|
|
805
|
+
display: { output?: Value; errors?: Value } | undefined,
|
|
806
|
+
): HaneulClientTypes.Display | null | undefined {
|
|
807
|
+
if (!include) return undefined;
|
|
808
|
+
if (display === undefined) return null;
|
|
809
|
+
return {
|
|
810
|
+
output:
|
|
811
|
+
display.output !== undefined
|
|
812
|
+
? (Value.toJson(display.output) as Record<string, string> | null)
|
|
813
|
+
: null,
|
|
814
|
+
errors:
|
|
815
|
+
display.errors !== undefined
|
|
816
|
+
? (Value.toJson(display.errors) as Record<string, string> | null)
|
|
817
|
+
: null,
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
|
|
783
821
|
function mapOwner(owner: Owner | null | undefined): HaneulClientTypes.ObjectOwner | null {
|
|
784
822
|
if (!owner) {
|
|
785
823
|
return null;
|
|
@@ -1166,7 +1204,7 @@ export function parseTransactionEffects({
|
|
|
1166
1204
|
};
|
|
1167
1205
|
}
|
|
1168
1206
|
|
|
1169
|
-
function parseTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
1207
|
+
function parseTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
1170
1208
|
transaction: ExecutedTransaction,
|
|
1171
1209
|
include?: Include,
|
|
1172
1210
|
): HaneulClientTypes.TransactionResult<Include> {
|
|
@@ -1244,6 +1282,7 @@ function parseTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
|
1244
1282
|
sender: normalizeHaneulAddress(event.sender!),
|
|
1245
1283
|
eventType: event.eventType!,
|
|
1246
1284
|
bcs: event.contents?.value ?? new Uint8Array(),
|
|
1285
|
+
json: event.json ? (Value.toJson(event.json) as Record<string, unknown>) : null,
|
|
1247
1286
|
})) ?? [])
|
|
1248
1287
|
: undefined) as HaneulClientTypes.Transaction<Include>['events'],
|
|
1249
1288
|
};
|
package/src/grpc/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
export { HaneulGrpcClient,
|
|
4
|
+
export { HaneulGrpcClient, isHaneulGrpcClient } from './client.js';
|
|
5
5
|
export { GrpcCoreClient } from './core.js';
|
|
6
6
|
export type { HaneulGrpcClientOptions } from './client.js';
|
|
7
7
|
export type { GrpcCoreClientOptions } from './core.js';
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { MessageType } from '@protobuf-ts/runtime';
|
|
13
13
|
/**
|
|
14
14
|
* `Bcs` contains an arbitrary type that is serialized using the
|
|
15
|
-
* [BCS](https://mystenlabs.github.
|
|
15
|
+
* [BCS](https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs)
|
|
16
16
|
* format as well as a name that identifies the type of the serialized value.
|
|
17
17
|
*
|
|
18
18
|
* @generated from protobuf message haneul.rpc.v2.Bcs
|
|
@@ -196,9 +196,9 @@ export enum ExecutionError_ExecutionErrorKind {
|
|
|
196
196
|
/**
|
|
197
197
|
* Haneul Move bytecode verification error.
|
|
198
198
|
*
|
|
199
|
-
* @generated from protobuf enum value:
|
|
199
|
+
* @generated from protobuf enum value: HANEUL_MOVE_VERIFICATION_ERROR = 11;
|
|
200
200
|
*/
|
|
201
|
-
|
|
201
|
+
HANEUL_MOVE_VERIFICATION_ERROR = 11,
|
|
202
202
|
/**
|
|
203
203
|
* Error from a non-abort instruction.
|
|
204
204
|
* Possible causes:
|
|
@@ -325,9 +325,9 @@ export enum ExecutionError_ExecutionErrorKind {
|
|
|
325
325
|
/**
|
|
326
326
|
* Haneul Move bytecode verification timed out.
|
|
327
327
|
*
|
|
328
|
-
* @generated from protobuf enum value:
|
|
328
|
+
* @generated from protobuf enum value: HANEUL_MOVE_VERIFICATION_TIMEDOUT = 31;
|
|
329
329
|
*/
|
|
330
|
-
|
|
330
|
+
HANEUL_MOVE_VERIFICATION_TIMEDOUT = 31,
|
|
331
331
|
/**
|
|
332
332
|
* The requested consensus object operation is not allowed.
|
|
333
333
|
*
|
|
@@ -107,6 +107,13 @@ export interface Object {
|
|
|
107
107
|
* @generated from protobuf field: optional uint64 balance = 101;
|
|
108
108
|
*/
|
|
109
109
|
balance?: bigint;
|
|
110
|
+
/**
|
|
111
|
+
* JSON rendering of the object based on an on-chain template.
|
|
112
|
+
* This will not be set if the value's type does not have an associated `Display` template.
|
|
113
|
+
*
|
|
114
|
+
* @generated from protobuf field: optional haneul.rpc.v2.Display display = 102;
|
|
115
|
+
*/
|
|
116
|
+
display?: Display;
|
|
110
117
|
}
|
|
111
118
|
/**
|
|
112
119
|
* Set of Objects
|
|
@@ -121,6 +128,29 @@ export interface ObjectSet {
|
|
|
121
128
|
*/
|
|
122
129
|
objects: Object[];
|
|
123
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* A rendered JSON blob based on an on-chain template.
|
|
133
|
+
*
|
|
134
|
+
* @generated from protobuf message haneul.rpc.v2.Display
|
|
135
|
+
*/
|
|
136
|
+
export interface Display {
|
|
137
|
+
/**
|
|
138
|
+
* Output for all successfully substituted display fields. Unsuccessful
|
|
139
|
+
* fields will be `null`, and will be accompanied by a field in `errors`,
|
|
140
|
+
* explaining the error.
|
|
141
|
+
*
|
|
142
|
+
* @generated from protobuf field: optional google.protobuf.Value output = 1;
|
|
143
|
+
*/
|
|
144
|
+
output?: Value;
|
|
145
|
+
/**
|
|
146
|
+
* If any fields failed to render, this will contain a mapping from failed
|
|
147
|
+
* field names to error messages. If all fields succeed, this will either be
|
|
148
|
+
* `null` or not set.
|
|
149
|
+
*
|
|
150
|
+
* @generated from protobuf field: optional google.protobuf.Value errors = 2;
|
|
151
|
+
*/
|
|
152
|
+
errors?: Value;
|
|
153
|
+
}
|
|
124
154
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
125
155
|
class Object$Type extends MessageType<Object> {
|
|
126
156
|
constructor() {
|
|
@@ -165,6 +195,7 @@ class Object$Type extends MessageType<Object> {
|
|
|
165
195
|
T: 4 /*ScalarType.UINT64*/,
|
|
166
196
|
L: 0 /*LongType.BIGINT*/,
|
|
167
197
|
},
|
|
198
|
+
{ no: 102, name: 'display', kind: 'message', T: () => Display },
|
|
168
199
|
]);
|
|
169
200
|
}
|
|
170
201
|
}
|
|
@@ -184,3 +215,16 @@ class ObjectSet$Type extends MessageType<ObjectSet> {
|
|
|
184
215
|
* @generated MessageType for protobuf message haneul.rpc.v2.ObjectSet
|
|
185
216
|
*/
|
|
186
217
|
export const ObjectSet = new ObjectSet$Type();
|
|
218
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
219
|
+
class Display$Type extends MessageType<Display> {
|
|
220
|
+
constructor() {
|
|
221
|
+
super('haneul.rpc.v2.Display', [
|
|
222
|
+
{ no: 1, name: 'output', kind: 'message', T: () => Value },
|
|
223
|
+
{ no: 2, name: 'errors', kind: 'message', T: () => Value },
|
|
224
|
+
]);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @generated MessageType for protobuf message haneul.rpc.v2.Display
|
|
229
|
+
*/
|
|
230
|
+
export const Display = new Display$Type();
|
|
@@ -418,7 +418,7 @@ export interface CircomG2 {
|
|
|
418
418
|
* A passkey authenticator.
|
|
419
419
|
*
|
|
420
420
|
* See
|
|
421
|
-
* [struct.PasskeyAuthenticator](https://mystenlabs.github.
|
|
421
|
+
* [struct.PasskeyAuthenticator](https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs)
|
|
422
422
|
* for more information on the requirements on the shape of the
|
|
423
423
|
* `client_data_json` field.
|
|
424
424
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Note: the enum values defined by this proto message exactly match their
|
|
16
16
|
* expected BCS serialized values when serialized as a u8. See
|
|
17
|
-
* [enum.SignatureScheme](https://mystenlabs.github.
|
|
17
|
+
* [enum.SignatureScheme](https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html)
|
|
18
18
|
* for more information about signature schemes.
|
|
19
19
|
*
|
|
20
20
|
* @generated from protobuf enum haneul.rpc.v2.SignatureScheme
|