@ampvaleo/x402-hyperliquid-client
v0.1.0
Published
Sign and fetch helpers for x402 on Hyperliquid HyperCore
Downloads
79
Readme
@ampvaleo/x402-hyperliquid-client
Sign sendAsset payments and perform automatic x402 retries via x402Fetch.
import { x402Fetch } from "@ampvaleo/x402-hyperliquid-client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const wallet = {
getAddress: async () => account.address,
signTypedData: (a) => account.signTypedData(a),
};
const res = await x402Fetch("https://api.example.com/paid", {}, wallet);Optional ethers v6 Signer helper: createEthersWallet(signer).
See the root README.
