Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction to an address in string #420

Closed
web3-sante opened this issue Feb 5, 2024 · 4 comments
Closed

Transaction to an address in string #420

web3-sante opened this issue Feb 5, 2024 · 4 comments

Comments

@web3-sante
Copy link

Hello team,
dumb question here:

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?

@leonardocustodio
Copy link
Owner

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.

@web3-sante
Copy link
Author

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.

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 api.tx.balances.transfer

Something like this:

final BOB = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
final bobAddr =  ..... // Encoded Decoded
final transfer = api.tx.balances.transfer(dest: bobAddr, value: BigInt.from(11111) );

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.

it's noted asap something is done on my side.

@leonardocustodio
Copy link
Owner

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:

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));

@web3-sante
Copy link
Author

Awesome @leonardocustodio Thanks 🙏 !

Repository owner locked and limited conversation to collaborators Mar 13, 2024
@leonardocustodio leonardocustodio converted this issue into discussion #440 Mar 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants