Transaction to an address in string #440
-
Hello team, How to execute a simple transfer to an address in this format final BOB = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty'; without also having to grab infos like block hash, genesis... but just something in this style. What would be the best way or place to ask questions without having to open issues? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Hello @web3-sante, right now, that's not possible. We started this project last year and there is a lot to be done yet. We are first working on supporting everything Polkadot can do, after that when people can do everything (in a harder or easier way) then we will start to work in the helpers and things to reduce the boilerplates. Feel free to send PR's if you make something and would like to contribute. And for now, issues here are the best (and only place), so no worries. |
Beta Was this translation helpful? Give feedback.
-
Thanks @leonardocustodio for the reply. May be I asked the question the wrong way. Assuming we are on polkadot how one would do to make a transfer instead of transferAll , how to encode/decode the BOB address: 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty; so we can use it in Something like this: final BOB = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
final bobAddr = ..... // Encoded Decoded
final transfer = api.tx.balances.transfer(dest: bobAddr, value: BigInt.from(11111) );
it's noted asap something is done on my side. |
Beta Was this translation helpful? Give feedback.
-
Ah I see, I thought you wanted a For the above, it is pretty simple: import 'package:polkadart_example/generated/polkadot/polkadot.dart';
import 'package:ss58/ss58.dart';
import 'package:polkadart_example/generated/polkadot/types/sp_runtime/multiaddress/multi_address.dart';
final bob = Address.decode('5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty');
final runtimeCall = api.tx.balances.transfer(dest: MultiAddress.values.id(bob.pubkey), value: BigInt.from(1000000000000)); |
Beta Was this translation helpful? Give feedback.
-
Awesome @leonardocustodio Thanks 🙏 ! |
Beta Was this translation helpful? Give feedback.
-
I'm trying this
and get the following error |
Beta Was this translation helpful? Give feedback.
Ah I see, I thought you wanted a
signAndSend
method that would get the wallet from keyring, sign and send, without having to construct the SigningPayload and Extrinsic data.For the above, it is pretty simple: