🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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
Version published
Maintainers
0
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