const client = await Comet38Client.create(new HttpClient(process.env.OSMOSIS_NODE_URL!))
const queryClient = QueryClient.withExtensions(cometClient, setupAuthExtension)
const body: TxBodyEncodeObject = {
typeUrl: '/cosmos.tx.v1beta1.TxBody',
value: {
messages: [
{
typeUrl: '/cosmos.bank.v1beta1.MsgSend',
value: {
fromAddress: address,
toAddress: to,
amount: coins(1, 'uosmo'),
},
},
],
memo,
},
}
const account = await context.queryClient.auth.account(address)
const { sequence, accountNumber } = accountFromAny(account)
const authInfoBytes = makeAuthInfoBytes(
[
{
pubkey: encodePubkey(encodeSecp256k1Pubkey(Buffer.from(publicKey, 'hex'))),
sequence,
},
],
'100',
Int53.fromString(fee.gas).toNumber(),
undefined,
undefined
)
const signDoc = makeSignDoc(context.registry.encode(body), authInfoBytes, 'osmo-test-5', accountNumber)
const res = await dfnsClient.wallets.generateSignature({
walletId,
body: {
kind: 'SignDocDirect',
signDoc: `0x${Buffer.from(makeSignBytes(doc)).toString('hex')}`,
},
})