UNPKG

@siacentral/ledgerjs-sia

Version:
74 lines 3.33 kB
/// <reference types="node" /> /// <reference types="node" /> import type Transport from "@ledgerhq/hw-transport"; import { Buffer } from 'buffer'; interface VerifyResponse { address: string; publicKey: string; } /** * Sia * * @example * import Sia from '@siacentral/ledgerjs-sia'; * const sia = new Sia(transport) */ export default class Sia { transport: Transport; constructor(transport: Transport, scrambleKey?: string); /** * getVersion returns the version of the Sia app * * @returns {string} the current version of the Sia app. */ getVersion(): Promise<string>; /** * verifyPublicKey returns the public key and standard Sia address for * the provided public key index. The user will be asked to verify the * public key on the display. A standard address is defined as an address * having 1 public key, requiring 1 signature, and no timelock. * @param index {number} the index of the public key * @returns {VerifyResponse} the public key and standard address */ verifyPublicKey(index: number): Promise<VerifyResponse>; /** * verifyStandardAddress returns the public key and standard Sia address for * the provided public key index. The user will be asked to verify the * address on the display. A standard address is defined as an address * having 1 public key, requiring 1 signature, and no timelock. * @param index {number} the index of the public key * @returns {VerifyResponse} the public key and standard address */ verifyStandardAddress(index: number): Promise<VerifyResponse>; /** * signTransactionV044 signs the transaction with the provided key * @deprecated deprecated in v0.4.5 * @param encodedTxn {Buffer} a sia encoded transaction * @param sigIndex {number} the index of the signature to sign * @param keyIndex {number} the index of the key to sign with * @returns {string} the base64 encoded signature */ signTransactionV044(encodedTxn: Buffer, sigIndex: number, keyIndex: number): Promise<string>; /** * signTransaction signs the transaction with the provided key * @param encodedTxn {Buffer} a sia encoded transaction * @param sigIndex {number} the index of the signature to sign * @param keyIndex {number} the index of the key to sign with * @param changeIndex {number} the index of the key used for the change output * @returns {string} the base64 encoded signature */ signTransaction(encodedTxn: Buffer, sigIndex: number, keyIndex: number, changeIndex: number): Promise<string>; /** * signV2Transaction signs the v2 transaction with the provided key * @param encodedTxn {Buffer} a sia encoded (V2TransactionSemantics) v2 transaction * @param sigIndex {number} the index of the signature to sign * @param keyIndex {number} the index of the key to sign with * @param changeIndex {number} the index of the key used for the change output * @returns {string} the base64 encoded signature */ signV2Transaction(encodedTxn: Buffer, sigIndex: number, keyIndex: number, changeIndex: number): Promise<string>; blindSign(sigHash: Buffer, keyIndex: number): Promise<string>; close(): Promise<void>; } export {}; //# sourceMappingURL=sia.d.ts.map