Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

ethers: Separate v5 and v6 subpaths #621

Closed
wants to merge 3 commits into from
Closed

Conversation

blukat29
Copy link
Contributor

@blukat29 blukat29 commented May 23, 2024

Using with ethers v5

// commonjs
const { Wallet } = require("@klaytn/ethers-ext")
const { Wallet } = require("@klaytn/ethers-ext").v5
const { Wallet } = require("@klaytn/ethers-ext/v5")

// esm
import { Wallet } from "@klaytn/ethers-ext";

// esm
import { v5 } from "@klaytn/ethers-ext";
const { Wallet } = v5;

// esm subpath import. If using typescript, add "moduleResolution": "nodenext" to tsconfig.json
import { Wallet } from "@klaytn/ethers-ext/v5";

Using with ethers v6

// commonjs
const { Wallet } = require("@klaytn/ethers-ext").v6
const { Wallet } = require("@klaytn/ethers-ext/v6")

// esm
import { v6 } from "@klaytn/ethers-ext";
const { Wallet } = v6;

// esm subpath import. If using typescript, add "moduleResolution": "nodenext" to tsconfig.json
import { Wallet } from "@klaytn/ethers-ext/v6";

@blukat29 blukat29 marked this pull request as draft May 24, 2024 02:34
@blukat29
Copy link
Contributor Author

blukat29 commented May 24, 2024

TODO: relocate examples under ethers-ext/example/v5 and fix the lines

// This example code demonstrates usage alongside ethers v5.
// Here we're explicitly importing ethers v5, but if your project only uses ethers v5 then you can require("ethers");
require("ethers5") // npm i ethers5@npm:ethers@5

@blukat29 blukat29 marked this pull request as ready for review May 28, 2024 05:03
@blukat29 blukat29 closed this Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants