Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head>
    <meta charset="utf-8" />
    <title>Get Solana Account Info</title>
    <script src="./app.js"></script>
</head>

<body>
  <div id='form'>
    <h2>Try Our Code - Instantly Get All Solana Account Info</h2>
    <label for="address"></label>
    <input type="text" id="address" placeholder="Enter Solana address" value="ChkH4bTk7c5NSGbxvXx89yY2oU7rFJsr3Cq1gPNCCPVe"/>
    <button id="get">Get Account Info</button>
  </div>
  <div id="result"></div>
</body>
</html>
              
            
!

CSS

              
                body {
  font-family: Poppins, sans-serif;
  background-color: white;
  font-size: 20px;
  color: #1C1E4F;
  text-align: left;
  padding: 0px 20px
}

input[type="text"] {
  width: 30%;
  padding: 13px 10px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid #e4e4e4;
  margin-bottom: 10px;
}

#get {
   font-family: Poppins, sans-serif;
  padding: 10px 20px;
  font-size: 18px;
  border-radius: 5px;
  border: 1px solid transparent;
  background-color: #4237ff;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

#get:hover {
  background-color: white;
  color: #4237ff;
  border-color: #4237ff;
}

#result {
  margin-top: 10px;
  font-size: 14px;
  text-align: left;
}


              
            
!

JS

              
                import { TatumSDK, Network } from "https://cdn.skypack.dev/@tatumio/tatum";

const button = document.getElementById("get");
const addressInput = document.getElementById('address');
const resultContainer = document.getElementById('result');

button.addEventListener("click", async () => {
  const tatum = await TatumSDK.init({ network: Network.SOLANA });
  const address = addressInput.value;
  
  // Get Solana account info
  const result = await tatum.rpc.getAccountInfo(address);
  console.log("account info", result);

  // Display the result
  resultContainer.innerHTML = `
    <p>Address: ${address}</p>
    <pre>Account Info: ${JSON.stringify(result.result, null, 2)}</pre>
  `;
});
              
            
!
999px

Console