UNPKG

@kyve/sdk-beta

Version:

<p align="center"> <a href="https://kyve.network"> <img src="https://user-images.githubusercontent.com/62398724/137493477-63868209-a19b-4efa-9413-f06d41197d6d.png" style="border-radius: 50%" height="96"> </a> <h3 align="center"><code>@kyve/sdk</

55 lines (54 loc) 2.01 kB
import { SignOptions } from "@cosmostation/extension-client/types/message"; import KyveClient from "./clients/rpc-client/client"; import KyveWebClient from "./clients/rpc-client/web.client"; import { KYVE_NETWORK, Network } from "./constants"; /** Class representing a KyveSDK. */ export declare class KyveSDK { readonly network: Network; private walletSupports; /** * Create sdk instance. * @param network - The network type, e.g mainnet, testnet, etc */ constructor(network: KYVE_NETWORK | Network); /** * Create a client from mnemonic * @param mnemonic * @return Promise<KyveClient> */ fromMnemonic(mnemonic: string): Promise<KyveClient>; /** * create a client from private key * @param privateKey - hex privateKey * @return Promise<KyveClient> */ fromPrivateKey(privateKey: string): Promise<KyveClient>; /** * Crate a client from Keplr wallet if installed * @return Promise<KyveWebClient> */ fromKeplr(): Promise<KyveWebClient>; /** * Crate a client from Cosmostaion wallet if installed * @return Promise<KyveWebClient> */ fromCosmostation(config?: SignOptions): Promise<KyveWebClient>; /** * Listener to detect if account in wallet changed, support fromKeplr and fromCosmostation instances * @param cb */ onAccountChange(cb: () => void): Promise<unknown>; /** * create LCD client to get data from Rest api */ createLCDClient(): import("./clients/lcd-client/client").KyveLCDClientType; /** * generate KyveClient instance without mnemonic */ generate(): Promise<KyveClient>; static generateMnemonic(): Promise<string>; static formatBalance(balance: string, decimals?: number): string; static getAddressFromPubKey(pubKey: string): string; static getAddressFromMnemonic(mnemonic: string): Promise<string>; static verifyString(signature: string, data: string, pubKey: string): Promise<boolean>; }