-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support not defined contractType for NFT types.
- Loading branch information
Showing
10 changed files
with
52 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@moralisweb3/evm-api': patch | ||
'@moralisweb3/evm-utils': patch | ||
--- | ||
|
||
Support not defined `contractType` for NFT types. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/evmUtils/src/dataTypes/EvmNftContractType.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { noramlizeEvmNftContractType, EvmNftContractType } from './EvmNftContractType'; | ||
|
||
describe('noramlizeEvmNftContractType()', () => { | ||
it('returns ERC721', () => { | ||
expect(noramlizeEvmNftContractType('erc721')).toEqual(EvmNftContractType.ERC721); | ||
expect(noramlizeEvmNftContractType('ERC721')).toEqual(EvmNftContractType.ERC721); | ||
}); | ||
|
||
it('returns ERC1155', () => { | ||
expect(noramlizeEvmNftContractType('erc1155')).toEqual(EvmNftContractType.ERC1155); | ||
expect(noramlizeEvmNftContractType('ERC1155')).toEqual(EvmNftContractType.ERC1155); | ||
}); | ||
|
||
it('returns undefined', () => { | ||
expect(noramlizeEvmNftContractType('')).toEqual(undefined); | ||
expect(noramlizeEvmNftContractType(null as any)).toEqual(undefined); | ||
expect(noramlizeEvmNftContractType(undefined as any)).toEqual(undefined); | ||
}); | ||
|
||
it('throws error if value is undefined', () => { | ||
expect(() => noramlizeEvmNftContractType('wrongErc')).toThrowError('Invalid NFT contract type provided'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters