UNPKG

@ledgerhq/live-common

Version:
44 lines 2.82 kB
import { Account, AccountLike, AnyMessage, Operation, SignedOperation } from "@ledgerhq/types-live"; import { RawPlatformTransaction, RawPlatformSignedTransaction } from "./rawTypes"; import type { TrackingAPI } from "./tracking"; import { LiveAppManifest, TranslatableString } from "./types"; import { Transaction } from "../generated/types"; import { Exchange } from "../exchange/types"; import { WalletState } from "@ledgerhq/live-wallet/store"; export declare function translateContent(content: string | TranslatableString, locale?: string): string; export type WebPlatformContext = { manifest: LiveAppManifest; accounts: AccountLike[]; tracking: TrackingAPI; }; export declare function receiveOnAccountLogic(walletState: WalletState, { manifest, accounts, tracking }: WebPlatformContext, accountId: string, uiNavigation: (account: AccountLike, parentAccount: Account | undefined, accountAddress: string) => Promise<string>): Promise<string>; export declare function signTransactionLogic({ manifest, accounts, tracking }: WebPlatformContext, accountId: string, transaction: RawPlatformTransaction, uiNavigation: (account: AccountLike, parentAccount: Account | undefined, signFlowInfos: { canEditFees: boolean; hasFeesProvided: boolean; liveTx: Partial<Transaction>; }) => Promise<RawPlatformSignedTransaction>): Promise<RawPlatformSignedTransaction>; export declare function broadcastTransactionLogic({ manifest, accounts, tracking }: WebPlatformContext, accountId: string, signedTransaction: RawPlatformSignedTransaction, uiNavigation: (account: AccountLike, parentAccount: Account | undefined, signedOperation: SignedOperation) => Promise<string>): Promise<string>; export type CompleteExchangeRequest = { provider: string; fromAccountId: string; toAccountId: string; transaction: RawPlatformTransaction; binaryPayload: string; signature: string; feesStrategy: string; exchangeType: number; }; export type CompleteExchangeUiRequest = { provider: string; exchange: Exchange; transaction: Transaction; binaryPayload: string; signature: string; feesStrategy: string; exchangeType: number; swapId?: string; amountExpectedTo?: number; }; export declare function completeExchangeLogic({ manifest, accounts, tracking }: WebPlatformContext, { provider, fromAccountId, toAccountId, transaction, binaryPayload, signature, feesStrategy, exchangeType, }: CompleteExchangeRequest, uiNavigation: (request: CompleteExchangeUiRequest) => Promise<Operation>): Promise<Operation>; export declare function signMessageLogic({ manifest, accounts, tracking }: WebPlatformContext, accountId: string, message: string, uiNavigation: (account: AccountLike, message: AnyMessage) => Promise<string>): Promise<string>; //# sourceMappingURL=logic.d.ts.map