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

Cannot create w2w transaction #33

Open
bluekirby1111 opened this issue Sep 19, 2022 · 0 comments
Open

Cannot create w2w transaction #33

bluekirby1111 opened this issue Sep 19, 2022 · 0 comments

Comments

@bluekirby1111
Copy link

I'm trying to create an data-empty transaction with target and quantity other than 0, a wallet 2 wallet transaction. Is this even supported? Is there a way of doing this?

Here is my attempt:

async fn main() {
    let path = PathBuf::from_str("wallet.json").unwrap();
    let arweave = 
        Arweave::from_keypair_path(path, Url::from_str("https://arweave.net").unwrap())
        .await
        .unwrap();
    
    let price_terms = arweave
        .get_price_terms(1.0)
        .await
        .unwrap();
    println!("{:?}", price_terms);
    
    let mut tx = arweave.create_transaction(vec![10], None, None, price_terms, false).await.unwrap();
    tx.target = Base64::from_str("PAgdonEn9f5xd-UbYdCX40Sj28eltQVnxz6bbUijeVY").unwrap();
    tx.quantity = 100000;
    dbg!(json!(&tx));


    let sig_tx = arweave
        .sign_transaction(tx)
        .unwrap();

    dbg!(json!(&sig_tx));
    
    let res = arweave
        .post_transaction(&sig_tx)
        .await;

    dbg!(res);
}

Apparently, the merkle generated when the target is present and quantity is different from zero is not being generated correctly.

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

No branches or pull requests

1 participant