Create MultiToken NFT Collection
ERC-1155 is a standard for smart contracts on the Ethereum blockchain, which encompasses the functionality of both ERC-20 (fungible tokens, like cryptocurrencies) and ERC-721 (non-fungible tokens, or NFTs) within a single smart contract. This makes it a MultiToken standard.
In the ERC-1155 standard, each token is identified by an ID. What makes this different from ERC-721 (where each token also has a unique ID) is that tokens of the same ID in ERC-1155 are interchangeable, just like ERC-20 tokens. This allows for both fungible and non-fungible tokens to be represented within a single contract.
- 1.Video Games: ERC-1155 tokens can represent a wide variety of assets within a game, such as fungible resources (like in-game currency or consumable items) and non-fungible unique items (like a special character or a limited edition weapon). This can all be done within a single, smart contract.
- 2.DeFi Platforms: A single ERC-1155 contract can manage a variety of tokens, such as governance tokens (fungible) and insurance contracts or loan receipts (non-fungible).
- 3.Art and Collectibles: Just like with ERC-721, artists can mint their artworks as NFTs with ERC-1155. However, with ERC-1155 they can also issue fungible tokens, such as prints or copies, alongside the unique piece.
- 4.Real World Assets: ERC-1155 tokens can represent ownership in real world assets, such as real estate or commodities. The fungible tokens can represent a divisible interest in an asset, while non-fungible tokens can represent unique assets.
By using the Tatum SDK to create an ERC-1155 MultiToken collection, you're able to manage a complex economy of both fungible and non-fungible tokens with ease. Whether you're developing an intricate in-game economy or creating a platform with diverse types of assets, ERC-1155 offers a versatile solution for digital ownership and trade.
Use the TatumSDK (
@tatumio/tatum
) to get a transaction history of the wallet.TypeScript
JavaScript
curl
1
// yarn add @tatumio/tatum
2
import {TatumSDK, Network, Ethereum, ResponseDto} from '@tatumio/tatum'
3
4
const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
5
6
const tx: ResponseDto<{txId: string}> = await tatum.nft.createMultiTokenNftCollection({
7
owner: '0x727ea45b2eb6abb2badd3dc7106d146e0dc0450d', // replace with your address
8
})
9
10
console.log(tx.data.txId)
11
// 0x8e564406701caab6258501c794f5c1eece380f673be99b561d626c3d8d81b202
12
13
// you can get created collection address using this RPC call
14
const collectionAddress = await tatum.rpc.getContractAddress(tx.data.txId)
15
console.log(collectionAddress)
16
// 0x876977006988ce590e219f576077459a49c7318a
1
// Install with: npm install @tatumio/tatum
2
const { TatumSDK, Network } = require("@tatumio/tatum");
3
4
(async () => {
5
try {
6
const tatum = await TatumSDK.init({ network: Network.ETHEREUM });
7
const txs = await tatum.nft.createMultiTokenNftCollection({
8
owner: '0x727ea45b2eb6abb2badd3dc7106d146e0dc0450d', // replace with your address
9
});
10
console.log(txs.data.txId);
11
// 0x8e564406701caab6258501c794f5c1eece380f673be99b561d626c3d8d81b202
12
13
const collectionAddress = await tatum.rpc.getContractAddress(tx.data.txId);
14
console.log(collectionAddress);
15
// 0x876977006988ce590e219f576077459a49c7318a
16
} catch (error) {
17
console.error("Error creating NFT collection:", error);
18
}
19
})();
1
curl --location --request POST 'https://api.tatum.io/v4/contract/deploy' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"contractType": "multitoken",
5
"chain": "ethereum-sepolia",
6
"owner": "0x727ea45b2eb6abb2badd3dc7106d146e0dc0450d"
7
}'
Try this feature
1
export interface CreateMultiTokenNftCollection {
2
/**
3
* Address of the NFT collection owner
4
*/
5
owner: string
6
/**
7
* Address of the NFT collection minter, this is optional and defaults to the owner address
8
*/
9
minter?: string
10
/**
11
* Optional base URI, which will be prepended to the token URI. If not specified, the token should be minted with the URI
12
*/
13
baseURI?: string
14
}
1
interface ResponseDto<{txId: string}> {
2
/**
3
* Actual payload of the response
4
*/
5
data: {txId: string}
6
/**
7
* Status of the response
8
*/
9
status: Status
10
/**
11
* In case of ERROR status, this field contains the error message and detailed description
12
*/
13
error?: ErrorWithMessage
14
}
Network | Support |
---|---|
Ethereum / Ethereum Sepolia / Ethereum Goerli
BNB Smart Chain / BNB Smart Chain Testnet
Celo / Celo Alfajores
Polygon / Polygon Mumbai | NFTs (BAYC,...)
ERC-1155 Tokens |
Last modified 1mo ago