<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raven Rebels on Medium]]></title>
        <description><![CDATA[Stories by Raven Rebels on Medium]]></description>
        <link>https://medium.com/@ravenrebels?source=rss-595216d6edac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jXx01qehJSzBs24EJqkGkw.jpeg</url>
            <title>Stories by Raven Rebels on Medium</title>
            <link>https://medium.com/@ravenrebels?source=rss-595216d6edac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:38:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ravenrebels/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ravencoin as a service]]></title>
            <link>https://medium.com/@ravenrebels/ravencoin-as-a-service-786418d75a17?source=rss-595216d6edac------2</link>
            <guid isPermaLink="false">https://medium.com/p/786418d75a17</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ravencoin]]></category>
            <dc:creator><![CDATA[Raven Rebels]]></dc:creator>
            <pubDate>Thu, 14 Dec 2023 21:43:01 GMT</pubDate>
            <atom:updated>2023-12-14T21:50:36.764Z</atom:updated>
            <content:encoded><![CDATA[<p>As a developer, if you want to get things done on Ravencoin, you can jumpstart your project by using the online Remote Procedure Call (RPC) service from ting.finance. It’s permissionless, requires no sign-up, and is totally anonymous.</p><p>This means that you can interact with Ravencoin in just a few lines of code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*X3VrQCexYYoJvqFCRIWV1g.png" /></figure><h3>How do I get started?</h3><p>Go to <a href="https://rpc.ting.finance/">https://rpc.ting.finance/</a> where you can select either mainnet or testnet. Make your choice and copy the endpoint URL.</p><p>This simple CURL script fetch the current block count.</p><pre>curl -d &quot;{\&quot;method\&quot;:\&quot;getblockcount\&quot;,\&quot;params\&quot;:[]}&quot; -H &quot;Content-Type: application/json&quot; -X POST https://rvn-rpc-mainnet.ting.finance/rpc</pre><p>Output {“result”:3104801}</p><h3>More sophisticated example code</h3><p>Let’s check the balance of all burn addresses on Ravencoin using JavaScript and Python. Learn more about burn addresses in this Medium article by Tron Black:<br><a href="https://tronblack.medium.com/ravencoin-burn-rvn-burn-4be59c777aeb">https://tronblack.medium.com/ravencoin-burn-rvn-burn-4be59c777aeb</a></p><h3>JavaScript example</h3><p>This example uses ES modules, so run the code in a file called index.mjs .</p><ol><li>Create an empty directory</li><li>run npm init -y</li><li>run npm install axios</li><li>Create the file index.mjs (extension is important)</li></ol><pre>import axios from &quot;axios&quot;;<br><br>const burnAddresses = [<br>  &quot;RXissueAssetXXXXXXXXXXXXXXXXXhhZGt&quot;,<br>  &quot;RXReissueAssetXXXXXXXXXXXXXXVEFAWu&quot;,<br>  &quot;RXissueSubAssetXXXXXXXXXXXXXWcwhwL&quot;,<br>  &quot;RXissueUniqueAssetXXXXXXXXXXWEAe58&quot;,<br>  &quot;RXBurnXXXXXXXXXXXXXXXXXXXXXXWUo9FV&quot;,<br>];<br><br>const params = [{ addresses: burnAddresses }];<br><br>const addressBalance = await rpc(&quot;getaddressbalance&quot;, params);<br>const total = addressBalance.balance / 1e8; //convert from satoshis to ful Ravencoins<br>console.log(total.toLocaleString());<br><br>async function rpc(method, params) {<br>  const axiosResponse = await axios.post(<br>    &quot;https://rvn-rpc-mainnet.ting.finance/rpc&quot;,<br>    { method, params }<br>  );<br>  const rpcResponse = axiosResponse.data; //<br>  return rpcResponse.result;<br>}</pre><p>Run the script node index.mjs , outputs 16 898 915.435</p><h3>Python example</h3><p>Create a .py file and run it, like python scrip.py .</p><pre>import requests<br>import json<br><br># URL<br>url = &#39;https://rvn-rpc-mainnet.ting.finance/rpc&#39;<br><br># Data payload<br>payload = { <br>    &quot;method&quot;: &quot;getaddressbalance&quot;,<br>    &quot;params&quot;: [{&quot;addresses&quot;: [<br>        &quot;RXissueAssetXXXXXXXXXXXXXXXXXhhZGt&quot;,<br>        &quot;RXReissueAssetXXXXXXXXXXXXXXVEFAWu&quot;,<br>        &quot;RXissueSubAssetXXXXXXXXXXXXXWcwhwL&quot;,<br>        &quot;RXissueUniqueAssetXXXXXXXXXXWEAe58&quot;,<br>        &quot;RXBurnXXXXXXXXXXXXXXXXXXXXXXWUo9FV&quot;<br>    ]}]<br>}<br><br># Headers<br>headers = {&#39;Content-Type&#39;: &#39;application/json&#39;}<br><br># Send POST request<br>response = requests.post(url, headers=headers, data=json.dumps(payload))<br><br># Parse response as JSON<br>json_response = response.json()<br><br># Extract and print the balance from the result<br># note split by 1e8 to convert from satoshis to Ravencoins<br> <br>balance = json_response[&#39;result&#39;][&#39;balance&#39;] / 1e8<br>formatted_balance = &quot;{:,}&quot;.format(balance)<br>print(&quot;Balance:&quot;, formatted_balance)</pre><h3>Setting up Your Raven Core Node and RPC Proxy</h3><ol><li>Start by running your own Raven core node or nodes. Make sure to activate all available indexes. You can find configuration information at: <a href="https://github.com/ravenrebels/ravencoin-rpc-proxy">https://github.com/ravenrebels/ravencoin-rpc-proxy</a></li><li>Download the necessary files from the official Ravencoin wallet at: <a href="https://ravencoin.org/wallet/">https://ravencoin.org/wallet/</a></li><li>Configure an RPC proxy to allow whitelisted remote procedure calls (RPCs) only. This setup also adds caching and queueing for enhanced performance and security. Detailed instructions can be found at: <a href="https://github.com/ravenrebels/ravencoin-rpc-proxy">https://github.com/ravenrebels/ravencoin-rpc-proxy</a></li><li>Setting up Cloudflare Tunnel — Zero Trust App Connector<br>The Cloudflare Tunnel daemon creates an encrypted tunnel between your origin web server and the nearest Cloudflare data center, all without exposing any public inbound ports. This ensures both security and speed for your network. <br>For a comprehensive tutorial on how to get started with Cloudflare Tunnel, watch this informative video: <a href="https://www.youtube.com/watch?v=Q5dG8g4-Sx0">Getting Started Tutorial</a>.”</li></ol><h3>Did you know?</h3><p>Our service, Ting.finance, is named after the TING (or ‘THING’).<br>A “thing” in Old Norse and Germanic societies was an assembly of free men that convened to reach <strong>consensus </strong>on important matters, such as laws and disputes. The word is still used in Scandinavia, like Folketing in Denmark, Storting in Norway and Tingsrätt in Sweden.<br>Learn more about it here <a href="https://en.wikipedia.org/wiki/Thing_(assembly)">https://en.wikipedia.org/wiki/Thing_(assembly)</a></p><h3>Thanks</h3><p>Thanks for reading, you find more stuff on <a href="https://www.ravenrebels.com/">https://www.ravenrebels.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=786418d75a17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ravencoin Mempool Guide: Predicting Transaction Confirmations]]></title>
            <link>https://medium.com/@ravenrebels/ravencoin-mempool-guide-predicting-transaction-confirmations-49581dcdada7?source=rss-595216d6edac------2</link>
            <guid isPermaLink="false">https://medium.com/p/49581dcdada7</guid>
            <category><![CDATA[ravencoin]]></category>
            <dc:creator><![CDATA[Raven Rebels]]></dc:creator>
            <pubDate>Wed, 13 Dec 2023 22:05:08 GMT</pubDate>
            <atom:updated>2023-12-14T18:42:34.081Z</atom:updated>
            <content:encoded><![CDATA[<p>When it comes to accepting payments using Ravencoin (RVN), you have two options: you can choose to only accept confirmed transactions on the blockchain, or you may consider accepting both confirmed transactions and certain mempool transactions.</p><p>Opting for confirmed transactions provides a high level of trust and security, as these transactions are already a part of the blockchain. However, the downside is that it can take a minute or two for a transaction to be confirmed, which might not be ideal for applications requiring instant access or services that demand a super-snappy user experience.</p><p>In situations where you want user interactions to be brutally fast, such as allowing visitors to pay a small fee, say 10 RVN, to instantly unlock and read an online article, mempool transactions become essential.</p><p>In this article, we’ll show you two straightforward checks to ensure your mempool transactions are trustworthy and reliable, so you can provide that super-snappy user experience.</p><ol><li><strong>No Dependencies on Other Mempool Transactions</strong>: It’s crucial that a transaction doesn’t depend on other unconfirmed transactions. You can easily check this with the getmempoolentry remote procedure call, reviewing the “depends” attribute. If the “depends” attribute is empty, it means the transaction isn’t relying on any other unconfirmed transactions, making it more reliable.</li><li><strong>Verify the Transaction Fee:</strong> Verify the transaction fee to ensure it’s reasonable and likely to be accepted by a miner. You can compare the transaction fee with the estimated fee from the estimatesmartfee RPC call.</li></ol><p>Thanks for taking your time to read this, hope you liked it. Anything you want to add? Please drop a comment.</p><p>Checkout our website for Ravencoin tools and services.<br><a href="https://www.ravenrebels.com/">https://www.ravenrebels.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49581dcdada7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extreme Speed Micro Payments with Ravencoin: A JavaScript Developer’s Toolkit]]></title>
            <link>https://medium.com/@ravenrebels/extreme-speed-micro-payments-with-ravencoin-a-javascript-developers-toolkit-f6533a302438?source=rss-595216d6edac------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6533a302438</guid>
            <category><![CDATA[ravencoin]]></category>
            <category><![CDATA[micropayments]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Raven Rebels]]></dc:creator>
            <pubDate>Sat, 09 Dec 2023 19:07:47 GMT</pubDate>
            <atom:updated>2023-12-14T19:07:45.846Z</atom:updated>
            <content:encoded><![CDATA[<p>As a JavaScript developer, you may be curious about how to integrate Ravencoin to enable <strong>instant</strong> micro payments on your website. This article offers a straightforward and practical guide to help you through this process.</p><figure><img alt="Ravencoin bird driving a boat at extreme speed" src="https://cdn-images-1.medium.com/max/960/1*-7zcsXmzDNStMEQ5duWWDg.png" /></figure><p>Consider a scenario where your website includes a section accessible only to paying visitors. This system operates on a permissionless basis: no need for subscriptions, accounts, or memberships. It’s designed to enable a direct and simple transaction, embodying a true ‘value for value’ voluntary exchange.</p><p>You can find all the code for this demonstration on GitHub: <a href="https://github.com/ravenrebels/micro-payments-demo">Raven Rebels Micro Payments Demo</a>.</p><p>In summary, here’s what we’ll cover:</p><ol><li>Building a website using Express and Node.js.</li><li>Implement middleware to assign a unique Ravencoin address to each visitor.</li><li>Implementing middleware to verify if the visitor has made a payment.</li><li>Implement middleware to restrict access to the ‘/restricted’ area for non-paying visitors.</li><li>Once payment is confirmed, granting access to the ‘/restricted’ area by setting an accessGranted attribute in the user&#39;s session.&quot;</li></ol><p>That is, content located behind the path /restricted can only be consumed by paying visistors.</p><p>We will use NPM package @ ravenrebels/ravencoin-rpc to make RPC calls.<br>We will use NPM package @ ravenrebels/ravencoin-key to generates addresses</p><h3>The web app</h3><p>File index.js</p><ul><li>Setup a Express app and enable HTTP session management.</li><li>Use middleware to monitor whether a user has paid.</li><li>Use middleware to block access to the /restricted area of our site for non-paying visitors.</li><li>Configure Express to serve static content from the ‘static’ folder, which includes items like HTML documents and CSS files.</li><li>Add two /api endpoints: one to fetch user session information and another to handle sign-out</li></ul><p>Your <strong>index.js</strong> file will look like this</p><pre>import express from &quot;express&quot;;<br>import { verifyPayment } from &quot;./verifyPayment.js&quot;;<br>import { setupSession } from &quot;./setupSession.js&quot;;<br>import config from &quot;./config.js&quot;;<br>export const network = &quot;rvn-test&quot;;<br><br>export const app = express();<br><br>setupSession(app);<br><br>app.use(verifyPayment);<br>//Only allow access to restricted area if access is granted<br>app.use(&quot;/restricted&quot;, (request, response, next) =&gt; {<br>  if (request.session.accessGranted === true) {<br>    return next();<br>  }<br>  return response.redirect(&quot;/&quot;);<br>});<br><br>app.use(express.static(&quot;static&quot;));<br><br>app.get(&quot;/api/session&quot;, (request, response) =&gt; {<br>  return response.send({<br>    address: request.session.address,<br>    accessGranted: request.session.accessGranted,<br>    network: config.network,<br>  });<br>});<br><br>app.get(&quot;/api/signout&quot;, (request, response) =&gt; {<br>  const callback = (err) =&gt; response.redirect(&quot;/&quot;);<br>  request.session.destroy(callback);<br>});<br><br>const PORT = config.port;<br>app.listen(PORT, () =&gt; {<br>  console.log(`Server is running on port ${PORT}`);<br>});<br><br>process.on(&quot;unhandledRejection&quot;, (reason, promise) =&gt; {<br>  console.error(&quot;Unhandled Rejection:&quot;, reason);<br>  // Handle the rejection here<br>});<br><br>process.on(&quot;uncaughtException&quot;, (error) =&gt; {<br>  console.error(&quot;Uncaught Exception:&quot;, error);<br>  // Handle the exception here<br>  process.exit(1); // It is often recommended to restart the process in case of an uncaught exception<br>});</pre><h3>Setup Ravencoin wallet/address</h3><p>File setupRavencoinAddress.js</p><p>We use the library @ ravenrebels/ravencoin-key to generate a unique address. We do not just get the address; we also receive the mnemonic key, WIF, and more. We write the wallet information to disk in a JSON file. Although not part of this article, there would typically be another script that sweeps the funds from all wallets on a regular basis.</p><pre>import RavencoinKey from &quot;@ravenrebels/ravencoin-key&quot;;<br>import fs from &quot;fs&quot;;<br>import config from &quot;./config.js&quot;;<br><br>export function setupRavencoinAddress(request) {<br>  //This gives us a random address with properties like mnemonic/WIF<br>  const generatedAddress = RavencoinKey.generateAddressObject(config.network);<br>  // Storing the address and mnemonic in the session for later use<br>  request.session.address = generatedAddress.address;<br>  request.session.mnemonic = generatedAddress.mnemonic;<br><br>  // Checking if the &#39;wallets&#39; directory exists, if not, creating it<br>  if (fs.existsSync(&quot;wallets&quot;) === false) {<br>    fs.mkdirSync(&quot;wallets&quot;);<br>  }<br><br>  const fileName = &quot;wallets/&quot; + generatedAddress.address + &quot;.json&quot;;<br>  const json = JSON.stringify(generatedAddress);<br>  fs.writeFileSync(fileName, json);<br>}</pre><h3>Verify Payment</h3><p>File verifyPayment.js</p><pre>import { setupRavencoinAddress } from &quot;./setupRavencoinAddress.js&quot;;<br>import { getReceived } from &quot;./getReceived.js&quot;;<br>import config from &quot;./config.js&quot;;<br>//Middeware, setup Ravencoin address and check balance<br>export async function verifyPayment(request, response, next) {<br>  //Create address if needed<br>  if (!request.session.address) {<br>    setupRavencoinAddress(request);<br>  }<br>  if (request.session.accessGranted === true) {<br>    return next();<br>  }<br><br>  //Check balance on chain and in mempool<br>  let received = await getReceived(request.session.address);<br>  let amount = config.accessPrice;<br>  request.session.accessGranted = received &gt;= amount;<br><br>  return next();<br>}</pre><h3>Monitor received funds</h3><p>File getReceived.js</p><p>We monitor the amount of RVN received by each visitor’s address, not balance. This approach is necessary because the balance may not be accurate if funds have been moved to a central wallet.</p><p>We also check the mempool for pending transactions to enable quick payments. While these transactions need miner confirmation and must be added to the blockchain, they are usually processed without issue. However, we filter out those mempool transactions that rely on other unconfirmed transactions.<br>Learn more about how to validate mempool transaction <a href="https://medium.com/@ravenrebels/ravencoin-mempool-guide-predicting-transaction-confirmations-49581dcdada7">here </a>.</p><p>Our goal is to make the user experience silky smooth and snappy, without the delay of blockchain confirmation. There’s a small chance that some shadowy super coder might get access without paying through a special coding trick, but that’s a minor risk. We mainly want to get as many paying visitors as possible and make their experience as good as it can be.</p><pre>import { getRPC } from &quot;@ravenrebels/ravencoin-rpc&quot;;<br>import config from &quot;./config.js&quot;;<br><br>//Support both Ravencoin testnet and mainnet<br>const URLs = {<br>  rvn: &quot;https://rvn-rpc-mainnet.ting.finance/rpc&quot;,<br>  &quot;rvn-test&quot;: &quot;https://rvn-rpc-testnet.ting.finance/rpc&quot;,<br>};<br>const URL = URLs[config.network];<br>const rpc = getRPC(&quot;anonymous&quot;, &quot;anonymous&quot;, URL);<br><br>export async function getReceived(address) {<br>  const params = [<br>    {<br>      addresses: [address],<br>    },<br>  ];<br>  //Get balance on chain<br>  const b = await rpc(&quot;getaddressbalance&quot;, params);<br><br>  //Get mempool balance for instant payments,<br>  //less secure since mempool transaction has not yet been confirmed<br>  //Ignore transactions with &quot;Replace-By-Fee&quot; enabled<br>  const mempool = await rpc(&quot;getaddressmempool&quot;, params);<br>  let received = b.received;<br>  for (const item of mempool) {<br>    try {<br>      const mempoolEntry = await rpc(&quot;getmempoolentry&quot;, [item.txid]);<br>      //Do not trust mempool entries that are dependent on other mempool entries.<br>      if (mempoolEntry.depends.length &gt; 0) {<br>        continue;<br>      }<br>      if (item.assetName === &quot;RVN&quot; &amp;&amp; item.satoshis &gt; 0) {<br>        received += item.satoshis;<br>      }<br>    } catch (e) {}<br>  }<br>  // Convert received from satoshis to Ravencoin: divide by 100 million since 1 ravencoin = 100 million satoshis<br>  if (received &gt; 0) {<br>    return received / 100000000;<br>  }<br>  return received;<br>}</pre><h3>Thank You &amp; Next Steps</h3><p>Try out the web app yourself by cloning the GitHub repo, links below. It’s configured to run on the Ravencoin testnet out of the box, but you can change the network settings in ./config.js. If you need RVN on the testnet, use the playground at <a href="https://testnet.ting.finance/">https://testnet.ting.finance</a> to send yourself some coins.</p><p>Thanks for reading, see you in the next article.</p><h3>Links and Acknowledgments</h3><p>The image of the Ravencoin bird driving a boat at extreme speed is sourced from PixaBay and has been modified by Twitter user @Humble_Miner<br><a href="https://pixabay.com/photos/powerboat-speed-speedboat-fast-2784250/">https://pixabay.com/photos/powerboat-speed-speedboat-fast-2784250/</a></p><p>Github repo<br><a href="https://github.com/ravenrebels/micro-payments-demo">https://github.com/ravenrebels/micro-payments-demo</a></p><p>RPC library<br><a href="https://www.npmjs.com/package/@ravenrebels/ravencoin-rpc">https://www.npmjs.com/package/@ravenrebels/ravencoin-rpc</a></p><p>Ravencoin key/address library<a href="https://www.npmjs.com/package/@ravenrebels/ravencoin-key"><br>https://www.npmjs.com/package/@ravenrebels/ravencoin-key</a></p><p>Permissionless RPC-service for Ravencoin<br><a href="https://rpc.ting.finance/">https://rpc.ting.finance/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6533a302438" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Dive Into Blockchain: A Beginner’s Guide to Mastering Ravencoin with JavaScript]]></title>
            <link>https://medium.com/@ravenrebels/dive-into-blockchain-a-beginners-guide-to-mastering-ravencoin-with-javascript-65a3be2f864c?source=rss-595216d6edac------2</link>
            <guid isPermaLink="false">https://medium.com/p/65a3be2f864c</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ravencoin]]></category>
            <dc:creator><![CDATA[Raven Rebels]]></dc:creator>
            <pubDate>Sun, 03 Dec 2023 12:46:51 GMT</pubDate>
            <atom:updated>2023-12-03T13:36:10.141Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn how to interact on the Ravencoin blockchain in less than 10 minutes using JavaScript and Node.js</p><p><strong>What is Ravencoin</strong></p><p>Ravencoin is a blockchain and platform optimized for transferring assets, such as tokens, from one holder to another. <br>The beauty of Ravencoin lies in its simplicity.</p><figure><img alt="Ravencoin and coffee" src="https://cdn-images-1.medium.com/max/1024/1*5ydWHinjOuHKptA-NJ0_aA.jpeg" /></figure><h3>Ravencoins simplicity, Brilliant Basics</h3><p>On other chains you create smart contracts to mint tokens, but not on Ravencoin. Ravencoin has native support for tokens, no programming skills needed aka “No code”.</p><p>To create a token you can use the “official” Raven core QT wallet or an online service such as Mango Farm Assets.<br><a href="https://ravencoin.org/wallet/">https://ravencoin.org/wallet/</a><br><a href="https://mangofarmassets.com/">https://mangofarmassets.com/</a></p><h3>Let’s build stuff, Magic Moments</h3><p>It’s up to us, the software developers, to create the magic moments.</p><p>We can automate processes and respond to changes on the blockchain by building bots that interact with it.</p><p>In this article, we will utilize a JavaScript wallet npm package. Right out of the box, this package leverages the publicly available Web API for Ravencoin (RPC), accessible at <a href="https://rpc.ting.finance/">https://rpc.ting.finance/</a>.</p><h3>Step 1: create a JavaScript project</h3><p>Before you start, you need to have Node.js installed, you can install it from <a href="https://nodejs.org/en">https://nodejs.org/en</a></p><p>Create a new directory, init a new project and install Raven Rebels JavaScript wallet for Ravencoin.</p><pre>mkdir ravenbegin <br>cd ravenbegin<br>npm init -y<br>npm install @ravenrebels/ravencoin-jswallet</pre><p>Now you have the foundation for your project.</p><h3>Step 2: Create wallet</h3><p>Go to https://ravencoin.org/bip44/ and generate a BIP39 Mnemonic.<br>For example</p><p><em>web very possible fury evolve bottom casual because express tackle jump display</em></p><p>These 12 words are for demonstration purposes only and you should generate their own.</p><h3>Step 3: setup your JavaScript wallet</h3><p>In your new project, create a file called index.mjs note that it ends with <strong>mjs </strong>which stands for Modular JavaScript.</p><pre>import Wallet from &quot;@ravenrebels/ravencoin-jswallet&quot;;<br><br>const mnemonic =<br>  &quot;web very possible fury evolve bottom casual because express tackle jump display&quot;;<br><br>//or use &quot;rvn&quot; for mainnet,<br>const network = &quot;rvn-test&quot;;<br>const wallet = await Wallet.createInstance({<br>  mnemonic,<br>  network,<br>});<br><br>const receiveAddress = await wallet.getReceiveAddress();<br>const balance = await wallet.getBalance();<br>const assets = await wallet.getAssets();<br>const mempool = await wallet.getMempool();<br><br>console.info(&quot;My address is:&quot;, receiveAddress);<br>console.log(&quot;Balance&quot;, balance);<br>console.log(&quot;Assets&quot;, assets);<br>console.log(&quot;Mempool&quot;, mempool);</pre><h3>Faucet</h3><p>It’s time to send some RVN and tokens to our new wallet.</p><p><strong>Run the script</strong>: Start by running the script with the command node index.mjs. The script will output the receiving address; make sure to copy it.</p><p><strong>Navigate to the Testnet Site</strong>: Next, go to <a href="https://testnet.ting.finance/">https://testnet.ting.finance/</a>. This site serves as a playground for the Ravencoin testnet and features predefined wallets. It also gives you the option to create new wallets by simply entering a name.</p><p><strong>Sending RVN and Tokens</strong>: Finally, access one of the predefined wallets on the site. Use it to send some RVN and tokens to the receiving address you obtained from running your script.</p><h3>Read the balance</h3><p>I have sent a Berry token and some RVN to the receiving address, which results in the following output when I run the script again:</p><pre>My address is: mvQshpZjuLrYDQXGG56BnZu8mA9y4RLqtU<br>Balance 100<br>Assets [<br>  {<br>    assetName: &#39;BARRY&#39;,<br>    balance: 100000000,<br>    received: 100000000,<br>    value: 1<br>  },<br>  {<br>    assetName: &#39;RVN&#39;,<br>    balance: 10000000000,<br>    received: 10000000000,<br>    value: 100<br>  }<br>]<br>Mempool []</pre><h3>Send tokens/Assets</h3><p>Let’s create a new script, send.mjs that sends the Barry token.</p><pre>import Wallet from &quot;@ravenrebels/ravencoin-jswallet&quot;;<br><br>const mnemonic =<br>  &quot;web very possible fury evolve bottom casual because express tackle jump display&quot;;<br><br>//use &quot;rvn&quot; for mainnet,<br>const network = &quot;rvn-test&quot;;<br>const wallet = await Wallet.createInstance({<br>  mnemonic,<br>  network,<br>});<br><br>//Send to Party Animal account on testnet.ting.finance<br>const result = await wallet.send({<br>  toAddress: &quot;myNG3fSawYiVv4RrjUhYzkiw332TDfQHV7&quot;,<br>  amount: 1,<br>  assetName: &quot;BARRY&quot;<br>});<br><br>console.log(result);</pre><p>The output is</p><pre>node send.mjs<br>{<br>  transactionId: &#39;03f4fa38d4ac0955dd047edb25be240fe879fedd00cd7a88a6db0c2aef574f0d&#39;,<br>  debug: {<br>    amount: 1,<br>    assetName: &#39;BARRY&#39;,<br>    fee: 0.013671875,<br>    inputs: [ [Object], [Object] ],<br>    outputs: {<br>      msLuHrPbRzqmbXPBk8FAzKJNd8Z7t1PbdK: 98.98,<br>      myNG3fSawYiVv4RrjUhYzkiw332TDfQHV7: [Object]<br>    },<br>    privateKeys: {<br>      mjH1rmUa5f2u7eP2dZ9gXmEf4j7kdXWtXm: &#39;cSyoKqnGg1XbjAzhDyHCz43ngd4NN6arb7EfyjvVRrb9RZbJLo6G&#39;,<br>      msLuHrPbRzqmbXPBk8FAzKJNd8Z7t1PbdK: &#39;cV2vBs8qgC48K3AsvWSmWEMsjVjKgNxobHgtcwvYVFYcHDTkWG7M&#39;<br>    },<br>    rawUnsignedTransaction: &#39;020000000285e6cd67c283c41f2feb859516a12c51dc5a5ea2c262aa8f1fed52791a9fcbd50000000000fffffffff73fd4016ad95fa7ee55ab76323b80d1924738b4faa89f14eb1ce1c0111d594b0100000000ffffffff02807ef74d020000001976a91481bad7b55dc163d94a5c2fa86beafd0f3492f62288ac00000000000000002e76a914c3cd56c792b01732c2a13338ea2ae2a047e98ce588acc01272766e7405424152525900e1f505000000007500000000&#39;,<br>    rvnChangeAmount: 98.98,<br>    rvnAmount: 0.013671875,<br>    signedTransaction: &#39;020000000285e6cd67c283c41f2feb859516a12c51dc5a5ea2c262aa8f1fed52791a9fcbd5000000006a473044022012373122b44c6e9add1e6c96770c2d67c1331ab6ea623db38a381432e2c5ee4a022025c385d31d61e16ad4ea6d88506d9b4809cab2e7cb978ea5fdc38da51e12f430012102c700c6c120562f5e5ea2beef83bd11313a1c6d767b7fa423e86f213da6f62d1cfffffffff73fd4016ad95fa7ee55ab76323b80d1924738b4faa89f14eb1ce1c0111d594b010000006b483045022100f369f9b1a60fcea63695f2a5c08f15b4846fbff76527a192700c1ccc35945d5c02202ac7851bf309036974e4792ab7bba908293a38cc7c3e0e8255949893c083ce200121020ff5018d0c3eaeaef28f593b3108949a315e93b9799ec22bbd1952d801808b72ffffffff02807ef74d020000001976a91481bad7b55dc163d94a5c2fa86beafd0f3492f62288ac00000000000000002e76a914c3cd56c792b01732c2a13338ea2ae2a047e98ce588acc01272766e7405424152525900e1f505000000007500000000&#39;,<br>    UTXOs: [ [Object], [Object] ],<br>    walletMempool: [ [Object], [Object] ]<br>  }<br>}</pre><h3><em>Summary</em></h3><p>Now you’ve learned how to:</p><ul><li>Create a new wallet</li><li>Read your wallet’s balance</li><li>Send a token</li></ul><p>Enjoy coding and create your own ‘Magic Moments’!</p><h3>Links</h3><p>Ravencoin Whitepaper<br><a href="https://ravencoin.org/whitepaper/">https://ravencoin.org/whitepaper/</a></p><p>@ravenrebels/ravencoin-jswallet<br><a href="https://www.npmjs.com/package/@ravenrebels/ravencoin-jswallet">https://www.npmjs.com/package/@ravenrebels/ravencoin-jswallet</a></p><p>ravenrebels/ravencoin-jswallet on Github<br><a href="https://github.com/ravenrebels/ravencoin-jswallet">https://github.com/ravenrebels/ravencoin-jswallet</a></p><p>Ravencoin Web API (RPC)<br><a href="https://rpc.ting.finance/">https://rpc.ting.finance/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65a3be2f864c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>