-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 💡 imporove token messaging doc
- Loading branch information
Showing
1 changed file
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
# How to build Secure Messaging between ERC721 NFT owners | ||
|
||
1. Install tokenscript CLI by running command ```npm i -g @tokenscript/cli``` | ||
1. Clone Token Messaging template from the [Template Center](https://github.com/SmartTokenLabs/TokenScript-Templates) | ||
|
||
2. Clone Git repo https://github.com/SmartTokenLabs/TokenScript-Templates - its list of TokenScript Templates | ||
```sh copy | ||
npx degit SmartTokenLabs/TokenScript-Templates/erc-721-messaging erc-721-messaging | ||
``` | ||
|
||
3. Open folder ```/erc-721-messaging``` | ||
2. Open folder `/erc-721-messaging` | ||
|
||
4. Replace Contract Address and chain ID in /tokenscript.xml, example: | ||
3. Replace Contract Address and chain ID in /tokenscript.xml, example: | ||
|
||
``` | ||
<ts:contract interface="erc721" name="Token"> | ||
<ts:address network="80001">0xe84Be2e18304AcF07ba2f11e37EABC321f4DC6Df</ts:address> | ||
</ts:contract> | ||
``` | ||
|
||
5. Run command ```npm i``` to install all dependencies | ||
4. Install TokenScript CLI: | ||
|
||
```sh npm2yarn copy | ||
npm i -g @tokenscript/cli | ||
``` | ||
|
||
5. Run command `npm i` to install all dependencies | ||
|
||
6. Run command ```npm run build``` to build TSML file **out/tokenscript.tsml** | ||
6. Run command `npm run build` to build TSML file **out/tokenscript.tsml** | ||
|
||
7. Run ```tokenscript emulate``` to preview your tokenscript in action | ||
7. Run `tokenscript emulate` to preview your tokenscript in action | ||
|
||
8. If TokenScript works as expected then copy file **out/tokenscript.tsml** to some HTTPS hosting and save file URL | ||
|
||
Now you can use this URL in tokenscript viewer. Don't forget to replace variables with values **chainId** , **contractAddress** and replace **tokenScriptFileURL** with its value, its URL, where TSML file located. | ||
|
||
This is template of TokenScript viewer for your TokenScript file: | ||
|
||
``` | ||
```sh | ||
https://viewer-staging.tokenscript.org/?chain=${chainId}&contract=${contractAddress}&tokenscriptUrl=${encodeURIComponent(tokenScriptFileURL)} | ||
``` | ||
|
||
|
||
|
||
Thats it, ready for messaging. | ||
|