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 an address from a long.
Creates an address from a long.
(blob byte-array)
Creates a blob from a byte array.
Creates a blob from a byte array.
(blob-map)
(blob-map kvs)
Creates a blob map from a collection of [blob value]
.
Creates a blob map from a collection of `[blob value]`.
(blob<-hex hex-string)
Creates a blob from a hex string.
Creates a blob from a hex string.
(boolean x)
Creates a boolean cell given a falsy or truthy value.
Creates a boolean cell given a falsy or truthy value.
(byte b)
Creates a byte cell from a value between 0 and 255 inclusive.
Creates a byte cell 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 character cell from a regular character.
Creates a character cell 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.
(encoding cell)
Returns a blob
representing the encoding of the given cell
.
This encoding is meant for incremental updates.
Returns a [[blob]] representing the encoding of the given `cell`. This encoding is meant for incremental updates.
(error message)
(error code message)
(error code message trace)
An error value as Convex data.
code
is often a keyword cell (:ASSERT
by default), message
could be any cell (albeit often a human-readable
string), and trace
is an optional stacktrace (vector cell of string cells).
An error value as Convex data. `code` is often a keyword cell (`:ASSERT` by default), `message` could be any cell (albeit often a human-readable string), and `trace` is an optional stacktrace (vector cell of string cells).
(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<-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-id 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 keyword cell from a string.
Creates a keyword cell from a string.
(list)
(list x)
Creates a list cell from a collection of cells.
Creates a list cell from a collection of cells.
(map)
(map kvs)
Creates a map cell from a collection of [key value]
.
Creates a map cell from a collection of `[key value]`.
(set)
(set x)
Creates a set cell from a collection of items cell.
Creates a set cell from a collection of items cell.
(string string)
Creates a string cell from a regular string.
Creates a string cell from a regular string.
(symbol string)
Creates a symbol cell from a string.
Creates a symbol cell from a string.
(syntax cell)
(syntax cell metadata)
Creates a syntax cell.
It wraps the given cell
and allow attaching a metadata map
.
Creates a syntax cell. It wraps the given `cell` and allow attaching a metadata [[map]].
(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 vector cell from a collection of items cell.
Creates a vector cell from a collection of items cell.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close