Contract Settings
You can change the settings of your contract using the SDK, including:
- Contract Metadata
- Royalty Fees
- Platform Fees
Contract Metadata
You can directly read, write, and update the metadata of a smart contract using the SDK, such as the:
- Image
- Name
- Description
Read
- React
- Javascript
- Python
- Go
React SDK support for get is coming soon.
Want this feature sooner? Let us know in Discord!
const metadata = await contract.metadata.get();
Python SDK support for get is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for get is coming soon.
Want this feature sooner? Let us know in Discord!
Write (Overwrite)
This will overwrite the existing metadata.
- React
- Javascript
- Python
- Go
React SDK support for set is coming soon.
Want this feature sooner? Let us know in Discord!
await contract.metadata.set({
name: "My Contract",
description: "My contract description"
})
Python SDK support for set is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for set is coming soon.
Want this feature sooner? Let us know in Discord!
Update
- React
- Javascript
- Python
- Go
React SDK support for update is coming soon.
Want this feature sooner? Let us know in Discord!
const contract = await sdk.getContract("{{contract_address}}");
const metadata = await contract.metadata.get();
await contract.metadata.set({
name: "My Contract",
description: "My contract description"
})
Python SDK support for update is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for update is coming soon.
Want this feature sooner? Let us know in Discord!
Royalty Fees
- React
- Javascript
- Python
- Go
React SDK support for base is coming soon.
Want this feature sooner? Let us know in Discord!
const contract = await sdk.getContract("{{contract_address}}");
const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
await contract.roles.setTokenRoyaltyInfo(tokenId, {
seller_fee_basis_points: 100, // 1% royalty fee
fee_recipient: "0x...", // the fee recipient
});
Python SDK support for base is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for base is coming soon.
Want this feature sooner? Let us know in Discord!
Platform Fees
- React
- Javascript
- Python
- Go
React SDK support for base is coming soon.
Want this feature sooner? Let us know in Discord!
const contract = await sdk.getContract("{{contract_address}}");
const feeInfo = await contract.platformFee.get();
await contract.platformFee.set({
platform_fee_basis_points: 100, // 1% fee
platform_fee_recipient: "0x..." // the fee recipient
})
Python SDK support for base is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for base is coming soon.
Want this feature sooner? Let us know in Discord!