Skip to content

Commit

Permalink
Merge pull request #13 from 0xsequence/prepare-publish
Browse files Browse the repository at this point in the history
Add files to package.json, fix all autofixable formatting
  • Loading branch information
AlexanderKolberg authored Nov 6, 2024
2 parents 4610bb2 + a5e0871 commit d86845b
Show file tree
Hide file tree
Showing 27 changed files with 48 additions and 47 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"format:check": "biome format .",
"barrel": "ctix build"
},
"files": ["src", "dist"],
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/react/_internal/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ChainId as NetworkChainId } from '@0xsequence/network';
import { ContractType } from '@types';
import type { ContractType } from '@types';

export type QueryArg = {
query?: {
Expand Down
4 changes: 2 additions & 2 deletions src/react/hooks/useTransferTokens.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ContractType, type ChainId } from '@internal';
import type { ContractType, ChainId } from '@internal';
import { ERC1155_ABI } from '../../utils';
import { Abi, erc721Abi, type Address, type Hex } from 'viem';
import { type Abi, erc721Abi, type Address, type Hex } from 'viem';
import { useAccount, useWriteContract } from 'wagmi';

interface BaseTransferParams {
Expand Down
4 changes: 2 additions & 2 deletions src/react/ui/modals/CreateListingModal/_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import { addDays } from 'date-fns/addDays';
import type { Hex } from 'viem';
import { useAccount, useSendTransaction } from 'wagmi';
import type { ShowCreateListingModalArgs } from '.';
import { Messages } from '../../../../types/messages';
import type { Messages } from '../../../../types/messages';
import { useTransactionStatusModal } from '../_internal/components/transactionStatusModal';
import {
getCreateListingTransactionMessage,
getCreateListingTransactionTitle,
} from './_utils/getCreateListingTransactionTitleMessage';
import { useCollectible } from '@react-hooks/useCollectible';
import { CollectionType } from '@internal';
import type { CollectionType } from '@internal';

export interface CreateListingModalState {
isOpen: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';
import type { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';

export const getCreateListingTransactionTitle = (
params: ConfirmationStatus,
Expand Down
2 changes: 1 addition & 1 deletion src/react/ui/modals/CreateListingModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import TransactionDetails from '../_internal/components/transactionDetails';
import { createListingModal$, useHydrate } from './_store';
import { useAccount } from 'wagmi';
import { useSwitchChainModal } from '../_internal/components/switchChainModal';
import { Messages } from '../../../../types/messages';
import type { Messages } from '../../../../types/messages';

export type ShowCreateListingModalArgs = {
collectionAddress: string;
Expand Down
4 changes: 2 additions & 2 deletions src/react/ui/modals/MakeOfferModal/_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import { addDays } from 'date-fns/addDays';
import { parseUnits, type Hex } from 'viem';
import { useAccount, useSendTransaction } from 'wagmi';
import type { ShowMakeOfferModalArgs } from '.';
import { Messages } from '../../../../types/messages';
import type { Messages } from '../../../../types/messages';
import { useTransactionStatusModal } from '../_internal/components/transactionStatusModal';
import {
getMakeOfferTransactionMessage,
getMakeOfferTransactionTitle,
} from './_utils/getMakeOfferTransactionTitleMessage';
import { useCollectible } from '@react-hooks/useCollectible';
import { CollectionType } from '@internal';
import type { CollectionType } from '@internal';

export interface MakeOfferModalState {
isOpen: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';
import type { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';

export const getMakeOfferTransactionTitle = (params: ConfirmationStatus) => {
if (params.isConfirmed) {
Expand Down
2 changes: 1 addition & 1 deletion src/react/ui/modals/MakeOfferModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import QuantityInput from '../_internal/components/quantityInput';
import TokenPreview from '../_internal/components/tokenPreview';
import { makeOfferModal$, useHydrate } from './_store';
import { useSwitchChainModal } from '../_internal/components/switchChainModal';
import { Messages } from '../../../../types/messages';
import type { Messages } from '../../../../types/messages';

export type ShowMakeOfferModalArgs = {
collectionAddress: string;
Expand Down
6 changes: 3 additions & 3 deletions src/react/ui/modals/SellModal/_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
import { useMount, useSelector } from '@legendapp/state/react';
import { useGenerateSellTransaction } from '@react-hooks/useGenerateSellTransaction';
import { useAccount, useSendTransaction } from 'wagmi';
import { Hex } from 'viem';
import { ShowSellModalArgs } from '.';
import { Messages } from '../../../../types/messages';
import type { Hex } from 'viem';
import type { ShowSellModalArgs } from '.';
import type { Messages } from '../../../../types/messages';
import { useTransactionStatusModal } from '../_internal/components/transactionStatusModal';
import {
getSellTransactionMessage,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';
import type { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';

export const getSellTransactionTitle = (params: ConfirmationStatus) => {
if (params.isConfirmed) {
Expand Down
6 changes: 3 additions & 3 deletions src/react/ui/modals/SellModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {
ActionModal,
ActionModalProps,
type ActionModalProps,
} from '../_internal/components/actionModal/ActionModal';
import { sellModal$, useHydrate } from './_store';
import { observer, Show } from '@legendapp/state/react';
import { useCollection } from '@react-hooks/useCollection';
import { Order, Price } from '@types';
import type { Order, Price } from '@types';
import TransactionHeader from '../_internal/components/transactionHeader';
import TokenPreview from '../_internal/components/tokenPreview';
import TransactionDetails from '../_internal/components/transactionDetails';
import { useCurrencies } from '@react-hooks/useCurrencies';
import { useAccount } from 'wagmi';
import { useSwitchChainModal } from '../_internal/components/switchChainModal';
import { Messages } from '../../../../types/messages';
import type { Messages } from '../../../../types/messages';

export type ShowSellModalArgs = {
chainId: string;
Expand Down
2 changes: 1 addition & 1 deletion src/react/ui/modals/SellModal/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfirmationStatus } from '../_internal/components/transactionStatusModal/store';
import type { ConfirmationStatus } from '../_internal/components/transactionStatusModal/store';

export const getSellModalTitle = ({
isConfirming,
Expand Down
6 changes: 3 additions & 3 deletions src/react/ui/modals/TransferModal/_store.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { observable } from '@legendapp/state';
import type { ShowTransferModalArgs } from '.';
import { Hex } from 'viem';
import { Messages } from '../../../../types/messages';
import { CollectionType } from '@internal';
import type { Hex } from 'viem';
import type { Messages } from '../../../../types/messages';
import type { CollectionType } from '@internal';

export interface TransferModalState {
isOpen: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';
import type { ConfirmationStatus } from '../../_internal/components/transactionStatusModal/store';

export const getTransferTransactionTitle = (params: ConfirmationStatus) => {
if (params.isConfirmed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { transferModal$ } from '../../_store';
import getMessage from '../../messages';
import { Box, Button, Text, TextInput } from '@0xsequence/design-system';
import { isAddress } from 'viem';
import { CollectionType, ContractType } from '@internal';
import { type CollectionType, ContractType } from '@internal';
import { useTokenBalances } from '@react-hooks/useListBalances';
import { useAccount } from 'wagmi';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ContractType } from '@internal';
import { transferModal$ } from '../../_store';
import { useCollection } from '@react-hooks/useCollection';
import { useTransferTokens } from '@react-hooks/useTransferTokens';
import { Hex } from 'viem';
import type { Hex } from 'viem';
import { useTransactionStatusModal } from '../../../_internal/components/transactionStatusModal';
import {
getTransferTransactionMessage,
Expand Down
4 changes: 2 additions & 2 deletions src/react/ui/modals/TransferModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { observer, Show } from '@legendapp/state/react';
import { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';
import { useAccount } from 'wagmi';
import { useSwitchChainModal } from '../_internal/components/switchChainModal';
import { Messages } from '../../../../types/messages';
import { Hex } from 'viem';
import type { Messages } from '../../../../types/messages';
import type { Hex } from 'viem';
import EnterWalletAddressView from './_views/enterWalletAddress';
import FollowWalletInstructionsView from './_views/followWalletInstructions';

Expand Down
2 changes: 1 addition & 1 deletion src/react/ui/modals/TransferModal/messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TransferModalState } from './_store';
import type { TransferModalState } from './_store';

type MessageKey = NonNullable<TransferModalState['view']>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { getPresentableChainName } from '../../../../../../utils/network';

import { UserRejectedRequestError } from 'viem';
import { SwitchChainNotSupportedError } from 'wagmi';
import { SwitchChainMessageCallbacks } from '../../../../../../types/messages';
import type { SwitchChainMessageCallbacks } from '../../../../../../types/messages';

export type ShowSwitchChainModalArgs = {
chainIdToSwitchTo: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { observable } from '@legendapp/state';
import { ShowSwitchChainModalArgs } from '.';
import { SwitchChainMessageCallbacks } from '../../../../../../types/messages';
import type { ShowSwitchChainModalArgs } from '.';
import type { SwitchChainMessageCallbacks } from '../../../../../../types/messages';

export interface SwitchChainModalState {
isOpen: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { truncateMiddle } from '../../../../../../utils';
import SvgPositiveCircleIcon from '../../../../icons/PositiveCircleIcon';
import { Box, Spinner, Text } from '@0xsequence/design-system';
import { Hex } from 'viem';
import type { Hex } from 'viem';

type TransactionFooterProps = {
transactionHash: Hex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export default function TransactionDetails({

if (royaltyPercentage !== undefined && formattedAmount) {
formattedAmount = (
parseFloat(formattedAmount) -
(parseFloat(formattedAmount) * Number(royaltyPercentage)) / 100
Number.parseFloat(formattedAmount) -
(Number.parseFloat(formattedAmount) * Number(royaltyPercentage)) / 100
).toString();
}

if (marketplaceFeePercentage !== undefined && formattedAmount) {
formattedAmount = (
parseFloat(formattedAmount) -
(parseFloat(formattedAmount) * marketplaceFeePercentage) / 100
Number.parseFloat(formattedAmount) -
(Number.parseFloat(formattedAmount) * marketplaceFeePercentage) / 100
).toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TimeAgo from '../timeAgo';
import { transactionStatusModal$ } from '../transactionStatusModal/store';
import { observer } from '@legendapp/state/react';
import { useTransactionPreviewTitle } from './useTransactionPreviewTitle';
import { Price } from '@types';
import type { Price } from '@types';
import { formatUnits } from 'viem';

type TransactionPreviewProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import {
import type {
ConfirmationStatus,
StatusOrderType,
} from '../transactionStatusModal/store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { observer } from '@legendapp/state/react';
import {
ConfirmationStatus,
StatusOrderType,
type ConfirmationStatus,
type StatusOrderType,
transactionStatusModal$,
} from './store';
import { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';
Expand All @@ -17,9 +17,9 @@ import {
Text,
} from '@0xsequence/design-system';
import { useCollectible } from '@react-hooks/useCollectible';
import { Hex } from 'viem';
import type { Hex } from 'viem';
import TransactionPreview from '../transactionPreview';
import { Price, TokenMetadata } from '@types';
import type { Price, TokenMetadata } from '@types';
import TransactionFooter from '../transaction-footer';
import { useTransactionReceipt } from 'wagmi';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { observable } from '@legendapp/state';
import { ShowTransactionStatusModalArgs as ShowTransactionStatusModalArgs } from '.';
import { TransactionStatus } from '@0xsequence/indexer';
import { Hex } from 'viem';
import { StepType } from '@internal';
import { Price } from '@types';
import type { ShowTransactionStatusModalArgs } from '.';
import type { TransactionStatus } from '@0xsequence/indexer';
import type { Hex } from 'viem';
import type { StepType } from '@internal';
import type { Price } from '@types';

export type ConfirmationStatus = {
isConfirming: boolean;
Expand Down

0 comments on commit d86845b

Please sign in to comment.