mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 20:47:27 +03:00
Add fee to useSettings hook
This commit is contained in:
parent
40f80a94b8
commit
6badb91b6f
@ -125,7 +125,6 @@ const Send = ({ stopSending, value, conversion }) => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log({ network });
|
||||
if (network === 'bitcoin') {
|
||||
let url = 'https://bitcoiner.live/api/fees/estimates/latest';
|
||||
fetch(url)
|
||||
@ -134,7 +133,6 @@ const Send = ({ stopSending, value, conversion }) => {
|
||||
// let estimates = Object.keys(n.estimates);
|
||||
// let mid = Math.floor(estimates.length / 2);
|
||||
// let high = estimates.length - 1;
|
||||
console.log('hello');
|
||||
setFeeChoices({
|
||||
high: [30, n.estimates[30]['sat_per_vbyte']],
|
||||
mid: [180, n.estimates[180]['sat_per_vbyte']],
|
||||
|
@ -27,6 +27,8 @@ export const SettingsContext = createContext({
|
||||
setBtcState: () => {},
|
||||
history: [],
|
||||
setHistory: () => {},
|
||||
fee: 0,
|
||||
setFee: () => {},
|
||||
psbt: '',
|
||||
setPsbt: () => {},
|
||||
address: null,
|
||||
@ -58,6 +60,7 @@ export const SettingsProvider = ({ channel, children }) => {
|
||||
const [btcState, setBtcState] = useState(null);
|
||||
const [history, setHistory] = useState([]);
|
||||
const [psbt, setPsbt] = useState('');
|
||||
const [fee, setFee] = useState(0);
|
||||
const [address, setAddress] = useState(null);
|
||||
const [currencyRates, setCurrencyRates] = useState({
|
||||
BTC: { last: 1, symbol: 'BTC' },
|
||||
@ -223,6 +226,7 @@ export const SettingsProvider = ({ channel, children }) => {
|
||||
}
|
||||
if (psbtData) {
|
||||
setPsbt(psbtData.pb);
|
||||
setFee(psbtData.fee);
|
||||
}
|
||||
if (cancelTx) {
|
||||
handleCancelTx(cancelTx);
|
||||
@ -281,6 +285,8 @@ export const SettingsProvider = ({ channel, children }) => {
|
||||
setHistory,
|
||||
psbt,
|
||||
setPsbt,
|
||||
fee,
|
||||
setFee,
|
||||
address,
|
||||
setAddress,
|
||||
currencyRates,
|
||||
|
Loading…
Reference in New Issue
Block a user