Skip to content

Instantly share code, notes, and snippets.

{meta {:name "Simple chat command"
:description ""
:documentation ""}
views
{preview
[text "Hello World"]
short-preview
[text "Hello"]}
{:meta {:name "Collectibles"
:description "Demonstration of collectible command"
:documentation ""}
:views
{:preview
(let [{{{symbol :symbol token :token tx-hash :tx-hash} :params} :content outgoing :outgoing timestamp-str :timestamp-str} properties]
(let [collectible-token [:status/get-collectible-token symbol token]]
[ view {:flex-direction :column
:align-items :flex-start}
(ns pluto.storage.gist
(:require [pluto.storage :as storage]))
(defn result [xhr]
(let [status (.-status xhr)]
(if (= 404 status)
{:type :error :value status}
{:type :success :value [{:content (.-responseText xhr)}]})))
;; TODO Handle all edn files types, not only extension.edn
{meta
{:name "Simple Demo"
:description "A simple demo of extension"
:documentation "Nothing. Just see a text with dynamic random color."}
hooks/main.demo
{:view @views/main}
views/main
(let [{name :name} @properties]
{meta {:name "Dynamic command Extension"
:description "Just a simple dynamic test command"
:documentation ""}
views/send.preview
(let [{from :from} @properties]
[view {}
[text {}
from]])

Now that the ancient knowledge of adding DApps to status is known, Rachel will be the new master of curated DApps in status :D

3 steps to add a new DApp

Update the data used by Status

Modify the content of src/status_im/ui/screens/contacts/default_dapps.cljs To add a DApp, find the proper category (identified by :title) then add the following modifed to the :data array structure:

status-cli is a command line whose goal is to simplify developers testing and debugging on status during DApps development.

It offers the following features:

  • listing of running status instances (local emulators or real devices available on same WIFI)
  • deployment of a DApp running on the developer machine
  • update chain used by Status so that local testrpc developer chain is used intead

As much as possible this CLI tool will rely on tools provided by mobile toolchain providers (e.g. adb). Specifically the discovery process should not mandate the inclusion of network stacks in Status itself.

Sequential data structure

Extract seq elements by index Elements can be ignored with _ :as symbol denotes the whole sequence

Examples

[[a _ c :as all] [1 2 3 4 5]]
var status;
window.addEventListener('message', function (event) {
if (!event.data || !event.data.type) { return; }
if (event.data.type === 'STATUS_API_SUCCESS') {
status = event.data.status
}
});
// request status API
window.postMessage({ type: 'STATUS_API_REQUEST', permissions: ["WHISPER"] });

Chat commands are:

  • only available in 1x1 chats
  • identified by a global unique verb
  • associated with a list of arguments
    • typed : free (string, float, int), constrained (query result)
    • can trigger a suggestion component : reuse regular list components?
  • trigger a callback when fired (call an events, visual feedback? always send a message?)