npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hashgraphonline/hedera-wallet-connect-sdk

v1.0.2

Published

The official Hashinal Wallet Connect SDK. A set of easy-to-use functions to interact with Hedera through Wallet Connect.

Downloads

6

Readme

Hedera Wallet Connect SDK

This SDK provides a simple interface for interacting with the Hedera Hashgraph using WalletConnect. It allows developers to easily integrate Hedera functionality into inscribed HTML files by injecting the SDK into the window. It is not meant for usage in a traditional non-inscribed dApp.

Features

  • Initialize and connect to WalletConnect
  • Submit messages to Hedera topics
  • Transfer HBAR between accounts
  • Execute smart contracts
  • Create topics and tokens
  • Mint NFTs
  • Fetch account balance and information
  • Retrieve messages from a topic

Usage

The script located in the dist folder can be used directly, but it's primarily intended to be integrated with an inscribed Topic ID via the Recursion SDK.

To use this script, ensure that you reference the current version's Topic ID in your HTML.

<script data-src="hcs://1/0.0.6790163" data-script-id="wallet-connect"></script>

Later in your code, access the SDK.

// Initialize the SDK
await window.HederaWalletConnectSDK.init(projectId, metadata);

// Connect to a wallet
const session = await HederaWalletConnectSDK.connect();

// Use various SDK functions
await HederaWalletConnectSDK.submitMessageToTopic(topicId, message);
await HederaWalletConnectSDK.transferHbar(fromAccountId, toAccountId, amount);
// ... and more

SDK Reference

init(projectId: string, metadata: SignClientTypes.Metadata)

Initializes the SDK with the given project ID and metadata. Ensure you've registered your project using the official WalletConnect website.

connect()

Opens the WalletConnect modal and establishes a connection.

disconnect()

Disconnects from all connected wallets.

submitMessageToTopic(topicId: string, message: string)

Submits a message to the specified Hedera topic.

transferHbar(fromAccountId: string, toAccountId: string, amount: number)

Transfers HBAR between accounts.

executeSmartContract(contractId: string, functionName: string, parameters: ContractFunctionParameters, gas: number = 100000)

Executes a function on a smart contract.

getAccountBalance()

Retrieves the balance of the connected account.

getAccountInfo()

Retrieves information about the connected account.

createTopic(memo?: string, adminKey?: string, submitKey?: string)

Creates a new topic on the Hedera network.

createToken(name: string, symbol: string, initialSupply: number, decimals: number, treasuryAccountId: string, adminKey: string, supplyKey: string)

Creates a new token on the Hedera network.

mintNFT(tokenId: string, metadata: string)

Mints a new NFT for the specified token.

getMessages(topicId: string, collectedMessages: Message[], lastTimestamp?: number, disableTimestampFilter: boolean = false, nextUrl?: string)

Retrieves messages from a specified topic.

connectWallet(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata)

Helper function to connect to the wallet.

disconnectWallet(clearStorage: boolean = true)

Helper function to disconnect and optionally wipe local storage.

initAccount(PROJECT_ID: string, APP_METADATA: SignClientTypes.Metadata)

Helper function to initialize the SDK from localStorage.

Versions and Topic IDs

| Version | Topic ID | | ------- | ----------- | | v0.0.1 | 0.0.6790163 |

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.