2019-08-21 08:53:47 +03:00
|
|
|
_section: Getting Started
|
|
|
|
|
|
|
|
|
|
|
|
_subsection: Installing
|
|
|
|
|
|
|
|
The various Classes and Functions are available to be imported
|
2020-02-02 15:58:29 +03:00
|
|
|
manually from sub-packages under the [@ethersproject](link-ethers-npm)
|
2019-08-21 08:53:47 +03:00
|
|
|
but for most projects, the umbrella package is the easiest way to
|
|
|
|
get started.
|
|
|
|
|
2020-04-19 09:18:20 +03:00
|
|
|
_code: @lang<shell>
|
|
|
|
|
|
|
|
/home/ricmoo> npm install --save ethers@next
|
2019-08-21 08:53:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
_subsection: Importing
|
|
|
|
|
|
|
|
_heading: Node.js
|
|
|
|
|
2020-05-08 10:24:40 +03:00
|
|
|
_code: node.js require @lang<script>
|
2020-04-19 09:18:20 +03:00
|
|
|
|
|
|
|
const { ethers } = require("ethers");
|
|
|
|
|
2020-05-08 10:24:40 +03:00
|
|
|
_code: ES6 or TypeScript @lang<script>
|
|
|
|
|
2020-04-19 09:18:20 +03:00
|
|
|
import { ethers } from "ethers";
|
|
|
|
|
2019-08-21 08:53:47 +03:00
|
|
|
|
|
|
|
_heading: Web Browser
|
|
|
|
|
|
|
|
It is generally better practice (for security reasons) to copy the
|
2020-02-02 15:58:29 +03:00
|
|
|
[ethers library](link-ethers-js) to your own webserver and serve it
|
|
|
|
yourself.
|
2019-08-21 08:53:47 +03:00
|
|
|
|
|
|
|
For quick demos or prototyping though, it can be loaded in your
|
|
|
|
Web Applications from our CDN.
|
|
|
|
|
2020-05-08 10:24:40 +03:00
|
|
|
|
|
|
|
_code: ES6 in the Browser @lang<html>
|
2020-04-19 09:18:20 +03:00
|
|
|
|
|
|
|
<script src="https://cdn.ethers.io/lib/ethers-5.0.esm.min.js"
|
|
|
|
type="application/javascipt"></script>
|
2020-05-08 10:24:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
_code: ES3 (UMD) in the Browser @lang<html>
|
|
|
|
|
|
|
|
<script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js"
|
|
|
|
type="application/javascipt"></script>
|