I need to programmatically pack an extrinsic for an RPC, I believe I'm looking for the following front-end functionality:
- extract relevant indices from the Metadata
- fill the extrinsic parameters
- properly Scale/hex encode it, be it signed or unsigned exactly as PolkadotJS app does. Something like this Rust code, but for the front-end: https://github.com/paritytech/polkadot-interaction-examples-rs/blob/main/src/bin/05_transfer_balance.rs
Please could anyone indicate me relevant packages in the PolkadotJS sources that do the job, maybe some code snippets that demonstrate the codification routine ?