Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


Save Automatically?

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.


                ### Interaction

<form action="">
  <input name="type" type="hidden" value="payment">
    <select name="network">
      <option value="test">Testnet</option>
      <option value="public">Public</option>
    <input name="memo" type="text" placeholder="28 characters max" required>
    <input name="destination" type="text" placeholder="Public key or federated address" required>
    <input name="amount" type="number" min="0" required>

    <input id="submit" type="submit" value="Submit">

### Description

This pen shows how to leverage the CosmicLink format to pass a transfer request from a simple HTML form.

### Keypoints

- Because it doesn't need any library, this pen is the lightest transfer form ever made!
- The HTML form builds a CosmicLink query that is passed to the website.
- CosmicLink queries syntax has been derived from `js-stellar-sdk` operations syntax.
- It is possible to create multi-operation transactions using the syntax `?type=transaction&{...metaFields|txFields}&operation={type1}&{...op1Parameters}...&operation={typeN}&{...opNParameters}`
- By leveraging the multi-operation syntax and hidden inputs, it is possible to create advanced transaction templates.

### Challenges

- **Easy/** Transform the HTML form into a donation form, that let the user send any amount to an address of your choice.
- **Hard/** Edit the form into one that let the user open a trustline for a selection of assets.

_Give it a try by editing the code, and be the first to post a solution on GalacticTalk!_

### Documentation

- <a href="" target="_blank">CosmicQueries cheatsheet</a>
- <a href="" target="_blank">StellarSdk Operations specification</a>

### Social

- [Discuss that pen on GalacticTalk](