Uplink client
createInfiniteChannel
Create a new infinite channel
Check out the sdk quickstart guide for help setting up your client.
Usage
Returns
{
contractAddress: Address, // address of the created channel
event: Log
}
Parameters
uri
- type:
string
The metadata URI of the channel
const { contractAddress } = await uplinkClient.createInfiniteChannel({
uri: 'ipfs://xyz',
...
})
name
- type:
string
The name of the channel
const { contractAddress } = await uplinkClient.createInfiniteChannel({
name: 'My new channel',
...
})
defaultAdmin
- type:
string
The address of the default admin. Admins can update channel metadata, fees, and logic and add or remove managers.
const { contractAddress } = await uplinkClient.createInfiniteChannel({
defaultAdmin: '0xedcC867bc8B5FEBd0459af17a6f134F41f422f0C',
...
})
managers
- type:
string[]
An array of manager addresses. Managers can update channel metadata, fees, and logic.
const { contractAddress } = await uplinkClient.createInfiniteChannel({
managers: ['0x1234567890123456789012345678901234567890'],
...
})
setupActions
- type:
SetupAction[]
An array of channel fee and logic configurations
const { contractAddress } = await uplinkClient.createInfiniteChannel({
setupActions: [
{
feeContract: CUSTOM_FEES,
feeArgs: {
channelTreasury: '0x1234567890123456789012345678901234567890',
uplinkPercentage: 10,
channelPercentage: 15,
creatorPercentage: 60,
mintReferralPercentage: 5,
sponsorPercentage: 10,
ethMintPrice: parseEther('0.000666'),
erc20MintPrice: parseEther('0.000666'),
erc20Contract: baseSepoliaWETH
}
},
{
logicContract: DYNAMIC_LOGIC,
creatorLogic: [new UniformInteractionPower(BigInt(10)).ifResultOf(baseSepoliaWETH, '0x70a08231', erc20BalanceOfData).gt(BigInt(1))],
minterLogic: [new UniformInteractionPower(BigInt(10)).ifResultOf(baseSepoliaWETH, '0x70a08231', erc20BalanceOfData).gt(BigInt(1))]
}
],
...
})
transportLayer
- type:
InfiniteTransportLayer
The transport layer configuration. Set the sale duration for each new token.
const { contractAddress } = await uplinkClient.createInfiniteChannel({
transportLayer: {
saleDurationInSeconds: 100
},
...
})
transactionOverrides (optional)
- type:
TransactionOverrides
type TransactionOverrides = {
accessList?: AccessList
gas?: bigint
maxFeePerGas?: bigint
maxPriorityFeePerGas?: bigint
nonce?: number
value?: bigint
}
Overrides for the transaction
const { contractAddress } = await uplinkClient.createInfiniteChannel({
...
transactionOverrides: {
gas: 1000000n
}
})
Calldata
generate calldata for the transaction
const { address, data } = await uplinkClient.calldata.createInfiniteChannel({...})
Returns
{
address: string, // address of the target contract
data: string // calldata for the transaction
}
Gas Estimation
Estimate gas for the transaction
const gas = await uplinkClient.estimateGas.createInfiniteChannel({...})
Returns
bigint // gas estimate in wei