diff --git a/packages/extension/src/components/pages/AcceptNFTOffer/AcceptNFTOffer.tsx b/packages/extension/src/components/pages/AcceptNFTOffer/AcceptNFTOffer.tsx index 1ebd1e68e..4981a734d 100644 --- a/packages/extension/src/components/pages/AcceptNFTOffer/AcceptNFTOffer.tsx +++ b/packages/extension/src/components/pages/AcceptNFTOffer/AcceptNFTOffer.tsx @@ -45,19 +45,7 @@ export const AcceptNFTOffer: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'NFTokenAcceptOffer', - Account: '', - ...(params.transaction?.NFTokenSellOffer && { - NFTokenSellOffer: params.transaction.NFTokenSellOffer - }), - ...(params.transaction?.NFTokenBuyOffer && { - NFTokenBuyOffer: params.transaction.NFTokenBuyOffer - }), - ...(params.transaction?.NFTokenBrokerFee && { - NFTokenBrokerFee: params.transaction.NFTokenBrokerFee - }) - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/AddNewTrustline/AddNewTrustline.tsx b/packages/extension/src/components/pages/AddNewTrustline/AddNewTrustline.tsx index ab7d47dec..162159e26 100644 --- a/packages/extension/src/components/pages/AddNewTrustline/AddNewTrustline.tsx +++ b/packages/extension/src/components/pages/AddNewTrustline/AddNewTrustline.tsx @@ -64,17 +64,7 @@ export const AddNewTrustline: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'TrustSet', - Account: '', - LimitAmount: params.transaction?.LimitAmount || { - currency: '', - issuer: '', - value: '0' - }, - ...(params.transaction?.Memos && { Memos: params.transaction?.Memos }), - ...(params.transaction?.Flags && { Flags: params.transaction.Flags }) - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/BurnNFT/BurnNFT.tsx b/packages/extension/src/components/pages/BurnNFT/BurnNFT.tsx index fb285fee6..7737c66ca 100644 --- a/packages/extension/src/components/pages/BurnNFT/BurnNFT.tsx +++ b/packages/extension/src/components/pages/BurnNFT/BurnNFT.tsx @@ -44,12 +44,7 @@ export const BurnNFT: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'NFTokenBurn', - Account: '', - NFTokenID: params.transaction?.NFTokenID ?? '', - ...(params.transaction?.Owner && { Owner: params.transaction.Owner }) - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/CancelNFTOffer/CancelNFTOffer.tsx b/packages/extension/src/components/pages/CancelNFTOffer/CancelNFTOffer.tsx index ed0b55420..36cad15fd 100644 --- a/packages/extension/src/components/pages/CancelNFTOffer/CancelNFTOffer.tsx +++ b/packages/extension/src/components/pages/CancelNFTOffer/CancelNFTOffer.tsx @@ -45,11 +45,7 @@ export const CancelNFTOffer: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'NFTokenCancelOffer', - Account: '', - NFTokenOffers: params.transaction?.NFTokenOffers ?? [] - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/CancelOffer/CancelOffer.tsx b/packages/extension/src/components/pages/CancelOffer/CancelOffer.tsx index f3067d2c7..17fa9c6ea 100644 --- a/packages/extension/src/components/pages/CancelOffer/CancelOffer.tsx +++ b/packages/extension/src/components/pages/CancelOffer/CancelOffer.tsx @@ -44,11 +44,7 @@ export const CancelOffer: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'OfferCancel', - Account: '', - OfferSequence: params.transaction?.OfferSequence ?? 0 - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/CreateNFTOffer/CreateNFTOffer.tsx b/packages/extension/src/components/pages/CreateNFTOffer/CreateNFTOffer.tsx index 1a3ad8bbd..3aa1a42ac 100644 --- a/packages/extension/src/components/pages/CreateNFTOffer/CreateNFTOffer.tsx +++ b/packages/extension/src/components/pages/CreateNFTOffer/CreateNFTOffer.tsx @@ -45,16 +45,7 @@ export const CreateNFTOffer: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'NFTokenCreateOffer', - Account: '', - NFTokenID: params.transaction?.NFTokenID ?? '', - Amount: params.transaction?.Amount ?? '', - ...(params.transaction?.Owner && { Owner: params.transaction.Owner }), - ...(params.transaction?.Expiration && { Expiration: params.transaction.Expiration }), - ...(params.transaction?.Destination && { Destination: params.transaction?.Destination }), - ...(params.transaction?.Flags && { Flags: params.transaction.Flags }) - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/CreateOffer/CreateOffer.tsx b/packages/extension/src/components/pages/CreateOffer/CreateOffer.tsx index 9c81fcb56..7bd195ab6 100644 --- a/packages/extension/src/components/pages/CreateOffer/CreateOffer.tsx +++ b/packages/extension/src/components/pages/CreateOffer/CreateOffer.tsx @@ -45,15 +45,7 @@ export const CreateOffer: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'OfferCreate', - Account: '', - ...(params.transaction?.Flags && { Flags: params.transaction.Flags }), - ...(params.transaction?.Expiration && { Expiration: params.transaction.Expiration }), - ...(params.transaction?.OfferSequence && { OfferSequence: params.transaction.OfferSequence }), - TakerGets: params.transaction?.TakerGets ?? '', - TakerPays: params.transaction?.TakerPays ?? '' - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/DeleteAccount/DeleteAccountConfirm.tsx b/packages/extension/src/components/pages/DeleteAccount/DeleteAccountConfirm.tsx index 99ff13811..f4552850f 100644 --- a/packages/extension/src/components/pages/DeleteAccount/DeleteAccountConfirm.tsx +++ b/packages/extension/src/components/pages/DeleteAccount/DeleteAccountConfirm.tsx @@ -33,7 +33,7 @@ export const DeleteAccountConfirm: FC = ({ const { errorFees, difference } = useFees( { TransactionType: 'AccountDelete', - Account: '', + Account: wallet?.publicAddress ?? '', Destination: destinationAddress }, null diff --git a/packages/extension/src/components/pages/MintNFT/MintNFT.tsx b/packages/extension/src/components/pages/MintNFT/MintNFT.tsx index c4e145723..8e7a75576 100644 --- a/packages/extension/src/components/pages/MintNFT/MintNFT.tsx +++ b/packages/extension/src/components/pages/MintNFT/MintNFT.tsx @@ -45,15 +45,7 @@ export const MintNFT: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'NFTokenMint', - Account: '', - NFTokenTaxon: params.transaction?.NFTokenTaxon ?? 0, - ...(params.transaction?.URI && { URI: params.transaction.URI }), - ...(params.transaction?.Flags && { Flags: params.transaction.Flags }), - ...(params.transaction?.TransferFee && { TransferFee: params.transaction.TransferFee }), - ...(params.transaction?.Issuer && { Issuer: params.transaction.Issuer }) - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/SetAccount/SetAccount.tsx b/packages/extension/src/components/pages/SetAccount/SetAccount.tsx index ab11dd0f9..a5cb9fc45 100644 --- a/packages/extension/src/components/pages/SetAccount/SetAccount.tsx +++ b/packages/extension/src/components/pages/SetAccount/SetAccount.tsx @@ -45,23 +45,7 @@ export const SetAccount: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'AccountSet', - Account: '', - ...(params.transaction?.Flags ? { Flags: params.transaction.Flags } : {}), - ...(params.transaction?.ClearFlag ? { ClearFlag: params.transaction.ClearFlag } : {}), - ...(params.transaction?.Domain ? { Domain: params.transaction.Domain } : {}), - ...(params.transaction?.EmailHash ? { EmailHash: params.transaction.EmailHash } : {}), - ...(params.transaction?.MessageKey ? { MessageKey: params.transaction.MessageKey } : {}), - ...(params.transaction?.NFTokenMinter - ? { NFTokenMinter: params.transaction.NFTokenMinter } - : {}), - ...(params.transaction?.SetFlag ? { SetFlag: params.transaction.SetFlag } : {}), - ...(params.transaction?.TransferRate - ? { TransferRate: params.transaction.TransferRate } - : {}), - ...(params.transaction?.TickSize ? { TickSize: params.transaction.TickSize } : {}) - }, + params.transaction ?? [], params.transaction?.Fee ); diff --git a/packages/extension/src/components/pages/SignTransaction/SignTransaction.tsx b/packages/extension/src/components/pages/SignTransaction/SignTransaction.tsx index 48e069d67..9c53a0821 100644 --- a/packages/extension/src/components/pages/SignTransaction/SignTransaction.tsx +++ b/packages/extension/src/components/pages/SignTransaction/SignTransaction.tsx @@ -43,13 +43,8 @@ export const SignTransaction: FC = () => { const { isConnectionFailed, networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - params.txParam ?? { - TransactionType: 'Payment', - Account: '', - Destination: '', - Amount: '' - }, - params.txParam?.Fee ?? null + params.txParam ?? [], + params.txParam?.Fee ); const urlParams = new URLSearchParams(window.location.search); diff --git a/packages/extension/src/components/pages/SubmitTransaction/SubmitTransaction.tsx b/packages/extension/src/components/pages/SubmitTransaction/SubmitTransaction.tsx index 136d86fc0..7a98723cf 100644 --- a/packages/extension/src/components/pages/SubmitTransaction/SubmitTransaction.tsx +++ b/packages/extension/src/components/pages/SubmitTransaction/SubmitTransaction.tsx @@ -44,7 +44,7 @@ export const SubmitTransaction: FC = () => { const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( params.txParam ?? [], - params.txParam?.Fee ?? null + params.txParam?.Fee ); const urlParams = new URLSearchParams(window.location.search); diff --git a/packages/extension/src/components/pages/Transaction/Transaction.tsx b/packages/extension/src/components/pages/Transaction/Transaction.tsx index a79abb504..b46c00973 100644 --- a/packages/extension/src/components/pages/Transaction/Transaction.tsx +++ b/packages/extension/src/components/pages/Transaction/Transaction.tsx @@ -47,15 +47,7 @@ export const Transaction: FC = () => { const { networkName } = useNetwork(); const { setTransactionProgress } = useTransactionProgress(); const { estimatedFees, errorFees, difference } = useFees( - { - TransactionType: 'Payment', - Account: '', - Amount: params.transaction?.Amount ?? '', - Destination: params.transaction?.Destination ?? '', - Memos: params.transaction?.Memos ?? undefined, - DestinationTag: params.transaction?.DestinationTag ?? undefined, - Flags: params.transaction?.Flags ?? undefined - }, + params.transaction ?? [], params.transaction?.Fee );