@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
|
@@ -577,9 +577,9 @@ export interface StakingPool {
|
|
|
577
577
|
* The total number of HANEUL tokens in this pool, including the HANEUL in the rewards_pool, as well as in all the principal
|
|
578
578
|
* in the `StakedHaneul` object, updated at epoch boundaries.
|
|
579
579
|
*
|
|
580
|
-
* @generated from protobuf field: optional uint64
|
|
580
|
+
* @generated from protobuf field: optional uint64 haneul_balance = 4;
|
|
581
581
|
*/
|
|
582
|
-
|
|
582
|
+
haneulBalance?: bigint;
|
|
583
583
|
/**
|
|
584
584
|
* The epoch stake rewards will be added here at the end of each epoch.
|
|
585
585
|
*
|
|
@@ -613,7 +613,7 @@ export interface StakingPool {
|
|
|
613
613
|
* Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
|
|
614
614
|
* This includes both the principal and rewards HANEUL withdrawn.
|
|
615
615
|
*
|
|
616
|
-
* @generated from protobuf field: optional uint64
|
|
616
|
+
* @generated from protobuf field: optional uint64 pending_total_haneul_withdraw = 9;
|
|
617
617
|
*/
|
|
618
618
|
pendingTotalHaneulWithdraw?: bigint;
|
|
619
619
|
/**
|
|
@@ -1160,7 +1160,7 @@ class StakingPool$Type extends MessageType<StakingPool> {
|
|
|
1160
1160
|
},
|
|
1161
1161
|
{
|
|
1162
1162
|
no: 9,
|
|
1163
|
-
name: '
|
|
1163
|
+
name: 'pending_total_haneul_withdraw',
|
|
1164
1164
|
kind: 'scalar',
|
|
1165
1165
|
opt: true,
|
|
1166
1166
|
T: 4 /*ScalarType.UINT64*/,
|
|
@@ -111,6 +111,14 @@ export interface SimulateTransactionResponse {
|
|
|
111
111
|
* @generated from protobuf field: repeated haneul.rpc.v2.CommandResult command_outputs = 2;
|
|
112
112
|
*/
|
|
113
113
|
commandOutputs: CommandResult[];
|
|
114
|
+
/**
|
|
115
|
+
* A suggested gas price to use, that is above RGP, in order to provide a
|
|
116
|
+
* better chance of the transaction being included in the presence of
|
|
117
|
+
* congested objects.
|
|
118
|
+
*
|
|
119
|
+
* @generated from protobuf field: optional uint64 suggested_gas_price = 3;
|
|
120
|
+
*/
|
|
121
|
+
suggestedGasPrice?: bigint;
|
|
114
122
|
}
|
|
115
123
|
/**
|
|
116
124
|
* An intermediate result/output from the execution of a single command
|
|
@@ -214,6 +222,14 @@ class SimulateTransactionResponse$Type extends MessageType<SimulateTransactionRe
|
|
|
214
222
|
repeat: 1 /*RepeatType.PACKED*/,
|
|
215
223
|
T: () => CommandResult,
|
|
216
224
|
},
|
|
225
|
+
{
|
|
226
|
+
no: 3,
|
|
227
|
+
name: 'suggested_gas_price',
|
|
228
|
+
kind: 'scalar',
|
|
229
|
+
opt: true,
|
|
230
|
+
T: 4 /*ScalarType.UINT64*/,
|
|
231
|
+
L: 0 /*LongType.BIGINT*/,
|
|
232
|
+
},
|
|
217
233
|
]);
|
|
218
234
|
}
|
|
219
235
|
}
|
package/src/jsonRpc/client.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { fromBase58, toBase64, toHex } from '@haneullabs/bcs';
|
|
|
5
5
|
import type { Signer } from '../cryptography/index.js';
|
|
6
6
|
import { BaseClient } from '../client/client.js';
|
|
7
7
|
import type { HaneulClientTypes } from '../client/types.js';
|
|
8
|
+
import { isCoinReservationDigest } from '../utils/coin-reservation.js';
|
|
8
9
|
import type { Transaction } from '../transactions/Transaction.js';
|
|
9
10
|
import { isTransaction } from '../transactions/Transaction.js';
|
|
10
11
|
import {
|
|
@@ -126,30 +127,11 @@ type NetworkOrTransport =
|
|
|
126
127
|
url?: never;
|
|
127
128
|
};
|
|
128
129
|
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
// Magic number used to identify fake address balance coins (last 20 bytes of the digest)
|
|
132
|
-
// See: haneul/crate./haneul-types/src/coin_reservation.rs
|
|
133
|
-
const COIN_RESERVATION_MAGIC = new Uint8Array([
|
|
134
|
-
0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac,
|
|
135
|
-
0xac, 0xac, 0xac, 0xac,
|
|
136
|
-
]);
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Checks if a digest indicates a fake address balance coin.
|
|
140
|
-
* These "coins" are created by the JSON RPC to represent address balances
|
|
141
|
-
* and should be filtered out from coin listings.
|
|
142
|
-
*/
|
|
143
|
-
function isCoinReservationDigest(digestBase58: string): boolean {
|
|
144
|
-
const digestBytes = fromBase58(digestBase58);
|
|
145
|
-
// Check if the last 20 bytes match the magic number
|
|
146
|
-
const last20Bytes = digestBytes.slice(12, 32);
|
|
147
|
-
return last20Bytes.every((byte, i) => byte === COIN_RESERVATION_MAGIC[i]);
|
|
148
|
-
}
|
|
130
|
+
const HANEUL_CLIENT_BRAND = Symbol.for('@haneullabs/HaneulJsonRpcClient') as never;
|
|
149
131
|
|
|
150
132
|
export function isHaneulJsonRpcClient(client: unknown): client is HaneulJsonRpcClient {
|
|
151
133
|
return (
|
|
152
|
-
typeof client === 'object' && client !== null && (client as any)[
|
|
134
|
+
typeof client === 'object' && client !== null && (client as any)[HANEUL_CLIENT_BRAND] === true
|
|
153
135
|
);
|
|
154
136
|
}
|
|
155
137
|
|
|
@@ -158,7 +140,7 @@ export class HaneulJsonRpcClient extends BaseClient {
|
|
|
158
140
|
jsonRpc = this;
|
|
159
141
|
protected transport: JsonRpcTransport;
|
|
160
142
|
|
|
161
|
-
get [
|
|
143
|
+
get [HANEUL_CLIENT_BRAND]() {
|
|
162
144
|
return true;
|
|
163
145
|
}
|
|
164
146
|
|
|
@@ -993,7 +975,7 @@ export class HaneulJsonRpcClient extends BaseClient {
|
|
|
993
975
|
});
|
|
994
976
|
}
|
|
995
977
|
|
|
996
|
-
// TODO: Migrate this to `
|
|
978
|
+
// TODO: Migrate this to `haneul_getChainIdentifier` once it is widely available.
|
|
997
979
|
async getChainIdentifier({ signal }: { signal?: AbortSignal } = {}): Promise<string> {
|
|
998
980
|
const checkpoint = await this.getCheckpoint({ id: '0', signal });
|
|
999
981
|
const bytes = fromBase58(checkpoint.digest);
|
package/src/jsonRpc/core.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { fromBase64, type InferBcsInput } from '@haneullabs/bcs';
|
|
|
5
5
|
|
|
6
6
|
import { bcs, TypeTagSerializer } from '../bcs/index.js';
|
|
7
7
|
import type {
|
|
8
|
+
DevInspectResults,
|
|
9
|
+
DryRunTransactionBlockResponse,
|
|
8
10
|
ExecutionStatus as JsonRpcExecutionStatus,
|
|
9
11
|
ObjectOwner,
|
|
10
12
|
HaneulMoveAbilitySet,
|
|
@@ -22,6 +24,7 @@ import { coreClientResolveTransactionPlugin } from '../client/core-resolver.js';
|
|
|
22
24
|
import { TransactionDataBuilder } from '../transactions/TransactionData.js';
|
|
23
25
|
import { chunk } from '@haneullabs/utils';
|
|
24
26
|
import { normalizeHaneulAddress, normalizeStructTag } from '../utils/haneul-types.js';
|
|
27
|
+
import { deriveDynamicFieldID } from '../utils/dynamic-fields.js';
|
|
25
28
|
import { HANEUL_FRAMEWORK_ADDRESS, HANEUL_SYSTEM_ADDRESS } from '../utils/constants.js';
|
|
26
29
|
import { CoreClient } from '../client/core.js';
|
|
27
30
|
import type { HaneulClientTypes } from '../client/types.js';
|
|
@@ -114,7 +117,7 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
114
117
|
this.#jsonRpcClient = jsonRpcClient;
|
|
115
118
|
}
|
|
116
119
|
|
|
117
|
-
async getObjects<Include extends HaneulClientTypes.ObjectInclude =
|
|
120
|
+
async getObjects<Include extends HaneulClientTypes.ObjectInclude = {}>(
|
|
118
121
|
options: HaneulClientTypes.GetObjectsOptions<Include>,
|
|
119
122
|
) {
|
|
120
123
|
const batches = chunk(options.objectIds, 50);
|
|
@@ -130,6 +133,7 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
130
133
|
options.include?.previousTransaction || options.include?.objectBcs ? true : false,
|
|
131
134
|
showStorageRebate: options.include?.objectBcs ?? false,
|
|
132
135
|
showContent: options.include?.json ?? false,
|
|
136
|
+
showDisplay: options.include?.display ?? false,
|
|
133
137
|
},
|
|
134
138
|
signal: options.signal,
|
|
135
139
|
});
|
|
@@ -147,7 +151,7 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
147
151
|
objects: results,
|
|
148
152
|
};
|
|
149
153
|
}
|
|
150
|
-
async listOwnedObjects<Include extends HaneulClientTypes.ObjectInclude =
|
|
154
|
+
async listOwnedObjects<Include extends HaneulClientTypes.ObjectInclude = {}>(
|
|
151
155
|
options: HaneulClientTypes.ListOwnedObjectsOptions<Include>,
|
|
152
156
|
) {
|
|
153
157
|
let filter: HaneulObjectDataFilter | null = null;
|
|
@@ -174,6 +178,7 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
174
178
|
options.include?.previousTransaction || options.include?.objectBcs ? true : false,
|
|
175
179
|
showStorageRebate: options.include?.objectBcs ?? false,
|
|
176
180
|
showContent: options.include?.json ?? false,
|
|
181
|
+
showDisplay: options.include?.display ?? false,
|
|
177
182
|
},
|
|
178
183
|
filter,
|
|
179
184
|
signal: options.signal,
|
|
@@ -286,7 +291,7 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
286
291
|
cursor: null,
|
|
287
292
|
};
|
|
288
293
|
}
|
|
289
|
-
async getTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
294
|
+
async getTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
290
295
|
options: HaneulClientTypes.GetTransactionOptions<Include>,
|
|
291
296
|
): Promise<HaneulClientTypes.TransactionResult<Include>> {
|
|
292
297
|
const transaction = await this.#jsonRpcClient.getTransactionBlock({
|
|
@@ -306,7 +311,7 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
306
311
|
|
|
307
312
|
return parseTransaction(transaction, options.include);
|
|
308
313
|
}
|
|
309
|
-
async executeTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
314
|
+
async executeTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
310
315
|
options: HaneulClientTypes.ExecuteTransactionOptions<Include>,
|
|
311
316
|
): Promise<HaneulClientTypes.TransactionResult<Include>> {
|
|
312
317
|
const transaction = await this.#jsonRpcClient.executeTransactionBlock({
|
|
@@ -327,11 +332,11 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
327
332
|
|
|
328
333
|
return parseTransaction(transaction, options.include);
|
|
329
334
|
}
|
|
330
|
-
async simulateTransaction<Include extends HaneulClientTypes.SimulateTransactionInclude =
|
|
335
|
+
async simulateTransaction<Include extends HaneulClientTypes.SimulateTransactionInclude = {}>(
|
|
331
336
|
options: HaneulClientTypes.SimulateTransactionOptions<Include>,
|
|
332
337
|
): Promise<HaneulClientTypes.SimulateTransactionResult<Include>> {
|
|
333
338
|
if (!(options.transaction instanceof Uint8Array)) {
|
|
334
|
-
await options.transaction.
|
|
339
|
+
await options.transaction.build({ client: this, onlyTransactionKind: true });
|
|
335
340
|
}
|
|
336
341
|
|
|
337
342
|
const tx = Transaction.from(options.transaction);
|
|
@@ -353,14 +358,44 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
353
358
|
})
|
|
354
359
|
: (options.transaction as Uint8Array);
|
|
355
360
|
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
361
|
+
const sender = tx.getData().sender ?? normalizeHaneulAddress('0x0');
|
|
362
|
+
const checksDisabled = options.checksEnabled === false;
|
|
363
|
+
|
|
364
|
+
let dryRunResult: DryRunTransactionBlockResponse | null = null;
|
|
365
|
+
try {
|
|
366
|
+
dryRunResult = await this.#jsonRpcClient.dryRunTransactionBlock({
|
|
367
|
+
transactionBlock: transactionBytes,
|
|
368
|
+
signal: options.signal,
|
|
369
|
+
});
|
|
370
|
+
} catch (e) {
|
|
371
|
+
if (!checksDisabled) {
|
|
372
|
+
throw e;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
let devInspectResult: DevInspectResults | null = null;
|
|
377
|
+
if (options.include?.commandResults || checksDisabled) {
|
|
378
|
+
try {
|
|
379
|
+
devInspectResult = await this.#jsonRpcClient.devInspectTransactionBlock({
|
|
380
|
+
sender,
|
|
381
|
+
transactionBlock: tx,
|
|
382
|
+
signal: options.signal,
|
|
383
|
+
});
|
|
384
|
+
} catch {}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const dryRunFailed = !dryRunResult || dryRunResult.effects.status.status !== 'success';
|
|
388
|
+
const effectsSource =
|
|
389
|
+
checksDisabled && dryRunFailed && devInspectResult
|
|
390
|
+
? devInspectResult
|
|
391
|
+
: (dryRunResult ?? devInspectResult);
|
|
392
|
+
if (!effectsSource) {
|
|
393
|
+
throw new Error('simulateTransaction failed: no results from dryRun or devInspect');
|
|
394
|
+
}
|
|
360
395
|
|
|
361
396
|
const { effects, objectTypes } = parseTransactionEffectsJson({
|
|
362
|
-
effects:
|
|
363
|
-
objectChanges:
|
|
397
|
+
effects: effectsSource.effects,
|
|
398
|
+
objectChanges: dryRunResult?.objectChanges ?? [],
|
|
364
399
|
});
|
|
365
400
|
|
|
366
401
|
const transactionData: HaneulClientTypes.Transaction<Include> = {
|
|
@@ -388,45 +423,35 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
388
423
|
bcs: (options.include?.bcs
|
|
389
424
|
? transactionBytes
|
|
390
425
|
: undefined) as HaneulClientTypes.Transaction<Include>['bcs'],
|
|
391
|
-
balanceChanges: (options.include?.balanceChanges
|
|
392
|
-
?
|
|
426
|
+
balanceChanges: (options.include?.balanceChanges && dryRunResult
|
|
427
|
+
? dryRunResult.balanceChanges.map((change) => ({
|
|
393
428
|
coinType: normalizeStructTag(change.coinType),
|
|
394
429
|
address: parseOwnerAddress(change.owner)!,
|
|
395
430
|
amount: change.amount,
|
|
396
431
|
}))
|
|
397
432
|
: undefined) as HaneulClientTypes.Transaction<Include>['balanceChanges'],
|
|
398
433
|
events: (options.include?.events
|
|
399
|
-
? (
|
|
434
|
+
? (effectsSource.events?.map((event) => ({
|
|
400
435
|
packageId: event.packageId,
|
|
401
436
|
module: event.transactionModule,
|
|
402
437
|
sender: event.sender,
|
|
403
438
|
eventType: event.type,
|
|
404
439
|
bcs: 'bcs' in event ? fromBase64(event.bcs) : new Uint8Array(),
|
|
440
|
+
json: (event.parsedJson as Record<string, unknown>) ?? null,
|
|
405
441
|
})) ?? [])
|
|
406
442
|
: undefined) as HaneulClientTypes.Transaction<Include>['events'],
|
|
407
443
|
};
|
|
408
444
|
|
|
409
445
|
let commandResults: HaneulClientTypes.CommandResult[] | undefined;
|
|
410
|
-
if (options.include?.commandResults) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
})
|
|
418
|
-
|
|
419
|
-
if (devInspectResult.results) {
|
|
420
|
-
commandResults = devInspectResult.results.map((result) => ({
|
|
421
|
-
returnValues: (result.returnValues ?? []).map(([bytes]) => ({
|
|
422
|
-
bcs: new Uint8Array(bytes),
|
|
423
|
-
})),
|
|
424
|
-
mutatedReferences: (result.mutableReferenceOutputs ?? []).map(([, bytes]) => ({
|
|
425
|
-
bcs: new Uint8Array(bytes),
|
|
426
|
-
})),
|
|
427
|
-
}));
|
|
428
|
-
}
|
|
429
|
-
} catch {}
|
|
446
|
+
if (options.include?.commandResults && devInspectResult?.results) {
|
|
447
|
+
commandResults = devInspectResult.results.map((result) => ({
|
|
448
|
+
returnValues: (result.returnValues ?? []).map(([bytes]) => ({
|
|
449
|
+
bcs: new Uint8Array(bytes),
|
|
450
|
+
})),
|
|
451
|
+
mutatedReferences: (result.mutableReferenceOutputs ?? []).map(([, bytes]) => ({
|
|
452
|
+
bcs: new Uint8Array(bytes),
|
|
453
|
+
})),
|
|
454
|
+
}));
|
|
430
455
|
}
|
|
431
456
|
|
|
432
457
|
return effects.status.success
|
|
@@ -453,6 +478,40 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
453
478
|
};
|
|
454
479
|
}
|
|
455
480
|
|
|
481
|
+
async getProtocolConfig(
|
|
482
|
+
options?: HaneulClientTypes.GetProtocolConfigOptions,
|
|
483
|
+
): Promise<HaneulClientTypes.GetProtocolConfigResponse> {
|
|
484
|
+
const result = await this.#jsonRpcClient.getProtocolConfig({ signal: options?.signal });
|
|
485
|
+
|
|
486
|
+
const attributes: Record<string, string | null> = {};
|
|
487
|
+
for (const [key, value] of Object.entries(result.attributes)) {
|
|
488
|
+
if (value === null) {
|
|
489
|
+
attributes[key] = null;
|
|
490
|
+
} else if ('u16' in value) {
|
|
491
|
+
attributes[key] = value.u16;
|
|
492
|
+
} else if ('u32' in value) {
|
|
493
|
+
attributes[key] = value.u32;
|
|
494
|
+
} else if ('u64' in value) {
|
|
495
|
+
attributes[key] = value.u64;
|
|
496
|
+
} else if ('f64' in value) {
|
|
497
|
+
attributes[key] = value.f64;
|
|
498
|
+
} else if ('bool' in value) {
|
|
499
|
+
attributes[key] = value.bool;
|
|
500
|
+
} else {
|
|
501
|
+
const entries = Object.entries(value);
|
|
502
|
+
attributes[key] = entries.length === 1 ? String(entries[0][1]) : JSON.stringify(value);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return {
|
|
507
|
+
protocolConfig: {
|
|
508
|
+
protocolVersion: result.protocolVersion,
|
|
509
|
+
featureFlags: { ...result.featureFlags },
|
|
510
|
+
attributes,
|
|
511
|
+
},
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
|
|
456
515
|
async getCurrentSystemState(
|
|
457
516
|
options?: HaneulClientTypes.GetCurrentSystemStateOptions,
|
|
458
517
|
): Promise<HaneulClientTypes.GetCurrentSystemStateResponse> {
|
|
@@ -503,21 +562,27 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
503
562
|
});
|
|
504
563
|
|
|
505
564
|
return {
|
|
506
|
-
dynamicFields: dynamicFields.data.map((dynamicField) => {
|
|
565
|
+
dynamicFields: dynamicFields.data.map((dynamicField): HaneulClientTypes.DynamicFieldEntry => {
|
|
507
566
|
const isDynamicObject = dynamicField.type === 'DynamicObject';
|
|
508
567
|
const fullType = isDynamicObject
|
|
509
568
|
? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name.type}>, 0x2::object::ID>`
|
|
510
569
|
: `0x2::dynamic_field::Field<${dynamicField.name.type}, ${dynamicField.objectType}>`;
|
|
511
570
|
|
|
571
|
+
const bcsBytes = fromBase64(dynamicField.bcsName);
|
|
572
|
+
const derivedNameType = isDynamicObject
|
|
573
|
+
? `0x2::dynamic_object_field::Wrapper<${dynamicField.name.type}>`
|
|
574
|
+
: dynamicField.name.type;
|
|
512
575
|
return {
|
|
513
|
-
|
|
576
|
+
$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',
|
|
577
|
+
fieldId: deriveDynamicFieldID(options.parentId, derivedNameType, bcsBytes),
|
|
514
578
|
type: normalizeStructTag(fullType),
|
|
515
579
|
name: {
|
|
516
580
|
type: dynamicField.name.type,
|
|
517
|
-
bcs:
|
|
581
|
+
bcs: bcsBytes,
|
|
518
582
|
},
|
|
519
583
|
valueType: dynamicField.objectType,
|
|
520
|
-
|
|
584
|
+
childId: isDynamicObject ? dynamicField.objectId : undefined,
|
|
585
|
+
} as HaneulClientTypes.DynamicFieldEntry;
|
|
521
586
|
}),
|
|
522
587
|
hasNextPage: dynamicFields.hasNextPage,
|
|
523
588
|
cursor: dynamicFields.nextCursor,
|
|
@@ -657,7 +722,7 @@ function serializeObjectToBcs(object: HaneulObjectData): Uint8Array | undefined
|
|
|
657
722
|
}
|
|
658
723
|
}
|
|
659
724
|
|
|
660
|
-
function parseObject<Include extends HaneulClientTypes.ObjectInclude =
|
|
725
|
+
function parseObject<Include extends HaneulClientTypes.ObjectInclude = {}>(
|
|
661
726
|
object: HaneulObjectData,
|
|
662
727
|
include?: Include,
|
|
663
728
|
): HaneulClientTypes.Object<Include> {
|
|
@@ -679,6 +744,12 @@ function parseObject<Include extends HaneulClientTypes.ObjectInclude = object>(
|
|
|
679
744
|
? null
|
|
680
745
|
: undefined;
|
|
681
746
|
|
|
747
|
+
const displayData = include?.display
|
|
748
|
+
? object.display?.data != null
|
|
749
|
+
? { output: object.display.data as Record<string, string>, errors: null }
|
|
750
|
+
: null
|
|
751
|
+
: undefined;
|
|
752
|
+
|
|
682
753
|
return {
|
|
683
754
|
objectId: object.objectId,
|
|
684
755
|
version: object.version,
|
|
@@ -693,6 +764,7 @@ function parseObject<Include extends HaneulClientTypes.ObjectInclude = object>(
|
|
|
693
764
|
: undefined) as HaneulClientTypes.Object<Include>['previousTransaction'],
|
|
694
765
|
objectBcs: objectBcs as HaneulClientTypes.Object<Include>['objectBcs'],
|
|
695
766
|
json: jsonContent as HaneulClientTypes.Object<Include>['json'],
|
|
767
|
+
display: displayData as HaneulClientTypes.Object<Include>['display'],
|
|
696
768
|
};
|
|
697
769
|
}
|
|
698
770
|
|
|
@@ -795,7 +867,7 @@ function parseOwnerAddress(owner: ObjectOwner): string | null {
|
|
|
795
867
|
throw new Error(`Unknown owner type: ${JSON.stringify(owner)}`);
|
|
796
868
|
}
|
|
797
869
|
|
|
798
|
-
function parseTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
870
|
+
function parseTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
799
871
|
transaction: HaneulTransactionBlockResponse,
|
|
800
872
|
include?: Include,
|
|
801
873
|
): HaneulClientTypes.TransactionResult<Include> {
|
|
@@ -879,6 +951,7 @@ function parseTransaction<Include extends HaneulClientTypes.TransactionInclude =
|
|
|
879
951
|
sender: event.sender,
|
|
880
952
|
eventType: event.type,
|
|
881
953
|
bcs: 'bcs' in event ? fromBase64(event.bcs) : new Uint8Array(),
|
|
954
|
+
json: (event.parsedJson as Record<string, unknown>) ?? null,
|
|
882
955
|
})) ?? [])
|
|
883
956
|
: undefined) as HaneulClientTypes.Transaction<Include>['events'],
|
|
884
957
|
};
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { PACKAGE_VERSION, TARGETED_RPC_VERSION } from '../version.js';
|
|
5
5
|
import { JsonRpcError, HaneulHTTPStatusError } from './errors.js';
|
|
6
|
-
import type { WebsocketClientOptions } from './rpc-websocket-client.js';
|
|
7
|
-
import { WebsocketClient } from './rpc-websocket-client.js';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* An object defining headers to be passed to the RPC server
|
|
@@ -13,15 +11,11 @@ export type HttpHeaders = { [header: string]: string };
|
|
|
13
11
|
|
|
14
12
|
export interface JsonRpcHTTPTransportOptions {
|
|
15
13
|
fetch?: typeof fetch;
|
|
16
|
-
WebSocketConstructor?: typeof WebSocket;
|
|
17
14
|
url: string;
|
|
18
15
|
rpc?: {
|
|
19
16
|
headers?: HttpHeaders;
|
|
20
17
|
url?: string;
|
|
21
18
|
};
|
|
22
|
-
websocket?: WebsocketClientOptions & {
|
|
23
|
-
url?: string;
|
|
24
|
-
};
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
export interface JsonRpcTransportRequestOptions {
|
|
@@ -30,25 +24,13 @@ export interface JsonRpcTransportRequestOptions {
|
|
|
30
24
|
signal?: AbortSignal;
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
export interface JsonRpcTransportSubscribeOptions<T> {
|
|
34
|
-
method: string;
|
|
35
|
-
unsubscribe: string;
|
|
36
|
-
params: unknown[];
|
|
37
|
-
onMessage: (event: T) => void;
|
|
38
|
-
signal?: AbortSignal;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
27
|
export interface JsonRpcTransport {
|
|
42
28
|
request<T = unknown>(input: JsonRpcTransportRequestOptions): Promise<T>;
|
|
43
|
-
subscribe<T = unknown>(
|
|
44
|
-
input: JsonRpcTransportSubscribeOptions<T>,
|
|
45
|
-
): Promise<() => Promise<boolean>>;
|
|
46
29
|
}
|
|
47
30
|
|
|
48
31
|
export class JsonRpcHTTPTransport implements JsonRpcTransport {
|
|
49
32
|
#requestId = 0;
|
|
50
33
|
#options: JsonRpcHTTPTransportOptions;
|
|
51
|
-
#websocketClient?: WebsocketClient;
|
|
52
34
|
|
|
53
35
|
constructor(options: JsonRpcHTTPTransportOptions) {
|
|
54
36
|
this.#options = options;
|
|
@@ -66,27 +48,6 @@ export class JsonRpcHTTPTransport implements JsonRpcTransport {
|
|
|
66
48
|
return fetchFn(input, init);
|
|
67
49
|
}
|
|
68
50
|
|
|
69
|
-
#getWebsocketClient(): WebsocketClient {
|
|
70
|
-
if (!this.#websocketClient) {
|
|
71
|
-
const WebSocketConstructor = this.#options.WebSocketConstructor ?? WebSocket;
|
|
72
|
-
if (!WebSocketConstructor) {
|
|
73
|
-
throw new Error(
|
|
74
|
-
'The current environment does not support WebSocket, you can provide a WebSocketConstructor in the options for HaneulHTTPTransport.',
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
this.#websocketClient = new WebsocketClient(
|
|
79
|
-
this.#options.websocket?.url ?? this.#options.url,
|
|
80
|
-
{
|
|
81
|
-
WebSocketConstructor,
|
|
82
|
-
...this.#options.websocket,
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return this.#websocketClient;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
51
|
async request<T>(input: JsonRpcTransportRequestOptions): Promise<T> {
|
|
91
52
|
this.#requestId += 1;
|
|
92
53
|
|
|
@@ -125,17 +86,4 @@ export class JsonRpcHTTPTransport implements JsonRpcTransport {
|
|
|
125
86
|
|
|
126
87
|
return data.result;
|
|
127
88
|
}
|
|
128
|
-
|
|
129
|
-
async subscribe<T>(input: JsonRpcTransportSubscribeOptions<T>): Promise<() => Promise<boolean>> {
|
|
130
|
-
const unsubscribe = await this.#getWebsocketClient().subscribe(input);
|
|
131
|
-
|
|
132
|
-
if (input.signal) {
|
|
133
|
-
input.signal.throwIfAborted();
|
|
134
|
-
input.signal.addEventListener('abort', () => {
|
|
135
|
-
unsubscribe();
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return async () => !!(await unsubscribe());
|
|
140
|
-
}
|
|
141
89
|
}
|
package/src/jsonRpc/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* ######################################
|
|
8
8
|
*
|
|
9
9
|
* This file is generated from:
|
|
10
|
-
* /
|
|
10
|
+
* /crates/haneul-open-rpc/spec/openrpc.json
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export interface AccumulatorEvent {
|
|
@@ -1374,7 +1374,7 @@ export interface HaneulValidatorSummary {
|
|
|
1374
1374
|
stakingPoolId: string;
|
|
1375
1375
|
/** The total number of HANEUL tokens in this pool. */
|
|
1376
1376
|
stakingPoolHaneulBalance: string;
|
|
1377
|
-
|
|
1377
|
+
haneulAddress: string;
|
|
1378
1378
|
votingPower: string;
|
|
1379
1379
|
workerAddress: string;
|
|
1380
1380
|
workerPubkeyBytes: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* ######################################
|
|
8
8
|
*
|
|
9
9
|
* This file is generated from:
|
|
10
|
-
* /
|
|
10
|
+
* /crates/haneul-open-rpc/spec/openrpc.json
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type * as RpcTypes from './generated.js';
|
|
@@ -304,7 +304,7 @@ export interface GetLatestHaneulSystemStateParams {
|
|
|
304
304
|
/**
|
|
305
305
|
* Return the list of objects owned by an address. Note that if the address owns more than
|
|
306
306
|
* `QUERY_MAX_RESULT_LIMIT` objects, the pagination is not accurate, because previous page may have
|
|
307
|
-
* been updated when the next page is fetched. Please use
|
|
307
|
+
* been updated when the next page is fetched. Please use haneulx_queryObjects if this is a concern.
|
|
308
308
|
*/
|
|
309
309
|
export type GetOwnedObjectsParams = {
|
|
310
310
|
/** the owner's Haneul address */
|
|
@@ -454,7 +454,7 @@ export interface UnsafeMoveCallParams {
|
|
|
454
454
|
/** the type arguments of the Move function */
|
|
455
455
|
typeArguments: string[];
|
|
456
456
|
/**
|
|
457
|
-
* the arguments to be passed into the Move function, in [HaneulJson](https://docs.haneul.io/
|
|
457
|
+
* the arguments to be passed into the Move function, in [HaneulJson](https://docs.haneul.io/build/haneul-json)
|
|
458
458
|
* format
|
|
459
459
|
*/
|
|
460
460
|
arguments: unknown[];
|
|
@@ -498,7 +498,7 @@ export interface UnsafePayParams {
|
|
|
498
498
|
}
|
|
499
499
|
/**
|
|
500
500
|
* Send all HANEUL coins to one recipient. This is for HANEUL coin only and does not require a separate gas
|
|
501
|
-
* coin object. Specifically, what
|
|
501
|
+
* coin object. Specifically, what pay_all_haneul does are: 1. accumulate all HANEUL from input coins and
|
|
502
502
|
* deposit all HANEUL to the first input coin 2. transfer the updated first coin to the recipient and also
|
|
503
503
|
* use this first coin as gas coin object. 3. the balance of the first input coin after tx is
|
|
504
504
|
* sum(input_coins) - actual_gas_cost. 4. all other input coins other than the first are deleted.
|
|
@@ -516,7 +516,7 @@ export interface UnsafePayAllHaneulParams {
|
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
518
|
* Send HANEUL coins to a list of addresses, following a list of amounts. This is for HANEUL coin only and
|
|
519
|
-
* does not require a separate gas coin object. Specifically, what
|
|
519
|
+
* does not require a separate gas coin object. Specifically, what pay_haneul does are: 1. debit each
|
|
520
520
|
* input_coin to create new coin following the order of amounts and assign it to the corresponding
|
|
521
521
|
* recipient. 2. accumulate all residual HANEUL from input coins left and deposit all HANEUL to the first
|
|
522
522
|
* input coin, then use the first input coin as the gas coin object. 3. the balance of the first input
|
|
@@ -649,7 +649,7 @@ export interface UnsafeTransferHaneulParams {
|
|
|
649
649
|
/** the transaction signer's Haneul address */
|
|
650
650
|
signer: string;
|
|
651
651
|
/** the Haneul coin object to be used in this transaction */
|
|
652
|
-
|
|
652
|
+
haneulObjectId: string;
|
|
653
653
|
/** the gas budget, the transaction will fail if the gas cost exceed the budget */
|
|
654
654
|
gasBudget: string;
|
|
655
655
|
/** the recipient's Haneul address */
|