Updated dist files.
This commit is contained in:
parent
f4c3073304
commit
2b88efea65
2
_version.d.ts
vendored
2
_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "4.0.0-beta.11";
|
export declare const version = "4.0.0-beta.12";
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "4.0.0-beta.11";
|
exports.version = "4.0.0-beta.12";
|
||||||
|
27
dist/ethers.js
vendored
27
dist/ethers.js
vendored
@ -1,7 +1,7 @@
|
|||||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethers = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethers = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "4.0.0-beta.11";
|
exports.version = "4.0.0-beta.12";
|
||||||
|
|
||||||
},{}],2:[function(require,module,exports){
|
},{}],2:[function(require,module,exports){
|
||||||
'use strict';
|
'use strict';
|
||||||
@ -957,6 +957,10 @@ var wallet_1 = require("./wallet");
|
|||||||
exports.HDNode = wallet_1.HDNode;
|
exports.HDNode = wallet_1.HDNode;
|
||||||
exports.SigningKey = wallet_1.SigningKey;
|
exports.SigningKey = wallet_1.SigningKey;
|
||||||
exports.Wallet = wallet_1.Wallet;
|
exports.Wallet = wallet_1.Wallet;
|
||||||
|
var abi_coder_1 = require("./utils/abi-coder");
|
||||||
|
exports.AbiCoder = abi_coder_1.AbiCoder;
|
||||||
|
var bignumber_1 = require("./utils/bignumber");
|
||||||
|
exports.BigNumber = bignumber_1.BigNumber;
|
||||||
var constants = __importStar(require("./utils/constants"));
|
var constants = __importStar(require("./utils/constants"));
|
||||||
exports.constants = constants;
|
exports.constants = constants;
|
||||||
var errors = __importStar(require("./utils/errors"));
|
var errors = __importStar(require("./utils/errors"));
|
||||||
@ -981,7 +985,7 @@ function getDefaultProvider(network) {
|
|||||||
}
|
}
|
||||||
exports.getDefaultProvider = getDefaultProvider;
|
exports.getDefaultProvider = getDefaultProvider;
|
||||||
|
|
||||||
},{"./_version":1,"./contracts":3,"./providers":52,"./types":57,"./utils":67,"./utils/constants":63,"./utils/errors":64,"./utils/shims":77,"./wallet":85,"./wordlists":89}],6:[function(require,module,exports){
|
},{"./_version":1,"./contracts":3,"./providers":52,"./types":57,"./utils":67,"./utils/abi-coder":58,"./utils/bignumber":61,"./utils/constants":63,"./utils/errors":64,"./utils/shims":77,"./wallet":85,"./wordlists":89}],6:[function(require,module,exports){
|
||||||
"use strict";
|
"use strict";
|
||||||
function __export(m) {
|
function __export(m) {
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||||
@ -10599,11 +10603,12 @@ var BaseProvider = /** @class */ (function (_super) {
|
|||||||
var result = tx;
|
var result = tx;
|
||||||
// Check the hash we expect is the same as the hash the server reported
|
// Check the hash we expect is the same as the hash the server reported
|
||||||
if (hash != null && tx.hash !== hash) {
|
if (hash != null && tx.hash !== hash) {
|
||||||
errors.throwError('Transaction hash mismatch from Proivder.sendTransaction.', errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
errors.throwError('Transaction hash mismatch from Provider.sendTransaction.', errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
||||||
}
|
}
|
||||||
this._emitted['t:' + tx.hash] = 'pending';
|
this._emitted['t:' + tx.hash] = 'pending';
|
||||||
result.wait = function (timeout) {
|
// @TODO: (confirmations? number, timeout? number)
|
||||||
return _this.waitForTransaction(hash, timeout).then(function (receipt) {
|
result.wait = function () {
|
||||||
|
return _this.waitForTransaction(hash).then(function (receipt) {
|
||||||
if (receipt.status === 0) {
|
if (receipt.status === 0) {
|
||||||
errors.throwError('transaction failed', errors.CALL_EXCEPTION, {
|
errors.throwError('transaction failed', errors.CALL_EXCEPTION, {
|
||||||
transactionHash: hash,
|
transactionHash: hash,
|
||||||
@ -13716,7 +13721,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var abi_coder_1 = require("./abi-coder");
|
var abi_coder_1 = require("./abi-coder");
|
||||||
exports.AbiCoder = abi_coder_1.AbiCoder;
|
|
||||||
exports.defaultAbiCoder = abi_coder_1.defaultAbiCoder;
|
exports.defaultAbiCoder = abi_coder_1.defaultAbiCoder;
|
||||||
exports.formatSignature = abi_coder_1.formatSignature;
|
exports.formatSignature = abi_coder_1.formatSignature;
|
||||||
exports.formatParamType = abi_coder_1.formatParamType;
|
exports.formatParamType = abi_coder_1.formatParamType;
|
||||||
@ -13729,7 +13733,6 @@ exports.getIcapAddress = address_1.getIcapAddress;
|
|||||||
var base64 = __importStar(require("./base64"));
|
var base64 = __importStar(require("./base64"));
|
||||||
exports.base64 = base64;
|
exports.base64 = base64;
|
||||||
var bignumber_1 = require("./bignumber");
|
var bignumber_1 = require("./bignumber");
|
||||||
exports.BigNumber = bignumber_1.BigNumber;
|
|
||||||
exports.bigNumberify = bignumber_1.bigNumberify;
|
exports.bigNumberify = bignumber_1.bigNumberify;
|
||||||
var bytes_1 = require("./bytes");
|
var bytes_1 = require("./bytes");
|
||||||
exports.arrayify = bytes_1.arrayify;
|
exports.arrayify = bytes_1.arrayify;
|
||||||
@ -13931,7 +13934,7 @@ function getNetwork(network) {
|
|||||||
var n = networks[network.name];
|
var n = networks[network.name];
|
||||||
// Not a standard network; check that it is a valid network in general
|
// Not a standard network; check that it is a valid network in general
|
||||||
if (!n) {
|
if (!n) {
|
||||||
if (typeof (n.chainId) !== 'number') {
|
if (typeof (network.chainId) !== 'number') {
|
||||||
errors.throwError('invalid network chainId', errors.INVALID_ARGUMENT, { arg: 'network', value: network });
|
errors.throwError('invalid network chainId', errors.INVALID_ARGUMENT, { arg: 'network', value: network });
|
||||||
}
|
}
|
||||||
return network;
|
return network;
|
||||||
@ -14022,7 +14025,7 @@ function setType(object, type) {
|
|||||||
}
|
}
|
||||||
exports.setType = setType;
|
exports.setType = setType;
|
||||||
function isType(object, type) {
|
function isType(object, type) {
|
||||||
return (object._ethersType === type);
|
return (object && object._ethersType === type);
|
||||||
}
|
}
|
||||||
exports.isType = isType;
|
exports.isType = isType;
|
||||||
function resolveProperties(object) {
|
function resolveProperties(object) {
|
||||||
@ -15938,11 +15941,7 @@ var Wallet = /** @class */ (function (_super) {
|
|||||||
}
|
}
|
||||||
if (this.mnemonic) {
|
if (this.mnemonic) {
|
||||||
// Make sure we don't accidentally bubble the mnemonic up the call-stack
|
// Make sure we don't accidentally bubble the mnemonic up the call-stack
|
||||||
var safeOptions = {};
|
options = properties_1.shallowCopy(options);
|
||||||
for (var key in options) {
|
|
||||||
safeOptions[key] = options[key];
|
|
||||||
}
|
|
||||||
options = safeOptions;
|
|
||||||
// Set the mnemonic and path
|
// Set the mnemonic and path
|
||||||
options.mnemonic = this.mnemonic;
|
options.mnemonic = this.mnemonic;
|
||||||
options.path = this.path;
|
options.path = this.path;
|
||||||
|
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js.map
vendored
2
dist/ethers.min.js.map
vendored
File diff suppressed because one or more lines are too long
184
dist/ethers.types.txt
vendored
184
dist/ethers.types.txt
vendored
@ -10,6 +10,8 @@ declare module 'ethers/ethers' {
|
|||||||
import { Contract, Interface } from 'ethers/contracts';
|
import { Contract, Interface } from 'ethers/contracts';
|
||||||
import * as providers from 'ethers/providers';
|
import * as providers from 'ethers/providers';
|
||||||
import { HDNode, SigningKey, Wallet } from 'ethers/wallet';
|
import { HDNode, SigningKey, Wallet } from 'ethers/wallet';
|
||||||
|
import { AbiCoder } from 'ethers/utils/abi-coder';
|
||||||
|
import { BigNumber } from 'ethers/utils/bignumber';
|
||||||
import * as constants from 'ethers/utils/constants';
|
import * as constants from 'ethers/utils/constants';
|
||||||
import * as errors from 'ethers/utils/errors';
|
import * as errors from 'ethers/utils/errors';
|
||||||
import * as utils from 'ethers/utils';
|
import * as utils from 'ethers/utils';
|
||||||
@ -18,7 +20,7 @@ declare module 'ethers/ethers' {
|
|||||||
import { platform } from 'ethers/utils/shims';
|
import { platform } from 'ethers/utils/shims';
|
||||||
import { version } from 'ethers/_version';
|
import { version } from 'ethers/_version';
|
||||||
function getDefaultProvider(network?: types.Network | string): providers.BaseProvider;
|
function getDefaultProvider(network?: types.Network | string): providers.BaseProvider;
|
||||||
export { Wallet, HDNode, SigningKey, Contract, Interface, getDefaultProvider, providers, errors, constants, utils, types, wordlists, platform, version };
|
export { Wallet, HDNode, SigningKey, Contract, Interface, getDefaultProvider, providers, AbiCoder, BigNumber, errors, constants, utils, types, wordlists, platform, version };
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'ethers/contracts' {
|
declare module 'ethers/contracts' {
|
||||||
@ -45,6 +47,75 @@ declare module 'ethers/wallet' {
|
|||||||
export { HDNode, SigningKey, Wallet };
|
export { HDNode, SigningKey, Wallet };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module 'ethers/utils/abi-coder' {
|
||||||
|
import { BigNumber } from 'ethers/utils/bignumber';
|
||||||
|
import { Arrayish } from 'ethers/utils/bytes';
|
||||||
|
export type CoerceFunc = (type: string, value: any) => any;
|
||||||
|
export type ParamType = {
|
||||||
|
name?: string;
|
||||||
|
type: string;
|
||||||
|
indexed?: boolean;
|
||||||
|
components?: Array<any>;
|
||||||
|
};
|
||||||
|
export type EventFragment = {
|
||||||
|
type: string;
|
||||||
|
name: string;
|
||||||
|
anonymous: boolean;
|
||||||
|
inputs: Array<ParamType>;
|
||||||
|
};
|
||||||
|
export type FunctionFragment = {
|
||||||
|
type: string;
|
||||||
|
name: string;
|
||||||
|
constant: boolean;
|
||||||
|
inputs: Array<ParamType>;
|
||||||
|
outputs: Array<ParamType>;
|
||||||
|
payable: boolean;
|
||||||
|
stateMutability: string;
|
||||||
|
gas: BigNumber;
|
||||||
|
};
|
||||||
|
export const defaultCoerceFunc: CoerceFunc;
|
||||||
|
export function parseParamType(type: string): ParamType;
|
||||||
|
export function formatParamType(paramType: ParamType): string;
|
||||||
|
export function formatSignature(fragment: EventFragment | FunctionFragment): string;
|
||||||
|
export function parseSignature(fragment: string): EventFragment | FunctionFragment;
|
||||||
|
export class AbiCoder {
|
||||||
|
readonly coerceFunc: CoerceFunc;
|
||||||
|
constructor(coerceFunc?: CoerceFunc);
|
||||||
|
encode(types: Array<string | ParamType>, values: Array<any>): string;
|
||||||
|
decode(types: Array<string | ParamType>, data: Arrayish): any;
|
||||||
|
}
|
||||||
|
export const defaultAbiCoder: AbiCoder;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'ethers/utils/bignumber' {
|
||||||
|
import { Hexable } from 'ethers/utils/bytes';
|
||||||
|
import { Arrayish } from 'ethers/utils/bytes';
|
||||||
|
export type BigNumberish = BigNumber | string | number | Arrayish;
|
||||||
|
export class BigNumber implements Hexable {
|
||||||
|
constructor(value: BigNumberish);
|
||||||
|
fromTwos(value: number): BigNumber;
|
||||||
|
toTwos(value: number): BigNumber;
|
||||||
|
add(other: BigNumberish): BigNumber;
|
||||||
|
sub(other: BigNumberish): BigNumber;
|
||||||
|
div(other: BigNumberish): BigNumber;
|
||||||
|
mul(other: BigNumberish): BigNumber;
|
||||||
|
mod(other: BigNumberish): BigNumber;
|
||||||
|
pow(other: BigNumberish): BigNumber;
|
||||||
|
maskn(value: number): BigNumber;
|
||||||
|
eq(other: BigNumberish): boolean;
|
||||||
|
lt(other: BigNumberish): boolean;
|
||||||
|
lte(other: BigNumberish): boolean;
|
||||||
|
gt(other: BigNumberish): boolean;
|
||||||
|
gte(other: BigNumberish): boolean;
|
||||||
|
isZero(): boolean;
|
||||||
|
toNumber(): number;
|
||||||
|
toString(): string;
|
||||||
|
toHexString(): string;
|
||||||
|
static isBigNumber(value: any): value is BigNumber;
|
||||||
|
}
|
||||||
|
export function bigNumberify(value: BigNumberish): BigNumber;
|
||||||
|
}
|
||||||
|
|
||||||
declare module 'ethers/utils/constants' {
|
declare module 'ethers/utils/constants' {
|
||||||
import { BigNumber } from 'ethers/utils/bignumber';
|
import { BigNumber } from 'ethers/utils/bignumber';
|
||||||
const AddressZero = "0x0000000000000000000000000000000000000000";
|
const AddressZero = "0x0000000000000000000000000000000000000000";
|
||||||
@ -79,10 +150,10 @@ declare module 'ethers/utils/errors' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare module 'ethers/utils' {
|
declare module 'ethers/utils' {
|
||||||
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from 'ethers/utils/abi-coder';
|
import { defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from 'ethers/utils/abi-coder';
|
||||||
import { getAddress, getContractAddress, getIcapAddress } from 'ethers/utils/address';
|
import { getAddress, getContractAddress, getIcapAddress } from 'ethers/utils/address';
|
||||||
import * as base64 from 'ethers/utils/base64';
|
import * as base64 from 'ethers/utils/base64';
|
||||||
import { BigNumber, bigNumberify } from 'ethers/utils/bignumber';
|
import { bigNumberify } from 'ethers/utils/bignumber';
|
||||||
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from 'ethers/utils/bytes';
|
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from 'ethers/utils/bytes';
|
||||||
import { hashMessage, id, namehash } from 'ethers/utils/hash';
|
import { hashMessage, id, namehash } from 'ethers/utils/hash';
|
||||||
import { getJsonWalletAddress } from 'ethers/utils/json-wallet';
|
import { getJsonWalletAddress } from 'ethers/utils/json-wallet';
|
||||||
@ -98,7 +169,7 @@ declare module 'ethers/utils' {
|
|||||||
import { toUtf8Bytes, toUtf8String } from 'ethers/utils/utf8';
|
import { toUtf8Bytes, toUtf8String } from 'ethers/utils/utf8';
|
||||||
import { formatEther, parseEther, formatUnits, parseUnits } from 'ethers/utils/units';
|
import { formatEther, parseEther, formatUnits, parseUnits } from 'ethers/utils/units';
|
||||||
import { fetchJson } from 'ethers/utils/web';
|
import { fetchJson } from 'ethers/utils/web';
|
||||||
export { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType, RLP, fetchJson, getNetwork, defineReadOnly, defineFrozen, resolveProperties, shallowCopy, arrayify, concat, padZeros, stripZeros, base64, BigNumber, bigNumberify, hexlify, hexStripZeros, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, formatEther, parseEther, formatUnits, parseUnits, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computePublicKey, verifyMessage };
|
export { defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType, RLP, fetchJson, getNetwork, defineReadOnly, defineFrozen, resolveProperties, shallowCopy, arrayify, concat, padZeros, stripZeros, base64, bigNumberify, hexlify, hexStripZeros, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, formatEther, parseEther, formatUnits, parseUnits, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computePublicKey, verifyMessage };
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'ethers/types' {
|
declare module 'ethers/types' {
|
||||||
@ -138,7 +209,7 @@ declare module 'ethers/utils/shims' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare module 'ethers/_version' {
|
declare module 'ethers/_version' {
|
||||||
export const version = "4.0.0-beta.11";
|
export const version = "4.0.0-beta.12";
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'ethers/contracts/contract' {
|
declare module 'ethers/contracts/contract' {
|
||||||
@ -553,92 +624,6 @@ declare module 'ethers/wallet/signing-key' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'ethers/utils/bignumber' {
|
|
||||||
import { Hexable } from 'ethers/utils/bytes';
|
|
||||||
import { Arrayish } from 'ethers/utils/bytes';
|
|
||||||
export type BigNumberish = BigNumber | string | number | Arrayish;
|
|
||||||
export class BigNumber implements Hexable {
|
|
||||||
constructor(value: BigNumberish);
|
|
||||||
fromTwos(value: number): BigNumber;
|
|
||||||
toTwos(value: number): BigNumber;
|
|
||||||
add(other: BigNumberish): BigNumber;
|
|
||||||
sub(other: BigNumberish): BigNumber;
|
|
||||||
div(other: BigNumberish): BigNumber;
|
|
||||||
mul(other: BigNumberish): BigNumber;
|
|
||||||
mod(other: BigNumberish): BigNumber;
|
|
||||||
pow(other: BigNumberish): BigNumber;
|
|
||||||
maskn(value: number): BigNumber;
|
|
||||||
eq(other: BigNumberish): boolean;
|
|
||||||
lt(other: BigNumberish): boolean;
|
|
||||||
lte(other: BigNumberish): boolean;
|
|
||||||
gt(other: BigNumberish): boolean;
|
|
||||||
gte(other: BigNumberish): boolean;
|
|
||||||
isZero(): boolean;
|
|
||||||
toNumber(): number;
|
|
||||||
toString(): string;
|
|
||||||
toHexString(): string;
|
|
||||||
static isBigNumber(value: any): value is BigNumber;
|
|
||||||
}
|
|
||||||
export function bigNumberify(value: BigNumberish): BigNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'ethers/utils/abi-coder' {
|
|
||||||
import { BigNumber } from 'ethers/utils/bignumber';
|
|
||||||
import { Arrayish } from 'ethers/utils/bytes';
|
|
||||||
export type CoerceFunc = (type: string, value: any) => any;
|
|
||||||
export type ParamType = {
|
|
||||||
name?: string;
|
|
||||||
type: string;
|
|
||||||
indexed?: boolean;
|
|
||||||
components?: Array<any>;
|
|
||||||
};
|
|
||||||
export type EventFragment = {
|
|
||||||
type: string;
|
|
||||||
name: string;
|
|
||||||
anonymous: boolean;
|
|
||||||
inputs: Array<ParamType>;
|
|
||||||
};
|
|
||||||
export type FunctionFragment = {
|
|
||||||
type: string;
|
|
||||||
name: string;
|
|
||||||
constant: boolean;
|
|
||||||
inputs: Array<ParamType>;
|
|
||||||
outputs: Array<ParamType>;
|
|
||||||
payable: boolean;
|
|
||||||
stateMutability: string;
|
|
||||||
gas: BigNumber;
|
|
||||||
};
|
|
||||||
export const defaultCoerceFunc: CoerceFunc;
|
|
||||||
export function parseParamType(type: string): ParamType;
|
|
||||||
export function formatParamType(paramType: ParamType): string;
|
|
||||||
export function formatSignature(fragment: EventFragment | FunctionFragment): string;
|
|
||||||
export function parseSignature(fragment: string): EventFragment | FunctionFragment;
|
|
||||||
export class AbiCoder {
|
|
||||||
readonly coerceFunc: CoerceFunc;
|
|
||||||
constructor(coerceFunc?: CoerceFunc);
|
|
||||||
encode(types: Array<string | ParamType>, values: Array<any>): string;
|
|
||||||
decode(types: Array<string | ParamType>, data: Arrayish): any;
|
|
||||||
}
|
|
||||||
export const defaultAbiCoder: AbiCoder;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'ethers/utils/address' {
|
|
||||||
import { BigNumber } from 'ethers/utils/bignumber';
|
|
||||||
import { Arrayish } from 'ethers/utils/bytes';
|
|
||||||
export function getAddress(address: string): string;
|
|
||||||
export function getIcapAddress(address: string): string;
|
|
||||||
export function getContractAddress(transaction: {
|
|
||||||
from: string;
|
|
||||||
nonce: Arrayish | BigNumber | number;
|
|
||||||
}): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'ethers/utils/base64' {
|
|
||||||
import { Arrayish } from 'ethers/utils/bytes';
|
|
||||||
export function decode(textData: string): Uint8Array;
|
|
||||||
export function encode(data: Arrayish): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'ethers/utils/bytes' {
|
declare module 'ethers/utils/bytes' {
|
||||||
/**
|
/**
|
||||||
* Conversion Utilities
|
* Conversion Utilities
|
||||||
@ -671,6 +656,23 @@ declare module 'ethers/utils/bytes' {
|
|||||||
export function joinSignature(signature: Signature): string;
|
export function joinSignature(signature: Signature): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module 'ethers/utils/address' {
|
||||||
|
import { BigNumber } from 'ethers/utils/bignumber';
|
||||||
|
import { Arrayish } from 'ethers/utils/bytes';
|
||||||
|
export function getAddress(address: string): string;
|
||||||
|
export function getIcapAddress(address: string): string;
|
||||||
|
export function getContractAddress(transaction: {
|
||||||
|
from: string;
|
||||||
|
nonce: Arrayish | BigNumber | number;
|
||||||
|
}): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module 'ethers/utils/base64' {
|
||||||
|
import { Arrayish } from 'ethers/utils/bytes';
|
||||||
|
export function decode(textData: string): Uint8Array;
|
||||||
|
export function encode(data: Arrayish): string;
|
||||||
|
}
|
||||||
|
|
||||||
declare module 'ethers/utils/hash' {
|
declare module 'ethers/utils/hash' {
|
||||||
import { Arrayish } from 'ethers/utils/bytes';
|
import { Arrayish } from 'ethers/utils/bytes';
|
||||||
export function namehash(name: string): string;
|
export function namehash(name: string): string;
|
||||||
|
4
ethers.d.ts
vendored
4
ethers.d.ts
vendored
@ -1,6 +1,8 @@
|
|||||||
import { Contract, Interface } from './contracts';
|
import { Contract, Interface } from './contracts';
|
||||||
import * as providers from './providers';
|
import * as providers from './providers';
|
||||||
import { HDNode, SigningKey, Wallet } from './wallet';
|
import { HDNode, SigningKey, Wallet } from './wallet';
|
||||||
|
import { AbiCoder } from './utils/abi-coder';
|
||||||
|
import { BigNumber } from './utils/bignumber';
|
||||||
import * as constants from './utils/constants';
|
import * as constants from './utils/constants';
|
||||||
import * as errors from './utils/errors';
|
import * as errors from './utils/errors';
|
||||||
import * as utils from './utils';
|
import * as utils from './utils';
|
||||||
@ -9,4 +11,4 @@ import * as wordlists from './wordlists';
|
|||||||
import { platform } from './utils/shims';
|
import { platform } from './utils/shims';
|
||||||
import { version } from './_version';
|
import { version } from './_version';
|
||||||
declare function getDefaultProvider(network?: types.Network | string): providers.BaseProvider;
|
declare function getDefaultProvider(network?: types.Network | string): providers.BaseProvider;
|
||||||
export { Wallet, HDNode, SigningKey, Contract, Interface, getDefaultProvider, providers, errors, constants, utils, types, wordlists, platform, version };
|
export { Wallet, HDNode, SigningKey, Contract, Interface, getDefaultProvider, providers, AbiCoder, BigNumber, errors, constants, utils, types, wordlists, platform, version };
|
||||||
|
@ -16,6 +16,10 @@ var wallet_1 = require("./wallet");
|
|||||||
exports.HDNode = wallet_1.HDNode;
|
exports.HDNode = wallet_1.HDNode;
|
||||||
exports.SigningKey = wallet_1.SigningKey;
|
exports.SigningKey = wallet_1.SigningKey;
|
||||||
exports.Wallet = wallet_1.Wallet;
|
exports.Wallet = wallet_1.Wallet;
|
||||||
|
var abi_coder_1 = require("./utils/abi-coder");
|
||||||
|
exports.AbiCoder = abi_coder_1.AbiCoder;
|
||||||
|
var bignumber_1 = require("./utils/bignumber");
|
||||||
|
exports.BigNumber = bignumber_1.BigNumber;
|
||||||
var constants = __importStar(require("./utils/constants"));
|
var constants = __importStar(require("./utils/constants"));
|
||||||
exports.constants = constants;
|
exports.constants = constants;
|
||||||
var errors = __importStar(require("./utils/errors"));
|
var errors = __importStar(require("./utils/errors"));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ethers",
|
"name": "ethers",
|
||||||
"version": "4.0.0-beta.11",
|
"version": "4.0.0-beta.12",
|
||||||
"description": "Ethereum wallet library.",
|
"description": "Ethereum wallet library.",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"types": "./index.d.ts",
|
"types": "./index.d.ts",
|
||||||
|
@ -685,11 +685,12 @@ var BaseProvider = /** @class */ (function (_super) {
|
|||||||
var result = tx;
|
var result = tx;
|
||||||
// Check the hash we expect is the same as the hash the server reported
|
// Check the hash we expect is the same as the hash the server reported
|
||||||
if (hash != null && tx.hash !== hash) {
|
if (hash != null && tx.hash !== hash) {
|
||||||
errors.throwError('Transaction hash mismatch from Proivder.sendTransaction.', errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
errors.throwError('Transaction hash mismatch from Provider.sendTransaction.', errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
|
||||||
}
|
}
|
||||||
this._emitted['t:' + tx.hash] = 'pending';
|
this._emitted['t:' + tx.hash] = 'pending';
|
||||||
result.wait = function (timeout) {
|
// @TODO: (confirmations? number, timeout? number)
|
||||||
return _this.waitForTransaction(hash, timeout).then(function (receipt) {
|
result.wait = function () {
|
||||||
|
return _this.waitForTransaction(hash).then(function (receipt) {
|
||||||
if (receipt.status === 0) {
|
if (receipt.status === 0) {
|
||||||
errors.throwError('transaction failed', errors.CALL_EXCEPTION, {
|
errors.throwError('transaction failed', errors.CALL_EXCEPTION, {
|
||||||
transactionHash: hash,
|
transactionHash: hash,
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "4.0.0-beta.11";
|
export const version = "4.0.0-beta.12";
|
||||||
|
@ -59,7 +59,7 @@ function checkTransaction(parsedTransaction, test) {
|
|||||||
var value = parsedTransaction[key];
|
var value = parsedTransaction[key];
|
||||||
|
|
||||||
if ({ gasLimit: 1, gasPrice: 1, value: 1 }[key]) {
|
if ({ gasLimit: 1, gasPrice: 1, value: 1 }[key]) {
|
||||||
assert.ok((ethers.utils.BigNumber.isBigNumber(value)),
|
assert.ok((ethers.BigNumber.isBigNumber(value)),
|
||||||
'parsed into a big number - ' + key);
|
'parsed into a big number - ' + key);
|
||||||
value = value.toHexString();
|
value = value.toHexString();
|
||||||
|
|
||||||
|
6
utils/index.d.ts
vendored
6
utils/index.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from './abi-coder';
|
import { defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from './abi-coder';
|
||||||
import { getAddress, getContractAddress, getIcapAddress } from './address';
|
import { getAddress, getContractAddress, getIcapAddress } from './address';
|
||||||
import * as base64 from './base64';
|
import * as base64 from './base64';
|
||||||
import { BigNumber, bigNumberify } from './bignumber';
|
import { bigNumberify } from './bignumber';
|
||||||
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from './bytes';
|
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from './bytes';
|
||||||
import { hashMessage, id, namehash } from './hash';
|
import { hashMessage, id, namehash } from './hash';
|
||||||
import { getJsonWalletAddress } from './json-wallet';
|
import { getJsonWalletAddress } from './json-wallet';
|
||||||
@ -17,4 +17,4 @@ import { parse as parseTransaction, serialize as serializeTransaction } from './
|
|||||||
import { toUtf8Bytes, toUtf8String } from './utf8';
|
import { toUtf8Bytes, toUtf8String } from './utf8';
|
||||||
import { formatEther, parseEther, formatUnits, parseUnits } from './units';
|
import { formatEther, parseEther, formatUnits, parseUnits } from './units';
|
||||||
import { fetchJson } from './web';
|
import { fetchJson } from './web';
|
||||||
export { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType, RLP, fetchJson, getNetwork, defineReadOnly, defineFrozen, resolveProperties, shallowCopy, arrayify, concat, padZeros, stripZeros, base64, BigNumber, bigNumberify, hexlify, hexStripZeros, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, formatEther, parseEther, formatUnits, parseUnits, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computePublicKey, verifyMessage };
|
export { defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType, RLP, fetchJson, getNetwork, defineReadOnly, defineFrozen, resolveProperties, shallowCopy, arrayify, concat, padZeros, stripZeros, base64, bigNumberify, hexlify, hexStripZeros, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, formatEther, parseEther, formatUnits, parseUnits, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computePublicKey, verifyMessage };
|
||||||
|
@ -8,7 +8,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var abi_coder_1 = require("./abi-coder");
|
var abi_coder_1 = require("./abi-coder");
|
||||||
exports.AbiCoder = abi_coder_1.AbiCoder;
|
|
||||||
exports.defaultAbiCoder = abi_coder_1.defaultAbiCoder;
|
exports.defaultAbiCoder = abi_coder_1.defaultAbiCoder;
|
||||||
exports.formatSignature = abi_coder_1.formatSignature;
|
exports.formatSignature = abi_coder_1.formatSignature;
|
||||||
exports.formatParamType = abi_coder_1.formatParamType;
|
exports.formatParamType = abi_coder_1.formatParamType;
|
||||||
@ -21,7 +20,6 @@ exports.getIcapAddress = address_1.getIcapAddress;
|
|||||||
var base64 = __importStar(require("./base64"));
|
var base64 = __importStar(require("./base64"));
|
||||||
exports.base64 = base64;
|
exports.base64 = base64;
|
||||||
var bignumber_1 = require("./bignumber");
|
var bignumber_1 = require("./bignumber");
|
||||||
exports.BigNumber = bignumber_1.BigNumber;
|
|
||||||
exports.bigNumberify = bignumber_1.bigNumberify;
|
exports.bigNumberify = bignumber_1.bigNumberify;
|
||||||
var bytes_1 = require("./bytes");
|
var bytes_1 = require("./bytes");
|
||||||
exports.arrayify = bytes_1.arrayify;
|
exports.arrayify = bytes_1.arrayify;
|
||||||
|
@ -81,7 +81,7 @@ function getNetwork(network) {
|
|||||||
var n = networks[network.name];
|
var n = networks[network.name];
|
||||||
// Not a standard network; check that it is a valid network in general
|
// Not a standard network; check that it is a valid network in general
|
||||||
if (!n) {
|
if (!n) {
|
||||||
if (typeof (n.chainId) !== 'number') {
|
if (typeof (network.chainId) !== 'number') {
|
||||||
errors.throwError('invalid network chainId', errors.INVALID_ARGUMENT, { arg: 'network', value: network });
|
errors.throwError('invalid network chainId', errors.INVALID_ARGUMENT, { arg: 'network', value: network });
|
||||||
}
|
}
|
||||||
return network;
|
return network;
|
||||||
|
@ -23,7 +23,7 @@ function setType(object, type) {
|
|||||||
}
|
}
|
||||||
exports.setType = setType;
|
exports.setType = setType;
|
||||||
function isType(object, type) {
|
function isType(object, type) {
|
||||||
return (object._ethersType === type);
|
return (object && object._ethersType === type);
|
||||||
}
|
}
|
||||||
exports.isType = isType;
|
exports.isType = isType;
|
||||||
function resolveProperties(object) {
|
function resolveProperties(object) {
|
||||||
|
@ -140,11 +140,7 @@ var Wallet = /** @class */ (function (_super) {
|
|||||||
}
|
}
|
||||||
if (this.mnemonic) {
|
if (this.mnemonic) {
|
||||||
// Make sure we don't accidentally bubble the mnemonic up the call-stack
|
// Make sure we don't accidentally bubble the mnemonic up the call-stack
|
||||||
var safeOptions = {};
|
options = properties_1.shallowCopy(options);
|
||||||
for (var key in options) {
|
|
||||||
safeOptions[key] = options[key];
|
|
||||||
}
|
|
||||||
options = safeOptions;
|
|
||||||
// Set the mnemonic and path
|
// Set the mnemonic and path
|
||||||
options.mnemonic = this.mnemonic;
|
options.mnemonic = this.mnemonic;
|
||||||
options.path = this.path;
|
options.path = this.path;
|
||||||
|
Loading…
Reference in New Issue
Block a user