Check out the sdk quickstart guide for help setting up your client.
Usage
import { downlinkClient } from './config'
const data = await downlinkClient.getChannelTokenPage({
channelAddress: '0x1234567890123456789012345678901234567890'
})
import { TransmissionsClient } from '@tx-kit/sdk'
import { BASE_MAINNET_SUBGRAPH_URL } from '@tx-kit/sdk/constants'
import { CreatePublicClient, CreateWalletClient } from 'viem'
import { base } from 'viem/chains'
const publicClient = createPublicClient({
chain: base,
transport: http()
})
const walletClient = createWalletClient({
account, // from local private key or browser wallet
chain: base,
transport: http()
})
export const { downlinkClient } = new TransmissionsClient({
publicClient,
walletClient,
chain: base,
apiConfig: {
serverUrl: BASE_MAINNET_SUBGRAPH_URL
}
})
Returns
IToken[]
type IToken = {
id: string
channelAddress: Address
tokenId: bigint
author: Address
sponsor: Address
uri: string
metadata: ITokenMetadata | null
totalMinted: bigint
maxSupply: bigint
blockNumber?: bigint
blockTimestamp?: bigint
}
Parameters
filters (optional)
- type:
Filters
type Filters = {
where?: GqlVariables
orderBy?: string
orderDirection?: string
pageSize?: number
skip?: number
}
// Fetch all channels with infinite transport layer type
const data = await downlinkClient.getChannelTokenPage({
channelAddress: contractAddress,
filters: {
pageSize: 100, // fetch 100 tokens
skip: 0, // skip 0 tokens
where: {
tokenId_not_in: ["0"] // ignore token zero
}
}
})