repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import type { BillingPack } from "../types"; |
| #2 | |
| #3 | export interface PaymentQuote { |
| #4 | amountUsd: number; |
| #5 | token: "USDC" | "CLAWD"; |
| #6 | rail: "pay.sh" | "clawd-commerce"; |
| #7 | status: "ready" | "insufficient"; |
| #8 | cta: string; |
| #9 | helper: string; |
| #10 | } |
| #11 | |
| #12 | export function toPaymentQuote(pack: BillingPack): PaymentQuote { |
| #13 | const rail = pack.token === "USDC" ? "pay.sh" : "clawd-commerce"; |
| #14 | const helper = |
| #15 | pack.token === "USDC" |
| #16 | ? "USDC packages settle instantly over existing x402/pay.sh rails." |
| #17 | : "$CLAWD packages use the CLAWD token commerce adapter and can mirror the same credit purchase flow."; |
| #18 | |
| #19 | return { |
| #20 | amountUsd: pack.amountUsd, |
| #21 | token: pack.token, |
| #22 | rail, |
| #23 | status: pack.state === "insufficient" ? "insufficient" : "ready", |
| #24 | cta: |
| #25 | pack.state === "insufficient" |
| #26 | ? `Insufficient ${pack.token}` |
| #27 | : `Buy $${pack.amountUsd} with ${pack.token}`, |
| #28 | helper, |
| #29 | }; |
| #30 | } |
| #31 |