import { ApiPromise } from "@polkadot/api"; import { AccountId, H256 } from "@polkadot/types/interfaces"; import { Network } from "bitcoinjs-lib"; import { Bytes } from "@polkadot/types"; import { AddressOrPair } from "@polkadot/api/types"; import { RefundRequest } from "../interfaces"; import { ElectrsAPI } from "../external"; import { DefaultTransactionAPI, TransactionAPI } from "./transaction"; export interface RefundRequestExt extends Omit { btc_address: string; } export declare function encodeRefundRequest(req: RefundRequest, network: Network): RefundRequestExt; /** * @category PolkaBTC Bridge * The type Big represents DOT or PolkaBTC denominations, * while the type BN represents Planck or Satoshi denominations. */ export interface RefundAPI extends TransactionAPI { /** * Execute a refund request * @remarks If `txId` is not set, the `merkleProof` and `rawTx` must both be set. * * @param refundId The ID generated by the refund request transaction * @param txId (Optional) The ID of the Bitcoin transaction that refunds a user in case of overpayment * @param merkleProof (Optional) The merkle inclusion proof of the Bitcoin transaction. * @param rawTx (Optional) The raw bytes of the Bitcoin transaction */ execute(refundId: string, btcTxId?: string, merkleProof?: Bytes, rawTx?: Bytes): Promise; /** * @returns An array containing the refund requests */ list(): Promise; /** * @param account The ID of the account whose refund requests are to be retrieved * @returns A mapping from the refund ID to the refund request, corresponding to the given account */ mapForUser(account: AccountId): Promise>; /** * @param issueId The ID of the refund to fetch * @returns A refund object */ getRequestById(refundId: H256): Promise; /** * @param issueId The ID of the refund request to fetch * @returns A refund request object */ getRequestByIssueId(issueId: H256): Promise; /** * Set an account to use when sending transactions from this API * @param account Keyring account */ setAccount(account: AddressOrPair): void; } export declare class DefaultRefundAPI extends DefaultTransactionAPI implements RefundAPI { private btcNetwork; private electrsAPI; constructor(api: ApiPromise, btcNetwork: Network, electrsAPI: ElectrsAPI, account?: AddressOrPair); execute(requestId: string, btcTxId?: string, merkleProof?: Bytes, rawTx?: Bytes): Promise; list(): Promise; mapForUser(account: AccountId): Promise>; getRequestById(refundId: H256): Promise; getRequestByIssueId(issueId: H256): Promise; }