Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nftx/react

Package Overview
Dependencies
Maintainers
0
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nftx/react

This package contains utils for nftx.js that are specific to the React ecosystem. It is not included in the main nftx.js package.

  • 4.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
102
increased by500%
Maintainers
0
Weekly downloads
 
Created
Source

@nftx/react

This package contains utils for nftx.js that are specific to the React ecosystem. It is not included in the main nftx.js package.

NftxProvider

const provider = createPublicClient();
const signer = createWalletClient();

return (
  <NftxProvider network={1} provider={provider} signer={signer}>
    <App />
  </NftxProvider>
);

useNftx

useNftx will return the provider-based details for you to use throughout your react application.

const { network, provider, signer } = useNftx();

const onSubmit = () => {
  increaseLiquidity({
    ...params,
    network,
    provider,
    signer,
  });
};

useTransaction

This is similar to react-query's useMutation and wagmi's useTransaction hooks. It takes a function that then returns an nftx.js-compatible transaction object.

const [
  write,
  {
    status,
    error,
    data: { transaction, receipt },
  },
] = useTransaction((args) => {
  return increaseLiquidity(args);
});

FAQs

Package last updated on 18 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc