Kima Network Documentation
  • What is Kima?
  • Supported blockchains
  • Supported tokens
  • Supported fiat currencies and payment methods
  • Adding Kima to your wallet
  • Try Kima with the Demo App
    • The Kima Light Demo App
    • The Kima Advanced Demo App
    • Kima Faucets
    • Kima Block Explorer
  • Become a Kima validator
    • Hardware and operating system requirements
    • Installation
    • Appendix
  • Become a Kima delegator
    • Benefits
    • How does it work?
    • Preparations
    • Delegate
    • Reclaim delegation
  • Become a liquidity provider
    • Benefits
    • Supported blockchains
    • Prepare to provide liquidity
    • Deposit assets in Kima pools
    • Withdraw liquidity
  • Kima governance
    • Draft a proposal
    • On-chain proposal
    • Off-chain proposal
    • References
  • The Kima SDK
    • Kima Use Cases for Developers
    • The Kima Transaction Back End
    • The Kima Transaction Widget
      • Installation
      • React
      • NextJS
      • Payment Mode
      • Bridge Mode
      • Status Mode
      • Configuration Options
    • Upgrading
      • v1.4.x
    • Using the Kima SDK Without the Widget
      • Approval
      • Submitting the Transaction
      • Getting the Transaction Status
  • Further reading
  • Legal
    • Terms and conditions
    • Privacy policy
    • Disclaimer
  • FAQ
Powered by GitBook
On this page
Export as PDF
  1. The Kima SDK
  2. The Kima Transaction Widget

Payment Mode

PreviousNextJSNextBridge Mode

Last updated 12 days ago

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 transactionOption prop (required)

  • The user can choose to pay from any and supported by Kima. The funds will be transferred to the wallet and chain specified in the transactionOption prop

  • The title and subtile can be customized using the titleOption and paymentTitleOption props

⚠️ On testnet, transactionOption.currency must be USDK as this is the only currency supported on testnet. You will need to switch the currency based on whether your app is currently using testnet or mainnet.

import React from "react";

import {
  KimaTransactionWidget,
  KimaProvider,
  ModeOptions,
  SupportNetworks,
  ColorModeOptions,
} from "@kimafinance/kima-transaction-widget";
import "@kimafinance/kima-transaction-widget/dist/index.css";

const App = () => {
  return (
    <KimaProvider kimaBackendUrl="http://localhost:3001">
      <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: SupportNetworks.SOLANA,
          targetAddress: "5tvyUUqPMWVGaVsRXHoQWqGw6h9uifM45BHCTQgzwSdr",
          amount: 12.34,
          currency: "USDK",
        }}
      />
    </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 approves the transfer amount.

Once the user sends the approval 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 .

chain
token
Widget Status Mode Section