@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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Transaction Intents
|
|
2
|
+
|
|
3
|
+
> Use high-level intents to simplify transaction building
|
|
4
|
+
|
|
5
|
+
Transaction Intents enable 3rd party SDKs and [Transaction Plugins](../plugins) to more easily add
|
|
6
|
+
complex operations to a Transaction. The Typescript SDK currently only includes a single Intent
|
|
7
|
+
(CoinWithBalance), but more will be added in the future.
|
|
8
|
+
|
|
9
|
+
## The CoinWithBalance intent
|
|
10
|
+
|
|
11
|
+
The `CoinWithBalance` intent makes it easy to get a coin with a specific balance. For HANEUL, this
|
|
12
|
+
has generally been done by splitting the gas coin:
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
const tx = new Transaction();
|
|
16
|
+
|
|
17
|
+
const [coin] = tx.splitCoins(tx.gas, [100]);
|
|
18
|
+
|
|
19
|
+
tx.transferObjects([coin], recipient);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This approach works well for HANEUL, but can't be used for other coin types. The CoinWithBalance
|
|
23
|
+
intent solves this by providing a helper function that automatically adds the correct SplitCoins and
|
|
24
|
+
MergeCoins commands to the transaction:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
const tx = new Transaction();
|
|
28
|
+
|
|
29
|
+
// Setting the sender is required for the CoinWithBalance intent to resolve coins when not using the gas coin
|
|
30
|
+
tx.setSender(keypair.toHaneulAddress());
|
|
31
|
+
|
|
32
|
+
tx.transferObjects(
|
|
33
|
+
[
|
|
34
|
+
// Create a HANEUL coin (balance is in GEUNHWA)
|
|
35
|
+
coinWithBalance({ balance: 100 }),
|
|
36
|
+
// Create a coin of another type
|
|
37
|
+
coinWithBalance({ balance: 100, type: '0x123::foo:Bar' }),
|
|
38
|
+
],
|
|
39
|
+
recipient,
|
|
40
|
+
);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Splitting the gas coin also causes problems for sponsored transactions. When sponsoring
|
|
44
|
+
transactions, the gas coin comes from the sponsor instead of the transaction sender. Transaction
|
|
45
|
+
sponsors usually do not sponsor transactions that use the gas coin for anything other than gas. To
|
|
46
|
+
transfer HANEUL that does not use the gas coin, you can set the `useGasCoin` option to `false`:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const tx = new Transaction();
|
|
50
|
+
tx.transferObjects([coinWithBalance({ balance: 100, useGasCoin: false })], recipient);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
It's important to only set `useGasCoin` option to false for sponsored transactions, otherwise the
|
|
54
|
+
coinWithBalance intent may use all the HANEUL coins, leaving no coins to use for gas.
|
|
55
|
+
|
|
56
|
+
## How it works
|
|
57
|
+
|
|
58
|
+
When the `CoinWithBalance` intent is resolved, it will look up the senders owned coins for each type
|
|
59
|
+
that needs to be created. It will then find a set of coins with sufficient balance to cover the
|
|
60
|
+
desired balance, to combine them into a single coin. This coin is then used in a `SplitCoins`
|
|
61
|
+
command to create the desired coin.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Building Offline
|
|
2
|
+
|
|
3
|
+
> Build transactions without a network connection
|
|
4
|
+
|
|
5
|
+
To build a transaction offline (with no `client` required), you need to fully define all of your
|
|
6
|
+
inputs, gas configuration, and expiration.
|
|
7
|
+
|
|
8
|
+
## Required Configuration
|
|
9
|
+
|
|
10
|
+
When building offline, you must set the following:
|
|
11
|
+
|
|
12
|
+
- **Sender address** - The address that will execute the transaction
|
|
13
|
+
- **Gas price** - The price per gas unit (can be obtained from the network beforehand)
|
|
14
|
+
- **Gas budget** - The maximum gas to spend on this transaction
|
|
15
|
+
- **Gas payment** - One or more coin object references to use for gas, or an empty array for Address
|
|
16
|
+
Balances
|
|
17
|
+
- **Expiration** - Only needed when using address balances for gas
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
const { referenceGasPrice } = await client.getReferenceGasPrice();
|
|
21
|
+
|
|
22
|
+
const tx = new Transaction();
|
|
23
|
+
|
|
24
|
+
tx.setSender('0x<your-address>');
|
|
25
|
+
tx.setGasPrice(referenceGasPrice);
|
|
26
|
+
tx.setGasBudget(50_000_000);
|
|
27
|
+
tx.setGasPayment([
|
|
28
|
+
{
|
|
29
|
+
objectId: '0x<gas-coin-object-id>',
|
|
30
|
+
version: '<object-version>',
|
|
31
|
+
digest: '<object-digest>',
|
|
32
|
+
},
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
// Build the transaction without a client
|
|
36
|
+
const bytes = await tx.build();
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Object References
|
|
40
|
+
|
|
41
|
+
For objects used in your transaction, you must provide full object references using the `Inputs`
|
|
42
|
+
helper:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
// For owned or immutable objects
|
|
46
|
+
tx.object(
|
|
47
|
+
Inputs.ObjectRef({
|
|
48
|
+
objectId: '0x<object-id>',
|
|
49
|
+
version: '<object-version>',
|
|
50
|
+
digest: '<object-digest>',
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// For shared objects
|
|
55
|
+
tx.object(
|
|
56
|
+
Inputs.SharedObjectRef({
|
|
57
|
+
objectId: '0x<object-id>',
|
|
58
|
+
initialSharedVersion: '<initial-shared-version>',
|
|
59
|
+
mutable: true,
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// For receiving objects (objects being received by another object)
|
|
64
|
+
tx.object(
|
|
65
|
+
Inputs.ReceivingRef({
|
|
66
|
+
objectId: '0x<object-id>',
|
|
67
|
+
version: '<object-version>',
|
|
68
|
+
digest: '<object-digest>',
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Sponsored Transactions
|
|
2
|
+
|
|
3
|
+
> Pay gas fees on behalf of other users with sponsored transactions
|
|
4
|
+
|
|
5
|
+
The transaction builder can support sponsored transactions by using the `onlyTransactionKind` flag
|
|
6
|
+
when building the transaction.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
const tx = new Transaction();
|
|
10
|
+
|
|
11
|
+
// ... add some transactions...
|
|
12
|
+
|
|
13
|
+
const kindBytes = await tx.build({ provider, onlyTransactionKind: true });
|
|
14
|
+
|
|
15
|
+
// construct a sponsored transaction from the kind bytes
|
|
16
|
+
const sponsoredtx = Transaction.fromKind(kindBytes);
|
|
17
|
+
|
|
18
|
+
// you can now set the sponsored transaction data that is required
|
|
19
|
+
sponsoredtx.setSender(sender);
|
|
20
|
+
sponsoredtx.setGasOwner(sponsor);
|
|
21
|
+
sponsoredtx.setGasPayment(sponsorCoins);
|
|
22
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Derived Objects
|
|
2
|
+
|
|
3
|
+
> Compute derived object IDs from parent objects
|
|
4
|
+
|
|
5
|
+
Derived objects enable deterministic IDs for objects, enabling offline derivation of object IDs.
|
|
6
|
+
[Click here to read more.](https://docs.haneul.io/concepts/haneul-move-concepts/derived-objects)
|
|
7
|
+
|
|
8
|
+
To derive an object ID, you can import `deriveObjectID` function exposed from utils.
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
To derive any object, you need to have its parent's ID (the object from which it was derived), and
|
|
15
|
+
the key used to generate it.
|
|
16
|
+
|
|
17
|
+
> **Warning:** It is recommended to verify the on-chain `derived_object::derive_address` match your
|
|
18
|
+
> off-chain calculation (at least once when implementing offline calculations), especially for
|
|
19
|
+
> critical cases like transferring assets.
|
|
20
|
+
|
|
21
|
+
## Deriving using primitive keys
|
|
22
|
+
|
|
23
|
+
To derive the IDs using primitive types, you can use the built-in types like this, assuming you have
|
|
24
|
+
a parent object with ID `0xc0ffee`.
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
// Example 1: On-chain derivation for `0xc0ffee + vector<u8>([0,1,2])
|
|
28
|
+
deriveObjectID('0xc0ffee', 'vector<u8>', bcs.vector(bcs.u8()).serialize([0, 1, 2]).toBytes());
|
|
29
|
+
|
|
30
|
+
// Example 2: On-chain derivation for `0xc0ffee + address('0x111')`
|
|
31
|
+
deriveObjectID('0xc0ffee', 'address', bcs.Address.serialize('0x111').toBytes());
|
|
32
|
+
|
|
33
|
+
// Example 3: On-chain derivation for `0xc0ffee + non-ascii string ("foo")`
|
|
34
|
+
deriveObjectID('0xc0ffee', '0x1::string::String', bcs.String.serialize('foo').toBytes());
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Deriving using custom types
|
|
38
|
+
|
|
39
|
+
To derive IDs using your custom objects, you can use BCS & the known type IDs.
|
|
40
|
+
|
|
41
|
+
Assuming a custom struct on-chain (for the key) being:
|
|
42
|
+
|
|
43
|
+
```move
|
|
44
|
+
public struct DemoStruct has copy, store, drop { value: u64 }
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
you can derive it by doing:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// Assuming we wanted to derive for key `DemoStruct { value: 1 }`.
|
|
51
|
+
const bcsType = bcs.struct('DemoStruct', {
|
|
52
|
+
value: bcs.u64(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const key = bcsType.serialize({ value: 1 }).toBytes();
|
|
56
|
+
|
|
57
|
+
// Derive the object ID for the key `DemoStruct { value: 1 }`.
|
|
58
|
+
deriveObjectID('0xc0ffee', `0xc0ffee::demo::DemoStruct`, key);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Deriving with fieldless structs
|
|
62
|
+
|
|
63
|
+
In Move, structs with no user-defined fields automatically get a `dummy_field: bool` injected by the
|
|
64
|
+
compiler. This means their BCS encoding is not empty — it's a single `0x00` byte (the encoding of
|
|
65
|
+
`false`). You can treat this as a constant.
|
|
66
|
+
|
|
67
|
+
A real-world example is `0x2::coin_registry::CurrencyKey<T>`, which is a fieldless generic struct
|
|
68
|
+
used to derive `Currency` objects from the coin registry (`0xc`) based on their type:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// On-chain: `public struct CurrencyKey<phantom T>() has copy, store, drop`
|
|
72
|
+
// The compiler injects `dummy_field: bool`, always `false`.
|
|
73
|
+
const key = new Uint8Array([0]);
|
|
74
|
+
|
|
75
|
+
const coinType = '0x2::haneul::HANEUL';
|
|
76
|
+
const currencyId = deriveObjectID('0xc', `0x2::coin_registry::CurrencyKey<${coinType}>`, key);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This applies to any struct with no fields — phantom type parameters don't add any BCS-encoded data,
|
|
80
|
+
so the key is always `new Uint8Array([0])`.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# The `@haneullabs/haneul/utils` package
|
|
2
|
+
|
|
3
|
+
> Utility functions for addresses, coins, and common operations
|
|
4
|
+
|
|
5
|
+
This package contains some utilities that simplify common operations when working with the Haneul
|
|
6
|
+
TypeScript SDK.
|
|
7
|
+
|
|
8
|
+
## Constants
|
|
9
|
+
|
|
10
|
+
A set of constants exported for common uses cases:
|
|
11
|
+
|
|
12
|
+
- `GEUNHWA_PER_HANEUL`: The conversion rate for GEUNHWA to HANEUL (1,000,000,000)
|
|
13
|
+
- `HANEUL_DECIMALS`: the number of decimals you must shift a GEUNHWA value to convert it to HANEUL
|
|
14
|
+
(`9`)
|
|
15
|
+
- `HANEUL_ADDRESS_LENGTH`: The number of bytes in a Haneul address (32)
|
|
16
|
+
- `MOVE_STDLIB_ADDRESS`: The address for the Haneul Move standard library
|
|
17
|
+
- `HANEUL_FRAMEWORK_ADDRESS`: The address for the Haneul Framework
|
|
18
|
+
- `HANEUL_SYSTEM_ADDRESS`: The address for the Haneul System module
|
|
19
|
+
- `HANEUL_CLOCK_OBJECT_ID`: The address for the `haneul::clock::Clock` object
|
|
20
|
+
- `HANEUL_SYSTEM_STATE_OBJECT_ID`: The address for the `HaneulSystemState` object
|
|
21
|
+
- `HANEUL_RANDOM_OBJECT_ID`: The address for the `0x2::random::Random` object
|
|
22
|
+
|
|
23
|
+
## Formatters
|
|
24
|
+
|
|
25
|
+
You can use the following helpers to format various values:
|
|
26
|
+
|
|
27
|
+
- `formatAddress`
|
|
28
|
+
- `formatDigest`
|
|
29
|
+
- `normalizeStructTag`
|
|
30
|
+
- `normalizeHaneulAddress`
|
|
31
|
+
- `normalizeHaneulObjectId`
|
|
32
|
+
- `normalizeHaneulNSName`
|
|
33
|
+
- `normalizeHaneulNSName`
|
|
34
|
+
|
|
35
|
+
## Validators
|
|
36
|
+
|
|
37
|
+
You can use the following helpers to validate the format of various values (this only validates that
|
|
38
|
+
the value is in the correct format, but does not validate the value is valid for a specific use
|
|
39
|
+
case, or exists on chain).
|
|
40
|
+
|
|
41
|
+
- `isValidHaneulAddress`
|
|
42
|
+
- `isValidHaneulObjectId`
|
|
43
|
+
- `isValidTransactionDigest`
|
|
44
|
+
- `isValidHaneulNSName`
|
|
45
|
+
|
|
46
|
+
## Encoding
|
|
47
|
+
|
|
48
|
+
The following methods are re-exported to help with converting between commonly used encodings
|
|
49
|
+
|
|
50
|
+
- `fromHex`: Deserializes a hex string to a Uint8Array
|
|
51
|
+
- `toHex`: Serializes a Uint8Array to a hex string
|
|
52
|
+
- `fromBase64`: Deserializes a base64 string to a Uint8Array
|
|
53
|
+
- `toBase64`: Serializes a Uint8Array to a base64 string
|
package/docs/zklogin.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# ZkLogin
|
|
2
|
+
|
|
3
|
+
> Zero-knowledge authentication with OAuth providers on Haneul
|
|
4
|
+
|
|
5
|
+
Utilities for working with zkLogin. Currently contains functionality to create and parse zkLogin
|
|
6
|
+
signatures and compute zkLogin addresses.
|
|
7
|
+
|
|
8
|
+
To parse a serialized zkLogin signature
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
const parsedSignature = await parseZkLoginSignature('BQNNMTY4NjAxMzAyO....');
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Use `getZkLoginSignature` to serialize a zkLogin signature.
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const serializedSignature = await getZkLoginSignature({ inputs, maxEpoch, userSignature });
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
To compute the address for a given address seed and iss you can use `computeZkLoginAddressFromSeed`
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
const address = computeZkLoginAddressFromSeed(0n, 'https://accounts.google.com');
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To compute an address from jwt:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
const address = jwtToAddress(jwtAsString, salt);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To compute an address from a parsed jwt:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
const address = computeZkLoginAddress({
|
|
36
|
+
claimName,
|
|
37
|
+
claimValue,
|
|
38
|
+
iss,
|
|
39
|
+
aud,
|
|
40
|
+
userSalt: BigInt(salt),
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To use zkLogin inside a multisig, see the [Multisig Guide](../haneul/cryptography/multisig) for more
|
|
45
|
+
details.
|
|
46
|
+
|
|
47
|
+
## Legacy addresses
|
|
48
|
+
|
|
49
|
+
When zklogin was first introduced, there was an inconsistency in how the address seed was computed.
|
|
50
|
+
For backwards compatibility reasons there are 2 valid addresses for a given set of inputs. Methods
|
|
51
|
+
that produce zklogin addresses all accept a `legacyAddress` boolean flag, either as their last
|
|
52
|
+
parameter, or in their options argument.
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
|
|
56
|
+
computeZkLoginAddress,
|
|
57
|
+
computeZkLoginAddressFromSeed,
|
|
58
|
+
jwtToAddress,
|
|
59
|
+
toZkLoginPublicIdentifier,
|
|
60
|
+
genAddressSeed,
|
|
61
|
+
} from '@haneullabs/haneul/zklogin';
|
|
62
|
+
|
|
63
|
+
const address = jwtToAddress(jwtAsString, salt, true);
|
|
64
|
+
const address = computeZkLoginAddressFromSeed(0n, 'https://accounts.google.com', true);
|
|
65
|
+
const address = computeZkLoginAddress({
|
|
66
|
+
claimName,
|
|
67
|
+
claimValue,
|
|
68
|
+
iss,
|
|
69
|
+
aud,
|
|
70
|
+
userSalt: BigInt(salt),
|
|
71
|
+
legacyAddress: true,
|
|
72
|
+
});
|
|
73
|
+
const address = toZkLoginPublicIdentifier(
|
|
74
|
+
genAddressSeed(userSalt, claimName, claimValue, aud),
|
|
75
|
+
iss,
|
|
76
|
+
{ legacyAddress: true },
|
|
77
|
+
).toHaneulAddress();
|
|
78
|
+
```
|