Split
Learn how to interact with your Split contract in the SDK.
Create a Split Contract
- React
- Javascript
- Python
- Go
- Unity
const sdk = useSDK();
const contractAddress = await sdk.deployer.deploySplit({
name: "My Split",
primary_sale_recipient: "your-address",
recipients: [
{
address: "your-address",
sharesBps: 80 * 100, // 80%
},
{
address: "another-address",
sharesBps: 20 * 100, // 20%
},
],
});
const contractAddress = await sdk.deployer.deploySplit({
name: "My Split",
primary_sale_recipient: "your-address",
recipients: [
{
address: "your-address",
sharesBps: 80 * 100, // 80%
},
{
address: "another-address",
sharesBps: 20 * 100, // 20%
},
],
});
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Unity SDK Reference for more information.
Reach out on Discord for further assistance!
Getting the contract in your application
To start using your Split contract inside your application, you'll need to use its contract address. You can get the contract address from the dashboard.
- React
- Javascript
- Python
- Go
- Unity
import { useContract } from '@thirdweb-dev/react'
export default function Component() {
const { contract } = useContract("<YOUR-CONTRACT-ADDRESS>", "split")
// Now you can use the split contract in the rest of the component
}
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("{{chainName}}");
const contract = await sdk.getContract("{{contract_address}}", "split");
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. Reach out to us on Discord if you need this feature! Split contract = sdk.GetContract("{{contract_address}}").split
View Recipients
- React
- Javascript
- Python
- Go
- Unity
const recipients = await contract.getAllRecipients();
console.log(recipients);
const recipients = await contract.getAllRecipients();
console.log(recipients);
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. You can still use the contrat.Read and contract.Write functions to call functions directly.
View Balance
Native Token Balance
Use this if you have been tokens native to the network (e.g., Ether
on the Ethereum network).
- React
- Javascript
- Python
- Go
- Unity
// The address to check the funds of
const address = "{{wallet_address}}";
const funds = await contract.balanceOf(address);
console.log(funds);
// The address to check the funds of
const address = "{{wallet_address}}";
const funds = await contract.balanceOf(address);
console.log(funds);
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. You can still use the contrat.Read and contract.Write functions to call functions directly.
Non-Native Token Balance
Use this if you have been sent custom tokens to the address.
- React
- Javascript
- Python
- Go
- Unity
// The address to check the funds of
const address = "{{wallet_address}}";
// The address of the currency to check the contracts funds of
const tokenAddress = "0x..."
const funds = await contract.balanceOfToken(address, tokenAddress);
console.log(funds);
// The address to check the funds of
const address = "{{wallet_address}}";
// The address of the currency to check the contracts funds of
const tokenAddress = "0x..."
const funds = await contract.balanceOfToken(address, tokenAddress);
console.log(funds);
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. You can still use the contrat.Read and contract.Write functions to call functions directly.
Distribute funds
This distributes funds held by the contract to all recipients.
Native Token
- React
- Javascript
- Python
- Go
- Unity
await contract.distribute();
await contract.distribute();
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. You can still use the contrat.Read and contract.Write functions to call functions directly.
Non-Native Token
- React
- Javascript
- Python
- Go
- Unity
// The address of the currency to distribute funds
const tokenAddress = "0x..."
await contract.distributeToken(tokenAddress);
// The address of the currency to distribute funds
const tokenAddress = "0x..."
await contract.distributeToken(tokenAddress);
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. You can still use the contrat.Read and contract.Write functions to call functions directly.
Withdraw Funds
- React
- Javascript
- Python
- Go
- Unity
// the wallet address that wants to withdraw their funds
const walletAddress = "{{wallet_address}}"
await contract.withdraw(walletAddress);
// the wallet address that wants to withdraw their funds
const walletAddress = "{{wallet_address}}"
await contract.withdraw(walletAddress);
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
// Split is not yet supported in Unity. You can still use the contrat.Read and contract.Write functions to call functions directly.