Skip to content

Commit

Permalink
feat: upgrade kadena, add sender and receiver chain id inputs in mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
ayelenmurano committed Oct 11, 2024
1 parent ccf5440 commit a609ce0
Show file tree
Hide file tree
Showing 16 changed files with 494 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import {
Transaction,
TransactionStatus,
} from "@ledgerhq/live-common/families/kadena/types";
import { Account } from "@ledgerhq/types-live";
import { LLDCoinFamily } from "../types";
import AccountSubHeader from "./AccountSubHeader";
import operationDetails from "./operationDetails";
import sendRecipientFields from "./SendRecipientFields";
import { Account } from "@ledgerhq/types-live";

const family: LLDCoinFamily<Account, Transaction, TransactionStatus, KadenaOperation> = {
AccountSubHeader,
sendRecipientFields,
operationDetails,
};

export default family;
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
import { Account, AccountLike, ProtoNFT } from "@ledgerhq/types-live";
import type { Device } from "@ledgerhq/live-common/hw/actions/types";
import type { Operation } from "@ledgerhq/types-live";
import type { Transaction, TransactionStatus } from "@ledgerhq/live-common/generated/types";
import type { Transaction as EvmTransaction, GasOptions } from "@ledgerhq/coin-evm/types/index";
import { Result } from "@ledgerhq/live-common/bridge/useBridgeTransaction";
import type {
CardanoAccount,
Transaction as CardanoTransaction,
} from "@ledgerhq/live-common/families/cardano/types";
AlgorandAccount,
AlgorandTransaction,
TransactionStatus as AlgorandTransactionStatus,
} from "@ledgerhq/live-common/families/algorand/types";
import type {
Transaction as BitcoinTransaction,
TransactionStatus as BitcoinTransactionStatus,
} from "@ledgerhq/live-common/families/bitcoin/types";
import type {
AlgorandAccount,
AlgorandTransaction,
TransactionStatus as AlgorandTransactionStatus,
} from "@ledgerhq/live-common/families/algorand/types";
CardanoAccount,
Transaction as CardanoTransaction,
} from "@ledgerhq/live-common/families/cardano/types";
import type { Transaction as CasperTransaction } from "@ledgerhq/live-common/families/casper/types";
import {
CosmosAccount,
Transaction as CosmosTransaction,
Expand All @@ -26,22 +23,22 @@ import {
Transaction as CryptoOrgTransaction,
} from "@ledgerhq/live-common/families/crypto_org/types";
import { Transaction as HederaTransaction } from "@ledgerhq/live-common/families/hedera/types";
import type { Transaction as ICPTransaction } from "@ledgerhq/live-common/families/internet_computer/types";
import { Transaction as KadenaTransaction } from "@ledgerhq/live-common/families/kadena/types";
import {
SolanaAccount,
Transaction as SolanaTransaction,
} from "@ledgerhq/live-common/families/solana/types";
import {
KadenaAccount,
Transaction as KadenaTransaction,
} from "@ledgerhq/live-common/families/kadena/types";
import type { Transaction as RippleTransaction } from "@ledgerhq/live-common/families/xrp/types";
import type { Transaction as ICPTransaction } from "@ledgerhq/live-common/families/internet_computer/types";
import type { Transaction as StellarTransaction } from "@ledgerhq/live-common/families/stellar/types";
import type { Transaction as StacksTransaction } from "@ledgerhq/live-common/families/stacks/types";
import type { Transaction as CasperTransaction } from "@ledgerhq/live-common/families/casper/types";
import type { Transaction as StellarTransaction } from "@ledgerhq/live-common/families/stellar/types";
import type { Transaction as TonTransaction } from "@ledgerhq/live-common/families/ton/types";
import type { Transaction as RippleTransaction } from "@ledgerhq/live-common/families/xrp/types";
import type { Transaction, TransactionStatus } from "@ledgerhq/live-common/generated/types";
import type { Device } from "@ledgerhq/live-common/hw/actions/types";
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
import type { Operation } from "@ledgerhq/types-live";
import { Account, AccountLike, ProtoNFT } from "@ledgerhq/types-live";
import BigNumber from "bignumber.js";
import { Result } from "@ledgerhq/live-common/bridge/useBridgeTransaction";
import { ScreenName } from "~/const";

export type SendFundsNavigatorStackParamList = {
Expand Down Expand Up @@ -363,7 +360,21 @@ export type SendFundsNavigatorStackParamList = {
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
[ScreenName.KadenaEditChainID]: {
[ScreenName.KadenaEditReceiverChainId]: {
accountId: string;
account: Account;
parentId?: string;
transaction: KadenaTransaction;
currentNavigation:
| ScreenName.SignTransactionSummary
| ScreenName.SendSummary
| ScreenName.SwapForm;
nextNavigation:
| ScreenName.SignTransactionSelectDevice
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
[ScreenName.KadenaEditSenderChainId]: {
accountId: string;
account: Account;
parentId?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Transaction, TransactionStatus } from "@ledgerhq/live-common/generated/types";
import type { Transaction as EvmTransaction, GasOptions } from "@ledgerhq/coin-evm/types/index";
import type {
CardanoAccount,
Transaction as CardanoTransaction,
} from "@ledgerhq/live-common/families/cardano/types";
AlgorandAccount,
AlgorandTransaction,
TransactionStatus as AlgorandTransactionStatus,
} from "@ledgerhq/live-common/families/algorand/types";
import type {
Transaction as BitcoinTransaction,
TransactionStatus as BitcoinTransactionStatus,
} from "@ledgerhq/live-common/families/bitcoin/types";
import type {
AlgorandAccount,
AlgorandTransaction,
TransactionStatus as AlgorandTransactionStatus,
} from "@ledgerhq/live-common/families/algorand/types";
CardanoAccount,
Transaction as CardanoTransaction,
} from "@ledgerhq/live-common/families/cardano/types";
import type { Transaction as CasperTransaction } from "@ledgerhq/live-common/families/casper/types";
import {
CosmosAccount,
Transaction as CosmosTransaction,
Expand All @@ -21,17 +21,18 @@ import {
CryptoOrgAccount,
Transaction as CryptoOrgTransaction,
} from "@ledgerhq/live-common/families/crypto_org/types";
import { Transaction as HederaTransaction } from "@ledgerhq/live-common/families/hedera/types";
import type { Transaction as ICPTransaction } from "@ledgerhq/live-common/families/internet_computer/types";
import { Transaction as KadenaTransaction } from "@ledgerhq/live-common/families/kadena/types";
import {
SolanaAccount,
Transaction as SolanaTransaction,
} from "@ledgerhq/live-common/families/solana/types";
import { Transaction as HederaTransaction } from "@ledgerhq/live-common/families/hedera/types";
import type { Transaction as ICPTransaction } from "@ledgerhq/live-common/families/internet_computer/types";
import type { Transaction as RippleTransaction } from "@ledgerhq/live-common/families/xrp/types";
import type { Transaction as StellarTransaction } from "@ledgerhq/live-common/families/stellar/types";
import type { Transaction as StacksTransaction } from "@ledgerhq/live-common/families/stacks/types";
import type { Transaction as CasperTransaction } from "@ledgerhq/live-common/families/casper/types";
import type { Transaction as StellarTransaction } from "@ledgerhq/live-common/families/stellar/types";
import type { Transaction as TonTransaction } from "@ledgerhq/live-common/families/ton/types";
import type { Transaction as RippleTransaction } from "@ledgerhq/live-common/families/xrp/types";
import { Transaction, TransactionStatus } from "@ledgerhq/live-common/generated/types";
import { Device } from "@ledgerhq/live-common/hw/actions/types";
import { Account, Operation, SignedOperation } from "@ledgerhq/types-live";
import BigNumber from "bignumber.js";
Expand Down Expand Up @@ -327,4 +328,32 @@ export type SignTransactionNavigatorParamList = {
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
[ScreenName.KadenaEditReceiverChainId]: {
accountId: string;
account: Account;
parentId?: string;
transaction: KadenaTransaction;
currentNavigation:
| ScreenName.SignTransactionSummary
| ScreenName.SendSummary
| ScreenName.SwapForm;
nextNavigation:
| ScreenName.SignTransactionSelectDevice
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
[ScreenName.KadenaEditSenderChainId]: {
accountId: string;
account: Account;
parentId?: string;
transaction: KadenaTransaction;
currentNavigation:
| ScreenName.SignTransactionSummary
| ScreenName.SendSummary
| ScreenName.SwapForm;
nextNavigation:
| ScreenName.SignTransactionSelectDevice
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
};
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
import type { Transaction as EvmTransaction, GasOptions } from "@ledgerhq/coin-evm/types/index";
import { ExchangeRate, SwapDataType } from "@ledgerhq/live-common/exchange/swap/types";
import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
import { Transaction } from "@ledgerhq/live-common/generated/types";
import type { Transaction as EvmTransaction, GasOptions } from "@ledgerhq/coin-evm/types/index";
import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";

import type {
DetailsSwapParamList,
DefaultAccountSwapParamList,
SwapSelectCurrency,
SwapPendingOperation,
SwapOperation,
} from "../../../screens/Swap/types";
import type {
CardanoAccount,
Transaction as CardanoTransaction,
} from "@ledgerhq/live-common/families/cardano/types";
AlgorandAccount,
AlgorandTransaction,
TransactionStatus as AlgorandTransactionStatus,
} from "@ledgerhq/live-common/families/algorand/types";
import type {
Transaction as BitcoinTransaction,
TransactionStatus as BitcoinTransactionStatus,
} from "@ledgerhq/live-common/families/bitcoin/types";
import type {
AlgorandAccount,
AlgorandTransaction,
TransactionStatus as AlgorandTransactionStatus,
} from "@ledgerhq/live-common/families/algorand/types";
CardanoAccount,
Transaction as CardanoTransaction,
} from "@ledgerhq/live-common/families/cardano/types";
import type { Transaction as CasperTransaction } from "@ledgerhq/live-common/families/casper/types";
import {
CosmosAccount,
Transaction as CosmosTransaction,
Expand All @@ -31,20 +25,27 @@ import {
CryptoOrgAccount,
Transaction as CryptoOrgTransaction,
} from "@ledgerhq/live-common/families/crypto_org/types";
import { Transaction as HederaTransaction } from "@ledgerhq/live-common/families/hedera/types";
import type { Transaction as ICPTransaction } from "@ledgerhq/live-common/families/internet_computer/types";
import { Transaction as KadenaTransaction } from "@ledgerhq/live-common/families/kadena/types";
import {
SolanaAccount,
Transaction as SolanaTransaction,
} from "@ledgerhq/live-common/families/solana/types";
import { Transaction as HederaTransaction } from "@ledgerhq/live-common/families/hedera/types";
import type { Transaction as RippleTransaction } from "@ledgerhq/live-common/families/xrp/types";
import type { Transaction as ICPTransaction } from "@ledgerhq/live-common/families/internet_computer/types";
import type { Transaction as StellarTransaction } from "@ledgerhq/live-common/families/stellar/types";
import type { Transaction as StacksTransaction } from "@ledgerhq/live-common/families/stacks/types";
import type { Transaction as CasperTransaction } from "@ledgerhq/live-common/families/casper/types";
import type { Transaction as StellarTransaction } from "@ledgerhq/live-common/families/stellar/types";
import type { Transaction as TonTransaction } from "@ledgerhq/live-common/families/ton/types";
import BigNumber from "bignumber.js";
import type { Transaction as RippleTransaction } from "@ledgerhq/live-common/families/xrp/types";
import { Account, Operation } from "@ledgerhq/types-live";
import BigNumber from "bignumber.js";
import { ScreenName } from "~/const";
import type {
DefaultAccountSwapParamList,
DetailsSwapParamList,
SwapOperation,
SwapPendingOperation,
SwapSelectCurrency,
} from "../../../screens/Swap/types";

type Target = "from" | "to";

Expand Down Expand Up @@ -329,4 +330,32 @@ export type SwapNavigatorParamList = {
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
[ScreenName.KadenaEditReceiverChainId]: {
accountId: string;
account: Account;
parentId?: string;
transaction: KadenaTransaction;
currentNavigation:
| ScreenName.SignTransactionSummary
| ScreenName.SendSummary
| ScreenName.SwapForm;
nextNavigation:
| ScreenName.SignTransactionSelectDevice
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
[ScreenName.KadenaEditSenderChainId]: {
accountId: string;
account: Account;
parentId?: string;
transaction: KadenaTransaction;
currentNavigation:
| ScreenName.SignTransactionSummary
| ScreenName.SendSummary
| ScreenName.SwapForm;
nextNavigation:
| ScreenName.SignTransactionSelectDevice
| ScreenName.SendSelectDevice
| ScreenName.SwapForm;
};
};
3 changes: 2 additions & 1 deletion apps/ledger-live-mobile/src/const/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ export enum ScreenName {
Web3HubApp = "Web3HubApp",

// Kadena
KadenaEditChainID = "KadenaEditChainID",
KadenaEditSenderChainId = "KadenaEditSenderChainId",
KadenaEditReceiverChainId = "KadenaEditReceiverChainId",
}

export enum NavigatorName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import AccountSubHeader from "~/components/AccountSubHeader";

export default function KadenaAccountSubHeader() {
return <AccountSubHeader family="Kadena" team="Zondax" />;
}
}
Loading

0 comments on commit a609ce0

Please sign in to comment.