@ethersproject/abi
Advanced tools
Comparing version 5.0.0-beta.131 to 5.0.0-beta.132
@@ -1,1 +0,1 @@ | ||
export declare const version = "5.0.0-beta.131"; | ||
export declare const version = "5.0.0-beta.132"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = "5.0.0-beta.131"; | ||
exports.version = "5.0.0-beta.132"; |
@@ -27,2 +27,3 @@ import { BigNumber } from "@ethersproject/bignumber"; | ||
readonly arrayChildren: ParamType; | ||
readonly _isParamType: boolean; | ||
constructor(constructorGuard: any, params: any); | ||
@@ -33,2 +34,3 @@ format(expanded?: boolean): string; | ||
static fromString(value: string, allowIndexed?: boolean): ParamType; | ||
static isParamType(value: any): value is ParamType; | ||
} | ||
@@ -39,2 +41,3 @@ export declare abstract class Fragment { | ||
readonly inputs: Array<ParamType>; | ||
readonly _isFragment: boolean; | ||
constructor(constructorGuard: any, params: any); | ||
@@ -45,2 +48,3 @@ format(expanded?: boolean): string; | ||
static fromString(value: string): Fragment; | ||
static isFragment(value: any): value is Fragment; | ||
} | ||
@@ -52,2 +56,3 @@ export declare class EventFragment extends Fragment { | ||
static fromString(value: string): EventFragment; | ||
static isEventFragment(value: any): value is EventFragment; | ||
} | ||
@@ -61,2 +66,3 @@ export declare class ConstructorFragment extends Fragment { | ||
static fromString(value: string): ConstructorFragment; | ||
static isConstructorFragment(value: any): value is ConstructorFragment; | ||
} | ||
@@ -69,2 +75,3 @@ export declare class FunctionFragment extends ConstructorFragment { | ||
static fromString(value: string): FunctionFragment; | ||
static isFunctionFragment(value: any): value is FunctionFragment; | ||
} |
@@ -218,2 +218,4 @@ "use strict"; | ||
} | ||
this._isParamType = true; | ||
Object.freeze(this); | ||
} | ||
@@ -258,3 +260,3 @@ // Format the parameter fragment | ||
ParamType.fromObject = function (value) { | ||
if (properties_1.isNamedInstance(ParamType, value)) { | ||
if (ParamType.isParamType(value)) { | ||
return value; | ||
@@ -280,2 +282,5 @@ } | ||
}; | ||
ParamType.isParamType = function (value) { | ||
return !!(value != null && value._isParamType); | ||
}; | ||
return ParamType; | ||
@@ -294,2 +299,4 @@ }()); | ||
populate(this, params); | ||
this._isFragment = true; | ||
Object.freeze(this); | ||
} | ||
@@ -325,2 +332,5 @@ // @TOOD: move logic to sub-classes; make this abstract | ||
Fragment.from = function (value) { | ||
if (Fragment.isFragment(value)) { | ||
return value; | ||
} | ||
if (typeof (value) === "string") { | ||
@@ -332,3 +342,3 @@ return Fragment.fromString(value); | ||
Fragment.fromObject = function (value) { | ||
if (properties_1.isNamedInstance(Fragment, value)) { | ||
if (Fragment.isFragment(value)) { | ||
return value; | ||
@@ -370,2 +380,5 @@ } | ||
}; | ||
Fragment.isFragment = function (value) { | ||
return !!(value && value._isFragment); | ||
}; | ||
return Fragment; | ||
@@ -386,3 +399,3 @@ }()); | ||
EventFragment.fromObject = function (value) { | ||
if (properties_1.isNamedInstance(EventFragment, value)) { | ||
if (EventFragment.isEventFragment(value)) { | ||
return value; | ||
@@ -424,2 +437,5 @@ } | ||
}; | ||
EventFragment.isEventFragment = function (value) { | ||
return (value && value._isFragment && value.type === "event"); | ||
}; | ||
return EventFragment; | ||
@@ -486,3 +502,3 @@ }(Fragment)); | ||
ConstructorFragment.fromObject = function (value) { | ||
if (properties_1.isNamedInstance(ConstructorFragment, value)) { | ||
if (ConstructorFragment.isConstructorFragment(value)) { | ||
return value; | ||
@@ -514,2 +530,5 @@ } | ||
}; | ||
ConstructorFragment.isConstructorFragment = function (value) { | ||
return (value && value._isFragment && value.type === "constructor"); | ||
}; | ||
return ConstructorFragment; | ||
@@ -530,3 +549,3 @@ }(Fragment)); | ||
FunctionFragment.fromObject = function (value) { | ||
if (properties_1.isNamedInstance(FunctionFragment, value)) { | ||
if (FunctionFragment.isFunctionFragment(value)) { | ||
return value; | ||
@@ -578,2 +597,5 @@ } | ||
}; | ||
FunctionFragment.isFunctionFragment = function (value) { | ||
return (value && value._isFragment && value.type === "function"); | ||
}; | ||
return FunctionFragment; | ||
@@ -580,0 +602,0 @@ }(ConstructorFragment)); |
@@ -23,2 +23,3 @@ import { BigNumber, BigNumberish } from "@ethersproject/bignumber"; | ||
readonly hash: string; | ||
static isIndexed(value: any): value is Indexed; | ||
} | ||
@@ -45,2 +46,3 @@ export declare class Result { | ||
readonly _abiCoder: AbiCoder; | ||
static _isInterface: boolean; | ||
constructor(fragments: string | Array<Fragment | JsonFragment | string>); | ||
@@ -69,2 +71,3 @@ static getAbiCoder(): AbiCoder; | ||
}): LogDescription; | ||
static isInterface(value: any): value is Interface; | ||
} |
@@ -53,2 +53,5 @@ "use strict"; | ||
} | ||
Indexed.isIndexed = function (value) { | ||
return !!(value && value._isIndexed); | ||
}; | ||
return Indexed; | ||
@@ -76,5 +79,2 @@ }(properties_1.Description)); | ||
properties_1.defineReadOnly(this, "fragments", abi.map(function (fragment) { | ||
if (properties_1.isNamedInstance(fragments_1.Fragment, fragment)) { | ||
return fragment; | ||
} | ||
return fragments_1.Fragment.from(fragment); | ||
@@ -130,2 +130,3 @@ }).filter(function (fragment) { return (fragment != null); })); | ||
} | ||
properties_1.defineReadOnly(this, "_isInterface", true); | ||
} | ||
@@ -306,6 +307,6 @@ Interface.getAbiCoder = function () { | ||
if (resultIndexed == null) { | ||
result[index] = new Indexed({ hash: null }); | ||
result[index] = new Indexed({ _isIndexed: true, hash: null }); | ||
} | ||
else if (dynamic[index]) { | ||
result[index] = new Indexed({ hash: resultIndexed[indexedIndex++] }); | ||
result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] }); | ||
} | ||
@@ -351,2 +352,16 @@ else { | ||
}; | ||
/* | ||
static from(value: Array<Fragment | string | JsonAbi> | string | Interface) { | ||
if (Interface.isInterface(value)) { | ||
return value; | ||
} | ||
if (typeof(value) === "string") { | ||
return new Interface(JSON.parse(value)); | ||
} | ||
return new Interface(value); | ||
} | ||
*/ | ||
Interface.isInterface = function (value) { | ||
return !!(value && value._isInterface); | ||
}; | ||
return Interface; | ||
@@ -353,0 +368,0 @@ }()); |
{ | ||
"name": "@ethersproject/abi", | ||
"version": "5.0.0-beta.131", | ||
"version": "5.0.0-beta.132", | ||
"description": "Error utility functions for ethers.", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
}, | ||
"tarballHash": "0x01c9130b48add5e7f90719d23992716773073976b4f9c183858ecf3362ada3ec" | ||
"tarballHash": "0x74367d2ba9f1a43ad8f0f5e0c5f815afd8d655ebae1ed710cd9e5d331557c78a" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84378
2097