SmartTokenLabs / TokenScript

TokenScript schema, specs and paper
http://tokenscript.org
MIT License
242 stars 71 forks source link

access token cards through TokenNegotation #387

Closed oleggrib closed 4 years ago

oleggrib commented 4 years ago

Crated pop-up overlay to select token (by the way - currenty its a root node in XML file, how can we add multiple tokens to the XML?) created top-rigth floating icon/token box with token added code for active and passive token add

SmartLayer commented 4 years ago

Feedback

message for token not found

Currently, if the user doesn't have a matching token, the user gets:

No Selected Active Tokens for this Account in this Network

It would be great if the message is:

On the current network, no token is found under your address [user-ethereum-address] that matches the criteria objectClass=booky.

If you can, replace the word 'current network' with the name of the current network.

Disconnect/reconnect

Currently, when the page launches, MetaMask will be connected automatically. If you now disconnect MetaMask, metamask will say:

MetaMask is not connected this site. To connect to a web3 site, find the connect button on their site.

At this point, the token list (the container of token card's item-view is listed) should:

The "connect to …" button restarts the negotiation.

Create a test directory

Separate tests related code from generic bootstrap-js library code. Create a directory 'bootstrap-js/tests' where all test-case related code are in. Keep tokenscript-bootstrap.js and everything it needs in the 'bootstrap-js' directory

SmartLayer commented 4 years ago

I'm thinking we may need 3 cases to demonstrate how this works.

  1. a passive negotiation case that included Bokky token's TS. In this case, the <meta name="token. filter"…> do not need to be supplied, since there is only 1 known token and the default filter is ownerAddress=${ownerAddress}

  2. a passive negotiation test case that included EntryToken's TS. In this case, the <meta name="token.filter" can have a value such as expiry<=2020100100 (or any filter that make sense to show the concept of filter, which uses existing attributes defined in EntryToken)

  3. an active negotiation test case that has this:

show tokens in [list] [button]

where [list] is a selection list of "Sydney", "Kiev" and [button] would cause a renegotiation with locality=Sydney or locality=Kiev

(note on the items in [list]: I don't know what is the locality of the entry token James Brown sent to you, so you will just have to make a list that at least allows one of the EntryToken to be found)


Note that in the 3 cases (each can be made into an html file), only the 2nd case uses the filter defined in the meta element, hence, check and fix this bit of code that I introduced (which incorrectly only shows the filter being used if there is one defined in <meta>

https://github.com/AlphaWallet/TokenScript/blob/ec4a16f5386cc152661eb9d7616ace14b34051f9/bootstrap-js/tokenscript-bootstrap.js#L1367