You can also pass your account and/or secret key into the initializer to avoid the need to pass them into each function call.
import dotenv from'dotenv';import { KaddexSdk } from'kaddex-sdk';dotenv.config();constPUBLIC_KEY=process.env.PUBLIC_KEY;constSECRET_KEY=process.env.SECRET_KEY;// if your account name is different from your PUBLIC_KEY, use the correct value hereconstaccount=awaitretrieveVerifiedAccount({ accountName:PUBLIC_KEY });constkaddex=newKaddexSdk({ account, secretKey:SECRET_KEY });awaitkaddex.swap({ ... });
A client instance includes all the core methods you'll need for interacting with the swap.