@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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Mysten Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import { toHex } from '@haneullabs/bcs';
|
|
4
5
|
import { ed25519 } from '@noble/curves/ed25519.js';
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
decodeHaneulPrivateKey,
|
|
9
|
+
encodeHaneulPrivateKey,
|
|
9
10
|
Keypair,
|
|
10
11
|
PRIVATE_KEY_SIZE,
|
|
11
12
|
} from '../../cryptography/keypair.js';
|
|
@@ -14,7 +15,7 @@ import type { SignatureScheme } from '../../cryptography/signature-scheme.js';
|
|
|
14
15
|
import { derivePath } from './ed25519-hd-key.js';
|
|
15
16
|
import { Ed25519PublicKey } from './publickey.js';
|
|
16
17
|
|
|
17
|
-
export const DEFAULT_ED25519_DERIVATION_PATH = "m/44'/
|
|
18
|
+
export const DEFAULT_ED25519_DERIVATION_PATH = "m/44'/8282'/0'/0'/0'";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Ed25519 Keypair data. The publickey is the 32-byte public key and
|
|
@@ -87,7 +88,7 @@ export class Ed25519Keypair extends Keypair {
|
|
|
87
88
|
options?: { skipValidation?: boolean },
|
|
88
89
|
): Ed25519Keypair {
|
|
89
90
|
if (typeof secretKey === 'string') {
|
|
90
|
-
const decoded =
|
|
91
|
+
const decoded = decodeHaneulPrivateKey(secretKey);
|
|
91
92
|
|
|
92
93
|
if (decoded.scheme !== 'ED25519') {
|
|
93
94
|
throw new Error(`Expected a ED25519 keypair, got ${decoded.scheme}`);
|
|
@@ -129,7 +130,7 @@ export class Ed25519Keypair extends Keypair {
|
|
|
129
130
|
* The Bech32 secret key string for this Ed25519 keypair
|
|
130
131
|
*/
|
|
131
132
|
getSecretKey(): string {
|
|
132
|
-
return
|
|
133
|
+
return encodeHaneulPrivateKey(
|
|
133
134
|
this.keypair.secretKey.slice(0, PRIVATE_KEY_SIZE),
|
|
134
135
|
this.getKeyScheme(),
|
|
135
136
|
);
|
|
@@ -146,8 +147,8 @@ export class Ed25519Keypair extends Keypair {
|
|
|
146
147
|
* Derive Ed25519 keypair from mnemonics and path. The mnemonics must be normalized
|
|
147
148
|
* and validated against the english wordlist.
|
|
148
149
|
*
|
|
149
|
-
* If path is none, it will default to m/44'/
|
|
150
|
-
* be compliant to SLIP-0010 in form m/44'/
|
|
150
|
+
* If path is none, it will default to m/44'/8282'/0'/0'/0', otherwise the path must
|
|
151
|
+
* be compliant to SLIP-0010 in form m/44'/8282'/{account_index}'/{change_index}'/{address_index}'.
|
|
151
152
|
*/
|
|
152
153
|
static deriveKeypair(mnemonics: string, path?: string): Ed25519Keypair {
|
|
153
154
|
if (path == null) {
|
|
@@ -164,16 +165,19 @@ export class Ed25519Keypair extends Keypair {
|
|
|
164
165
|
/**
|
|
165
166
|
* Derive Ed25519 keypair from mnemonicSeed and path.
|
|
166
167
|
*
|
|
167
|
-
* If path is none, it will default to m/44'/
|
|
168
|
-
* be compliant to SLIP-0010 in form m/44'/
|
|
168
|
+
* If path is none, it will default to m/44'/8282'/0'/0'/0', otherwise the path must
|
|
169
|
+
* be compliant to SLIP-0010 in form m/44'/8282'/{account_index}'/{change_index}'/{address_index}'.
|
|
170
|
+
*
|
|
171
|
+
* @param seed - The seed as a hex string or Uint8Array.
|
|
169
172
|
*/
|
|
170
|
-
static deriveKeypairFromSeed(
|
|
173
|
+
static deriveKeypairFromSeed(seed: string | Uint8Array, path?: string): Ed25519Keypair {
|
|
171
174
|
if (path == null) {
|
|
172
175
|
path = DEFAULT_ED25519_DERIVATION_PATH;
|
|
173
176
|
}
|
|
174
177
|
if (!isValidHardenedPath(path)) {
|
|
175
178
|
throw new Error('Invalid derivation path');
|
|
176
179
|
}
|
|
180
|
+
const seedHex = typeof seed === 'string' ? seed : toHex(seed);
|
|
177
181
|
const { key } = derivePath(path, seedHex);
|
|
178
182
|
|
|
179
183
|
return Ed25519Keypair.fromSecretKey(key);
|
|
@@ -39,7 +39,7 @@ export type BrowserPasswordProviderOptions = Pick<
|
|
|
39
39
|
|
|
40
40
|
export interface PasskeyProvider {
|
|
41
41
|
create(): Promise<RegistrationCredential>;
|
|
42
|
-
get(challenge: Uint8Array): Promise<AuthenticationCredential>;
|
|
42
|
+
get(challenge: Uint8Array, credentialId?: Uint8Array): Promise<AuthenticationCredential>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Default browser implementation
|
|
@@ -80,12 +80,15 @@ export class BrowserPasskeyProvider implements PasskeyProvider {
|
|
|
80
80
|
})) as RegistrationCredential;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
async get(challenge: Uint8Array): Promise<AuthenticationCredential> {
|
|
83
|
+
async get(challenge: Uint8Array, credentialId?: Uint8Array): Promise<AuthenticationCredential> {
|
|
84
84
|
return (await navigator.credentials.get({
|
|
85
85
|
publicKey: {
|
|
86
86
|
challenge: challenge as BufferSource,
|
|
87
87
|
userVerification: this.#options.authenticatorSelection?.userVerification || 'required',
|
|
88
88
|
timeout: this.#options.timeout ?? 60000,
|
|
89
|
+
...(credentialId && {
|
|
90
|
+
allowCredentials: [{ type: 'public-key' as const, id: credentialId as BufferSource }],
|
|
91
|
+
}),
|
|
89
92
|
},
|
|
90
93
|
})) as AuthenticationCredential;
|
|
91
94
|
}
|
|
@@ -93,11 +96,12 @@ export class BrowserPasskeyProvider implements PasskeyProvider {
|
|
|
93
96
|
|
|
94
97
|
/**
|
|
95
98
|
* @experimental
|
|
96
|
-
* A passkey signer used for signing transactions. This is a client side implementation for [SIP-9](https://github.
|
|
99
|
+
* A passkey signer used for signing transactions. This is a client side implementation for [SIP-9](https://github.com/haneul-foundation/sips/blob/main/sips/sip-9.md).
|
|
97
100
|
*/
|
|
98
101
|
export class PasskeyKeypair extends Signer {
|
|
99
102
|
private publicKey: Uint8Array;
|
|
100
103
|
private provider: PasskeyProvider;
|
|
104
|
+
private credentialId?: Uint8Array;
|
|
101
105
|
|
|
102
106
|
/**
|
|
103
107
|
* Get the key scheme of passkey,
|
|
@@ -120,10 +124,20 @@ export class PasskeyKeypair extends Signer {
|
|
|
120
124
|
* If there are existing passkey wallet, use `signAndRecover` to identify the correct
|
|
121
125
|
* public key and then initialize the instance. See usage in `signAndRecover`.
|
|
122
126
|
*/
|
|
123
|
-
constructor(publicKey: Uint8Array, provider: PasskeyProvider) {
|
|
127
|
+
constructor(publicKey: Uint8Array, provider: PasskeyProvider, credentialId?: Uint8Array) {
|
|
124
128
|
super();
|
|
125
129
|
this.publicKey = publicKey;
|
|
126
130
|
this.provider = provider;
|
|
131
|
+
this.credentialId = credentialId;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Return the credential ID for this passkey, if available.
|
|
136
|
+
* The credential ID is captured when creating a new passkey via `getPasskeyInstance`
|
|
137
|
+
* and can be used to constrain which credential the browser selects during signing.
|
|
138
|
+
*/
|
|
139
|
+
getCredentialId(): Uint8Array | undefined {
|
|
140
|
+
return this.credentialId;
|
|
127
141
|
}
|
|
128
142
|
|
|
129
143
|
/**
|
|
@@ -145,7 +159,7 @@ export class PasskeyKeypair extends Signer {
|
|
|
145
159
|
const pubkeyUncompressed = parseDerSPKI(new Uint8Array(derSPKI));
|
|
146
160
|
const pubkey = secp256r1.Point.fromBytes(pubkeyUncompressed);
|
|
147
161
|
const pubkeyCompressed = pubkey.toBytes(true);
|
|
148
|
-
return new PasskeyKeypair(pubkeyCompressed, provider);
|
|
162
|
+
return new PasskeyKeypair(pubkeyCompressed, provider, new Uint8Array(credential.rawId));
|
|
149
163
|
}
|
|
150
164
|
}
|
|
151
165
|
|
|
@@ -162,7 +176,7 @@ export class PasskeyKeypair extends Signer {
|
|
|
162
176
|
*/
|
|
163
177
|
async sign(data: Uint8Array) {
|
|
164
178
|
// asks the passkey to sign over challenge as the data.
|
|
165
|
-
const credential = await this.provider.get(data);
|
|
179
|
+
const credential = await this.provider.get(data, this.credentialId);
|
|
166
180
|
|
|
167
181
|
// parse authenticatorData (as bytes), clientDataJSON (decoded as string).
|
|
168
182
|
const authenticatorData = new Uint8Array(credential.response.authenticatorData);
|
|
@@ -190,7 +204,7 @@ export class PasskeyKeypair extends Signer {
|
|
|
190
204
|
arr.set(normalized, 1);
|
|
191
205
|
arr.set(this.publicKey, 1 + normalized.length);
|
|
192
206
|
|
|
193
|
-
// serialize all fields into a passkey signature according to https://github.
|
|
207
|
+
// serialize all fields into a passkey signature according to https://github.com/haneul-foundation/sips/blob/main/sips/sip-9.md#signature-encoding
|
|
194
208
|
return PasskeyAuthenticator.serialize({
|
|
195
209
|
authenticatorData: authenticatorData,
|
|
196
210
|
clientDataJson: clientDataJSONString,
|
|
@@ -245,7 +259,7 @@ export class PasskeyKeypair extends Signer {
|
|
|
245
259
|
* const testMessage2 = new TextEncoder().encode('Hello world 2!');
|
|
246
260
|
* const possiblePks2 = await PasskeyKeypair.signAndRecover(provider, testMessage2);
|
|
247
261
|
* const commonPk = findCommonPublicKey(possiblePks, possiblePks2);
|
|
248
|
-
* const signer = new PasskeyKeypair(
|
|
262
|
+
* const signer = new PasskeyKeypair(commonPk.toRawBytes(), provider);
|
|
249
263
|
* ```
|
|
250
264
|
*
|
|
251
265
|
* @param provider - the passkey provider.
|
|
@@ -5,13 +5,13 @@ import { secp256k1 } from '@noble/curves/secp256k1.js';
|
|
|
5
5
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
6
6
|
import { HDKey } from '@scure/bip32';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { decodeHaneulPrivateKey, encodeHaneulPrivateKey, Keypair } from '../../cryptography/keypair.js';
|
|
9
9
|
import { isValidBIP32Path, mnemonicToSeed } from '../../cryptography/mnemonics.js';
|
|
10
10
|
import type { PublicKey } from '../../cryptography/publickey.js';
|
|
11
11
|
import type { SignatureScheme } from '../../cryptography/signature-scheme.js';
|
|
12
12
|
import { Secp256k1PublicKey } from './publickey.js';
|
|
13
13
|
|
|
14
|
-
export const DEFAULT_SECP256K1_DERIVATION_PATH = "m/54'/
|
|
14
|
+
export const DEFAULT_SECP256K1_DERIVATION_PATH = "m/54'/8282'/0'/0/0";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Secp256k1 Keypair data
|
|
@@ -77,7 +77,7 @@ export class Secp256k1Keypair extends Keypair {
|
|
|
77
77
|
options?: { skipValidation?: boolean },
|
|
78
78
|
): Secp256k1Keypair {
|
|
79
79
|
if (typeof secretKey === 'string') {
|
|
80
|
-
const decoded =
|
|
80
|
+
const decoded = decodeHaneulPrivateKey(secretKey);
|
|
81
81
|
|
|
82
82
|
if (decoded.scheme !== 'Secp256k1') {
|
|
83
83
|
throw new Error(`Expected a Secp256k1 keypair, got ${decoded.scheme}`);
|
|
@@ -120,7 +120,7 @@ export class Secp256k1Keypair extends Keypair {
|
|
|
120
120
|
* The Bech32 secret key string for this Secp256k1 keypair
|
|
121
121
|
*/
|
|
122
122
|
getSecretKey(): string {
|
|
123
|
-
return
|
|
123
|
+
return encodeHaneulPrivateKey(this.keypair.secretKey, this.getKeyScheme());
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -136,8 +136,8 @@ export class Secp256k1Keypair extends Keypair {
|
|
|
136
136
|
* Derive Secp256k1 keypair from mnemonics and path. The mnemonics must be normalized
|
|
137
137
|
* and validated against the english wordlist.
|
|
138
138
|
*
|
|
139
|
-
* If path is none, it will default to m/54'/
|
|
140
|
-
* be compliant to BIP-32 in form m/54'/
|
|
139
|
+
* If path is none, it will default to m/54'/8282'/0'/0/0, otherwise the path must
|
|
140
|
+
* be compliant to BIP-32 in form m/54'/8282'/{account_index}'/{change_index}/{address_index}.
|
|
141
141
|
*/
|
|
142
142
|
static deriveKeypair(mnemonics: string, path?: string): Secp256k1Keypair {
|
|
143
143
|
if (path == null) {
|
|
@@ -5,13 +5,13 @@ import { p256 as secp256r1 } from '@noble/curves/nist.js';
|
|
|
5
5
|
import { blake2b } from '@noble/hashes/blake2.js';
|
|
6
6
|
import { HDKey } from '@scure/bip32';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { decodeHaneulPrivateKey, encodeHaneulPrivateKey, Keypair } from '../../cryptography/keypair.js';
|
|
9
9
|
import { isValidBIP32Path, mnemonicToSeed } from '../../cryptography/mnemonics.js';
|
|
10
10
|
import type { PublicKey } from '../../cryptography/publickey.js';
|
|
11
11
|
import type { SignatureScheme } from '../../cryptography/signature-scheme.js';
|
|
12
12
|
import { Secp256r1PublicKey } from './publickey.js';
|
|
13
13
|
|
|
14
|
-
export const DEFAULT_SECP256R1_DERIVATION_PATH = "m/74'/
|
|
14
|
+
export const DEFAULT_SECP256R1_DERIVATION_PATH = "m/74'/8282'/0'/0/0";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Secp256r1 Keypair data
|
|
@@ -77,7 +77,7 @@ export class Secp256r1Keypair extends Keypair {
|
|
|
77
77
|
options?: { skipValidation?: boolean },
|
|
78
78
|
): Secp256r1Keypair {
|
|
79
79
|
if (typeof secretKey === 'string') {
|
|
80
|
-
const decoded =
|
|
80
|
+
const decoded = decodeHaneulPrivateKey(secretKey);
|
|
81
81
|
|
|
82
82
|
if (decoded.scheme !== 'Secp256r1') {
|
|
83
83
|
throw new Error(`Expected a Secp256r1 keypair, got ${decoded.scheme}`);
|
|
@@ -121,7 +121,7 @@ export class Secp256r1Keypair extends Keypair {
|
|
|
121
121
|
* The Bech32 secret key string for this Secp256r1 keypair
|
|
122
122
|
*/
|
|
123
123
|
getSecretKey(): string {
|
|
124
|
-
return
|
|
124
|
+
return encodeHaneulPrivateKey(this.keypair.secretKey, this.getKeyScheme());
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
/**
|
|
@@ -137,8 +137,8 @@ export class Secp256r1Keypair extends Keypair {
|
|
|
137
137
|
* Derive Secp256r1 keypair from mnemonics and path. The mnemonics must be normalized
|
|
138
138
|
* and validated against the english wordlist.
|
|
139
139
|
*
|
|
140
|
-
* If path is none, it will default to m/74'/
|
|
141
|
-
* be compliant to BIP-32 in form m/74'/
|
|
140
|
+
* If path is none, it will default to m/74'/8282'/0'/0/0, otherwise the path must
|
|
141
|
+
* be compliant to BIP-32 in form m/74'/8282'/{account_index}'/{change_index}/{address_index}.
|
|
142
142
|
*/
|
|
143
143
|
static deriveKeypair(mnemonics: string, path?: string): Secp256r1Keypair {
|
|
144
144
|
if (path == null) {
|
|
@@ -197,7 +197,7 @@ export class MultiSigPublicKey extends PublicKey {
|
|
|
197
197
|
// The initial value 3 ensures that following data will be after the flag byte and threshold bytes
|
|
198
198
|
let i = 3;
|
|
199
199
|
for (const { publicKey, weight } of this.publicKeys) {
|
|
200
|
-
const bytes = publicKey.
|
|
200
|
+
const bytes = publicKey.toHaneulBytes();
|
|
201
201
|
tmp.set(bytes, i);
|
|
202
202
|
i += bytes.length;
|
|
203
203
|
tmp.set([weight], i++);
|
|
@@ -17,7 +17,7 @@ export type TransactionArgument =
|
|
|
17
17
|
export type TransactionInput = CallArg;
|
|
18
18
|
|
|
19
19
|
// Keep in sync with constants in
|
|
20
|
-
//
|
|
20
|
+
// crates/haneul-framework/packages/haneul-framework/sources/package.move
|
|
21
21
|
export enum UpgradePolicy {
|
|
22
22
|
COMPATIBLE = 0,
|
|
23
23
|
ADDITIVE = 128,
|
|
@@ -31,7 +31,12 @@ import { createPure } from './pure.js';
|
|
|
31
31
|
import { TransactionDataBuilder } from './TransactionData.js';
|
|
32
32
|
import { getIdFromCallArg } from './utils.js';
|
|
33
33
|
import { namedPackagesPlugin } from './plugins/NamedPackagesPlugin.js';
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
COIN_WITH_BALANCE,
|
|
36
|
+
resolveCoinBalance,
|
|
37
|
+
coinWithBalance,
|
|
38
|
+
createBalance,
|
|
39
|
+
} from './intents/CoinWithBalance.js';
|
|
35
40
|
import type { ClientWithCoreApi } from '../client/core.js';
|
|
36
41
|
|
|
37
42
|
export type TransactionObjectArgument =
|
|
@@ -307,6 +312,38 @@ export class Transaction {
|
|
|
307
312
|
return { $kind: 'GasCoin' as const, GasCoin: true as const };
|
|
308
313
|
}
|
|
309
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Creates a coin of the specified type and balance.
|
|
317
|
+
* Sourced from address balance when available, falling back to owned coins.
|
|
318
|
+
*/
|
|
319
|
+
coin({
|
|
320
|
+
type,
|
|
321
|
+
balance,
|
|
322
|
+
useGasCoin,
|
|
323
|
+
}: {
|
|
324
|
+
balance: bigint | number;
|
|
325
|
+
type?: string;
|
|
326
|
+
useGasCoin?: boolean;
|
|
327
|
+
}): TransactionResult {
|
|
328
|
+
return this.add(coinWithBalance({ type, balance, useGasCoin }));
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Creates a Balance object of the specified type and balance.
|
|
333
|
+
* Sourced from address balance when available, falling back to owned coins.
|
|
334
|
+
*/
|
|
335
|
+
balance({
|
|
336
|
+
type,
|
|
337
|
+
balance,
|
|
338
|
+
useGasCoin,
|
|
339
|
+
}: {
|
|
340
|
+
balance: bigint | number;
|
|
341
|
+
type?: string;
|
|
342
|
+
useGasCoin?: boolean;
|
|
343
|
+
}): TransactionResult {
|
|
344
|
+
return this.add(createBalance({ type, balance, useGasCoin }));
|
|
345
|
+
}
|
|
346
|
+
|
|
310
347
|
/**
|
|
311
348
|
* Add a new object input to the transaction.
|
|
312
349
|
*/
|
|
@@ -22,7 +22,7 @@ import type { SerializedTransactionDataV2Schema } from './data/v2.js';
|
|
|
22
22
|
import { hashTypedData } from './hash.js';
|
|
23
23
|
import { getIdFromCallArg, remapCommandArguments } from './utils.js';
|
|
24
24
|
import type { TransactionResult } from './Transaction.js';
|
|
25
|
-
function
|
|
25
|
+
function prepareHaneulAddress(address: string) {
|
|
26
26
|
return normalizeHaneulAddress(address).replace('0x', '');
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -164,11 +164,11 @@ export class TransactionDataBuilder implements TransactionData {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
const transactionData = {
|
|
167
|
-
sender:
|
|
167
|
+
sender: prepareHaneulAddress(sender),
|
|
168
168
|
expiration: expiration ? expiration : { None: true },
|
|
169
169
|
gasData: {
|
|
170
170
|
payment: gasData.payment,
|
|
171
|
-
owner:
|
|
171
|
+
owner: prepareHaneulAddress(this.gasData.owner ?? sender),
|
|
172
172
|
price: BigInt(gasData.price),
|
|
173
173
|
budget: BigInt(gasData.budget),
|
|
174
174
|
},
|
|
@@ -124,7 +124,7 @@ it('can serialize transaction data with a programmable transaction', () => {
|
|
|
124
124
|
package: haneul,
|
|
125
125
|
module: 'display',
|
|
126
126
|
function: 'new',
|
|
127
|
-
typeArguments: [
|
|
127
|
+
typeArguments: [`${haneul}::capy::Capy`],
|
|
128
128
|
arguments: [
|
|
129
129
|
// publisher object
|
|
130
130
|
{
|
|
@@ -140,7 +140,7 @@ it('can serialize transaction data with a programmable transaction', () => {
|
|
|
140
140
|
package: haneul,
|
|
141
141
|
module: 'display',
|
|
142
142
|
function: 'add_multiple',
|
|
143
|
-
typeArguments: [
|
|
143
|
+
typeArguments: [`${haneul}::capy::Capy`],
|
|
144
144
|
arguments: [
|
|
145
145
|
// result of the first transaction
|
|
146
146
|
{
|
|
@@ -166,7 +166,7 @@ it('can serialize transaction data with a programmable transaction', () => {
|
|
|
166
166
|
package: haneul,
|
|
167
167
|
module: 'display',
|
|
168
168
|
function: 'update_version',
|
|
169
|
-
typeArguments: [
|
|
169
|
+
typeArguments: [`${haneul}::capy::Capy`],
|
|
170
170
|
arguments: [
|
|
171
171
|
// result of the first transaction again
|
|
172
172
|
{
|
|
@@ -101,7 +101,7 @@ export const U32 = pipe(
|
|
|
101
101
|
check((val) => val >= 0 && val < 2 ** 32, 'Invalid u32'),
|
|
102
102
|
);
|
|
103
103
|
|
|
104
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
104
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/base_types.rs#L138
|
|
105
105
|
// Implemented as a tuple in rust
|
|
106
106
|
export const ObjectRefSchema = object({
|
|
107
107
|
objectId: HaneulAddress,
|
|
@@ -110,7 +110,7 @@ export const ObjectRefSchema = object({
|
|
|
110
110
|
});
|
|
111
111
|
export type ObjectRef = InferOutput<typeof ObjectRefSchema>;
|
|
112
112
|
|
|
113
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
113
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L690-L702
|
|
114
114
|
export const ArgumentSchema = union([
|
|
115
115
|
withKind('GasCoin', object({ GasCoin: literal(true) })),
|
|
116
116
|
withKind(
|
|
@@ -129,7 +129,7 @@ export const ArgumentSchema = union([
|
|
|
129
129
|
|
|
130
130
|
export type Argument = InferOutput<typeof ArgumentSchema>;
|
|
131
131
|
|
|
132
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
132
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L1387-L1392
|
|
133
133
|
export const GasDataSchema = object({
|
|
134
134
|
budget: nullable(JsonU64),
|
|
135
135
|
price: nullable(JsonU64),
|
|
@@ -174,7 +174,7 @@ export const OpenSignatureSchema = object({
|
|
|
174
174
|
body: OpenSignatureBodySchema,
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
177
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L707-L718
|
|
178
178
|
const ProgrammableMoveCallSchema = object({
|
|
179
179
|
package: ObjectID,
|
|
180
180
|
module: string(),
|
|
@@ -192,7 +192,7 @@ export const $Intent = object({
|
|
|
192
192
|
data: record(string(), unknown()),
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
195
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L657-L685
|
|
196
196
|
export const CommandSchema = safeEnum({
|
|
197
197
|
MoveCall: ProgrammableMoveCallSchema,
|
|
198
198
|
TransferObjects: object({
|
|
@@ -266,7 +266,7 @@ export type Command<Arg = Argument> = EnumOutputShape<{
|
|
|
266
266
|
};
|
|
267
267
|
}>;
|
|
268
268
|
|
|
269
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
269
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L102-L114
|
|
270
270
|
export const ObjectArgSchema = safeEnum({
|
|
271
271
|
ImmOrOwnedObject: ObjectRefSchema,
|
|
272
272
|
SharedObject: object({
|
|
@@ -278,26 +278,26 @@ export const ObjectArgSchema = safeEnum({
|
|
|
278
278
|
Receiving: ObjectRefSchema,
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
// Rust:
|
|
281
|
+
// Rust: crates/haneul-types/src/transaction.rs
|
|
282
282
|
export const ReservationSchema = safeEnum({
|
|
283
283
|
MaxAmountU64: JsonU64,
|
|
284
284
|
});
|
|
285
285
|
export type Reservation = InferOutput<typeof ReservationSchema>;
|
|
286
286
|
|
|
287
|
-
// Rust:
|
|
287
|
+
// Rust: crates/haneul-types/src/transaction.rs
|
|
288
288
|
export const WithdrawalTypeArgSchema = safeEnum({
|
|
289
289
|
Balance: string(),
|
|
290
290
|
});
|
|
291
291
|
export type WithdrawalTypeArg = InferOutput<typeof WithdrawalTypeArgSchema>;
|
|
292
292
|
|
|
293
|
-
// Rust:
|
|
293
|
+
// Rust: crates/haneul-types/src/transaction.rs
|
|
294
294
|
export const WithdrawFromSchema = safeEnum({
|
|
295
295
|
Sender: literal(true),
|
|
296
296
|
Sponsor: literal(true),
|
|
297
297
|
});
|
|
298
298
|
export type WithdrawFrom = InferOutput<typeof WithdrawFromSchema>;
|
|
299
299
|
|
|
300
|
-
// Rust:
|
|
300
|
+
// Rust: crates/haneul-types/src/transaction.rs
|
|
301
301
|
export const FundsWithdrawalArgSchema = object({
|
|
302
302
|
reservation: ReservationSchema,
|
|
303
303
|
typeArg: WithdrawalTypeArgSchema,
|
|
@@ -305,7 +305,7 @@ export const FundsWithdrawalArgSchema = object({
|
|
|
305
305
|
});
|
|
306
306
|
export type FundsWithdrawalArg = InferOutput<typeof FundsWithdrawalArgSchema>;
|
|
307
307
|
|
|
308
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
308
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L75-L80
|
|
309
309
|
const CallArgSchema = safeEnum({
|
|
310
310
|
Object: ObjectArgSchema,
|
|
311
311
|
Pure: object({
|
|
@@ -332,7 +332,7 @@ export const NormalizedCallArg = safeEnum({
|
|
|
332
332
|
}),
|
|
333
333
|
});
|
|
334
334
|
|
|
335
|
-
// Rust:
|
|
335
|
+
// Rust: crates/haneul-types/src/transaction.rs
|
|
336
336
|
export const ValidDuringSchema = object({
|
|
337
337
|
minEpoch: nullable(JsonU64),
|
|
338
338
|
maxEpoch: nullable(JsonU64),
|
|
@@ -44,7 +44,7 @@ function enumUnion<T extends Record<string, GenericSchema<any>>>(options: T) {
|
|
|
44
44
|
>;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
47
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L690-L702
|
|
48
48
|
const Argument = enumUnion({
|
|
49
49
|
GasCoin: literal(true),
|
|
50
50
|
Input: pipe(number(), integer()),
|
|
@@ -52,7 +52,7 @@ const Argument = enumUnion({
|
|
|
52
52
|
NestedResult: tuple([pipe(number(), integer()), pipe(number(), integer())]),
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
55
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L1387-L1392
|
|
56
56
|
const GasData = object({
|
|
57
57
|
budget: nullable(JsonU64),
|
|
58
58
|
price: nullable(JsonU64),
|
|
@@ -60,7 +60,7 @@ const GasData = object({
|
|
|
60
60
|
payment: nullable(array(ObjectRefSchema)),
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
63
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L707-L718
|
|
64
64
|
const ProgrammableMoveCall = object({
|
|
65
65
|
package: ObjectID,
|
|
66
66
|
module: string(),
|
|
@@ -76,7 +76,7 @@ const $Intent = object({
|
|
|
76
76
|
data: record(string(), unknown()),
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
79
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L657-L685
|
|
80
80
|
const Command = enumUnion({
|
|
81
81
|
MoveCall: ProgrammableMoveCall,
|
|
82
82
|
TransferObjects: object({
|
|
@@ -108,7 +108,7 @@ const Command = enumUnion({
|
|
|
108
108
|
$Intent,
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
111
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L102-L114
|
|
112
112
|
const ObjectArg = enumUnion({
|
|
113
113
|
ImmOrOwnedObject: ObjectRefSchema,
|
|
114
114
|
SharedObject: object({
|
|
@@ -120,7 +120,7 @@ const ObjectArg = enumUnion({
|
|
|
120
120
|
Receiving: ObjectRefSchema,
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/
|
|
123
|
+
// https://github.com/GeunhwaJeong/haneul/blob/df41d5fa8127634ff4285671a01ead00e519f806/crates/haneul-types/src/transaction.rs#L75-L80
|
|
124
124
|
const CallArg = enumUnion({
|
|
125
125
|
Object: ObjectArg,
|
|
126
126
|
Pure: object({
|
|
@@ -15,7 +15,7 @@ import { isTransaction } from '../Transaction.js';
|
|
|
15
15
|
export interface ExecuteTransactionOptions<Include extends HaneulClientTypes.TransactionInclude = {}> {
|
|
16
16
|
transaction: Transaction | Uint8Array;
|
|
17
17
|
signatures: string[];
|
|
18
|
-
include?: Include;
|
|
18
|
+
include?: Include & HaneulClientTypes.TransactionInclude;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export class CachingTransactionExecutor {
|
|
@@ -93,7 +93,7 @@ export class CachingTransactionExecutor {
|
|
|
93
93
|
}: {
|
|
94
94
|
transaction: Transaction;
|
|
95
95
|
signer: Signer;
|
|
96
|
-
include?: Include;
|
|
96
|
+
include?: Include & HaneulClientTypes.TransactionInclude;
|
|
97
97
|
}): Promise<HaneulClientTypes.TransactionResult<Include & { effects: true }>> {
|
|
98
98
|
transaction.setSenderIfNotSet(signer.toHaneulAddress());
|
|
99
99
|
const bytes = await this.buildTransaction({ transaction });
|
|
@@ -128,7 +128,7 @@ export class ParallelTransactionExecutor {
|
|
|
128
128
|
|
|
129
129
|
async executeTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
130
130
|
transaction: Transaction,
|
|
131
|
-
include?: Include,
|
|
131
|
+
include?: Include & HaneulClientTypes.TransactionInclude,
|
|
132
132
|
additionalSignatures: string[] = [],
|
|
133
133
|
): Promise<HaneulClientTypes.TransactionResult<Include & { effects: true }>> {
|
|
134
134
|
const { promise, resolve, reject } =
|
|
@@ -262,7 +262,6 @@ export class ParallelTransactionExecutor {
|
|
|
262
262
|
if (gasOwner === this.#signer.toHaneulAddress()) {
|
|
263
263
|
const totalUsed =
|
|
264
264
|
BigInt(gasUsed.computationCost) +
|
|
265
|
-
BigInt(gasUsed.storageCost) +
|
|
266
265
|
BigInt(gasUsed.storageCost) -
|
|
267
266
|
BigInt(gasUsed.storageRebate);
|
|
268
267
|
const remainingBalance = coin.balance - totalUsed;
|
|
@@ -164,7 +164,7 @@ export class SerialTransactionExecutor {
|
|
|
164
164
|
|
|
165
165
|
executeTransaction<Include extends HaneulClientTypes.TransactionInclude = {}>(
|
|
166
166
|
transaction: Transaction | Uint8Array,
|
|
167
|
-
include?: Include,
|
|
167
|
+
include?: Include & HaneulClientTypes.TransactionInclude,
|
|
168
168
|
additionalSignatures: string[] = [],
|
|
169
169
|
): Promise<HaneulClientTypes.TransactionResult<Include & { effects: true }>> {
|
|
170
170
|
return this.#queue.runTask(async () => {
|