@coinflowlabs/react-native

中文文档
4.21.2发布于 2026/09/25Apache-2.0TypeScriptCommonJS近 30 天下载 11.3万

React Native Component for Coinflow

原始使用文档
文档目录61 节
  1. Withdraw Usage
  2. Purchase Usage
  3. 4.20.0
  4. 4.18.0
  5. New CoinflowApplePayButton component
  6. 4.17.0
  7. 4.15.0
  8. 4.14.0
  9. 4.13.0
  10. 4.12.0
  11. 4.11.0
  12. 4.10.0
  13. 4.9.2
  14. 4.9.1
  15. 4.8.1
  16. 4.8.0
  17. 4.7.0
  18. 4.6.0
  19. 4.5.2
  20. 4.5.1
  21. 4.5.0
  22. 4.4.2
  23. 4.4.1
  24. 4.4.0
  25. 4.3.1
  26. 4.3.0
  27. 4.1.6
  28. 4.1.0
  29. 4.0.6
  30. 4.0.5
  31. 4.0.4
  32. 4.0.3
  33. 4.0.2
  34. 4.0.1
  35. 4.0.0
  36. 3.4.2
  37. 3.4.1
  38. 3.4.0
  39. 3.2.1
  40. 3.2.0
  41. 3.1.5
  42. 3.1.4
  43. 3.1.0
  44. 3.0.0
  45. 2.1.13
  46. 2.1.12
  47. 2.1.11
  48. 2.1.10
  49. 2.1.9
  50. 2.1.7
  51. 2.1.6
  52. 2.1.5
  53. 2.1.2
  54. 2.1.0
  55. 2.0.0
  56. 1.3.1
  57. 1.3.0
  58. 1.2.4
  59. 1.2.3
  60. 1.2.2
  61. 0.1.3

Coinflow React Native

Withdraw Usage

import {useWallet} from '@solana/wallet-adapter-react';
const wallet = useWallet();
const connection = useConnection();

<CoinflowWithdraw wallet={wallet} merchantId='<YOUR MERCHANT ID>' env='prod|sandbox|staging' connection={connection} />;

Props:

  • wallet: The Solana Wallet Adapter Wallet
  • merchantId: Your Merchant ID (Contact Coinflow support for this)
  • connection: Solana Connection
  • env (optional): This defaults to prod
    • For testing set to staging
  • onSuccess (optional): function to run when the withdrawal process is successful
  • lockAmount (optional): Whether to let the user select the amount to withdraw or to disable the input
  • amount (optional): The amount to withdraw - required if lockAmount=true
  • tokens (optional): Define a list to filter the available tokens
  • lockDefaultToken (optional): Only allow the default token to be used
  • email (optional): Set the default email to be used in entry fields
  • bankAccountLinkRedirect (optional): The URL to be used for bank account setup
  • additionalWallets (optional): Define additional wallets to assign to the user
  • usePermit (optional): Pass as false to disable permit message signing for EVM and use approve transactions
  • transactionSigner (optional): Public Key of the wallet which will actually execute the withdrawal transaction. Must be associated with the same withdrawer as the main wallet.

Purchase Usage

import {useWallet} from '@solana/wallet-adapter-react';
const wallet = useWallet();
const connection = useConnection();

<CoinflowPurchase wallet={wallet} merchantId='<YOUR MERCHANT ID>' env='prod|sandbox|staging' connection={connection} />;

Props:

  • subtotal (optional): Fix the amount of purchase
  • wallet: The Solana Wallet Adapter Wallet
  • merchantId: Your Merchant ID (Contact Coinflow support for this)
  • connection: Solana Connection
  • env (optional): This defaults to prod
    • For testing set to staging
  • onSuccess (optional): function to run when the purchase process is successful
  • transaction (optional): transaction for the user to run which redeems their credits with your smart contract. Create this transaction just like you would for a normal user who has USDC in their account.
  • debugTx (optional): Setting this to true will sign the transaction with the wallet, and send the transaction with no preflight checks allowing for easier debug of any issues.
  • planCode (optional): When a subscription is being purchased, the code of the subscription plan.
  • settlementType (optional): The settlement method to use for the proceeds of a purchase. (Credits, USDC, or Bank)
  • webhookInfo (optional): Product or transaction based information that you want transmitted when you receive webhooks regarding the purchase
  • email (optional): Set the default email to use in email entry fields
  • chargebackProtectionData (optional):
  • customerInfo (optional): Additional information about the customer
  • allowedPaymentMethods (optional): The payment methods displayed on the UI. If omitted, all available payment methods will be displayed.
  • rent (optional, Solana only): Specify the blockchain rent amount to add to the total
  • nativeSolToConvert (optional, Solana only): Specify the amount of native SOL to convert wSOL for the purchase
  • jwtToken (optional): A JWT token which encodes verified checkout parameters to prevent spoofing of arguments.
  • supportEmail (optional): Your business support email address to use for support inquiries
  • zeroAuthorization (optional): Pass in true if you wish to perform a zero authorization card transaction

