@haneullabs/haneul 2.5.1 → 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 +2 -3
- package/dist/cryptography/publickey.d.mts.map +1 -1
- package/dist/cryptography/publickey.mjs +10 -10
- 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 +4 -5
- 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 +8 -8
- 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 +32 -6
- 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 +16 -16
- 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/index.d.mts +2 -2
- package/dist/verify/index.mjs +2 -2
- package/dist/verify/verify.d.mts +2 -2
- package/dist/verify/verify.d.mts.map +1 -1
- package/dist/verify/verify.mjs +2 -2
- package/dist/verify/verify.mjs.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/nonce.mjs +1 -1
- package/dist/zklogin/nonce.mjs.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 +8 -8
- 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/multisig/publickey.ts +1 -1
- 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/verify/index.ts +1 -1
- package/src/verify/verify.ts +1 -1
- package/src/version.ts +1 -1
- package/src/zklogin/nonce.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/client/types.ts
CHANGED
|
@@ -58,24 +58,54 @@ export namespace HaneulClientTypes {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface ObjectInclude {
|
|
61
|
+
/**
|
|
62
|
+
* Include the BCS-encoded Move struct content of the object.
|
|
63
|
+
*
|
|
64
|
+
* Returns the raw bytes of the object's Move struct fields — pass directly to
|
|
65
|
+
* generated BCS types (e.g., `MyStruct.parse(object.content)`).
|
|
66
|
+
*/
|
|
61
67
|
content?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Include the digest of the transaction that last mutated this object.
|
|
70
|
+
*/
|
|
62
71
|
previousTransaction?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Include the full BCS-encoded object envelope. Rarely needed — most metadata
|
|
74
|
+
* (owner, version, type) is already available as fields on the object response.
|
|
75
|
+
*
|
|
76
|
+
* Parse with `bcs.Object.parse(object.objectBcs)` from `@haneullabs/haneul/bcs`.
|
|
77
|
+
* Do not pass to a Move struct parser — use `content` for that instead.
|
|
78
|
+
*/
|
|
63
79
|
objectBcs?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Include the JSON representation of the object's Move struct content.
|
|
82
|
+
*
|
|
83
|
+
* **Warning:** The exact shape and field names of this data may vary between different
|
|
84
|
+
* API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs,
|
|
85
|
+
* use the `content` field and parse the BCS data directly.
|
|
86
|
+
*/
|
|
64
87
|
json?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Include the Display v2 rendered output for the object.
|
|
90
|
+
*
|
|
91
|
+
* Returns a map of display field names to their rendered string values.
|
|
92
|
+
* Returns `null` if the object's type does not have an associated Display template.
|
|
93
|
+
*/
|
|
94
|
+
display?: boolean;
|
|
65
95
|
}
|
|
66
96
|
|
|
67
97
|
export interface GetObjectsOptions<
|
|
68
98
|
Include extends ObjectInclude = {},
|
|
69
99
|
> extends CoreClientMethodOptions {
|
|
70
100
|
objectIds: string[];
|
|
71
|
-
include?: Include;
|
|
101
|
+
include?: Include & ObjectInclude;
|
|
72
102
|
}
|
|
73
103
|
|
|
74
104
|
export interface GetObjectOptions<
|
|
75
105
|
Include extends ObjectInclude = {},
|
|
76
106
|
> extends CoreClientMethodOptions {
|
|
77
107
|
objectId: string;
|
|
78
|
-
include?: Include;
|
|
108
|
+
include?: Include & ObjectInclude;
|
|
79
109
|
}
|
|
80
110
|
|
|
81
111
|
export interface ListOwnedObjectsOptions<
|
|
@@ -85,7 +115,7 @@ export namespace HaneulClientTypes {
|
|
|
85
115
|
limit?: number;
|
|
86
116
|
cursor?: string | null;
|
|
87
117
|
type?: string;
|
|
88
|
-
include?: Include;
|
|
118
|
+
include?: Include & ObjectInclude;
|
|
89
119
|
}
|
|
90
120
|
|
|
91
121
|
export interface ListCoinsOptions extends CoreClientMethodOptions {
|
|
@@ -133,8 +163,10 @@ export namespace HaneulClientTypes {
|
|
|
133
163
|
digest: string;
|
|
134
164
|
owner: ObjectOwner;
|
|
135
165
|
type: string;
|
|
166
|
+
/** BCS-encoded Move struct content — pass to generated BCS type parsers. */
|
|
136
167
|
content: Include extends { content: true } ? Uint8Array<ArrayBuffer> : undefined;
|
|
137
168
|
previousTransaction: Include extends { previousTransaction: true } ? string | null : undefined;
|
|
169
|
+
/** Full BCS-encoded object envelope — parse with `bcs.Object` not a struct parser. */
|
|
138
170
|
objectBcs: Include extends { objectBcs: true } ? Uint8Array<ArrayBuffer> : undefined;
|
|
139
171
|
/**
|
|
140
172
|
* The JSON representation of the object's Move struct content.
|
|
@@ -144,6 +176,15 @@ export namespace HaneulClientTypes {
|
|
|
144
176
|
* the `content` field and parse the BCS data directly.
|
|
145
177
|
*/
|
|
146
178
|
json: Include extends { json: true } ? Record<string, unknown> | null : undefined;
|
|
179
|
+
/** Display rendered output. `null` if the type has no Display template. */
|
|
180
|
+
display: Include extends { display: true } ? Display | null : undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface Display {
|
|
184
|
+
/** Successfully rendered display field values, keyed by field name. */
|
|
185
|
+
output: Record<string, string> | null;
|
|
186
|
+
/** Per-field rendering errors, keyed by field name. `null` if all fields succeeded. */
|
|
187
|
+
errors: Record<string, string> | null;
|
|
147
188
|
}
|
|
148
189
|
|
|
149
190
|
export interface Coin {
|
|
@@ -155,27 +196,28 @@ export namespace HaneulClientTypes {
|
|
|
155
196
|
balance: string;
|
|
156
197
|
}
|
|
157
198
|
|
|
199
|
+
export type DynamicFieldEntry = {
|
|
200
|
+
fieldId: string;
|
|
201
|
+
type: string;
|
|
202
|
+
name: DynamicFieldName;
|
|
203
|
+
valueType: string;
|
|
204
|
+
} & ({ $kind: 'DynamicField'; childId?: never } | { $kind: 'DynamicObject'; childId: string });
|
|
205
|
+
|
|
206
|
+
export type DynamicField = DynamicFieldEntry & {
|
|
207
|
+
value: DynamicFieldValue;
|
|
208
|
+
version: string;
|
|
209
|
+
digest: string;
|
|
210
|
+
previousTransaction: string | null;
|
|
211
|
+
};
|
|
212
|
+
|
|
158
213
|
export interface ListDynamicFieldsResponse {
|
|
159
214
|
hasNextPage: boolean;
|
|
160
215
|
cursor: string | null;
|
|
161
|
-
dynamicFields:
|
|
162
|
-
fieldId: string;
|
|
163
|
-
type: string;
|
|
164
|
-
name: DynamicFieldName;
|
|
165
|
-
valueType: string;
|
|
166
|
-
}[];
|
|
216
|
+
dynamicFields: DynamicFieldEntry[];
|
|
167
217
|
}
|
|
168
218
|
|
|
169
219
|
export interface GetDynamicFieldResponse {
|
|
170
|
-
dynamicField:
|
|
171
|
-
name: DynamicFieldName;
|
|
172
|
-
value: DynamicFieldValue;
|
|
173
|
-
fieldId: string;
|
|
174
|
-
version: string;
|
|
175
|
-
digest: string;
|
|
176
|
-
type: string;
|
|
177
|
-
previousTransaction: string | null;
|
|
178
|
-
};
|
|
220
|
+
dynamicField: DynamicField;
|
|
179
221
|
}
|
|
180
222
|
|
|
181
223
|
export interface GetDynamicObjectFieldOptions<
|
|
@@ -183,7 +225,7 @@ export namespace HaneulClientTypes {
|
|
|
183
225
|
> extends CoreClientMethodOptions {
|
|
184
226
|
parentId: string;
|
|
185
227
|
name: DynamicFieldName;
|
|
186
|
-
include?: Include;
|
|
228
|
+
include?: Include & ObjectInclude;
|
|
187
229
|
}
|
|
188
230
|
|
|
189
231
|
export interface GetDynamicObjectFieldResponse<out Include extends ObjectInclude = {}> {
|
|
@@ -311,15 +353,22 @@ export namespace HaneulClientTypes {
|
|
|
311
353
|
};
|
|
312
354
|
|
|
313
355
|
export interface TransactionInclude {
|
|
356
|
+
/** Include balance changes caused by the transaction. */
|
|
314
357
|
balanceChanges?: boolean;
|
|
358
|
+
/** Include parsed transaction effects (gas used, changed objects, status, etc.). */
|
|
315
359
|
effects?: boolean;
|
|
360
|
+
/** Include events emitted by the transaction. */
|
|
316
361
|
events?: boolean;
|
|
362
|
+
/** Include a map of object IDs to their types for all changed objects. */
|
|
317
363
|
objectTypes?: boolean;
|
|
364
|
+
/** Include the parsed transaction data (sender, gas config, inputs, commands). */
|
|
318
365
|
transaction?: boolean;
|
|
366
|
+
/** Include the raw BCS-encoded transaction bytes. */
|
|
319
367
|
bcs?: boolean;
|
|
320
368
|
}
|
|
321
369
|
|
|
322
370
|
export interface SimulateTransactionInclude extends TransactionInclude {
|
|
371
|
+
/** Include return values and mutated references from each command (simulation only). */
|
|
323
372
|
commandResults?: boolean;
|
|
324
373
|
}
|
|
325
374
|
|
|
@@ -344,7 +393,7 @@ export namespace HaneulClientTypes {
|
|
|
344
393
|
Include extends TransactionInclude = {},
|
|
345
394
|
> extends CoreClientMethodOptions {
|
|
346
395
|
digest: string;
|
|
347
|
-
include?: Include;
|
|
396
|
+
include?: Include & TransactionInclude;
|
|
348
397
|
}
|
|
349
398
|
|
|
350
399
|
export type WaitForTransactionOptions<Include extends TransactionInclude = {}> =
|
|
@@ -355,6 +404,8 @@ export namespace HaneulClientTypes {
|
|
|
355
404
|
Include extends TransactionInclude = {},
|
|
356
405
|
> extends GetTransactionOptions<Include> {
|
|
357
406
|
timeout?: number;
|
|
407
|
+
/** Absolute times (ms from start) to poll, e.g. [0, 300, 600, 1500]. After exhausted, repeats the last interval. */
|
|
408
|
+
pollSchedule?: number[];
|
|
358
409
|
result?: never;
|
|
359
410
|
}
|
|
360
411
|
|
|
@@ -362,8 +413,10 @@ export namespace HaneulClientTypes {
|
|
|
362
413
|
Include extends TransactionInclude = {},
|
|
363
414
|
> extends CoreClientMethodOptions {
|
|
364
415
|
result: TransactionResult<any>;
|
|
365
|
-
include?: Include;
|
|
416
|
+
include?: Include & TransactionInclude;
|
|
366
417
|
timeout?: number;
|
|
418
|
+
/** Absolute times (ms from start) to poll, e.g. [0, 300, 600, 1500]. After exhausted, repeats the last interval. */
|
|
419
|
+
pollSchedule?: number[];
|
|
367
420
|
digest?: never;
|
|
368
421
|
}
|
|
369
422
|
|
|
@@ -372,7 +425,7 @@ export namespace HaneulClientTypes {
|
|
|
372
425
|
> extends CoreClientMethodOptions {
|
|
373
426
|
transaction: Uint8Array;
|
|
374
427
|
signatures: string[];
|
|
375
|
-
include?: Include;
|
|
428
|
+
include?: Include & TransactionInclude;
|
|
376
429
|
}
|
|
377
430
|
|
|
378
431
|
export interface SignAndExecuteTransactionOptions<
|
|
@@ -381,14 +434,22 @@ export namespace HaneulClientTypes {
|
|
|
381
434
|
transaction: Uint8Array | TransactionInstance;
|
|
382
435
|
signer: Signer;
|
|
383
436
|
additionalSignatures?: string[];
|
|
384
|
-
include?: Include;
|
|
437
|
+
include?: Include & TransactionInclude;
|
|
385
438
|
}
|
|
386
439
|
|
|
387
440
|
export interface SimulateTransactionOptions<
|
|
388
441
|
Include extends SimulateTransactionInclude = {},
|
|
389
442
|
> extends CoreClientMethodOptions {
|
|
390
443
|
transaction: Uint8Array | TransactionInstance;
|
|
391
|
-
include?: Include;
|
|
444
|
+
include?: Include & SimulateTransactionInclude;
|
|
445
|
+
/**
|
|
446
|
+
* When set to `false`, disables transaction validation checks during simulation.
|
|
447
|
+
* This allows inspecting non-public/non-entry Move functions and other transactions
|
|
448
|
+
* that would normally fail validation.
|
|
449
|
+
*
|
|
450
|
+
* Defaults to `true` (checks enabled).
|
|
451
|
+
*/
|
|
452
|
+
checksEnabled?: boolean;
|
|
392
453
|
}
|
|
393
454
|
|
|
394
455
|
export interface GetReferenceGasPriceOptions extends CoreClientMethodOptions {}
|
|
@@ -415,6 +476,22 @@ export namespace HaneulClientTypes {
|
|
|
415
476
|
systemState: SystemStateInfo;
|
|
416
477
|
}
|
|
417
478
|
|
|
479
|
+
export interface GetProtocolConfigOptions extends CoreClientMethodOptions {}
|
|
480
|
+
|
|
481
|
+
export interface TransportMethods {
|
|
482
|
+
getProtocolConfig?: (options?: GetProtocolConfigOptions) => Promise<GetProtocolConfigResponse>;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export interface GetProtocolConfigResponse {
|
|
486
|
+
protocolConfig: ProtocolConfig;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export interface ProtocolConfig {
|
|
490
|
+
protocolVersion: string;
|
|
491
|
+
featureFlags: Record<string, boolean>;
|
|
492
|
+
attributes: Record<string, string | null>;
|
|
493
|
+
}
|
|
494
|
+
|
|
418
495
|
export interface GetChainIdentifierOptions extends CoreClientMethodOptions {}
|
|
419
496
|
|
|
420
497
|
export interface TransportMethods {
|
|
@@ -814,6 +891,14 @@ export namespace HaneulClientTypes {
|
|
|
814
891
|
sender: string;
|
|
815
892
|
eventType: string;
|
|
816
893
|
bcs: Uint8Array;
|
|
894
|
+
/**
|
|
895
|
+
* The JSON representation of the event's Move struct data.
|
|
896
|
+
*
|
|
897
|
+
* **Warning:** The exact shape and field names of this data may vary between different
|
|
898
|
+
* API implementations (JSON-RPC vs gRPC or GraphQL). For consistent data across APIs use
|
|
899
|
+
* the `bcs` field and parse the BCS data directly.
|
|
900
|
+
*/
|
|
901
|
+
json: Record<string, unknown> | null;
|
|
817
902
|
}
|
|
818
903
|
|
|
819
904
|
export interface MoveAbort {
|
|
@@ -122,7 +122,7 @@ export abstract class Keypair extends Signer {
|
|
|
122
122
|
* 33-byte Bech32 encoded string starting with `haneulprivkey`, and
|
|
123
123
|
* parse out the signature scheme and the private key in bytes.
|
|
124
124
|
*/
|
|
125
|
-
export function
|
|
125
|
+
export function decodeHaneulPrivateKey(value: string): ParsedKeypair {
|
|
126
126
|
const { prefix, words } = bech32.decode(value as `${string}1${string}`);
|
|
127
127
|
if (prefix !== HANEUL_PRIVATE_KEY_PREFIX) {
|
|
128
128
|
throw new Error('invalid private key prefix');
|
|
@@ -143,7 +143,7 @@ export function decodeSuiPrivateKey(value: string): ParsedKeypair {
|
|
|
143
143
|
* encoding 33-byte `flag || bytes` for the given the 32-byte private
|
|
144
144
|
* key and its signature scheme.
|
|
145
145
|
*/
|
|
146
|
-
export function
|
|
146
|
+
export function encodeHaneulPrivateKey(bytes: Uint8Array, scheme: SignatureScheme): string {
|
|
147
147
|
if (bytes.length !== PRIVATE_KEY_SIZE) {
|
|
148
148
|
throw new Error('Invalid bytes length');
|
|
149
149
|
}
|
|
@@ -4,27 +4,27 @@ import { toHex } from '@haneullabs/bcs';
|
|
|
4
4
|
import { mnemonicToSeedSync as bip39MnemonicToSeedSync } from '@scure/bip39';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Parse and validate a path that is compliant to SLIP-0010 in form m/44'/
|
|
7
|
+
* Parse and validate a path that is compliant to SLIP-0010 in form m/44'/8282'/{account_index}'/{change_index}'/{address_index}'.
|
|
8
8
|
*
|
|
9
|
-
* @param path path string (e.g. `m/44'/
|
|
9
|
+
* @param path path string (e.g. `m/44'/8282'/0'/0'/0'`).
|
|
10
10
|
*/
|
|
11
11
|
export function isValidHardenedPath(path: string): boolean {
|
|
12
|
-
if (!new RegExp("^m\\/44'\\/
|
|
12
|
+
if (!new RegExp("^m\\/44'\\/8282'\\/[0-9]+'\\/[0-9]+'\\/[0-9]+'+$").test(path)) {
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Parse and validate a path that is compliant to BIP-32 in form m/54'/
|
|
20
|
-
* for Secp256k1 and m/74'/
|
|
19
|
+
* Parse and validate a path that is compliant to BIP-32 in form m/54'/8282'/{account_index}'/{change_index}/{address_index}
|
|
20
|
+
* for Secp256k1 and m/74'/8282'/{account_index}'/{change_index}/{address_index} for Secp256r1.
|
|
21
21
|
*
|
|
22
22
|
* Note that the purpose for Secp256k1 is registered as 54, to differentiate from Ed25519 with purpose 44.
|
|
23
23
|
*
|
|
24
|
-
* @param path path string (e.g. `m/54'/
|
|
24
|
+
* @param path path string (e.g. `m/54'/8282'/0'/0/0`).
|
|
25
25
|
*/
|
|
26
26
|
export function isValidBIP32Path(path: string): boolean {
|
|
27
|
-
if (!new RegExp("^m\\/(54|74)'\\/
|
|
27
|
+
if (!new RegExp("^m\\/(54|74)'\\/8282'\\/[0-9]+'\\/[0-9]+\\/[0-9]+$").test(path)) {
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
30
|
return true;
|
|
@@ -60,8 +60,8 @@ export abstract class PublicKey {
|
|
|
60
60
|
* base-64. A Haneul public key is formed by the concatenation
|
|
61
61
|
* of the scheme flag with the raw bytes of the public key
|
|
62
62
|
*/
|
|
63
|
-
|
|
64
|
-
const bytes = this.
|
|
63
|
+
toHaneulPublicKey(): string {
|
|
64
|
+
const bytes = this.toHaneulBytes();
|
|
65
65
|
return toBase64(bytes);
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -105,13 +105,13 @@ export abstract class PublicKey {
|
|
|
105
105
|
* Returns the bytes representation of the public key
|
|
106
106
|
* prefixed with the signature scheme flag
|
|
107
107
|
*/
|
|
108
|
-
|
|
108
|
+
toHaneulBytes(): Uint8Array<ArrayBuffer> {
|
|
109
109
|
const rawBytes = this.toRawBytes();
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
const haneulBytes = new Uint8Array(rawBytes.length + 1);
|
|
111
|
+
haneulBytes.set([this.flag()]);
|
|
112
|
+
haneulBytes.set(rawBytes, 1);
|
|
113
113
|
|
|
114
|
-
return
|
|
114
|
+
return haneulBytes;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
/**
|
|
@@ -120,7 +120,7 @@ export abstract class PublicKey {
|
|
|
120
120
|
toHaneulAddress(): string {
|
|
121
121
|
// Each hex char represents half a byte, hence hex address doubles the length
|
|
122
122
|
return normalizeHaneulAddress(
|
|
123
|
-
bytesToHex(blake2b(this.
|
|
123
|
+
bytesToHex(blake2b(this.toHaneulBytes(), { dkLen: 32 })).slice(0, HANEUL_ADDRESS_LENGTH * 2),
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
|
package/src/faucet/faucet.ts
CHANGED
|
@@ -55,7 +55,7 @@ async function faucetRequest<T>({ host, path, body, headers, method }: FaucetReq
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export async function
|
|
58
|
+
export async function requestHaneulFromFaucetV2(input: {
|
|
59
59
|
host: string;
|
|
60
60
|
recipient: string;
|
|
61
61
|
headers?: HeadersInit;
|
package/src/faucet/index.ts
CHANGED
package/src/graphql/client.ts
CHANGED
|
@@ -9,6 +9,10 @@ import { BaseClient } from '../client/index.js';
|
|
|
9
9
|
import type { HaneulClientTypes } from '../client/index.js';
|
|
10
10
|
import { GraphQLCoreClient } from './core.js';
|
|
11
11
|
import type { TypedDocumentString } from './generated/queries.js';
|
|
12
|
+
import { GetDynamicFieldsDocument } from './generated/queries.js';
|
|
13
|
+
import { fromBase64 } from '@haneullabs/utils';
|
|
14
|
+
import { normalizeStructTag } from '../utils/haneul-types.js';
|
|
15
|
+
import { deriveDynamicFieldID } from '../utils/dynamic-fields.js';
|
|
12
16
|
import type { TransactionPlugin } from '../transactions/index.js';
|
|
13
17
|
|
|
14
18
|
export type GraphQLDocument<
|
|
@@ -58,14 +62,29 @@ export interface HaneulGraphQLClientOptions<Queries extends Record<string, Graph
|
|
|
58
62
|
|
|
59
63
|
export class HaneulGraphQLRequestError extends Error {}
|
|
60
64
|
|
|
61
|
-
const
|
|
65
|
+
const HANEUL_CLIENT_BRAND = Symbol.for('@haneullabs/HaneulGraphQLClient') as never;
|
|
62
66
|
|
|
63
|
-
export function
|
|
67
|
+
export function isHaneulGraphQLClient(client: unknown): client is HaneulGraphQLClient {
|
|
64
68
|
return (
|
|
65
|
-
typeof client === 'object' && client !== null && (client as any)[
|
|
69
|
+
typeof client === 'object' && client !== null && (client as any)[HANEUL_CLIENT_BRAND] === true
|
|
66
70
|
);
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
export interface DynamicFieldInclude {
|
|
74
|
+
value?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> =
|
|
78
|
+
HaneulClientTypes.DynamicFieldEntry & {
|
|
79
|
+
value: Include extends { value: true } ? HaneulClientTypes.DynamicFieldValue : undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {
|
|
83
|
+
hasNextPage: boolean;
|
|
84
|
+
cursor: string | null;
|
|
85
|
+
dynamicFields: DynamicFieldEntryWithValue<Include>[];
|
|
86
|
+
}
|
|
87
|
+
|
|
69
88
|
export class HaneulGraphQLClient<Queries extends Record<string, GraphQLDocument> = {}>
|
|
70
89
|
extends BaseClient
|
|
71
90
|
implements HaneulClientTypes.TransportMethods
|
|
@@ -79,7 +98,7 @@ export class HaneulGraphQLClient<Queries extends Record<string, GraphQLDocument>
|
|
|
79
98
|
return this.core.mvr;
|
|
80
99
|
}
|
|
81
100
|
|
|
82
|
-
get [
|
|
101
|
+
get [HANEUL_CLIENT_BRAND]() {
|
|
83
102
|
return true;
|
|
84
103
|
}
|
|
85
104
|
|
|
@@ -220,10 +239,83 @@ export class HaneulGraphQLClient<Queries extends Record<string, GraphQLDocument>
|
|
|
220
239
|
return this.core.getReferenceGasPrice();
|
|
221
240
|
}
|
|
222
241
|
|
|
223
|
-
listDynamicFields(
|
|
224
|
-
input: HaneulClientTypes.ListDynamicFieldsOptions,
|
|
225
|
-
): Promise<
|
|
226
|
-
|
|
242
|
+
async listDynamicFields<Include extends DynamicFieldInclude = {}>(
|
|
243
|
+
input: HaneulClientTypes.ListDynamicFieldsOptions & { include?: Include & DynamicFieldInclude },
|
|
244
|
+
): Promise<ListDynamicFieldsWithValueResponse<Include>> {
|
|
245
|
+
const includeValue = input.include?.value ?? false;
|
|
246
|
+
|
|
247
|
+
const { data, errors } = await this.query({
|
|
248
|
+
query: GetDynamicFieldsDocument,
|
|
249
|
+
variables: {
|
|
250
|
+
parentId: input.parentId,
|
|
251
|
+
first: input.limit,
|
|
252
|
+
cursor: input.cursor,
|
|
253
|
+
includeValue,
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
if (errors?.length) {
|
|
258
|
+
throw errors.length === 1
|
|
259
|
+
? new Error(errors[0].message)
|
|
260
|
+
: new AggregateError(errors.map((e) => new Error(e.message)));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const result = data?.address?.dynamicFields;
|
|
264
|
+
if (!result) {
|
|
265
|
+
throw new Error('Missing response data');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
dynamicFields: result.nodes.map((dynamicField): DynamicFieldEntryWithValue<Include> => {
|
|
270
|
+
const valueType =
|
|
271
|
+
dynamicField.value?.__typename === 'MoveObject'
|
|
272
|
+
? dynamicField.value.contents?.type?.repr!
|
|
273
|
+
: dynamicField.value?.type?.repr!;
|
|
274
|
+
const isDynamicObject = dynamicField.value?.__typename === 'MoveObject';
|
|
275
|
+
const derivedNameType = isDynamicObject
|
|
276
|
+
? `0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>`
|
|
277
|
+
: dynamicField.name?.type?.repr!;
|
|
278
|
+
|
|
279
|
+
let value: HaneulClientTypes.DynamicFieldValue | undefined;
|
|
280
|
+
if (includeValue) {
|
|
281
|
+
let valueBcs: Uint8Array;
|
|
282
|
+
if (dynamicField.value?.__typename === 'MoveValue') {
|
|
283
|
+
valueBcs = fromBase64(dynamicField.value.bcs ?? '');
|
|
284
|
+
} else if (dynamicField.value?.__typename === 'MoveObject') {
|
|
285
|
+
valueBcs = fromBase64(dynamicField.value.contents?.bcs ?? '');
|
|
286
|
+
} else {
|
|
287
|
+
valueBcs = new Uint8Array();
|
|
288
|
+
}
|
|
289
|
+
value = { type: valueType, bcs: valueBcs };
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return {
|
|
293
|
+
$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',
|
|
294
|
+
fieldId: deriveDynamicFieldID(
|
|
295
|
+
input.parentId,
|
|
296
|
+
derivedNameType,
|
|
297
|
+
fromBase64(dynamicField.name?.bcs!),
|
|
298
|
+
),
|
|
299
|
+
type: normalizeStructTag(
|
|
300
|
+
isDynamicObject
|
|
301
|
+
? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>,0x2::object::ID>`
|
|
302
|
+
: `0x2::dynamic_field::Field<${dynamicField.name?.type?.repr},${valueType}>`,
|
|
303
|
+
),
|
|
304
|
+
name: {
|
|
305
|
+
type: dynamicField.name?.type?.repr!,
|
|
306
|
+
bcs: fromBase64(dynamicField.name?.bcs!),
|
|
307
|
+
},
|
|
308
|
+
valueType,
|
|
309
|
+
childId:
|
|
310
|
+
isDynamicObject && dynamicField.value?.__typename === 'MoveObject'
|
|
311
|
+
? dynamicField.value.address
|
|
312
|
+
: undefined,
|
|
313
|
+
value: (includeValue ? value : undefined) as DynamicFieldEntryWithValue<Include>['value'],
|
|
314
|
+
} as DynamicFieldEntryWithValue<Include>;
|
|
315
|
+
}),
|
|
316
|
+
cursor: result.pageInfo.endCursor ?? null,
|
|
317
|
+
hasNextPage: result.pageInfo.hasNextPage,
|
|
318
|
+
};
|
|
227
319
|
}
|
|
228
320
|
|
|
229
321
|
getDynamicField(
|