1.0.33 • Published 2 years ago

@gum-protocol/react-sdk v1.0.33

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
2 years ago

Gum React SDK

Installation

yarn add @gum-protocol/react-sdk

Documentation

For more detailed documentation, please visit the Gum documentation.

Usage

The useGum hook provides the Gum SDK instance and the useCreateUser hook provides a function to create a new user.

import { useGum, useCreateUser } from "@gum-protocol/react-sdk";
import { AnchorWallet, useAnchorWallet } from "@solana/wallet-adapter-react";
import { Connection, PublicKey } from "@solana/web3.js";
import { useMemo } from "react";

const App = () => {
  const anchorWallet = useAnchorWallet() as AnchorWallet;
  const connection = useMemo(
    () => new Connection("https://api.devnet.solana.com", "confirmed"),
    []
  );
  const sdk = useGum(
    anchorWallet,
    connection,
    { preflightCommitment: "confirmed" },
    "devnet"
  );

  const { create, error, loading } = useCreateUser(sdk!);

  return (
    <button
      onClick={() => {
        create(anchorWallet?.publicKey as PublicKey);
      }}
    >
      Create User
    </button>
  );
};

export default App;

Example App

Check out the example app that uses the react-sdk to demonstrate its capabilities. The app is a simple React app that showcases the creation of a user, profile, and post.

Contributing

We welcome contributions to improve the SDK. Please raise an issue or submit a pull request with any suggestions or bug fixes.

License

The Gum SDK is licensed under the GNU General Public License v3.0.

Support

Join our Discord community at https://discord.gg/tCswbSK5W2 for any questions or support.

1.0.22

2 years ago

1.0.21

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago