Skip to content

Commit d234b3f

Browse files
committed
Deploying to gh-pages from @ 8ad4f87 🚀
1 parent cd555cf commit d234b3f

39 files changed

Lines changed: 452 additions & 381 deletions

dapp/message-signing/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
const tronweb = tronLink.tronWeb;
44
try {
55
const message = "0x1e"; // any hex string
6-
const signedString = await tronweb.trx.sign(message);
6+
const signedString = await tronweb.trx.signMessageV2(message);
77
} catch (e) {}
88
}
9-
</code></pre> <p><strong>Parameters</strong></p> <p>“tronLink.tronWeb.trx.sign” accepts a hexadecimal string as the parameter. The string represents the content to be signed.</p> <p><strong>Returns</strong></p> <p>If the user chooses to sign in the pop-up window, the DApp will get the signed hexadecimal string. For example:</p> <pre><code class=language-shell> 0xaa302ca153b10dff25b5f00a7e2f603c5916b8f6d78cdaf2122e24cab56ad39a79f60ff3916dde9761baaadea439b567475dde183ee3f8530b4cc76082b29c341c
9+
</code></pre> <p><strong>Parameters</strong></p> <p>“tronLink.tronWeb.trx.signMessageV2” accepts a hexadecimal string as the parameter. The string represents the content to be signed.</p> <p><strong>Returns</strong></p> <p>If the user chooses to sign in the pop-up window, the DApp will get the signed hexadecimal string. For example:</p> <pre><code class=language-shell> 0xb0e0b150b9b10dc348f25c7f38fc87f16e18c0d230d23946aac519a5ad9e45937f656012d33c09e9d9dec00b03fbb304e797f8991bb823dce676ac91e03a55991b
1010
</code></pre> <p>If an error occurs, the following information will be returned:</p> <pre><code class=language-shell>
1111
Uncaught (in promise) Invalid transaction provided
12-
</code></pre> <p><strong>Interaction</strong></p> <p>When “tronweb.trx.sign(message);” is executed, a pop-up window will show in the TronLink wallet asking the user to confirm, as shown below. The message content will be in hex: </p> <p><img alt=image src=../../images/dapp_message-signature_img_0.jpg></p> <p>If the user chooses “Reject” in the pop-up window, an exception will be thrown, which the developer can catch for further processing.</p> <div class=page-nav-below> <hr style="margin: 2rem 0;"> <div class=nav-links> <a href=../multi-sign-transfer/ class="md-footer__link md-footer__link--prev" aria-label="Previous: Multi-Signature Transfer"> <div class="md-footer__button md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg> </div> <div class=md-footer__title> <span class=md-footer__direction> Previous </span> <div class=md-ellipsis> Multi-Signature Transfer </div> </div> </a> <a href=../transfer/ class="md-footer__link md-footer__link--next" aria-label="Next: General Transfer"> <div class=md-footer__title> <span class=md-footer__direction> Next </span> <div class=md-ellipsis> General Transfer </div> </div> <div class="md-footer__button md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg> </div> </a> <div style="clear: both;"></div> </div> </div> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright &copy; 2025 TronLink Team </div> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../..", "features": ["navigation.sections", "navigation.top", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate", "content.tabs.link", "header.autohide", "toc.integrate", "search.highlight", "search.suggest", "content.code.annotate", "content.tooltips"], "search": "../../assets/javascripts/workers/search.f8cc74c7.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script> <script src=../../assets/javascripts/bundle.c8b220af.min.js></script> <script src=../../javascripts/toc.js></script> <script src=../../javascripts/nav-toc.js></script> </body> </html>
12+
</code></pre> <p><strong>Interaction</strong></p> <p>When “tronweb.trx.signMessageV2(message);” is executed, a pop-up window will show in the TronLink wallet asking the user to confirm, as shown below. The message content will be in hex: </p> <p><img alt=image src=../../images/dapp_message-signature_img_0.jpg></p> <p>If the user chooses “Reject” in the pop-up window, an exception will be thrown, which the developer can catch for further processing.</p> <div class=page-nav-below> <hr style="margin: 2rem 0;"> <div class=nav-links> <a href=../multi-sign-transfer/ class="md-footer__link md-footer__link--prev" aria-label="Previous: Multi-Signature Transfer"> <div class="md-footer__button md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg> </div> <div class=md-footer__title> <span class=md-footer__direction> Previous </span> <div class=md-ellipsis> Multi-Signature Transfer </div> </div> </a> <a href=../transfer/ class="md-footer__link md-footer__link--next" aria-label="Next: General Transfer"> <div class=md-footer__title> <span class=md-footer__direction> Next </span> <div class=md-ellipsis> General Transfer </div> </div> <div class="md-footer__button md-icon"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg> </div> </a> <div style="clear: both;"></div> </div> </div> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> Copyright &copy; 2025 TronLink Team </div> Made with <a href=https://squidfunk.github.io/mkdocs-material/ target=_blank rel=noopener> Material for MkDocs </a> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../..", "features": ["navigation.sections", "navigation.top", "search.suggest", "search.highlight", "content.code.copy", "content.code.annotate", "content.tabs.link", "header.autohide", "toc.integrate", "search.highlight", "search.suggest", "content.code.annotate", "content.tooltips"], "search": "../../assets/javascripts/workers/search.f8cc74c7.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script> <script src=../../assets/javascripts/bundle.c8b220af.min.js></script> <script src=../../javascripts/toc.js></script> <script src=../../javascripts/nav-toc.js></script> </body> </html>

images/plugin-wallet_acceptWeb.jpg

122 KB
Loading

images/plugin-wallet_add_trc10.jpg

67 KB
Loading
120 KB
Loading

images/plugin-wallet_add_trc20.jpg

70.3 KB
Loading
79.1 KB
Loading
68.2 KB
Loading
90 KB
Loading
92.5 KB
Loading
114 KB
Loading

0 commit comments

Comments
 (0)