Constructors for CVM cells and related type predicate functions.
Constructors for CVM cells and related type predicate functions.
(* x)
Macro for translating Clojure types to Convex types.
Convex types can be inserted using ~
, especially useful for inserting values dynamically or inserting types
that have no equivalent in Clojure (eg. address
).
;; Cell for `(transfer #42 500000)`
;;
(* (transfer ~(address 42)
500000))
Macro for translating Clojure types to Convex types. Convex types can be inserted using `~`, especially useful for inserting values dynamically or inserting types that have no equivalent in Clojure (eg. `address`). ```clojure ;; Cell for `(transfer #42 500000)` ;; (* (transfer ~(address 42) 500000)) ```
(address long)
Creates a CVM address from a long.
Creates a CVM address from a long.
(blob byte-array)
Creates a CVM blob from a byte array.
Creates a CVM blob from a byte array.
(blob<-hex hex-string)
Creates a CVM blob from a hex string.
Creates a CVM blob from a hex string.
(boolean x)
Creates a CVM boolean given a falsy or truthy value.
Creates a CVM boolean given a falsy or truthy value.
(byte b)
Creates a CVM byte from a value between 0 and 255 inclusive.
Creates a CVM byte from a value between 0 and 255 inclusive.
(call address sequence address-callable function-name args)
(call address sequence address-callable offer function-name args)
Creates a transaction for invoking a callable function.
Creates a transaction for invoking a callable function.
(char ch)
Creates a CVM character from a regular character.
Creates a CVM character from a regular character.
(code-std* kw)
Given a Clojure keyword, returns the corresponding standard error code (any of the Convex keyword the CVM itself uses):
:ARGUMENT
:ARITY
:ASSERT
:BOUNDS
:CAST
:COMPILE
:DEPTH
:EXCEPTION
:EXPAND
:FATAL
:FUNDS
:HALT
:JUICE
:MEMORY
:NOBODY
:RECUR
:REDUCED
:RETURN
:ROLLBACK
:SEQUENCE
:SIGNATURE
:STATE
:TAILCALL
:TODO
:TRUST
:UNDECLARED
:UNEXPECTED
Throws if keyword does not match any of those.
Note that in user functions, codes can be anything, any type, using those codes is not at all mandatory.
Given a Clojure keyword, returns the corresponding standard error code (any of the Convex keyword the CVM itself uses): - `:ARGUMENT` - `:ARITY` - `:ASSERT` - `:BOUNDS` - `:CAST` - `:COMPILE` - `:DEPTH` - `:EXCEPTION` - `:EXPAND` - `:FATAL` - `:FUNDS` - `:HALT` - `:JUICE` - `:MEMORY` - `:NOBODY` - `:RECUR` - `:REDUCED` - `:RETURN` - `:ROLLBACK` - `:SEQUENCE` - `:SIGNATURE` - `:STATE` - `:TAILCALL` - `:TODO` - `:TRUST` - `:UNDECLARED` - `:UNEXPECTED` Throws if keyword does not match any of those. Note that in user functions, codes can be anything, any type, using those codes is not at all mandatory.
(cvm-value? cell)
Is cell
a CVM value?
Returns false if x
is not accessible in the CVM and meant to be used outside (eg. networking).
Is `cell` a CVM value? Returns false if `x` is not accessible in the CVM and meant to be used outside (eg. networking).
(encoding cell)
Returns a blob
representing the encoding of the given cell
.
Returns a [[blob]] representing the encoding of the given `cell`.
(error message)
(error code message)
(error code message trace)
An error value as Convex data.
code
is often a CVM keyword (:ASSERT
by default), message
could be any CVM value (albeit often a human-readable
string), and trace
is an optional stacktrace (CVM vector of CVM strings).
An error value as Convex data. `code` is often a CVM keyword (`:ASSERT` by default), `message` could be any CVM value (albeit often a human-readable string), and `trace` is an optional stacktrace (CVM vector of CVM strings).
(hash cell)
Returns the hash of the given cell
.
A hash is a specialized 32-byte blob
.
Returns the hash of the given `cell`. A hash is a specialized 32-byte [[blob]].
(hash<-blob blob)
Converts a 32-byte blob
to a hash.
Converts a 32-byte [[blob]] to a hash.
(hash<-hex hex-string)
Creates a hash
from a hex string.
Returns nil if hex string is of wrong format.
Creates a [[hash]] from a hex string. Returns nil if hex string is of wrong format.
(invoke address sequence cell)
Creates a transaction for invoking code (a cell).
Creates a transaction for invoking code (a cell).
Zeroed key
that can be used during dev and testing so that an account is considered as a user, not an actor.
Zeroed [[key]] that can be used during dev and testing so that an account is considered as a user, not an actor.
(keyword string)
Creates a CVM keyword from a string.
Creates a CVM keyword from a string.
(list)
(list x)
Creates a CVM list from a collection of CVM items.
Creates a CVM list from a collection of CVM items.
(map)
(map x)
Creates a CVM map from a collection of [key value]
.
Creates a CVM map from a collection of `[key value]`.
(set)
(set x)
Creates a CVM set from a collection of CVM items.
Creates a CVM set from a collection of CVM items.
(string string)
Creates a CVM string from a regular string.
Creates a CVM string from a regular string.
(symbol string)
Creates a CVM symbol from a string.
Creates a CVM symbol from a string.
(transfer address sequence address-receiver amount)
Creates a transaction for transferring Convex Coins.
Creates a transaction for transferring Convex Coins.
(vector)
(vector x)
Creates a CVM vector from a collection of CVM items.
Creates a CVM vector from a collection of CVM items.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close