UNPKG

@ledgerhq/coin-celo

Version:
54 lines 2.1 kB
import { getSerializedAddressParameters, updateTransaction, makeAccountBridgeReceive, makeScanAccounts, } from "@ledgerhq/coin-framework/bridge/jsHelpers"; import { getPreloadStrategy, preload, hydrate } from "./preload"; import { getTransactionStatus } from "./getTransactionStatus"; import { estimateMaxSpendable } from "./estimateMaxSpendable"; import { prepareTransaction } from "./prepareTransaction"; import { createTransaction } from "./createTransaction"; import { assignFromAccountRaw, assignToAccountRaw, toOperationExtraRaw, fromOperationExtraRaw, } from "./serialization"; import resolver from "../signer/hw-getAddress"; import { broadcast } from "./broadcast"; import getAddressWrapper from "@ledgerhq/coin-framework/bridge/getAddressWrapper"; import { getAccountShape } from "./synchronisation"; import { buildSignOperation } from "./signOperation"; import { sync } from "./synchronisation"; export function buildCurrencyBridge(signerContext) { const getAddress = resolver(signerContext); const scanAccounts = makeScanAccounts({ getAccountShape, getAddressFn: getAddressWrapper(getAddress), }); return { getPreloadStrategy, preload, hydrate, scanAccounts, }; } export function buildAccountBridge(signerContext) { const getAddress = resolver(signerContext); const receive = makeAccountBridgeReceive(getAddressWrapper(getAddress)); const signOperation = buildSignOperation(signerContext); return { estimateMaxSpendable, createTransaction, updateTransaction, getTransactionStatus, prepareTransaction, sync, receive, signOperation, broadcast, getSerializedAddressParameters, assignFromAccountRaw, assignToAccountRaw, toOperationExtraRaw, fromOperationExtraRaw, }; } export function createBridges(signerContext) { return { currencyBridge: buildCurrencyBridge(signerContext), accountBridge: buildAccountBridge(signerContext), }; } //# sourceMappingURL=index.js.map