Skip to content

Commit

Permalink
chore: move imported modules to a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
semeano committed Jan 8, 2025
1 parent 114d419 commit a1d70c3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.

This file was deleted.

This file was deleted.

24 changes: 22 additions & 2 deletions libs/ledger-live-common/src/families/aptos/bridge/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import {
sync,
makeAccountBridgeReceive,
} from "../../../bridge/mockHelpers";
import { getEstimatedFees } from "./bridgeHelpers/fee";
import { updateTransaction } from "@ledgerhq/coin-framework/bridge/jsHelpers";
import { getAddress, isAddressValid } from "./bridgeHelpers/addresses";
import { getMainAccount } from "../../../account";

const receive = makeAccountBridgeReceive();
Expand Down Expand Up @@ -134,15 +132,36 @@ const estimateMaxSpendable = async ({

return balance;
};

const preload = async () => ({});

const hydrate = () => {};

const getAddress = (
a: Account,
): {
address: string;
derivationPath: string;
} => ({ address: a.freshAddress, derivationPath: a.freshAddressPath });

const isAddressValid = (): boolean => {
try {
return true;
} catch (err) {
return false;
}
};

const getEstimatedFees = (): BigNumber => {
return new BigNumber(0);
};

const currencyBridge: CurrencyBridge = {
preload,
hydrate,
scanAccounts,
};

const accountBridge: AccountBridge<Transaction> = {
getSerializedAddressParameters,
createTransaction,
Expand All @@ -155,6 +174,7 @@ const accountBridge: AccountBridge<Transaction> = {
broadcast,
estimateMaxSpendable,
};

export default {
currencyBridge,
accountBridge,
Expand Down

0 comments on commit a1d70c3

Please sign in to comment.