Skip to main content

Contract Settings

Configure the settings of your smart contract.

Contract Metadata

Read, write, and update the metadata of a smart contract using the SDK, such as the name, description and image.

Read

const metadata = await contract.metadata.get();

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Write (Overwrite)

danger

This will overwrite the existing metadata.

await contract.metadata.set({
name: "My Contract",
description: "My contract description"
})

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Update

await contract.metadata.update({
name: "My Contract",
description: "My contract description"
})

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Royalty Fees

Read and update the royalty fees of a collection or a specific token.

Read

const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Update

await contract.roles.setDefaultRoyaltyInfo({
seller_fee_basis_points: 100, // 1% royalty fee
fee_recipient: "0x...", // the fee recipient
});

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Read Specific Token

const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Update Specific Token

await contract.roles.setTokenRoyaltyInfo(tokenId, {
seller_fee_basis_points: 100, // 1% royalty fee
fee_recipient: "0x...", // the fee recipient
});

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Platform Fees

Platform fees allow you to charge a percentage fee wherever there is a transfer of currency in your contract.

Read

const feeInfo = await contract.platformFee.get();

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Update

This feature is missing a code snippet or might not be supported yet.

Check the React SDK documentation for more information.

Reach out on Discord for further assistance!
View React SDK Documentation

Primary Sale

Configure the recipient of the primary sale fees.

Read

const salesRecipient = await contract.sales.getRecipient();

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Update

await contract.sales.setRecipient(recipientWalletAddress);

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation