bitcoin-php icon indicating copy to clipboard operation
bitcoin-php copied to clipboard

1 Page Transaction Builder

Open besoeasy opened this issue 5 years ago • 9 comments

there are lot of problems on windows with dependent lib, best way to implement below code in single page without any dependices.

require DIR . "/../vendor/autoload.php"; use BitWasp\Bitcoin\Address\AddressCreator; use BitWasp\Bitcoin\Transaction\TransactionFactory; $addrCreator = new AddressCreator(); $transaction = TransactionFactory::build() ->input('99fe5212e4e52e2d7b35ec0098ae37881a7adaf889a7d46683d3fbb473234c28', 0) ->payToAddress(29890000, $addrCreator->fromString('19SokJG7fgk8iTjemJ2obfMj14FM16nqzj')) ->payToAddress(100000, $addrCreator->fromString('1CzcTWMAgBNdU7K8Bjj6s6ezm2dAQfUU9a')) ->get(); echo $transaction->getHex() . PHP_EOL;

besoeasy avatar Jan 06 '19 19:01 besoeasy

Please copy/paste a snippet of the error, or at least tell me what dependency you have the trouble with.

You could put it together with strrev() and pack(), see https://en.bitcoin.it/wiki/Transaction / https://en.bitcoin.it/wiki/Protocol_documentation#tx

But really, just getting the library would be a hell of a lot easier!

afk11 avatar Jan 06 '19 21:01 afk11

can you please try to do it, as your system environment is already stetted up

it would be favour, leave me your btc address ill tip if it works.

besoeasy avatar Jan 06 '19 22:01 besoeasy

I don't understand why you don't just use the library, or tell me whats wrong with it?

afk11 avatar Jan 07 '19 02:01 afk11

link to your documentation broken, in simple how do we sig transaction from unspent inputs ?

besoeasy avatar Jan 17 '19 01:01 besoeasy

https://github.com/Bit-Wasp/bitcoin-php/blob/master/examples/tx.spend.p2wpkh.php Check out the other tx.spend* examples as well.

link to your documentation broken,

huh?

afk11 avatar Jan 17 '19 23:01 afk11

Documentation Check out the beginnings of the documentation for the library: [Introduction]

check this link its broken https://github.com/Bit-Wasp/bitcoin-php/blob/master/doc/Introduction.md

besoeasy avatar Jan 19 '19 23:01 besoeasy

My bad, I'll update the readme! I moved the one deeper recently https://github.com/Bit-Wasp/bitcoin-php/tree/master/doc/documentation

afk11 avatar Jan 20 '19 00:01 afk11

so how do we build a transaction using unspent inputs from here 👍

https://blockexplorer.com/api/addr/1JfHxhhZnkhZtPJrU2juLbyeokzHaaZcNT/utxo

sorry but your documentation is very complex !

besoeasy avatar Jan 25 '19 01:01 besoeasy

Sorry, don't have a lot of time to help. Did you get this working in the end?

afk11 avatar Mar 09 '20 15:03 afk11