Skip to content

Commit ada614e

Browse files
Merge pull request #850 from threshold-network/chore/update-sdk-and-node-versions
chore: upgrade tbtc sdk & workflow config fixes
2 parents 8cd5ae3 + 28fb962 commit ada614e

File tree

12 files changed

+369
-39
lines changed

12 files changed

+369
-39
lines changed

.github/workflows/dashboard-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- uses: actions/setup-node@v3
3131
with:
32-
node-version: "18"
32+
node-version: "20"
3333
cache: "yarn"
3434

3535
# This step forces Git to download dependencies using `https://` protocol,
@@ -58,7 +58,7 @@ jobs:
5858

5959
- uses: actions/setup-node@v3
6060
with:
61-
node-version: "18"
61+
node-version: "20"
6262
cache: "yarn"
6363

6464
# We need this step because the `@keep-network/tbtc` which we update in

.github/workflows/dashboard-mainnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-node@v3
1919
with:
20-
node-version: "18"
20+
node-version: "20"
2121
cache: "yarn"
2222

2323
# This step forces Git to download dependencies using `https://` protocol,

.github/workflows/reusable-build-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787

8888
- uses: actions/setup-node@v3
8989
with:
90-
node-version: "18"
90+
node-version: "20"
9191
cache: "yarn"
9292

9393
# We need this step because the `@keep-network/tbtc` which we update in