Changelog

4.20.0

  • Added loading states to the CoinflowCardForm, CoinflowCardNumberInput, CoinflowCvvOnlyInput components

4.18.0

New CoinflowApplePayButton component

A standalone Apple Pay button that renders only the hosted Apple Pay button (not the full checkout) in a WebView.

  • Accepts color (white | black) plus onApprove ({paymentId} on completion), onError, and onLoad callbacks
  • Note: Apple Pay only works on a real iOS device — it will not run in the simulator

4.17.0

  • New CoinflowPayPalButton component — a standalone PayPal button that renders only the hosted PayPal button (not the full checkout) in a WebView
  • Accepts a PayPal email, phoneNumber, or saved token to create the order; the identifier updates live without reloading the button
  • Added onApprove ({paymentId} on completion) and onError callbacks; the button is always tappable and surfaces a clear error when no identifier is provided
  • Added overlayInsets ({top?, bottom?}) so the PayPal approval overlay fills only the content region (top safe area down to the tab bar) and keeps the button anchored in place while open

4.15.0

  • Added cardBackground to MerchantTheme to control the inner card-entry surface independently of the outer canvas background
  • Added placeholderColor to MerchantTheme to control placeholder text color in card form inputs
  • Fixed the card brand icon being hidden when the card form reflows to a stacked two-row layout at narrow widths

4.14.0

  • Fixed an issue with vertical spacing when resizing the page

4.13.0

  • Added userLocation property to CoinflowPurchase and CoinflowWithdraw for merchants who choose to use Geolocation checks

4.12.0

  • New CoinflowCardForm, CoinflowCardNumberForm, and CoinflowCvvForm components — simple card inputs with a single tokenize() call and theme support
  • Added theme options for fontSize and placeholder text

4.11.0

  • Added unified protection initialization helper and headers helper
  • Test zipcode 00001 triggers fraud protection rejection

4.10.0

  • Added support for CashApp redirection

4.9.2

  • Fixed typing for sessionKey being not present when passing the wallet object

4.9.1

  • Added support for overriding the default account type (from merchant settings) used for chargeback protection via chargebackProtectionAccountType in the URL parameters.

4.8.1

  • Added support for custom pay-in fees via customPayInFees in the JWT token or URL parameters. This allows merchants to add custom fee line items (fixed or percentage-based) that are displayed during checkout.

4.8.0

  • New Blockchain Support: The SDK now supports Stellar, a fast and low-cost blockchain for payments. Pass blockchain='stellar' to enable Stellar payment processing.

4.7.0

  • Added zeroAuthorizationConfig prop to CoinflowPurchase for controlling zero authorization behavior (show/hide saved payment methods, verify a specific card by token). Deprecates isZeroAuthorization boolean prop.

4.6.0

  • New Blockchain Support: The SDK now supports Monad, a high-performance EVM-compatible blockchain. Pass blockchain='monad' to enable Monad payment processing.

4.5.2

  • [Bug Fix] Fixes an issue on some earlier versions of expo: Requiring unknown module "undefined".

4.5.1

  • Improve the logic to handle linking users out to the browser so that it is future proofed and consistent in the future.
  • Internal change to a query parameter name for zero authorization

4.5.0

  • Added zeroAuthorization parameter to allow zero authorization card transactions

4.4.2

  • Added email as a field for customerInfo

4.4.1

  • Added redemptionCheck to purchase (Solana only)

4.4.0

  • Added allowedWithdrawSpeeds query parameter to allow merchants to specify what withdraw speeds are allowed. The default is all.

4.3.1

  • Added more chargebackProtectionData product types

4.3.0

  • Added partialUsdcChecked property to pre-check partial USDC payment checkbox

4.1.6

  • Support wallet connect deep links

4.1.0

  • Added Multi-Currency Presentment via the presentment property

4.0.6

  • Improving Withdraw With Session Keys

4.0.5

  • Fixing onAuthDeclined callback

4.0.4

  • Added seller prop to chargebackProtectionData

4.0.3

  • Added 3DS Challenge Handling to the standalone Google Pay button

