Open-source NFT Blend smart contract, allows NFT collection owners and/or projects owners to setup crafting recipes to mint new NFT assets.
Project | Chains |
---|---|
Wombat Dungeon Master | WAX, EOS |
Pomelo Harvest | EOS |
- Admin setup NFT recipe & blend
- User sends AtomicAssets NFT assets to
blend.gems
with desired blend id in the memo.
# setup NFT blend (basic)
$ cleos push action blend.gems setblend '[["mycollection", 789], "My Blend", null, [], null, null]' -p myaccount
# setup NFT blend (advanced)
$ cleos push action blend.gems setblend '[["mycollection", 789], "My Advanced Blend", "myplugin", [{"contract":"eosio.token", "quantity": "1.0000 EOS"}], "2021-11-01T00:00:00", "2021-12-01T00:00:00"]' -p myaccount
# setup NFT recipe
$ cleos push action blend.gems addrecipe '[["mycollection", 789], [["mycollection", 123], ["mycollection", 456]]]' -p myauthor
# user send NFT's to contract (memo schema `<collection_name>:<template_id>`)
$ cleos push action atomicassets transfer '["myaccount", "blend.gems", [1099512167123, 1099512167124], "mycollection:789"]' -p myaccount
curl -X 'POST' \
"https://eos.api.eosnation.io/v1/chain/get_table_rows" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"code": "d.blend.gems",
"scope": "d.blend.gems",
"table": "collections",
"json": true,
"limit": 1
}' | jq .
curl -X 'POST' \
"https://eos.api.eosnation.io/v1/chain/get_table_rows" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"code": "d.blend.gems",
"scope": "robotbeepbop",
"table": "blends",
"json": true,
"limit": 100
}' | jq .
curl -X 'POST' \
"https://eos.api.eosnation.io/v1/chain/get_table_rows" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"code": "d.blend.gems",
"scope": "robotbeepbop",
"table": "blends",
"json": true,
"lower_bound": 3027,
"upper_bound": 3027,
"limit": 1
}' | jq .
curl -X 'POST' \
"https://eos.api.eosnation.io/v1/chain/get_table_rows" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"code": "d.blend.gems",
"scope": "robotbeepbop",
"table": "recipes",
"json": true,
"limit": 100
}' | jq .
curl -X 'POST' \
"https://eos.api.eosnation.io/v1/chain/get_table_rows" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"code": "d.blend.gems",
"scope": "robotbeepbop",
"table": "recipes",
"json": true,
"lower_bound": 0,
"upper_bound": 0,
"limit": 1
}' | jq .
curl -X 'POST' \
"https://eos.api.eosnation.io/v1/chain/get_table_rows" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"code": "d.blend.gems",
"scope": "d.blend.gems",
"table": "config",
"json": true,
"limit": 1
}' | jq .
- TABLE
status
- TABLE
collections
- TABLE
blends
- TABLE
recipes
- TABLE
limits
- TABLE
orders
- ACTION
setblend
- ACTION
addrecipe
- ACTION
setrecipe
- ACTION
delblend
- ACTION
delrecipe
- ACTION
cancel
{vector<uint32_t>} counters
- counters{uint32_t} counters[0]
- total mint{uint32_t} counters[1]
- total burn{time_point_sec} last_updated
- last updated
{
"counters": [10, 30],
"last_updated": "2021-04-12T12:23:42"
}
{set<name>} collection_names
- collection names
{
"collection_names": ["mycollection"]
}
- scope:
{name} collection_name
{atomic::nft_extra} id
- output AtomicAsset NFT template{set<uint64_t>} recipe_ids
- one or many input recipes ID's{string} [description=null]]
- (optional) blend description{name} [plugin=null]
- (optional) plugin (custom attributes){extended_asset} [quantity=[]]
- (optional) token deposit required{time_point_sec} [start_time=null]
- (optional) start time (ex: "2021-07-01T00:00:00"){time_point_sec} [end_time=null]
- (optional) end time (ex: "2021-08-01T00:00:00")
{
"id": {"collection_name": "mycollection", "schema_name": "myschema", "template_id": 21883},
"recipe_ids": [1, 2],
"description": "My Blend",
"plugin": "myplugin",
"quantity": {"contract": "eosio.token", "quantity": "1.0000 EOS"},
"start_time": "2021-07-01T00:00:00",
"end_time": "2021-10-01T00:00:00"
}
- scope:
{name} collection_name
{uint64_t} id
- (auto-incremental primary key) recipe ID{vector<atomic::nft_extra>} templates
- AtomicAsset NFT templates
{
"id": 1,
"templates": [{"collection_name": "mycollection", "schema_name": "myschema", "template_id": 21883}]
}
- scope:
{name} collection_name
{int32_t} template_id
- AtomicAsset NFT template ID{int64_t} quantity
- if exists, limit the quantity of NFT's to mint
{
"template_id": 21883,
"quantity": 100
}
scope: owner
(name)
{atomic::nft} id
- output AtomicAsset NFT template{extended_asset} quantity
- quantity asset
{
"id": {"collection_name": "mycollection", "schema_name": "myschema", "template_id": 21883},
"quantity": {"contract": "eosio.token", "quantity": "1.0000 EOS"}
}
Set NFT blend
- authority:
atomicassets::author
orget_self()
{name} collection_name
- AtomicAsset NFT collection name{int32_t} template_id
- AtomicAsset NFT template ID{string} [description=""]
- (optional) blend description{name} [plugin=""]
- (optional) plugin (custom attributes){extended_asset} [quantity=null]
- (optional) token deposit required{time_point_sec} [start_time=null]
- (optional) start time (ex: "2021-07-01T00:00:00"){time_point_sec} [end_time=null]
- (optional) end time (ex: "2021-08-01T00:00:00")
# basic
$ cleos push action blend.gems setblend '["mycollection", 789, "My Blend", null, null, null, null]' -p myaccount
# advanced
$ cleos push action blend.gems setblend '["mycollection", 789, "My Blend", "myplugin, {"contract": "eosio.token", "quantity": "0.1000 EOS"}, "2021-11-01T00:00:00", "2021-12-01T00:00:00"]' -p myaccount
Add NFT recipe to blend
- authority:
atomicassets::author
orget_self()
{name} collection_name
- AtomicAsset NFT collection name{int32_t} template_id
- AtomicAsset NFT template ID{vector<atomic::nft>} templates
- AtomicHub NFT templates
$ cleos push action blend.gems addrecipe '["mycollection", 789, [["mycollection", 123], ["mycollection", 456]]]' -p blend.gems
Set NFT recipe to blend
- authority:
atomicassets::author
orget_self()
{name} collection_name
- AtomicAsset NFT collection name{int32_t} template_id
- AtomicAsset NFT template ID{set<uint64_t>} recipe_ids
- one or many input recipes ID's
$ cleos push action blend.gems setrecipes '["mycollection", 789, [1]]' -p blend.gems
Delete NFT blend
- authority:
atomicassets::author
orget_self()
{name} collection_name
- AtomicAsset NFT collection name{int32_t} template_id
- AtomicAsset NFT template ID
$ cleos push action blend.gems delblend '["mycollection", 789]' -p blend.gems
Delete NFT recipe
- authority:
atomicassets::author
orget_self()
{name} collection_name
- AtomicAsset NFT collection name{int32_t} template_id
- AtomicAsset NFT template ID{uint64_t} recipe_id
- recipe ID
$ cleos push action blend.gems delrecipe '["mycollection", 789, 1]' -p blend.gems
Returns any remaining orders to owner account
- authority:
owner
orget_self()
{name} owner
- owner account to claim{int32_t} template_id
- AtomicAsset NFT template ID
$ cleos push action blend.gems cancel '["myaccount", 789]' -p myaccount