- Overview
- Tutorials
- Getting started
- Get started with Canton and the JSON Ledger API
- Get Started with Canton, the JSON Ledger API, and TypeScript
- Get started with Canton Network App Dev Quickstart
- Get started with smart contract development
- Basic contracts
- Test templates using Daml scripts
- Build the Daml Archive (.dar) file
- Data types
- Transform contracts using choices
- Add constraints to a contract
- Parties and authority
- Compose choices
- Handle exceptions
- Work with dependencies
- Functional programming 101
- The Daml standard library
- Test Daml contracts
- Next steps
- Application development
- Getting started
- Development how-tos
- Component how-tos
- Explanations
- References
- Application development
- Smart contract development
- Daml language cheat sheet
- Daml language reference
- Daml standard library
- DA.Action.State.Class
- DA.Action.State
- DA.Action
- DA.Assert
- DA.Bifunctor
- DA.Crypto.Text
- DA.Date
- DA.Either
- DA.Exception
- DA.Fail
- DA.Foldable
- DA.Functor
- DA.Internal.Interface.AnyView.Types
- DA.Internal.Interface.AnyView
- DA.List.BuiltinOrder
- DA.List.Total
- DA.List
- DA.Logic
- DA.Map
- DA.Math
- DA.Monoid
- DA.NonEmpty.Types
- DA.NonEmpty
- DA.Numeric
- DA.Optional
- DA.Record
- DA.Semigroup
- DA.Set
- DA.Stack
- DA.Text
- DA.TextMap
- DA.Time
- DA.Traversable
- DA.Tuple
- DA.Validation
- GHC.Show.Text
- GHC.Tuple.Check
- Prelude
- Smart contract upgrading reference
- Glossary of concepts
DA.Crypto.Text¶
Functions for working with Crypto builtins. For example, as used to implement CCTP functionality.
Typeclasses¶
class HasToHex a where
class HasFromHex a where
instance HasFromHex (Optional Party)
instance HasFromHex (Optional Int)
instance HasFromHex (Optional Text)
Data Types¶
- type PublicKeyHex
= Text
A DER formatted public key to be used for ECDSA signature verification
- type SignatureHex
= Text
A DER formatted SECP256K1 signature
Functions¶
- isHex
-
isHex
isTrue
ift
is not empty and consists only of hex or hexadecimal characters.
- keccak256
-
Computes the KECCAK256 hash of the UTF8 bytes of the
Text
, and returns it in its hex-encoded form. The hex encoding uses lowercase letters.
- secp256k1
: SignatureHex -> BytesHex -> PublicKeyHex -> Bool
Validate the SECP256K1 signature given a hex encoded message and a hex encoded DER formatted public key.
- numericViaStringToHex
: NumericScale n => Numeric n -> BytesHex
- numericViaStringFromHex
: NumericScale n => BytesHex -> Optional (Numeric n)
- minBytes32Hex
: BytesHex
Minimum Bytes32 hex value
- maxBytes32Hex
: BytesHex
Maximum Bytes32 hex value
- isBytes32Hex
-
Validate that the byte encoded string is Bytes32Hex
- minUInt32Hex
: BytesHex
Minimum UInt32 hex value
- maxUInt32Hex
: BytesHex
Maximum UInt32 hex value
- isUInt32Hex
-
Validate that the byte encoded string is UInt32Hex
- minUInt64Hex
: BytesHex
Minimum UInt64 hex value
- maxUInt64Hex
: BytesHex
Maximum UInt64 hex value
- isUInt64Hex
-
Validate that the byte encoded string is UInt64Hex
- minUInt256Hex
: BytesHex
Minimum UInt256 hex value
- maxUInt256Hex
: BytesHex
Maximum UInt256 hex value
- isUInt256Hex
-
Validate that the byte encoded string is UInt256Hex
- packHexBytes
: BytesHex -> Int -> Optional BytesHex
Pack a byte encoded string to a given byte count size. If the byte string is shorter than the pad size, then prefix with 00 byte strings. If the byte string is larger, then truncate the byte string.