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

release: v0.26.0 to main #707

Merged
merged 17 commits into from
Dec 12, 2023
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create release PR

on:
workflow_dispatch:
inputs:
bump:
description: 'Version bump level'
required: true
default: patch
type: choice
options:
- patch
- minor
- major

jobs:
create-release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- id: run-create-release-pr-sh
env:
BUMP: ${{ inputs.bump }}
GH_TOKEN: ${{ github.token }}
run: |
# git config
git config user.name "GitHub Actions Bot"
git config user.email "<>"
# run shell script
cd scripts
./create-release-pr.sh
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xverse-web-extension",
"description": "A Bitcoin wallet for Web3",
"version": "0.25.0",
"version": "0.26.0",
"private": true,
"engines": {
"node": "^18.18.2"
Expand All @@ -10,7 +10,7 @@
"@ledgerhq/hw-transport-webusb": "^6.27.13",
"@phosphor-icons/react": "^2.0.10",
"@react-spring/web": "^9.6.1",
"@secretkeylabs/xverse-core": "5.0.0",
"@secretkeylabs/xverse-core": "5.2.0",
"@stacks/connect": "^6.10.2",
"@stacks/encryption": "4.3.5",
"@stacks/stacks-blockchain-api-types": "6.1.1",
Expand Down
3 changes: 3 additions & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release.json
pr-*.json
body.md
74 changes: 74 additions & 0 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#! /bin/bash

if [[ -z "$BUMP" ]]; then
echo "BUMP is required. major|minor|patch"
exit 1
fi

echo -e "\n--- Prepare for $BUMP release branch ---"

git fetch --all
git checkout develop
git pull

npm version $BUMP --git-tag-version=false
VERSION=$(npm pkg get version | sed 's/"//g')
TAG="v$VERSION"
BRANCH="release/$TAG"
TITLE="release: $TAG"

git checkout -B $BRANCH
git commit -am "$TITLE"
git merge origin/main -s ours

git push --set-upstream origin $BRANCH

echo -e "\n--- Create draft release for $TAG ---"

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/{owner}/{repo}/releases \
-f tag_name=$TAG \
-f target_commitish="$BRANCH" \
-f name=$TAG \
-F draft=true \
-F prerelease=true \
-F generate_release_notes=true > release.json

cat release.json | jq -r .body > body.md
echo -e "\n\nDraft release: $(cat release.json | jq -r .html_url)" >> body.md

for b in main develop; do
echo -e "\n--- Create PR to $b ---"

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/{owner}/{repo}/pulls \
-f title="$TITLE to $b" \
-f body="Created by GitHub Actions Bot" \
-f head="$BRANCH" \
-f base="$b" > pr-$b.json

echo -e "\n--- Update PR to $b with description ---"

PR_ID=$(cat pr-$b.json | jq -r .number)

gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/{owner}/{repo}/pulls/$PR_ID \
-F 'body=@body.md'

# clean up temp files
# rm pr-$b.json
done

echo -e "\n--- Done ---"
# clean up temp files
# rm release.json
# rm body.md
19 changes: 18 additions & 1 deletion src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import LoadingScreen from '@components/loadingScreen';
import { CheckCircle } from '@phosphor-icons/react';
import rootStore from '@stores/index';
import { QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
Expand Down Expand Up @@ -40,7 +41,23 @@ function App(): JSX.Element {
<SessionGuard>
<ThemeProvider theme={Theme}>
<RouterProvider router={router} />
<Toaster position="bottom-center" />
<Toaster
position="bottom-center"
containerStyle={{ bottom: 80 }}
toastOptions={{
success: {
icon: <CheckCircle size={20} weight="bold" />,
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.success_medium,
borderRadius: Theme.radius(2),
padding: Theme.spacing(4),
paddingLeft: Theme.spacing(6),
color: Theme.colors.elevation0,
},
},
}}
/>
</ThemeProvider>
</SessionGuard>
</PersistGate>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/bottomModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Modal from 'react-modal';
import styled, { useTheme } from 'styled-components';

const BottomModalHeaderText = styled.h1((props) => ({
...props.theme.body_bold_m,
...props.theme.typography.body_bold_l,
flex: 1,
}));

Expand Down
6 changes: 3 additions & 3 deletions src/app/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface Props {
icon?: JSX.Element;
iconPosition?: 'left' | 'right';
text: string;
onPress: () => void;
onPress: (e: React.MouseEvent<HTMLButtonElement>) => void;
processing?: boolean;
disabled?: boolean;
transparent?: boolean;
Expand All @@ -102,9 +102,9 @@ function ActionButton({
warning,
hoverDialogId,
}: Props) {
const handleOnPress = () => {
const handleOnPress = (e: React.MouseEvent<HTMLButtonElement>) => {
if (!disabled) {
onPress();
onPress(e);
}
};

Expand Down
4 changes: 4 additions & 0 deletions src/app/components/confirmBtcTransactionComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import TransactionSettingAlert from '@components/transactionSetting';
import TransferFeeView from '@components/transferFeeView';
import useNftDataSelector from '@hooks/stores/useNftDataSelector';
import useBtcClient from '@hooks/useBtcClient';
import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress';
import useSeedVault from '@hooks/useSeedVault';
import useWalletSelector from '@hooks/useWalletSelector';
Expand Down Expand Up @@ -148,6 +149,7 @@
const [signedTx, setSignedTx] = useState(signedTxHex);
const [total, setTotal] = useState<BigNumber>(new BigNumber(0));
const [showFeeWarning, setShowFeeWarning] = useState(false);
const btcClient = useBtcClient();

const bundle = selectedSatBundle ?? ordinalBundle ?? undefined;
const {
Expand All @@ -170,6 +172,7 @@
btcAddress,
selectedAccount?.id ?? 0,
seedPhrase,
btcClient,
network.type,
new BigNumber(txFee),
),
Expand Down Expand Up @@ -221,6 +224,7 @@
btcAddress,
Number(selectedAccount?.id),
seedPhrase,
btcClient,
network.type,
ordinalsUtxos,
new BigNumber(txFee),
Expand All @@ -235,7 +239,7 @@
setSignedTx(data.signedTx);
setShowFeeSettings(false);
}
}, [data]);

Check warning on line 242 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

Check warning on line 242 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

Check warning on line 242 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
if (ordinalData) {
Expand All @@ -243,7 +247,7 @@
setSignedTx(ordinalData.signedTx);
setShowFeeSettings(false);
}
}, [ordinalData]);

