import { type Logger } from '@chainlink/ccip-sdk/src/index.ts'; import HIDTransport from '@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid'; import { type PublicKey, type SignatureScheme, type SignatureWithBytes, Signer } from '@mysten/sui/cryptography'; type LedgerTransport = Awaited>; /** * Minimal client for the "Sui" Ledger application, speaking the device APDU protocol directly. * * The device holds the private key and computes the intent digest itself, so signing is done * with raw transaction bytes (as in the official mysten ledgerjs-hw-app-sui package, whose * dependency chain is not Node-ESM compatible). */ export declare class SuiLedgerClient { readonly transport: LedgerTransport; /** * Creates a SuiLedgerClient over an open HID transport. */ constructor(transport: LedgerTransport); /** * Retrieves the public key associated with a BIP32 path from the Ledger Sui app. * @param path - BIP32 derivation path. * @returns Raw 32-byte Ed25519 public key. */ getPublicKey(path: string): Promise; /** * Signs a serialized Sui transaction on the Ledger device. The device * blake2b-hashes exactly the bytes it receives (after its 4-byte length * prefix) and signs the hash, so callers pass the intent message bytes * (`intent prefix || TransactionData`). * @param path - BIP32 derivation path. * @param txn - Intent-message-encoded transaction bytes to sign. * @returns Raw 64-byte Ed25519 signature. */ signTransaction(path: string, txn: Uint8Array): Promise; /** Terminates the Ledger connection. */ close(): Promise; /** * Sends payloads as a SHA-256 linked list of 180-byte chunks, and collects the * device's chunked result until the RESULT_FINAL frame is received. */ private sendChunks; } /** * Ledger hardware wallet signer for Sui. * * Unlike a {@link Signer} backed by a local keypair, the device holds the private key and * computes the intent digest itself, so signing must always go through {@link signTransaction} * with the raw transaction bytes. The abstract `sign` is intentionally unsupported. */ export declare class SuiLedgerSigner extends Signer { #private; readonly ledger: SuiLedgerClient; readonly derivationPath: string; /** * Private constructor - use static `create` method instead. * @internal */ private constructor(); /** * Creates a new SuiLedgerSigner instance. * @param derivationPath - BIP44 derivation path. * @param logger - Optional logger (falls back to console). * @returns A new SuiLedgerSigner instance. */ static create(derivationPath: string, logger?: Logger): Promise; /** * Signs raw transaction bytes on the Ledger device, and returns the serialized * Sui signature. * * The device blake2b-hashes exactly the bytes it is given (after the length * prefix) and signs that hash, so the 3-byte `TransactionData` intent prefix * must be prepended here — the signature is then over * `blake2b(intent || transactionBytes)`, which is what the node verifies. * (Same as the official `LedgerSigner` from `@mysten/sui`.) * @param bytes - Serialized TransactionData bytes (without intent). * @returns Base64 transaction bytes and serialized signature. */ signTransaction(bytes: Uint8Array): Promise; /** * Signing raw bytes is not supported on Ledger: the device only signs transaction * bytes (with intent handling) via {@link signTransaction}. */ sign(_data: Uint8Array): Promise>; /** {@inheritDoc Signer.getKeyScheme} */ getKeyScheme(): SignatureScheme; /** {@inheritDoc Signer.getPublicKey} */ getPublicKey(): PublicKey; } /** * Loads a Sui wallet from the provided options. * @param wallet - wallet options (as passed from yargs argv) * @returns Promise to Sui wallet instance (Signer) */ export declare function loadSuiWallet({ wallet: walletOpt, interactive }: { wallet?: unknown; interactive?: boolean; }, logger?: Logger): Promise; export {}; //# sourceMappingURL=sui.d.ts.map