craco.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const webpack = require("webpack")
33
module.exports = {
44
babel: {
55
plugins: [
6+
"@babel/plugin-proposal-numeric-separator",
67
"@babel/plugin-proposal-nullish-coalescing-operator",
78
"@babel/plugin-proposal-optional-chaining",
89
"@babel/plugin-proposal-logical-assignment-operators",
@@ -11,6 +12,8 @@ module.exports = {
1112
* ECPair library error used by "@keep-network/tbtc-v2.ts"
1213
*/
1314
["@babel/plugin-transform-class-properties", { loose: true }],
15+
["@babel/plugin-proposal-private-methods", { loose: true }],
16+
["@babel/plugin-proposal-private-property-in-object", { loose: true }],
1417
],
1518
},
1619
jest: {
@@ -36,6 +39,11 @@ module.exports = {
3639
},
3740
webpack: {
3841
configure: (webpackConfig) => {
42+
webpackConfig.module.rules.push({
43+
test: /\.mjs$/,
44+
include: /node_modules/,
45+
type: "javascript/auto",
46+
})
3947
// Add webpack plugins
4048
webpackConfig.plugins = [
4149
...webpackConfig.plugins,

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@keep-network/keep-ecdsa": "1.8.0",
1919
"@keep-network/random-beacon": "2.0.0",
2020
"@keep-network/tbtc": "1.1.0",
21-
"@keep-network/tbtc-v2.ts": "^2.7.1",
21+
"@keep-network/tbtc-v2.ts": "^2.8.0",
2222
"@ledgerhq/connect-kit-loader": "1.1.8",
2323
"@ledgerhq/wallet-api-client": "^1.2.0",
2424
"@ledgerhq/wallet-api-client-react": "^1.1.1",
@@ -111,7 +111,11 @@
111111
"babel-loader": "8.1.0",
112112
"react-error-overlay": "6.0.9",
113113
"@types/react": "17.0.30",
114-
"@tenderly/hardhat-tenderly": ">=1.0.12 <1.1.0"
114+
"@tenderly/hardhat-tenderly": ">=1.0.12 <1.1.0",
115+
"@solana/web3.js": "1.98.0",
116+
"@solana/errors": "2.1.0",
117+
"@solana/codecs-numbers": "2.1.0",
118+
"@solana/codecs-core": "2.1.0"
115119
},
116120
"devDependencies": {
117121
"@babel/plugin-proposal-logical-assignment-operators": "^7.20.7",

src/components/Forms/FormikInput.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC } from "react"
1+
import { ChangeEvent, FC, FocusEvent } from "react"
22
import {
33
FormControl,
44
FormControlProps,
@@ -20,6 +20,8 @@ export const FormikInput: FC<
2020
helperText?: string | JSX.Element
2121
placeholder?: string
2222
tooltip?: string
23+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void
24+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void
2325
}
2426
> = ({
2527
name,
@@ -28,6 +30,8 @@ export const FormikInput: FC<
2830
helperText,
2931
placeholder,
3032
tooltip,
33+
onChange,
34+
onBlur,
3135
...restProps
3236
}) => {
3337
const [field, meta] = useField(name)
@@ -75,8 +79,16 @@ export const FormikInput: FC<
7579
errorBorderColor="red.300"
7680
placeholder={placeholder}
7781
_placeholder={{ color: useColorModeValue("gray.400", "gray.500") }}
78-
{...field}
79-
value={meta.value}
82+
name={field.name}
83+
value={field.value}
84+
onChange={(e) => {
85+
field.onChange(e)
86+
onChange?.(e)
87+
}}
88+
onBlur={(e) => {
89+
field.onBlur(e)
90+
onBlur?.(e)
91+
}}
8092
/>
8193
<HelperErrorText
8294
helperText={helperText}

src/components/Modal/SelectWalletModal/ConnectSui.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ConnectSui: FC<{
1111
goBack={goBack}
1212
closeModal={closeModal}
1313
WalletIcon={SuiIcon}
14-
title="Sui"
14+
title="Sui Wallets"
1515
subTitle="Connect by choosing one of the available wallets."
1616
>
1717
<SuiWalletList closeModal={closeModal} />

src/components/Modal/SelectWalletModal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const baseWalletOptions: WalletOption[] = [
8282
},
8383
{
8484
id: WalletType.Sui,
85-
title: "Sui",
85+
title: "Sui Wallets",
8686
icon: {
8787
light: SuiIcon,
8888
dark: SuiIcon,

src/contexts/StarknetWalletProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const StarknetWalletProvider: React.FC<StarknetWalletProviderProps> = ({
196196
// Use starknetkit's connect with modal and custom dApp name
197197
const result = await connect({
198198
modalMode: "alwaysAsk",
199-
dappName: "StarkNet",
199+
dappName: "Starknet",
200200
modalTheme: "dark",
201201
})
202202

@@ -371,7 +371,7 @@ export const StarknetWalletProvider: React.FC<StarknetWalletProviderProps> = ({
371371
getStarknetKit().then(({ connect }) => {
372372
connect({
373373
modalMode: "neverAsk",
374-
dappName: "StarkNet",
374+
dappName: "Starknet",
375375
modalTheme: "dark",
376376
})
377377
.then((result: any) => {

src/pages/tBTC/Bridge/Minting/ProvideData.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
useState,
1313
useEffect,
1414
FocusEvent,
15+
ChangeEvent,
1516
} from "react"
1617
import { Form, FormikInput } from "../../../../components/Forms"
1718
import withOnlyConnectedWallet from "../../../../components/withOnlyConnectedWallet"
@@ -68,7 +69,6 @@ type ComponentProps = {
6869
const MintingProcessFormBase: FC<ComponentProps & FormikProps<FormValues>> = ({
6970
formId,
7071
values,
71-
setFieldTouched,
7272
}) => {
7373
const dispatch = useAppDispatch()
7474
const threshold = useThreshold()
@@ -80,9 +80,8 @@ const MintingProcessFormBase: FC<ComponentProps & FormikProps<FormValues>> = ({
8080
: BitcoinNetwork.Mainnet
8181
)
8282

83-
const handleBtcAddressChange = (event: FocusEvent<HTMLInputElement>) => {
83+
const handleBtcAddressChange = (event: ChangeEvent<HTMLInputElement>) => {
8484
const btcAddress = event.target.value
85-
setFieldTouched("btcRecoveryAddress", true)
8685

8786
const isValidFormat =
8887
validateBTCAddress(btcAddress, threshold.tbtc.bitcoinNetwork) ===
@@ -95,10 +94,6 @@ const MintingProcessFormBase: FC<ComponentProps & FormikProps<FormValues>> = ({
9594
ethChainId: SupportedChainIds.Ethereum,
9695
})
9796
)
98-
} else if (btcAddress) {
99-
console.log(
100-
"BTC Address format validation failed (onBlur) or address is empty."
101-
)
10297
}
10398
}
10499

@@ -156,6 +151,7 @@ const MintingProcessForm = withFormik<MintingProcessFormProps, FormValues>({
156151
},
157152
displayName: "MintingProcessForm",
158153
enableReinitialize: true,
154+
validateOnChange: false,
159155
})(MintingProcessFormBase)
160156

161157
export const ProvideDataComponent: FC<{

0 commit comments

Comments
 (0)