@moralisweb3/evm-utils
Advanced tools
Comparing version 2.0.0-beta.9 to 2.0.0-beta.10
@@ -31,3 +31,3 @@ export interface EvmNativeCurrency { | ||
type: 'L2' | 'shard'; | ||
chain: 'eip155-4' | 'eip155-90' | 'eip155-100' | 'eip155-1' | 'eip155-100' | 'eip155-900' | 'eip155-100000' | 'eip155-110000'; | ||
chain: 'eip155-3' | 'eip155-4' | 'eip155-5' | 'eip155-90' | 'eip155-100' | 'eip155-1' | 'eip155-100' | 'eip155-250' | 'eip155-900' | 'eip155-100000' | 'eip155-110000'; | ||
bridges?: { | ||
@@ -37,5 +37,5 @@ url: string; | ||
}; | ||
deprecated?: boolean; | ||
status?: 'deprecated' | 'incubating'; | ||
} | ||
export declare const chainList: EvmChainListDataEntry[]; | ||
//# sourceMappingURL=chaindata.d.ts.map |
import { MoralisDataObject } from '@moralisweb3/core'; | ||
import { EvmAddress, EvmAddressish } from '../EvmAddress'; | ||
import { EvmChain, EvmChainish } from '../EvmChain'; | ||
export interface Erc20Input { | ||
decimals: number | string; | ||
name: string; | ||
symbol: string; | ||
contractAddress: EvmAddressish; | ||
chain: EvmChainish; | ||
logo?: string | null; | ||
logoHash?: string | null; | ||
thumbnail?: string | null; | ||
} | ||
interface Erc20Data { | ||
decimals: number; | ||
name: string; | ||
symbol: string; | ||
contractAddress: EvmAddress; | ||
chain: EvmChain; | ||
logo?: string | null; | ||
logoHash?: string | null; | ||
thumbnail?: string | null; | ||
} | ||
import { EvmAddress } from '../EvmAddress'; | ||
import { EvmChain } from '../EvmChain'; | ||
import { Erc20Input, Erc20Data } from './types'; | ||
export declare type Erc20Tokenish = Erc20Input | Erc20Token; | ||
@@ -66,3 +47,2 @@ /** | ||
} | ||
export {}; | ||
//# sourceMappingURL=Erc20.d.ts.map |
export * from './Erc20'; | ||
export * from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -18,2 +18,3 @@ "use strict"; | ||
__exportStar(require("./Erc20"), exports); | ||
__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -12,2 +12,3 @@ import { MoralisCore, EvmAddressFormat, Config, MoralisData } from '@moralisweb3/core'; | ||
private _value; | ||
static get ZERO_ADDRESS(): EvmAddress; | ||
constructor(address: InputEvmAddress, config: Config); | ||
@@ -14,0 +15,0 @@ /** |
@@ -23,2 +23,9 @@ "use strict"; | ||
}; | ||
Object.defineProperty(EvmAddress, "ZERO_ADDRESS", { | ||
get: function () { | ||
return EvmAddress.create('0x0000000000000000000000000000000000000000'); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
/** | ||
@@ -25,0 +32,0 @@ * Parse the input to a value that is compatible with the internal _value |
@@ -10,6 +10,17 @@ import { EvmChainish } from './EvmChainish'; | ||
private readonly config; | ||
/** | ||
* Accepts a {@link EvmChainish} value and returns a new EvmChain or an already existing EvmChain | ||
*/ | ||
static create(chain: EvmChainish, core?: MoralisCore): EvmChain; | ||
static get ETHEREUM(): EvmChain; | ||
static get ROPSTEN(): EvmChain; | ||
static get RINKEBY(): EvmChain; | ||
static get GOERLI(): EvmChain; | ||
static get KOVAN(): EvmChain; | ||
static get POLYGON(): EvmChain; | ||
static get MUMBAI(): EvmChain; | ||
static get BSC(): EvmChain; | ||
static get BSC_TESTNET(): EvmChain; | ||
static get AVALANCHE(): EvmChain; | ||
static get FUJI(): EvmChain; | ||
static get FANTOM(): EvmChain; | ||
static get CRONOS(): EvmChain; | ||
static get CRONOS_TESTNET(): EvmChain; | ||
private _value; | ||
@@ -16,0 +27,0 @@ private _chainlistData; |
@@ -21,5 +21,2 @@ "use strict"; | ||
} | ||
/** | ||
* Accepts a {@link EvmChainish} value and returns a new EvmChain or an already existing EvmChain | ||
*/ | ||
EvmChain.create = function (chain, core) { | ||
@@ -32,2 +29,100 @@ if (chain instanceof EvmChain) { | ||
}; | ||
Object.defineProperty(EvmChain, "ETHEREUM", { | ||
get: function () { | ||
return EvmChain.create(1); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "ROPSTEN", { | ||
get: function () { | ||
return EvmChain.create(3); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "RINKEBY", { | ||
get: function () { | ||
return EvmChain.create(4); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "GOERLI", { | ||
get: function () { | ||
return EvmChain.create(5); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "KOVAN", { | ||
get: function () { | ||
return EvmChain.create(42); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "POLYGON", { | ||
get: function () { | ||
return EvmChain.create(137); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "MUMBAI", { | ||
get: function () { | ||
return EvmChain.create(80001); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "BSC", { | ||
get: function () { | ||
return EvmChain.create(56); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "BSC_TESTNET", { | ||
get: function () { | ||
return EvmChain.create(97); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "AVALANCHE", { | ||
get: function () { | ||
return EvmChain.create(43113); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "FUJI", { | ||
get: function () { | ||
return EvmChain.create(43113); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "FANTOM", { | ||
get: function () { | ||
return EvmChain.create(250); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "CRONOS", { | ||
get: function () { | ||
return EvmChain.create(25); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmChain, "CRONOS_TESTNET", { | ||
get: function () { | ||
return EvmChain.create(338); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
/** | ||
@@ -34,0 +129,0 @@ * Getter to return _chainlistData and throws an error if it is not defined |
import { EvmChain } from './EvmChain'; | ||
export declare type ChainName = 'eth' | 'ropsten' | 'rinkeby' | 'goerli' | 'kovan' | 'polygon' | 'mumbai' | 'bsc' | 'bsc testnet' | 'avalanche' | 'avalanche testnet' | 'fantom'; | ||
export declare type InputChainId = string | ChainName | number; | ||
export declare type InputChainId = string | number; | ||
export declare type EvmChainish = EvmChain | InputChainId; | ||
//# sourceMappingURL=EvmChainish.d.ts.map |
@@ -5,19 +5,2 @@ "use strict"; | ||
var core_1 = require("@moralisweb3/core"); | ||
var isSupportedChainName = function (value) { | ||
return value in chainNameToChainIdMap; | ||
}; | ||
var chainNameToChainIdMap = { | ||
eth: '0x1', | ||
ropsten: '0x3', | ||
rinkeby: '0x4', | ||
goerli: '0x5', | ||
kovan: '0x2a', | ||
polygon: '0x89', | ||
mumbai: '0x13881', | ||
bsc: '0x38', | ||
'bsc testnet': '0x61', | ||
avalanche: '0xa86a', | ||
'avalanche testnet': '0xa869', | ||
fantom: '0xfa', | ||
}; | ||
var EvmChainParser = /** @class */ (function () { | ||
@@ -28,5 +11,2 @@ function EvmChainParser() { | ||
if (typeof chain === 'string') { | ||
if (isSupportedChainName(chain)) { | ||
return chainNameToChainIdMap[chain]; | ||
} | ||
if (chain.startsWith('0x') && chain !== '0x' && chain !== '0x0') { | ||
@@ -37,3 +17,3 @@ return chain; | ||
code: core_1.CoreErrorCode.INVALID_ARGUMENT, | ||
message: "Invalid provided chain, value must be a positive number, chain-name or a hex-string starting with '0x'", | ||
message: "Invalid provided chain, value must be a positive number, or a hex-string starting with '0x'", | ||
}); | ||
@@ -40,0 +20,0 @@ } |
@@ -11,2 +11,5 @@ import { BigNumber, BigNumberish, MoralisData } from '@moralisweb3/core'; | ||
private readonly rawValue; | ||
static get ONE_ETH(): EvmNative; | ||
static get ONE_GWEI(): EvmNative; | ||
static get ONE_WEI(): EvmNative; | ||
private constructor(); | ||
@@ -13,0 +16,0 @@ static create(native: EvmNativeish, unit?: UnitOrDecimals): EvmNative; |
@@ -22,2 +22,23 @@ "use strict"; | ||
} | ||
Object.defineProperty(EvmNative, "ONE_ETH", { | ||
get: function () { | ||
return EvmNative.create(1, 'ether'); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmNative, "ONE_GWEI", { | ||
get: function () { | ||
return EvmNative.create(1, 'gwei'); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(EvmNative, "ONE_WEI", { | ||
get: function () { | ||
return EvmNative.create(1, 'wei'); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
EvmNative.create = function (native, unit) { | ||
@@ -24,0 +45,0 @@ if (native instanceof EvmNative) { |
import { MoralisDataObject } from '@moralisweb3/core'; | ||
import { EvmTransactionResponse } from '../EvmTransactionResponse/EvmTransactionResponse'; | ||
import { EvmTransactionInput, EvmTransactionData, EthersJsTransactionRequest } from './EvmTransactionTypes'; | ||
export declare type EvmTransactionish = EvmTransactionInput | EvmTransaction; | ||
/** | ||
* The EvmTransaction class is a MoralisData that references an Evm transaction request, | ||
* that is meant to be sent to the network. | ||
* | ||
* @see EvmTransactionResponse for a published transaction that has been sent to the network | ||
* @see EvmTransactionReceipt for a confirmed transaction | ||
*/ | ||
import { EvmTransacionInput, EvmTransactionData } from './types'; | ||
export declare type EvmTransactionish = EvmTransacionInput | EvmTransaction; | ||
export declare class EvmTransaction implements MoralisDataObject { | ||
private _value; | ||
private _sendCall; | ||
constructor(value: EvmTransactionInput, sendCall?: (value: EvmTransaction) => Promise<EvmTransactionResponse>); | ||
static create(transaction: EvmTransactionish, sendCall?: (value: EvmTransaction) => Promise<EvmTransactionResponse>): EvmTransaction; | ||
static parse(value: EvmTransactionInput): EvmTransactionData; | ||
static equals(providedTransactionA: EvmTransactionish, providedTransactionB: EvmTransactionish): boolean; | ||
equals(value: EvmTransactionish): boolean; | ||
toEthRequest(): EthersJsTransactionRequest; | ||
send: () => Promise<EvmTransactionResponse>; | ||
private _data; | ||
constructor(data: EvmTransacionInput); | ||
static parse: (data: EvmTransacionInput) => EvmTransactionData; | ||
static create(data: EvmTransactionish): EvmTransaction; | ||
static equals(dataA: EvmTransactionish, dataB: EvmTransactionish): boolean; | ||
equals(data: EvmTransactionish): boolean; | ||
toJSON(): { | ||
to: string | undefined; | ||
from: string; | ||
nonce: string; | ||
gasLimit: string | undefined; | ||
gasPrice: string | undefined; | ||
nonce: string | undefined; | ||
gas: string | undefined; | ||
gasPrice: string; | ||
gasUsed: string; | ||
cumulativeGasUsed: string; | ||
blockNumber: string; | ||
value: string | undefined; | ||
chain: string | number; | ||
maxPriorityFeePerGas: string | undefined; | ||
maxFeePerGas: string | undefined; | ||
data?: import("../types").BytesLike | undefined; | ||
contractAddress: string | undefined; | ||
logs: { | ||
address: string; | ||
logIndex?: number | undefined; | ||
transactionHash: string; | ||
transactionIndex?: number | undefined; | ||
data: string; | ||
topics: string[]; | ||
blockHash: string; | ||
blockNumber: number; | ||
blockTimestamp?: string | undefined; | ||
}[]; | ||
data?: string | undefined; | ||
hash: string; | ||
type?: number | undefined; | ||
accessList?: import("../types").AccessList | undefined; | ||
index: number; | ||
blockHash: string; | ||
blockTimestamp: Date; | ||
receiptRoot?: string | undefined; | ||
receiptStatus?: number | undefined; | ||
}; | ||
@@ -39,12 +46,30 @@ format(): { | ||
from: string; | ||
nonce: string; | ||
gasLimit: string | undefined; | ||
gasPrice: string | undefined; | ||
nonce: string | undefined; | ||
gas: string | undefined; | ||
gasPrice: string; | ||
gasUsed: string; | ||
cumulativeGasUsed: string; | ||
blockNumber: string; | ||
value: string | undefined; | ||
chain: string | number; | ||
maxPriorityFeePerGas: string | undefined; | ||
maxFeePerGas: string | undefined; | ||
data?: import("../types").BytesLike | undefined; | ||
contractAddress: string | undefined; | ||
logs: { | ||
address: string; | ||
logIndex?: number | undefined; | ||
transactionHash: string; | ||
transactionIndex?: number | undefined; | ||
data: string; | ||
topics: string[]; | ||
blockHash: string; | ||
blockNumber: number; | ||
blockTimestamp?: string | undefined; | ||
}[]; | ||
data?: string | undefined; | ||
hash: string; | ||
type?: number | undefined; | ||
accessList?: import("../types").AccessList | undefined; | ||
index: number; | ||
blockHash: string; | ||
blockTimestamp: Date; | ||
receiptRoot?: string | undefined; | ||
receiptStatus?: number | undefined; | ||
}; | ||
@@ -51,0 +76,0 @@ get result(): EvmTransactionData; |
@@ -13,16 +13,4 @@ "use strict"; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EvmTransaction = void 0; | ||
var transactions_1 = require("@ethersproject/transactions"); | ||
var core_1 = require("@moralisweb3/core"); | ||
@@ -32,67 +20,31 @@ var EvmAddress_1 = require("../EvmAddress"); | ||
var EvmNative_1 = require("../EvmNative"); | ||
/** | ||
* The EvmTransaction class is a MoralisData that references an Evm transaction request, | ||
* that is meant to be sent to the network. | ||
* | ||
* @see EvmTransactionResponse for a published transaction that has been sent to the network | ||
* @see EvmTransactionReceipt for a confirmed transaction | ||
*/ | ||
var EvmTransactionLog_1 = require("../EvmTransactionLog"); | ||
var EvmTransaction = /** @class */ (function () { | ||
function EvmTransaction(value, sendCall) { | ||
var _this = this; | ||
this.send = function () { | ||
if (!_this._sendCall) { | ||
throw new core_1.MoralisCoreError({ | ||
code: core_1.CoreErrorCode.GENERIC_CORE_ERROR, | ||
message: 'Cannot send transaction, no supported call method provided', | ||
}); | ||
} | ||
return _this._sendCall(_this); | ||
}; | ||
this._value = EvmTransaction.parse(value); | ||
this._sendCall = sendCall; | ||
function EvmTransaction(data) { | ||
this._data = EvmTransaction.parse(data); | ||
} | ||
EvmTransaction.create = function (transaction, sendCall) { | ||
if (transaction instanceof EvmTransaction) { | ||
return transaction; | ||
EvmTransaction.create = function (data) { | ||
if (data instanceof EvmTransaction) { | ||
return data; | ||
} | ||
return new EvmTransaction(transaction, sendCall); | ||
return new EvmTransaction(data); | ||
}; | ||
EvmTransaction.parse = function (value) { | ||
return { | ||
to: (0, core_1.maybe)(value.to, EvmAddress_1.EvmAddress.create), | ||
from: (0, core_1.maybe)(value.from, EvmAddress_1.EvmAddress.create), | ||
nonce: (0, core_1.maybe)(value.nonce, core_1.BigNumber.create), | ||
gasLimit: (0, core_1.maybe)(value.gasLimit, core_1.BigNumber.create), | ||
gasPrice: (0, core_1.maybe)(value.gasPrice, core_1.BigNumber.create), | ||
data: (0, core_1.maybe)(value.data), | ||
value: (0, core_1.maybe)(value.value, function (val) { return EvmNative_1.EvmNative.create(val, 'wei'); }), | ||
chain: (0, core_1.maybe)(value.chain, EvmChain_1.EvmChain.create), | ||
type: (0, core_1.maybe)(value.type), | ||
accessList: (0, core_1.maybe)(value.accessList, transactions_1.accessListify), | ||
maxPriorityFeePerGas: (0, core_1.maybe)(value.maxPriorityFeePerGas, core_1.BigNumber.create), | ||
maxFeePerGas: (0, core_1.maybe)(value.maxFeePerGas, core_1.BigNumber.create), | ||
}; | ||
}; | ||
EvmTransaction.equals = function (providedTransactionA, providedTransactionB) { | ||
var transactionA = EvmTransaction.create(providedTransactionA); | ||
var transactionB = EvmTransaction.create(providedTransactionB); | ||
if (JSON.stringify(transactionA.toJSON()) === JSON.stringify(transactionB.toJSON())) { | ||
return true; | ||
EvmTransaction.equals = function (dataA, dataB) { | ||
var transactionA = EvmTransaction.create(dataA); | ||
var transactionB = EvmTransaction.create(dataB); | ||
if (!transactionA._data.chain.equals(transactionB._data.chain)) { | ||
return false; | ||
} | ||
return false; | ||
if (transactionA._data.hash !== transactionB._data.hash) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
EvmTransaction.prototype.equals = function (value) { | ||
return EvmTransaction.equals(this, value); | ||
EvmTransaction.prototype.equals = function (data) { | ||
return EvmTransaction.equals(this, data); | ||
}; | ||
EvmTransaction.prototype.toEthRequest = function () { | ||
var _a, _b, _c; | ||
var _d = this._value, chain = _d.chain, value = __rest(_d, ["chain"]); | ||
return __assign(__assign({}, value), { to: (_a = value.to) === null || _a === void 0 ? void 0 : _a.checksum, from: (_b = value.from) === null || _b === void 0 ? void 0 : _b.checksum, chainId: chain === null || chain === void 0 ? void 0 : chain.decimal, value: (_c = value.value) === null || _c === void 0 ? void 0 : _c.format() }); | ||
}; | ||
EvmTransaction.prototype.toJSON = function () { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j; | ||
var value = this._value; | ||
var out = __assign(__assign({}, value), { to: (_a = value.to) === null || _a === void 0 ? void 0 : _a.format(), from: (_b = value.from) === null || _b === void 0 ? void 0 : _b.format(), nonce: (_c = value.nonce) === null || _c === void 0 ? void 0 : _c.toString(), gasLimit: (_d = value.gasLimit) === null || _d === void 0 ? void 0 : _d.toString(), gasPrice: (_e = value.gasPrice) === null || _e === void 0 ? void 0 : _e.toString(), value: (_f = value.value) === null || _f === void 0 ? void 0 : _f.toString(), chain: (_g = value.chain) === null || _g === void 0 ? void 0 : _g.format(), maxPriorityFeePerGas: (_h = value.maxPriorityFeePerGas) === null || _h === void 0 ? void 0 : _h.toString(), maxFeePerGas: (_j = value.maxFeePerGas) === null || _j === void 0 ? void 0 : _j.toString() }); | ||
return out; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var data = this._data; | ||
return __assign(__assign({}, data), { to: (_a = data.to) === null || _a === void 0 ? void 0 : _a.format(), from: (_b = data.from) === null || _b === void 0 ? void 0 : _b.format(), nonce: (_c = data.nonce) === null || _c === void 0 ? void 0 : _c.toString(), gas: (_d = data.gas) === null || _d === void 0 ? void 0 : _d.toString(), gasPrice: (_e = data.gasPrice) === null || _e === void 0 ? void 0 : _e.toString(), gasUsed: (_f = data.gasUsed) === null || _f === void 0 ? void 0 : _f.toString(), cumulativeGasUsed: (_g = data.cumulativeGasUsed) === null || _g === void 0 ? void 0 : _g.toString(), blockNumber: (_h = data.blockNumber) === null || _h === void 0 ? void 0 : _h.toString(), value: (_j = data.value) === null || _j === void 0 ? void 0 : _j.toString(), chain: (_k = data.chain) === null || _k === void 0 ? void 0 : _k.format(), contractAddress: (_l = data.contractAddress) === null || _l === void 0 ? void 0 : _l.format(), logs: data.logs.map(function (log) { return log.toJSON(); }) }); | ||
}; | ||
@@ -104,3 +56,3 @@ EvmTransaction.prototype.format = function () { | ||
get: function () { | ||
return this._value; | ||
return this._data; | ||
}, | ||
@@ -110,2 +62,27 @@ enumerable: false, | ||
}); | ||
EvmTransaction.parse = function (data) { | ||
var _a; | ||
return ({ | ||
from: (0, core_1.maybe)(data.from, EvmAddress_1.EvmAddress.create), | ||
to: (0, core_1.maybe)(data.to, EvmAddress_1.EvmAddress.create), | ||
nonce: (0, core_1.maybe)(data.nonce, core_1.BigNumber.create), | ||
data: (0, core_1.maybe)(data.data), | ||
value: (0, core_1.maybe)(data.value, function (val) { return EvmNative_1.EvmNative.create(val, 'wei'); }), | ||
hash: data.hash, | ||
type: (0, core_1.maybe)(data.type), | ||
chain: EvmChain_1.EvmChain.create(data.chain), | ||
gas: (0, core_1.maybe)(data.gas, core_1.BigNumber.create), | ||
gasPrice: core_1.BigNumber.create(data.gasPrice), | ||
index: +data.index, | ||
blockNumber: core_1.BigNumber.create(data.blockNumber), | ||
blockHash: data.blockHash, | ||
blockTimestamp: (0, core_1.dateInputToDate)(data.blockTimestamp), | ||
cumulativeGasUsed: core_1.BigNumber.create(data.cumulativeGasUsed), | ||
gasUsed: core_1.BigNumber.create(data.gasUsed), | ||
contractAddress: (0, core_1.maybe)(data.contractAddress, EvmAddress_1.EvmAddress.create), | ||
receiptRoot: (0, core_1.maybe)(data.receiptRoot), | ||
receiptStatus: (0, core_1.maybe)(data.receiptStatus, function (status) { return +status; }), | ||
logs: ((_a = data.logs) !== null && _a !== void 0 ? _a : []).map(function (log) { return EvmTransactionLog_1.EvmTransactionLog.create(log); }), | ||
}); | ||
}; | ||
return EvmTransaction; | ||
@@ -112,0 +89,0 @@ }()); |
@@ -0,3 +1,3 @@ | ||
export * from './types'; | ||
export * from './EvmTransaction'; | ||
export * from './EvmTransactionTypes'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -17,4 +17,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./EvmTransaction"), exports); | ||
__exportStar(require("./EvmTransactionTypes"), exports); | ||
//# sourceMappingURL=index.js.map |
import { MoralisDataObject } from '@moralisweb3/core'; | ||
import { EvmAddress, EvmAddressish } from '../EvmAddress'; | ||
export interface EvmTransactionLogInput { | ||
logIndex?: number; | ||
transactionHash: string; | ||
transactionIndex?: number; | ||
address: EvmAddressish; | ||
data: string; | ||
topics: string[]; | ||
blockHash: string; | ||
blockNumber: number; | ||
blockTimestamp?: string; | ||
} | ||
export interface EvmTransactionLogData { | ||
logIndex?: number; | ||
transactionHash: string; | ||
transactionIndex?: number; | ||
address: EvmAddress; | ||
data: string; | ||
topics: string[]; | ||
blockHash: string; | ||
blockNumber: number; | ||
blockTimestamp?: string; | ||
} | ||
import { EvmTransactionLogData, EvmTransactionLogInput } from './types'; | ||
export declare type EvmTransactionLogish = EvmTransactionLogInput | EvmTransactionLog; | ||
export declare class EvmTransactionLog implements MoralisDataObject { | ||
@@ -29,3 +8,3 @@ private _value; | ||
static parse(value: EvmTransactionLogInput): EvmTransactionLogData; | ||
static create(value: EvmTransactionLogInput): EvmTransactionLog; | ||
static create(value: EvmTransactionLogish): EvmTransactionLog; | ||
equals(value: this): boolean; | ||
@@ -32,0 +11,0 @@ toJSON(): { |
@@ -35,2 +35,5 @@ "use strict"; | ||
EvmTransactionLog.create = function (value) { | ||
if (value instanceof EvmTransactionLog) { | ||
return value; | ||
} | ||
return new EvmTransactionLog(value); | ||
@@ -37,0 +40,0 @@ }; |
export * from './EvmTransactionLog'; | ||
export * from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -18,2 +18,3 @@ "use strict"; | ||
__exportStar(require("./EvmTransactionLog"), exports); | ||
__exportStar(require("./types"), exports); | ||
//# sourceMappingURL=index.js.map |
export * from './Erc20'; | ||
export * from './Erc20Value'; | ||
export * from './EvmAddress'; | ||
export * from './EvmBlock'; | ||
export * from './EvmChain'; | ||
export * from './Erc20Transfer'; | ||
export * from './EvmEvent'; | ||
export * from './EvmNative'; | ||
export * from './EvmNFT'; | ||
export * from './EvmNft'; | ||
export * from './EvmNftMetadata'; | ||
export * from './EvmNftTrade'; | ||
export * from './EvmNftTransfer'; | ||
export * from './EvmTransaction'; | ||
export * from './EvmTransactionLog'; | ||
export * from './EvmTransactionReceipt'; | ||
export * from './EvmTransactionResponse'; | ||
export * from './EvmNftContractType'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -20,9 +20,14 @@ "use strict"; | ||
__exportStar(require("./EvmAddress"), exports); | ||
__exportStar(require("./EvmBlock"), exports); | ||
__exportStar(require("./EvmChain"), exports); | ||
__exportStar(require("./Erc20Transfer"), exports); | ||
__exportStar(require("./EvmEvent"), exports); | ||
__exportStar(require("./EvmNative"), exports); | ||
__exportStar(require("./EvmNFT"), exports); | ||
__exportStar(require("./EvmNft"), exports); | ||
__exportStar(require("./EvmNftMetadata"), exports); | ||
__exportStar(require("./EvmNftTrade"), exports); | ||
__exportStar(require("./EvmNftTransfer"), exports); | ||
__exportStar(require("./EvmTransaction"), exports); | ||
__exportStar(require("./EvmTransactionLog"), exports); | ||
__exportStar(require("./EvmTransactionReceipt"), exports); | ||
__exportStar(require("./EvmTransactionResponse"), exports); | ||
__exportStar(require("./EvmNftContractType"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@moralisweb3/evm-utils", | ||
"author": "Moralis", | ||
"version": "2.0.0-beta.9", | ||
"version": "2.0.0-beta.10", | ||
"license": "MIT", | ||
@@ -33,4 +33,4 @@ "private": false, | ||
"@ethersproject/transactions": "^5.6.0", | ||
"@moralisweb3/core": "^2.0.0-beta.9" | ||
"@moralisweb3/core": "^2.0.0-beta.10" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
627781
190
12874