Skip to content

Commit

Permalink
wallet-ext: revert some of the changes of 2605 pr
Browse files Browse the repository at this point in the history
* fixes missing files
* reverted some renaming changes back to coin since wallet does only coin transfers for now
  • Loading branch information
pchrysochoidis committed Jun 28, 2022
1 parent d396edd commit 16e5a0f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions wallet/src/ui/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ImportPage from './pages/initialize/import';
import SelectPage from './pages/initialize/select';
import SiteConnectPage from './pages/site-connect';
import TransactionDetailsPage from './pages/transaction-details';
import PublicTransferObjectPage from './pages/transfer-coin';
import TransferCoinPage from './pages/transfer-coin';
import WelcomePage from './pages/welcome';
import { AppType } from './redux/slices/app/AppType';
import { useAppDispatch, useAppSelector } from '_hooks';
Expand Down Expand Up @@ -44,7 +44,7 @@ const App = () => {
<Route path="nfts" element={<NftsPage />} />
<Route path="transactions" element={<TransactionsPage />} />
<Route path="settings" element={<SettingsPage />} />
<Route path="send" element={<PublicTransferObjectPage />} />
<Route path="send" element={<TransferCoinPage />} />
<Route
path="tx/:txDigest"
element={<TransactionDetailsPage />}
Expand Down
10 changes: 5 additions & 5 deletions wallet/src/ui/app/pages/transfer-coin/TransferCoinForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ import { balanceFormatOptions } from '_shared/formatting';

import type { FormValues } from './';

import st from './PublicTransferObjectForm.module.scss';
import st from './TransferCoinForm.module.scss';

export type PublicTransferObjectFormProps = {
export type TransferCoinFormProps = {
submitError: string | null;
coinBalance: string;
coinSymbol: string;
onClearSubmitError: () => void;
};

function PublicTransferObjectForm({
function TransferCoinForm({
submitError,
coinBalance,
coinSymbol,
onClearSubmitError,
}: PublicTransferObjectFormProps) {
}: TransferCoinFormProps) {
const {
isSubmitting,
isValid,
Expand Down Expand Up @@ -103,4 +103,4 @@ function PublicTransferObjectForm({
);
}

export default memo(PublicTransferObjectForm);
export default memo(TransferCoinForm);
8 changes: 4 additions & 4 deletions wallet/src/ui/app/pages/transfer-coin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useCallback, useMemo, useState } from 'react';
import { useIntl } from 'react-intl';
import { Navigate, useNavigate, useSearchParams } from 'react-router-dom';

import PublicTransferObjectForm from './PublicTransferObjectForm';
import TransferCoinForm from './TransferCoinForm';
import { createValidationSchema } from './validation';
import Loading from '_components/loading';
import { useAppSelector, useAppDispatch } from '_hooks';
Expand All @@ -29,7 +29,7 @@ const initialValues = {
export type FormValues = typeof initialValues;

// TODO: show out of sync when sui objects locally might be outdated
function PublicTransferObjectPage() {
function TransferCoinPage() {
const [searchParams] = useSearchParams();
const coinType = useMemo(() => searchParams.get('type'), [searchParams]);
const balances = useAppSelector(accountItemizedBalancesSelector);
Expand Down Expand Up @@ -120,7 +120,7 @@ function PublicTransferObjectPage() {
validationSchema={validationSchema}
onSubmit={onHandleSubmit}
>
<PublicTransferObjectForm
<TransferCoinForm
submitError={sendError}
coinBalance={coinBalance.toString()}
coinSymbol={coinSymbol}
Expand All @@ -132,4 +132,4 @@ function PublicTransferObjectPage() {
);
}

export default PublicTransferObjectPage;
export default TransferCoinPage;
2 changes: 1 addition & 1 deletion wallet/src/ui/app/redux/slices/sui-objects/Coin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Coin {
* @param amount The amount to be transfer
* @param recipient The sui address of the recipient
*/
public static async publicTransferObject(
public static async transferCoin(
signer: RawSigner,
coins: SuiMoveObject[],
amount: bigint,
Expand Down
2 changes: 1 addition & 1 deletion wallet/src/ui/app/redux/slices/transactions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const sendTokens = createAsyncThunk<
isSuiMoveObject(anObj.data) && anObj.data.type === coinType
)
.map(({ data }) => data as SuiMoveObject);
const response = await Coin.publicTransferObject(
const response = await Coin.transferCoin(
api.getSignerInstance(keypairVault.getKeyPair()),
coins,
amount,
Expand Down
4 changes: 3 additions & 1 deletion wallet/src/ui/app/redux/slices/txresults/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export const getTransactionsByAddress = createAsyncThunk<
const txn = txns[0];
const txKind = getTransactionKindName(txn);
const recipient =
getPublicTransferObjectTransaction(txn)?.recipient;
getPublicTransferObjectTransaction(
txn
)?.recipient;

return {
seq,
Expand Down

0 comments on commit 16e5a0f

Please sign in to comment.