Para with CosmJS
Learn how to integrate Para with Cosmos using @getpara/cosmjs-v0-integration
This guide demonstrates how to use Para with CosmJS for Cosmos blockchain integration. Youβll learn how to set up the
integration, perform basic operations, and handle transactions using the @getpara/cosmjs-v0-integration
package.
Prerequisites
To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration. Before integrating Para with your application, ensure you have:
- Completed Para authentication setup in your application (see one of our Setup Guides)
- A valid Para API key
- An RPC endpoint for your desired network
Need an API key? Visit the Developer Portal to create API keys, manage billing, teams, and more.
Installation
Install the required packages using your preferred package manager:
Setup
For basic setup pass your Para instance and the address prefix to the ParaProtoSigner
. Once created pass the signer to
the SigningStargateClient
.
You can also setup a ParaAminoSigner
if you want to use Amino signing instead of Proto signing. The usage is similar, just replace ParaProtoSigner
with ParaAminoSigner
.
Once setup you can using the SigningStargateClient
as you would normally with CosmJS. You can reference the CosmJS Github for more details.
Basic Usage
Get Address and Balance
Send Tokens
For sending a transaction you can construct a transaction object and call the sendTokens
method:
Advanced Transaction Signing
Sometimes you want more control over the transaction and not send the transaction directly. You can construct any valid message and sign it manually before broadcasting:
Multi-Chain Support
To use Para with different Cosmos-based chains, specify the appropriate address prefix and RPC endpoint when creating signers and clients:
Each client will be configured with the appropriate signer for its respective chain, allowing you to interact with multiple Cosmos networks in the same application.
Server-Side Signing
Paraβs signers can also be used on the server-side using pregen wallets or an active client side session. To learn more about using para on the server, check out these guides:
Examples
If youβd like to learn more about how to use the ParaProtoSigner
or the ParaAminoSigner
for different transaction types, check out this example in our Examples Hub: