import { OneSwap } from '@oneswap/sdk'
const apiKey = 'os_live_...'
const partyId = 'alice::12205a8c...'
const authClient = new OneSwap({ apiKey })
const challenge = await authClient.walletAuth.requestChallenge(partyId)
const signature = await wallet.signMessage(challenge.message)
const verified = await authClient.walletAuth.verifyChallenge({
partyId,
nonce: challenge.nonce,
signature,
publicKey: wallet.publicKey,
})
const client = new OneSwap({
apiKey,
walletToken: verified.token,
})
const swap = await client.swaps.create({
fromToken: 'Amulet',
toToken: 'USDCx',
amount: '100',
walletAddress: partyId,
})