availproject / avail

775 stars 536 forks source link

Use polkadart lib to sendTransfer failed, but same logic work on polkadot, kusama, westend. any diff from avail? #486

Closed gtmickey closed 7 months ago

gtmickey commented 7 months ago

posted detail on https://github.com/leonardocustodio/polkadart/issues/444

Leouarz commented 7 months ago

Hey, our chains have specific custom types because we changed header and other types. You can check how to initialize an instance of polka api here : https://github.com/availproject/avail/blob/main/avail-js/src/chain/index.ts#L20 And you can see a working example here : https://github.com/availproject/avail/blob/main/avail-js/examples/node-examples/src/transfer.ts

You can try with a local node.

gtmickey commented 7 months ago

thanks for quick reply, I had try js version, it works well, could you tell me what specific custom types has changed?

btw, other issue is that:

when I call rpc method: payment_queryFeeDetails with 'wss://goldberg.avail.tools/ws' node it always returns null, any idea?

gtmickey commented 7 months ago

is it related to metaData chainInfo? extrinsic = "4d028400ba264b7c2da1e38e85f2fbff19a75cd21536bdadabf57839f8c9bd2e074dff3f0160f0de260b8bc6876ce32bf1c6a359170fabbc5b8591762d57149fffd50db433d412901c94c609937ab258ecd40011fa8a59fb529756743e1a92b7acf1a14186f5031000060300ca9b88baf306fc2f4e611fe23ce42ed79fdcea035c6c0807014972e8d973e6611300000c3d5d53aa01"

If decode this extrinsic use avail's metadata chainInfo, it will failed. but If decode it use polkadot's metadata chainInfo it works, also other substrate's base chain.