Skip to content

Commit bf84b58

Browse files
authored
Merge pull request #13756 from ethereum/code-examples
fix: convert js example to ts string export
2 parents 7279e39 + 4bec49f commit bf84b58

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/data/CreateWallet.js renamed to src/data/CreateWallet.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// ? Should this become a `*.ts` file?
2-
// eslint-disable-next-line @typescript-eslint/no-var-requires
3-
const ethers = require("ethers")
1+
const createWallet = `const ethers = require("ethers")
42
53
// Create a wallet instance from a mnemonic...
64
const mnemonic =
@@ -51,3 +49,6 @@ wallet.sendTransaction(tx)
5149
// https://github.com/ethers-io/ethers.js/blob/master/docs/v5/api/signer/README.md#methods
5250
// Content is licensed under the Creative Commons License:
5351
// https://choosealicense.com/licenses/cc-by-4.0/
52+
`
53+
54+
export default createWallet

src/pages/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ import {
4545
isLangRightToLeft,
4646
} from "@/lib/utils/translations"
4747

48+
import CreateWalletContent from "@/data/CreateWallet"
49+
4850
import { BASE_TIME_UNIT } from "@/lib/constants"
4951

50-
import CreateWalletContent from "!!raw-loader!@/data/CreateWallet.js"
5152
import SimpleDomainRegistryContent from "!!raw-loader!@/data/SimpleDomainRegistry.sol"
5253
import SimpleTokenContent from "!!raw-loader!@/data/SimpleToken.sol"
5354
import SimpleWalletContent from "!!raw-loader!@/data/SimpleWallet.sol"

0 commit comments

Comments
 (0)