Skip to content

useProvider

Introduction

This hook is used to provide the Aptos client interface in React Hooks style.

See @aptos-labs/ts-sdk package on npm for more information.

import React from 'react';
import { useProvider } from '@razorlabs/razorkit';
function YourComponent() {
  const rpcUrl = 'https://mainnet.movementnetwork.xyz/v1';
  const provider = useProvider(rpcUrl);
 
  return <>...</>;
}

Using the Aptos interface

If you use the Aptos client interface provided by useProvider, you can call the rpc methods in a more convenient way from your react app: