Skip to content
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

Create multiTx function #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Create multiTx function #18

wants to merge 1 commit into from

Conversation

atmoner
Copy link

@atmoner atmoner commented Jun 12, 2021

I added a function that allows sending multi tx in a single block.
Here's how to use it:

data_input is send
data_output is the one who receives

data_input = [{'address': 'cosmos1dwkhyqsgr6mxa2qf70rv5mpdch9vr345tsmlpm'
              , 'coins': [{'amount': '100000', 'denom': 'uatom'}]},
              {'address': 'cosmos1dwkhyqsgr6mxa2qf70rv5mpdch9vr345tsmlpm'
              , 'coins': [{'amount': '100000', 'denom': 'uatom'}]}]

data_output = [{'address': 'cosmos19xxs503q3xe6p20tngk4qa8shlp479739sly2z'
               , 'coins': [{'amount': '100000', 'denom': 'uatom'}]},
               {'address': 'cosmos1t8yky3wexwncwsdqvdet2e9l4drw69cwcgw3f0'
               , 'coins': [{'amount': '100000', 'denom': 'uatom'}]}]

tx.add_multi_transfer(data_inputF=data_input, data_outputF=data_output)

@hukkin
Copy link
Owner

hukkin commented Jun 14, 2021

Thanks for the PR!

The API already supports one type of one-to-many transaction via calling .add_transfer() more than once. So I'm not sure if adding this PR would allow any new use case. Where the MsgMultiSend type would be truly useful is sending from different input addresses (many-to-many type of transaction) but this PR in its current state doesn't allow that.

Also, a test would be needed for any added functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants