useTx
Props
Name
Type
Description
Return Type
Name
Type
Description
Basic Usage
import { useTx } from 'typink';
function RemarkExample() {
const remarkTx = useTx((tx) => tx.system.remark);
const handleSend = async () => {
await remarkTx.signAndSend({
args: ['Hello from Typink!'],
callback: (result) => {
console.log('Transaction status:', result.status.type);
},
});
};
return (
<button
onClick={handleSend}
disabled={remarkTx.inBestBlockProgress}>
{remarkTx.inBestBlockProgress ? 'Sending...' : 'Send Remark'}
</button>
);
}Last updated