pai
    Preparing search index...

    Function buyWithCard

    • Buys credit by card: asks Phantom AI for a Stripe checkout page (requestCardPayment), prints the card total and the link on stderr, opens the link in the browser, and waits for the payment (waitForPayment). It tops up the key pai runs as, or with new (or no key set) buys a new key and saves it as the login key or by the save name. The purchase and status calls need no key, so a new-key buy sends an empty one. A person has to pay on the page, so agent wallets never take this path.

      Parameters

      • env: Env
      • io: { stderr: (s: string) => void }
      • opts: {
            amount_usd: number;
            baseUrl?: string;
            new?: boolean;
            open?: (url: string) => boolean;
            save?: string | true;
            sleep?: (ms: number) => Promise<void>;
        }

      Returns Promise<CardBuyResult>