-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
269 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="swaydoc"><meta name="description" content="API documentation for the Sway `caller_addresses` function in `auth`."><meta name="keywords" content="sway, swaylang, sway-lang, caller_addresses"><link rel="icon" href="../../static.files/sway-logo.svg"><title>caller_addresses in auth - Sway</title><link rel="stylesheet" type="text/css" href="../../static.files/normalize.css"><link rel="stylesheet" type="text/css" href="../../static.files/swaydoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../static.files/ayu.css"><link rel="stylesheet" href="../../static.files/ayu.min.css"></head><body class="swaydoc fn"><nav class="sidebar"><a class="sidebar-logo" href="../../std/index.html"><div class="logo-container"><img class="sway-logo" src="../../static.files/sway-logo.svg" alt="logo"></div></a><h2 class="location">Function caller_addresses</h2><div class="sidebar-elems"></div></nav><main><div class="width-limiter"><script src="../../search.js" type="text/javascript"></script><script>function onSearchFormSubmit(event){event.preventDefault();const searchQuery=document.getElementById("search-input").value;const url=new URL(window.location.href);if(searchQuery){url.searchParams.set('search',searchQuery)}else{url.searchParams.delete('search')}history.pushState({search:searchQuery},"",url);window.dispatchEvent(new HashChangeEvent("hashchange"))}document.addEventListener('DOMContentLoaded',()=>{const searchbar=document.getElementById("search-input");const searchForm=document.getElementById("search-form");searchbar.addEventListener("keyup",function(event){onSearchFormSubmit(event)});searchbar.addEventListener("search",function(event){onSearchFormSubmit(event)});function onQueryParamsChange(){const searchParams=new URLSearchParams(window.location.search);const query=searchParams.get("search");const searchSection=document.getElementById('search');const mainSection=document.getElementById('main-content');const searchInput=document.getElementById('search-input');if(query){searchInput.value=query;const results=Object.values(SEARCH_INDEX).flat().filter(item=>{const lowerQuery=query.toLowerCase();return item.name.toLowerCase().includes(lowerQuery)});const header=`<h1>Results for ${query}</h1>`;if(results.length>0){const resultList=results.map(item=>{const formattedName=`<span class="type ${item.type_name}">${item.name}</span>`;const name=[...item.module_info,formattedName].join("::");const path=["../..",...item.module_info,item.html_filename].join("/");const left=`<td><span>${name}</span></td>`;const right=`<td><p>${item.preview}</p></td>`;return`<tr onclick="window.location='${path}';">${left}${right}</tr>`}).join('');searchSection.innerHTML=`${header}<table>${resultList}</table>`}else{searchSection.innerHTML=`${header}<p>No results found.</p>`}searchSection.setAttribute("class","search-results");mainSection.setAttribute("class","content hidden")}else{searchSection.setAttribute("class","search-results hidden");mainSection.setAttribute("class","content")}}window.addEventListener('hashchange',onQueryParamsChange);onQueryParamsChange()})</script><nav class="sub"><form id="search-form" class="search-form" onsubmit="onSearchFormSubmit(event)"><div class="search-container"><input id="search-input" class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Search the docs..." type="search"></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a class="mod" href="../index.html">std</a><span>::</span><a class="mod" href="index.html">auth</a><span>::</span><a class="fn" href="#">caller_addresses</a></span></h1></div><div class="docblock item-decl"><pre class="sway fn"><code>pub fn caller_addresses() -> Vec<Address> </code></pre></div><details class="swaydoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Get the owners of the inputs (of type <code>Input::Coin</code> or <code>Input::Message</code>) to a<br /> | ||
<code>TransactionScript</code>.</p> | ||
<h1>Additional Information</h1> | ||
<p>The list is not deduplicated, so there may be repeated addresses in the returned vector.</p> | ||
<h1>Returns</h1> | ||
<ul> | ||
<li>[Vec<!-- raw HTML omitted -->] - The addresses of the owners of the inputs.</li> | ||
</ul> | ||
<h1>Examples</h1> | ||
<pre><code class="language-sway">use std::auth::caller_addresses; | ||
|
||
fn foo(some_address: Address) { | ||
let addresses = caller_addresses(); | ||
|
||
assert(addresses.get(0).unwrap() == some_address); | ||
} | ||
</code></pre> | ||
</div></details></section><section id="search" class="search-results"></section></div></main><script src="../../static.files/highlight.js"></script><script>hljs.highlightAll();</script></body></html> |
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,5 +1,5 @@ | ||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="swaydoc"><meta name="description" content="API documentation for the Sway `auth` module in `std`."><meta name="keywords" content="sway, swaylang, sway-lang, auth"><link rel="icon" href="../../static.files/sway-logo.svg"><title>auth in std - Sway</title><link rel="stylesheet" type="text/css" href="../../static.files/normalize.css"><link rel="stylesheet" type="text/css" href="../../static.files/swaydoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../static.files/ayu.css"><link rel="stylesheet" href="../../static.files/ayu.min.css"></head><body class="swaydoc mod"><nav class="sidebar"><a class="sidebar-logo" href="../../std/index.html"><div class="logo-container"><img class="sway-logo" src="../../static.files/sway-logo.svg" alt="logo"></div></a><h2 class="location">Module auth</h2><div class="sidebar-elems"><section><h3><a href="#enums">Enums</a></h3><ul class="block method"><li><a href="enum.AuthError.html">AuthError</a></li></ul></section><section><h3><a href="#functions">Functions</a></h3><ul class="block method"><li><a href="fn.caller_is_external.html">caller_is_external</a></li><li><a href="fn.caller_contract_id.html">caller_contract_id</a></li><li><a href="fn.caller_address.html">caller_address</a></li><li><a href="fn.msg_sender.html">msg_sender</a></li><li><a href="fn.predicate_address.html">predicate_address</a></li></ul></section></div></nav><main><div class="width-limiter"><script src="../../search.js" type="text/javascript"></script><script>function onSearchFormSubmit(event){event.preventDefault();const searchQuery=document.getElementById("search-input").value;const url=new URL(window.location.href);if(searchQuery){url.searchParams.set('search',searchQuery)}else{url.searchParams.delete('search')}history.pushState({search:searchQuery},"",url);window.dispatchEvent(new HashChangeEvent("hashchange"))}document.addEventListener('DOMContentLoaded',()=>{const searchbar=document.getElementById("search-input");const searchForm=document.getElementById("search-form");searchbar.addEventListener("keyup",function(event){onSearchFormSubmit(event)});searchbar.addEventListener("search",function(event){onSearchFormSubmit(event)});function onQueryParamsChange(){const searchParams=new URLSearchParams(window.location.search);const query=searchParams.get("search");const searchSection=document.getElementById('search');const mainSection=document.getElementById('main-content');const searchInput=document.getElementById('search-input');if(query){searchInput.value=query;const results=Object.values(SEARCH_INDEX).flat().filter(item=>{const lowerQuery=query.toLowerCase();return item.name.toLowerCase().includes(lowerQuery)});const header=`<h1>Results for ${query}</h1>`;if(results.length>0){const resultList=results.map(item=>{const formattedName=`<span class="type ${item.type_name}">${item.name}</span>`;const name=[...item.module_info,formattedName].join("::");const path=["../..",...item.module_info,item.html_filename].join("/");const left=`<td><span>${name}</span></td>`;const right=`<td><p>${item.preview}</p></td>`;return`<tr onclick="window.location='${path}';">${left}${right}</tr>`}).join('');searchSection.innerHTML=`${header}<table>${resultList}</table>`}else{searchSection.innerHTML=`${header}<p>No results found.</p>`}searchSection.setAttribute("class","search-results");mainSection.setAttribute("class","content hidden")}else{searchSection.setAttribute("class","search-results hidden");mainSection.setAttribute("class","content")}}window.addEventListener('hashchange',onQueryParamsChange);onQueryParamsChange()})</script><nav class="sub"><form id="search-form" class="search-form" onsubmit="onSearchFormSubmit(event)"><div class="search-container"><input id="search-input" class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Search the docs..." type="search"></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a class="mod" href="../index.html">std</a><span>::</span><a class="mod" href="#">auth</a></span></h1></div><details class="swaydoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Functionality for determining who is calling a contract.</p> | ||
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="swaydoc"><meta name="description" content="API documentation for the Sway `auth` module in `std`."><meta name="keywords" content="sway, swaylang, sway-lang, auth"><link rel="icon" href="../../static.files/sway-logo.svg"><title>auth in std - Sway</title><link rel="stylesheet" type="text/css" href="../../static.files/normalize.css"><link rel="stylesheet" type="text/css" href="../../static.files/swaydoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../static.files/ayu.css"><link rel="stylesheet" href="../../static.files/ayu.min.css"></head><body class="swaydoc mod"><nav class="sidebar"><a class="sidebar-logo" href="../../std/index.html"><div class="logo-container"><img class="sway-logo" src="../../static.files/sway-logo.svg" alt="logo"></div></a><h2 class="location">Module auth</h2><div class="sidebar-elems"><section><h3><a href="#enums">Enums</a></h3><ul class="block method"><li><a href="enum.AuthError.html">AuthError</a></li></ul></section><section><h3><a href="#functions">Functions</a></h3><ul class="block method"><li><a href="fn.caller_is_external.html">caller_is_external</a></li><li><a href="fn.caller_contract_id.html">caller_contract_id</a></li><li><a href="fn.caller_address.html">caller_address</a></li><li><a href="fn.msg_sender.html">msg_sender</a></li><li><a href="fn.caller_addresses.html">caller_addresses</a></li><li><a href="fn.predicate_address.html">predicate_address</a></li></ul></section></div></nav><main><div class="width-limiter"><script src="../../search.js" type="text/javascript"></script><script>function onSearchFormSubmit(event){event.preventDefault();const searchQuery=document.getElementById("search-input").value;const url=new URL(window.location.href);if(searchQuery){url.searchParams.set('search',searchQuery)}else{url.searchParams.delete('search')}history.pushState({search:searchQuery},"",url);window.dispatchEvent(new HashChangeEvent("hashchange"))}document.addEventListener('DOMContentLoaded',()=>{const searchbar=document.getElementById("search-input");const searchForm=document.getElementById("search-form");searchbar.addEventListener("keyup",function(event){onSearchFormSubmit(event)});searchbar.addEventListener("search",function(event){onSearchFormSubmit(event)});function onQueryParamsChange(){const searchParams=new URLSearchParams(window.location.search);const query=searchParams.get("search");const searchSection=document.getElementById('search');const mainSection=document.getElementById('main-content');const searchInput=document.getElementById('search-input');if(query){searchInput.value=query;const results=Object.values(SEARCH_INDEX).flat().filter(item=>{const lowerQuery=query.toLowerCase();return item.name.toLowerCase().includes(lowerQuery)});const header=`<h1>Results for ${query}</h1>`;if(results.length>0){const resultList=results.map(item=>{const formattedName=`<span class="type ${item.type_name}">${item.name}</span>`;const name=[...item.module_info,formattedName].join("::");const path=["../..",...item.module_info,item.html_filename].join("/");const left=`<td><span>${name}</span></td>`;const right=`<td><p>${item.preview}</p></td>`;return`<tr onclick="window.location='${path}';">${left}${right}</tr>`}).join('');searchSection.innerHTML=`${header}<table>${resultList}</table>`}else{searchSection.innerHTML=`${header}<p>No results found.</p>`}searchSection.setAttribute("class","search-results");mainSection.setAttribute("class","content hidden")}else{searchSection.setAttribute("class","search-results hidden");mainSection.setAttribute("class","content")}}window.addEventListener('hashchange',onQueryParamsChange);onQueryParamsChange()})</script><nav class="sub"><form id="search-form" class="search-form" onsubmit="onSearchFormSubmit(event)"><div class="search-container"><input id="search-input" class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Search the docs..." type="search"></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a class="mod" href="../index.html">std</a><span>::</span><a class="mod" href="#">auth</a></span></h1></div><details class="swaydoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Functionality for determining who is calling a contract.</p> | ||
</div></details><h2 id="enums">Enums</h2><div class="item-table"><div class="item-row"><div class="item-left Enum-item"><a class="enum" href="enum.AuthError.html">AuthError</a></div><div class="item-right docblock-short"><p>The error type used when an <code>Identity</code> cannot be determined.</p> | ||
</div></div></div><h2 id="functions">Functions</h2><div class="item-table"><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.caller_address.html">caller_address</a></div><div class="item-right docblock-short"><p>Get the owner of the inputs (of type <code>Input::Coin</code> or <code>Input::Message</code>) to a<br /></div></div><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.caller_contract_id.html">caller_contract_id</a></div><div class="item-right docblock-short"><p>If the caller is internal, returns the contract ID of the caller.</p> | ||
</div></div></div><h2 id="functions">Functions</h2><div class="item-table"><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.caller_address.html">caller_address</a></div><div class="item-right docblock-short"><p>Get the owner of the inputs (of type <code>Input::Coin</code> or <code>Input::Message</code>) to a<br /></div></div><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.caller_addresses.html">caller_addresses</a></div><div class="item-right docblock-short"><p>Get the owners of the inputs (of type <code>Input::Coin</code> or <code>Input::Message</code>) to a<br /></div></div><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.caller_contract_id.html">caller_contract_id</a></div><div class="item-right docblock-short"><p>If the caller is internal, returns the contract ID of the caller.</p> | ||
</div></div><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.caller_is_external.html">caller_is_external</a></div><div class="item-right docblock-short"><p>Returns <code>true</code> if the caller is external (i.e. a <code>script</code>).<br /></div></div><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.msg_sender.html">msg_sender</a></div><div class="item-right docblock-short"><p>Get the <code>Identity</code> (i.e. <code>Address</code> or <code>ContractId</code>) from which a call was made.<br /></div></div><div class="item-row"><div class="item-left Function-item"><a class="fn" href="fn.predicate_address.html">predicate_address</a></div><div class="item-right docblock-short"><p>Get the current predicate’s address when called in an internal context.</p> | ||
</div></div></div></section><section id="search" class="search-results"></section></div></main><script src="../../static.files/highlight.js"></script><script>hljs.highlightAll();</script></body></html> |
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
Oops, something went wrong.