Kiijs-utils

@kiichain/kiijs-utils

Typescript library containing general utility functions for interacting with Kiichain.

Installation

yarn add @kiichain/kiijs-utils @kiichain/kiijs-proto

Bech32 conversion

The package has utils to easen up conversion between hex and bech32 addresses. They can be used like this:

import { HexToBech32, Bech32ToHex } from '@kiichain/kiijs-utils'

const kiiAddress = HexToBech32("0xyourhex")

const evmAddress = Bech32ToHex("kiiYouraddress)

ETHSECP signer

Some wallets do not recognize the ETHSECP256-1 PubKey signatures. We made a couple helpers to utilize it without problems.

Signing a transaction

  1. Create the SigningStargateClient with the correct type

The signing client must use a custom account parser to handle the ethsecp256k1 public key format. This is crucial for correctly signing transactions.

  1. Sign the transaction with a custom pubkey

  1. Broadcast the signed transaction

Last updated