4.0.2

  • Added allowedPaymentMethods to CoinflowPurchase
  • Options are:
    • 'card' = Credit and debit cards
    • 'ach' = ACH bank account transfers
    • 'fasterPayments' = UK Faster Payments (GBP Bank Transfers)
    • 'sepa' = SEPA bank account transfers (EUR Bank Transfers)
    • 'pix' = Pix bank account transfers (BRL Bank Transfers)
    • 'usdc' = USDC
    • 'googlePay' = Google Pay
    • 'applePay' = Apple Pay
    • 'credits' = Credits

4.0.1

  • Fix for iframe from here: Can't open URL about:srcdoc on IOS react-native-webview/react-native-webview#2567 (comment)
  • Allow for inspection in safari from here: Feature/webview debugging enabled prop react-native-webview/react-native-webview#2937
  • Fixing the use of session keys in react native SDK

4.0.0

  • Deprecating amount and token in favor of subtotal which can be accessed via the following ways:
  • Added multi-currency support for presentment
  • SEPA and UK Faster Payments support
{
  cents: number;
  currency: 'USD' | 'EUR' | 'GBP' | 'BRL';
}

or

{
  address: string;
  amount: number;
}

3.4.2

  • Extended redirect blacklist for CoinflowWebView

3.4.1

  • Added sessionKey authentication mechanism to CoinflowWithdraw

3.4.0

  • Added sessionKey authentication mechanism to CoinflowPurchase

3.2.1

  • CoinflowPurchaseV2 component added for a modernized purchase flow

3.2.0

  • Added arbitrum blockchain support

3.1.5

  • Allow custom taker on reservoir transactions

3.1.4

  • Fix redirect bug on checkout component

3.1.0

  • Added base blockchain support
  • Added AuthOnly parameter to CoinflowPurchase

3.0.0

  • Require signMessage on wallets for stronger withdraw authentication

2.1.13

  • Added new ChargebackProtectionData productTypes

2.1.12

  • Added waitForHash to EvmTransactionData

2.1.11

  • Added theme props to Coinflow components for easy color control

2.1.10

  • Added orderId option for reservoir items

2.1.9

  • Added nativeSolToConvert for Solana transactions

2.1.7

  • Settlement type param for settlement control

2.1.6

  • Customer info param for added reporting capabilities

2.1.5

  • Added disableGooglePay and disableApplePay props to CoinflowPurchase

2.1.2

  • Bug fix for enhanced usage with Google Pay

2.1.0

  • Added support for EVM NFT purchases

2.0.0

Breaking Changes

  • This is enabled to true by default. If you are using a wallet that does not support versioned transactions, you must set supportsVersionedTransactions in CoinflowWithdraw to false.

1.3.1

  • Added new property lockDefaultToken which locks the withdrawal option to the users default currency (USDC or EUROe)

1.3.0

  • Added support for paying solana rent for a transaction

1.2.8

  • Fix external linking for Coinflow URLs

1.2.7

  • Fix external linking for specified URLs

1.2.6

  • Added deviceId and chargebackProtectionData to CoinflowPurchase

1.2.5

  • Fixing Webhook Info

1.2.3

  • getFeePayer - Return the PublicKey of the Coinflow Fee Payer

Changelog

1.2.4

  • Added token prop for CoinflowPurchase with polygon

1.2.3

  • Fixing nSure redirect error

1.2.2

  • Added Withdraw and Purchase history components

0.1.3

  • Added the ability to sign transactions instead of sign messages

0.1.0

Genesis 1:1

版本与发布记录

@coinflowlabs/react-native 共发布 114 个版本,首次发布于 2022/12/08;过去 12 个月发布了 30 个版本。

版本发布日期距今
4.21.2latest2026/09/251 个月前
4.21.12026/09/231 个月前
4.21.02026/08/202 个月前
4.20.22026/08/122 个月前
4.20.12026/07/303 个月前
4.20.02026/07/213 个月前

其他发布通道:snapshot → 4.13.0-SNAPSHOT.4。

关于 @coinflowlabs/react-native 的常见问题

@coinflowlabs/react-native 是什么?

React Native Component for Coinflow

如何安装 @coinflowlabs/react-native?

在项目目录运行 npm install @coinflowlabs/react-native,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16)、react-native(>=0.66.0)、react-native-webview(>=11.16.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@coinflowlabs/react-native 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@coinflowlabs/react-native 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@coinflowlabs/react-native 可以商用吗?

@coinflowlabs/react-native 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@coinflowlabs/react-native 的下载量有多少?

根据 npm 官方下载统计,@coinflowlabs/react-native 在 2026/10/11 – 2026/11/09 这 30 天内被下载 113,183 次,日均约 3,773 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@coinflowlabs/react-native 还在维护吗?

最新版本 4.21.2 发布于 2026/09/25(1 个月前);至今共发布 114 个版本,其中过去 12 个月发布了 30 个;首次发布于 2022/12/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。