Payment Mode
mode = ModeOptions.payment
Payment mode allows your users to pay for a product or service using stablecoins from any chain supported by Kima.
The payment details are passed into the Widget via the
transactionOptionprop (required)The title and subtitle can be customized using the
titleOptionandpaymentTitleOptionprops
⚠️
transactionOption.currencymust be a token symbol that is currently supported by Kima for the selected environment (mainnetortestnet) and selected chain. Resolve supported symbols dynamically from/chainsin your backend. ℹ️ The example below usesUSDC, which is valid on mainnet for Solana. If you are testing on Sardis, replace it with a supported testnet token such asUSDK.
import React from "react";
import {
KimaTransactionWidget,
KimaProvider,
ModeOptions,
ChainName,
ColorModeOptions,
} from "@kimafinance/kima-transaction-widget";
import "@kimafinance/kima-transaction-widget/index.css";
const App = () => {
return (
<KimaProvider
projectId='your-project-id'
kimaBackendUrl="http://localhost:4000"
>
<KimaTransactionWidget
theme={{ colorMode: ColorModeOptions.light }}
mode={ModeOptions.payment}
titleOption={{
initialTitle: "New Purchase",
}}
paymentTitleOption={{
title: "Buy MyFirst NFT",
style: {
fontSize: "1.2em",
fontWeight: "500",
color: "#DDDDDD",
},
}}
transactionOption={{
targetChain: ChainName.SOLANA,
targetAddress: "5tvyUUqPMWVGaVsRXHoQWqGw6h9uifM45BHCTQgzwSdr",
amount: 12.34,
currency: "USDC",
}}
/>
</KimaProvider>
);
};
export default App;You should see a page that looks like this:

The payment (target) wallet and chain will show on the next step when the user completes the authorization for the transfer amount.

Once the user completes the authorization step and submits the transaction, the user can see the transaction status in the next step.

For more details on how to get transaction status of a previous transaction, check the Widget Status Mode Section.
Last updated