@ledgerhq/coin-stellar
Version:
Ledger Stellar Coin integration
63 lines • 2.46 kB
TypeScript
import type { CacheRes } from "@ledgerhq/live-network/cache";
import type { Account } from "@ledgerhq/types-live";
import { AccountRecord } from "@stellar/stellar-sdk";
import { BigNumber } from "bignumber.js";
import { type BalanceAsset, type NetworkInfo, type Signer, NetworkCongestionLevel, StellarOperation } from "../types";
export declare const BASE_RESERVE = 0.5;
export declare const BASE_RESERVE_MIN_COUNT = 2;
export declare const MIN_BALANCE = 1;
export declare function fetchBaseFee(): Promise<{
baseFee: number;
recommendedFee: number;
networkCongestionLevel: NetworkCongestionLevel;
}>;
/**
* Get all account-related data
*
* @async
* @param {string} addr
*/
export declare function fetchAccount(addr: string): Promise<{
blockHeight: number;
balance: BigNumber;
spendableBalance: BigNumber;
assets: BalanceAsset[];
}>;
/**
* Fetch operations for a single account from indexer
*
* @param {string} accountId
* @param {string} addr
* @param {string} order - "desc" or "asc" order of returned records
* @param {string} cursor - point to start fetching records
* @param {number} maxOperations - maximum number of operations to return, stops fetching after reaching this threshold
*
* @return {Operation[]}
*/
export declare function fetchAllOperations(accountId: string, addr: string, order: "asc" | "desc", cursor?: string, maxOperations?: number): Promise<StellarOperation[]>;
export declare function fetchOperations({ accountId, addr, minHeight, order, cursor, limit, }: {
accountId: string;
addr: string;
minHeight: number;
order: "asc" | "desc";
cursor: string | undefined;
limit?: number | undefined;
}): Promise<[StellarOperation[], string]>;
export declare function fetchAccountNetworkInfo(account: Account): Promise<NetworkInfo>;
export declare function fetchSequence(account: Account): Promise<BigNumber>;
export declare function fetchSigners(account: Account): Promise<Signer[]>;
export declare function broadcastTransaction(signedTransaction: string): Promise<string>;
export declare function loadAccount(addr: string): Promise<AccountRecord | null>;
export declare function getLastBlock(): Promise<{
height: number;
hash: string;
time: Date;
}>;
export declare const getRecipientAccount: CacheRes<Array<{
recipient: string;
}>, {
id: string | null;
isMuxedAccount: boolean;
assetIds: string[];
} | null>;
//# sourceMappingURL=horizon.d.ts.map