Skip to content

Instantly share code, notes, and snippets.

@andytudhope
Forked from janherich/extension.edn
Created October 19, 2018 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andytudhope/365885c732a42e440466d5bc09c6873d to your computer and use it in GitHub Desktop.
Save andytudhope/365885c732a42e440466d5bc09c6873d to your computer and use it in GitHub Desktop.
{meta {:name "Test"
: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 (query [:get-collectible-token symbol token])]
[view {:flex-direction :column
:align-items :flex-start}
[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]]
[send-status tx-hash outgoing]]))
views/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/commands.collectible
{:description "Collectible"
:scope #{:personal-chats :public-chats}
:preview @views/preview
:short-preview @views/short-preview
:on-send transfer-nft-token
:parameters [{:id :symbol
:type :text
:placeholder "Collectible symbol"
:suggestions asset-selector}
{:id :token
:type :number
:placeholder "Collectible token"
:suggestions token-selector}]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment