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 [:from :gas :ignore-forward?] :as opts})

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 transaction-hash (state-altering calls) or method return value (read-only calls).

# 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 transaction-hash (state-altering calls) or `method` return value (read-only calls).
sourceraw docstring

contract-event-in-txcljs

(contract-event-in-tx tx-hash contract event-name & args)
source

contract-events-in-txcljs

(contract-events-in-tx tx-hash contract event-name & args)
source

contract-namecljs

(contract-name contract-key)
source

create-event-filtercljs

(create-event-filter contract
                     event
                     filter-opts
                     opts
                     &
                     [on-event {:keys [:ignore-forward?]}])

This function installs event filter

arguments:

contract parameter can be one of:

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

event : camel_case keyword corresponding to the smart-contract event

filter-opts : a map of indexed return values you want to filter the logs by e.g. {:valueA 1 :valueB 2}

opts : specifies additional filter options, can be one of:

  • string 'latest' to specify that only new observed events should be processed
  • map {:from-block 0 :to-block 100} specifying earliest and latest block on which the event handler should fire

on-event : event handler function

see https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events for additional details

This function installs event filter
# arguments:
## `contract` parameter can be one of:
 * keyword :some-contract
 * tuple of keyword and address [:some-contract 0x1234...]
 * instance SomeContract
## `event` : camel_case keyword corresponding to the smart-contract event
## `filter-opts` : a map of indexed return values you want to filter the logs by e.g. {:valueA 1 :valueB 2}
## `opts` : specifies additional filter options, can be one of:
 * string 'latest' to specify that only new observed events should be processed
 * map {:from-block 0 :to-block 100} specifying earliest and latest block on which the event handler should fire
## `on-event` : event handler function
see https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events for additional details
sourceraw docstring

deploy-smart-contract!cljs

(deploy-smart-contract! contract-key args)
(deploy-smart-contract! contract-key
                        args
                        {:keys [:placeholder-replacements :from :gas] :as opts})

arguments:

  • contract-key keyword e.g. :some-contract

args is a vector of arguments for the constructor

opts is a map of options:

  • placeholder-replacements : a map containing replacements for library placeholders
  • from : address deploying the conract
  • :gas : gas limit for the contract creation transaction

returns:

function returns a Promise resolving to the deployed contracts address.

# arguments:
  * `contract-key` keyword e.g. :some-contract
## `args` is a vector of arguments for the constructor
## `opts` is a map of options:
 * `placeholder-replacements` : a map containing replacements for library placeholders
 * `from` : address deploying the conract
 * `:gas` : gas limit for the contract creation transaction
# returns:
function returns a Promise resolving to the deployed contracts address.
sourceraw docstring

fscljs

source

instancecljs

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

(link-contract-libraries smart-contracts bin library-placeholders)
source

(link-library bin placeholder library-address)
source

load-contract-filescljs

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

processcljs

source

replay-past-eventscljs

(replay-past-events event-filter
                    callback
                    &
                    [{:keys [:delay :transform-fn :on-finish]
                      :or {delay 0 transform-fn identity}}])
source

replay-past-events-in-ordercljs

(replay-past-events-in-order event-filters
                             callback
                             &
                             [{:keys [:delay :transform-fn :on-finish]
                               :or {delay 0 transform-fn identity}}])
source

smart-contractscljs

source

startcljs

(start {:keys [contracts-build-path :contracts-var print-gas-usage?] :as opts})
source

update-contract!cljs

(update-contract! contract-key contract)
source

wait-for-tx-receiptcljs

(wait-for-tx-receipt tx-hash)

blocks until transaction tx-hash gets sent to the network.

blocks until transaction `tx-hash` gets sent to the network.
sourceraw docstring

write-smart-contracts!cljs

(write-smart-contracts!)
source

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

× close