UNPKG

avail-js-sdk

Version:

Avail library of functions to interact with blockchain and manipulate transactions

28 lines (27 loc) 1.17 kB
import { ApiPromise } from "@polkadot/api"; import { Result } from "neverthrow"; import { EventRecord } from "@polkadot/types/interfaces/types"; /** * Converts a commission percentage to a perbill format. * * @param {number} value - The commission percentage (0-100). * @return {string} The commission value in perbill format. * @throws {Error} If the value is not an integer or is out of the 0-100 range. */ export declare function commissionNumberToPerbill(value: number): Result<string, string>; export declare function generateMultisig(addresses: string[], threshold: number): string; export declare function sortMultisigAddresses(addresses: string[]): string[]; /** * Converts a hexadecimal string to an ASCII string. * * @param {string} hex - The hexadecimal string to convert. * @return {string} The converted ASCII string. */ export declare function fromHexToAscii(hex: string): string; export declare function deconstruct_session_keys(keys: string): { babe: string; grandpa: string; imOnline: string; authorityDiscovery: string; }; export declare function findAndDecodeError(api: ApiPromise, events: EventRecord[]): string | null;