Liking cljdoc? Tell your friends :D

convex.cell

Constructors for CVM cells and related type predicate functions.

Constructors for CVM cells and related type predicate functions.
raw docstring

*cljmacro

(* 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).

Also understands ~@ (aka unquote splicing).

;; 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`).

Also understands `~@` (aka unquote splicing).


```clojure
;; Cell for `(transfer #42 500000)`
;;
(* (transfer ~(address 42)
             500000))
```
sourceraw docstring

addressclj

(address long)

Creates an address from a long.

Creates an address from a long.
sourceraw docstring

blobclj

(blob byte-array)

Creates a blob from a byte array.

Creates a blob from a byte array.
sourceraw docstring

blob-mapclj

(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]`.
sourceraw docstring

blob<-hexclj

(blob<-hex hex-string)

Creates a blob from a hex string.

Creates a blob from a hex string.
sourceraw docstring

booleanclj

(boolean x)

Creates a boolean cell given a falsy or truthy value.

Creates a boolean cell given a falsy or truthy value.
sourceraw docstring

byteclj

(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.
sourceraw docstring

callclj

(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.
sourceraw docstring

charclj

(char ch)

Creates a character cell from a regular character.

Creates a character cell from a regular character.
sourceraw docstring

code-std*cljmacro

(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.
sourceraw docstring

doubleclj

(double x)

Creates a double cell.

Creates a double cell.
sourceraw docstring

encodingclj

(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.
sourceraw docstring

errorclj

(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).
sourceraw docstring

hashclj

(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]].
sourceraw docstring

hash<-blobclj

(hash<-blob blob)

Converts a 32-byte blob to a hash.

Converts a 32-byte [[blob]] to a [[hash]].
sourceraw docstring

hash<-hexclj

(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.
sourceraw docstring

invokeclj

(invoke address sequence-id cell)

Creates a transaction for invoking code (a cell).

Creates a transaction for invoking code (a cell).
sourceraw docstring

keyclj

(key blob)

Creates an account key from a 32-byte blob.

Returns nil if the given blob is of wrong size.

Creates an account key from a 32-byte [[blob]].

Returns nil if the given [[blob]] is of wrong size.
sourceraw docstring

key-fakeclj

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.
sourceraw docstring

keywordclj

(keyword string)

Creates a keyword cell from a string.

Creates a keyword cell from a string.
sourceraw docstring

listclj

(list)
(list x)

Creates a list cell from a collection of cells.

Creates a list cell from a collection of cells.
sourceraw docstring

longclj

(long x)

Creates a long cell.

Creates a long cell.
sourceraw docstring

mapclj

(map)
(map kvs)

Creates a map cell from a collection of [key value].

Creates a map cell from a collection of `[key value]`.
sourceraw docstring

quotedclj

(quoted x)

Wraps x in quote.

Wraps `x` in `quote`.
sourceraw docstring

setclj

(set)
(set x)

Creates a set cell from a collection of items cell.

Creates a set cell from a collection of items cell.
sourceraw docstring

stringclj

(string string)

Creates a string cell from a regular string.

Creates a string cell from a regular string.
sourceraw docstring

symbolclj

(symbol string)

Creates a symbol cell from a string.

Creates a symbol cell from a string.
sourceraw docstring

syntaxclj

(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]].
sourceraw docstring

transferclj

(transfer address sequence address-receiver amount)

Creates a transaction for transferring Convex Coins.

Creates a transaction for transferring Convex Coins.
sourceraw docstring

vectorclj

(vector)
(vector x)

Creates a vector cell from a collection of items cell.

Creates a vector cell from a collection of items cell.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close