Create a snapshot
You can create a snapshot of a deployed collection at a specific point in time using the API.
You must have the deployed smart contract address before creating a snapshot.
Issue a POST
request to the snapshot
endpoint to generate a snapshot. You can create a snapshot based on details about the contract or by directly specifying a collection ID.
POST https://admin-api.phosphor.xyz/v1/snapshots
- using contract info
- using collection_id
- Example response
{
"name": "snapshot-1",
"criteria": {
"block_number": "15796241",
"token_ids": ["110", "112"],
"token_ranges": [
{
"from_id": "1000",
"to_id": "7404"
}
],
"min_tokens": "1",
"max_tokens": "20"
},
"contract_address": "0xB660C6Dc8B18e7541a493A9014D0525575184Bd7",
"network_id": 59144,
"token_type": "ERC1155"
}
{
"name": "snapshot-2",
"criteria": {
"block_number": "15796241",
"token_ids": ["110", "112"],
"token_ranges": [
{
"from_id": "1000",
"to_id": "7404"
}
],
"min_tokens": "1",
"max_tokens": "20"
},
"collection_id": "abdeb124-6bc7-46df-a17e-cb9c158e69bd"
}
{
"collection_id": null,
"contract_address": "0xB660C6Dc8B18e7541a493A9014D0525575184Bd7",
"criteria": {
"block_number": "15796241",
"max_tokens": null,
"min_tokens": "1",
"timestamp": null,
"token_ids": null,
"token_ranges": [
{
"from_id": "1000",
"to_id": "7404"
}
]
},
"id": "69520a3f-12fd-4977-a04c-47ece3616e24",
"name": "snapshot-315",
"network_id": 59144,
"organization_id": "f4d13d67-d918-4e34-9a4d-166f243cc6c5",
"status": "PENDING",
"token_type": "ERC1155"
}
When creating a snapshot using a collection ID:
- The
name
of the snapshot must be unique. - The
collection_id
specifies the deployed collection for which to create the snapshot. - Either a
timestamp
orblock_number
must be provided in thecriteria
.
When creating a snapshot using contract info:
- The
name
of the snapshot must be unique. - The
network_id
must be provided. - The
token_type
only supportsERC721
orERC1155
. - The
contract_address
must be provided. - Either a
timestamp
orblock_number
must be provided in thecriteria
.
note
network_id
, contract_address
, and token_type
are not allowed when specifying collection_id
.
Snapshot criteria
You can optionally specify the following additional criteria for adding tokens to the snapshot:
token_ids
- A list of token IDs to be included in the snapshot. For exampletoken_ids: ["1", "2", "3"]
token_ranges
- A list containing the range of tokens to be included in the snapshot. For exampletoken_ranges: [ {"from_id": "100", "to_id": "200"} ]
min_tokens
andmax_tokens
- The minimum and maximum number of tokens held