Snippet builder#
Pick the cover your users would want, copy the iframe, and paste it into your page. The preview on the right is the real widget served from /embed/quote/.
<iframe src="https://kshot3000.github.io/PlutusShield/embed/quote/?p=exploit&a=250" title="PlutusShield Smart-contract exploit cover quote" width="360" height="440" style="border:0;border-radius:16px;max-width:100%" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"></iframe>
<script>addEventListener("message",function(e){if(!e.data||e.data.type!=="plutusshield:embed:resize")return;document.querySelectorAll('iframe[src*="/embed/quote/"]').forEach(function(f){if(f.contentWindow===e.source)f.style.height=Math.ceil(e.data.height)+"px"})});</script>URL params#
Every setting is a query param on https://kshot3000.github.io/PlutusShield/embed/quote/. Defaults are left out of the snippet. A bad value never breaks the widget: it falls back to the default (a term outside the product's range is clamped into it) and the widget lists what it ignored.
| Param | Values | Default |
|---|---|---|
p | depeg or exploit (SLA cover has no live pool, so it is refused) | depeg |
c | ADA or USDC: the tranche that prices and would pay the policy | ADA |
a | Cover amount, above 0 and at most 1,000,000; the pool's 10% single-policy and 90% utilization caps still apply | 100 |
d | Term in days: 14–365 for depeg, 30–365 for exploit | 90 |
t | dark or light | dark |
ref | Your partner tag (a-z, 0-9, dashes, up to 32), shown as “via ref” and carried into the plan label | none |
The widget's button opens /plan in a new tab with the same cover encoded as a plan share link, so the user lands on a priced plan with a Buy link for each policy.
Auto-size#
The widget posts its content height to the parent page as a plutusshield:embed:resize message whenever it changes. The optional script in the builder sets each PlutusShield iframe's height from that message and only trusts messages from the iframe they claim to size.
{ "type": "plutusshield:embed:resize", "height": 412 }From the SDK#
Build the same snippet, or price the widget's cover yourself, from TypeScript:
import { embedSnippet, embedQuote, decodeEmbedConfig } from "@plutusshield/sdk";
const cfg = { product: "exploit", currency: "USDC", amount: 250, days: 90, theme: "light", ref: "my-dex" } as const;
const html = embedSnippet(cfg, { siteRoot: "https://kshot3000.github.io/PlutusShield" });
// Same quote() as /cover; planQuery rebuilds the cover on /plan.
const { quote, planQuery } = embedQuote(cfg, { capital: 2_000, activeCover: 50 });What it never does#
- It never connects or asks for a wallet, and never builds or signs a transaction. Buying happens on PlutusShield, from the user's own CIP-30 wallet.
- It reads no cookies or storage from your page, and the snippet sends only your origin as the referrer.
- Prices come from the Preview pool snapshot baked into each site build, the same one /plan uses, so a live quote on /cover can differ slightly if the pool moved since.