Check warning on line 250 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

Check warning on line 250 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

Check warning on line 250 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
let sum: BigNumber = new BigNumber(0);
Expand All @@ -262,7 +266,7 @@
setSignedTx(signedNonOrdinalBtcSend.signedTx);
setShowFeeSettings(false);
}
}, [signedNonOrdinalBtcSend]);

Check warning on line 269 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

Check warning on line 269 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

Check warning on line 269 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'setCurrentFee'. Either include it or remove the dependency array. If 'setCurrentFee' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
if (
Expand All @@ -273,7 +277,7 @@
} else if (showFeeWarning) {
setShowFeeWarning(false);
}
}, [currentFee, feeMultipliers]);

Check warning on line 280 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'showFeeWarning'. Either include it or remove the dependency array

Check warning on line 280 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'showFeeWarning'. Either include it or remove the dependency array

Check warning on line 280 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has a missing dependency: 'showFeeWarning'. Either include it or remove the dependency array

const onAdvancedSettingClick = () => {
setShowFeeSettings(true);
Expand Down Expand Up @@ -326,7 +330,7 @@
setError(t('TX_ERRORS.INSUFFICIENT_BALANCE_FEES'));
} else setError(txError.toString());
}
}, [txError]);

Check warning on line 333 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients' and 't'. Either include them or remove the dependency array

Check warning on line 333 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients' and 't'. Either include them or remove the dependency array

Check warning on line 333 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients' and 't'. Either include them or remove the dependency array

useEffect(() => {
if (recipients && ordinalError) {
Expand All @@ -337,7 +341,7 @@
setError(t('TX_ERRORS.INSUFFICIENT_BALANCE_FEES'));
} else setError(ordinalError.toString());
}
}, [ordinalError]);

Check warning on line 344 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

Check warning on line 344 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

