import { Address, Hash, Hex, PublicClient, SendTransactionReturnType } from "viem"; import { OrangeKitContracts } from "./contracts"; import { TransactionSender } from "./utils/TransactionSender"; import { SafeDeploymentTransaction } from "./contracts/safe-factory"; export * from "./bitcoin"; /** * Represents the Safe transaction data payload for calculating the hash used * as a message to sign with Bitcoin wallet. */ export type SafeTransactionData = { /** * Destination address of Safe transaction. */ to: string; /** * The amount of ether (in wei) of Safe transaction. */ value: string; /** * Data payload of Safe transaction. */ data: string; /** * Operation type of Safe transaction. */ operation: number; /** * Gas that should be used for the Safe transaction. */ safeTxGas: string; /** * Gas costs for that are independent of the transaction execution(e.g. base * transaction fee, signature check, payment of the refund) */ baseGas: string; /** * Gas price that should be used for the payment calculation. */ gasPrice: string; /** * Token address (or 0 if ETH) that is used for the payment. */ gasToken: string; /** * Address of receiver of gas payment (or 0 if tx.origin). */ refundReceiver: string; /** * Transaction nonce. */ nonce: number; }; /** * Function for signing a Bitcoin transaction message. The message is a hash of * the Safe transaction with details specified by the `transactionData`. * Handling the `transactionData` is optional and can be used to provide the * clear signing process, depending on the wallet implementation. * * @param message - Message to sign. * @param transactionData - Safe transaction data serves as the payload for the * message to sign calculation. * * @returns A promise that resolves to a string representing the signed message. */ export type BitcoinSignSafeTransactionMessageFn = (message: string, transactionData: SafeTransactionData) => Promise; export declare class OrangeKitSmartAccount { #private; static init(chainId: number, rpcUrl: string, transactionSender: TransactionSender): Promise; constructor(client: PublicClient, _chainId: number, contracts: OrangeKitContracts, transactionSender: TransactionSender); get chainId(): number; /** * Predicts the Ethereum address of a safe for a given Bitcoin address. * @param {string} bitcoinAddress - The Bitcoin address to predict the safe for. * @param {string} publicKey - The public key associated with the Bitcoin address. * @returns {Promise} A promise that resolves to the predicted Ethereum address of the safe. */ predictAddress(bitcoinAddress: string, publicKey?: string): Promise
; private checkIfContractExists; checkIfSafeExists(bitcoinAddress: string, publicKey?: string): Promise; /** * Populates a transaction to deploy a safe for a given Bitcoin address. * @param {string} bitcoinAddress - The Bitcoin address to deploy the safe for. * @param {string} [publicKey] - The public key associated with the Bitcoin address. * @returns {Promise} A promise that resolves to the populated transaction. */ populateSafeDeploymentTransaction(bitcoinAddress: string, publicKey?: string): Promise; deploySafe(bitcoinAddress: string, relayerPrivateKey: Hex, rpcUrl: string): Promise; private ensureContract; private ensureSafeForBtcWallet; /** * Sends a transaction from a safe associated with a given Bitcoin address. * @param {string} to - The Ethereum address to send the transaction to. * @param {string} value - The amount of Ether to send. * @param {string} data - The data to include in the transaction. * @param {string} bitcoinAddress - The Bitcoin address associated with the safe. * @param {string} publicKey - The public key associated with the Bitcoin address. * @param {BitcoinSignSafeTransactionMessageFn} bitcoinSignMessageFn - A * function to sign a message with the Bitcoin private key. * @returns {Promise} A promise that resolves to the hash of the sent transaction. */ sendTransaction(to: Address, value: string, data: Hex, bitcoinAddress: string, publicKey: string, bitcoinSignMessageFn: BitcoinSignSafeTransactionMessageFn): Promise; } //# sourceMappingURL=index.d.ts.map