diff --git a/components/forms/DelegationForm.tsx b/components/forms/DelegationForm.tsx index 8cb44ab..6f2ff60 100644 --- a/components/forms/DelegationForm.tsx +++ b/components/forms/DelegationForm.tsx @@ -12,7 +12,7 @@ import StackableContainer from "../layout/StackableContainer"; interface Props { delegatorAddress: string; - accountOnChain: Account | null; + accountOnChain: Account; router: NextRouter; closeForm: () => void; } @@ -49,7 +49,7 @@ const DelegationForm = (props: Props) => { assert(gasPrice, "gasPrice missing"); const fee = calculateFee(gasLimit, gasPrice); const { accountOnChain } = props; - assert(accountOnChain, "accountOnChain missing"); + assert(typeof accountOnChain.accountNumber === "number", "accountNumber missing"); return { accountNumber: accountOnChain.accountNumber, sequence: accountOnChain.sequence, diff --git a/components/forms/ReDelegationForm.tsx b/components/forms/ReDelegationForm.tsx index 5ada999..ec2a98b 100644 --- a/components/forms/ReDelegationForm.tsx +++ b/components/forms/ReDelegationForm.tsx @@ -12,7 +12,7 @@ import StackableContainer from "../layout/StackableContainer"; interface Props { delegatorAddress: string; - accountOnChain: Account | null; + accountOnChain: Account; router: NextRouter; closeForm: () => void; } @@ -56,7 +56,7 @@ const ReDelegationForm = (props: Props) => { assert(gasPrice, "gasPrice missing"); const fee = calculateFee(gasLimit, gasPrice); const { accountOnChain } = props; - assert(accountOnChain, "accountOnChain missing"); + assert(typeof accountOnChain.accountNumber === "number", "accountNumber missing"); return { accountNumber: accountOnChain.accountNumber, sequence: accountOnChain.sequence, diff --git a/components/forms/RewardsForm.tsx b/components/forms/RewardsForm.tsx index c4a16d0..f0f583e 100644 --- a/components/forms/RewardsForm.tsx +++ b/components/forms/RewardsForm.tsx @@ -11,7 +11,7 @@ import StackableContainer from "../layout/StackableContainer"; interface Props { delegatorAddress: string; - accountOnChain: Account | null; + accountOnChain: Account; router: NextRouter; closeForm: () => void; } @@ -39,7 +39,7 @@ const RewardsForm = (props: Props) => { assert(gasPrice, "gasPrice missing"); const fee = calculateFee(gasLimit, gasPrice); const { accountOnChain } = props; - assert(accountOnChain, "accountOnChain missing"); + assert(typeof accountOnChain.accountNumber === "number", "accountNumber missing"); return { accountNumber: accountOnChain.accountNumber, sequence: accountOnChain.sequence, diff --git a/components/forms/TransactionForm.tsx b/components/forms/TransactionForm.tsx index 3d22d75..47dfb82 100644 --- a/components/forms/TransactionForm.tsx +++ b/components/forms/TransactionForm.tsx @@ -12,7 +12,7 @@ import StackableContainer from "../layout/StackableContainer"; interface Props { address: string | null; - accountOnChain: Account | null; + accountOnChain: Account; router: NextRouter; closeForm: () => void; } @@ -51,7 +51,7 @@ const TransactionForm = (props: Props) => { assert(gasPrice, "gasPrice missing"); const fee = calculateFee(gasLimit, gasPrice); const { accountOnChain } = props; - assert(accountOnChain, "accountOnChain missing"); + assert(typeof accountOnChain.accountNumber === "number", "accountNumber missing"); return { accountNumber: accountOnChain.accountNumber, sequence: accountOnChain.sequence, diff --git a/components/forms/UnDelegationForm.tsx b/components/forms/UnDelegationForm.tsx index 50cb41f..699c4dd 100644 --- a/components/forms/UnDelegationForm.tsx +++ b/components/forms/UnDelegationForm.tsx @@ -50,6 +50,7 @@ const UnDelegationForm = (props: Props) => { const fee = calculateFee(gasLimit, gasPrice); const { accountOnChain } = props; assert(accountOnChain, "accountOnChain missing"); + assert(typeof accountOnChain.accountNumber === "number", "accountNumber missing"); return { accountNumber: accountOnChain.accountNumber, sequence: accountOnChain.sequence, diff --git a/pages/multi/[address]/index.tsx b/pages/multi/[address]/index.tsx index c058e60..d725b11 100644 --- a/pages/multi/[address]/index.tsx +++ b/pages/multi/[address]/index.tsx @@ -112,35 +112,35 @@ const Multipage = () => { )} - {txView === "send" && ( + {txView === "send" && accountOnChain && ( )} - {txView === "delegate" && ( + {txView === "delegate" && accountOnChain && ( )} - {txView === "undelegate" && ( + {txView === "undelegate" && accountOnChain && ( )} - {txView === "redelegate" && ( + {txView === "redelegate" && accountOnChain && ( )} - {txView === "claimRewards" && ( + {txView === "claimRewards" && accountOnChain && ( { Once a transaction is created, it can be signed by the multisig members, and then broadcast.

-