apps icon indicating copy to clipboard operation
apps copied to clipboard

Support "Send funds" on "Accounts" page using derives

Open gregdhill opened this issue 3 years ago • 6 comments

@jacogr would it be possible to also support "Send" using derives? The "Accounts" page currently crashes with the error api.consts.balances is undefined when I try to open the modal.

Originally posted by @gregdhill in https://github.com/polkadot-js/apps/issues/6744#issuecomment-1004929722

gregdhill avatar Jan 04 '22 16:01 gregdhill

Change the const check to api.consts.balances?.<whatever> and see if that at least makes it work. So would suggest making it work first (i.e. don't crash if stuff is not available) and then looking at trying to extract the constants/etc. via another mechanism.

If it is api.consts.balances.* it is most-probably the existential/etc constants.

jacogr avatar Jan 04 '22 16:01 jacogr

@jacogr I'll look into extracting the balance interactions into another mechanism, is derive suitable?

gregdhill avatar Jan 05 '22 11:01 gregdhill

I think atm that is the only option, i.e. it is the only place where JS code can be injected for use inside the apps UI.

jacogr avatar Jan 05 '22 11:01 jacogr

@jacogr this needs to be added to @polkadot/api-derive right? What's the best way to link to apps locally for a development build?

gregdhill avatar Jan 06 '22 14:01 gregdhill

I would suggest adding it locally (see eq equilibrium) - if more chains and broader support we can move it to api.

jacogr avatar Jan 06 '22 17:01 jacogr

@jacogr could you take a look at my draft PR? https://github.com/polkadot-js/apps/pull/6799

I'm new to RxJS so I'm not sure how best to integrate a custom call, getting the error TypeError: extrinsic.registry is undefined.

gregdhill avatar Jan 07 '22 14:01 gregdhill