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

Order issue returning false. #2

Closed
lightwalkernet opened this issue Jun 6, 2019 · 4 comments
Closed

Order issue returning false. #2

lightwalkernet opened this issue Jun 6, 2019 · 4 comments

Comments

@lightwalkernet
Copy link

Thank you for sharing this package.

I can seem to get the txOrder to work.

I most likely have got the sequence for transmitting an order incorrect. Can you point me in the right direction.

`require DIR . '/../vendor/autoload.php';
use deemru\WavesKit;

$wk = new WavesKit();
$wk->setPrivatekey('REDACTED_BUT_CORRECT');
$order = $wk->txOrder ('Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck', 'BiHyoWW3M3AjbU1pE5t1hNrJG5KtmtFvD43UDpqRyyzh', false, 25, 100, 10 * 60 );
$signed = $wk->txSign($order);
$return = $wk->txOrderBroadcast($signed);
var_dump($signed);
var_dump($return);`

Here is the output:

array(13) { ["version"]=> int(2) ["sender"]=> string(35) "3PGmcbDUGaTtxMSv1HsCmVSbAQkj7CagQ3a" ["senderPublicKey"]=> string(43) "8VAwR7Tpd9h189YGJQHJwWFxCGU31qvuZCAbSTY45qb" ["matcherPublicKey"]=> string(44) "7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy" ["assetPair"]=> array(2) { ["amountAsset"]=> string(44) "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck" ["priceAsset"]=> string(44) "BiHyoWW3M3AjbU1pE5t1hNrJG5KtmtFvD43UDpqRyyzh" } ["orderType"]=> string(3) "buy" ["amount"]=> int(25) ["price"]=> int(100) ["matcherFee"]=> int(300000) ["timestamp"]=> int(1559810103668) ["expiration"]=> int(1559810104268) ["id"]=> string(44) "C3kQxnhnbzwJwV5bLjbHMGAnUTP1hdoVhgx7SXASnReA" ["proofs"]=> array(1) { [0]=> string(87) "Nfy7Fqt2B8XiuhHhE4zs8CqhscS3C75vmpkEo4yeMxHru2vdjY5AAMHEXkrpgc3iZh6NfnPwtCQXhe3Wy1Bpbhr" } } bool(false))

@deemru
Copy link
Owner

deemru commented Jun 7, 2019

You should set explicitly:

$wk->setNodeAddress( 'https://matcher.wavesplatform.com' );

@lightwalkernet
Copy link
Author

Thanks. Great help. I am able to broadcast the order as I can see it in the matcher/orderbook. however the txOrderBroadcast() method return false even on a successful order.

This seems to be occurring in the fetch method here.

if( false !== $fetch ) { if( !$post ) $this->setNodeCache( $url, $fetch ); return $fetch; }

Am I missing something?

Thanks again for your help.

@deemru
Copy link
Owner

deemru commented Jun 14, 2019

  • cannot reproduce
  • check your WavesKit version, should be at least 1.0.10
  • provide a full example to reproduce your error

This seems to be occurring in the fetch method here.

if( false !== $fetch ) { if( !$post ) $this->setNodeCache( $url, $fetch ); return $fetch; }

Am I missing something?

This code cannot return false in our universe.

@lightwalkernet
Copy link
Author

Sorry. Working perfectly now. Must have been my mistake. New install and all is well. Thank you for an amazing package.

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

2 participants