Creates a new Cosmos chain instance
Configuration parameters
Instance of the chain signature contract for MPC operations
Chain id for the Cosmos network
Optional
endpoints?: { rpcUrl?: string; restUrl?: string }Optional RPC and REST endpoints
Optional
rpcUrl?: stringOptional RPC endpoint URL
Optional
restUrl?: stringOptional REST endpoint URL
Gets the native token balance and decimals for a given address
The address to check
Promise resolving to an object containing: - balance: The balance as a bigint, in the chain's base units - decimals: The number of decimals used to format the balance
Uses Sig Network Key Derivation Function to derive the address and public key. from a signer ID and string path.
The id/address of the account requesting signature
The string path used to derive the key
Promise resolving to the derived address and public key
Serializes an unsigned transaction to a string format. This is useful for storing or transmitting the transaction.
The unsigned transaction to serialize
The serialized transaction string
Deserializes a transaction string back into an unsigned transaction object. This reverses the serialization done by serializeTransaction().
The serialized transaction string
The deserialized unsigned transaction
Prepares a transaction for Sig Network MPC signing by creating the necessary payloads. This method handles chain-specific transaction preparation including:
The transaction request containing parameters like recipient, amount, etc.
Promise resolving to an object containing: - transaction: The unsigned transaction - hashesToSign: Array of payloads to be signed by MPC. The order of these payloads must match the order of signatures provided to finalizeTransactionSigning()
Adds Sig Network MPC-generated signatures to an unsigned transaction.
Parameters for adding signatures
The unsigned transaction to add signatures to
Array of RSV signatures generated through MPC. Must be in the same order as the payloads returned by prepareTransactionForSigning()
The serialized signed transaction ready for broadcast
Broadcasts a signed transaction to the network.
The serialized signed transaction
Promise resolving to an object containing the transaction hash/ID
Implementation of the ChainAdapter interface for Cosmos-based networks. Handles interactions with Cosmos SDK chains like Cosmos Hub, Osmosis, etc.