import { Asset, BASE_FEE, Horizon, Networks, Operation, TransactionBuilder } from '@stellar/stellar-sdk'
const walletId = 'wa-6lbfv-9esgj-xxxxxxxxxxxxxxxx'
const wallet = await dfnsClient.wallets.getWallet({ walletId })
const provider = new Horizon.Server(process.env.HORIZON_API_URL!)
const account = await provider.loadAccount(senderWallet.address)
const transaction = new TransactionBuilder(account, {
fee: BASE_FEE,
networkPassphrase: Networks.TESTNET,
})
.addOperation(
Operation.payment({
destination: 'GAZWLHTNAOJWW52GZCUJAS5MSXK7LAWCUC5TFOFFVDQ7CDTNFODJ37GB',
asset: Asset.native(),
amount: '1',
})
)
.setTimeout(180)
.build()
const res = await dfnsClient.wallets.generateSignature({
walletId,
body: {
kind: 'Transaction',
transaction: `0x${transaction.toEnvelope().toXDR('hex')}`,
},
})