oipwg / insight-explorer

Easily retreive information about transactions and addresses from any insight api explorer
MIT License
1 stars 6 forks source link

broadcast response 404 #2

Closed mcfang closed 5 years ago

mcfang commented 5 years ago

Hi, i want to create a flo Transaction and broadcast. Here is my code. When i request the broadcastRawTransaction() method, response Error:

Unable to broadcastRawTransaction: 400 Bad Request | Verification failure: dust (code=nonstandard score=0 hash=ab3e3fd09b2ea79ae588e6759b84008fa01d488b2dcab8f9f119397c00a3d7da). Code:-32603

How to fix the problem? Here is my code.

mcfang commented 5 years ago

const ExplprerWallet = require('js-oip/lib/modules/wallets/ExplorerWallet').default; const Insight = require('insight-explorer').Insight let explorer = new Insight("https://livenet.flocha.in/api") let wif = 'REY4ZqznnrjiiUGHbyj9FRYqW1bPQb8tQdGP6W64HFFJdbN927sE' let address = "FBjBWwd4Bm8MAYdJqqLB2pvDXzP1AomBXK"; const explprerWallet = new ExplprerWallet({ network: 'mainnet', wif: wif }); let output = { address: "FKXpmwKdTnMrQQBVhBRLpMbQy7PqiicYgV", value: 1 } explprerWallet.buildTXHex("", output).then(hex => { console.log("hex----"+hex); });

//hex = '02000000019bfb6196f7b080c44c9953de224e8a1c4efb2029503c19cfc4a39eede350acd9000000006a47304402201882f6dc2bc46c74594aae271447fd9b124be2e5294c49c0ba421a340de79932022027c80e86f6d2d5c4f619ebbd81f939a45707432791161cef5c340dbb7fcf13fc0121024f5374c77ad80945578b1894246798d3ef6abdacba254c0b5b937d3d8b331bb4ffffffff0201000000000000001976a914964cc27f77366fcd03166c0127f004ac126a026888ac35ea8abd000000001976a91440b1a4a6fc7c8b88ef2a1beac1fe3de118e8d08888ac0000000000';

explorer.broadcastRawTransaction(hex).then(txid => { console.log(txid); });

mcfang commented 5 years ago

let output = { address: "FKXpmwKdTnMrQQBVhBRLpMbQy7PqiicYgV", value: 1 } explprerWallet.sendTx(output, floData = "").then(txid => { console.log(txid); });

use sendTx() method , still response 'Unable to broadcastRawTransaction: 400 Bad Request'

mcfang commented 5 years ago

I change the output value from 1 to 1e8, and broadcast success.