Skip to content

Instantly share code, notes, and snippets.

@jeluard
Forked from janherich/extension.edn
Last active October 1, 2018 21:10
Show Gist options
  • Save jeluard/b8a80e71063d19e782bef138d08325c5 to your computer and use it in GitHub Desktop.
Save jeluard/b8a80e71063d19e782bef138d08325c5 to your computer and use it in GitHub Desktop.
{: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}
[:status/nft-token collectible-token]
[:view {:color (if outgoing "#707caf" "#939ba1")
:margin-top 6
:font-size 12
:flex-direction :row}
[:text {} "Sent at "] [text {} timestamp-str]]
[:status/send-status tx-hash outgoing]]))
:short-preview
(let [{{{symbol :symbol} :params} :content outgoing :outgoing} properties]
[:view {:flex-direction :row
:align-items :flex-start}
[:text (if outgoing "Sent " "Received ")]
[:text symbol]])}
:hooks
{:status/chat.commands
{:collectible
{:description "Collectible"
:scope #{:personal-chats :public-chats}
:preview [:preview]
:short-preview [:short-preview]
:on-send [:status/transfer-nft-token]
:parameters [{:id :symbol
:type :text
:placeholder "Collectible symbol"
:suggestions [:status/asset-selector]}
{:id :token
:type :number
:placeholder "Collectible token"
:suggestions [:status/token-selector]}]}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment