usesendwallets
This commit is contained in:
parent
f89286ffdf
commit
6b59e1fa75
@ -13,7 +13,7 @@ import { usePaidMutation } from './use-paid-mutation'
|
|||||||
import { ACT_MUTATION } from '@/fragments/paidAction'
|
import { ACT_MUTATION } from '@/fragments/paidAction'
|
||||||
import { meAnonSats } from '@/lib/apollo'
|
import { meAnonSats } from '@/lib/apollo'
|
||||||
import { BoostItemInput } from './adv-post-form'
|
import { BoostItemInput } from './adv-post-form'
|
||||||
import { useWalletsWithPayments } from '@/wallets/index'
|
import { useSendWallets } from '@/wallets/index'
|
||||||
|
|
||||||
const defaultTips = [100, 1000, 10_000, 100_000]
|
const defaultTips = [100, 1000, 10_000, 100_000]
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ function BoostForm ({ step, onSubmit, children, item, oValue, inputRef, act = 'B
|
|||||||
export default function ItemAct ({ onClose, item, act = 'TIP', step, children, abortSignal }) {
|
export default function ItemAct ({ onClose, item, act = 'TIP', step, children, abortSignal }) {
|
||||||
const inputRef = useRef(null)
|
const inputRef = useRef(null)
|
||||||
const { me } = useMe()
|
const { me } = useMe()
|
||||||
const wallets = useWalletsWithPayments()
|
const wallets = useSendWallets()
|
||||||
const [oValue, setOValue] = useState()
|
const [oValue, setOValue] = useState()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -260,7 +260,7 @@ export function useAct ({ query = ACT_MUTATION, ...options } = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function useZap () {
|
export function useZap () {
|
||||||
const wallets = useWalletsWithPayments()
|
const wallets = useSendWallets()
|
||||||
const act = useAct()
|
const act = useAct()
|
||||||
const strike = useLightning()
|
const strike = useLightning()
|
||||||
const toaster = useToast()
|
const toaster = useToast()
|
||||||
|
@ -218,7 +218,7 @@ export function useWallet (name) {
|
|||||||
return wallets.find(w => w.def.name === name)
|
return wallets.find(w => w.def.name === name)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useWalletsWithPayments () {
|
export function useSendWallets () {
|
||||||
const { wallets } = useWallets()
|
const { wallets } = useWallets()
|
||||||
// return the first enabled wallet that is available and can send
|
// return the first enabled wallet that is available and can send
|
||||||
return wallets
|
return wallets
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { useWalletsWithPayments } from '@/wallets'
|
import { useSendWallets } from '@/wallets'
|
||||||
import { formatSats } from '@/lib/format'
|
import { formatSats } from '@/lib/format'
|
||||||
import { useInvoice } from '@/components/payment'
|
import { useInvoice } from '@/components/payment'
|
||||||
import { FAST_POLL_INTERVAL } from '@/lib/constants'
|
import { FAST_POLL_INTERVAL } from '@/lib/constants'
|
||||||
@ -11,7 +11,7 @@ import { canSend } from './common'
|
|||||||
import { useWalletLoggerFactory } from './logger'
|
import { useWalletLoggerFactory } from './logger'
|
||||||
|
|
||||||
export function useWalletPayment () {
|
export function useWalletPayment () {
|
||||||
const wallets = useWalletsWithPayments()
|
const wallets = useSendWallets()
|
||||||
const sendPayment = useSendPayment()
|
const sendPayment = useSendPayment()
|
||||||
const invoiceHelper = useInvoice()
|
const invoiceHelper = useInvoice()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user