Verify your collection on-chain.
The Tensor Foundation Whitelist program allows defining and managing a collection of NFTs or other digital assets on-chain. Within the Tensor protocol it is used for gatekeeping which NFTs can be deposited or sold in to AMM pools, and which items Marketplace bids are placed against.
This project contains the following program:
- Whitelist
TL1ST2iRBzuGTqLn1KXnGdSnEow62BzPnGiqyRXhWtW
You will need a Rust version compatible with BPF to compile the program, currently we recommend using Rust 1.75.0.
This project contains the following clients:
This new Whitelist program is currently deployed to devnet, and will be deployed to mainnet on October 2nd.
Devnet | Mainnet |
---|---|
v0.2.1 | v0.2.1 |
You need the following tools installed to build the project:
- pnpm v9+
- rust v1.78.0
- node v18+
- solana v1.17.23
- anchor v0.29.0
Install JavaScript dependencies:
pnpm install
Build the program and generate the clients:
pnpm programs:build
pnpm generate
Run JS and Rust tests:
pnpm clients:js:test
pnpm clients:rust:test
Install this library using the package manager of your choice.
npm install @tensor-foundation/whitelist
const uuid = Buffer.from(
"099c4f20-fd22-44b3-af6d-43d2b9f4cf21".replaceAll("-", ""),
).toJSON().data;
const whitelistSeeds: WhitelistSeeds = {
uuid: uuid,
};
const [whitelistPDA] = await findWhitelistPda(whitelistSeeds);
const transport = createDefaultRpcTransport({
url: "https://api.mainnet-beta.solana.com/",
});
const rpc = createSolanaRpc({ transport });
const whitelistAccountResponse = await fetchWhitelist(rpc, whitelistPDA);
const mint =
"DWBXzV8MjkCRLxWwZEZm6B3wfrpgh4oYcYKVxSuL9ay6" as Address<"MintType">;
const whitelist =
"ExGjYcjK1GNtQ5WnN3gy22132s6WMzrgFUHDNi6sT6nL" as Address<"WhitelistType">;
const seeds = { mint: mint, whiltelist: whitelist };
const mintProofPDA = await findMintProofPda(seeds);
const URL = `https://api.mainnet.tensordev.io/api/v1/sdk/mint_proofs?whitelist=${whitelist}&mints=${mint}`;
const response = await axios.get(URL, {
headers: {
"x-tensor-api-key": API_KEY,
},
});
const proof: Array<Uint8Array> = response.data[0].proof.map(
(proof) => proof.data,
);
const initUpdateMintProofInput = {
whitelist: whitelist,
mint: mint,
mintProof: mintProofPDA,
user: wallet.publicKey,
proof: proof,
};
const mintProofInstruction = getInitUpdateMintProofInstruction(
initUpdateMintProofInput,
);
-
We're here to help!
-
Join our developer community on discord
Check out the Contributing Guide the learn more about how to contribute to this project.
Copyright (c) 2024 Tensor Protocol Foundation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.