Check warning on line 344 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

useEffect(() => {
if (recipients && errorSigningNonOrdial) {
Expand All @@ -348,7 +352,7 @@
setError(t('TX_ERRORS.INSUFFICIENT_BALANCE_FEES'));
} else setError(errorSigningNonOrdial.toString());
}
}, [errorSigningNonOrdial]);

Check warning on line 355 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

Check warning on line 355 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

Check warning on line 355 in src/app/components/confirmBtcTransactionComponent/index.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useEffect has missing dependencies: 'recipients', 't', and 'txError'. Either include them or remove the dependency array

return (
<>
Expand Down
19 changes: 11 additions & 8 deletions src/app/components/transactionSetting/editFee.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import useBtcClient from '@hooks/useBtcClient';
import useDebounce from '@hooks/useDebounce';
import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress';
import useWalletSelector from '@hooks/useWalletSelector';
Expand Down Expand Up @@ -57,10 +58,7 @@ const InputContainer = styled.div<InputContainerProps>((props) => ({
}`,
backgroundColor: props.theme.colors.elevation1,
borderRadius: props.theme.radius(1),
paddingLeft: props.theme.spacing(5),
paddingRight: props.theme.spacing(5),
paddingTop: props.theme.spacing(5),
paddingBottom: props.theme.spacing(5),
padding: props.theme.spacing(5),
}));

const InputField = styled.input((props) => ({
Expand Down Expand Up @@ -102,7 +100,7 @@ const FeeButton = styled.button<ButtonProps>((props) => ({
color: `${props.isSelected ? props.theme.colors.elevation2 : props.theme.colors.white_400}`,
background: `${props.isSelected ? props.theme.colors.white : 'transparent'}`,
border: `1px solid ${props.isSelected ? 'transparent' : props.theme.colors.elevation6}`,
borderRadius: 40,
borderRadius: props.theme.radius(9),
width: props.isBtc ? 104 : 82,
height: 40,
display: 'flex',
Expand All @@ -111,13 +109,13 @@ const FeeButton = styled.button<ButtonProps>((props) => ({
marginRight: props.isLastInRow ? 0 : 8,
}));

const ButtonContainer = styled.div({
const ButtonContainer = styled.div((props) => ({
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
marginTop: 12,
});
marginTop: props.theme.spacing(6),
}));

const FeeContainer = styled.div({
display: 'flex',
Expand Down Expand Up @@ -190,6 +188,7 @@ function EditFee({
const isStx = type === 'STX';
const { ordinals } = useOrdinalsByAddress(btcAddress);
const ordinalsUtxos = useMemo(() => ordinals?.map((ord) => ord.utxo), [ordinals]);
const btcClient = useBtcClient();

const modifyStxFees = (mode: string) => {
const currentFee = new BigNumber(fee);
Expand Down Expand Up @@ -237,6 +236,7 @@ function EditFee({
const { fee: modifiedFee, selectedFeeRate } = await getBtcFees(
btcRecipients,
btcAddress,
btcClient,
network.type,
mode,
);
Expand All @@ -248,6 +248,7 @@ function EditFee({
btcRecipients[0].address,
ordinalTxUtxo,
btcAddress,
btcClient,
network.type,
ordinalsUtxos || [],
mode,
Expand Down Expand Up @@ -297,6 +298,7 @@ function EditFee({
const { fee: modifiedFee, selectedFeeRate } = await getBtcFees(
btcRecipients,
btcAddress,
btcClient,
network.type,
feeMode,
feeRateInput,
Expand All @@ -322,6 +324,7 @@ function EditFee({
btcRecipients[0].address,
ordinalTxUtxo,
btcAddress,
btcClient,
network.type,
ordinalsUtxos || [],
feeMode,
Expand Down
1 change: 1 addition & 0 deletions src/app/components/transactionSetting/editNonce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface Props {
function EditNonce({ nonce, setNonce }: Props) {
const { t } = useTranslation('translation', { keyPrefix: 'TRANSACTION_SETTING' });
const [nonceInput, setNonceInput] = useState(nonce);

const onInputEditNonceChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setNonceInput(e.target.value);
};
Expand Down
Loading
Loading