Canonical SDK for BNBPay + x402Flex.
- Single package:
npm i @pepay/x402flex - Works with
bnbpay-apiout of the box (apimode) - Supports direct contract execution (
contractsmode) - Supports combined rollout (
hybridmode) - Includes endpoint and buyer wrappers (
createResourceServer,wrapFetchWithPayment,wrapAxiosWithPayment)
import { createClient } from '@pepay/x402flex';
const sdk = createClient({
mode: 'hybrid',
preset: 'bnbpay-testnets',
api: { baseUrl: 'https://api.bnbpay.org' },
contracts: { defaultNetwork: 'eip155:97' },
});@pepay/x402flex/core@pepay/x402flex/evm@pepay/x402flex/api@pepay/x402flex/fetch@pepay/x402flex/axios@pepay/x402flex/express
api: typed client forbnbpay-api.contracts: direct RPC + contract interactions.hybrid: API-first with contract fallback for compatible operations.
preset: 'bnbpay-testnets' preloads:
- supported testnet chain IDs and public RPC defaults
- current working BNB testnet contracts from
bnbpay-api
Runtime config overrides preset values.
Licensed under the MIT License.
Copyright (c) 2025-2026 Pepay Labs, Inc.