0.0.2 • Published 1 year ago

onyxpay v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Onyxfi-pay

Onyxfi-pay is a React component that provides payment functionality for your application. It allows you to make payments instantly, schedule payments for later, make payments via EMI, and set up recurring payments.

Installation

You can install Onyxfi-pay using npm:

npm install onyxfi-pay

Usage

To use Onyxfi-pay, import the component into your React application and add it to your component tree. You will also need to import the useAccount, useContract, useProvider, and useSigner hooks from the wagmi library. Here's an example:

import React from "react";
import { useAccount, useContract, useProvider, useSigner } from "wagmi";
import OnyxfiPay from "onyxfi-pay";

function MyComponent() {
  const { address, isConnected } = useAccount();
  const provider = useProvider();
  const { data: signer } = useSigner();

  const Payments_Contract = useContract({
    address: "0x123456789...",
    abi: [ /* contract ABI */ ],
    signerOrProvider: signer || provider,
  });
return (
    <div>
      <OnyxfiPay
        paymentsContract={Payments_Contract}
        sender={address}
      />
    </div>
  );
}

Props

Onyxfi-pay takes the following props:

  • paymentsContract: The address and ABI of the payments contract that you want to interact with.
  • sender: The address of the sender.
  • className: An optional CSS class to apply to the component.

Contributing

If you find a bug or would like to suggest a new feature, please open an issue on the GitHub repository. Pull requests are also welcome!

License

Onyxfi-pay is licensed under the MIT License. See the LICENSE file for more information.

Publishing to npm

To publish your Onyxfi-pay package to npm, follow these steps:

  1. Make sure you have an account on npm. If you don't, you can create one by running npm adduser in your terminal and following the prompts.

  2. Update the version number in your package.json file. You can do this manually or by running npm version <new version>.

  3. Build your package by running npm run build.

  4. Publish your package by running npm publish. This will upload your package to the npm registry and make it available for others to use.

  5. Verify that your package was published successfully by visiting its page on the npm website.

Congratulations, you have now published your Onyxfi-pay package to npm!

Conclusion

Onyxfi-pay is a powerful payment component that can help you add payment functionality to your React application quickly and easily. By following the steps outlined in this README, you can publish your Onyxfi-pay package to npm and share it with the world.

If you have any questions or encounter any issues along the way, don't hesitate to reach out to the community for help. Good luck!