Skip to content

withPublicClient

Override the configuration of default PublicClient with a custom configuration.

Usage

example.ts
import { mintclub } from 'mint.club-v2-sdk';
 
await mintclub
  .withPublicClient({ 
    chain: 'rick-morty-chain', 
    transport: http('https://rnm-mainnet.g.alchemy.com/v2/...') 
    ...
  }) 
  .token('MINT')
  .create({
    name: 'Mint Club',
    reserveToken: {
      address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // mainnet WETH token address
      decimals: 18,
    },
	curveData: {
		curveType: 'LINEAR',
		stepCount: 10,
		maxSupply: 10_000,
		initialMintingPrice: 0.01, // 0.01 WETH
		finalMintingPrice: 0.1, // 0.1 WETH
		creatorAllocation: 100,
	}
  })

Return Value

network

Returns the network instance, so you chain functions such as token and nft.

Parameters

PublicClient