eigerco / nebula

A soroban contract library
https://nebula.eiger.co
Apache License 2.0
7 stars 2 forks source link

Make the nebula wizard embed-able #113

Open geofmureithi opened 9 months ago

geofmureithi commented 9 months ago

Describe the solution you'd like I would want to be able to pragmatically embed a contract. This would generate the usual invoke and similar commands.

Consider such an example:

<script src="path/to/embedded.js"/>
<div id="container"></div>
<script>
  let nebula = new NebulaEmbed({
       pulsarUrl: "some/path",
       contract: "some/git/path"
  });
  nebula.bind("container");
</script>

A Remix button can be included to redirect to the pulsar IDE.

Additional context We can borrow more context from other similar embed-able wizards.

geofmureithi commented 9 months ago

How would this work?

geofmureithi commented 9 months ago

An alternative to the code syntax above:

<script 
    src="path/to/embed.js" 
    data-pulsar-url="/path" 
    data-contract-url="some-git-path" 
    data-bind-to="#container"
/>

References: https://stackoverflow.com/questions/49626885/embedding-reactjs-in-remote-site-iframe https://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t