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
- React
- Javascript
- Python
- Go
- Unity
const { data: contractMetadata, isLoading } = useContractMetadata(contract);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst appURI = await contract.appURI.get(appURI);
console.log(appURI) // "ipfs://some_ipfs_hash";
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Write (Overwrite)
This will overwrite the existing metadata.
- React
- Javascript
- Python
- Go
- Unity
const appURI = "ipfs://some_ipfs_hash";
await contract.appURI.set(appURI);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst appURI = "ipfs://some_ipfs_hash";
await contract.appURI.set(appURI);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Update
- React
- Javascript
- Python
- Go
- Unity
await contract.metadata.update({
description: "My new contract description"
})
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationawait contract.metadata.update({
description: "My new contract description"
})
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Royalty Fees
Read and update the royalty fees of a collection or a specific token.
Read
- React
- Javascript
- Python
- Go
- Unity
const { data: settings, isLoading, error } = useRoyaltySettings(contract);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
console.log(royaltyInfo.fee_recipient);
console.log(royaltyInfo.seller_fee_basis_points);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Update
- React
- Javascript
- Python
- Go
- Unity
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: updateRoyaltySettings,
isLoading,
error,
} = useUpdateRoyaltySettings(contract);
if (error) {
console.error("failed to update royalty settings", error);
}
return (
<button
disabled={isLoading}
onClick={() => updateRoyaltySettings({ updatePayload: { fee_recipient: "{{wallet_address}}", seller_fee_basis_points: 5_00 } })}
>
Update Royalty Settings
</button>
);
};
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationawait 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 Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Read Specific Token
- React
- Javascript
- Python
- Go
- Unity
const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
console.log(royaltyInfo.fee_recipient);
console.log(royaltyInfo.seller_fee_basis_points);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
console.log(royaltyInfo.fee_recipient);
console.log(royaltyInfo.seller_fee_basis_points);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Update Specific Token
- React
- Javascript
- Python
- Go
- Unity
const tokenId = 0;
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 Documentationconst tokenId = 0;
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 Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Platform Fees
Platform fees allow you to charge a percentage fee wherever there is a transfer of currency in your contract.
Read
- React
- Javascript
- Python
- Go
- Unity
const { data: platformFees, isLoading, error } = usePlatformFees(contract);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst feeInfo = await contract.platformFee.get();
console.log(feeInfo.platform_fee_recipient);
console.log(feeInfo.platform_fee_basis_points);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Update
- React
- Javascript
- Python
- Go
- Unity
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: updatePlatformFees,
isLoading,
error,
} = useUpdatePlatformFees(contract);
if (error) {
console.error("failed to update platform fees", error);
}
return (
<button
disabled={isLoading}
onClick={() => updatePlatformFees({ updatePayload: { fee_recipient: "{{wallet_address}}", platform_fee_basis_points: 5_00 } })}
>
Update Platform fees
</button>
);
};
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationawait contract.platformFee.set({
platform_fee_basis_points: 100, // 1% fee
platform_fee_recipient: "0x..." // the fee recipient
})
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Unity SDK documentation for more information.
Reach out on Discord for further assistance!
View Unity SDK DocumentationPrimary Sale
Configure the recipient of the primary sale fees.
Read
- React
- Javascript
- Python
- Go
- Unity
const { data: primarySaleRecipient, isLoading, error } = usePrimarySalesRecipient(contract);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst salesRecipient = await contract.sales.getRecipient();
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation
Update
- React
- Javascript
- Python
- Go
- Unity
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: updatePrimarySalesRecipient,
isLoading,
error,
} = useUpdatePrimarySaleRecipient(contract);
if (error) {
console.error("failed to update recipient", error);
}
return (
<button
disabled={isLoading}
onClick={() => updatePrimarySalesRecipient({ newRecipient: "{{wallet_address}}" })}
>
Update Recipient
</button>
);
};
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationawait contract.sales.setRecipient(recipientWalletAddress);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentation