|
| 1 | +import { SignTransactionArgs, Transport, SignTransactionResponse, GetAddressResponse, GetAppVersionResponse, GetAppNameResponse } from "./types"; |
| 2 | +/** |
| 3 | + * Mina App API |
| 4 | + */ |
| 5 | +export declare class MinaLedgerJS { |
| 6 | + transport: Transport; |
| 7 | + constructor(transport: Transport, scrambleKey?: string); |
| 8 | + protected pad(n: number | string, width?: number, paddingValue?: number | string): string; |
| 9 | + protected asciiToHex(str: string): string; |
| 10 | + protected convertMemo(memo: string): string; |
| 11 | + protected createTXApdu({ txType, senderAccount, senderAddress, receiverAddress, amount, fee, nonce, validUntil, memo, networkId, }: SignTransactionArgs): string; |
| 12 | + /** |
| 13 | + * Get Mina address for a given account number. |
| 14 | + * |
| 15 | + * @param account int of the account number |
| 16 | + * @param display optionally enable or not the display |
| 17 | + * @return an object with a publicKey |
| 18 | + * @example |
| 19 | + * const result = await Mina.getAddress(1); |
| 20 | + * const { publicKey, returnCode } = result; |
| 21 | + */ |
| 22 | + getAddress(account?: number): Promise<GetAddressResponse>; |
| 23 | + signTransaction({ txType, senderAccount, senderAddress, receiverAddress, amount, fee, nonce, validUntil, memo, networkId, }: SignTransactionArgs): Promise<SignTransactionResponse>; |
| 24 | + /** |
| 25 | + * get the version of the Mina app installed on the hardware device |
| 26 | + * the version is returned from the installed app. |
| 27 | + * |
| 28 | + * @return an object with a version |
| 29 | + */ |
| 30 | + getAppVersion(): Promise<GetAppVersionResponse>; |
| 31 | + /** |
| 32 | + * get the name and version of the Mina app installed on the hardware device |
| 33 | + * it can be used to ping the app and know the name of the running app. |
| 34 | + * The name and version is returned from the Ledger firmware. |
| 35 | + * |
| 36 | + * @return an object with an app name and version |
| 37 | + */ |
| 38 | + getAppName(): Promise<GetAppNameResponse>; |
| 39 | +} |
0 commit comments