Skip to main content

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
{
"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"
}

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 or block_number must be provided in the criteria.

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 supports ERC721 or ERC1155.
  • The contract_address must be provided.
  • Either a timestamp or block_number must be provided in the criteria.
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 example token_ids: ["1", "2", "3"]
  • token_ranges - A list containing the range of tokens to be included in the snapshot. For example token_ranges: [ {"from_id": "100", "to_id": "200"} ]
  • min_tokens and max_tokens - The minimum and maximum number of tokens held