Liking cljdoc? Tell your friends :D

district.server.smart-contracts


contractcljs

(contract contract-key)
source

contract-abicljs

(contract-abi contract-key)
source

contract-addresscljs

(contract-address contract-key)
source

contract-bincljs

(contract-bin contract-key)
source

contract-by-addresscljs

(contract-by-address contract-address)
source

contract-callcljs

(contract-call contract method)
(contract-call contract method args)
(contract-call contract method args {:keys [:ignore-forward?] :as opts})

Will call a method and execute its smart contract method in the EVM without sending any transaction.

arguments:

contract parameter can be one of:

  • keyword :some-contract
  • tuple of keyword and address [:some-contract 0x1234...]
  • instance SomeContract

method is a :camel_case keyword corresponding to the smart-contract function

args is a vector of arguments for the method

opts is a map of options passed as message data

returns:

function returns a Promise resolving to the result of method call.

Will call a method and execute its smart contract method in the EVM without sending any transaction.
# arguments:
## `contract` parameter can be one of:
* keyword :some-contract
* tuple of keyword and address [:some-contract 0x1234...]
* instance SomeContract
## `method` is a :camel_case keyword corresponding to the smart-contract function
## `args` is a vector of arguments for the `method`
## `opts` is a map of options passed as message data
# returns:
function returns a Promise resolving to the result of `method` call.
sourceraw docstring

contract-event-in-txcljs

(contract-event-in-tx contract event {:keys [:transaction-hash] :as tx-receipt})
source

contract-namecljs

(contract-name contract-key)
source

contract-sendcljs

(contract-send contract method)
(contract-send contract method args)
(contract-send contract
               method
               args
               {:keys [:from :gas :ignore-forward?] :as opts})

Will send a transaction to the smart contract and execute its method.

arguments:

contract parameter can be one of:

  • keyword :some-contract
  • tuple of keyword and address [:some-contract 0x1234...]
  • instance SomeContract

method is a :camel_case keyword corresponding to the smart-contract function

args is a vector of arguments for the method

opts is a map of options passed as message data

returns:

function returns a Promise resolving to a tx receipt.

Will send a transaction to the smart contract and execute its method.
# arguments:
## `contract` parameter can be one of:
* keyword :some-contract
* tuple of keyword and address [:some-contract 0x1234...]
* instance SomeContract
## `method` is a :camel_case keyword corresponding to the smart-contract function
## `args` is a vector of arguments for the `method`
## `opts` is a map of options passed as message data
# returns:
function returns a Promise resolving to a tx receipt.
sourceraw docstring

fscljs

source

instancecljs

(instance contract-key)
(instance contract-key contract-key-or-addr)
source

instance-from-argcljs

(instance-from-arg contract & [{:keys [:ignore-forward?]}])
source

load-contract-filescljs

(load-contract-files contract {:keys [:contracts-build-path]})
source

processcljs

source

replay-past-events-in-ordercljs

(replay-past-events-in-order events
                             callback
                             {:keys [:from-block :to-block :ignore-forward?
                                     :delay :transform-fn :on-finish]
                              :or {delay 0 transform-fn identity}
                              :as opts})
source

smart-contractscljs

source

startcljs

(start {:keys [:contracts-var] :as opts})
source

subscribe-event-logscljs

(subscribe-event-logs contract
                      event
                      {:keys [:from-block :address :topics :ignore-forward?]
                       :as opts}
                      &
                      [callback])
source

subscribe-eventscljs

(subscribe-events contract
                  event
                  {:keys [:from-block :address :topics :ignore-forward?
                          :latest-event?]
                   :as opts}
                  callbacks)
source

update-contract!cljs

(update-contract! contract-key contract)
source

wait-for-blockcljs

(wait-for-block block-number callback)

Blocks until block with block-number arrives. callback is a nodejs style callback i.e. (fn [error data] ...)

Blocks until block with block-number arrives.
callback is a nodejs style callback i.e. (fn [error data] ...)
sourceraw docstring

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

× close