From e7fa9095ee537972601b62541f8b037461c9f579 Mon Sep 17 00:00:00 2001 From: Mateusz Jasiuk Date: Thu, 5 Dec 2024 18:49:06 +0100 Subject: [PATCH] fix: do not use empty string memos by default - in transfers (#1386) --- apps/namadillo/src/App/Transfer/TransferModule.tsx | 2 +- apps/namadillo/src/atoms/transfer/atoms.ts | 6 +++--- apps/namadillo/src/atoms/transfer/services.ts | 8 ++++---- apps/namadillo/src/lib/transactions.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/namadillo/src/App/Transfer/TransferModule.tsx b/apps/namadillo/src/App/Transfer/TransferModule.tsx index ed9d479a7..0416adc9a 100644 --- a/apps/namadillo/src/App/Transfer/TransferModule.tsx +++ b/apps/namadillo/src/App/Transfer/TransferModule.tsx @@ -108,7 +108,7 @@ export const TransferModule = ({ destination.enableCustomAddress && !destination.availableWallets ); - const [memo, setMemo] = useState(""); + const [memo, setMemo] = useState(); const selectedAsset = mapUndefined( (address) => source.availableAssets?.[address], diff --git a/apps/namadillo/src/atoms/transfer/atoms.ts b/apps/namadillo/src/atoms/transfer/atoms.ts index 6ffcf3320..65a4d6134 100644 --- a/apps/namadillo/src/atoms/transfer/atoms.ts +++ b/apps/namadillo/src/atoms/transfer/atoms.ts @@ -44,7 +44,7 @@ export const createShieldedTransferAtom = atomWithMutation((get) => { params, gasConfig, account, - memo = "", + memo, }: BuildTxAtomParams) => createShieldedTransferTx(chain.data!, account, params, gasConfig, memo), }; @@ -59,7 +59,7 @@ export const createShieldingTransferAtom = atomWithMutation((get) => { params, gasConfig, account, - memo = "", + memo, }: BuildTxAtomParams) => createShieldingTransferTx(chain.data!, account, params, gasConfig, memo), }; @@ -74,7 +74,7 @@ export const createUnshieldingTransferAtom = atomWithMutation((get) => { params, gasConfig, account, - memo = "", + memo, }: BuildTxAtomParams) => createUnshieldingTransferTx( chain.data!, diff --git a/apps/namadillo/src/atoms/transfer/services.ts b/apps/namadillo/src/atoms/transfer/services.ts index 3df314545..e27640ded 100644 --- a/apps/namadillo/src/atoms/transfer/services.ts +++ b/apps/namadillo/src/atoms/transfer/services.ts @@ -18,7 +18,7 @@ export const createTransparentTransferTx = async ( account: Account, props: TransparentTransferMsgValue[], gasConfig: GasConfig, - memo = "" + memo?: string ): Promise | undefined> => { const { tx } = await getSdkInstance(); const transactionPairs = await buildTxPair( @@ -38,7 +38,7 @@ export const createShieldedTransferTx = async ( account: Account, props: ShieldedTransferMsgValue[], gasConfig: GasConfig, - memo = "" + memo?: string ): Promise | undefined> => { const { tx } = await getSdkInstance(); const transactionPairs = await buildTxPair( @@ -58,7 +58,7 @@ export const createShieldingTransferTx = async ( account: Account, props: ShieldingTransferMsgValue[], gasConfig: GasConfig, - memo = "" + memo?: string ): Promise | undefined> => { const { tx } = await getSdkInstance(); const transactionPairs = await buildTxPair( @@ -78,7 +78,7 @@ export const createUnshieldingTransferTx = async ( account: Account, props: UnshieldingTransferMsgValue[], gasConfig: GasConfig, - memo = "" + memo?: string ): Promise | undefined> => { const { tx } = await getSdkInstance(); const transactionPairs = await buildTxPair( diff --git a/apps/namadillo/src/lib/transactions.ts b/apps/namadillo/src/lib/transactions.ts index b91e144c8..3773d1675 100644 --- a/apps/namadillo/src/lib/transactions.ts +++ b/apps/namadillo/src/lib/transactions.ts @@ -167,7 +167,7 @@ export const createTransferDataFromNamada = ( | TransactionPair | TransactionPair | TransactionPair, - memo = "" + memo?: string ): TransferTransactionData[] => { if (!txResponse?.encodedTxData?.txs?.length) { throw "Invalid transaction response";