UNPKG

@ledgerhq/coin-filecoin

Version:
52 lines 2.87 kB
import { rejectBalanceOptions } from "@ledgerhq/coin-module-framework/api/getBalance/rejectBalanceOptions"; import { craftTransactionData } from "@ledgerhq/coin-module-framework/logic/craftTransactionData"; import { getBalance } from "../logic/account/getBalance"; import { getNextSequence } from "../logic/account/getNextSequence"; import { lastBlock } from "../logic/history/lastBlock"; import { listOperations } from "../logic/history/listOperations"; import { broadcast } from "../logic/transaction/broadcast"; import { combine } from "../logic/transaction/combine"; import { craftTransaction } from "../logic/transaction/craftTransaction"; import { estimateFees } from "../logic/transaction/estimateFees"; import { validateAddress } from "../logic/validateAddress"; import { validateIntent } from "../logic/validateIntent"; export function createApi() { return { broadcast: (_context, tx, options) => broadcast(tx, options?.broadcastConfig), async call(_context) { throw new Error("call is not supported"); }, async register() { throw new Error("register is not supported"); }, combine: (_context, tx, signature, options) => combine(tx, signature, options?.pubkey), craftTransaction: (_context, intent, options) => craftTransaction(intent, options?.customFees), estimateFees: (_context, intent, options) => estimateFees(intent, options?.customFeesParameters), lastBlock: (_context) => lastBlock(), listOperations: (_context, address, options) => listOperations(address, options), validateIntent: (_context, intent, balances, options) => validateIntent(intent, balances, options?.customFees), getNextSequence: (_context, address) => getNextSequence(address), validateAddress: (_context, address, parameters) => validateAddress(address, parameters), craftTransactionData: (_context, intent) => craftTransactionData(intent), getBalance: (_context, address, options) => rejectBalanceOptions(() => getBalance(address), options), craftRawTransaction: (_context, _transaction, _sender, _publicKey, _sequence) => { throw new Error("craftRawTransaction is not supported"); }, getBlock(_context, _height) { throw new Error("getBlock is not supported"); }, getBlockInfo(_context, _height) { throw new Error("getBlockInfo is not supported"); }, getStakes(_context, _address, _options) { throw new Error("getStakes is not supported"); }, getRewards(_context, _address, _options) { throw new Error("getRewards is not supported"); }, getValidators(_context, _options) { throw new Error("getValidators is not supported"); }, }; } //# sourceMappingURL=index.js.map