Please follow the link to find the detailed information regarding Nesting and Bundling.
You can easily create a collection with nested tokens by running this application with appropriate parameters like owner seed, network, required number of tokens and the nesting depth of a bundle.
To create a basic collection follow the steps below.
In the env.json
file add the following data:
-
A Seed Phrase of the collection owner (you can use Seed Phrase of your own test account).
NOTE: the collection owner must have sufficient balance for creation a new collection.
-
Network.
NOTE: For testing purposes we usually use OPAL network so DO NOT change the endpoint and leave it as is:
wss://ws-opal.unique.network
In the MyClient.ts
add the the collection owner address to the constructor.
Optionally you can change name, description and prefix of the collection in init()
method.
In the index.ts
we pass tokensPerLevel
and depth
when calling MyClient.magic
method to configure the depth of the created bundles (e.g. (2, 2), (3, 3)). You can configure those parameters by updating tokensPerLevel
and depth
in env.json
file. By default both set as 2.
For example, with (2, 2) depth the following token structure is created.
NOTE: Token creation time depends on the required depth of the bundle. For example, the bundle with depth (2, 2) would be created in 5 minutes while creation (3, 3) bundle would take about 30 minutes. Maximum available depth is 5.
Execute following command in the terminal.
npm install
Execute following command in the terminal.
npx ts-node index.ts
Once it's complete the collection with appropriate bundles will be available.