@moralisweb3/evm-utils
Advanced tools
Comparing version 2.6.5 to 2.6.6
@@ -76,2 +76,3 @@ import MoralisCore, { MoralisDataObject, BigNumber } from '@moralisweb3/core'; | ||
address: string; | ||
chain: string | number; | ||
logIndex?: number | undefined; | ||
@@ -148,2 +149,3 @@ transactionHash: string; | ||
address: string; | ||
chain: string | number; | ||
logIndex?: number | undefined; | ||
@@ -150,0 +152,0 @@ transactionHash: string; |
@@ -72,3 +72,3 @@ import MoralisCore, { MoralisDataObject, MoralisDataObjectValue, BigNumber } from '@moralisweb3/core'; | ||
tokenId: string | number; | ||
contractType?: import("../EvmNftContractType").EvmNftContractType | undefined; | ||
contractType?: string | undefined; | ||
tokenUri?: string | undefined; | ||
@@ -95,3 +95,3 @@ tokenHash?: string | undefined; | ||
tokenId: string | number; | ||
contractType?: import("../EvmNftContractType").EvmNftContractType | undefined; | ||
contractType?: string | undefined; | ||
tokenUri?: string | undefined; | ||
@@ -122,3 +122,3 @@ tokenHash?: string | undefined; | ||
*/ | ||
get contractType(): import("../EvmNftContractType").EvmNftContractType | undefined; | ||
get contractType(): string | undefined; | ||
/** | ||
@@ -125,0 +125,0 @@ * @returns the NFT token address |
@@ -18,3 +18,2 @@ "use strict"; | ||
var EvmChain_1 = require("../EvmChain"); | ||
var EvmNftContractType_1 = require("../EvmNftContractType"); | ||
/** | ||
@@ -318,3 +317,3 @@ * The EvmNft class is a MoralisData that references to a the NFT of the type; Erc721 or Erc1155 | ||
_a = EvmNft; | ||
EvmNft.parse = function (data, core) { return (__assign(__assign({}, data), { chain: EvmChain_1.EvmChain.create(data.chain, core), contractType: (0, core_1.maybe)(data.contractType, EvmNftContractType_1.normalizeEvmNftContractType), tokenAddress: EvmAddress_1.EvmAddress.create(data.tokenAddress, core), metadata: (0, core_1.maybe)(data.metadata, _a.validateMetadata), tokenUri: (0, core_1.maybe)(data.tokenUri), tokenHash: (0, core_1.maybe)(data.tokenHash), name: (0, core_1.maybe)(data.name), symbol: (0, core_1.maybe)(data.symbol), ownerOf: (0, core_1.maybe)(data.ownerOf, function (ownerOf) { return EvmAddress_1.EvmAddress.create(ownerOf, core); }), blockNumberMinted: (0, core_1.maybe)(data.blockNumberMinted, core_1.BigNumber.create), blockNumber: (0, core_1.maybe)(data.blockNumber, core_1.BigNumber.create), lastMetadataSync: (0, core_1.maybe)(data.lastMetadataSync, core_1.dateInputToDate), lastTokenUriSync: (0, core_1.maybe)(data.lastTokenUriSync, core_1.dateInputToDate), amount: (0, core_1.maybe)(data.amount, function (value) { return +value; }) })); }; | ||
EvmNft.parse = function (data, core) { return (__assign(__assign({}, data), { chain: EvmChain_1.EvmChain.create(data.chain, core), contractType: (0, core_1.maybe)(data.contractType), tokenAddress: EvmAddress_1.EvmAddress.create(data.tokenAddress, core), metadata: (0, core_1.maybe)(data.metadata, _a.validateMetadata), tokenUri: (0, core_1.maybe)(data.tokenUri), tokenHash: (0, core_1.maybe)(data.tokenHash), name: (0, core_1.maybe)(data.name), symbol: (0, core_1.maybe)(data.symbol), ownerOf: (0, core_1.maybe)(data.ownerOf, function (ownerOf) { return EvmAddress_1.EvmAddress.create(ownerOf, core); }), blockNumberMinted: (0, core_1.maybe)(data.blockNumberMinted, core_1.BigNumber.create), blockNumber: (0, core_1.maybe)(data.blockNumber, core_1.BigNumber.create), lastMetadataSync: (0, core_1.maybe)(data.lastMetadataSync, core_1.dateInputToDate), lastTokenUriSync: (0, core_1.maybe)(data.lastTokenUriSync, core_1.dateInputToDate), amount: (0, core_1.maybe)(data.amount, function (value) { return +value; }) })); }; | ||
/** | ||
@@ -321,0 +320,0 @@ * This function confirms that the NFT metadata is a valid JSON string. |
import { BigNumber, BigNumberish, DateInput, MoralisDataObjectValue } from '@moralisweb3/core'; | ||
import { EvmAddressish, EvmAddress } from '../EvmAddress'; | ||
import { EvmChain, EvmChainish } from '../EvmChain'; | ||
import { EvmNftContractType } from '../EvmNftContractType'; | ||
/** | ||
@@ -50,3 +49,3 @@ * This can be any object with valid transaction data. | ||
tokenId: number | string; | ||
contractType?: EvmNftContractType; | ||
contractType?: string; | ||
chain: EvmChain; | ||
@@ -53,0 +52,0 @@ tokenUri?: string; |
@@ -51,3 +51,3 @@ import MoralisCore, { MoralisDataObject } from '@moralisweb3/core'; | ||
tokenAddress: string; | ||
contractType?: import("../EvmNftContractType").EvmNftContractType | undefined; | ||
contractType?: string | undefined; | ||
name: string; | ||
@@ -66,3 +66,3 @@ symbol: string; | ||
tokenAddress: string; | ||
contractType?: import("../EvmNftContractType").EvmNftContractType | undefined; | ||
contractType?: string | undefined; | ||
name: string; | ||
@@ -90,3 +90,3 @@ symbol: string; | ||
*/ | ||
get contractType(): import("../EvmNftContractType").EvmNftContractType | undefined; | ||
get contractType(): string | undefined; | ||
/** | ||
@@ -93,0 +93,0 @@ * @returns the token name of collection. |
@@ -18,3 +18,2 @@ "use strict"; | ||
var EvmChain_1 = require("../EvmChain"); | ||
var EvmNftContractType_1 = require("../EvmNftContractType"); | ||
/** | ||
@@ -156,3 +155,3 @@ * The EvmNftCollection is a representation of an nft collection. | ||
}); | ||
EvmNftCollection.parse = function (data, core) { return (__assign(__assign({}, data), { tokenAddress: EvmAddress_1.EvmAddress.create(data.tokenAddress, core), chain: EvmChain_1.EvmChain.create(data.chain, core), contractType: (0, core_1.maybe)(data.contractType, EvmNftContractType_1.normalizeEvmNftContractType) })); }; | ||
EvmNftCollection.parse = function (data, core) { return (__assign(__assign({}, data), { tokenAddress: EvmAddress_1.EvmAddress.create(data.tokenAddress, core), chain: EvmChain_1.EvmChain.create(data.chain, core), contractType: (0, core_1.maybe)(data.contractType) })); }; | ||
return EvmNftCollection; | ||
@@ -159,0 +158,0 @@ }()); |
import { EvmAddressish, EvmAddress } from '../EvmAddress'; | ||
import { EvmChain, EvmChainish } from '../EvmChain'; | ||
import { EvmNftContractType } from '../EvmNftContractType'; | ||
/** | ||
@@ -29,3 +28,3 @@ * This can be any object with valid block data. | ||
chain: EvmChain; | ||
contractType?: EvmNftContractType; | ||
contractType?: string; | ||
name: string; | ||
@@ -32,0 +31,0 @@ symbol: string; |
@@ -60,3 +60,3 @@ import { MoralisDataObject } from '@moralisweb3/core'; | ||
symbol: string; | ||
contractType?: import("..").EvmNftContractType | undefined; | ||
contractType?: string | undefined; | ||
syncedAt?: Date | undefined; | ||
@@ -73,3 +73,3 @@ }; | ||
symbol: string; | ||
contractType?: import("..").EvmNftContractType | undefined; | ||
contractType?: string | undefined; | ||
syncedAt?: Date | undefined; | ||
@@ -96,3 +96,3 @@ }; | ||
*/ | ||
get contractType(): import("..").EvmNftContractType | undefined; | ||
get contractType(): string | undefined; | ||
/** | ||
@@ -99,0 +99,0 @@ * @returns the chain in the metadata. |
import { DateInput } from '@moralisweb3/core'; | ||
import { EvmAddressish, EvmAddress } from '../EvmAddress'; | ||
import { EvmChain, EvmChainish } from '../EvmChain'; | ||
import { EvmNftContractType } from '../EvmNftContractType'; | ||
/** | ||
@@ -24,3 +23,3 @@ * Valid ERC20 token input | ||
symbol: string; | ||
contractType?: EvmNftContractType; | ||
contractType?: string; | ||
syncedAt: DateInput | null; | ||
@@ -36,5 +35,5 @@ } | ||
symbol: string; | ||
contractType?: EvmNftContractType; | ||
contractType?: string; | ||
syncedAt?: Date; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -65,2 +65,3 @@ import MoralisCore, { MoralisDataObject, BigNumber } from '@moralisweb3/core'; | ||
address: string; | ||
chain: string | number; | ||
logIndex?: number | undefined; | ||
@@ -105,2 +106,3 @@ transactionHash: string; | ||
address: string; | ||
chain: string | number; | ||
logIndex?: number | undefined; | ||
@@ -107,0 +109,0 @@ transactionHash: string; |
import MoralisCore, { MoralisDataObject } from '@moralisweb3/core'; | ||
import { EvmAddress } from '../EvmAddress'; | ||
import { EvmTransactionLogData, EvmTransactionLogInput } from './types'; | ||
import { EvmChain } from '../EvmChain'; | ||
/** | ||
@@ -50,2 +51,3 @@ * This can be any valid {@link EvmTransactionLogInput} or {@link EvmTransactionLog}. | ||
address: string; | ||
chain: string | number; | ||
logIndex?: number | undefined; | ||
@@ -71,2 +73,3 @@ transactionHash: string; | ||
address: string; | ||
chain: string | number; | ||
logIndex?: number | undefined; | ||
@@ -163,3 +166,12 @@ transactionHash: string; | ||
get blockTimestamp(): string | undefined; | ||
/** | ||
* @returns the chainId for the particular log. | ||
* | ||
* @example | ||
* ```ts | ||
* log.chainId; // "1" | ||
* ``` | ||
*/ | ||
get chain(): EvmChain; | ||
} | ||
//# sourceMappingURL=EvmTransactionLog.d.ts.map |
@@ -17,2 +17,3 @@ "use strict"; | ||
var EvmAddress_1 = require("../EvmAddress"); | ||
var EvmChain_1 = require("../EvmChain"); | ||
/** | ||
@@ -55,2 +56,3 @@ * The EvmTransactionLog class is a MoralisData that references an EVM transaction log. | ||
address: EvmAddress_1.EvmAddress.create(value.address, core), | ||
chain: EvmChain_1.EvmChain.create(value.chain, core), | ||
}; | ||
@@ -71,3 +73,4 @@ }; | ||
value._value.address.equals(this._value.address) && | ||
value._value.logIndex === this._value.logIndex); | ||
value._value.logIndex === this._value.logIndex && | ||
value._value.chain.equals(this._value.chain)); | ||
}; | ||
@@ -84,4 +87,5 @@ /** | ||
EvmTransactionLog.prototype.toJSON = function () { | ||
var _a; | ||
var value = this._value; | ||
return __assign(__assign({}, value), { address: value.address.format() }); | ||
return __assign(__assign({}, value), { address: value.address.format(), chain: (_a = value.chain) === null || _a === void 0 ? void 0 : _a.format() }); | ||
}; | ||
@@ -236,2 +240,17 @@ /** | ||
}); | ||
Object.defineProperty(EvmTransactionLog.prototype, "chain", { | ||
/** | ||
* @returns the chainId for the particular log. | ||
* | ||
* @example | ||
* ```ts | ||
* log.chainId; // "1" | ||
* ``` | ||
*/ | ||
get: function () { | ||
return this._value.chain; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
return EvmTransactionLog; | ||
@@ -238,0 +257,0 @@ }()); |
import { EvmAddressish, EvmAddress } from '../EvmAddress'; | ||
import { EvmChain, EvmChainish } from '../EvmChain'; | ||
/** | ||
@@ -17,2 +18,3 @@ * Valid EvmTransactionLog input. | ||
* transactionIndex: "204", | ||
* chain: "1" | ||
* } | ||
@@ -31,2 +33,3 @@ * ``` | ||
blockTimestamp?: string; | ||
chain: EvmChainish; | ||
} | ||
@@ -46,3 +49,4 @@ /** | ||
blockTimestamp?: string; | ||
chain: EvmChain; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -11,3 +11,2 @@ export * from './Erc20'; | ||
export * from './EvmNftCollection'; | ||
export * from './EvmNftContractType'; | ||
export * from './EvmNftMetadata'; | ||
@@ -14,0 +13,0 @@ export * from './EvmNftTrade'; |
@@ -27,3 +27,2 @@ "use strict"; | ||
__exportStar(require("./EvmNftCollection"), exports); | ||
__exportStar(require("./EvmNftContractType"), exports); | ||
__exportStar(require("./EvmNftMetadata"), exports); | ||
@@ -30,0 +29,0 @@ __exportStar(require("./EvmNftTrade"), exports); |
{ | ||
"name": "@moralisweb3/evm-utils", | ||
"author": "Moralis", | ||
"version": "2.6.5", | ||
"version": "2.6.6", | ||
"license": "MIT", | ||
@@ -15,7 +15,7 @@ "private": false, | ||
"test": "yarn jest --runInBand --detectOpenHandles --forceExit --ci", | ||
"test:coverage": "yarn run test --coverage", | ||
"test:coverage": "yarn run test --coverage --coverageReporters json-summary", | ||
"test:watch": "yarn run test --watch", | ||
"lint": "eslint . --ext .js,.ts,.tsx,jsx", | ||
"clean": "rm -rf lib && rm -rf tsconfig.tsbuildinfo && rm -rf ./node_modules/.cache/nx", | ||
"build": "tsc", | ||
"clean": "rm -rf lib && rm -rf tsconfig.tsbuildinfo && rm -rf tsconfig.build.tsbuildinfo && rm -rf ./node_modules/.cache/nx", | ||
"build": "tsc -p tsconfig.build.json", | ||
"dev": "tsc --watch" | ||
@@ -31,4 +31,4 @@ }, | ||
"@ethersproject/transactions": "^5.6.0", | ||
"@moralisweb3/core": "^2.6.5" | ||
"@moralisweb3/core": "^2.6.6" | ||
} | ||
} |
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
17327
782594
198
Updated@moralisweb3/core@^2.6.6