</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L499</p><h4id="pendingnonceat"><ahref="#pendingnonceat"class="anchor-heading"aria-labelledby="pendingnonceat"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> PendingNonceAt </h4><p><codeclass="language-plaintext highlighter-rouge">PendingNonceAt</code> returns the account nonce of the given account in the pending state. This is the nonce that should be used for the next transaction.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L440</p><h4id="suggestgasprice"><ahref="#suggestgasprice"class="anchor-heading"aria-labelledby="suggestgasprice"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> SuggestGasPrice </h4><p><codeclass="language-plaintext highlighter-rouge">SuggestGasPrice</code> retrieves the currently suggested gas price to allow a timely execution of a transaction.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L487</p><h4id="sendtransaction"><ahref="#sendtransaction"class="anchor-heading"aria-labelledby="sendtransaction"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> SendTransaction </h4><p><codeclass="language-plaintext highlighter-rouge">SendTransaction</code> injects a signed transaction into the pending pool for execution.</p><p>If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L512</p><h3id="fetching-balance"><ahref="#fetching-balance"class="anchor-heading"aria-labelledby="fetching-balance"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Fetching balance </h3><p>A Status node fetches the current and historical [ECR20] (https://eips.ethereum.org/EIPS/eip-20) and ETH balance for the user wallet address. Collectibles following the <ahref="https://eips.ethereum.org/EIPS/eip-721">ECR-721</a> are also fetched if enabled.</p><p>A Status node supports by default the following <ahref="https://github.com/status-im/status-react/blob/develop/src/status_im/ethereum/tokens.cljs">tokens</a>. Custom tokens can be added by specifying the <codeclass="language-plaintext highlighter-rouge">address</code>, <codeclass="language-plaintext highlighter-rouge">symbol</code> and <codeclass="language-plaintext highlighter-rouge">decimals</code>.</p><h4id="blockbyhash"><ahref="#blockbyhash"class="anchor-heading"aria-labelledby="blockbyhash"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> BlockByHash </h4><p><codeclass="language-plaintext highlighter-rouge">BlockByHash</code> returns the given full block.</p><p>It is used by status to fetch a given block which will then be inspected for transfers to the user address, both tokens and ETH.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L78</p><h4id="blockbynumber"><ahref="#blockbynumber"class="anchor-heading"aria-labelledby="blockbynumber"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> BlockByNumber </h4><p><codeclass="language-plaintext highlighter-rouge">BlockByNumber</code> returns a block from the current canonical chain. If number is nil, the latest known block is returned.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L82</p><h4id="filterlogs"><ahref="#filterlogs"class="anchor-heading"aria-labelledby="filterlogs"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> FilterLogs </h4><p><codeclass="language-plaintext highlighter-rouge">FilterLogs</code> executes a filter query.</p><p>Status uses this function to filter out logs, using the hash of the block and the address of interest, both inbound and outbound.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L377</p><h4id="nonceat"><ahref="#nonceat"class="anchor-heading"aria-labelledby="nonceat"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> NonceAt </h4><p><codeclass="language-plaintext highlighter-rouge">NonceAt</code> returns the account nonce of the given account.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L366</p><h4id="transactionbyhash"><ahref="#transactionbyhash"class="anchor-heading"aria-labelledby="transactionbyhash"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> TransactionByHash </h4><p><codeclass="language-plaintext highlighter-rouge">TransactionByHash</code> returns the transaction with the given hash, used to inspect those transactions made/received by the user.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L202</p><h4id="headerbynumber"><ahref="#headerbynumber"class="anchor-heading"aria-labelledby="headerbynumber"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> HeaderByNumber </h4><p><codeclass="language-plaintext highlighter-rouge">HeaderByNumber</code> returns a block header from the current canonical chain.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L172</p><h4id="transactionreceipt"><ahref="#transactionreceipt"class="anchor-heading"aria-labelledby="transactionreceipt"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> TransactionReceipt </h4><p><codeclass="language-plaintext highlighter-rouge">TransactionReceipt</code> returns the receipt of a transaction by transaction hash. It is used in status to check if a token transfer was made to the user address.</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
</code></pre></div></div><p>https://github.com/ethereum/go-ethereum/blob/26d271dfbba1367326dec38068f9df828d462c61/ethclient/ethclient.go#L270</p><h2id="ens"><ahref="#ens"class="anchor-heading"aria-labelledby="ens"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> ENS </h2><p>All the interactions with <codeclass="language-plaintext highlighter-rouge">ENS</code> are made through the <ahref="https://github.com/ensdomains/ens">ENS contract</a></p><p>For the <codeclass="language-plaintext highlighter-rouge">stateofus.eth</code> username, one can be registered through these <ahref="https://github.com/status-im/ens-usernames">contracts</a></p><h3id="registering-releasing-and-updating"><ahref="#registering-releasing-and-updating"class="anchor-heading"aria-labelledby="registering-releasing-and-updating"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Registering, releasing and updating </h3><ul><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L113">Registering a username</a></li><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L131">Releasing a username</a></li><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L174">Updating a username</a></li></ul><h3id="slashing"><ahref="#slashing"class="anchor-heading"aria-labelledby="slashing"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Slashing </h3><p>Usernames MUST be in a specific format, otherwise they MAY be slashed:</p><ul><li>They MUST only contain alphanumeric characters</li><li>They MUST NOT be in the form <codeclass="language-plaintext highlighter-rouge">0x[0-9a-f]{5}.*</code> and have more than 12 characters</li><li>They MUST NOT be in the <ahref="https://github.com/status-im/ens-usernames/blob/47c4c6c2058be0d80b7d678e611e166659414a3b/config/ens-usernames/reservedNames.js">reserved list</a></li><li><p>They MUST NOT be too short, this is dynamically set in the contract and can be checked against the <ahref="https://github.com/status-im/ens-usernames/blob/master/contracts/registry/UsernameRegistrar.sol#L26">contract</a></p></li><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L237">Slash a reserved username</a></li><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L261">Slash an invalid username</a></li><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L215">Slash a username too similar to an address</a></li><li><ahref="https://github.com/status-im/ens-usernames/blob/77d9394d21a5b6213902473b7a16d62a41d9cd09/contracts/registry/UsernameRegistrar.sol#L200">Slash a username that is too short</a></li></ul><p>ENS names are propagated through <codeclass="language-plaintext highlighter-rouge">ChatMessage</code> and <codeclass="language-plaintext highlighter-rouge">ContactUpdate</code><ahref="./6-payloads.md">payload</a>. A client SHOULD verify ens names against the public key of the sender on receiving the message against the <ahref="https://github.com/ensdomains/ens">ENS contract</a></p><h2id="copyright"><ahref="#copyright"class="anchor-heading"aria-labelledby="copyright"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Copyright </h2><p>Copyright and related rights waived via <ahref="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>.</p></div></div><divclass="search-overlay"></div></div></body></html>