From 2ebff216c7bfac10bdcebbba97656d7e15c171a0 Mon Sep 17 00:00:00 2001 From: Zetazzz Date: Thu, 26 Dec 2024 07:04:10 +0800 Subject: [PATCH] inj docs --- libs/injectivejs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/injectivejs/README.md b/libs/injectivejs/README.md index e081655b..09acb44a 100644 --- a/libs/injectivejs/README.md +++ b/libs/injectivejs/README.md @@ -50,6 +50,7 @@ npm install injectivejs - [Initializing the Stargate Client](#initializing-the-stargate-client) - [Creating Signers](#creating-signers) - [Broadcasting Messages](#broadcasting-messages) +- [All In One Example](#all-in-one-example) - [Advanced Usage](#advanced-usage) - [Developing](#developing) - [Codegen](#codegen) @@ -500,6 +501,19 @@ const fee: StdFee = { const response = await stargateClient.signAndBroadcast(address, [msg], fee); ``` +### All In One Example + +For a comprehensive example of how to use InjectiveJS to send messages, please see the example [here](https://github.com/cosmology-tech/create-cosmos-app/blob/main/examples/injective/components/SendMsg.tsx). This example demonstrates how to: + +- Initialize the Stargate client. +- Create and sign messages. +- Broadcast transactions. +- Handle responses and errors. + +The example provides a complete walkthrough of setting up the client, creating a message for sending tokens, and broadcasting the transaction to the Injective blockchain. + +Follow the [instructions](https://github.com/cosmology-tech/create-cosmos-app/tree/main/examples/injective) in the example to set up your InjectiveJS client and start sending messages to the Injective blockchain. + ## Advanced Usage If you want to manually construct a stargate client