You should never have to create DEX transactions yourself. However, the documentation below gives a rundown on how you can obtain information for your swap transactions, as well as listen for specific events through the Tx lifecycle.
payments(): PayToAddress[]
Get the address payments made for the Tx
console.log(transaction.payments);
status(): TransactionStatus
Get the current status of the transaction
console.log(transaction.status);
onBuilding(TransactionCallback): DexTransaction
Tx is in building status
transaction.onBuilding(() => {
console.log('Tx building');
});
onSigning(TransactionCallback): DexTransaction
Tx is in signing status
transaction.onSigning(() => {
console.log('Tx signing');
});
onSubmitting(TransactionCallback): DexTransaction
Tx is in submitting status
transaction.onSubmitting(() => {
console.log('Tx submitting to chain');
});
onSubmitted(TransactionCallback): DexTransaction
Tx has been submitted on-chain
transaction.onSubmitted(() => {
console.log('Tx submitted');
});
onError(TransactionCallback): DexTransaction
Error has occurred with the transaction
transaction.onError(() => {
console.log('Something went wrong');
});