Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/typos in bridge store #1298

Open
wants to merge 3 commits into
base: sepolia
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/services/canvasService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ const getBadgeOrder = async profileContract => {
}
}

const fetchCanvasDetail = async (privider, othersAddress, profileAddress) => {
const { profileContract, name } = await queryCanvasUsername(privider, profileAddress)
const userBadges = await queryUserBadgesWrapped(privider, othersAddress)
const fetchCanvasDetail = async (provider, othersAddress, profileAddress) => {
const { profileContract, name } = await queryCanvasUsername(provider, profileAddress)
const userBadges = await queryUserBadgesWrapped(provider, othersAddress)
const { orderedAttachedBadges, attachedBadges, badgeOrder } = await getOrderedAttachedBadges(profileContract)
return { name, profileContract, userBadges, attachedBadges, orderedAttachedBadges, badgeOrder }
}
Expand Down
16 changes: 8 additions & 8 deletions src/stores/batchBridgeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ interface BatchBridgeStore {
bridgeSummaryType: BridgeSummaryType
depositBatchMode: DepositBatchMode
batchDepositConfig: BatchDepositConfig
depositAmountIsVaild: boolean
depositAmountIsValid: boolean

changeBridgeSummaryType: (depositTpye: BridgeSummaryType) => void
changeBridgeSummaryType: (depositType: BridgeSummaryType) => void
changeDepositBatchMode: (depositBatchMode: DepositBatchMode) => void
changeBatchDepositConfig: (batchDepositConfig: BatchDepositConfig) => void
changeDepositAmountIsVaild: (depositAmountIsVaild: boolean) => void
changeDepositAmountIsValid: (depositAmountIsValid: boolean) => void
}

const useBatchBridgeStore = create<BatchBridgeStore>()((set, get) => ({
Expand All @@ -40,11 +40,11 @@ const useBatchBridgeStore = create<BatchBridgeStore>()((set, get) => ({
maxDelayPerBatch: 0n,
safeBridgeGasLimit: 0n,
},
depositAmountIsVaild: true,
depositAmountIsValid: true,

changeBridgeSummaryType: bridgeSummaryType => {
changeBridgeSummaryType: depositType => {
set({
bridgeSummaryType,
bridgeSummaryType: depositType,
})
},

Expand All @@ -58,9 +58,9 @@ const useBatchBridgeStore = create<BatchBridgeStore>()((set, get) => ({
batchDepositConfig,
})
},
changeDepositAmountIsVaild: depositAmountIsVaild => {
changeDepositAmountIsValid: depositAmountIsValid => {
set({
depositAmountIsVaild,
depositAmountIsValid,
})
},
}))
Expand Down
29 changes: 15 additions & 14 deletions src/stores/bridgeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { loadState } from "@/utils/localStorage"

type TransactionType = "Deposit" | "Withdraw"

type WithDrawStep = "1" | "2"
type WithdrawStep = "1" | "2"

interface TxSuccess {
code: 1
Expand All @@ -18,15 +18,16 @@ export interface TxError {
}

type TxResult = TxSuccess | TxError | null

interface BridgeStore {
historyVisible: boolean
changeHistoryVisible: (value) => void
changeHistoryVisible: (value: boolean) => void

// new-bridge
fromNetwork: Network
toNetwork: Network
txType: TransactionType
withDrawStep: WithDrawStep
withdrawStep: WithdrawStep
txResult: TxResult
isNetworkCorrect: boolean
tokenList: Array<Token>
Expand All @@ -35,7 +36,7 @@ interface BridgeStore {
changeToNetwork: (network: Network) => void
changeTxType: (txType: TransactionType) => void
changeTxResult: (txResult: TxResult | null) => void
changeWithdrawStep: (withDrawStep: WithDrawStep) => void
changeWithdrawStep: (withdrawStep: WithdrawStep) => void
changeIsNetworkCorrect: (isNetworkCorrect: boolean) => void
fetchTokenList: () => Promise<void>
}
Expand All @@ -45,7 +46,7 @@ const useBridgeStore = create<BridgeStore>()((set, get) => ({
fromNetwork: NETWORKS[0],
toNetwork: NETWORKS[1],
txType: "Deposit",
withDrawStep: "1",
withdrawStep: "1",
txResult: null,
isNetworkCorrect: true,
tokenList: NATIVE_TOKEN_LIST,
Expand Down Expand Up @@ -87,44 +88,44 @@ const useBridgeStore = create<BridgeStore>()((set, get) => ({
}
},

changeHistoryVisible: value => {
changeHistoryVisible: (value: boolean) => {
set({
historyVisible: value,
})
},
changeFromNetwork: network => {
changeFromNetwork: (network: Network) => {
set({
fromNetwork: network,
})
},
changeToNetwork: network => {
changeToNetwork: (network: Network) => {
set({
toNetwork: network,
})
},
changeTxType: txType => {
changeTxType: (txType: TransactionType) => {
set({
txType,
})
},

changeTxResult: txResult => {
changeTxResult: (txResult: TxResult | null) => {
set({
txResult,
})
},

changeWithdrawStep: withDrawStep => {
changeWithdrawStep: (withdrawStep: WithdrawStep) => {
set({
withDrawStep,
withdrawStep,
})
},

changeIsNetworkCorrect: isNetworkCorrect => {
changeIsNetworkCorrect: (isNetworkCorrect: boolean) => {
set({
isNetworkCorrect,
})
},
}))

export default useBridgeStore
export default useBridgeStore